From 85c6582a4ac2235fcb341b5edd872927491f1226 Mon Sep 17 00:00:00 2001 From: cameron-eyds Date: Sun, 26 Nov 2023 07:32:32 -0800 Subject: [PATCH 1/4] ongoing Linting --- ppr-ui/.eslintrc.js | 4 +- .../src/components/collateral/Collateral.vue | 16 +++---- .../generalCollateral/GenColAmend.vue | 3 ++ .../generalCollateral/GenColSummary.vue | 8 ++-- .../vehicleCollateral/VehicleCollateral.vue | 7 ++-- .../factories/collateralFormValidator.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 ++- .../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 | 1 - ppr-ui/src/components/common/LienAlert.vue | 3 -- .../src/components/common/OrgNameLookup.vue | 2 +- .../common/RegistrationsWrapper.vue | 7 +--- ppr-ui/src/components/common/Remarks.vue | 2 - ppr-ui/src/components/common/ReviewCard.vue | 2 +- .../components/common/SimpleHelpToggle.vue | 13 ++++-- .../components/common/SubProductSelector.vue | 6 +-- .../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 | 1 - ppr-ui/src/components/search/SearchBar.vue | 4 +- .../components/tables/mhr/SearchedResults.vue | 4 +- ppr-ui/src/composables/useInputRules.ts | 22 +++++----- 31 files changed, 135 insertions(+), 124 deletions(-) diff --git a/ppr-ui/.eslintrc.js b/ppr-ui/.eslintrc.js index eaa05ba6e..0e0e2ced0 100644 --- a/ppr-ui/.eslintrc.js +++ b/ppr-ui/.eslintrc.js @@ -12,6 +12,7 @@ module.exports = { ], rules: { '@typescript-eslint/no-explicit-any': 'off', + '@typescript-eslint/ban-ts-comment': 'off', 'object-curly-spacing': ['error', 'always'], 'standard/computed-property-even-spacing': 'off', 'vue/multi-word-component-names': 'off', @@ -27,7 +28,8 @@ module.exports = { '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..db5a01318 100644 --- a/ppr-ui/src/components/collateral/Collateral.vue +++ b/ppr-ui/src/components/collateral/Collateral.vue @@ -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/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/vehicleCollateral/VehicleCollateral.vue b/ppr-ui/src/components/collateral/vehicleCollateral/VehicleCollateral.vue index eab217bb9..5364cf0ba 100644 --- a/ppr-ui/src/components/collateral/vehicleCollateral/VehicleCollateral.vue +++ b/ppr-ui/src/components/collateral/vehicleCollateral/VehicleCollateral.vue @@ -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/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/DischargeConfirmSummary.vue b/ppr-ui/src/components/common/DischargeConfirmSummary.vue index 83807cac1..6daa71a75 100644 --- a/ppr-ui/src/components/common/DischargeConfirmSummary.vue +++ b/ppr-ui/src/components/common/DischargeConfirmSummary.vue @@ -83,10 +83,20 @@ import { UIRegistrationTypes } from '@/enums' export default defineComponent({ name: 'DischargeConfirmSummary', props: { - setRegNum: String, - setRegType: String, - setCollateralSummary: String, + setRegNum: { + type: String, + default: '' + }, + setRegType: { + type: String, + default: '' + }, + setCollateralSummary: { + type: String, + default: '' + }, setShowErrors: { + type: Boolean, default: false } }, diff --git a/ppr-ui/src/components/common/DocumentId.vue b/ppr-ui/src/components/common/DocumentId.vue index 33e51a9d6..796e1ea02 100644 --- a/ppr-ui/src/components/common/DocumentId.vue +++ b/ppr-ui/src/components/common/DocumentId.vue @@ -84,7 +84,8 @@ export default defineComponent({ }, sectionNumber: { type: Number, - required: false + required: false, + default: null }, content: { type: Object as () => 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..2f2a8863d 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 /> diff --git a/ppr-ui/src/components/common/LienAlert.vue b/ppr-ui/src/components/common/LienAlert.vue index 01ac882f9..3e6dda795 100644 --- a/ppr-ui/src/components/common/LienAlert.vue +++ b/ppr-ui/src/components/common/LienAlert.vue @@ -59,9 +59,6 @@ import { export default defineComponent({ name: 'LienAlert', - props: { - setEndDate: { type: String } - }, emits: ['isLoading'], setup (props, { emit }) { const router = useRouter() diff --git a/ppr-ui/src/components/common/OrgNameLookup.vue b/ppr-ui/src/components/common/OrgNameLookup.vue index 8f1bfcfa9..7058c280a 100644 --- a/ppr-ui/src/components/common/OrgNameLookup.vue +++ b/ppr-ui/src/components/common/OrgNameLookup.vue @@ -47,7 +47,7 @@ export default defineComponent({ baseValue: { type: String, default: '' }, fieldLabel: { type: String, default: 'Find or enter the Full Legal Name of the Business' }, fieldHint: { type: String, default: '' }, - orgNameRules: { type: Array as () => Array, default: () => [] }, + orgNameRules: { type: Array as () => Array<(v:any)=>string|boolean>, default: () => [] }, nilSearchText: { type: String, default: 'Ensure you have entered the correct, full legal name of the organization before entering the phone' + diff --git a/ppr-ui/src/components/common/RegistrationsWrapper.vue b/ppr-ui/src/components/common/RegistrationsWrapper.vue index 721d38c4d..bc3808513 100644 --- a/ppr-ui/src/components/common/RegistrationsWrapper.vue +++ b/ppr-ui/src/components/common/RegistrationsWrapper.vue @@ -293,10 +293,7 @@ export default defineComponent({ default: false } }, - emits: [ - 'haveData', - 'error' - ], + emits: ['error', 'haveData', 'snackBarMsg'], setup (props, context) { const router = useRouter() const { @@ -908,7 +905,7 @@ export default defineComponent({ sortedDrafts = await draftHistory(cloneDeep(args.sortOptions)) } // Destructure to omit orderBy and orderVal from condition - const { orderBy, orderVal, ...sortvalues } = args.sortOptions + const { ...sortvalues } = args.sortOptions const sortedRegs = hasTruthyValue(sortvalues) ? await registrationHistory(cloneDeep(args.sortOptions)) : await registrationHistory() diff --git a/ppr-ui/src/components/common/Remarks.vue b/ppr-ui/src/components/common/Remarks.vue index e1b694466..436fe4379 100644 --- a/ppr-ui/src/components/common/Remarks.vue +++ b/ppr-ui/src/components/common/Remarks.vue @@ -75,12 +75,10 @@ export default defineComponent({ }, additionalRemarks: { type: String, - required: false, default: '' }, sectionNumber: { type: Number, - required: false, default: null }, content: { diff --git a/ppr-ui/src/components/common/ReviewCard.vue b/ppr-ui/src/components/common/ReviewCard.vue index 34f8f4b5b..096a045ed 100644 --- a/ppr-ui/src/components/common/ReviewCard.vue +++ b/ppr-ui/src/components/common/ReviewCard.vue @@ -75,7 +75,7 @@ export default defineComponent({ props: { reviewProperties: { type: Array as () => Array<{ label: string, property: any }>, - required: false + default: () => [] }, showIncomplete: { type: Boolean, diff --git a/ppr-ui/src/components/common/SimpleHelpToggle.vue b/ppr-ui/src/components/common/SimpleHelpToggle.vue index 0061790f5..b680001df 100644 --- a/ppr-ui/src/components/common/SimpleHelpToggle.vue +++ b/ppr-ui/src/components/common/SimpleHelpToggle.vue @@ -49,15 +49,20 @@ import { computed, defineComponent, reactive, toRefs } from 'vue' export default defineComponent({ name: 'SimpleHelpToggle', props: { - toggleButtonTitle: { default: '' }, + toggleButtonTitle: { + type: String, + default: '' + }, /* show or hide secondary toggle within content */ - hasBottomHideToggle: { default: true }, - defaultHideText: { default: true } + hasBottomHideToggle: { + type: Boolean, + default: true + } }, setup (props) { const localState = reactive({ isHelpContentOpen: false, - hideText: props.defaultHideText ? 'Hide Help' : 'Hide ' + props.toggleButtonTitle, + hideText: props.toggleButtonTitle ? 'Hide ' + props.toggleButtonTitle : 'Hide Help', title: computed(() : string => localState.isHelpContentOpen ? localState.hideText : props.toggleButtonTitle), showBottomToggle: props.hasBottomHideToggle }) diff --git a/ppr-ui/src/components/common/SubProductSelector.vue b/ppr-ui/src/components/common/SubProductSelector.vue index 83920528b..c9bad6b5b 100644 --- a/ppr-ui/src/components/common/SubProductSelector.vue +++ b/ppr-ui/src/components/common/SubProductSelector.vue @@ -18,7 +18,7 @@ :value="subProduct.type" >