diff --git a/src/docs/asciidoc/reference_doc/ui_api.adoc b/src/docs/asciidoc/reference_doc/ui_api.adoc index ad64aca543..1feb12f928 100644 --- a/src/docs/asciidoc/reference_doc/ui_api.adoc +++ b/src/docs/asciidoc/reference_doc/ui_api.adoc @@ -138,7 +138,7 @@ To adapt the template content to the display context it is possible to get from === Function getEntitiesAllowedToRespond -If inside your template, you want to get the ids of the entities allowed to send a response, you can call the method getEntitiesAllowedToRespond. This method returns an array containing the ids. An example of usage can be found in the file https://github.com/opfab/operatorfabric-core/tree/master/src/test/resources/bundles/messageOrQuestionExample/template/question.handlebars[src/test/resources/bundles/messageOrQuestionExample/template/question.handlebars]. +If inside your template, you want to get the ids of the entities allowed to send a response, you can call the method getEntitiesAllowedToRespond. This method returns an array containing the ids. ``` const entities = opfab.currentCard.getEntitiesAllowedToRespond(); @@ -146,14 +146,22 @@ If inside your template, you want to get the ids of the entities allowed to send === Function getEntityUsedForUserResponse -If inside your template, you want to get the id of the entity used by the user to send a response, you can call the method getEntityUsedForUserResponse. -An example of usage can be found in the file https://github.com/opfab/operatorfabric-core/tree/master/src/test/resources/bundles/messageOrQuestionExample/template/question.handlebars[src/test/resources/bundles/messageOrQuestionExample/template/question.handlebars]. +If inside your template, you want to get the id of the entity used by the user to send a response, you can call the method getEntityUsedForUserResponse. This method is deprecated and you should favor the use of the method getEntitiesUsableForUserResponse. ``` const entity = opfab.currentCard.getEntityUsedForUserResponse() ``` +=== Function getEntitiesUsableForUserResponse + +If inside your template, you want to get the ids of the entities the user can answer on behalf of, you can call the method getEntitiesUsableForUserResponse. This method will return an array containing the entities' ids + +``` + const entities = opfab.currentCard.getEntitiesUsableForUserResponse() + +``` + === Function isResponseLocked diff --git a/src/docs/asciidoc/resources/migration_guide_to_4.1.adoc b/src/docs/asciidoc/resources/migration_guide_to_4.1.adoc index d8b340290b..9a1f25abaa 100644 --- a/src/docs/asciidoc/resources/migration_guide_to_4.1.adoc +++ b/src/docs/asciidoc/resources/migration_guide_to_4.1.adoc @@ -39,3 +39,14 @@ For example : == Log directories in docker For the services cards-reminder, supervisor, cards-external-diffusion the log directory in the docker is not anymore /usr/app/logs but /var/log/opfab. So if you map the log directory in your configuration , you need to change it. + + +== OpfabAPI + +The following method is deprecated and it is recommended you use the new method: + +|=== +|Deprecated method or attribute | New method + +|opfab.currentCard.getEntityUsedForUserResponse() +|opfab.currentCard.getEntitiesUsableForUserResponse() \ No newline at end of file diff --git a/src/test/cypress/cypress/integration/CardDetail.spec.js b/src/test/cypress/cypress/integration/CardDetail.spec.js index 50f76817bf..014c77d84e 100644 --- a/src/test/cypress/cypress/integration/CardDetail.spec.js +++ b/src/test/cypress/cypress/integration/CardDetail.spec.js @@ -48,7 +48,7 @@ describe('Card detail', function () { cy.get('#opfab-users-entities-getEntityName-unknownEntity').contains('unknownEntity'); cy.get('#opfab-currentCard-isUserAllowedToRespond').contains('true'); cy.get('#opfab-currentCard-isUserMemberOfAnEntityRequiredToRespond').contains('true'); - cy.get('#opfab-currentCard-getEntityUsedForUserResponse').contains(/^ENTITY1_FR$/); + cy.get('#opfab-currentCard-getEntitiesUsableForUserResponse').contains(/^ENTITY1_FR$/); cy.get('#opfab-currentCard-getDisplayContext').contains(/^realtime$/); cy.get('#opfab-users-entities-getAllEntities').contains( 'entity[0]:id=ENTITY1_FR,name=Control Center FR North,description=Control Center FR North,entityAllowedToSendCard=true,parents=ENTITY_FR,labels=FR1 label' diff --git a/src/test/resources/bundles/cypress/template/kitchenSink.handlebars b/src/test/resources/bundles/cypress/template/kitchenSink.handlebars index 9ef2c612eb..4df7569e7d 100644 --- a/src/test/resources/bundles/cypress/template/kitchenSink.handlebars +++ b/src/test/resources/bundles/cypress/template/kitchenSink.handlebars @@ -32,7 +32,7 @@
onTemplateRenderingComplete :

OPFAB CALLS

-
LINK TO ANOTHER CARD
+
LINK TO ANOTHER CARD

HANDLEBARS TEMPLATING

@@ -71,8 +71,8 @@ function loadData() { responses += opfab.currentCard.isUserMemberOfAnEntityRequiredToRespond(); responses += ''; - responses += '
getEntityUsedForUserResponse() : '; - responses += opfab.currentCard.getEntityUsedForUserResponse(); + responses += '
getEntitiesUsableForUserResponse() : '; + responses += opfab.currentCard.getEntitiesUsableForUserResponse(); responses += '
'; responses += '
getDisplayContext() : '; diff --git a/src/test/resources/bundles/messageOrQuestionExample/template/confirmation.handlebars b/src/test/resources/bundles/messageOrQuestionExample/template/confirmation.handlebars index 5ce3896f13..3a4a75435f 100644 --- a/src/test/resources/bundles/messageOrQuestionExample/template/confirmation.handlebars +++ b/src/test/resources/bundles/messageOrQuestionExample/template/confirmation.handlebars @@ -31,7 +31,6 @@

-