forked from eclipse-edc/DataDashboard
-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: asset page, create asset, delete asset now use UI API Wrapper (#…
…430)
- Loading branch information
1 parent
cf7098d
commit c358d6c
Showing
16 changed files
with
122 additions
and
95 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,39 @@ | ||
[ | ||
{ | ||
"properties": { | ||
"asset:prop:id": "urn:artifact:db-rail-network-2023-jan", | ||
"asset:prop:name": "Rail Network DB 2023 January", | ||
"asset:prop:version": "1.1", | ||
"asset:prop:originator": "https://example-connector.rail-mgmt.bahn.de/api/v1/ids/data", | ||
"asset:prop:originatorOrganization": "Deutsche Bahn AG", | ||
"asset:prop:keywords": "db, bahn, rail, Rail-Designer", | ||
"asset:prop:contenttype": "application/json", | ||
"asset:prop:description": "Train Network Map released on 10.01.2023, valid until 31.02.2023. \nFile format is xyz as exported by Rail-Designer.", | ||
"asset:prop:language": "https://w3id.org/idsa/code/EN", | ||
"asset:prop:publisher": "https://my.cool-api.gg/about", | ||
"asset:prop:standardLicense": "https://my.cool-api.gg/license", | ||
"asset:prop:endpointDocumentation": "https://my.cool-api.gg/docs", | ||
"http://w3id.org/mds#dataCategory": "Infrastructure and Logistics", | ||
"http://w3id.org/mds#dataSubcategory": "General Information About Planning Of Routes", | ||
"http://w3id.org/mds#dataModel": "my-data-model-001", | ||
"http://w3id.org/mds#geoReferenceMethod": "my-geo-reference-method", | ||
"http://w3id.org/mds#transportMode": "Rail", | ||
"asset:prop:some-unsupported-property": "F10E2821BBBEA527EA02200352313BC059445190" | ||
{ | ||
"assets": [ | ||
{ | ||
"properties": { | ||
"asset:prop:id": "urn:artifact:db-rail-network-2023-jan", | ||
"asset:prop:name": "Rail Network DB 2023 January", | ||
"asset:prop:version": "1.1", | ||
"asset:prop:originator": "https://example-connector.rail-mgmt.bahn.de/api/v1/ids/data", | ||
"asset:prop:originatorOrganization": "Deutsche Bahn AG", | ||
"asset:prop:keywords": "db, bahn, rail, Rail-Designer", | ||
"asset:prop:contenttype": "application/json", | ||
"asset:prop:description": "Train Network Map released on 10.01.2023, valid until 31.02.2023. \nFile format is xyz as exported by Rail-Designer.", | ||
"asset:prop:language": "https://w3id.org/idsa/code/EN", | ||
"asset:prop:publisher": "https://my.cool-api.gg/about", | ||
"asset:prop:standardLicense": "https://my.cool-api.gg/license", | ||
"asset:prop:endpointDocumentation": "https://my.cool-api.gg/docs", | ||
"http://w3id.org/mds#dataCategory": "Infrastructure and Logistics", | ||
"http://w3id.org/mds#dataSubcategory": "General Information About Planning Of Routes", | ||
"http://w3id.org/mds#dataModel": "my-data-model-001", | ||
"http://w3id.org/mds#geoReferenceMethod": "my-geo-reference-method", | ||
"http://w3id.org/mds#transportMode": "Rail", | ||
"asset:prop:some-unsupported-property": "test" | ||
}, | ||
"privateProperties": {} | ||
}, | ||
{ | ||
"properties": { | ||
"asset:prop:id": "urn:artifact:bitcoin-data", | ||
"asset:prop:name": "Bitcoin Data", | ||
"asset:prop:contenttype": "application/json", | ||
"asset:prop:description": "description", | ||
"asset:prop:version": "1.0", | ||
"asset:prop:type": "HttpData", | ||
"asset:prop:originator": "https://sovity-001.stage-sovity.azure.sovity.io/control/api/v1/ids/data" | ||
}, | ||
"privateProperties": {} | ||
} | ||
}, | ||
{ | ||
"properties": { | ||
"asset:prop:id": "urn:artifact:bitcoin-data", | ||
"asset:prop:name": "Bitcoin Data", | ||
"asset:prop:contenttype": "application/json", | ||
"asset:prop:description": "description", | ||
"asset:prop:version": "1.0", | ||
"asset:prop:type": "HttpData", | ||
"asset:prop:originator": "https://sovity-001.stage-sovity.azure.sovity.io/control/api/v1/ids/data" | ||
} | ||
} | ||
] | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,31 @@ | ||
import {Injectable} from '@angular/core'; | ||
import {AssetEditorDialogFormValue} from '../../routes/connector-ui/asset-page/asset-create-dialog/asset-editor-dialog-form-model'; | ||
import {AssetEntryDto} from './api/legacy-managent-api-client'; | ||
import {AssetCreateRequest} from '@sovity.de/edc-client/dist/generated/models/AssetCreateRequest'; | ||
import { | ||
AssetEditorDialogFormValue | ||
} from '../../routes/connector-ui/asset-page/asset-create-dialog/asset-editor-dialog-form-model'; | ||
import {AssetPropertyMapper} from './asset-property-mapper'; | ||
import {DataAddressMapper} from './data-address-mapper'; | ||
|
||
|
||
@Injectable() | ||
export class AssetEntryBuilder { | ||
constructor( | ||
private assetPropertyMapper: AssetPropertyMapper, | ||
private dataAddressMapper: DataAddressMapper, | ||
) {} | ||
) { | ||
} | ||
|
||
/** | ||
* Build {@link AssetEntryDto} from {@link AssetEditorDialogFormValue} | ||
* Build {@link AssetCreateRequest} from {@link AssetEditorDialogFormValue} | ||
* | ||
* @param formValue form value | ||
* @return asset create dto | ||
*/ | ||
buildAssetEntry(formValue: AssetEditorDialogFormValue): AssetEntryDto { | ||
buildAssetCreateRequest(formValue: AssetEditorDialogFormValue): AssetCreateRequest { | ||
let properties = this.assetPropertyMapper.buildProperties(formValue); | ||
const dataAddress = this.dataAddressMapper.buildDataAddressProperties( | ||
const dataAddressProperties = this.dataAddressMapper.buildDataAddressProperties( | ||
formValue.datasource, | ||
); | ||
return {asset: {properties}, dataAddress}; | ||
return {properties, dataAddressProperties, privateProperties: {}}; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.