Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Location Type payload and PidNumber refactor #1722

Merged
merged 1 commit into from
Feb 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions ppr-ui/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion ppr-ui/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ppr-ui",
"version": "3.0.34",
"version": "3.0.35",
"private": true,
"appName": "Assets UI",
"sbcName": "SBC Common Components",
Expand Down
10 changes: 4 additions & 6 deletions ppr-ui/src/components/common/PidNumber.vue
Original file line number Diff line number Diff line change
Expand Up @@ -104,14 +104,12 @@
<script lang="ts">

import { computed, defineComponent, nextTick, reactive, ref, toRefs, watch } from 'vue'
import { useStore } from '@/store/store'
import { useInputRules } from '@/composables'
import { ltsaDetails } from '@/utils/ltsa-api-helper'
import { BaseDialog } from '@/components/dialogs'
import { pidNotFoundDialog } from '@/resources/dialogOptions'
import { LtsaDetailsIF, PidInfoIF } from '@/interfaces/ltsa-api-interfaces'
import { FormIF } from '@/interfaces'
import { storeToRefs } from 'pinia'


export default defineComponent({
Expand All @@ -120,21 +118,21 @@ export default defineComponent({
BaseDialog
},
props: {
pidNumber: { type: String, default: '' },
disable: { type: Boolean, default: false },
required: { type: Boolean, default: false }
},
emits: ['setPid', 'verifyingPid'],
setup (props, context) {
const { getMhrRegistrationLocation } = storeToRefs(useStore())
const { isNumber } = useInputRules()
const pidOneRef = ref(null) as FormIF
const pidTwoRef = ref(null) as FormIF
const pidThreeRef = ref(null) as FormIF

const localState = reactive({
pidOne: getMhrRegistrationLocation.value?.pidNumber.slice(0, 3) || '',
pidTwo: getMhrRegistrationLocation.value?.pidNumber.slice(3, 6) || '',
pidThree: getMhrRegistrationLocation.value?.pidNumber.slice(6, 9) || '',
pidOne: props.pidNumber?.slice(0, 3) || '',
pidTwo: props.pidNumber?.slice(3, 6) || '',
pidThree: props.pidNumber?.slice(6, 9) || '',
enablePidLoader: false,
dialogOptions: pidNotFoundDialog,
showNotFoundDialog: false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@
>
<PidNumber
class="mb-4"
:pidNumber="locationTypeInfo.pidNumber"
:disable="showLocationInfo"
:required="otherTypeOption === HomeLocationTypes.OTHER_STRATA && validate"
@set-pid="handlePidInfo($event)"
Expand Down
6 changes: 6 additions & 0 deletions ppr-ui/src/composables/mhrInformation/useTransportPermits.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,12 @@ export const useTransportPermits = () => {
payloadData.newLocation.address.postalCode = ' '
}

// api does not support otherType, and it should be set to the locationType
if (payloadData.newLocation.otherType) {
payloadData.newLocation.locationType = payloadData.newLocation.otherType
delete payloadData.newLocation.otherType
}

return payloadData
}

Expand Down
Loading