From c1fc07d9d5a1b7f5a09d9c69661ce97fa74f1f10 Mon Sep 17 00:00:00 2001 From: Cameron Bowler Date: Fri, 18 Oct 2024 06:49:30 -0700 Subject: [PATCH 1/2] Drs Mhr Table Integration --- ppr-ui/.env.example | 8 ++- ppr-ui/package-lock.json | 4 +- ppr-ui/package.json | 2 +- .../common/RegistrationsWrapper.vue | 26 ++++++-- .../components/tables/RegistrationTable.vue | 26 ++++++-- .../src/components/tables/common/TableRow.vue | 63 ++++++++++++++++++- ppr-ui/src/composables/useRegistration.ts | 2 + .../registration-sort-interface.ts | 3 +- ppr-ui/src/resources/tableHeaders.ts | 7 +++ ppr-ui/src/store/store.ts | 6 ++ ppr-ui/src/utils/config-helper.ts | 8 +++ ppr-ui/src/utils/feature-flags.ts | 1 + ppr-ui/src/utils/mhr-api-helper.ts | 3 +- .../tests/unit/RegistrationsWrapper.spec.ts | 6 +- 14 files changed, 146 insertions(+), 19 deletions(-) diff --git a/ppr-ui/.env.example b/ppr-ui/.env.example index a49b819ba..7cc32449e 100644 --- a/ppr-ui/.env.example +++ b/ppr-ui/.env.example @@ -12,6 +12,7 @@ VUE_APP_BCOL_STAFF_PARTY_CODE="99980001" #vaults web-url VUE_APP_REGISTRY_URL="https://dev.bcregistry.gov.bc.ca/dashboard" VUE_APP_AUTH_WEB_URL="https://dev.account.bcregistry.gov.bc.ca/" +VUE_APP_DOCUMENTS_UI_URL="https://documents-ui-dev.firebaseapp.com" VUE_APP_SITEMINDER_LOGOUT_URL="https://logontest7.gov.bc.ca/clp-cgi/logoff.cgi" #vaults API @@ -21,12 +22,15 @@ VUE_APP_PPR_API_KEY= VUE_APP_MHR_API_URL="https://bcregistry-dev.apigee.net/mhr" VUE_APP_MHR_API_VERSION="/api/v1" VUE_APP_MHR_API_KEY= +VUE_APP_DOC_API_URL="https://bcregistry-dev.apigee.net/doc" +VUE_APP_DOC_API_VERSION="/api/v1" +VUE_APP_DOC_API_KEY="" VUE_APP_LTSA_API_URL="https://bcregistry-dev.apigee.net/ltsa" VUE_APP_LTSA_API_VERSION="/api/v1" VUE_APP_LTSA_API_KEY= -VUE_APP_AUTH_API_URL="https://auth-api-dev.apps.silver.devops.gov.bc.ca" +VUE_APP_AUTH_API_URL="https://auth-api-dev-142173140222.northamerica-northeast1.run.app" VUE_APP_AUTH_API_VERSION="/api/v1" -VUE_APP_STATUS_API_URL="https://status-api-dev.apps.silver.devops.gov.bc.ca" +VUE_APP_STATUS_API_URL="https://status-api-dev.apps.gold.devops.gov.bc.ca/api/v1" VUE_APP_STATUS_API_VERSION="/api/v1" VUE_APP_PAY_API_URL="https://pay-api-dev.apps.silver.devops.gov.bc.ca" VUE_APP_PAY_API_VERSION="/api/v1" diff --git a/ppr-ui/package-lock.json b/ppr-ui/package-lock.json index 36ef319a1..fef2f509b 100644 --- a/ppr-ui/package-lock.json +++ b/ppr-ui/package-lock.json @@ -1,12 +1,12 @@ { "name": "ppr-ui", - "version": "3.2.65a", + "version": "3.2.66", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "ppr-ui", - "version": "3.2.65a", + "version": "3.2.66", "dependencies": { "@bcrs-shared-components/input-field-date-picker": "^1.0.0", "@lemoncode/fonk": "^1.5.1", diff --git a/ppr-ui/package.json b/ppr-ui/package.json index 73eece4ac..dc9fbb5cf 100644 --- a/ppr-ui/package.json +++ b/ppr-ui/package.json @@ -1,6 +1,6 @@ { "name": "ppr-ui", - "version": "3.2.65a", + "version": "3.2.66", "private": true, "appName": "Assets UI", "sbcName": "SBC Common Components", diff --git a/ppr-ui/src/components/common/RegistrationsWrapper.vue b/ppr-ui/src/components/common/RegistrationsWrapper.vue index 56dfe1663..be1a32a91 100644 --- a/ppr-ui/src/components/common/RegistrationsWrapper.vue +++ b/ppr-ui/src/components/common/RegistrationsWrapper.vue @@ -357,7 +357,7 @@ export default defineComponent({ getRegTableBaseRegs, getRegTableDraftsBaseReg, isMhrRegistration, isMhrManufacturerRegistration, getRegTableTotalRowCount, getStateModel, getRegTableDraftsChildReg, hasMorePages, getRegTableNewItem, getRegTableSortOptions, getRegTableSortPage, getUserSettings, getMhRegTableBaseRegs, isRoleStaffReg, - isRoleQualifiedSupplier, getRegTableMhSortOptions + isRoleQualifiedSupplier, getRegTableMhSortOptions, hasDrsEnabled } = storeToRefs(useStore()) const { @@ -399,11 +399,24 @@ export default defineComponent({ myRegActionDialog: dischargeConfirmationDialog as DialogOptionsIF, myRegDataLoading: false, myRegDataAdding: false, - myRegHeaders: props.isPpr ? [...registrationTableHeaders] : [...mhRegistrationTableHeaders], - myRegHeadersSelected: props.isPpr ? [...registrationTableHeaders] : [...mhRegistrationTableHeaders], + myRegHeaders: props.isPpr + ? [...registrationTableHeaders] + : [...hasDrsEnabled.value + ? mhRegistrationTableHeaders + : mhRegistrationTableHeaders.filter(item => item.value !== 'documentId') + ], + myRegHeadersSelected: props.isPpr + ? [...registrationTableHeaders] + : [...hasDrsEnabled.value + ? mhRegistrationTableHeaders + : mhRegistrationTableHeaders.filter(item => item.value !== 'documentId') + ], myRegHeadersSelectable: props.isPpr ? [...registrationTableHeaders].slice(0, -1) // remove actions - : [...mhRegistrationTableHeaders].slice(0, -1), // remove actions + : [...hasDrsEnabled.value + ? mhRegistrationTableHeaders + : mhRegistrationTableHeaders.filter(item => item.value !== 'documentId') + ].slice(0, -1), // remove actions myRegistrations: computed(() => { if (props.isPpr && !!getRegTableDraftsBaseReg.value && !!getRegTableBaseRegs.value) { return [...getRegTableDraftsBaseReg.value, ...getRegTableBaseRegs.value] @@ -478,7 +491,10 @@ export default defineComponent({ localState.myRegHeadersSelected = getUserSettings.value[SettingOptions.REGISTRATION_TABLE]?.mhrColumns?.length >= 1 ? getUserSettings.value[SettingOptions.REGISTRATION_TABLE]?.mhrColumns - : [...mhRegistrationTableHeaders] // Default to all selections for initialization + : [...hasDrsEnabled.value + ? mhRegistrationTableHeaders + : mhRegistrationTableHeaders.filter(item => item.value !== 'documentId') + ] // Default to all selections for initialization } else { // set default headers const headers = [] diff --git a/ppr-ui/src/components/tables/RegistrationTable.vue b/ppr-ui/src/components/tables/RegistrationTable.vue index 2abe682cd..13919f286 100644 --- a/ppr-ui/src/components/tables/RegistrationTable.vue +++ b/ppr-ui/src/components/tables/RegistrationTable.vue @@ -194,6 +194,18 @@ aria-hidden="true" @click="showDatePicker = true" /> +