diff --git a/CHANGELOG.md b/CHANGELOG.md index ea2dfe10f..25d6111cc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,8 @@ the detailed section referring to by linking pull requests or issues. #### Major +- Internationalize the UI and add a German localization + #### Minor #### Patch diff --git a/NOTICE b/NOTICE new file mode 100644 index 000000000..11716f93b --- /dev/null +++ b/NOTICE @@ -0,0 +1,11 @@ +sovity EDC UI +Copyright (c) 2024. sovity GmbH + +This product includes software developed at sovity GmbH (https://www.sovity.de). +Copyright (c) 2024. sovity GmbH + +The initial internationalization of the EDC UI and localization to German was done +by the Fraunhofer Institute for Applied Information Technology FIT (https://www.fit.fraunhofer.de/). +This project was part of the national flagship project "Datenraum Kultur" and was funded +by the Federal Government Commissioner for Culture and the Media from 2023 to 2025. +Copyright (c) 2024. Fraunhofer Institute for Applied Information Technology FIT diff --git a/package-lock.json b/package-lock.json index 7536bfc4f..4c553d9c6 100644 --- a/package-lock.json +++ b/package-lock.json @@ -21,6 +21,8 @@ "@angular/platform-browser-dynamic": "^14.3.0", "@angular/router": "^14.3.0", "@ng-apimock/core": "^3.11.0", + "@ngx-translate/core": "^14.0.0", + "@ngx-translate/http-loader": "^7.0.0", "@ngxs/store": "^3.8.1", "@sovity.de/edc-client": "10.4.0", "clean-deep": "^3.4.0", @@ -3351,6 +3353,31 @@ "webpack": "^5.54.0" } }, + "node_modules/@ngx-translate/core": { + "version": "14.0.0", + "resolved": "https://registry.npmjs.org/@ngx-translate/core/-/core-14.0.0.tgz", + "integrity": "sha512-UevdwNCXMRCdJv//0kC8h2eSfmi02r29xeE8E9gJ1Al4D4jEJ7eiLPdjslTMc21oJNGguqqWeEVjf64SFtvw2w==", + "dependencies": { + "tslib": "^2.3.0" + }, + "peerDependencies": { + "@angular/core": ">=13.0.0", + "rxjs": "^6.5.3 || ^7.4.0" + } + }, + "node_modules/@ngx-translate/http-loader": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/@ngx-translate/http-loader/-/http-loader-7.0.0.tgz", + "integrity": "sha512-j+NpXXlcGVdyUNyY/qsJrqqeAdJdizCd+GKh3usXExSqy1aE9866jlAIL+xrfDU4w+LiMoma5pgE4emvFebZmA==", + "dependencies": { + "tslib": "^2.3.0" + }, + "peerDependencies": { + "@angular/common": ">=13.0.0", + "@ngx-translate/core": ">=14.0.0", + "rxjs": "^6.5.3 || ^7.4.0" + } + }, "node_modules/@ngxs/store": { "version": "3.8.1", "resolved": "https://registry.npmjs.org/@ngxs/store/-/store-3.8.1.tgz", @@ -16478,6 +16505,22 @@ "dev": true, "requires": {} }, + "@ngx-translate/core": { + "version": "14.0.0", + "resolved": "https://registry.npmjs.org/@ngx-translate/core/-/core-14.0.0.tgz", + "integrity": "sha512-UevdwNCXMRCdJv//0kC8h2eSfmi02r29xeE8E9gJ1Al4D4jEJ7eiLPdjslTMc21oJNGguqqWeEVjf64SFtvw2w==", + "requires": { + "tslib": "^2.3.0" + } + }, + "@ngx-translate/http-loader": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/@ngx-translate/http-loader/-/http-loader-7.0.0.tgz", + "integrity": "sha512-j+NpXXlcGVdyUNyY/qsJrqqeAdJdizCd+GKh3usXExSqy1aE9866jlAIL+xrfDU4w+LiMoma5pgE4emvFebZmA==", + "requires": { + "tslib": "^2.3.0" + } + }, "@ngxs/store": { "version": "3.8.1", "resolved": "https://registry.npmjs.org/@ngxs/store/-/store-3.8.1.tgz", diff --git a/package.json b/package.json index d89783691..cc540581f 100644 --- a/package.json +++ b/package.json @@ -27,6 +27,8 @@ "@angular/platform-browser-dynamic": "^14.3.0", "@angular/router": "^14.3.0", "@ng-apimock/core": "^3.11.0", + "@ngx-translate/core": "^14.0.0", + "@ngx-translate/http-loader": "^7.0.0", "@ngxs/store": "^3.8.1", "@sovity.de/edc-client": "10.4.0", "clean-deep": "^3.4.0", diff --git a/src/app/app-routing.module.ts b/src/app/app-routing.module.ts index 4582103ee..87c2d65f6 100644 --- a/src/app/app-routing.module.ts +++ b/src/app/app-routing.module.ts @@ -1,7 +1,7 @@ import {NgModule} from '@angular/core'; import {ROUTES, RouterModule, Routes} from '@angular/router'; -import {PageNotFoundComponent} from './component-library/error-404-component/page-not-found.component'; import {APP_CONFIG, AppConfig} from './core/config/app-config'; +import {PageNotFoundPageComponent} from './routes/connector-ui/page-not-found-page/page-not-found-page.component'; @NgModule({ imports: [RouterModule.forRoot([], {paramsInheritanceStrategy: 'always'})], @@ -27,7 +27,7 @@ import {APP_CONFIG, AppConfig} from './core/config/app-config'; default: throw new Error(`Unhandled PageSet: ${config.routes}`); } - routes.push({path: '**', component: PageNotFoundComponent}); + routes.push({path: '**', component: PageNotFoundPageComponent}); return routes; }, }, diff --git a/src/app/app.module.ts b/src/app/app.module.ts index 7c92fe1c0..c166dc256 100644 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -1,15 +1,22 @@ -import {HTTP_INTERCEPTORS, HttpClientModule} from '@angular/common/http'; +import { + HTTP_INTERCEPTORS, + HttpClient, + HttpClientModule, +} from '@angular/common/http'; import {NgModule} from '@angular/core'; import {BrowserModule} from '@angular/platform-browser'; import {BrowserAnimationsModule} from '@angular/platform-browser/animations'; +import {TitleStrategy} from '@angular/router'; +import {TranslateLoader, TranslateModule} from '@ngx-translate/core'; +import {TranslateHttpLoader} from '@ngx-translate/http-loader'; import {NgxsModule} from '@ngxs/store'; import {NgChartsModule} from 'ng2-charts'; import {AppRoutingModule} from './app-routing.module'; import {AppComponent} from './app.component'; -import {PageNotFoundComponent} from './component-library/error-404-component/page-not-found.component'; import {provideAppConfig} from './core/config/app-config-initializer'; import {ApiKeyInterceptor} from './core/services/api/api-key.interceptor'; -import {SharedModule} from './shared.module'; +import {CustomPageTitleStrategy} from './core/services/page-title-strategy'; +import {SharedModule} from './shared/shared.module'; @NgModule({ imports: [ @@ -18,7 +25,14 @@ import {SharedModule} from './shared.module'; BrowserModule, HttpClientModule, - SharedModule, + //Translation + TranslateModule.forRoot({ + loader: { + provide: TranslateLoader, + useFactory: (http: HttpClient) => new TranslateHttpLoader(http), + deps: [HttpClient], + }, + }), // NgXs NgxsModule.forRoot([]), @@ -26,15 +40,21 @@ import {SharedModule} from './shared.module'; // Third Party NgChartsModule.forRoot(), + // Features + SharedModule, + // Routing AppRoutingModule, ], - declarations: [AppComponent, PageNotFoundComponent], + declarations: [AppComponent], providers: [ + HttpClient, provideAppConfig(), {provide: HTTP_INTERCEPTORS, multi: true, useClass: ApiKeyInterceptor}, + {provide: TitleStrategy, useClass: CustomPageTitleStrategy}, ], bootstrap: [AppComponent], + exports: [TranslateModule], }) export class AppModule {} diff --git a/src/app/component-library/catalog/catalog.module.ts b/src/app/component-library/catalog/catalog.module.ts deleted file mode 100644 index aa501591f..000000000 --- a/src/app/component-library/catalog/catalog.module.ts +++ /dev/null @@ -1,84 +0,0 @@ -import {CommonModule} from '@angular/common'; -import {NgModule} from '@angular/core'; -import {MatButtonModule} from '@angular/material/button'; -import {MatCardModule} from '@angular/material/card'; -import {MatChipsModule} from '@angular/material/chips'; -import {MatDialogModule} from '@angular/material/dialog'; -import {MatIconModule} from '@angular/material/icon'; -import {MatProgressBarModule} from '@angular/material/progress-bar'; -import {MatProgressSpinnerModule} from '@angular/material/progress-spinner'; -import {MatTooltipModule} from '@angular/material/tooltip'; -import {ConditionsForUseDialogModule} from '../conditions-for-use-dialog/conditions-for-use-dialog.module'; -import {InitiateNegotiationConfirmTosDialogModule} from '../initiate-negotiation-confirm-tos-dialog/initiate-negotiation-confirm-tos-dialog.module'; -import {JsonDialogModule} from '../json-dialog/json-dialog.module'; -import {MarkdownDescriptionModule} from '../markdown-description/markdown-description.module'; -import {PipesAndDirectivesModule} from '../pipes-and-directives/pipes-and-directives.module'; -import {PropertyGridModule} from '../property-grid/property-grid.module'; -import {UiElementsModule} from '../ui-elements/ui-elements.module'; -import {UrlListDialogModule} from '../url-list-dialog/url-list-dialog.module'; -import {AssetCardTagListComponent} from './asset-card-tag-list/asset-card-tag-list.component'; -import {AssetDetailDialogDataService} from './asset-detail-dialog/asset-detail-dialog-data.service'; -import {AssetDetailDialogComponent} from './asset-detail-dialog/asset-detail-dialog.component'; -import {AssetDetailDialogService} from './asset-detail-dialog/asset-detail-dialog.service'; -import {AssetPropertyGridGroupBuilder} from './asset-detail-dialog/asset-property-grid-group-builder'; -import {PolicyPropertyFieldBuilder} from './asset-detail-dialog/policy-property-field-builder'; -import {ContractOfferIconComponent} from './contract-offer-icon/contract-offer-icon.component'; -import {ContractOfferMiniListComponent} from './contract-offer-mini-list/contract-offer-mini-list.component'; -import {DataOfferCardsComponent} from './data-offer-cards/data-offer-cards.component'; -import {TransferHistoryMiniListComponent} from './transfer-history-mini-list/transfer-history-mini-list.component'; -import {TruncatedShortDescription} from './truncated-short-description/truncated-short-description.component'; - -@NgModule({ - imports: [ - // Angular - CommonModule, - - // Angular Material - MatButtonModule, - MatCardModule, - MatChipsModule, - MatIconModule, - MatProgressBarModule, - MatProgressSpinnerModule, - MatDialogModule, - MatTooltipModule, - MatIconModule, - MatChipsModule, - - // Features - JsonDialogModule, - UrlListDialogModule, - ConditionsForUseDialogModule, - PropertyGridModule, - UiElementsModule, - PipesAndDirectivesModule, - MarkdownDescriptionModule, - - InitiateNegotiationConfirmTosDialogModule, - ], - declarations: [ - AssetDetailDialogComponent, - ContractOfferIconComponent, - ContractOfferMiniListComponent, - DataOfferCardsComponent, - TransferHistoryMiniListComponent, - TruncatedShortDescription, - AssetCardTagListComponent, - ], - exports: [ - AssetDetailDialogComponent, - ContractOfferIconComponent, - ContractOfferMiniListComponent, - DataOfferCardsComponent, - TransferHistoryMiniListComponent, - TruncatedShortDescription, - AssetCardTagListComponent, - ], - providers: [ - AssetPropertyGridGroupBuilder, - AssetDetailDialogDataService, - AssetDetailDialogService, - PolicyPropertyFieldBuilder, - ], -}) -export class CatalogModule {} diff --git a/src/app/component-library/catalog/truncated-short-description/truncated-short-description.component.html b/src/app/component-library/catalog/truncated-short-description/truncated-short-description.component.html deleted file mode 100644 index d3fba5099..000000000 --- a/src/app/component-library/catalog/truncated-short-description/truncated-short-description.component.html +++ /dev/null @@ -1 +0,0 @@ -{{ text || 'No description.' }} diff --git a/src/app/component-library/conditions-for-use-dialog/conditions-for-use-dialog.module.ts b/src/app/component-library/conditions-for-use-dialog/conditions-for-use-dialog.module.ts deleted file mode 100644 index c6fb402ac..000000000 --- a/src/app/component-library/conditions-for-use-dialog/conditions-for-use-dialog.module.ts +++ /dev/null @@ -1,39 +0,0 @@ -import {CommonModule} from '@angular/common'; -import {NgModule} from '@angular/core'; -import {FormsModule} from '@angular/forms'; -import {MatButtonModule} from '@angular/material/button'; -import {MatCardModule} from '@angular/material/card'; -import {MatDialogModule} from '@angular/material/dialog'; -import {MatIconModule} from '@angular/material/icon'; -import {NgxJsonViewerModule} from 'ngx-json-viewer'; -import {ConfirmationDialogModule} from '../confirmation-dialog/confirmation-dialog.module'; -import {MarkdownDescriptionModule} from '../markdown-description/markdown-description.module'; -import {PipesAndDirectivesModule} from '../pipes-and-directives/pipes-and-directives.module'; -import {ConditionsForUseDialogComponent} from './conditions-for-use-dialog/conditions-for-use-dialog.component'; -import {ConditionsForUseDialogService} from './conditions-for-use-dialog/conditions-for-use-dialog.service'; - -@NgModule({ - imports: [ - // Angular - CommonModule, - FormsModule, - - // Angular Material - MatButtonModule, - MatCardModule, - MatDialogModule, - MatIconModule, - - // Third Party - NgxJsonViewerModule, - - // EDC UI Modules - PipesAndDirectivesModule, - ConfirmationDialogModule, - MarkdownDescriptionModule, - ], - declarations: [ConditionsForUseDialogComponent], - providers: [ConditionsForUseDialogService], - exports: [ConditionsForUseDialogComponent], -}) -export class ConditionsForUseDialogModule {} diff --git a/src/app/component-library/confirmation-dialog/confirmation-dialog.module.ts b/src/app/component-library/confirmation-dialog/confirmation-dialog.module.ts deleted file mode 100644 index 703ff1a52..000000000 --- a/src/app/component-library/confirmation-dialog/confirmation-dialog.module.ts +++ /dev/null @@ -1,33 +0,0 @@ -import {ClipboardModule} from '@angular/cdk/clipboard'; -import {CommonModule} from '@angular/common'; -import {NgModule} from '@angular/core'; -import {MatButtonModule} from '@angular/material/button'; -import {MatCheckboxModule} from '@angular/material/checkbox'; -import {MatDialogModule} from '@angular/material/dialog'; -import {MatIconModule} from '@angular/material/icon'; -import {MatTooltipModule} from '@angular/material/tooltip'; -import {PipesAndDirectivesModule} from '../pipes-and-directives/pipes-and-directives.module'; -import {ConfirmationDialogComponent} from './confirmation-dialog/confirmation-dialog.component'; - -@NgModule({ - imports: [ - // Angular - CommonModule, - - // Angular CDK - ClipboardModule, - - // Angular Material - MatButtonModule, - MatCheckboxModule, - MatDialogModule, - MatIconModule, - MatTooltipModule, - - // EDC UI Feature Modules - PipesAndDirectivesModule, - ], - declarations: [ConfirmationDialogComponent], - exports: [ConfirmationDialogComponent], -}) -export class ConfirmationDialogModule {} diff --git a/src/app/component-library/data-address/data-address.module.ts b/src/app/component-library/data-address/data-address.module.ts deleted file mode 100644 index 0003fa584..000000000 --- a/src/app/component-library/data-address/data-address.module.ts +++ /dev/null @@ -1,21 +0,0 @@ -import {CommonModule} from '@angular/common'; -import {NgModule} from '@angular/core'; -import {ReactiveFormsModule} from '@angular/forms'; -import {MatInputModule} from '@angular/material/input'; -import {MatSelectModule} from '@angular/material/select'; -import {DataAddressTypeSelectComponent} from './data-address-type-select/data-address-type-select.component'; - -@NgModule({ - imports: [ - // Angular - CommonModule, - ReactiveFormsModule, - - // Angular Material - MatInputModule, - MatSelectModule, - ], - declarations: [DataAddressTypeSelectComponent], - exports: [DataAddressTypeSelectComponent], -}) -export class DataAddressModule {} diff --git a/src/app/component-library/edit-asset-form/edit-asset-form.module.ts b/src/app/component-library/edit-asset-form/edit-asset-form.module.ts deleted file mode 100644 index 47d79dac2..000000000 --- a/src/app/component-library/edit-asset-form/edit-asset-form.module.ts +++ /dev/null @@ -1,93 +0,0 @@ -import {CommonModule} from '@angular/common'; -import {NgModule} from '@angular/core'; -import {FormsModule, ReactiveFormsModule} from '@angular/forms'; -import {MatBadgeModule} from '@angular/material/badge'; -import {MatButtonModule} from '@angular/material/button'; -import {MatCardModule} from '@angular/material/card'; -import {MatCheckboxModule} from '@angular/material/checkbox'; -import {MatChipsModule} from '@angular/material/chips'; -import {MatNativeDateModule} from '@angular/material/core'; -import {MatDatepickerModule} from '@angular/material/datepicker'; -import {MatDialogModule} from '@angular/material/dialog'; -import {MatDividerModule} from '@angular/material/divider'; -import {MatFormFieldModule} from '@angular/material/form-field'; -import {MatIconModule} from '@angular/material/icon'; -import {MatInputModule} from '@angular/material/input'; -import {MatPaginatorModule} from '@angular/material/paginator'; -import {MatProgressSpinnerModule} from '@angular/material/progress-spinner'; -import {MatRadioModule} from '@angular/material/radio'; -import {MatSelectModule} from '@angular/material/select'; -import {MatSlideToggleModule} from '@angular/material/slide-toggle'; -import {MatStepperModule} from '@angular/material/stepper'; -import {MatTooltipModule} from '@angular/material/tooltip'; -import {RouterModule} from '@angular/router'; -import {CatalogModule} from '../catalog/catalog.module'; -import {PipesAndDirectivesModule} from '../pipes-and-directives/pipes-and-directives.module'; -import {PolicyEditorModule} from '../policy-editor/policy-editor.module'; -import {UiElementsModule} from '../ui-elements/ui-elements.module'; -import {DataCategorySelectComponent} from './data-category-select/data-category-select.component'; -import {DataSubcategoryItemsPipe} from './data-subcategory-select/data-subcategory-items.pipe'; -import {DataSubcategorySelectComponent} from './data-subcategory-select/data-subcategory-select.component'; -import {EditAssetFormDataAddressTypeSelectComponent} from './edit-asset-form-data-address-type-select/edit-asset-form-data-address-type-select.component'; -import {EditAssetFormGroupComponent} from './edit-asset-form-group/edit-asset-form-group.component'; -import {EditAssetFormInputComponent} from './edit-asset-form-input/edit-asset-form-input.component'; -import {EditAssetFormLabelComponent} from './edit-asset-form-label/edit-asset-form-label.component'; -import {EditAssetFormTextareaComponent} from './edit-asset-form-textarea/edit-asset-form-textarea.component'; -import {EditAssetFormComponent} from './edit-asset-form/edit-asset-form.component'; -import {KeywordSelectComponent} from './keyword-select/keyword-select.component'; -import {LanguageSelectComponent} from './language-select/language-select.component'; -import {TransportModeSelectComponent} from './transport-mode-select/transport-mode-select.component'; - -@NgModule({ - imports: [ - // Angular - CommonModule, - FormsModule, - ReactiveFormsModule, - RouterModule, - - // Angular Material - MatBadgeModule, - MatButtonModule, - MatCardModule, - MatCheckboxModule, - MatChipsModule, - MatDatepickerModule, - MatDividerModule, - MatFormFieldModule, - MatProgressSpinnerModule, - MatSelectModule, - MatSlideToggleModule, - MatStepperModule, - MatTooltipModule, - MatPaginatorModule, - MatInputModule, - MatRadioModule, - MatIconModule, - MatDialogModule, - MatNativeDateModule, - - // EDC UI Modules - CatalogModule, - PipesAndDirectivesModule, - PolicyEditorModule, - UiElementsModule, - ], - declarations: [ - EditAssetFormComponent, - EditAssetFormGroupComponent, - EditAssetFormLabelComponent, - EditAssetFormInputComponent, - EditAssetFormTextareaComponent, - KeywordSelectComponent, - DataCategorySelectComponent, - DataSubcategorySelectComponent, - DataSubcategoryItemsPipe, - EditAssetFormDataAddressTypeSelectComponent, - TransportModeSelectComponent, - LanguageSelectComponent, - ], - exports: [EditAssetFormComponent, EditAssetFormLabelComponent], - providers: [], -}) -export class EditAssetFormModule {} diff --git a/src/app/component-library/initiate-negotiation-confirm-tos-dialog/initiate-negotiation-confirm-tos-dialog.module.ts b/src/app/component-library/initiate-negotiation-confirm-tos-dialog/initiate-negotiation-confirm-tos-dialog.module.ts deleted file mode 100644 index e1bdce3f8..000000000 --- a/src/app/component-library/initiate-negotiation-confirm-tos-dialog/initiate-negotiation-confirm-tos-dialog.module.ts +++ /dev/null @@ -1,33 +0,0 @@ -import {ClipboardModule} from '@angular/cdk/clipboard'; -import {CommonModule} from '@angular/common'; -import {NgModule} from '@angular/core'; -import {MatButtonModule} from '@angular/material/button'; -import {MatCheckboxModule} from '@angular/material/checkbox'; -import {MatDialogModule} from '@angular/material/dialog'; -import {MatIconModule} from '@angular/material/icon'; -import {MatTooltipModule} from '@angular/material/tooltip'; -import {PipesAndDirectivesModule} from '../pipes-and-directives/pipes-and-directives.module'; -import {InitiateNegotiationConfirmTosDialogComponent} from './initiate-negotiation-confirm-tos-dialog/initiate-negotiation-confirm-tos-dialog.component'; - -@NgModule({ - imports: [ - // Angular - CommonModule, - - // Angular CDK - ClipboardModule, - - // Angular Material - MatButtonModule, - MatCheckboxModule, - MatDialogModule, - MatIconModule, - MatTooltipModule, - - // EDC UI Feature Modules - PipesAndDirectivesModule, - ], - declarations: [InitiateNegotiationConfirmTosDialogComponent], - exports: [InitiateNegotiationConfirmTosDialogComponent], -}) -export class InitiateNegotiationConfirmTosDialogModule {} diff --git a/src/app/component-library/json-dialog/json-dialog.module.ts b/src/app/component-library/json-dialog/json-dialog.module.ts deleted file mode 100644 index d0d7e19f5..000000000 --- a/src/app/component-library/json-dialog/json-dialog.module.ts +++ /dev/null @@ -1,41 +0,0 @@ -import {CommonModule} from '@angular/common'; -import {NgModule} from '@angular/core'; -import {FormsModule} from '@angular/forms'; -import {MatButtonModule} from '@angular/material/button'; -import {MatCardModule} from '@angular/material/card'; -import {MatCheckboxModule} from '@angular/material/checkbox'; -import {MatDialogModule} from '@angular/material/dialog'; -import {MatIconModule} from '@angular/material/icon'; -import {MatTooltipModule} from '@angular/material/tooltip'; -import {NgxJsonViewerModule} from 'ngx-json-viewer'; -import {ConfirmationDialogModule} from '../confirmation-dialog/confirmation-dialog.module'; -import {PipesAndDirectivesModule} from '../pipes-and-directives/pipes-and-directives.module'; -import {JsonDialogComponent} from './json-dialog/json-dialog.component'; -import {JsonDialogService} from './json-dialog/json-dialog.service'; - -@NgModule({ - imports: [ - // Angular - CommonModule, - FormsModule, - - // Angular Material - MatButtonModule, - MatCardModule, - MatCheckboxModule, - MatDialogModule, - MatIconModule, - MatTooltipModule, - - // Third Party - NgxJsonViewerModule, - - // EDC UI Modules - PipesAndDirectivesModule, - ConfirmationDialogModule, - ], - declarations: [JsonDialogComponent], - providers: [JsonDialogService], - exports: [JsonDialogComponent], -}) -export class JsonDialogModule {} diff --git a/src/app/component-library/markdown-description/markdown-description.module.ts b/src/app/component-library/markdown-description/markdown-description.module.ts deleted file mode 100644 index fc6eb5728..000000000 --- a/src/app/component-library/markdown-description/markdown-description.module.ts +++ /dev/null @@ -1,40 +0,0 @@ -import {CommonModule} from '@angular/common'; -import {NgModule} from '@angular/core'; -import {FormsModule} from '@angular/forms'; -import {MatButtonModule} from '@angular/material/button'; -import {MatCardModule} from '@angular/material/card'; -import {MatCheckboxModule} from '@angular/material/checkbox'; -import {MatDialogModule} from '@angular/material/dialog'; -import {MatIconModule} from '@angular/material/icon'; -import {MatTooltipModule} from '@angular/material/tooltip'; -import {NgxJsonViewerModule} from 'ngx-json-viewer'; -import {ConfirmationDialogModule} from '../confirmation-dialog/confirmation-dialog.module'; -import {PipesAndDirectivesModule} from '../pipes-and-directives/pipes-and-directives.module'; -import {MarkdownDescriptionComponent} from './markdown-description.component'; - -@NgModule({ - imports: [ - // Angular - CommonModule, - FormsModule, - - // Angular Material - MatButtonModule, - MatCardModule, - MatCheckboxModule, - MatDialogModule, - MatIconModule, - MatTooltipModule, - - // Third Party - NgxJsonViewerModule, - - // EDC UI Modules - PipesAndDirectivesModule, - ConfirmationDialogModule, - ], - declarations: [MarkdownDescriptionComponent], - providers: [], - exports: [MarkdownDescriptionComponent], -}) -export class MarkdownDescriptionModule {} diff --git a/src/app/component-library/pipes-and-directives/pipes-and-directives.module.ts b/src/app/component-library/pipes-and-directives/pipes-and-directives.module.ts deleted file mode 100644 index 1af7a09de..000000000 --- a/src/app/component-library/pipes-and-directives/pipes-and-directives.module.ts +++ /dev/null @@ -1,41 +0,0 @@ -import {CommonModule} from '@angular/common'; -import {NgModule} from '@angular/core'; -import {MatIconModule} from '@angular/material/icon'; -import {MatProgressSpinnerModule} from '@angular/material/progress-spinner'; -import {AutofocusDirective} from './directives/autofocus.direcitive'; -import {ExternalLinkDirective} from './directives/external-link.directive'; -import {RemoveClassDirective} from './directives/remove-class.directive'; -import {TrackByFieldDirective} from './directives/track-by-field.directive'; -import {CompareByFieldPipe} from './pipes/compare-by-field.pipe'; -import {IsActiveFeaturePipe} from './pipes/is-active-feature.pipe'; -import {ValuesPipe} from './pipes/values.pipe'; - -@NgModule({ - imports: [ - // Angular - CommonModule, - - // Angular Material - MatIconModule, - MatProgressSpinnerModule, - ], - declarations: [ - AutofocusDirective, - CompareByFieldPipe, - ExternalLinkDirective, - IsActiveFeaturePipe, - RemoveClassDirective, - TrackByFieldDirective, - ValuesPipe, - ], - exports: [ - AutofocusDirective, - CompareByFieldPipe, - ExternalLinkDirective, - IsActiveFeaturePipe, - RemoveClassDirective, - TrackByFieldDirective, - ValuesPipe, - ], -}) -export class PipesAndDirectivesModule {} diff --git a/src/app/component-library/policy-editor/model/policy-mapper.ts b/src/app/component-library/policy-editor/model/policy-mapper.ts deleted file mode 100644 index 6b254bf33..000000000 --- a/src/app/component-library/policy-editor/model/policy-mapper.ts +++ /dev/null @@ -1,133 +0,0 @@ -import {Injectable} from '@angular/core'; -import { - OperatorDto, - UiPolicyExpression, - UiPolicyExpressionType, - UiPolicyLiteral, -} from '@sovity.de/edc-client'; -import {associateBy} from '../../../core/utils/map-utils'; -import {PolicyExpressionMapped} from './policy-expression-mapped'; -import { - PolicyMultiExpressionConfig, - SUPPORTED_MULTI_EXPRESSIONS, -} from './policy-multi-expressions'; -import { - PolicyOperatorConfig, - SUPPORTED_POLICY_OPERATORS, - defaultPolicyOperatorConfig, -} from './policy-operators'; -import { - PolicyVerbConfig, - SUPPORTED_POLICY_VERBS, - defaultPolicyVerbConfig, -} from './policy-verbs'; - -@Injectable({providedIn: 'root'}) -export class PolicyMapper { - verbs = associateBy(SUPPORTED_POLICY_VERBS, (it) => it.operandLeftId); - operators = associateBy(SUPPORTED_POLICY_OPERATORS, (it) => it.id); - multiExpressionTypes = associateBy( - SUPPORTED_MULTI_EXPRESSIONS, - (it) => it.expressionType, - ); - - buildPolicy(expression: UiPolicyExpression): PolicyExpressionMapped { - if (expression.type === 'EMPTY') { - return {type: 'EMPTY'}; - } - - if (expression.type === 'CONSTRAINT') { - return this.mapConstraint(expression); - } - - return this.mapMultiExpression(expression); - } - - private mapConstraint( - expression: UiPolicyExpression, - ): PolicyExpressionMapped { - const verb = this.getVerbConfig(expression.constraint?.left!); - const operator = this.getOperatorConfig(expression.constraint?.operator!); - const value = expression.constraint?.right; - - return { - type: 'CONSTRAINT', - verb, - operator, - valueRaw: value, - valueJson: this.formatJson(value!), - displayValue: this.formatValue(value, verb, operator) ?? 'null', - }; - } - - private mapMultiExpression( - expression: UiPolicyExpression, - ): PolicyExpressionMapped { - const multiExpression = this.getMultiExpressionConfig(expression.type); - const expressions = (expression.expressions ?? []).map((it) => - this.buildPolicy(it), - ); - return { - type: 'MULTI', - multiExpression, - expressions, - }; - } - - private getVerbConfig(verb: string): PolicyVerbConfig { - const verbConfig = this.verbs.get(verb); - if (verbConfig) { - return verbConfig; - } - - return defaultPolicyVerbConfig(verb); - } - - private getOperatorConfig(operator: OperatorDto): PolicyOperatorConfig { - const operatorConfig = this.operators.get(operator); - if (operatorConfig) { - return operatorConfig; - } - - return defaultPolicyOperatorConfig(operator); - } - - private getMultiExpressionConfig( - expressionType: UiPolicyExpressionType, - ): PolicyMultiExpressionConfig { - const multiExpressionType = this.multiExpressionTypes.get(expressionType); - if (multiExpressionType) { - return multiExpressionType; - } - - return { - expressionType, - title: expressionType, - description: '', - }; - } - - private formatValue( - value: UiPolicyLiteral | undefined, - verbConfig: PolicyVerbConfig, - operatorConfig: PolicyOperatorConfig, - ) { - if (value == null) { - return ''; - } - - return verbConfig.adapter.displayText(value, operatorConfig); - } - - private formatJson(value: UiPolicyLiteral): string { - if (value.type === 'STRING_LIST') { - return JSON.stringify(value.valueList); - } - - if (value.type === 'JSON') { - return value.value ?? ''; - } - - return JSON.stringify(value.value); - } -} diff --git a/src/app/component-library/policy-editor/model/policy-multi-expressions.ts b/src/app/component-library/policy-editor/model/policy-multi-expressions.ts deleted file mode 100644 index 427b29cf2..000000000 --- a/src/app/component-library/policy-editor/model/policy-multi-expressions.ts +++ /dev/null @@ -1,28 +0,0 @@ -import {UiPolicyExpressionType} from '@sovity.de/edc-client'; - -export interface PolicyMultiExpressionConfig { - expressionType: UiPolicyExpressionType; - title: string; - description: string; -} - -export const SUPPORTED_MULTI_EXPRESSIONS: PolicyMultiExpressionConfig[] = [ - { - expressionType: 'AND', - title: 'AND', - description: - 'Conjunction of several expressions. Evaluates to true if and only if all child expressions are true', - }, - { - expressionType: 'OR', - title: 'OR', - description: - 'Disjunction of several expressions. Evaluates to true if and only if at least one child expression is true', - }, - { - expressionType: 'XONE', - title: 'XONE', - description: - 'XONE operation. Evaluates to true if and only if exactly one child expression is true', - }, -]; diff --git a/src/app/component-library/policy-editor/model/policy-operators.ts b/src/app/component-library/policy-editor/model/policy-operators.ts deleted file mode 100644 index 8d76a5ba4..000000000 --- a/src/app/component-library/policy-editor/model/policy-operators.ts +++ /dev/null @@ -1,77 +0,0 @@ -import {OperatorDto} from '@sovity.de/edc-client'; - -export interface PolicyOperatorConfig { - id: OperatorDto; - title: string; - description: string; -} - -export const SUPPORTED_POLICY_OPERATORS: PolicyOperatorConfig[] = [ - { - id: 'EQ', - title: '=', - description: 'Equal to', - }, - { - id: 'NEQ', - title: '≠', - description: 'Not equal to', - }, - { - id: 'GEQ', - title: '≥', - description: 'Greater than or equal to', - }, - { - id: 'GT', - title: '>', - description: 'Greater than', - }, - { - id: 'LEQ', - title: '≤', - description: 'Less than or equal to', - }, - { - id: 'LT', - title: '<', - description: 'Less than', - }, - { - id: 'IN', - title: 'IN', - description: 'In', - }, - { - id: 'HAS_PART', - title: 'HAS PART', - description: 'Has Part', - }, - { - id: 'IS_A', - title: 'IS A', - description: 'Is a', - }, - { - id: 'IS_NONE_OF', - title: 'IS NONE OF', - description: 'Is none of', - }, - { - id: 'IS_ANY_OF', - title: 'IS ANY OF', - description: 'Is any of', - }, - { - id: 'IS_ALL_OF', - title: 'IS ALL OF', - description: 'Is all of', - }, -]; -export const defaultPolicyOperatorConfig = ( - operator: OperatorDto, -): PolicyOperatorConfig => ({ - id: operator, - title: operator, - description: '', -}); diff --git a/src/app/component-library/policy-editor/model/policy-verbs.ts b/src/app/component-library/policy-editor/model/policy-verbs.ts deleted file mode 100644 index a84fbd1b0..000000000 --- a/src/app/component-library/policy-editor/model/policy-verbs.ts +++ /dev/null @@ -1,54 +0,0 @@ -import {OperatorDto} from '@sovity.de/edc-client'; -import { - PolicyFormAdapter, - jsonAdapter, - localDateAdapter, - stringArrayOrCommaJoinedAdapter, -} from './policy-form-adapter'; -import {policyLeftExpressions} from './policy-left-expressions'; -import {SUPPORTED_POLICY_OPERATORS} from './policy-operators'; - -export interface PolicyVerbConfig { - operandLeftId: string; - operandLeftTitle: string; - operandLeftDescription: string; - operandRightType: 'DATE' | 'TEXT' | 'PARTICIPANT_ID'; - operandRightHint?: string; - operandRightPlaceholder?: string; - supportedOperators: OperatorDto[]; - adapter: PolicyFormAdapter; -} - -export const SUPPORTED_POLICY_VERBS: PolicyVerbConfig[] = [ - { - operandLeftId: policyLeftExpressions.referringConnector, - operandLeftTitle: "Consumer's Participant ID", - operandLeftDescription: - "Consumer's Participant ID, also called Connector ID, of the counter-party connector.", - operandRightType: 'PARTICIPANT_ID', - supportedOperators: ['EQ', 'IN'], - operandRightPlaceholder: 'MDSL1234XX.C1234YY', - operandRightHint: 'Multiple values can be joined by comma', - adapter: stringArrayOrCommaJoinedAdapter, - }, - { - operandLeftId: policyLeftExpressions.policyEvaluationTime, - operandLeftTitle: 'Time Restriction', - operandLeftDescription: - 'Time at which the policy is evaluated. This can be used to restrict the data offer to certain time periods', - supportedOperators: ['GEQ', 'LEQ', 'GT', 'LT'], - operandRightType: 'DATE', - operandRightPlaceholder: 'DD/MM/YYYY', - operandRightHint: 'DD/MM/YYYY', - adapter: localDateAdapter, - }, -]; - -export const defaultPolicyVerbConfig = (verb: string): PolicyVerbConfig => ({ - operandLeftId: verb, - operandLeftTitle: verb, - operandLeftDescription: '', - supportedOperators: SUPPORTED_POLICY_OPERATORS.map((it) => it.id), - operandRightType: 'TEXT', - adapter: jsonAdapter, -}); diff --git a/src/app/component-library/policy-editor/policy-editor.module.ts b/src/app/component-library/policy-editor/policy-editor.module.ts deleted file mode 100644 index 22130c938..000000000 --- a/src/app/component-library/policy-editor/policy-editor.module.ts +++ /dev/null @@ -1,59 +0,0 @@ -import {CommonModule} from '@angular/common'; -import {NgModule} from '@angular/core'; -import {FormsModule, ReactiveFormsModule} from '@angular/forms'; -import {SharedModule} from 'src/app/shared.module'; -import {PipesAndDirectivesModule} from '../pipes-and-directives/pipes-and-directives.module'; -import {ParticipantIdSelectComponent} from './editor/controls/participant-id-select/participant-id-select.component'; -import {PolicyFormAddMenuComponent} from './editor/policy-form-add-menu/policy-form-add-menu.component'; -import {PolicyFormExpressionConstraintComponent} from './editor/policy-form-expression-constraint/policy-form-expression-constraint.component'; -import {PolicyFormExpressionEmptyComponent} from './editor/policy-form-expression-empty/policy-form-expression-empty.component'; -import {PolicyFormExpressionMultiComponent} from './editor/policy-form-expression-multi/policy-form-expression-multi.component'; -import {PolicyFormExpressionComponent} from './editor/policy-form-expression/policy-form-expression.component'; -import {PolicyFormRemoveButton} from './editor/policy-form-remove-button/policy-form-remove-button.component'; -import {PolicyOperatorSelectComponent} from './editor/policy-operator-select/policy-operator-select.component'; -import {PolicyExpressionRecipeService} from './editor/recipes/policy-expression-recipe.service'; -import {TimespanRestrictionDialogComponent} from './editor/recipes/timespan-restriction-dialog/timespan-restriction-dialog.component'; -import {PolicyExpressionComponent} from './renderer/policy-expression/policy-expression.component'; -import {PolicyRendererComponent} from './renderer/policy-renderer/policy-renderer.component'; - -@NgModule({ - imports: [ - // Angular - CommonModule, - FormsModule, - ReactiveFormsModule, - - // Angular Material - SharedModule, - - // EDC UI Modules - PipesAndDirectivesModule, - ], - declarations: [ - // ./editor - PolicyFormAddMenuComponent, - PolicyFormExpressionComponent, - PolicyFormExpressionEmptyComponent, - PolicyFormExpressionConstraintComponent, - PolicyFormExpressionMultiComponent, - PolicyFormRemoveButton, - PolicyOperatorSelectComponent, - - // ./editor/controls - ParticipantIdSelectComponent, - - // ./editor/recipes - TimespanRestrictionDialogComponent, - - // ./renderer - PolicyRendererComponent, - PolicyExpressionComponent, - ], - providers: [PolicyExpressionRecipeService], - exports: [ - PolicyRendererComponent, - PolicyFormExpressionComponent, - TimespanRestrictionDialogComponent, - ], -}) -export class PolicyEditorModule {} diff --git a/src/app/component-library/property-grid/property-grid.module.ts b/src/app/component-library/property-grid/property-grid.module.ts deleted file mode 100644 index faa613d3c..000000000 --- a/src/app/component-library/property-grid/property-grid.module.ts +++ /dev/null @@ -1,38 +0,0 @@ -import {ClipboardModule} from '@angular/cdk/clipboard'; -import {CommonModule} from '@angular/common'; -import {NgModule} from '@angular/core'; -import {MatButtonModule} from '@angular/material/button'; -import {MatIconModule} from '@angular/material/icon'; -import {MatProgressSpinnerModule} from '@angular/material/progress-spinner'; -import {MatTooltipModule} from '@angular/material/tooltip'; -import {MarkdownDescriptionModule} from '../markdown-description/markdown-description.module'; -import {PipesAndDirectivesModule} from '../pipes-and-directives/pipes-and-directives.module'; -import {PolicyEditorModule} from '../policy-editor/policy-editor.module'; -import {UiElementsModule} from '../ui-elements/ui-elements.module'; -import {PropertyGridGroupComponent} from './property-grid-group/property-grid-group.component'; -import {PropertyGridComponent} from './property-grid/property-grid.component'; - -@NgModule({ - imports: [ - // Angular - CommonModule, - - // Angular CDK - ClipboardModule, - - // Angular Material - MatButtonModule, - MatIconModule, - MatProgressSpinnerModule, - MatTooltipModule, - - // EDC UI Feature Modules - PipesAndDirectivesModule, - UiElementsModule, - PolicyEditorModule, - MarkdownDescriptionModule, - ], - declarations: [PropertyGridComponent, PropertyGridGroupComponent], - exports: [PropertyGridComponent, PropertyGridGroupComponent], -}) -export class PropertyGridModule {} diff --git a/src/app/component-library/ui-elements/ui-elements.module.ts b/src/app/component-library/ui-elements/ui-elements.module.ts deleted file mode 100644 index a5ada56e1..000000000 --- a/src/app/component-library/ui-elements/ui-elements.module.ts +++ /dev/null @@ -1,43 +0,0 @@ -import {CommonModule} from '@angular/common'; -import {NgModule} from '@angular/core'; -import {MatIconModule} from '@angular/material/icon'; -import {MatProgressSpinnerModule} from '@angular/material/progress-spinner'; -import {MatTooltipModule} from '@angular/material/tooltip'; -import {AgoComponent} from './ago/ago.component'; -import {AgoPipe} from './ago/ago.pipe'; -import {DateComponent} from './date/date.component'; -import {EmptyStateComponent} from './empty-state/empty-state.component'; -import {ErrorStateComponent} from './error-state/error-state.component'; -import {HorizontalSectionDividerComponent} from './horizontal-section-divider/horizontal-section-divider.component'; -import {LoadingStateComponent} from './loading-state/loading-state.component'; - -@NgModule({ - imports: [ - // Angular - CommonModule, - - // Angular Material - MatIconModule, - MatProgressSpinnerModule, - MatTooltipModule, - ], - declarations: [ - AgoComponent, - AgoPipe, - DateComponent, - EmptyStateComponent, - ErrorStateComponent, - HorizontalSectionDividerComponent, - LoadingStateComponent, - ], - exports: [ - AgoComponent, - AgoPipe, - DateComponent, - EmptyStateComponent, - ErrorStateComponent, - HorizontalSectionDividerComponent, - LoadingStateComponent, - ], -}) -export class UiElementsModule {} diff --git a/src/app/component-library/url-list-dialog/url-list-dialog.module.ts b/src/app/component-library/url-list-dialog/url-list-dialog.module.ts deleted file mode 100644 index 7355df2ca..000000000 --- a/src/app/component-library/url-list-dialog/url-list-dialog.module.ts +++ /dev/null @@ -1,39 +0,0 @@ -import {CommonModule} from '@angular/common'; -import {NgModule} from '@angular/core'; -import {FormsModule} from '@angular/forms'; -import {MatButtonModule} from '@angular/material/button'; -import {MatCardModule} from '@angular/material/card'; -import {MatDialogModule} from '@angular/material/dialog'; -import {MatIconModule} from '@angular/material/icon'; -import {NgxJsonViewerModule} from 'ngx-json-viewer'; -import {ConfirmationDialogModule} from '../confirmation-dialog/confirmation-dialog.module'; -import {MarkdownDescriptionModule} from '../markdown-description/markdown-description.module'; -import {PipesAndDirectivesModule} from '../pipes-and-directives/pipes-and-directives.module'; -import {UrlListDialogComponent} from './url-list-dialog/url-list-dialog.component'; -import {UrlListDialogService} from './url-list-dialog/url-list-dialog.service'; - -@NgModule({ - imports: [ - // Angular - CommonModule, - FormsModule, - - // Angular Material - MatButtonModule, - MatCardModule, - MatDialogModule, - MatIconModule, - - // Third Party - NgxJsonViewerModule, - - // EDC UI Modules - PipesAndDirectivesModule, - ConfirmationDialogModule, - MarkdownDescriptionModule, - ], - declarations: [UrlListDialogComponent], - providers: [UrlListDialogService], - exports: [UrlListDialogComponent], -}) -export class UrlListDialogModule {} diff --git a/src/app/core/services/api/fake-backend/connector-fake-impl/data/test-policies.ts b/src/app/core/services/api/fake-backend/connector-fake-impl/data/test-policies.ts index 7c3f72f90..3613cdf14 100644 --- a/src/app/core/services/api/fake-backend/connector-fake-impl/data/test-policies.ts +++ b/src/app/core/services/api/fake-backend/connector-fake-impl/data/test-policies.ts @@ -1,10 +1,10 @@ import {UiPolicy, UiPolicyExpression} from '@sovity.de/edc-client'; -import {policyLeftExpressions} from '../../../../../../component-library/policy-editor/model/policy-left-expressions'; +import {policyLeftExpressions} from '../../../../../../shared/business/policy-editor/model/policy-left-expressions'; import { constraint, constraintList, multi, -} from '../../../../../../component-library/policy-editor/model/ui-policy-expression-utils'; +} from '../../../../../../shared/business/policy-editor/model/ui-policy-expression-utils'; export namespace TestPolicies { const policy = ( diff --git a/src/app/core/services/api/fake-backend/connector-fake-impl/policy-definition-fake-service.ts b/src/app/core/services/api/fake-backend/connector-fake-impl/policy-definition-fake-service.ts index 6de17bd83..18e1a1f80 100644 --- a/src/app/core/services/api/fake-backend/connector-fake-impl/policy-definition-fake-service.ts +++ b/src/app/core/services/api/fake-backend/connector-fake-impl/policy-definition-fake-service.ts @@ -7,7 +7,7 @@ import { PolicyDefinitionPage, UiPolicyExpression, } from '@sovity.de/edc-client'; -import {ALWAYS_TRUE_POLICY_ID} from 'src/app/component-library/edit-asset-form/edit-asset-form/form/model/always-true-policy-id'; +import {ALWAYS_TRUE_POLICY_ID} from '../../../../../shared/business/edit-asset-form/form/model/always-true-policy-id'; import {TestPolicies} from './data/test-policies'; let policyDefinitions: PolicyDefinitionDto[] = [ diff --git a/src/app/core/services/asset-builder.ts b/src/app/core/services/asset-builder.ts index d02202341..7fba6a0b2 100644 --- a/src/app/core/services/asset-builder.ts +++ b/src/app/core/services/asset-builder.ts @@ -1,13 +1,13 @@ import {Injectable} from '@angular/core'; import {UiAsset} from '@sovity.de/edc-client'; -import {DataCategorySelectItem} from 'src/app/component-library/edit-asset-form/data-category-select/data-category-select-item'; -import {DataCategorySelectItemService} from 'src/app/component-library/edit-asset-form/data-category-select/data-category-select-item.service'; -import {DataSubcategorySelectItem} from 'src/app/component-library/edit-asset-form/data-subcategory-select/data-subcategory-select-item'; -import {DataSubcategorySelectItemService} from 'src/app/component-library/edit-asset-form/data-subcategory-select/data-subcategory-select-item.service'; -import {LanguageSelectItem} from 'src/app/component-library/edit-asset-form/language-select/language-select-item'; -import {LanguageSelectItemService} from 'src/app/component-library/edit-asset-form/language-select/language-select-item.service'; -import {TransportModeSelectItem} from 'src/app/component-library/edit-asset-form/transport-mode-select/transport-mode-select-item'; -import {TransportModeSelectItemService} from 'src/app/component-library/edit-asset-form/transport-mode-select/transport-mode-select-item.service'; +import {DataCategorySelectItem} from '../../shared/form-elements/data-category-select/data-category-select-item'; +import {DataCategorySelectItemService} from '../../shared/form-elements/data-category-select/data-category-select-item.service'; +import {DataSubcategorySelectItem} from '../../shared/form-elements/data-subcategory-select/data-subcategory-select-item'; +import {DataSubcategorySelectItemService} from '../../shared/form-elements/data-subcategory-select/data-subcategory-select-item.service'; +import {LanguageSelectItem} from '../../shared/form-elements/language-select/language-select-item'; +import {LanguageSelectItemService} from '../../shared/form-elements/language-select/language-select-item.service'; +import {TransportModeSelectItem} from '../../shared/form-elements/transport-mode-select/transport-mode-select-item'; +import {TransportModeSelectItemService} from '../../shared/form-elements/transport-mode-select/transport-mode-select-item.service'; import {AdditionalAssetProperty, UiAssetMapped} from './models/ui-asset-mapped'; /** diff --git a/src/app/core/services/asset-data-source-mapper-legacy.ts b/src/app/core/services/asset-data-source-mapper-legacy.ts index e05e8787c..fb68d58b3 100644 --- a/src/app/core/services/asset-data-source-mapper-legacy.ts +++ b/src/app/core/services/asset-data-source-mapper-legacy.ts @@ -1,7 +1,7 @@ import {Injectable} from '@angular/core'; import {UiDataSource} from '@sovity.de/edc-client'; -import {AssetDatasourceFormValue} from '../../routes/connector-ui/asset-page/asset-edit-dialog/form/model/asset-datasource-form-model'; -import {HttpDatasourceHeaderFormValue} from '../../routes/connector-ui/asset-page/asset-edit-dialog/form/model/http-datasource-header-form-model'; +import {AssetDatasourceFormValue} from '../../routes/connector-ui/asset-list-page/asset-create-dialog/form/model/asset-datasource-form-model'; +import {HttpDatasourceHeaderFormValue} from '../../routes/connector-ui/asset-list-page/asset-create-dialog/form/model/http-datasource-header-form-model'; import {getAuthFields} from '../utils/form-value-utils'; import {QueryParamsMapper} from './query-params-mapper'; diff --git a/src/app/core/services/asset-data-source-mapper.ts b/src/app/core/services/asset-data-source-mapper.ts index 5f0462f2a..03f4b74d4 100644 --- a/src/app/core/services/asset-data-source-mapper.ts +++ b/src/app/core/services/asset-data-source-mapper.ts @@ -1,7 +1,7 @@ import {Injectable} from '@angular/core'; import {UiDataSource} from '@sovity.de/edc-client'; -import {AssetDatasourceFormValue} from 'src/app/component-library/edit-asset-form/edit-asset-form/form/model/asset-datasource-form-model'; -import {HttpDatasourceHeaderFormValue} from 'src/app/component-library/edit-asset-form/edit-asset-form/form/model/http-datasource-header-form-model'; +import {AssetDatasourceFormValue} from '../../shared/business/edit-asset-form/form/model/asset-datasource-form-model'; +import {HttpDatasourceHeaderFormValue} from '../../shared/business/edit-asset-form/form/model/http-datasource-header-form-model'; import {getAuthFields} from '../utils/form-value-utils'; import {QueryParamsMapper} from './query-params-mapper'; diff --git a/src/app/core/services/asset-request-builder-legacy.ts b/src/app/core/services/asset-request-builder-legacy.ts index fb77fe190..e97533f70 100644 --- a/src/app/core/services/asset-request-builder-legacy.ts +++ b/src/app/core/services/asset-request-builder-legacy.ts @@ -1,6 +1,6 @@ import {Injectable} from '@angular/core'; -import {UiAssetCreateRequest, UiAssetEditRequest} from '@sovity.de/edc-client'; -import {AssetEditorDialogFormValue} from '../../routes/connector-ui/asset-page/asset-edit-dialog/form/model/asset-editor-dialog-form-model'; +import {UiAssetCreateRequest} from '@sovity.de/edc-client'; +import {AssetCreateDialogFormValue} from '../../routes/connector-ui/asset-list-page/asset-create-dialog/form/model/asset-create-dialog-form-model'; import {toGmtZeroHourDate} from '../utils/date-utils'; import {AssetDataSourceMapperLegacy} from './asset-data-source-mapper-legacy'; import {AssetRequestCommonMetadata} from './asset-request-common-metadata'; @@ -10,7 +10,7 @@ export class AssetRequestBuilderLegacy { constructor(private assetDataSourceMapper: AssetDataSourceMapperLegacy) {} buildAssetCreateRequestLegacy( - formValue: AssetEditorDialogFormValue, + formValue: AssetCreateDialogFormValue, ): UiAssetCreateRequest { const id = formValue.metadata?.id!; const metadata = this.buildAssetRequestCommonMetadataLegacy(formValue); @@ -24,22 +24,8 @@ export class AssetRequestBuilderLegacy { }; } - buildAssetEditRequestLegacy( - formValue: AssetEditorDialogFormValue, - ): UiAssetEditRequest { - const metadata = this.buildAssetRequestCommonMetadataLegacy(formValue); - const dataSourceOrNull = - this.assetDataSourceMapper.buildDataSourceOrNullLegacy( - formValue.datasource!, - ); - return { - ...metadata, - dataSourceOverrideOrNull: dataSourceOrNull ?? undefined, - }; - } - buildAssetRequestCommonMetadataLegacy( - formValue: AssetEditorDialogFormValue, + formValue: AssetCreateDialogFormValue, ): AssetRequestCommonMetadata { const title = formValue.metadata?.title!; const version = formValue.metadata?.version; diff --git a/src/app/core/services/asset-request-builder.ts b/src/app/core/services/asset-request-builder.ts index 45fd05d49..284b71987 100644 --- a/src/app/core/services/asset-request-builder.ts +++ b/src/app/core/services/asset-request-builder.ts @@ -1,6 +1,6 @@ import {Injectable} from '@angular/core'; import {UiAssetCreateRequest, UiAssetEditRequest} from '@sovity.de/edc-client'; -import {EditAssetFormValue} from 'src/app/component-library/edit-asset-form/edit-asset-form/form/model/edit-asset-form-model'; +import {EditAssetFormValue} from 'src/app/shared/business/edit-asset-form/form/model/edit-asset-form-model'; import {toGmtZeroHourDate} from '../utils/date-utils'; import {AssetDataSourceMapper} from './asset-data-source-mapper'; import {AssetRequestCommonMetadata} from './asset-request-common-metadata'; diff --git a/src/app/core/services/connector-info-property-grid-group-builder.ts b/src/app/core/services/connector-info-property-grid-group-builder.ts index 462cebcdb..64faf64af 100644 --- a/src/app/core/services/connector-info-property-grid-group-builder.ts +++ b/src/app/core/services/connector-info-property-grid-group-builder.ts @@ -1,11 +1,12 @@ import {Injectable} from '@angular/core'; import {MatDialog} from '@angular/material/dialog'; +import {TranslateService} from '@ngx-translate/core'; import {DashboardPage} from '@sovity.de/edc-client'; -import {JsonDialogComponent} from '../../component-library/json-dialog/json-dialog/json-dialog.component'; -import {JsonDialogData} from '../../component-library/json-dialog/json-dialog/json-dialog.data'; -import {PropertyGridGroup} from '../../component-library/property-grid/property-grid-group/property-grid-group'; -import {PropertyGridField} from '../../component-library/property-grid/property-grid/property-grid-field'; -import {PropertyGridFieldService} from '../../component-library/property-grid/property-grid/property-grid-field.service'; +import {JsonDialogComponent} from '../../shared/common/json-dialog/json-dialog.component'; +import {JsonDialogData} from '../../shared/common/json-dialog/json-dialog.data'; +import {PropertyGridGroup} from '../../shared/common/property-grid-group/property-grid-group'; +import {PropertyGridField} from '../../shared/common/property-grid/property-grid-field'; +import {PropertyGridFieldService} from '../../shared/common/property-grid/property-grid-field.service'; import {LastCommitInfo} from './api/model/last-commit-info'; import {Fetched} from './models/fetched'; import {ParticipantIdLocalization} from './participant-id-localization'; @@ -16,12 +17,13 @@ export class ConnectorInfoPropertyGridGroupBuilder { private participantIdLocalization: ParticipantIdLocalization, private propertyGridUtils: PropertyGridFieldService, private matDialog: MatDialog, + private translateService: TranslateService, ) {} private onShowConnectorVersionClick(title: string, versionData: any) { const data: JsonDialogData = { title, - subtitle: 'Show Details', + subtitle: this.translateService.instant('general.details'), icon: 'link', objectForJson: versionData, }; @@ -86,13 +88,14 @@ export class ConnectorInfoPropertyGridGroupBuilder { label: 'UI Version', text: data.trim().toString() ? this.asDate(data.trim().toString()) - : 'Show Details', + : this.translateService.instant('general.details'), onclick: () => this.onShowConnectorVersionClick('Version Information', { 'UI Last Commit Information': uiCommitDetails.match({ ifOk: (uiCommitdata) => uiCommitdata, ifError: (error) => error.failureMessage, - ifLoading: () => 'Still Loading...', + ifLoading: () => + this.translateService.instant('general.still_loading'), }), }), }, @@ -101,7 +104,7 @@ export class ConnectorInfoPropertyGridGroupBuilder { { icon: 'link', label: 'UI Version', - text: 'Show Details', + text: this.translateService.instant('general.details'), onclick: () => this.onShowConnectorVersionClick('Version Information', { 'UI Commit Information': error.failureMessage, @@ -112,7 +115,7 @@ export class ConnectorInfoPropertyGridGroupBuilder { { icon: 'link', label: 'UI Version', - text: 'Loading...', + text: this.translateService.instant('general.loading'), }, ], }); @@ -125,12 +128,18 @@ export class ConnectorInfoPropertyGridGroupBuilder { const fields: PropertyGridField[] = dashboardData.match< PropertyGridField[] >({ - ifLoading: () => [{icon: 'info', label: 'Loading', text: 'Loading...'}], + ifLoading: () => [ + { + icon: 'info', + label: this.translateService.instant('general.loading1'), + text: this.translateService.instant('general.loading'), + }, + ], ifError: () => [ { icon: 'error', - label: 'Error', - text: 'Failed loading connector information', + label: this.translateService.instant('general.error'), + text: this.translateService.instant('services.failed_loading'), }, ], ifOk: (data) => this.buildConnectorMetadata(data), @@ -146,7 +155,7 @@ export class ConnectorInfoPropertyGridGroupBuilder { const fields = [ { icon: 'link', - label: 'Connector Endpoint', + label: this.translateService.instant('general.endpoint'), ...this.propertyGridUtils.guessValue(data.connectorEndpoint), }, { @@ -156,32 +165,32 @@ export class ConnectorInfoPropertyGridGroupBuilder { }, { icon: 'title', - label: 'Title', + label: this.translateService.instant('general.title'), ...this.propertyGridUtils.guessValue(data.connectorTitle), }, { icon: 'apartment', - label: 'Curator Organization Name', + label: this.translateService.instant('services.curator_org'), ...this.propertyGridUtils.guessValue(data.connectorCuratorName), }, { icon: 'apartment', - label: 'Curator URL', + label: this.translateService.instant('services.curator_url'), ...this.propertyGridUtils.guessValue(data.connectorCuratorUrl), }, { icon: 'title', - label: 'Description', + label: this.translateService.instant('general.description'), ...this.propertyGridUtils.guessValue(data.connectorDescription), }, { icon: 'contact_support', - label: 'Maintainer Organization Name', + label: this.translateService.instant('services.maintainer'), ...this.propertyGridUtils.guessValue(data.connectorMaintainerName), }, { icon: 'contact_support', - label: 'Maintainer URL', + label: this.translateService.instant('services.main_url'), ...this.propertyGridUtils.guessValue(data.connectorMaintainerUrl), }, ]; diff --git a/src/app/core/services/contract-negotiation.service.ts b/src/app/core/services/contract-negotiation.service.ts index adf9da50b..d813ee12c 100644 --- a/src/app/core/services/contract-negotiation.service.ts +++ b/src/app/core/services/contract-negotiation.service.ts @@ -2,13 +2,14 @@ import {Injectable} from '@angular/core'; import {MatDialog} from '@angular/material/dialog'; import {EMPTY, Observable, interval} from 'rxjs'; import {catchError, filter, first, switchMap, tap} from 'rxjs/operators'; +import {TranslateService} from '@ngx-translate/core'; import { ContractNegotiationRequest, UiContractNegotiation, UiContractOffer, } from '@sovity.de/edc-client'; -import {InitiateNegotiationConfirmTosDialogComponent} from 'src/app/component-library/initiate-negotiation-confirm-tos-dialog/initiate-negotiation-confirm-tos-dialog/initiate-negotiation-confirm-tos-dialog.component'; import {environment} from '../../../environments/environment'; +import {InitiateNegotiationConfirmTosDialogComponent} from '../../shared/business/initiate-negotiation-confirm-tos-dialog/initiate-negotiation-confirm-tos-dialog.component'; import {EdcApiService} from './api/edc-api.service'; import {DataOffer} from './models/data-offer'; import {NotificationService} from './notification.service'; @@ -22,6 +23,7 @@ export class ContractNegotiationService { private edcApiService: EdcApiService, private notificationService: NotificationService, private confirmationDialog: MatDialog, + private translateService: TranslateService, ) { if (!environment.production) { // Test data on local dev @@ -106,7 +108,8 @@ export class ContractNegotiationService { } private onFailureStarting() { - this.notificationService.showError('Failure starting negotiation.'); + const err = this.translateService.instant('notification.starting_neg'); + this.notificationService.showError(err); } private onStarted(contractOfferId: string) { @@ -115,13 +118,15 @@ export class ContractNegotiationService { private onFailureNegotiating(contractOfferId: string) { this.runningContractOffers.delete(contractOfferId); - this.notificationService.showError('Failed negotiating contract.'); + const err2 = this.translateService.instant('notification.negotiation'); + this.notificationService.showError(err2); } private onSuccess(contractOfferId: string) { this.runningContractOffers.delete(contractOfferId); this.doneContractOffers.add(contractOfferId); - this.notificationService.showInfo('Contract Negotiation complete!'); + const mes = this.translateService.instant('notification.compl_negotiation'); + this.notificationService.showError(mes); } private initiateNegotiation( diff --git a/src/app/core/services/models/contract-offer.ts b/src/app/core/services/models/contract-offer.ts index 8dad1ebaf..52d0a570b 100644 --- a/src/app/core/services/models/contract-offer.ts +++ b/src/app/core/services/models/contract-offer.ts @@ -1,5 +1,5 @@ import {UiContractOffer} from '@sovity.de/edc-client'; -import {PropertyGridField} from '../../../component-library/property-grid/property-grid/property-grid-field'; +import {PropertyGridField} from '../../../shared/common/property-grid/property-grid-field'; export type ContractOffer = UiContractOffer & { properties: PropertyGridField[]; diff --git a/src/app/core/services/models/ui-asset-mapped.ts b/src/app/core/services/models/ui-asset-mapped.ts index 2a13f58f6..3a22b72be 100644 --- a/src/app/core/services/models/ui-asset-mapped.ts +++ b/src/app/core/services/models/ui-asset-mapped.ts @@ -1,8 +1,8 @@ import {UiAsset} from '@sovity.de/edc-client'; -import {DataCategorySelectItem} from 'src/app/component-library/edit-asset-form/data-category-select/data-category-select-item'; -import {DataSubcategorySelectItem} from 'src/app/component-library/edit-asset-form/data-subcategory-select/data-subcategory-select-item'; -import {LanguageSelectItem} from 'src/app/component-library/edit-asset-form/language-select/language-select-item'; -import {TransportModeSelectItem} from 'src/app/component-library/edit-asset-form/transport-mode-select/transport-mode-select-item'; +import {DataCategorySelectItem} from '../../../shared/form-elements/data-category-select/data-category-select-item'; +import {DataSubcategorySelectItem} from '../../../shared/form-elements/data-subcategory-select/data-subcategory-select-item'; +import {LanguageSelectItem} from '../../../shared/form-elements/language-select/language-select-item'; +import {TransportModeSelectItem} from '../../../shared/form-elements/transport-mode-select/transport-mode-select-item'; /** * UiAsset with replaced fixed vocabulary items. diff --git a/src/app/core/services/nav-items-builder.ts b/src/app/core/services/nav-items-builder.ts index 605c7880e..2dec50ed4 100644 --- a/src/app/core/services/nav-items-builder.ts +++ b/src/app/core/services/nav-items-builder.ts @@ -17,25 +17,41 @@ export class NavItemsBuilder { { title: 'Providing', items: [ - {path: 'create-asset', icon: 'post_add', title: 'Create Data Offer'}, - {path: 'my-assets', icon: 'upload', title: 'Assets'}, - {path: 'policies', icon: 'policy', title: 'Policies'}, + { + path: 'create-asset', + icon: 'post_add', + title: 'create_data_offer_page.title', + }, + {path: 'my-assets', icon: 'upload', title: 'asset_list_page.title'}, + { + path: 'policies', + icon: 'policy', + title: 'policy_definition_page.title', + }, { path: 'data-offers', icon: 'rule', - title: 'Data Offers', + title: 'contract_definition_page.title', }, ], }, { title: 'Consuming', items: [ - {path: 'catalog-browser', icon: 'sim_card', title: 'Catalog Browser'}, - {path: 'contracts', icon: 'assignment_turned_in', title: 'Contracts'}, + { + path: 'catalog-browser', + icon: 'sim_card', + title: 'catalog_browser_page.title', + }, + { + path: 'contracts', + icon: 'assignment_turned_in', + title: 'contract_agreement_page.title', + }, { path: 'transfer-history', icon: 'assignment', - title: 'Transfer History', + title: 'transfer_history_page.title', }, ], }, @@ -44,7 +60,7 @@ export class NavItemsBuilder { { path: 'logout', icon: 'logout', - title: 'Logout', + title: 'logout_page.title', requiresFeature: 'logout-button', }, ], diff --git a/src/app/core/services/page-title-strategy.ts b/src/app/core/services/page-title-strategy.ts new file mode 100644 index 000000000..be687093d --- /dev/null +++ b/src/app/core/services/page-title-strategy.ts @@ -0,0 +1,42 @@ +import {Injectable} from '@angular/core'; +import {Title} from '@angular/platform-browser'; +import { + ActivatedRouteSnapshot, + RouterStateSnapshot, + TitleStrategy, +} from '@angular/router'; +import {Subject, switchMap} from 'rxjs'; +import {TranslateService} from '@ngx-translate/core'; + +@Injectable() +export class CustomPageTitleStrategy extends TitleStrategy { + rawTitle$ = new Subject(); + + constructor( + private translateService: TranslateService, + private title: Title, + ) { + super(); + this.rawTitle$ + .pipe(switchMap((title) => this.translateService.get(title))) + .subscribe((title) => this.title.setTitle(title)); + } + + override updateTitle(snapshot: RouterStateSnapshot): void { + const data = this.getRouteDataRecursively(snapshot); + const titleUntranslated = data.title ?? 'EDC Connector'; + this.rawTitle$.next(titleUntranslated); + } + + private getRouteDataRecursively( + routerStateSnapshot: RouterStateSnapshot, + ): any { + let snapshot: ActivatedRouteSnapshot | null = routerStateSnapshot.root; + let data = {}; + while (snapshot) { + data = {...data, ...snapshot.data}; + snapshot = snapshot.firstChild; + } + return data; + } +} diff --git a/src/app/core/services/participant-id-localization.ts b/src/app/core/services/participant-id-localization.ts index 2c225295c..ad0e2f313 100644 --- a/src/app/core/services/participant-id-localization.ts +++ b/src/app/core/services/participant-id-localization.ts @@ -1,14 +1,33 @@ import {Inject, Injectable} from '@angular/core'; +import {TranslateService} from '@ngx-translate/core'; import {APP_CONFIG, AppConfig} from '../config/app-config'; @Injectable({providedIn: 'root'}) export class ParticipantIdLocalization { + constructor( + @Inject(APP_CONFIG) private config: AppConfig, + private translateService: TranslateService, + ) { + this.translateService + .stream([ + 'component_library.connector_id', + 'component_library.connector_id_plural', + 'component_library.participant_id', + 'component_library.participant_id_plural', + ]) + .subscribe((translations) => { + this.participantId = this.mds + ? translations['component_library.connector_id'] + : translations['component_library.participant_id']; + this.participantIdPlural = this.mds + ? translations['component_library.connector_id_plural'] + : translations['component_library.participant_id_plural']; + }); + } private mds = this.config.features.has('mds-connector-id'); - participantId = this.mds ? 'Connector ID' : 'Participant ID'; - participantIdPlural = this.participantId + 's'; + participantId = ''; // init, will be updated by translateService + participantIdPlural = ''; participantIdPlaceholder = this.mds ? 'MDSL1234XX.C1234XX' : 'other-connector-participant-id'; - - constructor(@Inject(APP_CONFIG) private config: AppConfig) {} } diff --git a/src/app/core/services/policy-definition-builder.ts b/src/app/core/services/policy-definition-builder.ts deleted file mode 100644 index a669594cf..000000000 --- a/src/app/core/services/policy-definition-builder.ts +++ /dev/null @@ -1,105 +0,0 @@ -import {Injectable} from '@angular/core'; -import { - OperatorDto, - PolicyDefinitionCreateRequest, - UiPolicyConstraint, -} from '@sovity.de/edc-client'; -import {addDays} from 'date-fns'; -import {policyLeftExpressions} from '../../component-library/policy-editor/model/policy-left-expressions'; -import {NewPolicyDialogFormValue} from '../../routes/connector-ui/policy-definition-page/new-policy-dialog/new-policy-dialog-form-model'; - -@Injectable({ - providedIn: 'root', -}) -export class PolicyDefinitionBuilder { - /** - * Build {@link PolicyDefinitionCreateRequest} from {@link NewPolicyDialogFormValue} - * - * @param formValue {@link NewPolicyDialogFormValue} - */ - buildPolicyDefinition( - formValue: NewPolicyDialogFormValue, - ): PolicyDefinitionCreateRequest { - return { - policyDefinitionId: formValue.id?.trim()!, - policy: { - constraints: this.buildPolicyConstraints(formValue), - }, - }; - } - - private buildPolicyConstraints( - formValue: NewPolicyDialogFormValue, - ): UiPolicyConstraint[] { - const policyType = formValue.policyType; - switch (policyType) { - case 'Time-Period-Restricted': - return this.buildTimePeriodRestrictionPermissions(formValue); - case 'Connector-Restricted-Usage': - return [this.buildConnectorRestrictedConstraint(formValue)]; - default: - throw new Error(`Unknown policyType: ${policyType}`); - } - } - - private buildConnectorRestrictedConstraint( - formValue: NewPolicyDialogFormValue, - ): UiPolicyConstraint { - return this.inOrEqIfOne( - policyLeftExpressions.referringConnector, - formValue.participantIds!, - ); - } - - private inOrEqIfOne(left: string, values: string[]): UiPolicyConstraint { - if (values.length === 1) { - const value = values[0]; - return { - left, - operator: 'EQ', - right: { - type: 'STRING', - value, - }, - }; - } - - return { - left, - operator: 'IN', - right: { - type: 'STRING_LIST', - valueList: values, - }, - }; - } - - private buildTimePeriodRestrictionPermissions( - formValue: NewPolicyDialogFormValue, - ): UiPolicyConstraint[] { - const start = formValue.range!.start!!; - const constraints: UiPolicyConstraint[] = [ - this.evaluationTime('GEQ', start), - ]; - - const end = formValue.range!.end; - if (end) { - constraints.push(this.evaluationTime('LT', addDays(end, 1))); - } - return constraints; - } - - private evaluationTime( - operator: OperatorDto, - date: Date, - ): UiPolicyConstraint { - return { - left: policyLeftExpressions.policyEvaluationTime, - operator, - right: { - type: 'STRING', - value: date.toISOString()!, - }, - }; - } -} diff --git a/src/app/core/services/query-params-mapper.ts b/src/app/core/services/query-params-mapper.ts index b03ff896d..54377fbba 100644 --- a/src/app/core/services/query-params-mapper.ts +++ b/src/app/core/services/query-params-mapper.ts @@ -1,5 +1,5 @@ import {Injectable} from '@angular/core'; -import {HttpDatasourceQueryParamFormValue} from 'src/app/component-library/edit-asset-form/edit-asset-form/form/model/http-datasource-query-param-form-model'; +import {HttpDatasourceQueryParamFormValue} from '../../shared/business/edit-asset-form/form/model/http-datasource-query-param-form-model'; import { everythingAfter, everythingBefore, diff --git a/src/app/core/services/title-utils.service.ts b/src/app/core/services/title-utils.service.ts deleted file mode 100644 index ef372f793..000000000 --- a/src/app/core/services/title-utils.service.ts +++ /dev/null @@ -1,52 +0,0 @@ -import {Injectable} from '@angular/core'; -import {Title} from '@angular/platform-browser'; -import { - ActivatedRoute, - ActivatedRouteSnapshot, - NavigationEnd, - Router, -} from '@angular/router'; -import {concat, of} from 'rxjs'; -import {filter, map, shareReplay} from 'rxjs/operators'; - -@Injectable() -export class TitleUtilsService { - routeData$ = this.routeDone$().pipe( - map(() => this.getRouteDataRecursively()), - shareReplay(1), - ); - - title$ = this.routeData$.pipe(map((data) => data.title)); - - constructor( - private router: Router, - private titleService: Title, - private activatedRoute: ActivatedRoute, - ) {} - - startUpdatingTitleFromRouteData(defaultTitle: string) { - this.title$.subscribe((title) => { - let fullTitle = title ?? defaultTitle; - this.titleService.setTitle(fullTitle); - }); - } - - private routeDone$() { - return concat( - of({}), - this.router.events.pipe( - filter((event) => event instanceof NavigationEnd), - ), - ); - } - - private getRouteDataRecursively(): any { - let snapshot: ActivatedRouteSnapshot | null = this.activatedRoute.snapshot; - let data = {}; - while (snapshot) { - data = {...data, ...snapshot.data}; - snapshot = snapshot.firstChild; - } - return data; - } -} diff --git a/src/app/core/services/transfer-data-sink-mapper.ts b/src/app/core/services/transfer-data-sink-mapper.ts index a97285b78..77f6f4c05 100644 --- a/src/app/core/services/transfer-data-sink-mapper.ts +++ b/src/app/core/services/transfer-data-sink-mapper.ts @@ -1,6 +1,6 @@ import {Injectable} from '@angular/core'; -import {HttpDatasourceHeaderFormValue} from 'src/app/component-library/edit-asset-form/edit-asset-form/form/model/http-datasource-header-form-model'; import {ContractAgreementTransferDialogFormValue} from '../../routes/connector-ui/contract-agreement-page/contract-agreement-transfer-dialog/contract-agreement-transfer-dialog-form-model'; +import {HttpDatasourceHeaderFormValue} from '../../shared/business/edit-asset-form/form/model/http-datasource-header-form-model'; import {getAuthFields} from '../utils/form-value-utils'; import {mapKeys, removeNullValues} from '../utils/record-utils'; import {DataAddressProperty} from './models/data-address-properties'; diff --git a/src/app/core/utils/form-value-utils.ts b/src/app/core/utils/form-value-utils.ts index 4908e54a2..a67c96b7f 100644 --- a/src/app/core/utils/form-value-utils.ts +++ b/src/app/core/utils/form-value-utils.ts @@ -1,5 +1,5 @@ -import {AssetDatasourceFormValue} from 'src/app/component-library/edit-asset-form/edit-asset-form/form/model/asset-datasource-form-model'; import {ContractAgreementTransferDialogFormValue} from '../../routes/connector-ui/contract-agreement-page/contract-agreement-transfer-dialog/contract-agreement-transfer-dialog-form-model'; +import {AssetDatasourceFormValue} from '../../shared/business/edit-asset-form/form/model/asset-datasource-form-model'; export function getAuthFields( formValue: diff --git a/src/app/core/utils/lazy-utils.ts b/src/app/core/utils/lazy-utils.ts new file mode 100644 index 000000000..12774e261 --- /dev/null +++ b/src/app/core/utils/lazy-utils.ts @@ -0,0 +1,21 @@ +import {TranslateService} from '@ngx-translate/core'; + +export class LazyTranslation { + private value: T | null = null; + private language: string | null = null; + constructor( + private translateService: TranslateService, + private generate: (translationService: TranslateService) => T, + ) {} + + getValue(): T { + if ( + this.value == null || + this.language !== this.translateService.currentLang + ) { + this.language = this.translateService.currentLang; + this.value = this.generate(this.translateService); + } + return this.value; + } +} diff --git a/src/app/routes/connector-ui/asset-edit-page/asset-edit-page.module.ts b/src/app/routes/connector-ui/asset-edit-page/asset-edit-page.module.ts index f0b5c9814..39a28a6a9 100644 --- a/src/app/routes/connector-ui/asset-edit-page/asset-edit-page.module.ts +++ b/src/app/routes/connector-ui/asset-edit-page/asset-edit-page.module.ts @@ -1,8 +1,7 @@ import {CommonModule} from '@angular/common'; import {NgModule} from '@angular/core'; import {RouterModule} from '@angular/router'; -import {EditAssetFormModule} from '../../../component-library/edit-asset-form/edit-asset-form.module'; -import {UiElementsModule} from '../../../component-library/ui-elements/ui-elements.module'; +import {SharedModule} from '../../../shared/shared.module'; import {AssetEditPageComponent} from './asset-edit-page/asset-edit-page.component'; @NgModule({ @@ -12,8 +11,7 @@ import {AssetEditPageComponent} from './asset-edit-page/asset-edit-page.componen RouterModule, // EDC UI Modules - EditAssetFormModule, - UiElementsModule, + SharedModule, ], declarations: [AssetEditPageComponent], exports: [AssetEditPageComponent], diff --git a/src/app/routes/connector-ui/asset-edit-page/asset-edit-page/asset-edit-page.component.ts b/src/app/routes/connector-ui/asset-edit-page/asset-edit-page/asset-edit-page.component.ts index bd4b5c2a0..796ddf697 100644 --- a/src/app/routes/connector-ui/asset-edit-page/asset-edit-page/asset-edit-page.component.ts +++ b/src/app/routes/connector-ui/asset-edit-page/asset-edit-page/asset-edit-page.component.ts @@ -1,40 +1,24 @@ import {Component, OnInit} from '@angular/core'; import {ActivatedRoute, Router} from '@angular/router'; import {EMPTY, Observable, catchError, finalize, tap} from 'rxjs'; -import { - DataOfferCreationRequestPolicyEnum, - IdResponseDto, - UiAssetEditRequest, -} from '@sovity.de/edc-client'; -import {AssetAdvancedFormBuilder} from 'src/app/component-library/edit-asset-form/edit-asset-form/form/asset-advanced-form-builder'; -import {AssetDatasourceFormBuilder} from 'src/app/component-library/edit-asset-form/edit-asset-form/form/asset-datasource-form-builder'; -import {AssetGeneralFormBuilder} from 'src/app/component-library/edit-asset-form/edit-asset-form/form/asset-general-form-builder'; -import {EditAssetForm} from 'src/app/component-library/edit-asset-form/edit-asset-form/form/edit-asset-form'; -import {EditAssetFormInitializer} from 'src/app/component-library/edit-asset-form/edit-asset-form/form/edit-asset-form-initializer'; -import {EditAssetFormValue} from 'src/app/component-library/edit-asset-form/edit-asset-form/form/model/edit-asset-form-model'; -import {ExpressionFormControls} from 'src/app/component-library/policy-editor/editor/expression-form-controls'; -import {ExpressionFormHandler} from 'src/app/component-library/policy-editor/editor/expression-form-handler'; +import {IdResponseDto, UiAssetEditRequest} from '@sovity.de/edc-client'; import {EdcApiService} from 'src/app/core/services/api/edc-api.service'; import {AssetRequestBuilder} from 'src/app/core/services/asset-request-builder'; import {AssetService} from 'src/app/core/services/asset.service'; import {Fetched} from 'src/app/core/services/models/fetched'; import {UiAssetMapped} from 'src/app/core/services/models/ui-asset-mapped'; import {NotificationService} from 'src/app/core/services/notification.service'; -import {PolicyDefinitionCreatePageForm} from '../../policy-definition-create-page/policy-definition-create-page/policy-definition-create-page-form'; +import {editAssetFormRequiredViewProviders} from '../../../../shared/business/edit-asset-form/edit-asset-form-required-providers'; +import {EditAssetForm} from '../../../../shared/business/edit-asset-form/form/edit-asset-form'; +import {EditAssetFormInitializer} from '../../../../shared/business/edit-asset-form/form/edit-asset-form-initializer'; +import {EditAssetFormValue} from '../../../../shared/business/edit-asset-form/form/model/edit-asset-form-model'; +import {ExpressionFormHandler} from '../../../../shared/business/policy-editor/editor/expression-form-handler'; @Component({ selector: 'asset-edit-page', templateUrl: './asset-edit-page.component.html', providers: [EditAssetFormInitializer, AssetRequestBuilder], - viewProviders: [ - EditAssetForm, - AssetGeneralFormBuilder, - AssetDatasourceFormBuilder, - AssetAdvancedFormBuilder, - ExpressionFormHandler, - ExpressionFormControls, - PolicyDefinitionCreatePageForm, - ], + viewProviders: editAssetFormRequiredViewProviders, }) export class AssetEditPageComponent implements OnInit { asset: Fetched = new Fetched( diff --git a/src/app/routes/connector-ui/asset-page/asset-cards/asset-cards.component.html b/src/app/routes/connector-ui/asset-list-page/asset-cards/asset-cards.component.html similarity index 100% rename from src/app/routes/connector-ui/asset-page/asset-cards/asset-cards.component.html rename to src/app/routes/connector-ui/asset-list-page/asset-cards/asset-cards.component.html diff --git a/src/app/routes/connector-ui/asset-page/asset-cards/asset-cards.component.ts b/src/app/routes/connector-ui/asset-list-page/asset-cards/asset-cards.component.ts similarity index 100% rename from src/app/routes/connector-ui/asset-page/asset-cards/asset-cards.component.ts rename to src/app/routes/connector-ui/asset-list-page/asset-cards/asset-cards.component.ts diff --git a/src/app/routes/connector-ui/asset-list-page/asset-create-dialog/asset-create-dialog-data.ts b/src/app/routes/connector-ui/asset-list-page/asset-create-dialog/asset-create-dialog-data.ts new file mode 100644 index 000000000..fac8c22aa --- /dev/null +++ b/src/app/routes/connector-ui/asset-list-page/asset-create-dialog/asset-create-dialog-data.ts @@ -0,0 +1,5 @@ +import {AssetCreateDialogFormValue} from './form/model/asset-create-dialog-form-model'; + +export interface AssetCreateDialogData { + initialFormValue: AssetCreateDialogFormValue; +} diff --git a/src/app/routes/connector-ui/asset-list-page/asset-create-dialog/asset-create-dialog-mode.ts b/src/app/routes/connector-ui/asset-list-page/asset-create-dialog/asset-create-dialog-mode.ts new file mode 100644 index 000000000..f5b88fb2a --- /dev/null +++ b/src/app/routes/connector-ui/asset-list-page/asset-create-dialog/asset-create-dialog-mode.ts @@ -0,0 +1 @@ +export type AssetCreateDialogMode = 'CREATE' | 'EDIT'; diff --git a/src/app/routes/connector-ui/asset-page/asset-edit-dialog/asset-edit-dialog-result.ts b/src/app/routes/connector-ui/asset-list-page/asset-create-dialog/asset-create-dialog-result.ts similarity index 84% rename from src/app/routes/connector-ui/asset-page/asset-edit-dialog/asset-edit-dialog-result.ts rename to src/app/routes/connector-ui/asset-list-page/asset-create-dialog/asset-create-dialog-result.ts index af21e6881..acfc47fff 100644 --- a/src/app/routes/connector-ui/asset-page/asset-edit-dialog/asset-edit-dialog-result.ts +++ b/src/app/routes/connector-ui/asset-list-page/asset-create-dialog/asset-create-dialog-result.ts @@ -1,6 +1,6 @@ import {UiAssetMapped} from '../../../../core/services/models/ui-asset-mapped'; -export interface AssetEditDialogResult { +export interface AssetCreateDialogResult { /** * Updated asset list for the asset page */ diff --git a/src/app/routes/connector-ui/asset-page/asset-edit-dialog/asset-edit-dialog.component.html b/src/app/routes/connector-ui/asset-list-page/asset-create-dialog/asset-create-dialog.component.html similarity index 87% rename from src/app/routes/connector-ui/asset-page/asset-edit-dialog/asset-edit-dialog.component.html rename to src/app/routes/connector-ui/asset-list-page/asset-create-dialog/asset-create-dialog.component.html index 89c211d3f..f8ebab355 100644 --- a/src/app/routes/connector-ui/asset-page/asset-edit-dialog/asset-edit-dialog.component.html +++ b/src/app/routes/connector-ui/asset-list-page/asset-create-dialog/asset-create-dialog.component.html @@ -1,12 +1,14 @@

- {{ form.mode === 'CREATE' ? 'Create New Asset' : 'Edit Asset' }} + {{ 'asset_list_page.create_asset' | translate }}

- General Information + {{ + 'asset_list_page.information' | translate + }}
@@ -27,7 +29,7 @@

- Version + {{ 'asset_list_page.version' | translate }} - Asset ID + {{ 'asset_list_page.asset_id' | translate }} - Description + {{ 'asset_list_page.file_des' | translate }} - The description supports + {{ 'asset_list_page.descrip' | translate }}
- Content Type + {{ 'general.content_type' | translate }} - Endpoint Documentation + {{ 'general.endpoint_doc' | translate }}

(click)=" form.all.controls.httpAuthHeaderType.setValue('Vault-Secret') "> - Add Authentication + {{ 'general.add_auth' | translate }}
@@ -101,9 +108,11 @@

Initiate Transfer

Type - Header with Vault Secret + {{ 'general.header_sec' | translate }} - Header with Value + {{ + 'general.header_val' | translate + }}
Initiate Transfer class="flex flex-row space-x-[10px]"> - Auth Header Name + {{ 'general.auth_header' | translate }} Initiate Transfer - Auth Header Value + {{ 'general.auth_value' | translate }} Initiate Transfer form.all.controls.httpAuthHeaderType.value === 'Vault-Secret' " class="grow"> - Vault Secret Name + {{ 'general.vault_secret' | translate }} Initiate Transfer mat-button color="warn" (click)="form.all.controls.httpAuthHeaderType.setValue('None')"> - Remove Authentication + {{ 'general.rem_auth' | translate }}
-
Additional Headers
+
+ {{ 'general.add_header' | translate }} +
- Header Name + {{ 'general.header_name' | translate }} Initiate Transfer - Header Value + {{ 'general.header_value' | translate }} Initiate Transfer color="warn" style="height: 54px; margin-top: 4px; margin-left: 8px" (click)="form.onHttpHeadersRemoveClick(i)"> - Remove + {{ 'general.remove' | translate }}
@@ -197,29 +208,25 @@

Initiate Transfer

mat-button color="accent" (click)="form.onHttpHeadersAddClick()"> - Add Additional Header + {{ 'general.add_add_header' | translate }}
-
HTTP Datasource Parameterization
+
+ {{ 'contract_agreement_page.http_para' | translate }} +
- When the data offer on the provider side is of the type - HttpData and certain data source fields are set, certain parts - of the request to the data source can be customized from the consumer - side and will be passed to the other connector when initiating the - transfer. This allows an asset to contain more than just one kind of - data, allowing additional filtering or even sharing of entire APIs - with multiple data sets via a single asset and a single contract. + {{ 'contract_agreement_page.http_message' | translate }}
- The resulting URL will look like + {{ 'contract_agreement_page.res_url' | translate }} {{ '{baseUrl}{customSubPath}?{baseQueryParams}&{customQueryParams}' }} @@ -233,8 +240,14 @@

Initiate Transfer

- Custom Method - + {{ + 'contract_agreement_page.cus_meth' | translate + }} + Initiate Transfer >{{ method }} - Requires "proxyMethod" to be "true". + + {{ + 'contract_agreement_page.proxy_method' | translate + }} @@ -251,12 +268,16 @@

Initiate Transfer

- Custom Subpath + {{ + 'contract_agreement_page.cus_sub' | translate + }} - Requires "proxyPath" to be "true". + {{ + 'contract_agreement_page.proxy_path' | translate + }}
@@ -270,19 +291,23 @@

Initiate Transfer

class="flex flex-row space-x-[10px]"> - Custom Query Param Name + {{ + 'contract_agreement_page.cus_query' | translate + }} - Requires "proxyQueryParams" to be "true". + + {{ 'contract_agreement_page.proxy_query' | translate }} + - Value + {{ 'general.value' | translate }} Initiate Transfer color="warn" style="height: 54px; margin-top: 4px; margin-left: 8px" (click)="form.onHttpQueryParamsRemoveClick(i)"> - Remove + {{ 'general.remove' | translate }} @@ -306,7 +331,7 @@

Initiate Transfer

mat-button color="accent" (click)="form.onHttpQueryParamsAddClick()"> - Add Custom Query Param + {{ 'contract_agreement_page.add_cus_query' | translate }}
@@ -314,24 +339,32 @@

Initiate Transfer

- Custom Request Body Content Type + {{ + 'contract_agreement_page.req_cont' | translate + }} - Requires "proxyBody" to be "true". + + {{ 'contract_agreement_page.proxy_body' | translate }} + - Custom Request Body + {{ + 'contract_agreement_page.req_body' | translate + }} - Requires "proxyBody" to be "true". + + {{ 'contract_agreement_page.proxy_body' | translate }} @@ -347,8 +380,12 @@

Initiate Transfer

mat-button [color]="ctrl.value ? 'warn' : 'accent'" (click)="ctrl.setValue(!ctrl.value)"> - {{ ctrl.value ? 'Hide' : 'Show' }} Http Datasource Parameterization - Fields + {{ + ctrl.value + ? ('general.hide' | translate) + : ('general.show' | translate) + }} + {{ 'contract_agreement_page.http_fields' | translate }} @@ -362,7 +399,7 @@

Initiate Transfer

color="default" [mat-dialog-close]="null" [disabled]="loading"> - Cancel + {{ 'general.cancel' | translate }} diff --git a/src/app/routes/connector-ui/contract-agreement-page/contract-agreement-transfer-dialog/contract-agreement-transfer-dialog.component.ts b/src/app/routes/connector-ui/contract-agreement-page/contract-agreement-transfer-dialog/contract-agreement-transfer-dialog.component.ts index d73c7632c..c2ae2e7c2 100644 --- a/src/app/routes/connector-ui/contract-agreement-page/contract-agreement-transfer-dialog/contract-agreement-transfer-dialog.component.ts +++ b/src/app/routes/connector-ui/contract-agreement-page/contract-agreement-transfer-dialog/contract-agreement-transfer-dialog.component.ts @@ -7,15 +7,15 @@ import { InitiateCustomTransferRequest, InitiateTransferRequest, } from '@sovity.de/edc-client'; -import { - DATA_SINK_HTTP_METHODS, - DATA_SOURCE_HTTP_METHODS, -} from 'src/app/component-library/edit-asset-form/edit-asset-form/form/http-methods'; import {EdcApiService} from '../../../../core/services/api/edc-api.service'; import {DataAddressMapper} from '../../../../core/services/data-address-mapper'; import {NotificationService} from '../../../../core/services/notification.service'; import {TransferDataSinkMapper} from '../../../../core/services/transfer-data-sink-mapper'; import {ValidationMessages} from '../../../../core/validators/validation-messages'; +import { + DATA_SINK_HTTP_METHODS, + DATA_SOURCE_HTTP_METHODS, +} from '../../../../shared/business/edit-asset-form/form/http-methods'; import {ContractAgreementTransferDialogData} from './contract-agreement-transfer-dialog-data'; import {ContractAgreementTransferDialogForm} from './contract-agreement-transfer-dialog-form'; import {ContractAgreementTransferDialogFormValue} from './contract-agreement-transfer-dialog-form-model'; diff --git a/src/app/routes/connector-ui/contract-definition-page/asset-select/asset-select.component.ts b/src/app/routes/connector-ui/contract-definition-page/asset-select/asset-select.component.ts index 02059d090..500c812b3 100644 --- a/src/app/routes/connector-ui/contract-definition-page/asset-select/asset-select.component.ts +++ b/src/app/routes/connector-ui/contract-definition-page/asset-select/asset-select.component.ts @@ -1,9 +1,9 @@ import {Component, Input, OnDestroy} from '@angular/core'; import {FormControl} from '@angular/forms'; import {Subject} from 'rxjs'; -import {AssetDetailDialogDataService} from '../../../../component-library/catalog/asset-detail-dialog/asset-detail-dialog-data.service'; -import {AssetDetailDialogService} from '../../../../component-library/catalog/asset-detail-dialog/asset-detail-dialog.service'; import {UiAssetMapped} from '../../../../core/services/models/ui-asset-mapped'; +import {AssetDetailDialogDataService} from '../../../../shared/business/asset-detail-dialog/asset-detail-dialog-data.service'; +import {AssetDetailDialogService} from '../../../../shared/business/asset-detail-dialog/asset-detail-dialog.service'; @Component({ selector: 'asset-select', diff --git a/src/app/routes/connector-ui/contract-definition-page/contract-definition-cards/contract-definition-cards.component.html b/src/app/routes/connector-ui/contract-definition-page/contract-definition-cards/contract-definition-cards.component.html index 5572103d6..f221f9ea0 100644 --- a/src/app/routes/connector-ui/contract-definition-page/contract-definition-cards/contract-definition-cards.component.html +++ b/src/app/routes/connector-ui/contract-definition-page/contract-definition-cards/contract-definition-cards.component.html @@ -12,12 +12,12 @@ {{ card.id }}
- Data Offer + {{ 'general.con_def' | translate }}
- Access Policy + {{ 'general.access_pol' | translate }}
- Contract Policy + {{ 'general.contract_policy' | translate }}
this.edcApiService.deleteContractDefinition(card.id).pipe( tap(() => { diff --git a/src/app/routes/connector-ui/contract-definition-page/contract-definition-editor-dialog/contract-definition-editor-dialog.component.html b/src/app/routes/connector-ui/contract-definition-page/contract-definition-editor-dialog/contract-definition-editor-dialog.component.html index eb7c68dcd..6326b0b34 100644 --- a/src/app/routes/connector-ui/contract-definition-page/contract-definition-editor-dialog/contract-definition-editor-dialog.component.html +++ b/src/app/routes/connector-ui/contract-definition-page/contract-definition-editor-dialog/contract-definition-editor-dialog.component.html @@ -1,4 +1,4 @@ -

Publish New Data Offer

+

{{ 'contract_agreement_page.new_def' | translate }}

@@ -19,20 +19,20 @@

Publish New Data Offer

@@ -40,7 +40,7 @@

Publish New Data Offer

diff --git a/src/app/routes/connector-ui/contract-definition-page/contract-definition-page.module.ts b/src/app/routes/connector-ui/contract-definition-page/contract-definition-page.module.ts index 2791500c1..cd1361de8 100644 --- a/src/app/routes/connector-ui/contract-definition-page/contract-definition-page.module.ts +++ b/src/app/routes/connector-ui/contract-definition-page/contract-definition-page.module.ts @@ -1,27 +1,8 @@ import {CommonModule} from '@angular/common'; import {NgModule} from '@angular/core'; import {FormsModule, ReactiveFormsModule} from '@angular/forms'; -import {MatBadgeModule} from '@angular/material/badge'; -import {MatButtonModule} from '@angular/material/button'; -import {MatCardModule} from '@angular/material/card'; -import {MatCheckboxModule} from '@angular/material/checkbox'; -import {MatChipsModule} from '@angular/material/chips'; -import {MatDatepickerModule} from '@angular/material/datepicker'; -import {MatDialogModule} from '@angular/material/dialog'; -import {MatFormFieldModule} from '@angular/material/form-field'; -import {MatIconModule} from '@angular/material/icon'; -import {MatInputModule} from '@angular/material/input'; -import {MatPaginatorModule} from '@angular/material/paginator'; -import {MatProgressSpinnerModule} from '@angular/material/progress-spinner'; -import {MatSelectModule} from '@angular/material/select'; -import {MatSlideToggleModule} from '@angular/material/slide-toggle'; -import {MatStepperModule} from '@angular/material/stepper'; -import {MatTooltipModule} from '@angular/material/tooltip'; import {RouterModule} from '@angular/router'; -import {CatalogModule} from '../../../component-library/catalog/catalog.module'; -import {JsonDialogModule} from '../../../component-library/json-dialog/json-dialog.module'; -import {PipesAndDirectivesModule} from '../../../component-library/pipes-and-directives/pipes-and-directives.module'; -import {UiElementsModule} from '../../../component-library/ui-elements/ui-elements.module'; +import {SharedModule} from '../../../shared/shared.module'; import {AssetSelectComponent} from './asset-select/asset-select.component'; import {ContractDefinitionCardsComponent} from './contract-definition-cards/contract-definition-cards.component'; import {ContractDefinitionEditorDialog} from './contract-definition-editor-dialog/contract-definition-editor-dialog.component'; @@ -36,29 +17,8 @@ import {PolicySelectComponent} from './policy-select/policy-select.component'; ReactiveFormsModule, RouterModule, - // Angular Material - MatBadgeModule, - MatButtonModule, - MatCardModule, - MatCheckboxModule, - MatChipsModule, - MatDatepickerModule, - MatFormFieldModule, - MatProgressSpinnerModule, - MatSelectModule, - MatSlideToggleModule, - MatStepperModule, - MatTooltipModule, - MatPaginatorModule, - MatInputModule, - MatIconModule, - MatDialogModule, - // EDC UI Modules - CatalogModule, - JsonDialogModule, - PipesAndDirectivesModule, - UiElementsModule, + SharedModule, ], declarations: [ AssetSelectComponent, diff --git a/src/app/routes/connector-ui/contract-definition-page/contract-definition-page/contract-definition-page.component.html b/src/app/routes/connector-ui/contract-definition-page/contract-definition-page/contract-definition-page.component.html index 08adb129e..5d0fd5453 100644 --- a/src/app/routes/connector-ui/contract-definition-page/contract-definition-page/contract-definition-page.component.html +++ b/src/app/routes/connector-ui/contract-definition-page/contract-definition-page/contract-definition-page.component.html @@ -5,7 +5,9 @@ class="search-form-field" appearance="outline" color="accent"> - Search data offers + + {{ 'contract_agreement_page.search_def' | translate }} search @@ -58,7 +60,7 @@ " class="min-h-[35rem]" [emptyMessage]=" - 'No contract definition found with given filter.' + 'contract_agreement_page.con_def' | translate ">
dataOffers.length), Fetched.wrap({ - failureMessage: 'Failed fetching data offers.', + failureMessage: this.translateService.instant( + 'dashboard_page.failed_offers', + ), }), map((numOffers) => ({numCatalogEntries: numOffers})), ); @@ -77,22 +81,37 @@ export class DashboardPageDataService { direction: 'CONSUMING' | 'PROVIDING', ): DonutChartData { const amounts: {label: string; amount: number; color: string}[] = [ - {label: 'Completed', amount: transfers.numOk, color: '#b2e061'}, - {label: 'In Progress', amount: transfers.numRunning, color: '#7eb0d5'}, - {label: 'Error', amount: transfers.numError, color: '#fd7f6f'}, + { + label: this.translateService.instant('dashboard_page.completed'), + amount: transfers.numOk, + color: '#b2e061', + }, + { + label: this.translateService.instant('dashboard_page.progress'), + amount: transfers.numRunning, + color: '#7eb0d5', + }, + { + label: this.translateService.instant('dashboard_page.error'), + amount: transfers.numError, + color: '#fd7f6f', + }, ].filter((it) => it.amount); const total = transfers.numTotal; - + const emptyMessage = + direction === 'CONSUMING' + ? this.translateService.instant('dashboard_page.no_transfer') + : this.translateService.instant('dashboard_page.no_transfer2'); return { - totalLabel: 'Total', + totalLabel: this.translateService.instant('general.total'), totalValue: total, isEmpty: !total, - emptyMessage: `No ${direction} transfer processes.`, + emptyMessage, labels: amounts.map((it) => it.label), datasets: [ { - label: 'Number of Transfer Processes', + label: this.translateService.instant('dashboard_page.num_transfer'), data: amounts.map((it) => it.amount), backgroundColor: amounts.map((it) => it.color), }, @@ -105,22 +124,30 @@ export class DashboardPageDataService { return combineLatest([ this.lastCommitInfoService.getLastCommitInfoData().pipe( Fetched.wrap({ - failureMessage: 'Failed fetching Env and Jar Last Commit Data', + failureMessage: this.translateService.instant( + 'dashboard_page.failed_env', + ), }), ), this.lastCommitInfoService.getUiBuildDateDetails().pipe( Fetched.wrap({ - failureMessage: 'Failed fetching UI Last Build Date Data', + failureMessage: this.translateService.instant( + 'dashboard_page.failed_ui_build', + ), }), ), this.lastCommitInfoService.getUiCommitDetails().pipe( Fetched.wrap({ - failureMessage: 'Failed fetching UI Last Commit Data', + failureMessage: this.translateService.instant( + 'dashboard_page.failed_ui', + ), }), ), this.edcApiService.getDashboardPage().pipe( Fetched.wrap({ - failureMessage: 'Failed fetching Dashboard Page Data', + failureMessage: this.translateService.instant( + 'dashboard_page.failed_dashboard', + ), }), ), ]).pipe( diff --git a/src/app/routes/connector-ui/dashboard-page/dashboard-page/dashboard-page-data.ts b/src/app/routes/connector-ui/dashboard-page/dashboard-page/dashboard-page-data.ts index 6c9b849ad..41b9d8b7d 100644 --- a/src/app/routes/connector-ui/dashboard-page/dashboard-page/dashboard-page-data.ts +++ b/src/app/routes/connector-ui/dashboard-page/dashboard-page/dashboard-page-data.ts @@ -1,5 +1,5 @@ -import {PropertyGridGroup} from '../../../../component-library/property-grid/property-grid-group/property-grid-group'; import {Fetched} from '../../../../core/services/models/fetched'; +import {PropertyGridGroup} from '../../../../shared/common/property-grid-group/property-grid-group'; import {DonutChartData} from '../dashboard-donut-chart/donut-chart-data'; export interface DashboardPageData { diff --git a/src/app/routes/connector-ui/dashboard-page/dashboard-page/dashboard-page.component.html b/src/app/routes/connector-ui/dashboard-page/dashboard-page/dashboard-page.component.html index 75fd3aa60..6b6e77be0 100644 --- a/src/app/routes/connector-ui/dashboard-page/dashboard-page/dashboard-page.component.html +++ b/src/app/routes/connector-ui/dashboard-page/dashboard-page/dashboard-page.component.html @@ -2,8 +2,12 @@
- Incoming Data - Transfer Processes + {{ + 'dashboard_page.inc_data' | translate + }} + {{ + 'dashboard_page.trans_pro' | translate + }}
@@ -11,8 +15,12 @@ - Outgoing Data - Transfer Processes + {{ + 'dashboard_page.out_data' | translate + }} + {{ + 'dashboard_page.trans_pro' | translate + }}
@@ -23,33 +31,37 @@
- Connector Properties - Additional Properties + {{ + 'dashboard_page.conn_prop' | translate + }} + {{ + 'dashboard_page.add_prop' | translate + }} @@ -59,7 +71,9 @@
- Get Managed EDC - Connector-as-a-Service + {{ + 'dashboard_page.managed_edc' | translate + }} + {{ + 'dashboard_page.conn_service' | translate + }}

- To join data spaces like Mobility Data Space or - Catena-X within minutes, consider the managed solution by + {{ 'dashboard_page.marketing_ce_intro' | translate }} sovity - - the Connector-as-a-Service (CaaS) based on open-source - software enriched with key enterprise features. + {{ 'dashboard_page.marketing_ce_intro2' | translate }}

- Contact + {{ 'dashboard_page.contact' | translate }} - About EDC - Eclipse Dataspace Components + {{ 'dashboard_page.about' | translate }} + {{ + 'dashboard_page.eclipse' | translate + }}

- The Eclipse Dataspace Components framework facilitates - sovereign, inter-organizational data exchange. + {{ 'dashboard_page.marketing_about' | translate }}

- It implements the International Data Spaces standard (IDS) as - well as relevant protocols associated with GAIA-X. + {{ 'dashboard_page.marketing_about2' | translate }}

- The framework is designed as extensible as possible to encourage - integrations into various data ecosystems. + {{ 'dashboard_page.marketing_about3' | translate }}

- About EDC UI - Data Dashboard + {{ + 'dashboard_page.about_ui' | translate + }} + {{ + 'dashboard_page.data_dashboard' | translate + }}

- Example use cases, that you can try out with this application, are: + {{ 'dashboard_page.marketing_about_ui' | translate }}

diff --git a/src/app/component-library/error-404-component/page-not-found.component.html b/src/app/routes/connector-ui/page-not-found-page/page-not-found-page.component.html similarity index 100% rename from src/app/component-library/error-404-component/page-not-found.component.html rename to src/app/routes/connector-ui/page-not-found-page/page-not-found-page.component.html diff --git a/src/app/component-library/error-404-component/page-not-found.component.ts b/src/app/routes/connector-ui/page-not-found-page/page-not-found-page.component.ts similarity index 70% rename from src/app/component-library/error-404-component/page-not-found.component.ts rename to src/app/routes/connector-ui/page-not-found-page/page-not-found-page.component.ts index 1d403c2c8..db210a297 100644 --- a/src/app/component-library/error-404-component/page-not-found.component.ts +++ b/src/app/routes/connector-ui/page-not-found-page/page-not-found-page.component.ts @@ -1,10 +1,10 @@ import {Component, HostBinding} from '@angular/core'; @Component({ - selector: 'app-page-not-found', - templateUrl: './page-not-found.component.html', + selector: 'app-page-not-found-page', + templateUrl: './page-not-found-page.component.html', }) -export class PageNotFoundComponent { +export class PageNotFoundPageComponent { @HostBinding('class.container') @HostBinding('class.flex') @HostBinding('class.items-center') diff --git a/src/app/routes/connector-ui/page-not-found-page/page-not-found-page.module.ts b/src/app/routes/connector-ui/page-not-found-page/page-not-found-page.module.ts new file mode 100644 index 000000000..3a17739ca --- /dev/null +++ b/src/app/routes/connector-ui/page-not-found-page/page-not-found-page.module.ts @@ -0,0 +1,15 @@ +import {CommonModule} from '@angular/common'; +import {NgModule} from '@angular/core'; +import {RouterModule} from '@angular/router'; +import {PageNotFoundPageComponent} from './page-not-found-page.component'; + +@NgModule({ + imports: [ + // Angular + CommonModule, + RouterModule, + ], + declarations: [PageNotFoundPageComponent], + exports: [PageNotFoundPageComponent], +}) +export class PageNotFoundPageModule {} diff --git a/src/app/routes/connector-ui/policy-definition-create-page/policy-definition-create-page.module.ts b/src/app/routes/connector-ui/policy-definition-create-page/policy-definition-create-page.module.ts index f1c4e1004..84d6c92bd 100644 --- a/src/app/routes/connector-ui/policy-definition-create-page/policy-definition-create-page.module.ts +++ b/src/app/routes/connector-ui/policy-definition-create-page/policy-definition-create-page.module.ts @@ -1,27 +1,9 @@ import {CommonModule} from '@angular/common'; import {NgModule} from '@angular/core'; import {FormsModule, ReactiveFormsModule} from '@angular/forms'; -import {MatBadgeModule} from '@angular/material/badge'; -import {MatButtonModule} from '@angular/material/button'; -import {MatCardModule} from '@angular/material/card'; -import {MatCheckboxModule} from '@angular/material/checkbox'; -import {MatChipsModule} from '@angular/material/chips'; -import {MatDatepickerModule} from '@angular/material/datepicker'; -import {MatDialogModule} from '@angular/material/dialog'; -import {MatDividerModule} from '@angular/material/divider'; -import {MatFormFieldModule} from '@angular/material/form-field'; -import {MatIconModule} from '@angular/material/icon'; -import {MatInputModule} from '@angular/material/input'; -import {MatMenuModule} from '@angular/material/menu'; -import {MatPaginatorModule} from '@angular/material/paginator'; -import {MatProgressSpinnerModule} from '@angular/material/progress-spinner'; -import {MatSelectModule} from '@angular/material/select'; -import {MatTooltipModule} from '@angular/material/tooltip'; import {RouterModule} from '@angular/router'; -import {JsonDialogModule} from '../../../component-library/json-dialog/json-dialog.module'; -import {PipesAndDirectivesModule} from '../../../component-library/pipes-and-directives/pipes-and-directives.module'; -import {PolicyEditorModule} from '../../../component-library/policy-editor/policy-editor.module'; -import {UiElementsModule} from '../../../component-library/ui-elements/ui-elements.module'; +import {TranslateModule} from '@ngx-translate/core'; +import {SharedModule} from '../../../shared/shared.module'; import {PolicyDefinitionCreatePageComponent} from './policy-definition-create-page/policy-definition-create-page.component'; @NgModule({ @@ -31,30 +13,10 @@ import {PolicyDefinitionCreatePageComponent} from './policy-definition-create-pa FormsModule, ReactiveFormsModule, RouterModule, - - // Angular Material - MatBadgeModule, - MatButtonModule, - MatCardModule, - MatCheckboxModule, - MatChipsModule, - MatDividerModule, - MatDatepickerModule, - MatFormFieldModule, - MatMenuModule, - MatProgressSpinnerModule, - MatSelectModule, - MatTooltipModule, - MatPaginatorModule, - MatInputModule, - MatIconModule, - MatDialogModule, + TranslateModule, // EDC UI Modules - PolicyEditorModule, - UiElementsModule, - JsonDialogModule, - PipesAndDirectivesModule, + SharedModule, ], declarations: [PolicyDefinitionCreatePageComponent], exports: [PolicyDefinitionCreatePageComponent], diff --git a/src/app/routes/connector-ui/policy-definition-create-page/policy-definition-create-page/policy-definition-create-page-form.ts b/src/app/routes/connector-ui/policy-definition-create-page/policy-definition-create-page/policy-definition-create-page-form.ts index ad66bdab3..e068e10eb 100644 --- a/src/app/routes/connector-ui/policy-definition-create-page/policy-definition-create-page/policy-definition-create-page-form.ts +++ b/src/app/routes/connector-ui/policy-definition-create-page/policy-definition-create-page/policy-definition-create-page-form.ts @@ -1,8 +1,8 @@ import {Injectable} from '@angular/core'; import {FormBuilder, FormGroup, Validators} from '@angular/forms'; import {DataOfferFormValidators} from 'src/app/core/validators/data-offer-form-validators'; -import {ExpressionFormControls} from '../../../../component-library/policy-editor/editor/expression-form-controls'; import {noWhitespacesOrColonsValidator} from '../../../../core/validators/no-whitespaces-or-colons-validator'; +import {ExpressionFormControls} from '../../../../shared/business/policy-editor/editor/expression-form-controls'; import { PolicyDefinitionCreatePageFormModel, PolicyDefinitionCreatePageFormValue, diff --git a/src/app/routes/connector-ui/policy-definition-create-page/policy-definition-create-page/policy-definition-create-page.component.html b/src/app/routes/connector-ui/policy-definition-create-page/policy-definition-create-page/policy-definition-create-page.component.html index 79c30368a..be0829ea6 100644 --- a/src/app/routes/connector-ui/policy-definition-create-page/policy-definition-create-page/policy-definition-create-page.component.html +++ b/src/app/routes/connector-ui/policy-definition-create-page/policy-definition-create-page/policy-definition-create-page.component.html @@ -1,5 +1,7 @@
-
Policy Metadata
+
+ {{ 'policy_definition_page.metadata' | translate }} +
-
Policy Expression
+
+ {{ 'policy_definition_page.expression' | translate }} +
diff --git a/src/app/routes/connector-ui/policy-definition-create-page/policy-definition-create-page/policy-definition-create-page.component.ts b/src/app/routes/connector-ui/policy-definition-create-page/policy-definition-create-page/policy-definition-create-page.component.ts index 354ef8568..e0d9d0c2a 100644 --- a/src/app/routes/connector-ui/policy-definition-create-page/policy-definition-create-page/policy-definition-create-page.component.ts +++ b/src/app/routes/connector-ui/policy-definition-create-page/policy-definition-create-page/policy-definition-create-page.component.ts @@ -2,20 +2,20 @@ import {Component, OnDestroy} from '@angular/core'; import {Router} from '@angular/router'; import {Subject} from 'rxjs'; import {finalize, takeUntil} from 'rxjs/operators'; +import {TranslateService} from '@ngx-translate/core'; import {PolicyDefinitionCreateDto} from '@sovity.de/edc-client'; -import {ExpressionFormControls} from '../../../../component-library/policy-editor/editor/expression-form-controls'; -import {ExpressionFormHandler} from '../../../../component-library/policy-editor/editor/expression-form-handler'; import {EdcApiService} from '../../../../core/services/api/edc-api.service'; import {NotificationService} from '../../../../core/services/notification.service'; import {ValidationMessages} from '../../../../core/validators/validation-messages'; +import {ExpressionFormHandler} from '../../../../shared/business/policy-editor/editor/expression-form-handler'; +import {policyFormRequiredViewProviders} from '../../../../shared/business/policy-editor/editor/policy-form-required-providers'; import {PolicyDefinitionCreatePageForm} from './policy-definition-create-page-form'; @Component({ selector: 'policy-definition-create-page', templateUrl: './policy-definition-create-page.component.html', viewProviders: [ - ExpressionFormHandler, - ExpressionFormControls, + ...policyFormRequiredViewProviders, PolicyDefinitionCreatePageForm, ], }) @@ -29,6 +29,7 @@ export class PolicyDefinitionCreatePageComponent implements OnDestroy { public validationMessages: ValidationMessages, private edcApiService: EdcApiService, private notificationService: NotificationService, + private translateService: TranslateService, ) {} onSave() { @@ -46,12 +47,17 @@ export class PolicyDefinitionCreatePageComponent implements OnDestroy { ) .subscribe({ complete: () => { - this.notificationService.showInfo('Successfully created policy.'); + this.notificationService.showInfo( + this.translateService.instant('notification.succ_pol'), + ); this.router.navigate(['/policies']); }, error: (error) => { - console.error('Failed creating Policy!', error); - this.notificationService.showError('Failed creating policy!'); + const message = this.translateService.instant( + 'notification.failed_create_policy', + ); + console.error(message, error); + this.notificationService.showError(message); }, }); } diff --git a/src/app/routes/connector-ui/policy-definition-page/policy-cards/policy-card-builder.ts b/src/app/routes/connector-ui/policy-definition-page/policy-cards/policy-card-builder.ts index 58c32cd6b..11f49b8f5 100644 --- a/src/app/routes/connector-ui/policy-definition-page/policy-cards/policy-card-builder.ts +++ b/src/app/routes/connector-ui/policy-definition-page/policy-cards/policy-card-builder.ts @@ -1,6 +1,6 @@ import {Injectable} from '@angular/core'; import {PolicyDefinitionDto, PolicyDefinitionPage} from '@sovity.de/edc-client'; -import {PolicyMapper} from '../../../../component-library/policy-editor/model/policy-mapper'; +import {PolicyMapper} from '../../../../shared/business/policy-editor/model/policy-mapper'; import {PolicyCard} from './policy-card'; @Injectable({providedIn: 'root'}) diff --git a/src/app/routes/connector-ui/policy-definition-page/policy-cards/policy-card.ts b/src/app/routes/connector-ui/policy-definition-page/policy-cards/policy-card.ts index fe7779830..1953da00a 100644 --- a/src/app/routes/connector-ui/policy-definition-page/policy-cards/policy-card.ts +++ b/src/app/routes/connector-ui/policy-definition-page/policy-cards/policy-card.ts @@ -1,4 +1,4 @@ -import {PolicyExpressionMapped} from '../../../../component-library/policy-editor/model/policy-expression-mapped'; +import {PolicyExpressionMapped} from '../../../../shared/business/policy-editor/model/policy-expression-mapped'; export interface PolicyCard { id: string; diff --git a/src/app/routes/connector-ui/policy-definition-page/policy-cards/policy-cards.component.html b/src/app/routes/connector-ui/policy-definition-page/policy-cards/policy-cards.component.html index a0fabfb9b..d63600a11 100644 --- a/src/app/routes/connector-ui/policy-definition-page/policy-cards/policy-cards.component.html +++ b/src/app/routes/connector-ui/policy-definition-page/policy-cards/policy-cards.component.html @@ -12,7 +12,7 @@ {{ policyCard.id }} - Policy + {{ 'general.policy' | translate }} ; const data: JsonDialogData = { title: policyCard.id, - subtitle: 'Policy', + subtitle: this.translateService.instant('general.policy'), icon: 'policy', objectForJson: policyCard.objectForJson, toolbarButton: { - text: 'Delete', + text: this.translateService.instant('general.delete'), icon: 'delete', - confirmation: ConfirmDialogModel.forDelete('policy', policyCard.id), + confirmation: ConfirmDialogModel.forDelete( + 'general.policy', + policyCard.id, + this.translateService, + ), action: () => this.edcApiService.deletePolicyDefinition(policyCard.id).pipe( tap(() => { diff --git a/src/app/routes/connector-ui/policy-definition-page/policy-definition-page.module.ts b/src/app/routes/connector-ui/policy-definition-page/policy-definition-page.module.ts index 3d6baaabd..003dbeca1 100644 --- a/src/app/routes/connector-ui/policy-definition-page/policy-definition-page.module.ts +++ b/src/app/routes/connector-ui/policy-definition-page/policy-definition-page.module.ts @@ -1,24 +1,8 @@ import {CommonModule} from '@angular/common'; import {NgModule} from '@angular/core'; import {FormsModule, ReactiveFormsModule} from '@angular/forms'; -import {MatBadgeModule} from '@angular/material/badge'; -import {MatButtonModule} from '@angular/material/button'; -import {MatCardModule} from '@angular/material/card'; -import {MatCheckboxModule} from '@angular/material/checkbox'; -import {MatChipsModule} from '@angular/material/chips'; -import {MatDatepickerModule} from '@angular/material/datepicker'; -import {MatDialogModule} from '@angular/material/dialog'; -import {MatFormFieldModule} from '@angular/material/form-field'; -import {MatIconModule} from '@angular/material/icon'; -import {MatInputModule} from '@angular/material/input'; -import {MatPaginatorModule} from '@angular/material/paginator'; -import {MatProgressSpinnerModule} from '@angular/material/progress-spinner'; -import {MatSelectModule} from '@angular/material/select'; -import {MatTooltipModule} from '@angular/material/tooltip'; import {RouterModule} from '@angular/router'; -import {JsonDialogModule} from '../../../component-library/json-dialog/json-dialog.module'; -import {PolicyEditorModule} from '../../../component-library/policy-editor/policy-editor.module'; -import {UiElementsModule} from '../../../component-library/ui-elements/ui-elements.module'; +import {SharedModule} from '../../../shared/shared.module'; import {PolicyCardsComponent} from './policy-cards/policy-cards.component'; import {PolicyDefinitionPageComponent} from './policy-definition-page/policy-definition-page.component'; @@ -30,26 +14,8 @@ import {PolicyDefinitionPageComponent} from './policy-definition-page/policy-def ReactiveFormsModule, RouterModule, - // Angular Material - MatBadgeModule, - MatButtonModule, - MatCardModule, - MatCheckboxModule, - MatChipsModule, - MatDatepickerModule, - MatFormFieldModule, - MatProgressSpinnerModule, - MatSelectModule, - MatTooltipModule, - MatPaginatorModule, - MatInputModule, - MatIconModule, - MatDialogModule, - // EDC UI Modules - PolicyEditorModule, - UiElementsModule, - JsonDialogModule, + SharedModule, ], declarations: [PolicyCardsComponent, PolicyDefinitionPageComponent], exports: [PolicyDefinitionPageComponent], diff --git a/src/app/routes/connector-ui/policy-definition-page/policy-definition-page/policy-definition-page.component.html b/src/app/routes/connector-ui/policy-definition-page/policy-definition-page/policy-definition-page.component.html index 1e34bee36..127a047de 100644 --- a/src/app/routes/connector-ui/policy-definition-page/policy-definition-page/policy-definition-page.component.html +++ b/src/app/routes/connector-ui/policy-definition-page/policy-definition-page/policy-definition-page.component.html @@ -5,7 +5,9 @@ class="search-form-field" appearance="outline" color="accent"> - Search policies + {{ + 'policy_definition_page.search_pol' | translate + }} search @@ -55,7 +57,9 @@ !policyList.data.policyCards.length) " class="min-h-[35rem]" - [emptyMessage]="'No policy found with given filter.'"> + [emptyMessage]=" + 'policy_definition_page.no_pol' | translate + ">
+ [emptyMessage]=" + 'tranfer_history_page.no_trans' | translate + ">
- Direction + {{ 'general.direction' | translate }} @@ -47,14 +49,16 @@ - Last updated + {{ 'general.updated' | translate }} - Asset + + {{ 'general.asset' | translate }} +
- State + {{ 'general.state' | translate }}
@@ -104,7 +108,7 @@ - Counterparty {{ participantIdLocalization.participantId }} + {{ 'transfer_history_page.counter_id' | translate }} {{ item.counterPartyParticipantId }} @@ -112,7 +116,7 @@ - Counterparty Connector Endpoint + {{ 'transfer_history_page.counter_endpoint' | translate }} {{ item.counterPartyConnectorEndpoint }} @@ -120,14 +124,14 @@ - Details + {{ 'general.details' | translate }} - {{ 'Show Details' }} + {{ 'general.details' | translate }} diff --git a/src/app/routes/connector-ui/transfer-history-page/transfer-history-page/transfer-history-page.component.ts b/src/app/routes/connector-ui/transfer-history-page/transfer-history-page/transfer-history-page.component.ts index abc70ba92..baa1dd7bf 100644 --- a/src/app/routes/connector-ui/transfer-history-page/transfer-history-page/transfer-history-page.component.ts +++ b/src/app/routes/connector-ui/transfer-history-page/transfer-history-page/transfer-history-page.component.ts @@ -9,20 +9,21 @@ import { switchMap, } from 'rxjs'; import {catchError, map} from 'rxjs/operators'; +import {TranslateService} from '@ngx-translate/core'; import { TransferHistoryEntry, TransferHistoryPage, UiAsset, } from '@sovity.de/edc-client'; -import {AssetDetailDialogDataService} from '../../../../component-library/catalog/asset-detail-dialog/asset-detail-dialog-data.service'; -import {AssetDetailDialogService} from '../../../../component-library/catalog/asset-detail-dialog/asset-detail-dialog.service'; -import {JsonDialogService} from '../../../../component-library/json-dialog/json-dialog/json-dialog.service'; import {EdcApiService} from '../../../../core/services/api/edc-api.service'; import {AssetBuilder} from '../../../../core/services/asset-builder'; import {Fetched} from '../../../../core/services/models/fetched'; import {UiAssetMapped} from '../../../../core/services/models/ui-asset-mapped'; import {NotificationService} from '../../../../core/services/notification.service'; import {ParticipantIdLocalization} from '../../../../core/services/participant-id-localization'; +import {AssetDetailDialogDataService} from '../../../../shared/business/asset-detail-dialog/asset-detail-dialog-data.service'; +import {AssetDetailDialogService} from '../../../../shared/business/asset-detail-dialog/asset-detail-dialog.service'; +import {JsonDialogService} from '../../../../shared/common/json-dialog/json-dialog.service'; @Component({ selector: 'transfer-history-page', @@ -51,13 +52,16 @@ export class TransferHistoryPageComponent implements OnInit, OnDestroy { private notificationService: NotificationService, private jsonDialogService: JsonDialogService, public participantIdLocalization: ParticipantIdLocalization, + private translateService: TranslateService, ) {} onTransferHistoryDetailsClick(item: TransferHistoryEntry) { this.jsonDialogService.showJsonDetailDialog( { title: item.assetName ?? item.assetId, - subtitle: 'Transfer History Details', + subtitle: this.translateService.instant( + 'transfer_history_page.subtitle', + ), icon: 'assignment', objectForJson: item, }, @@ -79,8 +83,11 @@ export class TransferHistoryPageComponent implements OnInit, OnDestroy { this.assetDetailDialogService.open(data, this.ngOnDestroy$); }, error: (error) => { - console.error('Failed to fetch asset details!', error); - this.notificationService.showError('Failed to fetch asset details!'); + const message = this.translateService.instant( + 'notification.failed_transfer_detail_fetch', + ); + console.error(message, error); + this.notificationService.showError(message); }, }); } diff --git a/src/app/shared.module.ts b/src/app/shared.module.ts deleted file mode 100644 index 494938a7f..000000000 --- a/src/app/shared.module.ts +++ /dev/null @@ -1,87 +0,0 @@ -import {CommonModule} from '@angular/common'; -import {NgModule} from '@angular/core'; -import {MatButtonModule} from '@angular/material/button'; -import {MatCardModule} from '@angular/material/card'; -import {MatChipsModule} from '@angular/material/chips'; -import { - DateAdapter, - MAT_DATE_LOCALE, - MatNativeDateModule, -} from '@angular/material/core'; -import {MatDatepickerModule} from '@angular/material/datepicker'; -import {MatDialogModule} from '@angular/material/dialog'; -import {MatDividerModule} from '@angular/material/divider'; -import { - MAT_FORM_FIELD_DEFAULT_OPTIONS, - MatFormFieldDefaultOptions, - MatFormFieldModule, -} from '@angular/material/form-field'; -import {MatIconModule} from '@angular/material/icon'; -import {MatInputModule} from '@angular/material/input'; -import {MatListModule} from '@angular/material/list'; -import {MatMenuModule} from '@angular/material/menu'; -import {MatSelectModule} from '@angular/material/select'; -import {MatSidenavModule} from '@angular/material/sidenav'; -import {MatSnackBarModule} from '@angular/material/snack-bar'; -import {MatToolbarModule} from '@angular/material/toolbar'; -import { - MAT_TOOLTIP_DEFAULT_OPTIONS, - MAT_TOOLTIP_DEFAULT_OPTIONS_FACTORY, - MatTooltipDefaultOptions, - MatTooltipModule, -} from '@angular/material/tooltip'; -import {CustomDateAdapter} from './core/adapters/custom-date-adapter'; - -const MODULES = [ - MatButtonModule, - MatCardModule, - MatChipsModule, - MatDatepickerModule, - MatDialogModule, - MatDividerModule, - MatFormFieldModule, - MatIconModule, - MatInputModule, - MatListModule, - MatMenuModule, - MatNativeDateModule, - MatSelectModule, - MatSidenavModule, - MatSnackBarModule, - MatToolbarModule, - MatTooltipModule, -]; - -const COMPONENTS: NgModule['declarations'] = []; - -@NgModule({ - imports: [ - // Angular - CommonModule, - - // Angular Material - ...MODULES, - ], - exports: [...MODULES, ...COMPONENTS], - declarations: COMPONENTS, - providers: [ - {provide: DateAdapter, useClass: CustomDateAdapter}, - - {provide: MAT_DATE_LOCALE, useValue: 'en-GB'}, - { - provide: MAT_FORM_FIELD_DEFAULT_OPTIONS, - useValue: { - appearance: 'outline', - color: 'accent', - } as MatFormFieldDefaultOptions, - }, - { - provide: MAT_TOOLTIP_DEFAULT_OPTIONS, - useValue: { - ...MAT_TOOLTIP_DEFAULT_OPTIONS_FACTORY(), - disableTooltipInteractivity: true, - }, - }, - ], -}) -export class SharedModule {} diff --git a/src/app/component-library/catalog/asset-card-tag-list/asset-card-tag-list.component.html b/src/app/shared/business/asset-card-tag-list/asset-card-tag-list.component.html similarity index 100% rename from src/app/component-library/catalog/asset-card-tag-list/asset-card-tag-list.component.html rename to src/app/shared/business/asset-card-tag-list/asset-card-tag-list.component.html diff --git a/src/app/component-library/catalog/asset-card-tag-list/asset-card-tag-list.component.ts b/src/app/shared/business/asset-card-tag-list/asset-card-tag-list.component.ts similarity index 100% rename from src/app/component-library/catalog/asset-card-tag-list/asset-card-tag-list.component.ts rename to src/app/shared/business/asset-card-tag-list/asset-card-tag-list.component.ts diff --git a/src/app/component-library/catalog/asset-detail-dialog/asset-detail-dialog-data.service.ts b/src/app/shared/business/asset-detail-dialog/asset-detail-dialog-data.service.ts similarity index 95% rename from src/app/component-library/catalog/asset-detail-dialog/asset-detail-dialog-data.service.ts rename to src/app/shared/business/asset-detail-dialog/asset-detail-dialog-data.service.ts index 4a29a29f9..4680aa20d 100644 --- a/src/app/component-library/catalog/asset-detail-dialog/asset-detail-dialog-data.service.ts +++ b/src/app/shared/business/asset-detail-dialog/asset-detail-dialog-data.service.ts @@ -1,4 +1,5 @@ import {Injectable} from '@angular/core'; +import {TranslateService} from '@ngx-translate/core'; import {DataOffer} from '../../../core/services/models/data-offer'; import {UiAssetMapped} from '../../../core/services/models/ui-asset-mapped'; import {ContractAgreementCardMapped} from '../../../routes/connector-ui/contract-agreement-page/contract-agreement-cards/contract-agreement-card-mapped'; @@ -12,6 +13,7 @@ import {AssetPropertyGridGroupBuilder} from './asset-property-grid-group-builder export class AssetDetailDialogDataService { constructor( private assetPropertyGridGroupBuilder: AssetPropertyGridGroupBuilder, + private translateService: TranslateService, ) {} assetDetailsReadonly(asset: UiAssetMapped): AssetDetailDialogData { @@ -89,7 +91,7 @@ export class AssetDetailDialogDataService { ), this.assetPropertyGridGroupBuilder.buildAssetPropertiesGroup( asset, - 'Asset', + this.translateService.instant('general.asset'), ), ...this.assetPropertyGridGroupBuilder.buildAdditionalPropertiesGroups( asset, diff --git a/src/app/component-library/catalog/asset-detail-dialog/asset-detail-dialog-data.ts b/src/app/shared/business/asset-detail-dialog/asset-detail-dialog-data.ts similarity index 90% rename from src/app/component-library/catalog/asset-detail-dialog/asset-detail-dialog-data.ts rename to src/app/shared/business/asset-detail-dialog/asset-detail-dialog-data.ts index 550156d83..a40a6f6b5 100644 --- a/src/app/component-library/catalog/asset-detail-dialog/asset-detail-dialog-data.ts +++ b/src/app/shared/business/asset-detail-dialog/asset-detail-dialog-data.ts @@ -1,7 +1,7 @@ import {UiAssetMapped} from 'src/app/core/services/models/ui-asset-mapped'; import {DataOffer} from '../../../core/services/models/data-offer'; import {ContractAgreementCardMapped} from '../../../routes/connector-ui/contract-agreement-page/contract-agreement-cards/contract-agreement-card-mapped'; -import {PropertyGridGroup} from '../../property-grid/property-grid-group/property-grid-group'; +import {PropertyGridGroup} from '../../common/property-grid-group/property-grid-group'; export interface AssetDetailDialogData { type: 'asset-details' | 'data-offer' | 'contract-agreement'; diff --git a/src/app/component-library/catalog/asset-detail-dialog/asset-detail-dialog-result.ts b/src/app/shared/business/asset-detail-dialog/asset-detail-dialog-result.ts similarity index 100% rename from src/app/component-library/catalog/asset-detail-dialog/asset-detail-dialog-result.ts rename to src/app/shared/business/asset-detail-dialog/asset-detail-dialog-result.ts diff --git a/src/app/component-library/catalog/asset-detail-dialog/asset-detail-dialog.component.html b/src/app/shared/business/asset-detail-dialog/asset-detail-dialog.component.html similarity index 92% rename from src/app/component-library/catalog/asset-detail-dialog/asset-detail-dialog.component.html rename to src/app/shared/business/asset-detail-dialog/asset-detail-dialog.component.html index 42ee62df3..a4591d304 100644 --- a/src/app/component-library/catalog/asset-detail-dialog/asset-detail-dialog.component.html +++ b/src/app/shared/business/asset-detail-dialog/asset-detail-dialog.component.html @@ -39,14 +39,14 @@ @@ -122,7 +122,7 @@
- Transfer History + {{ 'component_library.t_history' | translate }}
@@ -171,7 +171,7 @@
- Negotiate + [matTooltip]="'tooltip.negotiate' | translate"> + {{ 'component_library.negotiate' | translate }} @@ -234,7 +236,7 @@ color="primary" [disabled]="data.contractAgreement?.isTerminated" (click)="onTransferClick()"> - Transfer + {{ 'component_library.transfer' | translate }}
diff --git a/src/app/component-library/catalog/asset-detail-dialog/asset-detail-dialog.component.scss b/src/app/shared/business/asset-detail-dialog/asset-detail-dialog.component.scss similarity index 100% rename from src/app/component-library/catalog/asset-detail-dialog/asset-detail-dialog.component.scss rename to src/app/shared/business/asset-detail-dialog/asset-detail-dialog.component.scss diff --git a/src/app/component-library/catalog/asset-detail-dialog/asset-detail-dialog.component.ts b/src/app/shared/business/asset-detail-dialog/asset-detail-dialog.component.ts similarity index 95% rename from src/app/component-library/catalog/asset-detail-dialog/asset-detail-dialog.component.ts rename to src/app/shared/business/asset-detail-dialog/asset-detail-dialog.component.ts index 5ada2c9af..3c7e526fb 100644 --- a/src/app/component-library/catalog/asset-detail-dialog/asset-detail-dialog.component.ts +++ b/src/app/shared/business/asset-detail-dialog/asset-detail-dialog.component.ts @@ -7,6 +7,7 @@ import { } from '@angular/material/dialog'; import {Observable, Subject, isObservable} from 'rxjs'; import {filter, finalize, takeUntil} from 'rxjs/operators'; +import {TranslateService} from '@ngx-translate/core'; import {UiContractOffer} from '@sovity.de/edc-client'; import {MailtoLinkBuilder} from 'src/app/core/services/mailto-link-builder'; import {EdcApiService} from '../../../core/services/api/edc-api.service'; @@ -23,8 +24,8 @@ import {ContractAgreementTransferDialogComponent} from '../../../routes/connecto import { ConfirmDialogModel, ConfirmationDialogComponent, -} from '../../confirmation-dialog/confirmation-dialog/confirmation-dialog.component'; -import {PropertyGridGroup} from '../../property-grid/property-grid-group/property-grid-group'; +} from '../../common/confirmation-dialog/confirmation-dialog.component'; +import {PropertyGridGroup} from '../../common/property-grid-group/property-grid-group'; import {AssetDetailDialogData} from './asset-detail-dialog-data'; import {AssetDetailDialogResult} from './asset-detail-dialog-result'; @@ -89,6 +90,7 @@ export class AssetDetailDialogComponent implements OnDestroy { public contractNegotiationService: ContractNegotiationService, private mailtoLinkBuilder: MailtoLinkBuilder, @Inject(DOCUMENT) private document: Document, + private translateService: TranslateService, ) { if (isObservable(this._data)) { this._data @@ -197,7 +199,11 @@ export class AssetDetailDialogComponent implements OnDestroy { } private confirmDelete(): Observable { - const dialogData = ConfirmDialogModel.forDelete('asset', this.asset.title); + const dialogData = ConfirmDialogModel.forDelete( + 'general.asset', + this.asset.title, + this.translateService, + ); const ref = this.matDialog.open(ConfirmationDialogComponent, { maxWidth: '20%', data: dialogData, diff --git a/src/app/component-library/catalog/asset-detail-dialog/asset-detail-dialog.service.ts b/src/app/shared/business/asset-detail-dialog/asset-detail-dialog.service.ts similarity index 100% rename from src/app/component-library/catalog/asset-detail-dialog/asset-detail-dialog.service.ts rename to src/app/shared/business/asset-detail-dialog/asset-detail-dialog.service.ts diff --git a/src/app/component-library/catalog/asset-detail-dialog/asset-property-grid-group-builder.ts b/src/app/shared/business/asset-detail-dialog/asset-property-grid-group-builder.ts similarity index 73% rename from src/app/component-library/catalog/asset-detail-dialog/asset-property-grid-group-builder.ts rename to src/app/shared/business/asset-detail-dialog/asset-property-grid-group-builder.ts index 94f6974db..5007ffcc6 100644 --- a/src/app/component-library/catalog/asset-detail-dialog/asset-property-grid-group-builder.ts +++ b/src/app/shared/business/asset-detail-dialog/asset-property-grid-group-builder.ts @@ -1,25 +1,27 @@ import {Injectable} from '@angular/core'; +import {TranslateService} from '@ngx-translate/core'; import {UiPolicy} from '@sovity.de/edc-client'; import {ActiveFeatureSet} from '../../../core/config/active-feature-set'; import {UiAssetMapped} from '../../../core/services/models/ui-asset-mapped'; import {ParticipantIdLocalization} from '../../../core/services/participant-id-localization'; import {ContractAgreementCardMapped} from '../../../routes/connector-ui/contract-agreement-page/contract-agreement-cards/contract-agreement-card-mapped'; -import {ConditionsForUseDialogService} from '../../conditions-for-use-dialog/conditions-for-use-dialog/conditions-for-use-dialog.service'; -import {PropertyGridGroup} from '../../property-grid/property-grid-group/property-grid-group'; -import {PropertyGridField} from '../../property-grid/property-grid/property-grid-field'; -import {PropertyGridFieldService} from '../../property-grid/property-grid/property-grid-field.service'; -import {UrlListDialogService} from '../../url-list-dialog/url-list-dialog/url-list-dialog.service'; +import {PropertyGridGroup} from '../../common/property-grid-group/property-grid-group'; +import {PropertyGridField} from '../../common/property-grid/property-grid-field'; +import {PropertyGridFieldService} from '../../common/property-grid/property-grid-field.service'; +import {UrlListDialogService} from '../../common/url-list-dialog/url-list-dialog.service'; +import {ConditionsForUseDialogService} from '../conditions-for-use-dialog/conditions-for-use-dialog.service'; import {PolicyPropertyFieldBuilder} from './policy-property-field-builder'; @Injectable() export class AssetPropertyGridGroupBuilder { constructor( - private participantIdLocalization: ParticipantIdLocalization, private activeFeatureSet: ActiveFeatureSet, private propertyGridUtils: PropertyGridFieldService, private urlListDialogService: UrlListDialogService, private conditionsForUseDialogService: ConditionsForUseDialogService, private policyPropertyFieldBuilder: PolicyPropertyFieldBuilder, + private translateService: TranslateService, + private participantIdLocalization: ParticipantIdLocalization, ) {} buildAssetPropertiesGroup( @@ -39,32 +41,34 @@ export class AssetPropertyGridGroupBuilder { }, { icon: 'language', - label: 'Language', + label: this.translateService.instant('general.language'), ...this.propertyGridUtils.guessValue(asset.language?.label), }, { icon: 'apartment', - label: 'Publisher', + label: this.translateService.instant('general.publisher'), ...this.propertyGridUtils.guessValue(asset.publisherHomepage), }, { icon: 'bookmarks', - label: 'Endpoint Documentation', + label: this.translateService.instant('general.endpoint_doc'), ...this.propertyGridUtils.guessValue(asset.landingPageUrl), }, { icon: 'gavel', - label: 'Standard License', + label: this.translateService.instant('general.standard_license'), ...this.propertyGridUtils.guessValue(asset.licenseUrl), }, { icon: 'category', - label: this.participantIdLocalization.participantId, + label: this.translateService.instant( + 'component_library.participant_id', + ), ...this.propertyGridUtils.guessValue(asset.participantId), }, { icon: 'account_circle', - label: 'Organization', + label: this.translateService.instant('component_library.organization'), ...this.propertyGridUtils.guessValue(asset.creatorOrganizationName), }, this.buildConnectorEndpointField(asset.connectorEndpoint), @@ -85,10 +89,22 @@ export class AssetPropertyGridGroupBuilder { const fields: PropertyGridField[] = []; const hints: {label: string; value: boolean | undefined}[] = [ - {label: 'Method', value: asset.httpDatasourceHintsProxyMethod}, - {label: 'Path', value: asset.httpDatasourceHintsProxyPath}, - {label: 'Query Params', value: asset.httpDatasourceHintsProxyQueryParams}, - {label: 'Body', value: asset.httpDatasourceHintsProxyBody}, + { + label: this.translateService.instant('general.method'), + value: asset.httpDatasourceHintsProxyMethod, + }, + { + label: this.translateService.instant('general.path'), + value: asset.httpDatasourceHintsProxyPath, + }, + { + label: this.translateService.instant('general.params'), + value: asset.httpDatasourceHintsProxyQueryParams, + }, + { + label: this.translateService.instant('general.body'), + value: asset.httpDatasourceHintsProxyBody, + }, ]; if (hints.some((hint) => hint.value != null)) { @@ -101,7 +117,7 @@ export class AssetPropertyGridGroupBuilder { fields.push({ icon: 'api', - label: 'HTTP Data Source Parameterization', + label: this.translateService.instant('component_library.http_param'), text, }); } @@ -109,7 +125,7 @@ export class AssetPropertyGridGroupBuilder { if (asset.mediaType) { fields.push({ icon: 'category', - label: 'Content Type', + label: this.translateService.instant('general.content_type'), ...this.propertyGridUtils.guessValue(asset.mediaType), }); } @@ -153,7 +169,9 @@ export class AssetPropertyGridGroupBuilder { return [ { - groupLabel: 'Additional Properties', + groupLabel: this.translateService.instant( + 'general.additional_properties', + ), properties: additionalProperties, }, { @@ -172,42 +190,42 @@ export class AssetPropertyGridGroupBuilder { if (asset.transportMode) { fields.push({ icon: 'commute', - label: 'Transport Mode', + label: this.translateService.instant('general.transport_mode'), ...this.propertyGridUtils.guessValue(asset.transportMode?.label), }); } if (asset.dataCategory) { fields.push({ icon: 'commute', - label: 'Data Category', + label: this.translateService.instant('general.data_category'), ...this.propertyGridUtils.guessValue(asset.dataCategory?.label), }); } if (asset.dataSubcategory) { fields.push({ icon: 'commute', - label: 'Data Subcategory', + label: this.translateService.instant('general.data_subcategory'), ...this.propertyGridUtils.guessValue(asset.dataSubcategory?.label), }); } if (asset.dataModel) { fields.push({ icon: 'category', - label: 'Data Model', + label: this.translateService.instant('general.data_model'), ...this.propertyGridUtils.guessValue(asset.dataModel), }); } if (asset.geoReferenceMethod) { fields.push({ icon: 'commute', - label: 'Geo Reference Method', + label: this.translateService.instant('general.geo_reference_method'), ...this.propertyGridUtils.guessValue(asset.geoReferenceMethod), }); } if (asset.geoLocation) { fields.push({ icon: 'location_on', - label: 'Geo Location', + label: this.translateService.instant('general.geo_location'), ...this.propertyGridUtils.guessValue(asset.geoLocation), }); } @@ -217,7 +235,7 @@ export class AssetPropertyGridGroupBuilder { if (asset.sovereignLegalName) { fields.push({ icon: 'account_balance', - label: 'Sovereign', + label: this.translateService.instant('general.sovereign'), ...this.propertyGridUtils.guessValue(asset.sovereignLegalName), }); } @@ -243,14 +261,14 @@ export class AssetPropertyGridGroupBuilder { if (asset.dataUpdateFrequency) { fields.push({ icon: 'timelapse', - label: 'Data Update Frequency', + label: this.translateService.instant('general.frequency'), ...this.propertyGridUtils.guessValue(asset.dataUpdateFrequency), }); } if (asset.temporalCoverageFrom || asset.temporalCoverageToInclusive) { fields.push({ icon: 'today', - label: 'Temporal Coverage', + label: this.translateService.instant('general.coverage'), ...this.propertyGridUtils.guessValue( this.buildTemporalCoverageString( asset.temporalCoverageFrom, @@ -266,7 +284,7 @@ export class AssetPropertyGridGroupBuilder { const properties: PropertyGridField[] = [ { icon: 'category', - label: 'Signed', + label: this.translateService.instant('general.signed'), ...this.propertyGridUtils.guessValue( this.propertyGridUtils.formatDateWithTime( contractAgreement.contractSigningDate, @@ -275,24 +293,32 @@ export class AssetPropertyGridGroupBuilder { }, { icon: 'policy', - label: 'Direction', - ...this.propertyGridUtils.guessValue(contractAgreement.direction), + label: this.translateService.instant('general.direction'), + ...this.propertyGridUtils.guessValue( + contractAgreement.direction === 'CONSUMING' + ? this.translateService.instant('general.consuming') + : this.translateService.instant('general.providing'), + ), }, { icon: 'category', - label: 'Contract Agreement ID', + label: this.translateService.instant('general.contract') + ' ID', ...this.propertyGridUtils.guessValue( contractAgreement.contractAgreementId, ), }, { icon: 'link', - label: `Counter-Party ${this.participantIdLocalization.participantId}`, + label: `${this.translateService.instant('general.oth_connector')} ${ + this.participantIdLocalization.participantId + }`, ...this.propertyGridUtils.guessValue(contractAgreement.counterPartyId), }, { icon: 'link', - label: 'Counter-Party Connector Endpoint', + label: this.translateService.instant( + 'transfer_history_page.counter_endpoint', + ), ...this.propertyGridUtils.guessValue( contractAgreement.counterPartyAddress, ), @@ -308,7 +334,7 @@ export class AssetPropertyGridGroupBuilder { } return { - groupLabel: 'Contract Agreement', + groupLabel: this.translateService.instant('general.contract'), properties, }; } @@ -318,10 +344,10 @@ export class AssetPropertyGridGroupBuilder { subtitle: string, ): PropertyGridGroup { return { - groupLabel: 'Contract Policy', + groupLabel: this.translateService.instant('general.contract_policy'), properties: this.policyPropertyFieldBuilder.buildPolicyPropertyFields( contractPolicy, - 'Contract Policy JSON-LD', + this.translateService.instant('general.contract_policy') + ' JSON-LD', subtitle, ), }; @@ -330,7 +356,7 @@ export class AssetPropertyGridGroupBuilder { buildConnectorEndpointField(endpoint: string): PropertyGridField { return { icon: 'link', - label: 'Connector Endpoint', + label: this.translateService.instant('general.endpoint'), ...this.propertyGridUtils.guessValue(endpoint), }; } @@ -338,7 +364,7 @@ export class AssetPropertyGridGroupBuilder { buildNutsLocationsField(locations: string[]): PropertyGridField { return { icon: 'location_on', - label: 'NUTS Locations', + label: this.translateService.instant('general.nuts'), text: locations.join(', '), }; } @@ -349,11 +375,11 @@ export class AssetPropertyGridGroupBuilder { ): PropertyGridField { return { icon: 'attachment', - label: 'Data Samples', - text: 'Show Data Samples', + label: this.translateService.instant('general.data'), + text: this.translateService.instant('general.show_data'), onclick: () => this.urlListDialogService.showUrlListDialog({ - title: `Data Samples`, + title: this.translateService.instant('general.data'), subtitle: title, icon: 'attachment', urls: dataSampleUrls, @@ -367,8 +393,8 @@ export class AssetPropertyGridGroupBuilder { ): PropertyGridField { return { icon: 'description', - label: 'Conditions For Use', - text: 'Show Conditions For Use', + label: this.translateService.instant('general.conditions'), + text: 'Show Conditions For Use', // TODO onclick: () => this.conditionsForUseDialogService.showConditionsForUseDialog({ title: 'Conditions For Use', @@ -386,11 +412,11 @@ export class AssetPropertyGridGroupBuilder { ): PropertyGridField { return { icon: 'receipt', - label: 'Reference Files', - text: 'Show Reference Files', + label: this.translateService.instant('general.files'), + text: this.translateService.instant('general.show_files'), onclick: () => this.urlListDialogService.showUrlListDialog({ - title: `Reference Files`, + title: this.translateService.instant('general.show_files'), subtitle: title, icon: 'receipt', urls: referenceFileUrls, diff --git a/src/app/component-library/catalog/asset-detail-dialog/policy-property-field-builder.ts b/src/app/shared/business/asset-detail-dialog/policy-property-field-builder.ts similarity index 62% rename from src/app/component-library/catalog/asset-detail-dialog/policy-property-field-builder.ts rename to src/app/shared/business/asset-detail-dialog/policy-property-field-builder.ts index 87c7f532e..c5fa5478c 100644 --- a/src/app/component-library/catalog/asset-detail-dialog/policy-property-field-builder.ts +++ b/src/app/shared/business/asset-detail-dialog/policy-property-field-builder.ts @@ -1,14 +1,16 @@ import {Injectable} from '@angular/core'; +import {TranslateService} from '@ngx-translate/core'; import {UiPolicy} from '@sovity.de/edc-client'; -import {JsonDialogService} from '../../json-dialog/json-dialog/json-dialog.service'; -import {PolicyMapper} from '../../policy-editor/model/policy-mapper'; -import {PropertyGridField} from '../../property-grid/property-grid/property-grid-field'; +import {JsonDialogService} from '../../common/json-dialog/json-dialog.service'; +import {PropertyGridField} from '../../common/property-grid/property-grid-field'; +import {PolicyMapper} from '../policy-editor/model/policy-mapper'; @Injectable() export class PolicyPropertyFieldBuilder { constructor( private jsonDialogService: JsonDialogService, private policyMapper: PolicyMapper, + private translateService: TranslateService, ) {} buildPolicyPropertyFields( @@ -19,15 +21,16 @@ export class PolicyPropertyFieldBuilder { return [ { icon: 'policy', - label: 'Policy', + label: this.translateService.instant('general.contract_policy'), policy: this.policyMapper.buildPolicy(policy.expression!), policyErrors: policy.errors || [], additionalContainerClasses: 'col-span-2', }, { icon: 'policy', - label: 'Policy JSON-LD', - text: 'Show JSON-LD', + label: + this.translateService.instant('general.contract_policy') + ' JSON-LD', + text: this.translateService.instant('component_library.json_ld'), onclick: () => this.jsonDialogService.showJsonDetailDialog({ title: policyDetailDialogTitle, diff --git a/src/app/component-library/conditions-for-use-dialog/conditions-for-use-dialog/conditions-for-use-dialog.component.html b/src/app/shared/business/conditions-for-use-dialog/conditions-for-use-dialog.component.html similarity index 100% rename from src/app/component-library/conditions-for-use-dialog/conditions-for-use-dialog/conditions-for-use-dialog.component.html rename to src/app/shared/business/conditions-for-use-dialog/conditions-for-use-dialog.component.html diff --git a/src/app/component-library/conditions-for-use-dialog/conditions-for-use-dialog/conditions-for-use-dialog.component.ts b/src/app/shared/business/conditions-for-use-dialog/conditions-for-use-dialog.component.ts similarity index 100% rename from src/app/component-library/conditions-for-use-dialog/conditions-for-use-dialog/conditions-for-use-dialog.component.ts rename to src/app/shared/business/conditions-for-use-dialog/conditions-for-use-dialog.component.ts diff --git a/src/app/component-library/conditions-for-use-dialog/conditions-for-use-dialog/conditions-for-use-dialog.data.ts b/src/app/shared/business/conditions-for-use-dialog/conditions-for-use-dialog.data.ts similarity index 100% rename from src/app/component-library/conditions-for-use-dialog/conditions-for-use-dialog/conditions-for-use-dialog.data.ts rename to src/app/shared/business/conditions-for-use-dialog/conditions-for-use-dialog.data.ts diff --git a/src/app/component-library/conditions-for-use-dialog/conditions-for-use-dialog/conditions-for-use-dialog.service.ts b/src/app/shared/business/conditions-for-use-dialog/conditions-for-use-dialog.service.ts similarity index 100% rename from src/app/component-library/conditions-for-use-dialog/conditions-for-use-dialog/conditions-for-use-dialog.service.ts rename to src/app/shared/business/conditions-for-use-dialog/conditions-for-use-dialog.service.ts diff --git a/src/app/component-library/catalog/contract-offer-icon/contract-offer-icon.component.ts b/src/app/shared/business/contract-offer-icon/contract-offer-icon.component.ts similarity index 100% rename from src/app/component-library/catalog/contract-offer-icon/contract-offer-icon.component.ts rename to src/app/shared/business/contract-offer-icon/contract-offer-icon.component.ts diff --git a/src/app/component-library/catalog/contract-offer-mini-list/contract-offer-mini-list.component.html b/src/app/shared/business/contract-offer-mini-list/contract-offer-mini-list.component.html similarity index 76% rename from src/app/component-library/catalog/contract-offer-mini-list/contract-offer-mini-list.component.html rename to src/app/shared/business/contract-offer-mini-list/contract-offer-mini-list.component.html index 4cfc61cc4..33722f0ac 100644 --- a/src/app/component-library/catalog/contract-offer-mini-list/contract-offer-mini-list.component.html +++ b/src/app/shared/business/contract-offer-mini-list/contract-offer-mini-list.component.html @@ -9,7 +9,10 @@
- Contract Offer {{ data.contractOffers.length >= 2 ? i + 1 : '' }} + + {{ 'general.contract_offer' | translate }} + {{ data.contractOffers.length >= 2 ? i + 1 : '' }} + - Negotiate + {{ + 'component_library.negotiate' | translate + }} - Negotiating... + {{ 'component_library.negotiating' | translate }} - Successfully Negotiated + {{ 'component_library.succ_negotiating' | translate }}
diff --git a/src/app/component-library/catalog/contract-offer-mini-list/contract-offer-mini-list.component.ts b/src/app/shared/business/contract-offer-mini-list/contract-offer-mini-list.component.ts similarity index 91% rename from src/app/component-library/catalog/contract-offer-mini-list/contract-offer-mini-list.component.ts rename to src/app/shared/business/contract-offer-mini-list/contract-offer-mini-list.component.ts index 3c09ee309..2d664d9e1 100644 --- a/src/app/component-library/catalog/contract-offer-mini-list/contract-offer-mini-list.component.ts +++ b/src/app/shared/business/contract-offer-mini-list/contract-offer-mini-list.component.ts @@ -8,7 +8,7 @@ import { import {DataOffer} from 'src/app/core/services/models/data-offer'; import {ContractNegotiationService} from '../../../core/services/contract-negotiation.service'; import {ContractOffer} from '../../../core/services/models/contract-offer'; -import {PropertyGridField} from '../../property-grid/property-grid/property-grid-field'; +import {PropertyGridField} from '../../common/property-grid/property-grid-field'; @Component({ selector: 'contract-offer-mini-list', diff --git a/src/app/component-library/catalog/data-offer-cards/data-offer-cards.component.html b/src/app/shared/business/data-offer-cards/data-offer-cards.component.html similarity index 100% rename from src/app/component-library/catalog/data-offer-cards/data-offer-cards.component.html rename to src/app/shared/business/data-offer-cards/data-offer-cards.component.html diff --git a/src/app/component-library/catalog/data-offer-cards/data-offer-cards.component.ts b/src/app/shared/business/data-offer-cards/data-offer-cards.component.ts similarity index 100% rename from src/app/component-library/catalog/data-offer-cards/data-offer-cards.component.ts rename to src/app/shared/business/data-offer-cards/data-offer-cards.component.ts diff --git a/src/app/shared/business/edit-asset-form/edit-asset-form-required-providers.ts b/src/app/shared/business/edit-asset-form/edit-asset-form-required-providers.ts new file mode 100644 index 000000000..d75efc586 --- /dev/null +++ b/src/app/shared/business/edit-asset-form/edit-asset-form-required-providers.ts @@ -0,0 +1,17 @@ +import {AssetRequestBuilder} from 'src/app/core/services/asset-request-builder'; +import {policyFormRequiredViewProviders} from '../policy-editor/editor/policy-form-required-providers'; +import {AssetAdvancedFormBuilder} from './form/asset-advanced-form-builder'; +import {AssetDatasourceFormBuilder} from './form/asset-datasource-form-builder'; +import {AssetGeneralFormBuilder} from './form/asset-general-form-builder'; +import {EditAssetForm} from './form/edit-asset-form'; +import {EditAssetFormInitializer} from './form/edit-asset-form-initializer'; + +export const editAssetFormRequiredViewProviders = [ + EditAssetFormInitializer, + AssetRequestBuilder, + EditAssetForm, + AssetGeneralFormBuilder, + AssetDatasourceFormBuilder, + AssetAdvancedFormBuilder, + ...policyFormRequiredViewProviders, +]; diff --git a/src/app/component-library/edit-asset-form/edit-asset-form/edit-asset-form.component.html b/src/app/shared/business/edit-asset-form/edit-asset-form.component.html similarity index 87% rename from src/app/component-library/edit-asset-form/edit-asset-form/edit-asset-form.component.html rename to src/app/shared/business/edit-asset-form/edit-asset-form.component.html index c0c1d5940..759dcdf84 100644 --- a/src/app/component-library/edit-asset-form/edit-asset-form/edit-asset-form.component.html +++ b/src/app/shared/business/edit-asset-form/edit-asset-form.component.html @@ -2,13 +2,13 @@ + [myTitle]="'asset_list_page.datasource' | translate" + [description]="'create_data_offer.def_datasrc' | translate">
@@ -36,12 +36,14 @@ This email address will be offered to potential consumers for - contacting you. This is done in place of having an actual data source - connected.{{ + 'create_data_offer.contact_email_descr' | translate + }} @@ -63,8 +65,8 @@
@@ -86,8 +88,8 @@
@@ -102,9 +104,8 @@ - The consuming side must provide a Custom HTTP Method with - method parameterization enabled. + {{ 'asset_list_page.provide' | translate }} +
- {{ ctrl.value ? 'Disable' : 'Enable' }} - Method Parameterization + {{ + ctrl.value + ? ('general.disable' | translate) + : ('general.enable' | translate) + }} + {{ 'asset_list_page.method_para' | translate }}
@@ -129,10 +134,8 @@ [hideHint]="!form.proxyPath" [ctrl]="ctrl" [label]="form.proxyPath ? 'Base URL' : 'URL'" - >The consuming side must provide a Custom HTTP Subpath with - method parameterization enabled. The Custom HTTP Subpath will be - appended to the base path. + >{{ 'asset_list_page.http_subpath' | translate }} +
- {{ ctrl.value ? 'Disable' : 'Enable' }} Path Parameterization + {{ + ctrl.value + ? ('general.disable' | translate) + : ('general.enable' | translate) + }} + {{ 'asset_list_page.method_para' | translate }}
@@ -150,7 +158,8 @@
- Name @@ -179,7 +187,6 @@ - Value - Remove + {{ 'general.remove' | translate }}
@@ -214,7 +221,9 @@ mat-button color="accent" (click)="form.onHttpQueryParamsAddClick($event)"> - Add {{ form.proxyQueryParams ? 'Default' : '' }} Query Param + {{ 'general.add' | translate }} + {{ form.proxyQueryParams ? 'Default' : '' }} + {{ 'asset_list_page.query_para_single' | translate }}
- + - The request body can only be set from the consumer side, if - parameterization is enabled. + {{ 'asset_list_page.info_body' | translate }}
- {{ ctrl.value ? 'Disable' : 'Enable' }} Request Body - Parameterization + {{ + ctrl.value + ? ('general.disable' | translate) + : ('general.enable' | translate) + }} + {{ 'asset_list_page.request_para' | translate }}
+ [label]="'general.auth' | translate">
- Add Authentication + {{ 'general.add' | translate }} {{ 'general.auth' | translate }}
@@ -274,13 +293,15 @@ form.datasource.controls.httpAuthHeaderType.value !== 'None' " class="grow mt-4"> - Type + {{ 'general.type' | translate }} - Header with Vault Secret + {{ 'general.header_sec' | translate }} - Header with Value + {{ + 'general.header_val' | translate + }}
- Auth Header Name - Auth Header Value - Vault Secret Name + {{ 'general.vault_secret' | translate }} - Remove Authentication + {{ 'general.remove' | translate }} + {{ 'general.auth' | translate }}
+ label="{{ + 'general.add_header' | translate + }}">
- Header Name - Header Value - Remove + {{ 'general.remove' | translate }}
@@ -387,7 +407,8 @@ mat-button color="accent" (click)="form.onHttpHeadersAddClick($event)"> - Add Additional Header + {{ 'general.add' | translate }} + {{ 'general.add_header' | translate }}
@@ -396,35 +417,35 @@ + [myTitle]="'asset_list_page.information' | translate" + [description]="'asset_list_page.information_desc' | translate">
- The description supports + {{ 'asset_list_page.descrip' | translate }}
- Show Advanced Fields + {{ + 'general.show_adv_fields' | translate + }} @@ -505,8 +526,8 @@ + description="Provide context information about the datasource" + [myTitle]="'general.doc' | translate"> + [myTitle]="'general.publishing' | translate" + [description]="'general.pub_desc' | translate">
- Publish unrestricted + {{ 'general.pub_unrestr' | translate }} +
diff --git a/src/app/component-library/initiate-negotiation-confirm-tos-dialog/initiate-negotiation-confirm-tos-dialog/initiate-negotiation-confirm-tos-dialog.component.scss b/src/app/shared/business/initiate-negotiation-confirm-tos-dialog/initiate-negotiation-confirm-tos-dialog.component.scss similarity index 100% rename from src/app/component-library/initiate-negotiation-confirm-tos-dialog/initiate-negotiation-confirm-tos-dialog/initiate-negotiation-confirm-tos-dialog.component.scss rename to src/app/shared/business/initiate-negotiation-confirm-tos-dialog/initiate-negotiation-confirm-tos-dialog.component.scss diff --git a/src/app/component-library/initiate-negotiation-confirm-tos-dialog/initiate-negotiation-confirm-tos-dialog/initiate-negotiation-confirm-tos-dialog.component.ts b/src/app/shared/business/initiate-negotiation-confirm-tos-dialog/initiate-negotiation-confirm-tos-dialog.component.ts similarity index 100% rename from src/app/component-library/initiate-negotiation-confirm-tos-dialog/initiate-negotiation-confirm-tos-dialog/initiate-negotiation-confirm-tos-dialog.component.ts rename to src/app/shared/business/initiate-negotiation-confirm-tos-dialog/initiate-negotiation-confirm-tos-dialog.component.ts diff --git a/src/app/component-library/policy-editor/editor/expression-form-controls.ts b/src/app/shared/business/policy-editor/editor/expression-form-controls.ts similarity index 98% rename from src/app/component-library/policy-editor/editor/expression-form-controls.ts rename to src/app/shared/business/policy-editor/editor/expression-form-controls.ts index f7ae76a1d..99b271199 100644 --- a/src/app/component-library/policy-editor/editor/expression-form-controls.ts +++ b/src/app/shared/business/policy-editor/editor/expression-form-controls.ts @@ -6,8 +6,8 @@ import { } from '@angular/forms'; import {OperatorDto, UiPolicyLiteral} from '@sovity.de/edc-client'; import {PolicyOperatorConfig} from '../model/policy-operators'; +import {TreeNode} from '../model/tree'; import {ExpressionFormValue} from './expression-form-value'; -import {TreeNode} from './tree'; /** * Manages the FormGroup across the expression tree diff --git a/src/app/component-library/policy-editor/editor/expression-form-handler.ts b/src/app/shared/business/policy-editor/editor/expression-form-handler.ts similarity index 91% rename from src/app/component-library/policy-editor/editor/expression-form-handler.ts rename to src/app/shared/business/policy-editor/editor/expression-form-handler.ts index f44428cdb..cae3495c3 100644 --- a/src/app/component-library/policy-editor/editor/expression-form-handler.ts +++ b/src/app/shared/business/policy-editor/editor/expression-form-handler.ts @@ -3,11 +3,11 @@ import {UiPolicyExpression} from '@sovity.de/edc-client'; import {PolicyExpressionMapped} from '../model/policy-expression-mapped'; import {PolicyMapper} from '../model/policy-mapper'; import {PolicyMultiExpressionConfig} from '../model/policy-multi-expressions'; -import {SUPPORTED_POLICY_OPERATORS} from '../model/policy-operators'; +import {PolicyOperatorService} from '../model/policy-operators'; import {PolicyVerbConfig} from '../model/policy-verbs'; +import {Tree, TreeGeneratorFn, TreeNode} from '../model/tree'; import {ExpressionFormControls} from './expression-form-controls'; import {ExpressionFormValue} from './expression-form-value'; -import {Tree, TreeGeneratorFn, TreeNode} from './tree'; /** * Central service for interacting with the policy expression form. @@ -21,6 +21,7 @@ export class ExpressionFormHandler { constructor( public controls: ExpressionFormControls, public policyMapper: PolicyMapper, + private policyOperatorService: PolicyOperatorService, ) {} private buildTree( @@ -107,9 +108,9 @@ export class ExpressionFormHandler { private buildExpressionFormValue( original: PolicyExpressionMapped, ): ExpressionFormValue { - const supportedOperators = SUPPORTED_POLICY_OPERATORS.filter((it) => - original.verb?.supportedOperators.includes(it.id), - ); + const supportedOperators = this.policyOperatorService + .getSupportedPolicyOperators() + .filter((it) => original.verb?.supportedOperators.includes(it.id)); return { type: original.type, multiExpression: original.multiExpression, diff --git a/src/app/component-library/policy-editor/editor/expression-form-value.ts b/src/app/shared/business/policy-editor/editor/expression-form-value.ts similarity index 100% rename from src/app/component-library/policy-editor/editor/expression-form-value.ts rename to src/app/shared/business/policy-editor/editor/expression-form-value.ts diff --git a/src/app/component-library/policy-editor/editor/policy-form-add-menu/policy-form-add-menu.component.html b/src/app/shared/business/policy-editor/editor/policy-form-add-menu/policy-form-add-menu.component.html similarity index 88% rename from src/app/component-library/policy-editor/editor/policy-form-add-menu/policy-form-add-menu.component.html rename to src/app/shared/business/policy-editor/editor/policy-form-add-menu/policy-form-add-menu.component.html index 56510ef12..dbc6158da 100644 --- a/src/app/component-library/policy-editor/editor/policy-form-add-menu/policy-form-add-menu.component.html +++ b/src/app/shared/business/policy-editor/editor/policy-form-add-menu/policy-form-add-menu.component.html @@ -1,9 +1,12 @@ - -
diff --git a/src/app/component-library/confirmation-dialog/confirmation-dialog/confirmation-dialog.component.scss b/src/app/shared/common/confirmation-dialog/confirmation-dialog.component.scss similarity index 100% rename from src/app/component-library/confirmation-dialog/confirmation-dialog/confirmation-dialog.component.scss rename to src/app/shared/common/confirmation-dialog/confirmation-dialog.component.scss diff --git a/src/app/component-library/confirmation-dialog/confirmation-dialog/confirmation-dialog.component.ts b/src/app/shared/common/confirmation-dialog/confirmation-dialog.component.ts similarity index 76% rename from src/app/component-library/confirmation-dialog/confirmation-dialog/confirmation-dialog.component.ts rename to src/app/shared/common/confirmation-dialog/confirmation-dialog.component.ts index 27a22a4de..caaa35d0f 100644 --- a/src/app/component-library/confirmation-dialog/confirmation-dialog/confirmation-dialog.component.ts +++ b/src/app/shared/common/confirmation-dialog/confirmation-dialog.component.ts @@ -1,5 +1,6 @@ import {Component, Inject, OnInit} from '@angular/core'; import {MAT_DIALOG_DATA, MatDialogRef} from '@angular/material/dialog'; +import {TranslateService} from '@ngx-translate/core'; @Component({ selector: 'app-confirmation-dialog', @@ -64,16 +65,23 @@ export class ConfirmDialogModel { } public static forDelete( - type: string, + typeKey: string, identifier: string, + translateService: TranslateService, ): ConfirmDialogModel { const dialogData = new ConfirmDialogModel( - 'Deletion confirmation', - `Please confirm you want to delete ${type} ${identifier}. This action cannot be undone.`, + `${translateService.instant('component_library.delete_title')}`, + `${translateService.instant( + 'component_library.delete_one', + )} ${translateService.instant( + typeKey, + )} ${identifier}. ${translateService.instant( + 'component_library.delete_two', + )}`, ); dialogData.confirmColor = 'warn'; - dialogData.confirmText = 'Delete'; - dialogData.cancelText = 'Cancel'; + dialogData.confirmText = translateService.instant('general.delete'); + dialogData.cancelText = translateService.instant('general.close'); return dialogData; } } diff --git a/src/app/component-library/ui-elements/date/date.component.ts b/src/app/shared/common/date/date.component.ts similarity index 100% rename from src/app/component-library/ui-elements/date/date.component.ts rename to src/app/shared/common/date/date.component.ts diff --git a/src/app/component-library/ui-elements/empty-state/empty-state.component.html b/src/app/shared/common/empty-state/empty-state.component.html similarity index 100% rename from src/app/component-library/ui-elements/empty-state/empty-state.component.html rename to src/app/shared/common/empty-state/empty-state.component.html diff --git a/src/app/component-library/ui-elements/empty-state/empty-state.component.ts b/src/app/shared/common/empty-state/empty-state.component.ts similarity index 100% rename from src/app/component-library/ui-elements/empty-state/empty-state.component.ts rename to src/app/shared/common/empty-state/empty-state.component.ts diff --git a/src/app/component-library/ui-elements/error-state/error-state.component.html b/src/app/shared/common/error-state/error-state.component.html similarity index 100% rename from src/app/component-library/ui-elements/error-state/error-state.component.html rename to src/app/shared/common/error-state/error-state.component.html diff --git a/src/app/component-library/ui-elements/error-state/error-state.component.ts b/src/app/shared/common/error-state/error-state.component.ts similarity index 100% rename from src/app/component-library/ui-elements/error-state/error-state.component.ts rename to src/app/shared/common/error-state/error-state.component.ts diff --git a/src/app/component-library/ui-elements/horizontal-section-divider/horizontal-section-divider.component.html b/src/app/shared/common/horizontal-section-divider/horizontal-section-divider.component.html similarity index 100% rename from src/app/component-library/ui-elements/horizontal-section-divider/horizontal-section-divider.component.html rename to src/app/shared/common/horizontal-section-divider/horizontal-section-divider.component.html diff --git a/src/app/component-library/ui-elements/horizontal-section-divider/horizontal-section-divider.component.ts b/src/app/shared/common/horizontal-section-divider/horizontal-section-divider.component.ts similarity index 100% rename from src/app/component-library/ui-elements/horizontal-section-divider/horizontal-section-divider.component.ts rename to src/app/shared/common/horizontal-section-divider/horizontal-section-divider.component.ts diff --git a/src/app/component-library/json-dialog/json-dialog/clean-json.ts b/src/app/shared/common/json-dialog/clean-json.ts similarity index 100% rename from src/app/component-library/json-dialog/json-dialog/clean-json.ts rename to src/app/shared/common/json-dialog/clean-json.ts diff --git a/src/app/component-library/json-dialog/json-dialog/json-dialog.component.html b/src/app/shared/common/json-dialog/json-dialog.component.html similarity index 90% rename from src/app/component-library/json-dialog/json-dialog/json-dialog.component.html rename to src/app/shared/common/json-dialog/json-dialog.component.html index 1cf0580c0..d951c326d 100644 --- a/src/app/component-library/json-dialog/json-dialog/json-dialog.component.html +++ b/src/app/shared/common/json-dialog/json-dialog.component.html @@ -42,8 +42,8 @@ Cleaned JSON + (ngModelChange)="updateVisibleJson()"> + {{ 'component_library.json' | translate }}
@@ -52,7 +52,7 @@ color="default" [mat-dialog-close]="null" [disabled]="busy"> - Close + {{ 'general.close' | translate }}
diff --git a/src/app/component-library/json-dialog/json-dialog/json-dialog.component.ts b/src/app/shared/common/json-dialog/json-dialog.component.ts similarity index 94% rename from src/app/component-library/json-dialog/json-dialog/json-dialog.component.ts rename to src/app/shared/common/json-dialog/json-dialog.component.ts index edb4b7646..fa37b260c 100644 --- a/src/app/component-library/json-dialog/json-dialog/json-dialog.component.ts +++ b/src/app/shared/common/json-dialog/json-dialog.component.ts @@ -15,7 +15,7 @@ import { import {Subject} from 'rxjs'; import {filter, finalize, takeUntil} from 'rxjs/operators'; import {NgxJsonViewerComponent} from 'ngx-json-viewer'; -import {ConfirmationDialogComponent} from '../../confirmation-dialog/confirmation-dialog/confirmation-dialog.component'; +import {ConfirmationDialogComponent} from '../confirmation-dialog/confirmation-dialog.component'; import {cleanJson} from './clean-json'; import {DialogToolbarButton, JsonDialogData} from './json-dialog.data'; diff --git a/src/app/component-library/json-dialog/json-dialog/json-dialog.data.ts b/src/app/shared/common/json-dialog/json-dialog.data.ts similarity index 75% rename from src/app/component-library/json-dialog/json-dialog/json-dialog.data.ts rename to src/app/shared/common/json-dialog/json-dialog.data.ts index b9e1f8df6..00f5abe87 100644 --- a/src/app/component-library/json-dialog/json-dialog/json-dialog.data.ts +++ b/src/app/shared/common/json-dialog/json-dialog.data.ts @@ -1,5 +1,5 @@ import {Observable} from 'rxjs'; -import {ConfirmDialogModel} from '../../confirmation-dialog/confirmation-dialog/confirmation-dialog.component'; +import {ConfirmDialogModel} from '../confirmation-dialog/confirmation-dialog.component'; export interface JsonDialogData { title: string; diff --git a/src/app/component-library/json-dialog/json-dialog/json-dialog.service.ts b/src/app/shared/common/json-dialog/json-dialog.service.ts similarity index 100% rename from src/app/component-library/json-dialog/json-dialog/json-dialog.service.ts rename to src/app/shared/common/json-dialog/json-dialog.service.ts diff --git a/src/app/shared/common/language-selector/language-selector.component.html b/src/app/shared/common/language-selector/language-selector.component.html new file mode 100644 index 000000000..9137fcba1 --- /dev/null +++ b/src/app/shared/common/language-selector/language-selector.component.html @@ -0,0 +1,25 @@ + + + + + diff --git a/src/app/shared/common/language-selector/language-selector.component.ts b/src/app/shared/common/language-selector/language-selector.component.ts new file mode 100644 index 000000000..fbb697713 --- /dev/null +++ b/src/app/shared/common/language-selector/language-selector.component.ts @@ -0,0 +1,41 @@ +import {Component, OnInit} from '@angular/core'; +import {TranslateService} from '@ngx-translate/core'; +import {LocalStoredValue} from '../../../core/utils/local-stored-value'; + +interface AvailableLanguage { + code: string; + name: string; +} + +@Component({ + selector: 'app-language-selector', + templateUrl: './language-selector.component.html', +}) +export class LanguageSelectorComponent implements OnInit { + supportedLanguages: AvailableLanguage[] = [ + {code: 'en', name: 'English'}, + {code: 'de', name: 'Deutsch'}, + ]; + + selectedLanguage = new LocalStoredValue( + 'en', + 'selectedLanguage', + (value): value is string => + this.supportedLanguages.map((it) => it.code).includes(value as string), + ); + + constructor(private translateService: TranslateService) {} + + ngOnInit(): void { + this.updateSelectedLanguage(); + } + + setSelectedLanguage(language: AvailableLanguage) { + this.selectedLanguage.value = language.code; + this.updateSelectedLanguage(); + } + + updateSelectedLanguage() { + this.translateService.use(this.selectedLanguage.value); + } +} diff --git a/src/app/component-library/ui-elements/loading-state/loading-state.component.html b/src/app/shared/common/loading-state/loading-state.component.html similarity index 100% rename from src/app/component-library/ui-elements/loading-state/loading-state.component.html rename to src/app/shared/common/loading-state/loading-state.component.html diff --git a/src/app/component-library/ui-elements/loading-state/loading-state.component.ts b/src/app/shared/common/loading-state/loading-state.component.ts similarity index 100% rename from src/app/component-library/ui-elements/loading-state/loading-state.component.ts rename to src/app/shared/common/loading-state/loading-state.component.ts diff --git a/src/app/component-library/markdown-description/markdown-description.component.html b/src/app/shared/common/markdown-description/markdown-description.component.html similarity index 81% rename from src/app/component-library/markdown-description/markdown-description.component.html rename to src/app/shared/common/markdown-description/markdown-description.component.html index d98236700..a97a6d460 100644 --- a/src/app/component-library/markdown-description/markdown-description.component.html +++ b/src/app/shared/common/markdown-description/markdown-description.component.html @@ -8,7 +8,9 @@ htmlSanitizer.sanitize(markdownConverter.toHtml(description ?? '')) ">
- No description. + {{ + 'component_library.no_description' | translate + }}
keyboard_double_arrow_up - {{ isCollapsed ? 'Show more' : 'Show less' }} + {{ + isCollapsed + ? ('component_library.show_more' | translate) + : ('component_library.show_less' | translate) + }}
diff --git a/src/app/component-library/markdown-description/markdown-description.component.ts b/src/app/shared/common/markdown-description/markdown-description.component.ts similarity index 96% rename from src/app/component-library/markdown-description/markdown-description.component.ts rename to src/app/shared/common/markdown-description/markdown-description.component.ts index 28a6c6a34..052f1f962 100644 --- a/src/app/component-library/markdown-description/markdown-description.component.ts +++ b/src/app/shared/common/markdown-description/markdown-description.component.ts @@ -11,7 +11,7 @@ import { } from '@angular/core'; import {HtmlSanitizer} from 'src/app/core/services/html-sanitizer'; import {MarkdownConverter} from 'src/app/core/services/markdown-converter'; -import {SimpleChangesTyped} from '../../core/utils/angular-utils'; +import {SimpleChangesTyped} from '../../../core/utils/angular-utils'; const COLLAPSED_DESCRIPTION_HEIGHT = 280; diff --git a/src/app/component-library/property-grid/property-grid-group/property-grid-group.component.html b/src/app/shared/common/property-grid-group/property-grid-group.component.html similarity index 89% rename from src/app/component-library/property-grid/property-grid-group/property-grid-group.component.html rename to src/app/shared/common/property-grid-group/property-grid-group.component.html index 0daf72315..7d2ee5de2 100644 --- a/src/app/component-library/property-grid/property-grid-group/property-grid-group.component.html +++ b/src/app/shared/common/property-grid-group/property-grid-group.component.html @@ -6,7 +6,7 @@
+ [style.margin-top.px]="first ? 20 : null"> {{ propGroup.groupLabel }}
{{ textBefore }} + + + +{{ textAfter }} diff --git a/src/app/shared/common/translate-with-slot/translate-with-slot.component.ts b/src/app/shared/common/translate-with-slot/translate-with-slot.component.ts new file mode 100644 index 000000000..ccc323a36 --- /dev/null +++ b/src/app/shared/common/translate-with-slot/translate-with-slot.component.ts @@ -0,0 +1,46 @@ +import {Component, Input, OnChanges, OnDestroy} from '@angular/core'; +import {Subject, switchMap} from 'rxjs'; +import {takeUntil} from 'rxjs/operators'; +import {TranslateService} from '@ngx-translate/core'; +import {SimpleChangesTyped} from '../../../core/utils/angular-utils'; + +@Component({ + selector: 'translate-with-slot', + templateUrl: './translate-with-slot.component.html', +}) +export class TranslateWithSlotComponent implements OnChanges, OnDestroy { + @Input() + key!: string; + key$ = new Subject(); + + textBefore = ''; + hasMiddle = false; + textAfter = ''; + + constructor(private translationService: TranslateService) { + this.key$ + .pipe( + switchMap(() => this.translationService.get(this.key)), + takeUntil(this.ngOnDestroy$), + ) + .subscribe((text) => { + const parts = text.split('{}'); + this.textBefore = parts[0]; + this.hasMiddle = parts.length > 1; + this.textAfter = parts[1] || ''; + }); + } + + ngOnChanges(changes: SimpleChangesTyped) { + if (changes.key) { + this.key$.next(changes.key); + } + } + + ngOnDestroy$ = new Subject(); + + ngOnDestroy() { + this.ngOnDestroy$.next(null); + this.ngOnDestroy$.complete(); + } +} diff --git a/src/app/shared/common/truncated-short-description/truncated-short-description.component.html b/src/app/shared/common/truncated-short-description/truncated-short-description.component.html new file mode 100644 index 000000000..ad639bb03 --- /dev/null +++ b/src/app/shared/common/truncated-short-description/truncated-short-description.component.html @@ -0,0 +1 @@ +{{ text || ('component_library.no_description' | translate) }} diff --git a/src/app/component-library/catalog/truncated-short-description/truncated-short-description.component.ts b/src/app/shared/common/truncated-short-description/truncated-short-description.component.ts similarity index 100% rename from src/app/component-library/catalog/truncated-short-description/truncated-short-description.component.ts rename to src/app/shared/common/truncated-short-description/truncated-short-description.component.ts diff --git a/src/app/component-library/url-list-dialog/url-list-dialog/url-list-dialog.component.html b/src/app/shared/common/url-list-dialog/url-list-dialog.component.html similarity index 84% rename from src/app/component-library/url-list-dialog/url-list-dialog/url-list-dialog.component.html rename to src/app/shared/common/url-list-dialog/url-list-dialog.component.html index 50eb41aab..9b29e28cc 100644 --- a/src/app/component-library/url-list-dialog/url-list-dialog/url-list-dialog.component.html +++ b/src/app/shared/common/url-list-dialog/url-list-dialog.component.html @@ -18,7 +18,7 @@ mat-dialog-content style="display: block; min-width: 40rem; max-width: 40rem; max-height: 60vh">
-
Description
+
{{ 'general.description' | translate }}
@@ -36,5 +36,7 @@
- +
diff --git a/src/app/component-library/url-list-dialog/url-list-dialog/url-list-dialog.component.ts b/src/app/shared/common/url-list-dialog/url-list-dialog.component.ts similarity index 100% rename from src/app/component-library/url-list-dialog/url-list-dialog/url-list-dialog.component.ts rename to src/app/shared/common/url-list-dialog/url-list-dialog.component.ts diff --git a/src/app/component-library/url-list-dialog/url-list-dialog/url-list-dialog.data.ts b/src/app/shared/common/url-list-dialog/url-list-dialog.data.ts similarity index 100% rename from src/app/component-library/url-list-dialog/url-list-dialog/url-list-dialog.data.ts rename to src/app/shared/common/url-list-dialog/url-list-dialog.data.ts diff --git a/src/app/component-library/url-list-dialog/url-list-dialog/url-list-dialog.service.ts b/src/app/shared/common/url-list-dialog/url-list-dialog.service.ts similarity index 100% rename from src/app/component-library/url-list-dialog/url-list-dialog/url-list-dialog.service.ts rename to src/app/shared/common/url-list-dialog/url-list-dialog.service.ts diff --git a/src/app/component-library/data-address/data-address-type-select/data-address-type-select-item.ts b/src/app/shared/form-elements/data-address-type-select/data-address-type-select-item.ts similarity index 100% rename from src/app/component-library/data-address/data-address-type-select/data-address-type-select-item.ts rename to src/app/shared/form-elements/data-address-type-select/data-address-type-select-item.ts diff --git a/src/app/component-library/data-address/data-address-type-select/data-address-type-select-items.ts b/src/app/shared/form-elements/data-address-type-select/data-address-type-select-items.ts similarity index 100% rename from src/app/component-library/data-address/data-address-type-select/data-address-type-select-items.ts rename to src/app/shared/form-elements/data-address-type-select/data-address-type-select-items.ts diff --git a/src/app/component-library/data-address/data-address-type-select/data-address-type-select-mode.ts b/src/app/shared/form-elements/data-address-type-select/data-address-type-select-mode.ts similarity index 100% rename from src/app/component-library/data-address/data-address-type-select/data-address-type-select-mode.ts rename to src/app/shared/form-elements/data-address-type-select/data-address-type-select-mode.ts diff --git a/src/app/component-library/data-address/data-address-type-select/data-address-type-select.component.html b/src/app/shared/form-elements/data-address-type-select/data-address-type-select.component.html similarity index 100% rename from src/app/component-library/data-address/data-address-type-select/data-address-type-select.component.html rename to src/app/shared/form-elements/data-address-type-select/data-address-type-select.component.html diff --git a/src/app/component-library/data-address/data-address-type-select/data-address-type-select.component.ts b/src/app/shared/form-elements/data-address-type-select/data-address-type-select.component.ts similarity index 100% rename from src/app/component-library/data-address/data-address-type-select/data-address-type-select.component.ts rename to src/app/shared/form-elements/data-address-type-select/data-address-type-select.component.ts diff --git a/src/app/component-library/data-address/data-address-type-select/data-address-type.ts b/src/app/shared/form-elements/data-address-type-select/data-address-type.ts similarity index 100% rename from src/app/component-library/data-address/data-address-type-select/data-address-type.ts rename to src/app/shared/form-elements/data-address-type-select/data-address-type.ts diff --git a/src/app/component-library/edit-asset-form/data-category-select/data-category-select-data.ts b/src/app/shared/form-elements/data-category-select/data-category-select-data.ts similarity index 100% rename from src/app/component-library/edit-asset-form/data-category-select/data-category-select-data.ts rename to src/app/shared/form-elements/data-category-select/data-category-select-data.ts diff --git a/src/app/component-library/edit-asset-form/data-category-select/data-category-select-item.service.ts b/src/app/shared/form-elements/data-category-select/data-category-select-item.service.ts similarity index 100% rename from src/app/component-library/edit-asset-form/data-category-select/data-category-select-item.service.ts rename to src/app/shared/form-elements/data-category-select/data-category-select-item.service.ts diff --git a/src/app/component-library/edit-asset-form/data-category-select/data-category-select-item.ts b/src/app/shared/form-elements/data-category-select/data-category-select-item.ts similarity index 100% rename from src/app/component-library/edit-asset-form/data-category-select/data-category-select-item.ts rename to src/app/shared/form-elements/data-category-select/data-category-select-item.ts diff --git a/src/app/component-library/edit-asset-form/data-category-select/data-category-select.component.html b/src/app/shared/form-elements/data-category-select/data-category-select.component.html similarity index 100% rename from src/app/component-library/edit-asset-form/data-category-select/data-category-select.component.html rename to src/app/shared/form-elements/data-category-select/data-category-select.component.html diff --git a/src/app/component-library/edit-asset-form/data-category-select/data-category-select.component.ts b/src/app/shared/form-elements/data-category-select/data-category-select.component.ts similarity index 100% rename from src/app/component-library/edit-asset-form/data-category-select/data-category-select.component.ts rename to src/app/shared/form-elements/data-category-select/data-category-select.component.ts diff --git a/src/app/component-library/edit-asset-form/data-subcategory-select/data-subcategory-items.pipe.ts b/src/app/shared/form-elements/data-subcategory-select/data-subcategory-items.pipe.ts similarity index 100% rename from src/app/component-library/edit-asset-form/data-subcategory-select/data-subcategory-items.pipe.ts rename to src/app/shared/form-elements/data-subcategory-select/data-subcategory-items.pipe.ts diff --git a/src/app/component-library/edit-asset-form/data-subcategory-select/data-subcategory-select-data.ts b/src/app/shared/form-elements/data-subcategory-select/data-subcategory-select-data.ts similarity index 100% rename from src/app/component-library/edit-asset-form/data-subcategory-select/data-subcategory-select-data.ts rename to src/app/shared/form-elements/data-subcategory-select/data-subcategory-select-data.ts diff --git a/src/app/component-library/edit-asset-form/data-subcategory-select/data-subcategory-select-item.service.ts b/src/app/shared/form-elements/data-subcategory-select/data-subcategory-select-item.service.ts similarity index 100% rename from src/app/component-library/edit-asset-form/data-subcategory-select/data-subcategory-select-item.service.ts rename to src/app/shared/form-elements/data-subcategory-select/data-subcategory-select-item.service.ts diff --git a/src/app/component-library/edit-asset-form/data-subcategory-select/data-subcategory-select-item.ts b/src/app/shared/form-elements/data-subcategory-select/data-subcategory-select-item.ts similarity index 100% rename from src/app/component-library/edit-asset-form/data-subcategory-select/data-subcategory-select-item.ts rename to src/app/shared/form-elements/data-subcategory-select/data-subcategory-select-item.ts diff --git a/src/app/component-library/edit-asset-form/data-subcategory-select/data-subcategory-select.component.html b/src/app/shared/form-elements/data-subcategory-select/data-subcategory-select.component.html similarity index 100% rename from src/app/component-library/edit-asset-form/data-subcategory-select/data-subcategory-select.component.html rename to src/app/shared/form-elements/data-subcategory-select/data-subcategory-select.component.html diff --git a/src/app/component-library/edit-asset-form/data-subcategory-select/data-subcategory-select.component.ts b/src/app/shared/form-elements/data-subcategory-select/data-subcategory-select.component.ts similarity index 100% rename from src/app/component-library/edit-asset-form/data-subcategory-select/data-subcategory-select.component.ts rename to src/app/shared/form-elements/data-subcategory-select/data-subcategory-select.component.ts diff --git a/src/app/component-library/edit-asset-form/edit-asset-form-data-address-type-select/edit-asset-form-data-address-type-select.component.html b/src/app/shared/form-elements/edit-asset-form-data-address-type-select/edit-asset-form-data-address-type-select.component.html similarity index 100% rename from src/app/component-library/edit-asset-form/edit-asset-form-data-address-type-select/edit-asset-form-data-address-type-select.component.html rename to src/app/shared/form-elements/edit-asset-form-data-address-type-select/edit-asset-form-data-address-type-select.component.html diff --git a/src/app/component-library/edit-asset-form/edit-asset-form-data-address-type-select/edit-asset-form-data-address-type-select.component.ts b/src/app/shared/form-elements/edit-asset-form-data-address-type-select/edit-asset-form-data-address-type-select.component.ts similarity index 85% rename from src/app/component-library/edit-asset-form/edit-asset-form-data-address-type-select/edit-asset-form-data-address-type-select.component.ts rename to src/app/shared/form-elements/edit-asset-form-data-address-type-select/edit-asset-form-data-address-type-select.component.ts index dca3d6fea..68081dfcd 100644 --- a/src/app/component-library/edit-asset-form/edit-asset-form-data-address-type-select/edit-asset-form-data-address-type-select.component.ts +++ b/src/app/shared/form-elements/edit-asset-form-data-address-type-select/edit-asset-form-data-address-type-select.component.ts @@ -1,6 +1,6 @@ import {Component, Input} from '@angular/core'; import {FormControl} from '@angular/forms'; -import {DataAddressType} from '../../data-address/data-address-type-select/data-address-type'; +import {DataAddressType} from '../data-address-type-select/data-address-type'; @Component({ selector: 'edit-asset-form-data-address-type-select', diff --git a/src/app/component-library/edit-asset-form/edit-asset-form-group/edit-asset-form-group.component.html b/src/app/shared/form-elements/edit-asset-form-group/edit-asset-form-group.component.html similarity index 100% rename from src/app/component-library/edit-asset-form/edit-asset-form-group/edit-asset-form-group.component.html rename to src/app/shared/form-elements/edit-asset-form-group/edit-asset-form-group.component.html diff --git a/src/app/component-library/edit-asset-form/edit-asset-form-group/edit-asset-form-group.component.ts b/src/app/shared/form-elements/edit-asset-form-group/edit-asset-form-group.component.ts similarity index 100% rename from src/app/component-library/edit-asset-form/edit-asset-form-group/edit-asset-form-group.component.ts rename to src/app/shared/form-elements/edit-asset-form-group/edit-asset-form-group.component.ts diff --git a/src/app/component-library/edit-asset-form/edit-asset-form-input/edit-asset-form-input.component.html b/src/app/shared/form-elements/edit-asset-form-input/edit-asset-form-input.component.html similarity index 100% rename from src/app/component-library/edit-asset-form/edit-asset-form-input/edit-asset-form-input.component.html rename to src/app/shared/form-elements/edit-asset-form-input/edit-asset-form-input.component.html diff --git a/src/app/component-library/edit-asset-form/edit-asset-form-input/edit-asset-form-input.component.ts b/src/app/shared/form-elements/edit-asset-form-input/edit-asset-form-input.component.ts similarity index 100% rename from src/app/component-library/edit-asset-form/edit-asset-form-input/edit-asset-form-input.component.ts rename to src/app/shared/form-elements/edit-asset-form-input/edit-asset-form-input.component.ts diff --git a/src/app/component-library/edit-asset-form/edit-asset-form-label/edit-asset-form-label.component.html b/src/app/shared/form-elements/edit-asset-form-label/edit-asset-form-label.component.html similarity index 100% rename from src/app/component-library/edit-asset-form/edit-asset-form-label/edit-asset-form-label.component.html rename to src/app/shared/form-elements/edit-asset-form-label/edit-asset-form-label.component.html diff --git a/src/app/component-library/edit-asset-form/edit-asset-form-label/edit-asset-form-label.component.ts b/src/app/shared/form-elements/edit-asset-form-label/edit-asset-form-label.component.ts similarity index 100% rename from src/app/component-library/edit-asset-form/edit-asset-form-label/edit-asset-form-label.component.ts rename to src/app/shared/form-elements/edit-asset-form-label/edit-asset-form-label.component.ts diff --git a/src/app/component-library/edit-asset-form/edit-asset-form-textarea/edit-asset-form-textarea.component.html b/src/app/shared/form-elements/edit-asset-form-textarea/edit-asset-form-textarea.component.html similarity index 100% rename from src/app/component-library/edit-asset-form/edit-asset-form-textarea/edit-asset-form-textarea.component.html rename to src/app/shared/form-elements/edit-asset-form-textarea/edit-asset-form-textarea.component.html diff --git a/src/app/component-library/edit-asset-form/edit-asset-form-textarea/edit-asset-form-textarea.component.ts b/src/app/shared/form-elements/edit-asset-form-textarea/edit-asset-form-textarea.component.ts similarity index 100% rename from src/app/component-library/edit-asset-form/edit-asset-form-textarea/edit-asset-form-textarea.component.ts rename to src/app/shared/form-elements/edit-asset-form-textarea/edit-asset-form-textarea.component.ts diff --git a/src/app/component-library/edit-asset-form/keyword-select/keyword-select.component.html b/src/app/shared/form-elements/keyword-select/keyword-select.component.html similarity index 87% rename from src/app/component-library/edit-asset-form/keyword-select/keyword-select.component.html rename to src/app/shared/form-elements/keyword-select/keyword-select.component.html index ebf8be51a..e7bf8d321 100644 --- a/src/app/component-library/edit-asset-form/keyword-select/keyword-select.component.html +++ b/src/app/shared/form-elements/keyword-select/keyword-select.component.html @@ -12,12 +12,12 @@ (removed)="remove(keyword)"> {{ keyword }} + - diff --git a/src/app/component-library/edit-asset-form/language-select/language-select.component.ts b/src/app/shared/form-elements/language-select/language-select.component.ts similarity index 94% rename from src/app/component-library/edit-asset-form/language-select/language-select.component.ts rename to src/app/shared/form-elements/language-select/language-select.component.ts index 0a48bfd9b..8d244a96d 100644 --- a/src/app/component-library/edit-asset-form/language-select/language-select.component.ts +++ b/src/app/shared/form-elements/language-select/language-select.component.ts @@ -9,7 +9,7 @@ import {LanguageSelectItemService} from './language-select-item.service'; }) export class LanguageSelectComponent { @Input() - label: string = 'Language'; + label: string | null = null; @Input() control!: FormControl; diff --git a/src/app/component-library/policy-editor/editor/controls/participant-id-select/participant-id-select.component.html b/src/app/shared/form-elements/participant-id-select/participant-id-select.component.html similarity index 100% rename from src/app/component-library/policy-editor/editor/controls/participant-id-select/participant-id-select.component.html rename to src/app/shared/form-elements/participant-id-select/participant-id-select.component.html diff --git a/src/app/component-library/policy-editor/editor/controls/participant-id-select/participant-id-select.component.ts b/src/app/shared/form-elements/participant-id-select/participant-id-select.component.ts similarity index 86% rename from src/app/component-library/policy-editor/editor/controls/participant-id-select/participant-id-select.component.ts rename to src/app/shared/form-elements/participant-id-select/participant-id-select.component.ts index e7c703d7b..931c06645 100644 --- a/src/app/component-library/policy-editor/editor/controls/participant-id-select/participant-id-select.component.ts +++ b/src/app/shared/form-elements/participant-id-select/participant-id-select.component.ts @@ -2,8 +2,8 @@ import {COMMA, ENTER, SEMICOLON} from '@angular/cdk/keycodes'; import {Component, HostBinding, Input} from '@angular/core'; import {FormControl} from '@angular/forms'; import {MatChipInputEvent} from '@angular/material/chips'; -import {ParticipantIdLocalization} from '../../../../../core/services/participant-id-localization'; -import {removeOnce} from '../../../../../core/utils/array-utils'; +import {ParticipantIdLocalization} from '../../../core/services/participant-id-localization'; +import {removeOnce} from '../../../core/utils/array-utils'; @Component({ selector: 'participant-id-select', diff --git a/src/app/component-library/policy-editor/editor/policy-operator-select/policy-operator-select.component.html b/src/app/shared/form-elements/policy-operator-select/policy-operator-select.component.html similarity index 100% rename from src/app/component-library/policy-editor/editor/policy-operator-select/policy-operator-select.component.html rename to src/app/shared/form-elements/policy-operator-select/policy-operator-select.component.html diff --git a/src/app/component-library/policy-editor/editor/policy-operator-select/policy-operator-select.component.ts b/src/app/shared/form-elements/policy-operator-select/policy-operator-select.component.ts similarity index 62% rename from src/app/component-library/policy-editor/editor/policy-operator-select/policy-operator-select.component.ts rename to src/app/shared/form-elements/policy-operator-select/policy-operator-select.component.ts index 4bcfa9595..3ae0c22c2 100644 --- a/src/app/component-library/policy-editor/editor/policy-operator-select/policy-operator-select.component.ts +++ b/src/app/shared/form-elements/policy-operator-select/policy-operator-select.component.ts @@ -1,6 +1,7 @@ import {Component, HostBinding, Input} from '@angular/core'; import {UntypedFormControl} from '@angular/forms'; -import {PolicyOperatorConfig} from '../../model/policy-operators'; +import {TranslateService} from '@ngx-translate/core'; +import {PolicyOperatorConfig} from '../../business/policy-editor/model/policy-operators'; @Component({ selector: 'policy-operator-select', @@ -17,5 +18,7 @@ export class PolicyOperatorSelectComponent { @HostBinding('class.flex-row') cls = true; - label = 'Operator'; + constructor(public translationService: TranslateService) {} + + label = this.translationService.instant('general.operator'); } diff --git a/src/app/component-library/edit-asset-form/transport-mode-select/transport-mode-select-data.ts b/src/app/shared/form-elements/transport-mode-select/transport-mode-select-data.ts similarity index 100% rename from src/app/component-library/edit-asset-form/transport-mode-select/transport-mode-select-data.ts rename to src/app/shared/form-elements/transport-mode-select/transport-mode-select-data.ts diff --git a/src/app/component-library/edit-asset-form/transport-mode-select/transport-mode-select-item.service.ts b/src/app/shared/form-elements/transport-mode-select/transport-mode-select-item.service.ts similarity index 100% rename from src/app/component-library/edit-asset-form/transport-mode-select/transport-mode-select-item.service.ts rename to src/app/shared/form-elements/transport-mode-select/transport-mode-select-item.service.ts diff --git a/src/app/component-library/edit-asset-form/transport-mode-select/transport-mode-select-item.ts b/src/app/shared/form-elements/transport-mode-select/transport-mode-select-item.ts similarity index 100% rename from src/app/component-library/edit-asset-form/transport-mode-select/transport-mode-select-item.ts rename to src/app/shared/form-elements/transport-mode-select/transport-mode-select-item.ts diff --git a/src/app/component-library/edit-asset-form/transport-mode-select/transport-mode-select.component.html b/src/app/shared/form-elements/transport-mode-select/transport-mode-select.component.html similarity index 100% rename from src/app/component-library/edit-asset-form/transport-mode-select/transport-mode-select.component.html rename to src/app/shared/form-elements/transport-mode-select/transport-mode-select.component.html diff --git a/src/app/component-library/edit-asset-form/transport-mode-select/transport-mode-select.component.ts b/src/app/shared/form-elements/transport-mode-select/transport-mode-select.component.ts similarity index 100% rename from src/app/component-library/edit-asset-form/transport-mode-select/transport-mode-select.component.ts rename to src/app/shared/form-elements/transport-mode-select/transport-mode-select.component.ts diff --git a/src/app/component-library/pipes-and-directives/directives/autofocus.direcitive.ts b/src/app/shared/pipes-and-directives/autofocus.direcitive.ts similarity index 100% rename from src/app/component-library/pipes-and-directives/directives/autofocus.direcitive.ts rename to src/app/shared/pipes-and-directives/autofocus.direcitive.ts diff --git a/src/app/component-library/pipes-and-directives/pipes/compare-by-field.pipe.ts b/src/app/shared/pipes-and-directives/compare-by-field.pipe.ts similarity index 100% rename from src/app/component-library/pipes-and-directives/pipes/compare-by-field.pipe.ts rename to src/app/shared/pipes-and-directives/compare-by-field.pipe.ts diff --git a/src/app/component-library/pipes-and-directives/directives/external-link.directive.ts b/src/app/shared/pipes-and-directives/external-link.directive.ts similarity index 100% rename from src/app/component-library/pipes-and-directives/directives/external-link.directive.ts rename to src/app/shared/pipes-and-directives/external-link.directive.ts diff --git a/src/app/component-library/pipes-and-directives/pipes/is-active-feature.pipe.ts b/src/app/shared/pipes-and-directives/is-active-feature.pipe.ts similarity index 71% rename from src/app/component-library/pipes-and-directives/pipes/is-active-feature.pipe.ts rename to src/app/shared/pipes-and-directives/is-active-feature.pipe.ts index a318481db..f39cf3ad8 100644 --- a/src/app/component-library/pipes-and-directives/pipes/is-active-feature.pipe.ts +++ b/src/app/shared/pipes-and-directives/is-active-feature.pipe.ts @@ -1,6 +1,6 @@ import {Pipe, PipeTransform} from '@angular/core'; -import {ActiveFeatureSet} from '../../../core/config/active-feature-set'; -import {EdcUiFeature} from '../../../core/config/profiles/edc-ui-feature'; +import {ActiveFeatureSet} from '../../core/config/active-feature-set'; +import {EdcUiFeature} from '../../core/config/profiles/edc-ui-feature'; /** * Easily check for active features in angular templates. diff --git a/src/app/component-library/pipes-and-directives/directives/remove-class.directive.ts b/src/app/shared/pipes-and-directives/remove-class.directive.ts similarity index 100% rename from src/app/component-library/pipes-and-directives/directives/remove-class.directive.ts rename to src/app/shared/pipes-and-directives/remove-class.directive.ts diff --git a/src/app/component-library/pipes-and-directives/directives/track-by-field.directive.ts b/src/app/shared/pipes-and-directives/track-by-field.directive.ts similarity index 100% rename from src/app/component-library/pipes-and-directives/directives/track-by-field.directive.ts rename to src/app/shared/pipes-and-directives/track-by-field.directive.ts diff --git a/src/app/component-library/pipes-and-directives/pipes/values.pipe.ts b/src/app/shared/pipes-and-directives/values.pipe.ts similarity index 100% rename from src/app/component-library/pipes-and-directives/pipes/values.pipe.ts rename to src/app/shared/pipes-and-directives/values.pipe.ts diff --git a/src/app/shared/shared.module.ts b/src/app/shared/shared.module.ts new file mode 100644 index 000000000..25b656730 --- /dev/null +++ b/src/app/shared/shared.module.ts @@ -0,0 +1,287 @@ +import {ClipboardModule} from '@angular/cdk/clipboard'; +import {CommonModule} from '@angular/common'; +import {NgModule} from '@angular/core'; +import {FormsModule, ReactiveFormsModule} from '@angular/forms'; +import {MatBadgeModule} from '@angular/material/badge'; +import {MatButtonModule} from '@angular/material/button'; +import {MatButtonToggleModule} from '@angular/material/button-toggle'; +import {MatCardModule} from '@angular/material/card'; +import {MatCheckboxModule} from '@angular/material/checkbox'; +import {MatChipsModule} from '@angular/material/chips'; +import { + DateAdapter, + MAT_DATE_LOCALE, + MatNativeDateModule, +} from '@angular/material/core'; +import {MatDatepickerModule} from '@angular/material/datepicker'; +import {MatDialogModule} from '@angular/material/dialog'; +import {MatDividerModule} from '@angular/material/divider'; +import {MatExpansionModule} from '@angular/material/expansion'; +import { + MAT_FORM_FIELD_DEFAULT_OPTIONS, + MatFormFieldDefaultOptions, + MatFormFieldModule, +} from '@angular/material/form-field'; +import {MatGridListModule} from '@angular/material/grid-list'; +import {MatIconModule} from '@angular/material/icon'; +import {MatInputModule} from '@angular/material/input'; +import {MatListModule} from '@angular/material/list'; +import {MatMenuModule} from '@angular/material/menu'; +import {MatPaginatorModule} from '@angular/material/paginator'; +import {MatProgressBarModule} from '@angular/material/progress-bar'; +import {MatProgressSpinnerModule} from '@angular/material/progress-spinner'; +import {MatRadioModule} from '@angular/material/radio'; +import {MatSelectModule} from '@angular/material/select'; +import {MatSidenavModule} from '@angular/material/sidenav'; +import {MatSlideToggleModule} from '@angular/material/slide-toggle'; +import {MatSnackBarModule} from '@angular/material/snack-bar'; +import {MatStepperModule} from '@angular/material/stepper'; +import {MatTableModule} from '@angular/material/table'; +import {MatTabsModule} from '@angular/material/tabs'; +import {MatToolbarModule} from '@angular/material/toolbar'; +import { + MAT_TOOLTIP_DEFAULT_OPTIONS, + MAT_TOOLTIP_DEFAULT_OPTIONS_FACTORY, + MatTooltipDefaultOptions, + MatTooltipModule, +} from '@angular/material/tooltip'; +import {TranslateModule} from '@ngx-translate/core'; +import {NgChartsModule} from 'ng2-charts'; +import {NgxJsonViewerModule} from 'ngx-json-viewer'; +import {CustomDateAdapter} from '../core/adapters/custom-date-adapter'; +import {AssetCardTagListComponent} from './business/asset-card-tag-list/asset-card-tag-list.component'; +import {AssetDetailDialogDataService} from './business/asset-detail-dialog/asset-detail-dialog-data.service'; +import {AssetDetailDialogComponent} from './business/asset-detail-dialog/asset-detail-dialog.component'; +import {AssetDetailDialogService} from './business/asset-detail-dialog/asset-detail-dialog.service'; +import {AssetPropertyGridGroupBuilder} from './business/asset-detail-dialog/asset-property-grid-group-builder'; +import {PolicyPropertyFieldBuilder} from './business/asset-detail-dialog/policy-property-field-builder'; +import {ConditionsForUseDialogComponent} from './business/conditions-for-use-dialog/conditions-for-use-dialog.component'; +import {ConditionsForUseDialogService} from './business/conditions-for-use-dialog/conditions-for-use-dialog.service'; +import {ContractOfferIconComponent} from './business/contract-offer-icon/contract-offer-icon.component'; +import {ContractOfferMiniListComponent} from './business/contract-offer-mini-list/contract-offer-mini-list.component'; +import {DataOfferCardsComponent} from './business/data-offer-cards/data-offer-cards.component'; +import {EditAssetFormComponent} from './business/edit-asset-form/edit-asset-form.component'; +import {InitiateNegotiationConfirmTosDialogComponent} from './business/initiate-negotiation-confirm-tos-dialog/initiate-negotiation-confirm-tos-dialog.component'; +import {PolicyFormAddMenuComponent} from './business/policy-editor/editor/policy-form-add-menu/policy-form-add-menu.component'; +import {PolicyFormExpressionConstraintComponent} from './business/policy-editor/editor/policy-form-expression-constraint/policy-form-expression-constraint.component'; +import {PolicyFormExpressionEmptyComponent} from './business/policy-editor/editor/policy-form-expression-empty/policy-form-expression-empty.component'; +import {PolicyFormExpressionMultiComponent} from './business/policy-editor/editor/policy-form-expression-multi/policy-form-expression-multi.component'; +import {PolicyFormExpressionComponent} from './business/policy-editor/editor/policy-form-expression/policy-form-expression.component'; +import {PolicyFormRemoveButton} from './business/policy-editor/editor/policy-form-remove-button/policy-form-remove-button.component'; +import {PolicyExpressionRecipeService} from './business/policy-editor/editor/recipes/policy-expression-recipe.service'; +import {TimespanRestrictionDialogComponent} from './business/policy-editor/editor/recipes/timespan-restriction-dialog/timespan-restriction-dialog.component'; +import {PolicyMapper} from './business/policy-editor/model/policy-mapper'; +import {PolicyMultiExpressionService} from './business/policy-editor/model/policy-multi-expressions'; +import {PolicyOperatorService} from './business/policy-editor/model/policy-operators'; +import {PolicyVerbService} from './business/policy-editor/model/policy-verbs'; +import {PolicyExpressionComponent} from './business/policy-editor/renderer/policy-expression/policy-expression.component'; +import {PolicyRendererComponent} from './business/policy-editor/renderer/policy-renderer/policy-renderer.component'; +import {TransferHistoryMiniListComponent} from './business/transfer-history-mini-list/transfer-history-mini-list.component'; +import {AgoComponent} from './common/ago/ago.component'; +import {AgoPipe} from './common/ago/ago.pipe'; +import {ConfirmationDialogComponent} from './common/confirmation-dialog/confirmation-dialog.component'; +import {DateComponent} from './common/date/date.component'; +import {EmptyStateComponent} from './common/empty-state/empty-state.component'; +import {ErrorStateComponent} from './common/error-state/error-state.component'; +import {HorizontalSectionDividerComponent} from './common/horizontal-section-divider/horizontal-section-divider.component'; +import {JsonDialogComponent} from './common/json-dialog/json-dialog.component'; +import {JsonDialogService} from './common/json-dialog/json-dialog.service'; +import {LanguageSelectorComponent} from './common/language-selector/language-selector.component'; +import {LoadingStateComponent} from './common/loading-state/loading-state.component'; +import {MarkdownDescriptionComponent} from './common/markdown-description/markdown-description.component'; +import {PropertyGridGroupComponent} from './common/property-grid-group/property-grid-group.component'; +import {PropertyGridComponent} from './common/property-grid/property-grid.component'; +import {TranslateWithSlotComponent} from './common/translate-with-slot/translate-with-slot.component'; +import {TruncatedShortDescription} from './common/truncated-short-description/truncated-short-description.component'; +import {UrlListDialogComponent} from './common/url-list-dialog/url-list-dialog.component'; +import {UrlListDialogService} from './common/url-list-dialog/url-list-dialog.service'; +import {DataAddressTypeSelectComponent} from './form-elements/data-address-type-select/data-address-type-select.component'; +import {DataCategorySelectComponent} from './form-elements/data-category-select/data-category-select.component'; +import {DataSubcategoryItemsPipe} from './form-elements/data-subcategory-select/data-subcategory-items.pipe'; +import {DataSubcategorySelectComponent} from './form-elements/data-subcategory-select/data-subcategory-select.component'; +import {EditAssetFormDataAddressTypeSelectComponent} from './form-elements/edit-asset-form-data-address-type-select/edit-asset-form-data-address-type-select.component'; +import {EditAssetFormGroupComponent} from './form-elements/edit-asset-form-group/edit-asset-form-group.component'; +import {EditAssetFormInputComponent} from './form-elements/edit-asset-form-input/edit-asset-form-input.component'; +import {EditAssetFormLabelComponent} from './form-elements/edit-asset-form-label/edit-asset-form-label.component'; +import {EditAssetFormTextareaComponent} from './form-elements/edit-asset-form-textarea/edit-asset-form-textarea.component'; +import {KeywordSelectComponent} from './form-elements/keyword-select/keyword-select.component'; +import {LanguageSelectComponent} from './form-elements/language-select/language-select.component'; +import {ParticipantIdSelectComponent} from './form-elements/participant-id-select/participant-id-select.component'; +import {PolicyOperatorSelectComponent} from './form-elements/policy-operator-select/policy-operator-select.component'; +import {TransportModeSelectComponent} from './form-elements/transport-mode-select/transport-mode-select.component'; +import {AutofocusDirective} from './pipes-and-directives/autofocus.direcitive'; +import {CompareByFieldPipe} from './pipes-and-directives/compare-by-field.pipe'; +import {ExternalLinkDirective} from './pipes-and-directives/external-link.directive'; +import {IsActiveFeaturePipe} from './pipes-and-directives/is-active-feature.pipe'; +import {RemoveClassDirective} from './pipes-and-directives/remove-class.directive'; +import {TrackByFieldDirective} from './pipes-and-directives/track-by-field.directive'; +import {ValuesPipe} from './pipes-and-directives/values.pipe'; + +const COMPONENTS: NgModule['declarations'] = [ + // ./common + AgoComponent, + AgoPipe, + ConfirmationDialogComponent, + DateComponent, + EmptyStateComponent, + ErrorStateComponent, + HorizontalSectionDividerComponent, + JsonDialogComponent, + LanguageSelectorComponent, + LoadingStateComponent, + MarkdownDescriptionComponent, + PropertyGridComponent, + PropertyGridGroupComponent, + TruncatedShortDescription, + UrlListDialogComponent, + TranslateWithSlotComponent, + + // ./business + AssetCardTagListComponent, + AssetDetailDialogComponent, + ConditionsForUseDialogComponent, + ContractOfferIconComponent, + ContractOfferMiniListComponent, + DataOfferCardsComponent, + InitiateNegotiationConfirmTosDialogComponent, + TransferHistoryMiniListComponent, + + // ./business/asset-edit-form + EditAssetFormComponent, + EditAssetFormGroupComponent, + EditAssetFormLabelComponent, + EditAssetFormInputComponent, + EditAssetFormTextareaComponent, + DataSubcategorySelectComponent, + DataSubcategoryItemsPipe, + + // ./business/policy-editor + PolicyFormAddMenuComponent, + PolicyFormExpressionComponent, + PolicyFormExpressionEmptyComponent, + PolicyFormExpressionConstraintComponent, + PolicyFormExpressionMultiComponent, + PolicyFormRemoveButton, + TimespanRestrictionDialogComponent, + PolicyRendererComponent, + PolicyExpressionComponent, + + // ./form-elements + DataAddressTypeSelectComponent, + DataCategorySelectComponent, + DataSubcategorySelectComponent, + DataSubcategoryItemsPipe, + EditAssetFormDataAddressTypeSelectComponent, + EditAssetFormGroupComponent, + EditAssetFormInputComponent, + EditAssetFormLabelComponent, + EditAssetFormTextareaComponent, + KeywordSelectComponent, + LanguageSelectorComponent, + LanguageSelectComponent, + ParticipantIdSelectComponent, + PolicyOperatorSelectComponent, + TransportModeSelectComponent, + + // ./pipes-and-directives + AutofocusDirective, + CompareByFieldPipe, + ExternalLinkDirective, + IsActiveFeaturePipe, + RemoveClassDirective, + TrackByFieldDirective, + ValuesPipe, +]; + +const MODULES = [ + // Angular + TranslateModule, + + // Angular CDK + ClipboardModule, + + // Angular Material + MatBadgeModule, + MatButtonModule, + MatButtonToggleModule, + MatCardModule, + MatCheckboxModule, + MatChipsModule, + MatDatepickerModule, + MatDialogModule, + MatDividerModule, + MatExpansionModule, + MatFormFieldModule, + MatGridListModule, + MatIconModule, + MatInputModule, + MatListModule, + MatMenuModule, + MatNativeDateModule, + MatPaginatorModule, + MatProgressBarModule, + MatProgressSpinnerModule, + MatRadioModule, + MatSelectModule, + MatSidenavModule, + MatSlideToggleModule, + MatSnackBarModule, + MatStepperModule, + MatTableModule, + MatTabsModule, + MatToolbarModule, + MatTooltipModule, + + // NGX Json Viewer + NgxJsonViewerModule, + + // NgCharts + NgChartsModule, +]; + +@NgModule({ + imports: [ + // Angular + CommonModule, + FormsModule, + ReactiveFormsModule, + + // Angular Material + ...MODULES, + ], + exports: [...MODULES, ...COMPONENTS], + declarations: COMPONENTS, + providers: [ + AssetDetailDialogDataService, + AssetDetailDialogService, + AssetPropertyGridGroupBuilder, + ConditionsForUseDialogService, + PolicyPropertyFieldBuilder, + JsonDialogService, + PolicyExpressionRecipeService, + UrlListDialogService, + PolicyMultiExpressionService, + PolicyOperatorService, + PolicyVerbService, + PolicyMapper, + + {provide: DateAdapter, useClass: CustomDateAdapter}, + + {provide: MAT_DATE_LOCALE, useValue: 'en-GB'}, + { + provide: MAT_FORM_FIELD_DEFAULT_OPTIONS, + useValue: { + appearance: 'outline', + color: 'accent', + } as MatFormFieldDefaultOptions, + }, + { + provide: MAT_TOOLTIP_DEFAULT_OPTIONS, + useValue: { + ...MAT_TOOLTIP_DEFAULT_OPTIONS_FACTORY(), + disableTooltipInteractivity: true, + }, + }, + ], +}) +export class SharedModule {} diff --git a/src/assets/i18n/de.json b/src/assets/i18n/de.json new file mode 100644 index 000000000..c13c543a3 --- /dev/null +++ b/src/assets/i18n/de.json @@ -0,0 +1,294 @@ +{ + "general": { + "close": "Schließen", + "delete": "Löschen", + "error": "Fehler", + "confirm": "Bestätigen", + "edit": "Bearbeiten", + "remove": "Entfernen", + "add": "Hinzufügen", + "cancel": "Abbrechen", + "create": "Erstellen", + "update": "Aktualisieren", + "refresh": "Aktualisieren", + "total": "Total", + "details": "Zeige Details", + "detail": "Details", + "warn": "Warnung", + "title": "Titel", + "disable": "Deaktivieren", + "enable": "Aktivieren", + "show": "Zeige", + "hide": "Verberge", + "description": "Beschreibung", + "loading": "Lädt...", + "loading1": "Lädt", + "still_loading": "Lädt noch...", + "language": "Sprache", + "value": "Wert", + "method": "Methode", + "method_para": "Parametrisierung der Methode", + "path": "Pfad", + "params": "Abfrageparameter", + "additional_properties": "Weitere Eigenschaften", + "data_category": "Datenkategorie", + "data_subcategory": "Datenunterkategorie", + "data_model": "Datenmodell", + "transport_mode": "Transportmodus", + "geo_reference_method": "Georeferenz-Methode", + "geo_location": "Geo-Standort", + "sovereign": "Souverän", + "frequency": "Häufigkeit der Datenaktualisierung", + "nuts": "NUTS-Standort", + "data": "Datenbeispiel", + "show_data": "Zeige Datenbeispiel", + "files": "Referenzdateien", + "show_files": "Zeige Referenzdateien", + "coverage": "Zeitlicher Geltungsbereich", + "conditions": "Nutzungsbedingungen", + "pol": "Richtlinie", + "policies": "Richtlinien", + "irr_pol": "Irreguläre Richtlinie", + "policy": "Vertragsrichtlinien", + "offer": "Vertragsangebot", + "con_def": "Vertragsdefinition", + "cons": "Einschränkungen", + "body": "Körper", + "type": "Typ", + "state": "Status", + "updated": "Zuletzt aktualisiert", + "direction": "Richtung", + "contract": "Vertragsabschluss", + "access_pol": "Zugriffsrichtlinie", + "assets": "Datenbestände", + "asset": "Datenbestand", + "consuming": "Eingehend", + "providing": "Ausgehend", + "endpoint": "Konnektor Endpunkt", + "endpoint_doc": "Endpunkt Dokumentation", + "content_type": "Inhaltstyp", + "publisher": "Anbieter", + "standard_license": "Standardlizenz", + "ad_info": "Weitere Informationen", + "id": "Vertragsangebot ID", + "oth_connector": "Gegenseite", + "signed": "Abgeschlossen", + "auth": "Authentifizierung", + "add_auth": "Authentifizierung hinzufügen", + "header_sec": "Kopfzeile mit Vault Passwort", + "header_val": "Kopfzeile mit Wert", + "auth_header": "Authentifizierungskopfzeile Name", + "auth_value": "Authentifizierungskopfzeile Wert", + "vault_secret": "Vault-Passwort-Name", + "rem_auth": "Entferne Authentifizierung", + "add_header": "Zusätzliche Kopfzeilen", + "header_name": "Kopfzeilen-Name", + "header_value": "Kopfzeilen-Wert", + "add_add_header": "Füge zusätzliche Kopfzeile hinzu" + }, + "tooltip": { + "negotiate": "Sie können keine Verträge mit Ihrem eigenen Konnektor aushandeln.", + "details": "Klicken Sie hier für Details", + "failed_details": "Klicken Sie hier für fehlgeschlagene Katalogdetails", + "clipboard": "In die Zwischenablage kopieren" + }, + "notification": { + "starting_neg": "Scheitern bei der Aufnahme von Verhandlungen.", + "negotiation": "Gescheiterte Vertragsverhandlungen.", + "compl_negotiation": "Vertragsverhandlungen abgeschlossen!", + "asset": "Datei erfolgreich gespeichert.", + "failed_asset": "Fehlgeschlagene Speichervorgang!", + "failed_refresh": "Aktualisierung der Datenbestände fehlgeschlagen!", + "succ_pol": "Erfolgreich erstellte Richtlinie.", + "failed_create_policy": "Fehlgeschlagene Richtlinie", + "failed_transfer_detail_fetch": "Datei-Details konnten nicht abgerufen werden!" + }, + "component_library": { + "delete_title": "Bestätigung der Löschung", + "delete_one": "Bitte bestätigen Sie, dass Sie löschen möchten", + "delete_two": ". Diese Aktion kann nicht rückgängig gemacht werden.", + "t_history": "Übertragungshistorie", + "negotiate": "Verhandeln", + "negotiating": "Verhandeln...", + "succ_negotiating": "Erfolgreich verhandelt", + "transfer": "Übertragung", + "no_description": "Keine Beschreibung", + "show_more": "Zeige mehr", + "show_less": "Zeige weniger", + "organization": "Organisation", + "http_param": "HTTP-Datenquellen-Parametrisierung", + "policy_details": "Zeige Richtlinien Details", + "content_type": "Inhaltstyp", + "at": "Erstellt am", + "up_at": "Aktualisiert am", + "oth_connector": "Gegenpart", + "participant_id": "Teilnehmer ID", + "connector_id": "Konnector ID", + "json_ld": "Zeige JSON-LD", + "no_transfer": "Kein Übertragungsprozess bisher gestartet.", + "json": "Bereinigtes JSON", + "agree": "Ich stimme den Allgemeinen Geschäftsbedingungen zu.", + "accept_licence": "Hiermit erkläre ich mich damit einverstanden, dass ich durch Drücken der Schaltfläche \"Bestätigen\" die mit dem Angebot des Anbieters verbundenen Lizenzbedingungen, Richtlinien und zusätzlichen Nutzungsbedingungen, einschließlich aller Urheberrechtshinweise, akzeptiere.", + "data_offer": "Allgemeine Geschäftsbedingungen für das Datenangebot" + }, + "services": { + "env_version": "Umgebungs Version", + "failed_loading": "Fehler beim Laden von Verbindungsinformationen", + "curator_url": "Kurator-URL", + "curator_org": "Name der Kurator Organisation", + "maintainer": "Name der betreuenden Organisation", + "main_url": "URL betreuende Organisation" + }, + "asset_page": { + "information": "Generelle Informationen", + "asset_id": "Datenbestand-ID", + "keywords": "Passwort", + "legal_name": "Rechtlicher Name des Dateninhabers", + "add_file": "Referenzdatei hinzufügen", + "file_des": "Beschreibung der Referenzdateien", + "info_file": "Zusätzliche Informationen zu den Referenzdateien", + "instructions": "Zusätzliche, rechtlich nicht relevante Nutzungshinweise (z. B. wie der Datensatz zu zitieren ist)", + "datasource_info": "Datenquellen Information", + "datasource": "Datenquelle", + "datasource_config": "Benutzerdefinierte Datenquellenkonfiguration (JSON)", + "provide": "Die konsumierende Seite muss eine benutzerdefinierte HTTP-Methode mit aktivierter Methodenparametrisierung bereitstellen.", + "http_subpath": "Die konsumierende Seite muss einen benutzerdefinierten HTTP-Unterpfad bereitstellen, bei dem die Methodenparametrisierung aktiviert ist. Der benutzerdefinierte HTTP-Teilpfad wird an den Basispfad angehängt.", + "path_para": "Pfadparametrisierung", + "query_para": "Abfrageparameter", + "query_name": "Abfrage Parametername", + "default_query": "Wenn die Parametrisierung von Abfrageparametern aktiviert ist, werden die Standardabfrageparameter und die vom Verbraucher bereitgestellten Abfrageparameter zusammengeführt.", + "query_parameter": " Parametrisierung von Abfrageparametern", + "info_body": "Der Anfragekörper kann nur von der Verbraucherseite aus festgelegt werden, wenn die Parametrisierung aktiviert ist.", + "request_body": "Anfragekörper", + "request_para": "Parametrisierung des Anfragekörpers", + "search_assets": "Durchsuche Datenbestände", + "create_assets": "Erstelle Datenbestände", + "create_asset": " Erstelle neuen Datenbestand", + "edit_asset": "Bearbeite Datenbestand", + "no_assets": "Keine Datenbestände mit gegebenem Filter gefunden.", + "descrip": "Die Beschreibung nutzt", + "add_loc": "Füge Ort hinzu", + "add_sample": "Füge Beispieldaten hinzu" + }, + "catalog_browser_page": { + "fetch": "Status abrufen", + "endpoint_catalogs": "Andere Kataloge für Verbindungs-Endpunkte", + "search": "Katalogssuche", + "con_endpoints": "Konnektor Endpunkte", + "enter_endpoints": "Bitte geben Sie andere Connector-Endpunkte an, um Kataloge zu holen.", + "no_contract_offers": "Keine Vertragsangebote mit diesem Filter gefunden", + "contract": "Vertragsangebot", + "usage": "Bereits verwendet" + }, + "contract_agreement_page": { + "search_agree": "Suche nach Vertragsvereinbarungen...", + "no_agree": "Noch keine vertraglichen Vereinbarungen.", + "no_agree_found": "Keine Vertragsvereinbarungen mit gegebenem Filter gefunden.", + "con_agree": "Verbrauchen von Vertragsvereinbarungen", + "prov_agree": "Bereitstellung von Vertragsvereinbarungen", + "ini_transfer": "Übertragung einleiten", + "http_fields": "Http-Datenquellenparametrisierung Felder", + "http_para": "Http-Datenquellen-Parametrisierung", + "http_message": "Wenn das Datenangebot auf der Anbieterseite vom Typ HttpData ist und bestimmte Datenquellenfelder gesetzt sind, können bestimmte Teile der Anfrage an die Datenquelle von der Verbraucherseite aus angepasst werden und werden bei der Einleitung der Übertragung an den anderen Konnektor übergeben. Dadurch kann ein Asset mehr als nur eine Art von Daten enthalten, was zusätzliche Filterung oder sogar die gemeinsame Nutzung ganzer APIs mit mehreren Datensätzen über ein einziges Asset und einen einzigen Vertrag ermöglicht.", + "res_url": "Die resultierende URL sieht wie folgt aus", + "proxy_body": "Erfordert, dass Anfragekörper wahr ist.", + "proxy_query": "Erfordert, dass Anfrageparameter wahr sind.", + "proxy_path": "Erfordert, dass Anfragepfad wahr ist.", + "proxy_method": "Erfordert, dass Anfragemethode wahr ist. ", + "datasink": "Datasenke", + "cus_datasink": "Benutzerdefinierte Datasenke-Konfiguration (JSON)", + "cus_transfer": "Benutzerdefinierte Übertragungsprozess-Anforderung (JSON)", + "json_hint": "JSON-LD Werte für edc:connectorId, edc:contractId, edc:connectorId und edc:connectorAddress werden überschrieben.", + "cus_meth": "Benutzerdefinierte Methode", + "cus_query": "Benutzerdefinierte Abfrage Parameter Name", + "add_cus_query": "Benutzerdefinierten Abfrage-Parameter hinzufügen", + "req_cont": "Benutzerdefinierter Inhaltstyp für Anfragen", + "req_body": "Anfragekörper", + "cus_sub": "Benutzerdefinierter Unterpfad", + "new_def": "Erstelle neue Vertragsdefinition", + "search_def": "Suche Vertragsdefinition", + "create_def": "Vertragsdefinition erstellen", + "con_def": "Keine Vertragsdefinition mit gegebenem Filter gefunden." + }, + "dashboard_page": { + "error": "Fehler", + "completed": "Abgeschlossen", + "progress": "In Arbeit", + "no_transfer": "Keine ausgehenden Übertragungen", + "no_transfer2": "Keine eingehenden Übertragungen", + "num_transfer": "Anzahl der Übertragungsvorgänge", + "failed_ui_build": "Abruf der Daten des letzten Baudatums der Benutzeroberfläche fehlgeschlagen", + "failed_ui": "Abruf der letzten UI Commit Daten fehlgeschlagen", + "failed_env": "Abruf von Env und Jar letzten Commit Daten fehlgeschlagen", + "failed_dashboard": "Abruf von Dashboard-Seitendaten fehlgeschlagen", + "failed_offers": "DATENÜBERTRAGUNG FEHLGESCHLAGEN", + "inc_data": "Eingehende Daten", + "trans_pro": "Übertragungsvorgänge", + "out_data": "Ausgehende Daten", + "conn_prop": "Konnektor Eigenschaften", + "add_prop": "Zusätzliche Eigenschaften", + "edc_conn": "EDC Konnektor", + "descrip": "Geben Sie den folgenden Konnektor-Endpunkt frei, um anderen den Zugriff auf den Katalog Ihres EDC Konnektors zu ermöglichen. Dies ist vor allem bei der Verwendung von Datenangeboten mit eingeschränktem Konnektor nützlich, die in Brokern nicht angezeigt werden.", + "conn_end": "Konnektor Endpunkte", + "api_url": "Management API URL", + "edition_edc": "Basisausgabe EDC", + "page": "klicken.", + "marketing_mds_basic_intro": "Dieser EDC Konnektor auf der Abo-Ebene Basic wird von sovity bereitgestellt, um Ihre ersten Schritte im Mobility Data Space (MDS) zu ermöglichen.", + "marketing_mds_basic_intro2": "Für zusätzliche Funktionen und erweiterte Kapazitäten können Sie uns gerne kontaktieren.", + "marketing_ce_intro": "Um Datenräume wie Mobility Data Space oder Catena-X innerhalb weniger Minuten zu verbinden, betrachten Sie die verwaltete Lösung von", + "marketing_ce_intro2": "- den Connector-as-a-Service (CaaS), der auf Open-Source-Software basiert und mit wichtigen Unternehmensfunktionen angereichert ist.", + "marketing_about": "Das Eclipse Dataspace Components Framework ermöglicht einen souveränen, organisationsübergreifenden Datenaustausch.", + "marketing_about2": "Es implementiert den internationalen Datenraumstandard (IDS) sowie die mit GAIA-X verbundenen relevanten Protokolle.", + "marketing_about3": "Der Aufbau ist so erweiterbar wie möglich gestaltet, um die Integration in verschiedene Datenökosysteme zu fördern.", + "marketing_about_ui": "Beispielhafte Anwendungsfälle, die Sie mit dieser Anwendung ausprobieren können, sind:", + "marketing_about_ui_catalog_view_offers": "Zeigen Sie den Datenbestands-Katalog an, der Ihnen in Ihrem Datenraum zur Verfügung steht, unter", + "marketing_about_ui_catalog_negotiate": "Verhandeln Sie einen Vertrag für die gemeinsame Nutzung von Daten in Ihrem Datenraum unter", + "marketing_about_ui_contracts_transfer": "Übertragen Sie ein Element in Ihren Datenraum indem Sie auf ", + "marketing_about_ui_transfer_history_view": "Sehen Sie sich an, welche Datenbestände in Ihrem Datenraum übertragen wurden, indem Sie auf", + "marketing_about_ui_assets_view_and_create": "Betrachten und erstellen Sie Datenbstände indem Sie auf", + "marketing_about_ui_policies_view_and_create": "Betrachten und erstellen Sie Richtlinien und wenden Sie diese auf Datenbestände in Ihrem Datenraum an, indem Sie auf", + "marketing_about_ui_contract_definitions_view_and_create": "Veröffentlichen Sie ein neues Element in Ihrem Datenraum unter", + "marketing_about_ui_contracts_view_existing": "Betrachten Sie ihre existierenden Verträge, indem Sie auf", + "contact": "Kontaktieren Sie uns", + "managed_edc": "Managed EDC", + "conn_service": "Konnektor als Dienstleistung", + "about": "Über EDC", + "eclipse": "Eclipse-Datenraum-Komponenten", + "about_ui": "Über EDC UI", + "data_dashboard": "Daten Dashboard", + "catalog": "Datenkatalog", + "contracts": "Verträge", + "transfer": "Übertragungshistorie", + "con_def": "Vertragsefinitions", + "your_def": "Deine Vertragsdefinitionen", + "your_assets": "Deine Datenbestände", + "your_pol": "Deine Richtlinien", + "pre_cat": "Vorkonfigurierte Kataloge", + "con_agree": "Vertragliche Vereinbarungen" + }, + "policy_definition_page": { + "create_pol": "Erstelle eine neue Richtlinie", + "time_res": "Zeitlich begrenzter Zeitraum", + "conn_res": "Anschluss mit vom Konnektor eingeschränkter Nutzung", + "date_range": "Datumsbereich", + "search_pol": "Durchsuche Richtlinien", + "create_policy": "Erstelle eine Richtlinie", + "no_pol": "Keine Richtlinie mit gegebenem Filter gefunden." + }, + "transfer_history_page": { + "subtitle": "Übertragungshistorie Details", + "no_trans": "Keine Übertragungshistorie gefunden.", + "counter_endpoint": "Gegenpart Konnektorendpunkt", + "counter_id": "Gegenpart Teilnehmer ID" + }, + "connector_ui": { + "dashboard": "Übersicht", + "catalog": "Katalogssuche", + "contracts": "Verträge", + "transfer": "Übertragungshistorie", + "assets": "Datenbestände", + "policies": "Richtlinien", + "contract": "Vertragsdefinition", + "logout": "Ausloggen" + } +} diff --git a/src/assets/i18n/en.json b/src/assets/i18n/en.json new file mode 100644 index 000000000..c420e0500 --- /dev/null +++ b/src/assets/i18n/en.json @@ -0,0 +1,329 @@ +{ + "general": { + "close": "Close", + "delete": "Delete", + "error": "Error", + "confirm": "Confirm", + "edit": "Edit", + "remove": "Remove", + "add": "Add", + "cancel": "Cancel", + "create": "Create", + "update": "Update", + "refresh": "Refresh", + "total": "Total", + "details": "Show Details", + "warn": "Warn", + "title": "Title", + "disable": "Disable", + "enable": "Enable", + "show": "Show", + "hide": "Hide", + "description": "Description", + "loading": "Loading...", + "loading1": "Loading", + "still_loading": "Still Loading...", + "language": "Language", + "value": "Value", + "method": "Method", + "method_para": "Method Parameterization", + "path": "Path", + "params": "Query Params", + "additional_properties": "Additional Properties", + "data_category": "Data Category", + "data_subcategory": "Data Subcategory", + "data_model": "Data Model", + "transport_mode": "Transport Mode", + "geo_reference_method": "Geo reference method", + "geo_location": "Geo Location", + "sovereign": "Sovereign", + "frequency": "Data Update Frequency", + "nuts": "NUTS Locations", + "data": "Data Samples", + "show_data": "Show Data Samples", + "files": "Reference Files", + "show_files": "Show Reference Files", + "coverage": "Temporal Coverage", + "conditions": "Conditions For Use", + "policy": "Policy", + "policies": "Policies", + "irr_pol": "Irregular Policy", + "contract_policy": "Contract Policy", + "contract_offer": "Contract Offer", + "con_def": "Data Offer", + "cons": "Constraints", + "body": "Body", + "type": "Type", + "state": "State", + "updated": "Last updated", + "direction": "Direction", + "contract": "Contract Agreement", + "access_pol": "Access Policy", + "assets": "Assets", + "asset": "Asset", + "consuming": "Consuming", + "providing": "Providing", + "endpoint": "Connector Endpoint", + "endpoint_doc": "Endpoint Documentation", + "content_type": "Content Type", + "publisher": "Publisher", + "standard_license": "Standard License", + "ad_info": "Advanced Information", + "id": "Contract Offer ID", + "oth_connector": "Other Connector", + "signed": "Signed", + "auth": "Authentication", + "add_auth": "Add Authentication", + "header_sec": "Header with Vault Secret", + "header_val": "Header with Value", + "auth_header": "Auth Header Name", + "auth_value": "Auth Header Value", + "vault_secret": "Vault Secret Name", + "rem_auth": "Remove Authentication", + "add_header": "Additional Headers", + "header_name": "Header Name", + "header_value": "Header Value", + "add_add_header": "Add Additional Header", + "page": "Page" + }, + "tooltip": { + "negotiate": "Cannot negotiate contracts with your own connector.", + "details": "Click for details", + "failed_details": "Click for failed catalog details", + "clipboard": "Copy to clipboard" + }, + "notification": { + "starting_neg": "Failure starting negotiation.", + "negotiation": "Failed negotiating contract.", + "compl_negotiation": "Contract Negotiation complete!", + "asset": "Successfully saved asset.", + "failed_asset": "Failed saving asset!", + "failed_refresh": "Failed refreshing asset list!", + "succ_pol": "Successfully created policy.", + "failed_create_policy": "Failed creating Policy!", + "failed_transfer_detail_fetch": "Failed to fetch asset details!" + }, + "component_library": { + "delete_title": "Deletion confirmation", + "delete_one": "Please confirm you want to delete", + "delete_two": "This action cannot be undone.", + "t_history": "Transfer History", + "negotiate": "Negotiate", + "negotiating": "Negotiating...", + "succ_negotiating": "Successfully Negotiated", + "transfer": "Transfer", + "no_description": "No Description", + "show_more": "Show more", + "show_less": "Show less", + "organization": "Organization", + "http_param": "HTTP Data Source Parameterization", + "policy_details": "Show Policy Details", + "content_type": "Content Type", + "at": "Created At", + "up_at": "Updated At", + "oth_connector": "Other Connector", + "participant_id": "Participant ID", + "participant_id_plural": "Participant IDs", + "connector_id": "Connector ID", + "connector_id_plural": "Connector IDs", + "json_ld": "Show JSON-LD", + "no_transfer": "No transfer processes started yet.", + "json": "Cleaned JSON", + "agree": "I agree to the Data Offer Terms & Conditions", + "accept_licence": "Hereby I agree that by pressing the 'Confirm' button, I accept the license\n terms, policies, and additional conditions for use, including any copyright\n notices, associated with the provider's offer.", + "data_offer": "Data Offer Terms & Conditions" + }, + "services": { + "env_version": "Environment Version", + "failed_loading": "Failed loading connector information", + "curator_url": "Curator URL", + "curator_org": "Curator Organization Name", + "maintainer": "Maintainer Organization Name", + "main_url": "Maintainer URL" + }, + "asset_list_page": { + "title": "Assets", + "page": "Asset Page", + "information": "General Information", + "information_desc": "Fill out general information about the asset.", + "my_asset": "My Asset", + "asset_id": "Asset ID", + "keywords": "Keywords", + "add_keyword": "Add keyword...", + "legal_name": "Legal name of the data owner", + "add_file": "Add reference file", + "file_des": "Reference files description", + "info_file": "Additional information regarding the reference files", + "instructions": "Additional not legally relevant usage instructions (e.g. how to cite the dataset)", + "datasource_info": "Datasource Information", + "datasource": "Datasource", + "datasource_config": "Custom Datasource Config (JSON)", + "provide": "The consuming side must provide a Custom HTTP Method with method parameterization enabled.", + "http_subpath": "The consuming side must provide a Custom HTTP Subpath with method parameterization is enabled. The Custom HTTP Subpath will be appended to the base path.", + "path_para": "Path Parameterization", + "method_para": "Method Parameterization", + "query_para": "Query Params", + "query_para_single": "Query Param", + "query_name": "Query Param Name", + "default_query": "With query param parameterization enabled, the default query params and the query params provided by the consumer will be merged.", + "query_parameter": " Query Param Parameterization", + "info_body": "The request body can only be set from the consumer side, if parameterization is enabled.", + "request_body": "Request Body", + "request_para": "Request Body Parameterization", + "search_assets": "Search assets", + "create_asset": " Create New Asset", + "edit_asset": "Edit Asset", + "no_assets": "No assets found with given filter.", + "descrip": "The description uses", + "add_loc": "Add location", + "add_sample": "Add data sample", + "name": "Title", + "version": "Version" + }, + "catalog_browser_page": { + "title": "Catalog Browser", + "page": "Catalog Browser", + "fetch": "Fetch Status", + "endpoint_catalogs": "Other Connector Endpoint Catalogs", + "search": "Search catalog", + "con_endpoints": "Connector Endpoints", + "enter_endpoints": "Please enter other connector endpoints to fetch catalogs.", + "no_contract_offers": "No contract offers found with this filter", + "contract": "Contract Offer", + "usage": "Already using" + }, + "contract_agreement_page": { + "title": "Contracts", + "page": "Contract Page", + "search_agree": "Search contract agreements...", + "no_agree": "No contract agreements yet.", + "no_agree_found": "No contract agreements found with given filter.", + "con_agree": "Consuming Contract Agreements", + "prov_agree": "Providing Contract Agreements", + "ini_transfer": "Initiate Transfer", + "http_fields": "Http Datasource Parameterization Fields", + "http_para": "Http Datasource Parameterization", + "http_message": "When the data offer on the provider side is of the type HttpData and certain data source fields are set, certain parts of the request to the data source can be customized from the consumer side and will be passed to the other connector when initiating the transfer. This allows an asset to contain more than just one kind of data, allowing additional filtering or even sharing of entire APIs with multiple data sets via a single asset and a single contract.", + "res_url": "The resulting URL will look like", + "proxy_body": "Requires proxyBody to be true.", + "proxy_query": "Requires proxyQueryParams to be true", + "proxy_path": "Requires proxyPath to be true. ", + "proxy_method": "Requires proxyMethod to be true. ", + "datasink": "Datasink", + "cus_datasink": "Custom Datasink Config (JSON)", + "cus_transfer": "Custom Transfer Process Request (JSON)", + "json_hint": "JSON-LD values for edc:connectorId, edc:contractId, edc:connectorId and edc:connectorAddress will be overridden.", + "cus_meth": "Custom Method", + "cus_query": "Custom Query Param Name", + "add_cus_query": "Add Custom Query Param", + "req_cont": "Custom Request Body Content Type", + "req_body": "Custom Request Body", + "cus_sub": "Custom Subpath", + "new_def": "Publish New Data Offer", + "search_def": "Search data offer", + "create_def": "Publish Data Offer", + "con_def": "No data offer found with given filter." + }, + "contract_definition_page": { + "title": "Data Offers", + "page": "Data Offer Page" + }, + "create_data_offer_page": { + "title": "Create Data Offer" + }, + "edit_asset_page": { + "title": "Edit Asset" + }, + "dashboard_page": { + "title": "Dashboard", + "page": "Dashboard Page", + "error": "Error", + "completed": "Completed", + "progress": "In Progress", + "no_transfer": "NO PROVIDING TRANSFER PROCESSES", + "no_transfer2": "NO CONSUMING TRANSFER PROCESSES", + "num_transfer": "Number of Transfer Processes", + "failed_ui_build": "Failed fetching UI Last Build Date Data", + "failed_ui": "Failed fetching UI Last Commit Data", + "failed_env": "Failed fetching Env and Jar Last Commit Data", + "failed_dashboard": "Failed fetching Dashboard Page Data", + "failed_offers": "Failed fetching data offers.", + "inc_data": "Incoming Data", + "trans_pro": "Transfer Processes", + "out_data": "Outgoing Data", + "conn_prop": "Connector Properties", + "add_prop": "Additional Properties", + "edc_conn": "EDC Connector", + "descrip": "Share the following Connector Endpoint to let others access your EDC Connector's catalog. This is especially useful when using connector-restricted data offers which won't show up in brokers.", + "conn_end": "Connector Endpoint", + "api_url": "Management API URL", + "edition_edc": "Basic Edition EDC", + "marketing_mds_basic_intro": "This EDC Connector on the subscription level Basic is provided by sovity to enable your first steps in the Mobility Data Space (MDS).", + "marketing_mds_basic_intro2": "For additional features and advanced capacities, please feel free to contact us.", + "marketing_ce_intro": "To join data spaces like Mobility Data Space or Catena-X within minutes, consider the managed solution by", + "marketing_ce_intro2": "- the Connector-as-a-Service (CaaS) based on open-source software enriched with key enterprise features.", + "marketing_about": "The Eclipse Dataspace Components framework facilitates sovereign, inter-organizational data exchange.", + "marketing_about2": "It implements the International Data Spaces standard (IDS) as well as relevant protocols associated with GAIA-X.", + "marketing_about3": "The framework is designed as extensible as possible to encourage integrations into various data ecosystems.", + "marketing_about_ui": "Example use cases, that you can try out with this application, are:", + "marketing_about_ui_catalog_view_offers": "View the asset catalog available to you in your Dataspace using the {}", + "marketing_about_ui_catalog_negotiate": "Negotiate a contract for data sharing in your Dataspace using the {}", + "marketing_about_ui_contracts_transfer": "Transfer an asset in your Dataspace using the {}", + "marketing_about_ui_transfer_history_view": "View which assets have been transferred in your Dataspace in the {}", + "marketing_about_ui_assets_view_and_create": "View and create assets using the {}", + "marketing_about_ui_policies_view_and_create": "View and create policies and apply these to assets in your Dataspace using the {}", + "marketing_about_ui_contract_definitions_view_and_create": "Publish an asset into your Dataspace using the {}", + "marketing_about_ui_contracts_view_existing": "View your existing contracts in the {}", + "contact": "Contact us", + "managed_edc": "Get Managed EDC", + "conn_service": "Connector-as-a-Service", + "about": "About EDC", + "eclipse": "Eclipse Dataspace Components", + "about_ui": "About EDC UI", + "data_dashboard": "Data Dashboard", + "catalog": "Catalog Browser", + "contracts": "Contracts", + "transfer": "Transfer History", + "con_def": "Contract Definitions", + "your_def": "Your Contract Definitions", + "your_assets": "Your Assets", + "your_pol": "Your Policies", + "pre_cat": "Preconfigured Catalogs", + "con_agree": "Contract Agreements" + }, + "policy_definition_page": { + "title": "Policies", + "page": "Policy Page", + "create_pol": "Create New Policy", + "time_res": "Time-Period-Restricted", + "conn_res": "Connector-Restricted-Usage", + "date_range": "Date Range", + "search_pol": "Search policies", + "create_policy": "Create Policy", + "no_pol": "No policy found with given filter." + }, + "create_policy_page": { + "title": "Create Policy" + }, + "transfer_history_page": { + "title": "Transfer History", + "page": "Transfer History Page", + "subtitle": "Transfer History Details", + "no_trans": "No transfer history found.", + "counter_endpoint": "Counterparty Connector Endpoint", + "counter_id": "Counterparty Participant ID" + }, + "logout_page": { + "title": "Logout" + }, + "connector_ui": { + "dashboard": "Dashboard", + "catalog": "Catalog Browser", + "contracts": "Contracts", + "transfer": "Transfer History", + "assets": "Assets", + "policies": "Policies", + "contract": "Contract Definitions", + "logout": "Logout" + } +} diff --git a/src/assets/images/flags/de.svg b/src/assets/images/flags/de.svg new file mode 100644 index 000000000..442047028 --- /dev/null +++ b/src/assets/images/flags/de.svg @@ -0,0 +1,9 @@ + + + + Flag of Germany + + + + diff --git a/src/assets/images/flags/en.svg b/src/assets/images/flags/en.svg new file mode 100644 index 000000000..c52d43125 --- /dev/null +++ b/src/assets/images/flags/en.svg @@ -0,0 +1,61 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/styles.scss b/src/styles.scss index 5fcd9403c..464185a7e 100644 --- a/src/styles.scss +++ b/src/styles.scss @@ -82,8 +82,6 @@ body { .link { color: var(--link-color); text-decoration: none; - display: flex; - align-items: center; &:hover, &:focus {