Skip to content

Commit

Permalink
Update Tax Certificate show condition
Browse files Browse the repository at this point in the history
  • Loading branch information
dimak1 committed Jan 17, 2024
1 parent 655dafa commit a2ef04e
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -272,10 +272,10 @@ export default defineComponent({
default: false
}
},
setup (props) {
emits: ['setStoreProperty'],
setup (props, { emit }) {
const {
// Actions
setMhrLocation,
setIsManualLocation
} = useStore()
const {
Expand Down Expand Up @@ -367,31 +367,31 @@ export default defineComponent({
/** Apply local models to store when they change. **/
watch(() => localState.dealerManufacturerLot, () => {
setMhrLocation({ key: 'dealerName', value: localState.dealerManufacturerLot })
emit('setStoreProperty', { key: 'dealerName', value: localState.dealerManufacturerLot })
})
watch(() => localState.homeParkName, () => {
setMhrLocation({ key: 'parkName', value: localState.homeParkName })
emit('setStoreProperty', { key: 'parkName', value: localState.homeParkName })
})
watch(() => localState.homeParkPad, () => {
setMhrLocation({ key: 'pad', value: localState.homeParkPad })
emit('setStoreProperty', { key: 'pad', value: localState.homeParkPad })
})
watch(() => localState.pidNumber, () => {
setMhrLocation({ key: 'pidNumber', value: localState.pidNumber })
setMhrLocation({ key: 'legalDescription', value: localState.legalDescription })
emit('setStoreProperty', { key: 'pidNumber', value: localState.pidNumber })
emit('setStoreProperty', { key: 'legalDescription', value: localState.legalDescription })
})
watch(() => localState.locationInfo, (val: MhrLocationInfoIF) => {
for (const [key, value] of Object.entries(val)) {
setMhrLocation({ key, value })
emit('setStoreProperty', { key, value })
}
}, { deep: true })
watch(() => localState.additionalDescription, () => {
setMhrLocation({ key: 'additionalDescription', value: localState.additionalDescription })
emit('setStoreProperty', { key: 'additionalDescription', value: localState.additionalDescription })
})
watch(() => localState.locationTypeOption, () => {
setMhrLocation({ key: 'locationType', value: localState.locationTypeOption })
emit('setStoreProperty', { key: 'locationType', value: localState.locationTypeOption })
})
watch(() => localState.otherTypeOption, () => {
setMhrLocation({ key: 'otherType', value: localState.otherTypeOption })
emit('setStoreProperty', { key: 'otherType', value: localState.otherTypeOption })
})
watch(() => localState.isLocationTypeValid, (val: boolean) => {
setValidation(MhrSectVal.LOCATION_VALID, MhrCompVal.LOCATION_TYPE_VALID, val)
Expand Down
5 changes: 5 additions & 0 deletions ppr-ui/src/components/mhrTransfers/LocationChange.vue
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
<HomeLocationType
:validate="false"
:class="{ 'border-error-left': false }"
@setStoreProperty="handleLocationTypeUpdate($event)"
/>
</section>

Expand Down Expand Up @@ -137,6 +138,10 @@ const handleTaxCertificateUpdate = (date: string) => {
setMhrLocation({ key: 'taxCertificate', value: !!date })
}
const handleLocationTypeUpdate = (newLocation: { key, value }) => {
console.log(newLocation);
}
watch(() => state.locationChangeType, val => {
emit('updateLocationType', val)
})
Expand Down
5 changes: 4 additions & 1 deletion ppr-ui/src/views/newMhrRegistration/HomeLocation.vue
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
:locationTypeInfo="getMhrRegistrationLocation"
:validate="validateLocationType"
:class="{ 'border-error-left': validateLocationType }"
@setStoreProperty="setMhrLocation($event)"
/>
</section>

Expand Down Expand Up @@ -79,7 +80,8 @@ export default defineComponent({
const {
getMhrRegistrationLocation,
getMhrRegistrationValidationModel,
getMhrRegistrationOwnLand
getMhrRegistrationOwnLand,
setMhrLocation
} = storeToRefs(useStore())
const {
Expand Down Expand Up @@ -114,6 +116,7 @@ export default defineComponent({
MhrCompVal,
MhrSectVal,
setValidation,
setMhrLocation,
getMhrRegistrationLocation,
getMhrRegistrationOwnLand,
CivicAddressSchema,
Expand Down

0 comments on commit a2ef04e

Please sign in to comment.