From ea726a7dba11a2852da5fed104b5d9a37184fb74 Mon Sep 17 00:00:00 2001 From: Mattia Vianelli Date: Thu, 2 Nov 2023 14:16:14 +0100 Subject: [PATCH] CST-12455 Moved patterns to be using i18n, added id to represent the string to send to the rest when doing operations --- .../ldn-service-form-edit.component.html | 4 +- .../ldn-service-form.component.html | 4 +- .../ldn-service-coar-patterns.ts | 137 +++++++++--------- src/assets/i18n/en.json5 | 53 +++++++ 4 files changed, 129 insertions(+), 69 deletions(-) diff --git a/src/app/admin/admin-ldn-services/ldn-service-form-edit/ldn-service-form-edit.component.html b/src/app/admin/admin-ldn-services/ldn-service-form-edit/ldn-service-form-edit.component.html index 568f3ed46f..8b086ceead 100644 --- a/src/app/admin/admin-ldn-services/ldn-service-form-edit/ldn-service-form-edit.component.html +++ b/src/app/admin/admin-ldn-services/ldn-service-form-edit/ldn-service-form-edit.component.html @@ -90,7 +90,7 @@ name="additionalInboundPattern{{i}}" required> + [ngValue]="pattern.id">{{ pattern.name | translate }} @@ -167,7 +167,7 @@ required> + [ngValue]="pattern.id">{{ pattern.name | translate }}
diff --git a/src/app/admin/admin-ldn-services/ldn-service-form/ldn-service-form.component.html b/src/app/admin/admin-ldn-services/ldn-service-form/ldn-service-form.component.html index f1afa886f1..23287ea671 100644 --- a/src/app/admin/admin-ldn-services/ldn-service-form/ldn-service-form.component.html +++ b/src/app/admin/admin-ldn-services/ldn-service-form/ldn-service-form.component.html @@ -81,7 +81,7 @@ name="additionalInboundPattern{{i}}" required> + [ngValue]="pattern.id">{{ pattern.name | translate }}
@@ -150,7 +150,7 @@ required> + [ngValue]="pattern.id ">{{ pattern.name | translate }}
diff --git a/src/app/admin/admin-ldn-services/ldn-services-patterns/ldn-service-coar-patterns.ts b/src/app/admin/admin-ldn-services/ldn-services-patterns/ldn-service-coar-patterns.ts index 7b0c25e832..dca0fd8daf 100644 --- a/src/app/admin/admin-ldn-services/ldn-services-patterns/ldn-service-coar-patterns.ts +++ b/src/app/admin/admin-ldn-services/ldn-services-patterns/ldn-service-coar-patterns.ts @@ -1,69 +1,76 @@ export const notifyPatterns = [ - { - name: 'Acknowledge and Accept', - description: 'This pattern is used to acknowledge and accept a request (offer). It implies an intention to act on the request.', - category: 'Acknowledgements' - }, - { - name: 'Acknowledge and Reject', - description: 'This pattern is used to acknowledge and reject a request (offer). It signifies no further action regarding the request.', - category: 'Acknowledgements' - }, - { - name: 'Acknowledge and Tentatively Accept', - description: 'This pattern is used to acknowledge and tentatively accept a request (offer). It implies an intention to act, which may change.', - category: 'Acknowledgements' - }, - { - name: 'Acknowledge and Tentatively Reject', - description: 'This pattern is used to acknowledge and tentatively reject a request (offer). It signifies no further action, subject to change.', - category: 'Acknowledgements' - }, - { - name: 'Announce Endorsement', - description: 'This pattern is used to announce the existence of an endorsement, referencing the endorsed resource.', - category: 'Announcements' - }, - { - name: 'Announce Ingest', - description: 'This pattern is used to announce that a resource has been ingested.', - category: 'Announcements' - }, - { - name: 'Announce Relationship', - description: 'This pattern is used to announce a relationship between two resources.', - category: 'Announcements' - }, - { - name: 'Announce Review', - description: 'This pattern is used to announce the existence of a review, referencing the reviewed resource.', - category: 'Announcements' - }, - { - name: 'Announce Service Result', - description: 'This pattern is used to announce the existence of a "service result", referencing the relevant resource.', - category: 'Announcements' - }, - { - name: 'Request Endorsement', - description: 'This pattern is used to request endorsement of a resource owned by the origin system.', - category: 'Requests' - }, - { - name: 'Request Ingest', - description: 'This pattern is used to request that the target system ingest a resource.', - category: 'Requests' - }, - { - name: 'Request Review', - description: 'This pattern is used to request a review of a resource owned by the origin system.', - category: 'Requests' - }, - { - name: 'Undo Offer', - description: 'This pattern is used to undo (retract) an offer previously made.', - category: 'Undo' - } + { + id: 'ask-accept', + name: 'ldn-service.form.label.pattern.acknowledge-and-accept.name', + description: 'ldn-service.form.label.pattern.acknowledge-and-accept.description', + category: 'ldn-service.form.label.pattern.acknowledge-and-accept.category' + }, + { + id: 'ask-reject', + name: 'ldn-service.form.label.pattern.acknowledge-and-reject.name', + description: 'ldn-service.form.label.pattern.acknowledge-and-reject.description', + category: 'Acknowledgements' + }, + { + id: 'ask-tentative', + name: 'ldn-service.form.label.pattern.acknowledge-and-tentatively-accept.name', + description: 'ldn-service.form.label.pattern.acknowledge-and-tentatively-accept.description', + category: 'Acknowledgements' + }, + { + id: 'announce-endorsement', + name: 'ldn-service.form.label.pattern.announce-endorsement.name', + description: 'ldn-service.form.label.pattern.announce-endorsement.description', + category: 'Announcements' + }, + { + id: 'announce-ingest', + name: 'ldn-service.form.label.pattern.announce-ingest.name', + description: 'ldn-service.form.label.pattern.announce-ingest.description', + category: 'Announcements' + }, + { + id: 'announce-relationship', + name: 'ldn-service.form.label.pattern.announce-relationship.name', + description: 'ldn-service.form.label.pattern.announce-relationship.description', + category: 'Announcements' + }, + { + id: 'announce-review', + name: 'ldn-service.form.label.pattern.announce-review.name', + description: 'ldn-service.form.label.pattern.announce-review.description', + category: 'Announcements' + }, + { + id: 'announce-service-result', + name: 'ldn-service.form.label.pattern.announce-service-result.name', + description: 'ldn-service.form.label.pattern.announce-service-result.description', + category: 'Announcements' + }, + { + id: 'request-endorsement', + name: 'ldn-service.form.label.pattern.request-endorsement.name', + description: 'ldn-service.form.label.pattern.request-endorsement.description', + category: 'Requests' + }, + { + id: 'request-ingest', + name: 'ldn-service.form.label.pattern.request-ingest.name', + description: 'ldn-service.form.label.pattern.request-ingest.description', + category: 'Requests' + }, + { + id: 'request-review', + name: 'ldn-service.form.label.pattern.request-review.name', + description: 'ldn-service.form.label.pattern.request-review.description', + category: 'Requests' + }, + { + id: 'undo', + name: 'ldn-service.form.label.pattern.undo-offer.name', + description: 'ldn-service.form.label.pattern.undo-offer.description', + category: 'Undo' + } ]; diff --git a/src/assets/i18n/en.json5 b/src/assets/i18n/en.json5 index 108433de21..7cda0e603b 100644 --- a/src/assets/i18n/en.json5 +++ b/src/assets/i18n/en.json5 @@ -936,6 +936,59 @@ "ldn-new-service.form.placeholder.ldnUrl": "Please specify the URL of the LDN Inbox", "ldn-new-service.form.label.inboundPattern": "Inbound Patterns", "ldn-new-service.form.label.placeholder.inboundPattern": "Select an Inbound Pattern", + + "ldn-service.form.label.pattern.acknowledge-and-accept.name": "Acknowledge and Accept", + "ldn-service.form.label.pattern.acknowledge-and-accept.description": "This pattern is used to acknowledge and accept a request (offer). It implies an intention to act on the request.", + "ldn-service.form.label.pattern.acknowledge-and-accept.category": "Acknowledgements", + + "ldn-service.form.label.pattern.acknowledge-and-reject.name": "Acknowledge and Reject", + "ldn-service.form.label.pattern.acknowledge-and-reject.description": "This pattern is used to acknowledge and reject a request (offer). It signifies no further action regarding the request.", + "ldn-service.form.label.pattern.acknowledge-and-reject.category": "Acknowledgements", + + "ldn-service.form.label.pattern.acknowledge-and-tentatively-accept.name": "Acknowledge and Tentatively Accept", + "ldn-service.form.label.pattern.acknowledge-and-tentatively-accept.description": "This pattern is used to acknowledge and tentatively accept a request (offer). It implies an intention to act, which may change.", + "ldn-service.form.label.pattern.acknowledge-and-tentatively-accept.category": "Acknowledgements", + + "ldn-service.form.label.pattern.acknowledge-and-tentatively-reject.name": "Acknowledge and Tentatively Reject", + "ldn-service.form.label.pattern.acknowledge-and-tentatively-reject.description": "This pattern is used to acknowledge and tentatively reject a request (offer). It signifies no further action, subject to change.", + "ldn-service.form.label.pattern.acknowledge-and-tentatively-reject.category": "Acknowledgements", + + "ldn-service.form.label.pattern.announce-endorsement.name": "Announce Endorsement", + "ldn-service.form.label.pattern.announce-endorsement.description": "This pattern is used to announce the existence of an endorsement, referencing the endorsed resource.", + "ldn-service.form.label.pattern.announce-endorsement.category": "Announcements", + + "ldn-service.form.label.pattern.announce-ingest.name": "Announce Ingest", + "ldn-service.form.label.pattern.announce-ingest.description": "This pattern is used to announce that a resource has been ingested.", + "ldn-service.form.label.pattern.announce-ingest.category": "Announcements", + + "ldn-service.form.label.pattern.announce-relationship.name": "Announce Relationship", + "ldn-service.form.label.pattern.announce-relationship.description": "This pattern is used to announce a relationship between two resources.", + "ldn-service.form.label.pattern.announce-relationship.category": "Announcements", + + "ldn-service.form.label.pattern.announce-review.name": "Announce Review", + "ldn-service.form.label.pattern.announce-review.description": "This pattern is used to announce the existence of a review, referencing the reviewed resource.", + "ldn-service.form.label.pattern.announce-review.category": "Announcements", + + "ldn-service.form.label.pattern.announce-service-result.name": "Announce Service Result", + "ldn-service.form.label.pattern.announce-service-result.description": "This pattern is used to announce the existence of a 'service result', referencing the relevant resource.", + "ldn-service.form.label.pattern.announce-service-result.category": "Announcements", + + "ldn-service.form.label.pattern.request-endorsement.name": "Request Endorsement", + "ldn-service.form.label.pattern.request-endorsement.description": "This pattern is used to request endorsement of a resource owned by the origin system.", + "ldn-service.form.label.pattern.request-endorsement.category": "Requests", + + "ldn-service.form.label.pattern.request-ingest.name": "Request Ingest", + "ldn-service.form.label.pattern.request-ingest.description": "This pattern is used to request that the target system ingest a resource.", + "ldn-service.form.label.pattern.request-ingest.category": "Requests", + + "ldn-service.form.label.pattern.request-review.name": "Request Review", + "ldn-service.form.label.pattern.request-review.description": "This pattern is used to request a review of a resource owned by the origin system.", + "ldn-service.form.label.pattern.request-review.category": "Requests", + + "ldn-service.form.label.pattern.undo-offer.name": "Undo Offer", + "ldn-service.form.label.pattern.undo-offer.description": "This pattern is used to undo (retract) an offer previously made.", + "ldn-service.form.label.pattern.undo-offer.category": "Undo", + "ldn-new-service.form.label.placeholder.selectedItemFilter": "No Item Filter Selected", "ldn-new-service.form.label.ItemFilter": "Item Filter", "ldn-new-service.form.label.automatic": "Automatic",