From a10166804d3022477aed9d71b75036718f89cea5 Mon Sep 17 00:00:00 2001 From: jostorey Date: Fri, 17 Nov 2023 14:53:27 -0800 Subject: [PATCH] Additional code QA feedback addressed. --- backend/src/components/message.js | 14 +++--- frontend/src/assets/css/main.css | 5 ++ .../messages/AssistanceRequestTable.vue | 9 ++-- .../src/components/messages/MessagesTab.vue | 2 +- .../messages/ReplyRequestDialog.vue | 8 +-- .../messages/RequestConversations.vue | 50 +++++++++---------- 6 files changed, 46 insertions(+), 42 deletions(-) diff --git a/backend/src/components/message.js b/backend/src/components/message.js index 94f72c59..b1b2aa46 100644 --- a/backend/src/components/message.js +++ b/backend/src/components/message.js @@ -61,7 +61,7 @@ function mapAssistanceRequestObjectForBack(data) { async function createAssistanceRequest(req, res) { try { - let payload = mapAssistanceRequestObjectForBack(req.body) + const payload = mapAssistanceRequestObjectForBack(req.body) let response = await postOperation('ofm_assistance_requests?$select=ofm_name,ofm_assistance_requestid', payload) response = new MappableObjectForFront(response, AssistanceRequestMappings).toJSON() return res.status(HttpStatus.OK).json(response) @@ -87,9 +87,9 @@ async function getAssistanceRequests(req, res) { try { log.debug('getAssistanceRequests: ', req.params.contactId) let assistanceRequests = [] - let operation = `ofm_assistance_requests?$select=modifiedon,ofm_assistance_requestid,ofm_last_opened_time,ofm_name,_ofm_request_category_value,ofm_subject,statecode,statuscode,ofm_is_read&$expand=ofm_facility_request_request($select=_ofm_facility_value),ofm_conversation_request($select=modifiedon)&$filter=(_ofm_contact_value eq ${req.params.contactId}) and (ofm_facility_request_request/any(o1:(o1/ofm_facility_requestid ne null))) and (ofm_conversation_request/any(o2:(o2/ofm_conversationid ne null)))` + const operation = `ofm_assistance_requests?$select=modifiedon,ofm_assistance_requestid,ofm_last_opened_time,ofm_name,_ofm_request_category_value,ofm_subject,statecode,statuscode,ofm_is_read&$expand=ofm_facility_request_request($select=_ofm_facility_value),ofm_conversation_request($select=modifiedon)&$filter=(_ofm_contact_value eq ${req.params.contactId}) and (ofm_facility_request_request/any(o1:(o1/ofm_facility_requestid ne null))) and (ofm_conversation_request/any(o2:(o2/ofm_conversationid ne null)))` log.debug('operation: ', operation) - let response = await getOperation(operation) + const response = await getOperation(operation) response?.value?.forEach((item) => assistanceRequests.push(mapAssistanceRequestObjectForFront(item))) return res.status(HttpStatus.OK).json(assistanceRequests) } catch (e) { @@ -110,8 +110,8 @@ async function getAssistanceRequest(req, res) { async function updateAssistanceRequest(req, res) { try { - let payload = new MappableObjectForBack(req.body, AssistanceRequestMappings).toJSON() - let response = await patchOperationWithObjectId('ofm_assistance_requests', req.params.assistanceRequestId, payload) + const payload = new MappableObjectForBack(req.body, AssistanceRequestMappings).toJSON() + const response = await patchOperationWithObjectId('ofm_assistance_requests', req.params.assistanceRequestId, payload) return res.status(HttpStatus.OK).json(response) } catch (e) { return res.status(HttpStatus.INTERNAL_SERVER_ERROR).json(e.data ? e.data : e?.status) @@ -120,9 +120,9 @@ async function updateAssistanceRequest(req, res) { async function getAssistanceRequestConversation(req, res) { try { - let operation = `ofm_conversations?$select=ofm_conversationid,ofm_name,createdon,ofm_message,ofm_source_system,_ofm_request_value,_ownerid_value,statecode,statuscode&$expand=createdby($select=firstname,lastname)&$filter=(_ofm_request_value eq ${req.params.assistanceRequestId})&$orderby=createdon desc` + const operation = `ofm_conversations?$select=ofm_conversationid,ofm_name,createdon,ofm_message,ofm_source_system,_ofm_request_value,_ownerid_value,statecode,statuscode&$expand=createdby($select=firstname,lastname)&$filter=(_ofm_request_value eq ${req.params.assistanceRequestId})&$orderby=createdon desc` log.debug('operation: ', operation) - let response = await getOperation(operation) + const response = await getOperation(operation) const messages = [] for (const item of response.value) { diff --git a/frontend/src/assets/css/main.css b/frontend/src/assets/css/main.css index a5adca3f..cfa6bf01 100644 --- a/frontend/src/assets/css/main.css +++ b/frontend/src/assets/css/main.css @@ -161,3 +161,8 @@ input[type='number'] { .theme--light.v-btn.v-btn--disabled:not(.v-btn--text):not(.v-btn--outlined) { background-color: rgba(0, 0, 0, 0.12) !important; } + +:global(.tooltip) { + background-color: #003466 !important; + color: #ffffff !important; +} diff --git a/frontend/src/components/messages/AssistanceRequestTable.vue b/frontend/src/components/messages/AssistanceRequestTable.vue index 5a4bbf8a..fb57c2ce 100644 --- a/frontend/src/components/messages/AssistanceRequestTable.vue +++ b/frontend/src/components/messages/AssistanceRequestTable.vue @@ -30,7 +30,7 @@ @@ -39,10 +39,11 @@ diff --git a/frontend/src/components/messages/MessagesTab.vue b/frontend/src/components/messages/MessagesTab.vue index e1a1ca8d..be842731 100644 --- a/frontend/src/components/messages/MessagesTab.vue +++ b/frontend/src/components/messages/MessagesTab.vue @@ -44,7 +44,7 @@ import { useAuthStore } from '@/stores/auth' import { useMessagesStore } from '@/stores/messages' import NewRequestDialog from '@/components/messages/NewRequestDialog.vue' import AssistanceRequestTable from '@/components/messages/AssistanceRequestTable.vue' -import RequestConversations from './RequestConversations.vue' +import RequestConversations from '@/components/messages/RequestConversations.vue' export default { name: 'MessagesTab', components: { NewRequestDialog, AssistanceRequestTable, RequestConversations }, diff --git a/frontend/src/components/messages/ReplyRequestDialog.vue b/frontend/src/components/messages/ReplyRequestDialog.vue index a97b69d6..42cc8e3b 100644 --- a/frontend/src/components/messages/ReplyRequestDialog.vue +++ b/frontend/src/components/messages/ReplyRequestDialog.vue @@ -37,8 +37,8 @@