CST-12455 Moved patterns to be using i18n, added id to represent the string to send to the rest when doing operations

This commit is contained in:
Mattia Vianelli
2023-11-02 14:16:14 +01:00
parent 5b3bcf4271
commit ea726a7dba
4 changed files with 129 additions and 69 deletions

View File

@@ -90,7 +90,7 @@
name="additionalInboundPattern{{i}}" required> name="additionalInboundPattern{{i}}" required>
<option value="">{{ 'ldn-new-service.form.label.placeholder.inboundPattern' | translate }}</option> <option value="">{{ 'ldn-new-service.form.label.placeholder.inboundPattern' | translate }}</option>
<option *ngFor="let pattern of inboundPatterns" <option *ngFor="let pattern of inboundPatterns"
[ngValue]="pattern.name">{{ pattern.name }}</option> [ngValue]="pattern.id">{{ pattern.name | translate }} </option>
</select> </select>
</div> </div>
@@ -167,7 +167,7 @@
required> required>
<option value="">{{ 'ldn-new-service.form.label.placeholder.outboundPattern' | translate }}</option> <option value="">{{ 'ldn-new-service.form.label.placeholder.outboundPattern' | translate }}</option>
<option *ngFor="let pattern of outboundPatterns" <option *ngFor="let pattern of outboundPatterns"
[ngValue]="pattern.name">{{ pattern.name }}</option> [ngValue]="pattern.id">{{ pattern.name | translate }} </option>
</select> </select>
</div> </div>
<div class="col"> <div class="col">

View File

@@ -81,7 +81,7 @@
name="additionalInboundPattern{{i}}" required> name="additionalInboundPattern{{i}}" required>
<option value="">{{ 'ldn-new-service.form.label.placeholder.inboundPattern' | translate }}</option> <option value="">{{ 'ldn-new-service.form.label.placeholder.inboundPattern' | translate }}</option>
<option *ngFor="let pattern of inboundPatterns" <option *ngFor="let pattern of inboundPatterns"
[ngValue]="pattern.name">{{ pattern.name }}</option> [ngValue]="pattern.id">{{ pattern.name | translate }} </option>
</select> </select>
</div> </div>
@@ -150,7 +150,7 @@
required> required>
<option value="">{{ 'ldn-new-service.form.label.placeholder.outboundPattern' | translate }}</option> <option value="">{{ 'ldn-new-service.form.label.placeholder.outboundPattern' | translate }}</option>
<option *ngFor="let pattern of outboundPatterns" <option *ngFor="let pattern of outboundPatterns"
[ngValue]="pattern.name">{{ pattern.name }}</option> [ngValue]="pattern.id ">{{ pattern.name | translate }}</option>
</select> </select>
</div> </div>
<div class="col"> <div class="col">

View File

@@ -1,69 +1,76 @@
export const notifyPatterns = [ export const notifyPatterns = [
{ {
name: 'Acknowledge and Accept', id: 'ask-accept',
description: 'This pattern is used to acknowledge and accept a request (offer). It implies an intention to act on the request.', name: 'ldn-service.form.label.pattern.acknowledge-and-accept.name',
category: 'Acknowledgements' description: 'ldn-service.form.label.pattern.acknowledge-and-accept.description',
}, category: 'ldn-service.form.label.pattern.acknowledge-and-accept.category'
{ },
name: 'Acknowledge and Reject', {
description: 'This pattern is used to acknowledge and reject a request (offer). It signifies no further action regarding the request.', id: 'ask-reject',
category: 'Acknowledgements' name: 'ldn-service.form.label.pattern.acknowledge-and-reject.name',
}, description: 'ldn-service.form.label.pattern.acknowledge-and-reject.description',
{ 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' 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',
name: 'Acknowledge and Tentatively Reject', category: 'Acknowledgements'
description: 'This pattern is used to acknowledge and tentatively reject a request (offer). It signifies no further action, subject to change.', },
category: 'Acknowledgements' {
}, id: 'announce-endorsement',
{ name: 'ldn-service.form.label.pattern.announce-endorsement.name',
name: 'Announce Endorsement', description: 'ldn-service.form.label.pattern.announce-endorsement.description',
description: 'This pattern is used to announce the existence of an endorsement, referencing the endorsed resource.', category: 'Announcements'
category: 'Announcements' },
}, {
{ id: 'announce-ingest',
name: 'Announce Ingest', name: 'ldn-service.form.label.pattern.announce-ingest.name',
description: 'This pattern is used to announce that a resource has been ingested.', description: 'ldn-service.form.label.pattern.announce-ingest.description',
category: 'Announcements' category: 'Announcements'
}, },
{ {
name: 'Announce Relationship', id: 'announce-relationship',
description: 'This pattern is used to announce a relationship between two resources.', name: 'ldn-service.form.label.pattern.announce-relationship.name',
category: 'Announcements' description: 'ldn-service.form.label.pattern.announce-relationship.description',
}, category: 'Announcements'
{ },
name: 'Announce Review', {
description: 'This pattern is used to announce the existence of a review, referencing the reviewed resource.', id: 'announce-review',
category: 'Announcements' name: 'ldn-service.form.label.pattern.announce-review.name',
}, description: 'ldn-service.form.label.pattern.announce-review.description',
{ 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' id: 'announce-service-result',
}, name: 'ldn-service.form.label.pattern.announce-service-result.name',
{ description: 'ldn-service.form.label.pattern.announce-service-result.description',
name: 'Request Endorsement', category: 'Announcements'
description: 'This pattern is used to request endorsement of a resource owned by the origin system.', },
category: 'Requests' {
}, id: 'request-endorsement',
{ name: 'ldn-service.form.label.pattern.request-endorsement.name',
name: 'Request Ingest', description: 'ldn-service.form.label.pattern.request-endorsement.description',
description: 'This pattern is used to request that the target system ingest a resource.', category: 'Requests'
category: 'Requests' },
}, {
{ id: 'request-ingest',
name: 'Request Review', name: 'ldn-service.form.label.pattern.request-ingest.name',
description: 'This pattern is used to request a review of a resource owned by the origin system.', description: 'ldn-service.form.label.pattern.request-ingest.description',
category: 'Requests' category: 'Requests'
}, },
{ {
name: 'Undo Offer', id: 'request-review',
description: 'This pattern is used to undo (retract) an offer previously made.', name: 'ldn-service.form.label.pattern.request-review.name',
category: 'Undo' 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'
}
]; ];

View File

@@ -936,6 +936,59 @@
"ldn-new-service.form.placeholder.ldnUrl": "Please specify the URL of the LDN Inbox", "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.inboundPattern": "Inbound Patterns",
"ldn-new-service.form.label.placeholder.inboundPattern": "Select an Inbound Pattern", "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.placeholder.selectedItemFilter": "No Item Filter Selected",
"ldn-new-service.form.label.ItemFilter": "Item Filter", "ldn-new-service.form.label.ItemFilter": "Item Filter",
"ldn-new-service.form.label.automatic": "Automatic", "ldn-new-service.form.label.automatic": "Automatic",