From 5a38d14f1c7356246eacd22147fc587b30c71425 Mon Sep 17 00:00:00 2001 From: illfixit <66363651+illfixit@users.noreply.github.com> Date: Thu, 26 Sep 2024 14:34:59 +0200 Subject: [PATCH] chore: refactor string interpolation to binding --- .../asset-create-dialog.component.html | 102 ++++----- ...t-agreement-transfer-dialog.component.html | 4 +- .../dashboard-page.component.html | 14 +- .../edit-asset-form.component.html | 204 ++++++++---------- ...timespan-restriction-dialog.component.html | 4 +- .../translate-with-slot.component.html | 6 +- .../translate-with-slot.component.ts | 4 + src/assets/i18n/en.json | 6 +- 8 files changed, 169 insertions(+), 175 deletions(-) diff --git a/src/app/routes/connector-ui/asset-list-page/asset-create-dialog/asset-create-dialog.component.html b/src/app/routes/connector-ui/asset-list-page/asset-create-dialog/asset-create-dialog.component.html index 665dd691..fbd3ec86 100644 --- a/src/app/routes/connector-ui/asset-list-page/asset-create-dialog/asset-create-dialog.component.html +++ b/src/app/routes/connector-ui/asset-list-page/asset-create-dialog/asset-create-dialog.component.html @@ -17,17 +17,17 @@

@@ -46,9 +46,9 @@

class="!scale-[0.9]" mat-icon-button matSuffix - matTooltip="{{ + [matTooltip]=" 'create_data_offer_page.version_tooltip' | translate - }}"> + "> info_outline @@ -70,9 +70,9 @@

class="!scale-[0.9]" mat-icon-button matSuffix - matTooltip="{{ + [matTooltip]=" 'create_data_offer_page.asset_id_tooltip' | translate - }}"> + "> info_outline @@ -157,10 +157,10 @@

class="!scale-[0.9]" mat-icon-button matSuffix - matTooltip="{{ + [matTooltip]=" 'create_data_offer_page.endpoint_documentation_tooltip' | translate - }}"> + "> info_outline @@ -181,9 +181,9 @@

class="!scale-[0.9]" mat-icon-button matSuffix - matTooltip="{{ + [matTooltip]=" 'create_data_offer_page.publisher_tooltip' | translate - }}"> + "> info_outline @@ -203,9 +203,9 @@

class="!scale-[0.9]" mat-icon-button matSuffix - matTooltip="{{ + [matTooltip]=" 'create_data_offer_page.standard_license_tooltip' | translate - }}"> + "> info_outline @@ -255,9 +255,9 @@

class="!scale-[0.9]" mat-icon-button matSuffix - matTooltip="{{ + [matTooltip]=" 'create_data_offer_page.data_model_tooltip' | translate - }}"> + "> info_outline @@ -266,7 +266,7 @@

@@ -284,9 +284,9 @@

class="!scale-[0.9]" mat-icon-button matSuffix - matTooltip="{{ + [matTooltip]=" 'create_data_offer_page.geo_reference_tooltip' | translate - }}"> + "> info_outline @@ -299,17 +299,17 @@

}} @@ -322,19 +322,19 @@

}} @@ -352,9 +352,9 @@

class="!scale-[0.9]" mat-icon-button matSuffix - matTooltip="{{ + [matTooltip]=" 'create_data_offer_page.geo_location_tooltip' | translate - }}"> + "> info_outline @@ -370,9 +370,9 @@

mat-icon-button matSuffix matTooltipPosition="right" - matTooltip="{{ + [matTooltip]=" 'create_data_offer_page.nuts_locations_tooltip' | translate - }}"> + "> info_outline @@ -417,9 +417,9 @@

mat-icon-button matSuffix matTooltipPosition="right" - matTooltip="{{ + [matTooltip]=" 'create_data_offer_page.data_samples_tooltip' | translate - }}"> + "> info_outline @@ -466,9 +466,9 @@

mat-icon-button matSuffix matTooltipPosition="right" - matTooltip="{{ + [matTooltip]=" 'create_data_offer_page.reference_files_tooltip' | translate - }}"> + "> info_outline @@ -544,15 +544,15 @@

+ " /> + [placeholder]=" + 'create_data_offer_page.end_date_inclusive' | translate + " /> {{ 'create_data_offer_page.temporal_coverage_hint' | translate }} @@ -574,10 +574,10 @@

@@ -656,9 +656,9 @@

class="!scale-[0.9]" mat-icon-button matSuffix - matTooltip="{{ + [matTooltip]=" 'create_data_offer_page.contact_email_tooltip' | translate - }}"> + "> info_outline @@ -688,9 +688,9 @@

class="!scale-[0.9]" mat-icon-button matSuffix - matTooltip="{{ + [matTooltip]=" 'create_data_offer_page.email_subject_tooltip' | translate - }}"> + "> info_outline @@ -952,11 +952,11 @@

}} @@ -969,9 +969,9 @@

{{ 'general.auth_value' | translate }} diff --git a/src/app/routes/connector-ui/contract-agreement-page/contract-agreement-transfer-dialog/contract-agreement-transfer-dialog.component.html b/src/app/routes/connector-ui/contract-agreement-page/contract-agreement-transfer-dialog/contract-agreement-transfer-dialog.component.html index b36628db..6b44e8f5 100644 --- a/src/app/routes/connector-ui/contract-agreement-page/contract-agreement-transfer-dialog/contract-agreement-transfer-dialog.component.html +++ b/src/app/routes/connector-ui/contract-agreement-page/contract-agreement-transfer-dialog/contract-agreement-transfer-dialog.component.html @@ -244,9 +244,7 @@

'contract_agreement_page.cus_meth' | translate }}

- {{ 'dashboard_page.marketing_ce_intro' | translate }} - sovity
- {{ 'dashboard_page.marketing_ce_intro2' | translate }} + + sovity + +
+

@@ -78,12 +78,12 @@ form.datasource.controls.dataDestination; let ctrl " - label="{{ - 'create_data_offer_page.custom_datasource_config_json_label' - | translate - }}" fieldId="create-asset-form-custom-datasource-json" placeholder='{"https://w3id.org/edc/v0.0.1/ns/type": "HttpData", ...}' + [label]=" + 'create_data_offer_page.custom_datasource_config_json_label' + | translate + " [ctrl]="ctrl"> @@ -259,9 +259,9 @@
+ "> {{ 'asset_list_page.info_body' | translate }} @@ -338,11 +338,11 @@ }} @@ -356,9 +356,9 @@ }} @@ -401,9 +401,9 @@
+ ">
@@ -467,7 +465,7 @@ @@ -476,7 +474,7 @@ @@ -520,7 +518,7 @@ class="mt-4" fieldId="create-asset-form-version" placeholder="1.0.0" - tooltip="{{ 'create_data_offer_page.version_tooltip' | translate }}" + [tooltip]="'create_data_offer_page.version_tooltip' | translate" [label]="'create_data_offer_page.version' | translate" [ctrl]="form.general.controls.version"> @@ -533,24 +531,24 @@ + "> @@ -568,42 +566,38 @@ @@ -611,17 +605,17 @@
+ ">
@@ -658,17 +652,17 @@
+ ">
@@ -706,11 +700,11 @@ + " + [myTitle]="'create_data_offer_page.location_time_title' | translate">
+ "> + [placeholder]="'create_data_offer_page.start_date' | translate" /> + [placeholder]=" + 'create_data_offer_page.end_date_inclusive' | translate + " /> {{ 'create_data_offer_page.temporal_coverage_hint' | translate }} @@ -776,15 +768,15 @@ @@ -792,13 +784,11 @@ @@ -806,27 +796,27 @@
+ ">
@@ -863,21 +853,19 @@ + "> @@ -885,32 +873,28 @@ + "> info_outline @@ -966,9 +950,9 @@ mat-icon-button matSuffix matTooltipPosition="right" - matTooltip="{{ + [matTooltip]=" 'create_data_offer_page.publish_restricted_tooltip' | translate - }}"> + "> info_outline @@ -979,9 +963,9 @@ mat-icon-button matSuffix matTooltipPosition="right" - matTooltip="{{ + [matTooltip]=" 'create_data_offer_page.publish_asset_only_tooltip' | translate - }}"> + "> info_outline diff --git a/src/app/shared/business/policy-editor/editor/recipes/timespan-restriction-dialog/timespan-restriction-dialog.component.html b/src/app/shared/business/policy-editor/editor/recipes/timespan-restriction-dialog/timespan-restriction-dialog.component.html index f00cfbae..a14abb38 100644 --- a/src/app/shared/business/policy-editor/editor/recipes/timespan-restriction-dialog/timespan-restriction-dialog.component.html +++ b/src/app/shared/business/policy-editor/editor/recipes/timespan-restriction-dialog/timespan-restriction-dialog.component.html @@ -15,11 +15,11 @@

+ [placeholder]="'general.start_date' | translate" /> + [placeholder]="'general.end_date' | translate" /> DD/MM/YYYY – DD/MM/YYYY diff --git a/src/app/shared/common/translate-with-slot/translate-with-slot.component.html b/src/app/shared/common/translate-with-slot/translate-with-slot.component.html index 50702d8a..e016fac1 100644 --- a/src/app/shared/common/translate-with-slot/translate-with-slot.component.html +++ b/src/app/shared/common/translate-with-slot/translate-with-slot.component.html @@ -1,5 +1,7 @@ -{{ textBefore }} +{{ textBefore }} + -{{ textAfter }} +{{ 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 index ccc323a3..fbba3630 100644 --- 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 @@ -11,6 +11,10 @@ import {SimpleChangesTyped} from '../../../core/utils/angular-utils'; export class TranslateWithSlotComponent implements OnChanges, OnDestroy { @Input() key!: string; + + @Input() + html = false; + key$ = new Subject(); textBefore = ''; diff --git a/src/assets/i18n/en.json b/src/assets/i18n/en.json index e29d76ab..0cc649d9 100644 --- a/src/assets/i18n/en.json +++ b/src/assets/i18n/en.json @@ -308,7 +308,7 @@ "email_subject_placeholder": "Data Offer 'xyz'", "email_subject_tooltip": "When potential customers reach out to you via email, you’ll receive messages with this subject line.", "email_subject": "Preferred E-Mail Subject", - "end-date-inclusive": "End date (inclusive)", + "end_date_inclusive": "End date (inclusive)", "endpoint_documentation_tooltip": "URL to the technical documentation about the data to be received.", "endpoint_documentation": "Endpoint Documentation", "general_information_description": "Fill out general information about the asset.", @@ -431,8 +431,8 @@ "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_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_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_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.", "no_transfer": "NO PROVIDING TRANSFER PROCESSES",