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

Create New Permit UXA #2039

Merged
merged 2 commits into from
Oct 15, 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.2.63",
"version": "3.2.64",
"private": true,
"appName": "Assets UI",
"sbcName": "SBC Common Components",
Expand Down
11 changes: 0 additions & 11 deletions ppr-ui/src/assets/svgs/IconExtend.svg

This file was deleted.

23 changes: 23 additions & 0 deletions ppr-ui/src/assets/svgs/iconExtend.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
21 changes: 21 additions & 0 deletions ppr-ui/src/assets/svgs/iconNewPermit.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
13 changes: 8 additions & 5 deletions ppr-ui/src/components/mhrTransportPermit/LocationChange.vue
Original file line number Diff line number Diff line change
Expand Up @@ -228,11 +228,13 @@ const props = defineProps<{

const emit = defineEmits(['updateLocationType'])

const { isRoleQualifiedSupplier, isRoleStaffSbc, setMhrTransportPermit, setMhrTransportPermitNewLocation,
const { setMhrTransportPermit, setMhrTransportPermitNewLocation,
setMhrTransportPermitNewCivicAddress, setUnsavedChanges, setMhrStatusType } = useStore()

const {
hasUnsavedChanges,
isRoleStaffSbc,
isRoleQualifiedSupplier,
getMhrTransportPermit,
getMhrTransportPermitHomeLocation,
getMhrOriginalTransportPermit,
Expand Down Expand Up @@ -274,9 +276,9 @@ const state = reactive({
prevLocationChangeType: null,
locationChangeFromValid: false,
roleBasedLocationChangeTypes: computed(() =>
(isRoleQualifiedSupplier || isRoleStaffSbc)
? locationChangeTypes.slice(0, -2) // remove Registered Location Change and Cancel Permit from the list
: locationChangeTypes.slice(0, -1)), // remove Cancel Permit from the list
(isRoleQualifiedSupplier.value || isRoleStaffSbc.value)
? locationChangeTypes.slice(0, -3) // remove Registered Location Change and Cancel Permit and Extend from the list
: locationChangeTypes.slice(0, -2)), // remove Cancel Permit and Extend from the list
isTransportPermitType: computed(() =>
getMhrTransportPermit.value.locationChangeType === LocationChangeTypes.TRANSPORT_PERMIT),
isNotManufacturersLot: computed(() => getMhrRegistrationLocation.value.locationType !== HomeLocationTypes.LOT),
Expand All @@ -287,7 +289,8 @@ const state = reactive({
(props.validate && !isValueAmended('newLocation.address') && !hasAmendmentChanges.value)),
isLandOwnershipInvalid: computed(() => (props.validate && !getInfoValidation('isHomeLandOwnershipValid')) ||
(props.validate && !isValueAmended('ownLand') && !hasAmendmentChanges.value)),
isRoleQSorSBCAmend: computed(() => (isRoleQualifiedSupplier || isRoleStaffSbc) && isAmendLocationActive.value),
isRoleQSorSBCAmend: computed(() => (isRoleQualifiedSupplier.value || isRoleStaffSbc.value) &&
isAmendLocationActive.value),
showChangeTransportPermitLocationTypeDialog: false,
amendedBadgeHomeLocationType: {
action: 'AMENDED',
Expand Down
10 changes: 5 additions & 5 deletions ppr-ui/src/views/mhrInformation/MhrTransportPermit.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
@proceed="handleConfirmNewPermit"
>
<template #content>
<p class="px-0">
By applying for a new transport permit you are confirming that the active Transport permit
<p class="px-0 mr-n11">
By applying for a new transport permit you are confirming that the active transport permit
{{ getMhrInformation.permitRegistrationNumber }} issued on
{{ pacificDate(getMhrInformation.permitDateTime, true) }} has been completed and will render as no longer
active.
Expand Down Expand Up @@ -78,7 +78,7 @@
<img
alt="extend-icon"
class="icon-small"
src="@/assets/svgs/NewPermit.svg"
src="@/assets/svgs/iconNewPermit.svg"
>
Create New Transport Permit
</v-btn>
Expand Down Expand Up @@ -140,7 +140,7 @@
<img
alt="extend-icon"
class="icon-small"
src="@/assets/svgs/IconExtend.svg"
src="@/assets/svgs/iconExtend.svg"
>
</span>
<span class="extend-btn-text ml-1">Extend Transport Permit</span>
Expand All @@ -160,7 +160,7 @@
<img
alt="extend-icon"
class="icon-small"
src="@/assets/svgs/NewPermit.svg"
src="@/assets/svgs/iconNewPermit.svg"
>
</span>
<span class="extend-btn-text ml-1">Create New Transport Permit</span>
Expand Down
6 changes: 3 additions & 3 deletions ppr-ui/tests/unit/MhrTransportPermit.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ describe('MhrTransportPermit', () => {
await nextTick()

const locationChangeDropdown = wrapper.findComponent(LocationChange).findComponent('.v-select')
expect(locationChangeDropdown.vm.items.length).toBe(3)
expect(locationChangeDropdown.vm.items.length).toBe(2)
})

it('should render different location change options', async () => {
Expand All @@ -127,7 +127,7 @@ describe('MhrTransportPermit', () => {
const locationChangeDropdown = locationChange.findComponent('.v-select')

expect(locationChangeDropdown.exists()).toBe(true)
expect(locationChangeDropdown.vm.items.length).toBe(4)
expect(locationChangeDropdown.vm.items.length).toBe(3)

// select transport permit
locationChange.vm.selectLocationType(LocationChangeTypes.TRANSPORT_PERMIT)
Expand Down Expand Up @@ -609,7 +609,7 @@ describe('Mhr Information Transport Permit', async () => {
await nextTick()

const locationChangeDropdown = locationChange.findComponent('.v-select')
expect(locationChangeDropdown.vm.items.length).toBe(3)
expect(locationChangeDropdown.vm.items.length).toBe(2)

expect(wrapper.findComponent(DocumentId).exists()).toBe(false)
expect(locationChange.findComponent(HomeLocationType).exists()).toBe(true)
Expand Down
Loading