Skip to content

Commit

Permalink
AddEdit Notices - Notice History Panels - Court/Commission Order Plac…
Browse files Browse the repository at this point in the history
…eholders (#1872)

* Add Edit View Notice - All but drop Actions

* placeholder forms and expansion controls

* Unit test - Clean up

* NoticePanels Unit Testing

* type fix
  • Loading branch information
cameron-eyds authored May 14, 2024
1 parent 1fa6099 commit 4d27d4e
Show file tree
Hide file tree
Showing 27 changed files with 843 additions and 69 deletions.
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.1.21",
"version": "3.1.22",
"private": true,
"appName": "Assets UI",
"sbcName": "SBC Common Components",
Expand Down
3 changes: 1 addition & 2 deletions ppr-ui/src/components/common/RegistrationsWrapper.vue
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,6 @@
variant="filled"
color="primary"
:errorMessages="myRegAddInvalid ? `Registration numbers contain ${ isMhr ? '6' : '7' } digits` : ''"
singleLine
:label="`${registrationLabel} Registration Number`"
style="width:342px"
density="compact"
Expand Down Expand Up @@ -1147,7 +1146,7 @@ export default defineComponent({
settings = getUserSettings.value
settings[SettingOptions.REGISTRATION_TABLE] = columnSettings
}
setUserSettings(settings)
setUserSettings({ ...getUserSettings.value, settings })
}
/** Returns True when the header is selected */
Expand Down
7 changes: 5 additions & 2 deletions ppr-ui/src/components/registration/RegistrationBar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
</v-btn>

<RegistrationBarTypeAheadList
v-else-if="hasRPPR && !isMhr"
v-else-if="(hasRPPR || isSecurityActNoticeEnabled) && !isMhr"
defaultLabel="Start a New Personal Property Registration"
:defaultDense="false"
:defaultClearable="false"
Expand Down Expand Up @@ -43,6 +43,7 @@ import {
import { AccountProductSubscriptionIF, RegistrationTypeIF } from '@/interfaces'
import { MhrRegistrationType } from '@/resources'
import { storeToRefs } from 'pinia'
import { usePprRegistration } from '@/composables'
export default defineComponent({
components: {
Expand All @@ -61,6 +62,7 @@ export default defineComponent({
},
emits: ['selectedRegistrationType'],
setup (props, { emit }) {
const { isSecurityActNoticeEnabled } = usePprRegistration()
const { setRegistrationTypeOtherDesc } = useStore()
const {
// Getters
Expand Down Expand Up @@ -88,7 +90,8 @@ export default defineComponent({
isRoleManufacturer,
isRoleQualifiedSupplier,
newRegistration,
MhrRegistrationType
MhrRegistrationType,
isSecurityActNoticeEnabled
}
}
})
Expand Down
1 change: 1 addition & 0 deletions ppr-ui/src/components/registration/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ export { default as RegistrationLengthTrustAmendment } from './length-trust/Regi
export { default as RegistrationLengthTrust } from './length-trust/RegistrationLengthTrust.vue'
export { default as RegistrationRepairersLien } from './length-trust/RegistrationRepairersLien.vue'
export { default as RegistrationLengthTrustSummary } from './length-trust/RegistrationLengthTrustSummary.vue'
export * from './securities-act-notices'
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<template>
<FormCard
id="add-edit-commission-order"
:label="`${addEditLabel} Commission Order`"
:class="{ 'border-error-left' : false }"
>
<template #formSlot />
</FormCard>
</template>

<script setup lang="ts">
import { computed } from 'vue'
import { FormCard } from '@/components/common'
/** Props **/
const props = withDefaults(defineProps<{
isEditing?: boolean,
commissionOrder?: any
}>(), {
isEditing: false,
commissionOrder: null
})
/** Local Properties **/
const addEditLabel = computed(() => props.isEditing ? 'Edit' : 'Add')
</script>
<style lang="scss" scoped>
@import '@/assets/styles/theme';
</style>
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<template>
<FormCard
id="add-edit-court-order"
:label="`${addEditLabel} Court Order`"
:class="{ 'border-error-left' : false }"
>
<template #formSlot />
</FormCard>
</template>

<script setup lang="ts">
import { computed } from 'vue'
import { FormCard } from '@/components/common'
/** Props **/
const props = withDefaults(defineProps<{
isEditing?: boolean,
courtOrder?: any
}>(), {
isEditing: false,
courtOrder: null
})
/** Local Properties **/
const addEditLabel = computed(() => props.isEditing ? 'Edit' : 'Add')
</script>
<style lang="scss" scoped>
@import '@/assets/styles/theme';
</style>
Original file line number Diff line number Diff line change
@@ -0,0 +1,142 @@
<template>
<FormCard
id="add-edit-notice"
:label="`${addEditLabel} Notice`"
:class="{ 'border-error-left' : isInvalidAddEditNotice }"
>
<template #formSlot>
<!-- Validation Error message -->
<p
v-if="isInvalidAddEditNotice"
class="error-text mt-1 mb-3 fs-12"
>
Indicate if the there is a Notice of Lien or Proceedings
</p>

<v-form
id="notice-form"
ref="noticeFormRef"
v-model="isFormValid"
>
<!-- Notice Type Selector -->
<v-row
noGutters
class="justify-end"
>
<v-col>
<v-radio-group
id="notice-type-options"
v-model="noticeType"
class="mt-0 pr-1"
inline
hideDetails="true"
:rules="required('')"
>
<v-radio
id="lien-option"
class="radio-one"
:class="{'selected-radio': noticeType === SaNoticeTypes.NOTICE_OF_LIEN}"
label="Lien"
:value="SaNoticeTypes.NOTICE_OF_LIEN"
/>
<v-radio
id="proceedings-option"
class="radio-two"
:class="{'selected-radio': noticeType === SaNoticeTypes.NOTICE_OF_PROCEEDINGS}"
label="Proceedings"
:value="SaNoticeTypes.NOTICE_OF_PROCEEDINGS"
/>
</v-radio-group>

<InputFieldDatePicker
class="mt-8 mr-3"
:title="'Effective Date (Optional)'"
:initialValue="effectiveDate"
@emitCancel="effectiveDate = ''"
@emitDate="effectiveDate = $event"
/>
</v-col>
</v-row>

<!-- Actions -->
<v-row
noGutters
class="justify-end mt-5 mr-3"
>
<v-btn
id="cancel-add-edit-notice"
class="mr-3 px-5 font-weight-bold"
variant="outlined"
@click="emits('cancel')"
>
Cancel
</v-btn>
<v-btn
id="submit-add-edit-notice"
class="px-5 font-weight-bold"
@click="submitAddEditNotice()"
>
Done
</v-btn>
</v-row>
</v-form>
</template>
</FormCard>
</template>

<script setup lang="ts">
import { computed, ref } from 'vue'
import { FormCard, InputFieldDatePicker } from '@/components/common'
import { AddEditSaNoticeIF, FormIF } from '@/interfaces'
import { SaNoticeTypes } from '@/enums'
import { useInputRules } from '@/composables'
/** Composables **/
const { required } = useInputRules()
/** Refs **/
const noticeFormRef: FormIF = ref(null)
/** Emits **/
const emits = defineEmits<{
cancel: [value: boolean]
done: [value: AddEditSaNoticeIF]
}>()
/** Props **/
const props = withDefaults(defineProps<{
isEditing?: boolean,
notice?: AddEditSaNoticeIF
}>(), {
isEditing: false,
notice: null
})
/** Local Properties **/
const validateAddEditNotice = ref(false)
const isFormValid = ref(false)
const noticeType = ref(props.notice?.noticeType || null)
const effectiveDate = ref(props.notice?.effectiveDate || '')
const addEditLabel = computed(() => props.isEditing ? 'Edit' : 'Add')
const isInvalidAddEditNotice = computed( () => {
return validateAddEditNotice.value && !isFormValid.value
})
/** Local Functions **/
const submitAddEditNotice = async () => {
validateAddEditNotice.value = true
await noticeFormRef.value.validate()
if(isFormValid.value) {
emits('done', {
noticeType: noticeType.value,
effectiveDate: effectiveDate.value
})
}
}
</script>
<style lang="scss" scoped>
@import '@/assets/styles/theme';
</style>
Loading

0 comments on commit 4d27d4e

Please sign in to comment.