From e2859db73b918eca8b9da73f790b830789563022 Mon Sep 17 00:00:00 2001 From: Matt Hopson Date: Mon, 22 Jun 2020 13:03:39 -0600 Subject: [PATCH 1/4] Add message action modals to pa11y --- web-client/pa11y/pa11y-petitionsclerk.js | 27 +++++++++++++++++++ .../src/views/Messages/MessageDetail.jsx | 3 +++ 2 files changed, 30 insertions(+) diff --git a/web-client/pa11y/pa11y-petitionsclerk.js b/web-client/pa11y/pa11y-petitionsclerk.js index 57ed1621f88..4e765417101 100644 --- a/web-client/pa11y/pa11y-petitionsclerk.js +++ b/web-client/pa11y/pa11y-petitionsclerk.js @@ -486,4 +486,31 @@ module.exports = [ 'http://localhost:1234/mock-login?token=petitionsclerk&path=/case-messages/section/inbox&info=case-messages-section-inbox', 'http://localhost:1234/mock-login?token=petitionsclerk&path=/case-messages/section/outbox&info=case-messages-section-outbox', 'http://localhost:1234/mock-login?token=petitionsclerk&path=/case-messages/105-20/message-detail/eb0a139a-8951-4de1-8b83-f02a27504105&info=case-message-detail', + { + actions: [ + 'wait for #button-forward to be visible', + 'click element #button-forward', + ], + notes: 'checks the forward modal', + url: + 'http://localhost:1234/mock-login?token=petitionsclerk&path=/case-messages/105-20/message-detail/eb0a139a-8951-4de1-8b83-f02a27504105&info=message-detail-forward', + }, + { + actions: [ + 'wait for #button-reply to be visible', + 'click element #button-reply', + ], + notes: 'checks the reply modal', + url: + 'http://localhost:1234/mock-login?token=petitionsclerk&path=/case-messages/105-20/message-detail/eb0a139a-8951-4de1-8b83-f02a27504105&info=message-detail-reply', + }, + { + actions: [ + 'wait for #button-complete to be visible', + 'click element #button-reply', + ], + notes: 'checks the complete modal', + url: + 'http://localhost:1234/mock-login?token=petitionsclerk&path=/case-messages/105-20/message-detail/eb0a139a-8951-4de1-8b83-f02a27504105&info=message-detail-complete', + }, ]; diff --git a/web-client/src/views/Messages/MessageDetail.jsx b/web-client/src/views/Messages/MessageDetail.jsx index f98fc29aac5..74eb1052ddb 100644 --- a/web-client/src/views/Messages/MessageDetail.jsx +++ b/web-client/src/views/Messages/MessageDetail.jsx @@ -118,6 +118,7 @@ export const MessageDetail = connect( link className="action-button" icon="check-circle" + id="button-complete" onClick={() => openCompleteMessageModalSequence()} > Complete @@ -128,6 +129,7 @@ export const MessageDetail = connect( link className="action-button" icon="share-square" + id="button-forward" onClick={() => openForwardMessageModalSequence()} > Forward @@ -138,6 +140,7 @@ export const MessageDetail = connect( link className="action-button" icon="reply" + id="button-reply" onClick={() => openReplyToMessageModalSequence()} > Reply From e8cca594e3514ccac4e1e8c28e49c438bc472d08 Mon Sep 17 00:00:00 2001 From: Matt Hopson Date: Mon, 22 Jun 2020 14:24:16 -0600 Subject: [PATCH 2/4] Update swagger --- web-api/swagger.json | 265 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 265 insertions(+) diff --git a/web-api/swagger.json b/web-api/swagger.json index ddb632fd79f..fc5ceecd5bd 100644 --- a/web-api/swagger.json +++ b/web-api/swagger.json @@ -5802,6 +5802,231 @@ } } }, + "/messages/{parentMessageId}/complete": { + "post": { + "tags": ["messages"], + "summary": "complete a case message", + "description": "Complete a message.\n", + "produces": ["application/json"], + "responses": { + "200": { + "description": "200 response", + "schema": { + "$ref": "#/definitions/caseMessage" + } + } + }, + "security": [ + { + "CognitoUserPool": [] + } + ] + }, + "parameters": [ + { + "name": "parentMessageId", + "in": "path", + "required": true, + "type": "string" + }, + { + "in": "body", + "name": "message info", + "description": "the case message info", + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string" + } + } + } + } + ], + "options": { + "consumes": ["application/json"], + "produces": ["application/json"], + "responses": { + "200": { + "description": "200 response", + "headers": { + "Access-Control-Allow-Origin": { + "type": "string" + }, + "Access-Control-Allow-Methods": { + "type": "string" + }, + "Access-Control-Allow-Credentials": { + "type": "string" + }, + "Access-Control-Allow-Headers": { + "type": "string" + } + } + } + } + } + }, + "/messages/{parentMessageId}/reply": { + "post": { + "tags": ["messages"], + "summary": "reply to a case message", + "description": "Reply to a message.\n", + "produces": ["application/json"], + "responses": { + "200": { + "description": "200 response", + "schema": { + "$ref": "#/definitions/caseMessage" + } + } + }, + "security": [ + { + "CognitoUserPool": [] + } + ] + }, + "parameters": [ + { + "name": "parentMessageId", + "in": "path", + "required": true, + "type": "string" + }, + { + "in": "body", + "name": "message info", + "description": "the case message info", + "schema": { + "type": "object", + "properties": { + "attachments": { + "type": "array" + }, + "caseId": { + "type": "string" + }, + "message": { + "type": "string" + }, + "subject": { + "type": "string" + }, + "toSection": { + "type": "string" + }, + "toUserId": { + "type": "string" + } + } + } + } + ], + "options": { + "consumes": ["application/json"], + "produces": ["application/json"], + "responses": { + "200": { + "description": "200 response", + "headers": { + "Access-Control-Allow-Origin": { + "type": "string" + }, + "Access-Control-Allow-Methods": { + "type": "string" + }, + "Access-Control-Allow-Credentials": { + "type": "string" + }, + "Access-Control-Allow-Headers": { + "type": "string" + } + } + } + } + } + }, + "/messages/{parentMessageId}/forward": { + "post": { + "tags": ["messages"], + "summary": "forward a case message", + "description": "Forward a message.\n", + "produces": ["application/json"], + "responses": { + "200": { + "description": "200 response", + "schema": { + "$ref": "#/definitions/caseMessage" + } + } + }, + "security": [ + { + "CognitoUserPool": [] + } + ] + }, + "parameters": [ + { + "name": "parentMessageId", + "in": "path", + "required": true, + "type": "string" + }, + { + "in": "body", + "name": "message info", + "description": "the case message info", + "schema": { + "type": "object", + "properties": { + "attachments": { + "type": "array" + }, + "caseId": { + "type": "string" + }, + "message": { + "type": "string" + }, + "subject": { + "type": "string" + }, + "toSection": { + "type": "string" + }, + "toUserId": { + "type": "string" + } + } + } + } + ], + "options": { + "consumes": ["application/json"], + "produces": ["application/json"], + "responses": { + "200": { + "description": "200 response", + "headers": { + "Access-Control-Allow-Origin": { + "type": "string" + }, + "Access-Control-Allow-Methods": { + "type": "string" + }, + "Access-Control-Allow-Credentials": { + "type": "string" + }, + "Access-Control-Allow-Headers": { + "type": "string" + } + } + } + } + } + }, "/public-api/todays-opinions": { "get": { "tags": ["case-documents"], @@ -6214,6 +6439,10 @@ "caseMessage": { "type": "object", "properties": { + "attachments": { + "type": "array", + "description": "array of document metadata objects attached to the message" + }, "caseId": { "type": "string", "description": "id of the associated case" @@ -6222,6 +6451,30 @@ "type": "string", "description": "status of the associated case" }, + "caseTitle": { + "type": "string", + "description": "case title for the associated cases" + }, + "completedAt": { + "type": "string", + "description": "when the message was marked as completed" + }, + "completedBy": { + "type": "string", + "description": "the name of the user who completed the message thread" + }, + "completedBySection": { + "type": "string", + "description": "the section of the user who completed the message thread" + }, + "completedByUserId": { + "type": "string", + "description": "the ID of the user who completed the message thread" + }, + "completedMessage": { + "type": "string", + "description": "the message entered when completing the message thread" + }, "createdAt": { "type": "string", "description": "message created time" @@ -6250,6 +6503,14 @@ "type": "string", "description": "the ID of the user who sent the message" }, + "isCompleted": { + "type": "boolean", + "description": "whether the message thread has been completed" + }, + "isRepliedTo": { + "type": "boolean", + "description": "whether the message has been replied to or forwarded" + }, "message": { "type": "string", "description": "the message text" @@ -6258,6 +6519,10 @@ "type": "string", "description": "the unique ID generated by the system to represent the message" }, + "parentMessageId": { + "type": "string", + "description": "the unique ID generated by the system to represent the parent / initial message" + }, "subject": { "type": "string", "description": "the subject line of the message" From aff0331eb389f774d56bf7f1131afedb54230fec Mon Sep 17 00:00:00 2001 From: Matt Hopson Date: Mon, 22 Jun 2020 14:52:26 -0600 Subject: [PATCH 3/4] Update pa11y --- web-client/pa11y/pa11y-petitionsclerk.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/web-client/pa11y/pa11y-petitionsclerk.js b/web-client/pa11y/pa11y-petitionsclerk.js index 4e765417101..ace278555ef 100644 --- a/web-client/pa11y/pa11y-petitionsclerk.js +++ b/web-client/pa11y/pa11y-petitionsclerk.js @@ -490,6 +490,7 @@ module.exports = [ actions: [ 'wait for #button-forward to be visible', 'click element #button-forward', + 'wait for .modal-dialog to be visible', ], notes: 'checks the forward modal', url: @@ -499,6 +500,7 @@ module.exports = [ actions: [ 'wait for #button-reply to be visible', 'click element #button-reply', + 'wait for .modal-dialog to be visible', ], notes: 'checks the reply modal', url: @@ -508,6 +510,7 @@ module.exports = [ actions: [ 'wait for #button-complete to be visible', 'click element #button-reply', + 'wait for .modal-dialog to be visible', ], notes: 'checks the complete modal', url: From e6c53fd55ace4239d41f39f15be5ceea8d7251ab Mon Sep 17 00:00:00 2001 From: Matt Hopson Date: Mon, 22 Jun 2020 14:56:31 -0600 Subject: [PATCH 4/4] Add additional swagger docs --- web-api/swagger.json | 156 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 156 insertions(+) diff --git a/web-api/swagger.json b/web-api/swagger.json index fc5ceecd5bd..6ddab8194fa 100644 --- a/web-api/swagger.json +++ b/web-api/swagger.json @@ -5802,6 +5802,162 @@ } } }, + "/messages/completed/section/{sectionId}": { + "parameters": [ + { + "name": "sectionId", + "in": "path", + "required": true, + "type": "string" + } + ], + "get": { + "tags": ["messages"], + "summary": "gets the completed messages for the specific section", + "description": "Gets the completed messages for the specific user section.\n", + "produces": ["application/json"], + "responses": { + "200": { + "description": "200 response", + "schema": { + "$ref": "#/definitions/caseMessage" + } + } + }, + "security": [ + { + "CognitoUserPool": [] + } + ] + }, + "options": { + "consumes": ["application/json"], + "produces": ["application/json"], + "responses": { + "200": { + "description": "200 response", + "headers": { + "Access-Control-Allow-Origin": { + "type": "string" + }, + "Access-Control-Allow-Methods": { + "type": "string" + }, + "Access-Control-Allow-Credentials": { + "type": "string" + }, + "Access-Control-Allow-Headers": { + "type": "string" + } + } + } + } + } + }, + "/messages/completed/{userId}": { + "parameters": [ + { + "name": "userId", + "in": "path", + "required": true, + "type": "string" + } + ], + "get": { + "tags": ["messages"], + "summary": "gets the completed messages for the specific user", + "description": "Gets the completed messages for the specific user.\n", + "produces": ["application/json"], + "responses": { + "200": { + "description": "200 response", + "schema": { + "$ref": "#/definitions/caseMessage" + } + } + }, + "security": [ + { + "CognitoUserPool": [] + } + ] + }, + "options": { + "consumes": ["application/json"], + "produces": ["application/json"], + "responses": { + "200": { + "description": "200 response", + "headers": { + "Access-Control-Allow-Origin": { + "type": "string" + }, + "Access-Control-Allow-Methods": { + "type": "string" + }, + "Access-Control-Allow-Credentials": { + "type": "string" + }, + "Access-Control-Allow-Headers": { + "type": "string" + } + } + } + } + } + }, + "/messages/case/{caseId}": { + "parameters": [ + { + "name": "caseId", + "in": "path", + "required": true, + "type": "string" + } + ], + "get": { + "tags": ["messages"], + "summary": "gets the messages for the specific case", + "description": "Gets the messages for the specific case.\n", + "produces": ["application/json"], + "responses": { + "200": { + "description": "200 response", + "schema": { + "$ref": "#/definitions/caseMessage" + } + } + }, + "security": [ + { + "CognitoUserPool": [] + } + ] + }, + "options": { + "consumes": ["application/json"], + "produces": ["application/json"], + "responses": { + "200": { + "description": "200 response", + "headers": { + "Access-Control-Allow-Origin": { + "type": "string" + }, + "Access-Control-Allow-Methods": { + "type": "string" + }, + "Access-Control-Allow-Credentials": { + "type": "string" + }, + "Access-Control-Allow-Headers": { + "type": "string" + } + } + } + } + } + }, "/messages/{parentMessageId}/complete": { "post": { "tags": ["messages"],