From 97089eb1b0e0bdb9e49bee3b1358cee490ce32e6 Mon Sep 17 00:00:00 2001 From: CameronEYDS <53542131+cameron-eyds@users.noreply.github.com> Date: Tue, 28 Nov 2023 08:54:40 -0800 Subject: [PATCH] Vue Fold in Prep: Linting Fixes (#1633) * ongoing Linting * Lint Fixes * no gutters update * MakeModel Test Fix --- ppr-ui/.eslintrc.js | 7 +- .../src/components/collateral/Collateral.vue | 20 +-- .../generalCollateral/GenColAmend.vue | 3 + .../generalCollateral/GenColEdit.vue | 4 +- .../generalCollateral/GenColSummary.vue | 8 +- .../generalCollateral/GeneralCollateral.vue | 2 +- .../vehicleCollateral/VehicleCollateral.vue | 9 +- .../factories/collateralFormValidator.ts | 2 +- .../vehicleCollateral/factories/useVehicle.ts | 2 +- ppr-ui/src/components/common/AccountInfo.vue | 3 +- ppr-ui/src/components/common/ButtonFooter.vue | 2 +- ppr-ui/src/components/common/CautionBox.vue | 5 +- .../components/common/CertifyInformation.vue | 2 +- ppr-ui/src/components/common/CourtOrder.vue | 2 +- .../common/DischargeConfirmSummary.vue | 16 ++- ppr-ui/src/components/common/DocumentId.vue | 3 +- ppr-ui/src/components/common/FolioNumber.vue | 8 +- .../common/FolioOrReferenceNumber.vue | 2 +- ppr-ui/src/components/common/FormField.vue | 2 +- .../components/common/HomeLocationInfo.vue | 5 +- ppr-ui/src/components/common/LienAlert.vue | 5 +- .../src/components/common/OrgNameLookup.vue | 4 +- ppr-ui/src/components/common/PidNumber.vue | 4 +- .../common/RegistrationsWrapper.vue | 11 +- ppr-ui/src/components/common/Remarks.vue | 2 - ppr-ui/src/components/common/ReviewCard.vue | 2 +- .../components/common/SimpleHelpToggle.vue | 13 +- .../src/components/common/StickyContainer.vue | 4 +- .../components/common/SubProductSelector.vue | 4 +- .../components/dashboard/DashboardTabs.vue | 1 + .../components/dialogs/ConfirmationDialog.vue | 42 +++--- .../dialogs/LargeSearchDelayDialog.vue | 28 ++-- .../dialogs/LargeSearchResultDialog.vue | 38 +++--- .../dialogs/RegistrationConfirmation.vue | 2 +- .../components/dialogs/SecuredPartyDialog.vue | 13 +- .../dialogs/common/DialogContent.vue | 1 - .../HomeLocation/HomeCivicAddress.vue | 8 +- .../HomeLocation/HomeLocationDescription.vue | 4 +- .../HomeLocation/HomeLocationType.vue | 4 +- .../HomeOwners/AddEditHomeOwner.vue | 5 +- .../HomeOwners/HomeOwnerGroups.vue | 24 +++- .../HomeOwners/HomeOwnerRoles.vue | 4 +- .../HomeOwners/HomeOwnersTable.vue | 16 ++- .../HomeOwners/TableGroupHeader.vue | 39 ++++-- .../ReviewConfirm/HomeOwnersReview.vue | 4 +- .../ReviewConfirm/YourHomeReview.vue | 26 ++-- .../YourHome/AddEditHomeSections.vue | 23 ++-- .../YourHome/HomeCertification.vue | 10 +- .../mhrRegistration/YourHome/HomeSections.vue | 10 +- .../YourHome/ManufacturedYearInput.vue | 2 +- .../YourHome/ManufacturedYearSelect.vue | 35 +++-- .../YourHome/ManufacturerMakeModel.vue | 8 +- .../mhrTransfers/ConfirmCompletion.vue | 6 +- .../mhrTransfers/DeathCertificate.vue | 6 +- .../mhrTransfers/SupportingDocuments.vue | 2 +- .../mhrTransfers/TransferDetails.vue | 14 +- .../components/mhrTransfers/TransferType.vue | 4 +- ppr-ui/src/components/parties/Parties.vue | 4 +- .../src/components/parties/PartySummary.vue | 2 +- .../src/components/parties/debtor/Debtors.vue | 5 +- .../components/parties/debtor/EditDebtor.vue | 2 +- .../components/parties/party/EditParty.vue | 4 +- .../parties/party/PartyAutocomplete.vue | 4 +- .../components/parties/party/PartySearch.vue | 4 +- .../parties/party/RegisteringParty.vue | 5 +- .../parties/party/RegisteringPartyChange.vue | 3 +- .../parties/party/SecuredParties.vue | 50 +------- .../parties/summaries/BasePartySummary.vue | 2 +- .../parties/summaries/DebtorSummary.vue | 4 +- .../summaries/RegisteringPartySummary.vue | 4 +- .../parties/summaries/SecuredPartySummary.vue | 2 +- .../registration/AmendmentDescription.vue | 4 +- .../registration/RegistrationBar.vue | 8 +- .../RegistrationBarTypeAheadList.vue | 4 +- .../length-trust/EditTrustIndenture.vue | 4 +- .../length-trust/RegistrationLengthTrust.vue | 5 +- .../RegistrationLengthTrustAmendment.vue | 7 +- .../RegistrationLengthTrustSummary.vue | 2 +- .../RegistrationRepairersLien.vue | 6 +- .../search/BusinessSearchAutocomplete.vue | 7 +- ppr-ui/src/components/search/SearchBar.vue | 34 ++--- .../src/components/search/SearchBarList.vue | 7 +- .../components/tables/RegistrationTable.vue | 6 +- .../src/components/tables/SearchHistory.vue | 3 +- .../tables/common/TableObserver.vue | 9 +- .../src/components/tables/common/TableRow.vue | 5 +- .../tables/mhr/HomeSectionsTable.vue | 15 ++- .../components/tables/mhr/SearchedResults.vue | 17 ++- .../components/tables/ppr/SearchedResults.vue | 21 ++- .../components/unitNotes/EffectiveDate.vue | 2 +- .../src/components/unitNotes/ExpiryDate.vue | 2 +- .../src/composables/address/BaseAddress.vue | 2 +- .../factories/vuelidate-validation-factory.ts | 5 +- ppr-ui/src/composables/fees/FeeSummary.vue | 4 +- .../mhrRegistration/useNewMhrRegistration.ts | 2 +- ppr-ui/src/composables/parties/useDebtor.ts | 2 +- .../composables/parties/useSecuredParty.ts | 2 +- .../pprRegistration/usePprRegistration.ts | 2 +- ppr-ui/src/composables/useInputRules.ts | 22 ++-- ppr-ui/src/composables/useParty.ts | 2 +- ppr-ui/src/composables/useRegistration.ts | 2 +- .../registration-interfaces.ts | 2 +- .../search-type-interface.ts | 1 - ppr-ui/src/router/router.ts | 5 +- ppr-ui/src/store/state/state-model.ts | 2 +- ppr-ui/src/utils/auth-helper.ts | 3 +- ppr-ui/src/utils/mhr-api-helper.ts | 5 +- ppr-ui/src/utils/ppr-api-helper.ts | 4 +- ppr-ui/src/utils/registration-helper.ts | 3 - ppr-ui/src/utils/utilities.ts | 2 +- ppr-ui/src/utils/validation-helper.ts | 6 +- .../validators/serial-number.validator.ts | 1 - ppr-ui/src/views/Dashboard.vue | 16 +-- ppr-ui/src/views/Search.vue | 4 +- .../src/views/amendment/ConfirmAmendment.vue | 7 +- ppr-ui/src/views/auth/Login.vue | 3 +- .../views/mhrInformation/MhrInformation.vue | 8 +- .../src/views/mhrInformation/MhrUnitNote.vue | 1 + .../src/views/mhrSearch/ConfirmMHRSearch.vue | 4 +- .../views/newMhrRegistration/HomeOwners.vue | 4 +- .../newMhrRegistration/MhrRegistration.vue | 3 +- .../newMhrRegistration/MhrReviewConfirm.vue | 4 +- .../views/newRegistration/AddCollateral.vue | 4 +- .../src/views/newRegistration/AddParties.vue | 2 +- .../src/views/newRegistration/LengthTrust.vue | 4 +- .../views/newRegistration/ReviewConfirm.vue | 4 +- ppr-ui/src/views/renew/RenewRegistration.vue | 7 - ppr-ui/tests/unit/Dashboard.spec.ts | 4 +- .../tests/unit/ManufacturerMakeModel.spec.ts | 120 +++++++++--------- ppr-ui/tests/unit/RegistrationBar.spec.ts | 2 +- .../tests/unit/RegistrationsWrapper.spec.ts | 2 +- ppr-ui/tests/unit/SearchBar.spec.ts | 4 +- ppr-ui/tests/unit/SearchValidation.spec.ts | 4 +- ppr-ui/tests/unit/TableRow.spec.ts | 11 ++ 134 files changed, 567 insertions(+), 532 deletions(-) diff --git a/ppr-ui/.eslintrc.js b/ppr-ui/.eslintrc.js index eaa05ba6e..9d33799b3 100644 --- a/ppr-ui/.eslintrc.js +++ b/ppr-ui/.eslintrc.js @@ -12,6 +12,8 @@ module.exports = { ], rules: { '@typescript-eslint/no-explicit-any': 'off', + '@typescript-eslint/ban-ts-comment': 'off', + '@typescript-eslint/no-duplicate-enum-values': 'off', 'object-curly-spacing': ['error', 'always'], 'standard/computed-property-even-spacing': 'off', 'vue/multi-word-component-names': 'off', @@ -23,11 +25,12 @@ module.exports = { 'vue/require-explicit-emits': 'error', 'vue/require-default-prop': 'error', 'vue/require-prop-types': 'error', - 'vue/no-template-shadow': 'error', + 'vue/no-template-shadow': 'off', 'vue/attribute-hyphenation': 'off', 'vue/v-on-event-hyphenation': 'off', 'vue/prop-name-casing': ['error', 'camelCase'], - 'vue/custom-event-name-casing': ['error', 'camelCase'] + 'vue/custom-event-name-casing': ['error', 'camelCase'], + 'vue/no-v-html': 'off' }, parser: 'vue-eslint-parser', parserOptions: { diff --git a/ppr-ui/src/components/collateral/Collateral.vue b/ppr-ui/src/components/collateral/Collateral.vue index 7a4151906..904d7f487 100644 --- a/ppr-ui/src/components/collateral/Collateral.vue +++ b/ppr-ui/src/components/collateral/Collateral.vue @@ -3,7 +3,7 @@ v-if="summaryView || registrationFlowType == RegistrationFlowType.AMENDMENT" id="collateral-component" fluid - class="bg-white pa-0 rounded-bottom no-gutters" + class="bg-white pa-0 rounded-bottom noGutters" :class="!valid && registrationFlowType !== RegistrationFlowType.AMENDMENT ? '' : 'pb-10'" > @@ -121,16 +121,12 @@ import { } from 'vue' import { useStore } from '@/store/store' import { useRouter } from 'vue-router' - -// local components import { GeneralCollateral } from './generalCollateral' import { VehicleCollateral } from './vehicleCollateral' -// local types/resources/etc. -import { ActionTypes, APIRegistrationTypes, RegistrationFlowType } from '@/enums' // eslint-disable-line no-unused-vars +import { ActionTypes, APIRegistrationTypes, RegistrationFlowType } from '@/enums' import { - AddCollateralIF, // eslint-disable-line no-unused-vars - GeneralCollateralIF, // eslint-disable-line no-unused-vars - VehicleCollateralIF // eslint-disable-line no-unused-vars + AddCollateralIF, + GeneralCollateralIF, } from '@/interfaces' import { useGeneralCollateral } from './generalCollateral/factories' import { useVehicle } from './vehicleCollateral/factories' @@ -152,6 +148,10 @@ export default defineComponent({ default: false } }, + emits: [ + 'setCollateralValid', + 'collateralOpen' + ], setup (props, context) { const router = useRouter() const { @@ -291,7 +291,7 @@ export default defineComponent({ localState.summaryView = val }) - watch(() => localState.collateral.vehicleCollateral, (val: VehicleCollateralIF[]) => { + watch(() => localState.collateral.vehicleCollateral, () => { if ((vehiclesValid() || localState.collateral?.generalCollateral?.length > 0 || registrationType === APIRegistrationTypes.TRANSITION_TAX_LIEN) && // vehicle collateral is optional for Income Tax registration type diff --git a/ppr-ui/src/components/collateral/generalCollateral/GenColAmend.vue b/ppr-ui/src/components/collateral/generalCollateral/GenColAmend.vue index 02e93bc4b..7755f497a 100644 --- a/ppr-ui/src/components/collateral/generalCollateral/GenColAmend.vue +++ b/ppr-ui/src/components/collateral/generalCollateral/GenColAmend.vue @@ -121,6 +121,9 @@ export default defineComponent({ default: false } }, + emits: [ + 'closeGenColAmend' + ], setup (props, { emit }) { const { setGeneralCollateral } = useStore() const { getGeneralCollateral, isTiptapEnabled } = storeToRefs(useStore()) diff --git a/ppr-ui/src/components/collateral/generalCollateral/GenColEdit.vue b/ppr-ui/src/components/collateral/generalCollateral/GenColEdit.vue index 536eb0a17..ba6e5e0f7 100644 --- a/ppr-ui/src/components/collateral/generalCollateral/GenColEdit.vue +++ b/ppr-ui/src/components/collateral/generalCollateral/GenColEdit.vue @@ -49,8 +49,8 @@ import { } from 'vue' import { useStore } from '@/store/store' // local -import { APIRegistrationTypes, RegistrationFlowType } from '@/enums' // eslint-disable-line no-unused-vars -import { GeneralCollateralIF } from '@/interfaces' // eslint-disable-line no-unused-vars +import { APIRegistrationTypes, RegistrationFlowType } from '@/enums' +import { GeneralCollateralIF } from '@/interfaces' import { storeToRefs } from 'pinia' import { WysiwygEditor } from '@/components/common' diff --git a/ppr-ui/src/components/collateral/generalCollateral/GenColSummary.vue b/ppr-ui/src/components/collateral/generalCollateral/GenColSummary.vue index 174677f54..dd7619237 100644 --- a/ppr-ui/src/components/collateral/generalCollateral/GenColSummary.vue +++ b/ppr-ui/src/components/collateral/generalCollateral/GenColSummary.vue @@ -258,9 +258,8 @@ import { computed } from 'vue' import { useStore } from '@/store/store' -// local -import { RegistrationFlowType } from '@/enums' // eslint-disable-line no-unused-vars -import { GeneralCollateralIF } from '@/interfaces' // eslint-disable-line no-unused-vars +import { RegistrationFlowType } from '@/enums' +import { GeneralCollateralIF } from '@/interfaces' import { pacificDate } from '@/utils' import { cloneDeep } from 'lodash' import { storeToRefs } from 'pinia' @@ -285,6 +284,9 @@ export default defineComponent({ default: false } }, + emits: [ + 'initGenColAmend' + ], setup (props, { emit }) { const { setGeneralCollateral } = useStore() const { getGeneralCollateral, getOriginalAddCollateral, getRegistrationFlowType } = storeToRefs(useStore()) diff --git a/ppr-ui/src/components/collateral/generalCollateral/GeneralCollateral.vue b/ppr-ui/src/components/collateral/generalCollateral/GeneralCollateral.vue index c507c712a..e63cfb61c 100644 --- a/ppr-ui/src/components/collateral/generalCollateral/GeneralCollateral.vue +++ b/ppr-ui/src/components/collateral/generalCollateral/GeneralCollateral.vue @@ -37,7 +37,7 @@ import { // local components import { GenColEdit, GenColSummary, GenColAmend } from '.' // local types/helpers/etc. -import { APIRegistrationTypes, RegistrationFlowType } from '@/enums' // eslint-disable-line no-unused-vars +import { APIRegistrationTypes, RegistrationFlowType } from '@/enums' import { useStore } from '@/store/store' import { storeToRefs } from 'pinia' diff --git a/ppr-ui/src/components/collateral/vehicleCollateral/VehicleCollateral.vue b/ppr-ui/src/components/collateral/vehicleCollateral/VehicleCollateral.vue index eab217bb9..b0554eee3 100644 --- a/ppr-ui/src/components/collateral/vehicleCollateral/VehicleCollateral.vue +++ b/ppr-ui/src/components/collateral/vehicleCollateral/VehicleCollateral.vue @@ -102,7 +102,7 @@ @@ -415,11 +415,9 @@ import { toRefs } from 'vue' import { useStore } from '@/store/store' -// local components import { EditCollateral } from '.' -// local types/etc. import { ActionTypes, APIVehicleTypes, RegistrationFlowType, APIRegistrationTypes } from '@/enums' -import { VehicleCollateralIF } from '@/interfaces' // eslint-disable-line no-unused-vars +import { VehicleCollateralIF } from '@/interfaces' import { vehicleTableHeaders, VehicleTypes } from '@/resources' import { useVehicle } from './factories/useVehicle' import { cloneDeep } from 'lodash' @@ -443,6 +441,9 @@ export default defineComponent({ default: false } }, + emits: [ + 'collateralOpen' + ], setup (props, context) { const { setVehicleCollateral } = useStore() const { diff --git a/ppr-ui/src/components/collateral/vehicleCollateral/factories/collateralFormValidator.ts b/ppr-ui/src/components/collateral/vehicleCollateral/factories/collateralFormValidator.ts index 344186588..a821bb6ff 100644 --- a/ppr-ui/src/components/collateral/vehicleCollateral/factories/collateralFormValidator.ts +++ b/ppr-ui/src/components/collateral/vehicleCollateral/factories/collateralFormValidator.ts @@ -68,5 +68,5 @@ const validationSchema = { ] } } -// @ts-ignore - there is a type mismatch in the structure above, but it still works +// @ts-ignore export const formValidation = createFormValidation(validationSchema) diff --git a/ppr-ui/src/components/collateral/vehicleCollateral/factories/useVehicle.ts b/ppr-ui/src/components/collateral/vehicleCollateral/factories/useVehicle.ts index 96e56adb6..072965b65 100644 --- a/ppr-ui/src/components/collateral/vehicleCollateral/factories/useVehicle.ts +++ b/ppr-ui/src/components/collateral/vehicleCollateral/factories/useVehicle.ts @@ -1,6 +1,6 @@ import { reactive, toRefs, computed } from 'vue' import { VehicleTypes, VehicleTypesNoMH } from '@/resources' -import { VehicleCollateralIF } from '@/interfaces' // eslint-disable-line no-unused-vars +import { VehicleCollateralIF } from '@/interfaces' import { useStore } from '@/store/store' import { ActionTypes, APIRegistrationTypes, RegistrationFlowType } from '@/enums' import { cloneDeep, isEqual } from 'lodash' diff --git a/ppr-ui/src/components/common/AccountInfo.vue b/ppr-ui/src/components/common/AccountInfo.vue index 61fcb3540..ee8d0adb9 100644 --- a/ppr-ui/src/components/common/AccountInfo.vue +++ b/ppr-ui/src/components/common/AccountInfo.vue @@ -5,7 +5,6 @@ props.forceSave, (val: boolean) => { + watch(() => props.forceSave, () => { // on change (T/F doesn't matter), save and go back to dash submitSaveResume() }) diff --git a/ppr-ui/src/components/common/CautionBox.vue b/ppr-ui/src/components/common/CautionBox.vue index de824010f..81d0fa560 100644 --- a/ppr-ui/src/components/common/CautionBox.vue +++ b/ppr-ui/src/components/common/CautionBox.vue @@ -15,7 +15,10 @@ import { defineComponent } from 'vue' export default defineComponent({ name: 'CautionBox', props: { - setMsg: String, + setMsg: { + type: String, + default: '' + }, setImportantWord: { type: String, default: 'Important' diff --git a/ppr-ui/src/components/common/CertifyInformation.vue b/ppr-ui/src/components/common/CertifyInformation.vue index 54cf454ce..5a9a3bdbd 100644 --- a/ppr-ui/src/components/common/CertifyInformation.vue +++ b/ppr-ui/src/components/common/CertifyInformation.vue @@ -156,7 +156,7 @@ import { useStore } from '@/store/store' import { convertDate, getRegisteringPartyFromAuth } from '@/utils' import { BaseAddress } from '@/composables/address' import { DefaultSchema } from '@/composables/address/resources' -import { CertifyIF, ContentIF, PartyIF } from '@/interfaces' // eslint-disable-line no-unused-vars +import { CertifyIF, ContentIF, PartyIF } from '@/interfaces' import { SessionStorageKeys } from 'sbc-common-components/src/util/constants' import { storeToRefs } from 'pinia' import { authorizedTableHeaders } from '@/resources' diff --git a/ppr-ui/src/components/common/CourtOrder.vue b/ppr-ui/src/components/common/CourtOrder.vue index 50ab0a994..6f5891842 100644 --- a/ppr-ui/src/components/common/CourtOrder.vue +++ b/ppr-ui/src/components/common/CourtOrder.vue @@ -183,7 +183,7 @@ ContentIF, diff --git a/ppr-ui/src/components/common/FolioNumber.vue b/ppr-ui/src/components/common/FolioNumber.vue index 04976cb6f..209422ef5 100644 --- a/ppr-ui/src/components/common/FolioNumber.vue +++ b/ppr-ui/src/components/common/FolioNumber.vue @@ -22,7 +22,7 @@ export default defineComponent({ default: '' } }, - emits: ['folio-number', 'folio-error'], + emits: ['folioNumber', 'folioError'], setup (props, { emit }) { const localState = reactive({ folioEdit: false, @@ -35,16 +35,16 @@ export default defineComponent({ watch(() => localState.folioEditNumber, (val: string) => { if (val?.length > 15) { localState.folioEditError = 'Maximum 15 characters reached' - emit('folio-error', true) + emit('folioError', true) } else { localState.folioEditError = '' localState.folioEditHint = `${15 - val?.length}` localState.folioNumber = localState.folioEditNumber - emit('folio-error', false) + emit('folioError', false) } }) watch(() => localState.folioNumber, (val: string) => { - emit('folio-number', val) + emit('folioNumber', val) }) // when enter pressed on the folio number, either focus on the input or the button if the input is disabled diff --git a/ppr-ui/src/components/common/FolioOrReferenceNumber.vue b/ppr-ui/src/components/common/FolioOrReferenceNumber.vue index 706fd4c6f..b4113e1b1 100644 --- a/ppr-ui/src/components/common/FolioOrReferenceNumber.vue +++ b/ppr-ui/src/components/common/FolioOrReferenceNumber.vue @@ -62,7 +62,7 @@ export default defineComponent({ }, sectionNumber: { type: Number, - required: false + default: null }, validate: { type: Boolean, diff --git a/ppr-ui/src/components/common/FormField.vue b/ppr-ui/src/components/common/FormField.vue index bbc29ad7a..348375089 100644 --- a/ppr-ui/src/components/common/FormField.vue +++ b/ppr-ui/src/components/common/FormField.vue @@ -46,7 +46,7 @@ export default defineComponent({ }, initialValue: { type: String, - required: false + default: '' }, inputTitle: { type: String, diff --git a/ppr-ui/src/components/common/HomeLocationInfo.vue b/ppr-ui/src/components/common/HomeLocationInfo.vue index 4cda9ec3d..2c4b99c50 100644 --- a/ppr-ui/src/components/common/HomeLocationInfo.vue +++ b/ppr-ui/src/components/common/HomeLocationInfo.vue @@ -220,7 +220,6 @@ v-model="locationInfo.exceptionPlan" variant="filled" label="Except Plan" - height="100" :rules="maxLength(80)" persistentHint /> @@ -231,13 +230,13 @@ diff --git a/ppr-ui/src/components/dialogs/LargeSearchResultDialog.vue b/ppr-ui/src/components/dialogs/LargeSearchResultDialog.vue index 85e7e4dc1..29b14a69a 100644 --- a/ppr-ui/src/components/dialogs/LargeSearchResultDialog.vue +++ b/ppr-ui/src/components/dialogs/LargeSearchResultDialog.vue @@ -1,12 +1,12 @@