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

SAN AMEND: UXA Feedback #1917

Merged
merged 1 commit into from
Jun 6, 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.10",
"version": "3.2.11",
"private": true,
"appName": "Assets UI",
"sbcName": "SBC Common Components",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
label="Effect of Order (Optional)"
counter="512"
persistentCounter
:rules="maxLength(512)"
:rules="effectOfOrderRules"
>
<template #counter="{ counter }">
<span>Characters: {{ counter }}</span>
Expand Down Expand Up @@ -140,6 +140,14 @@ const fileNumberRules = customRules(
minLength(5),
maxLength(20)
)
const effectOfOrderRules = computed(() => {
return !!commissionOrderData.value.effectOfOrder
? customRules(
minLength(5),
maxLength(512)
)
: []
})

/** Local Functions **/
const submitAddEditCommissionOrder = async () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@
label="Effect of Order (Optional)"
counter="512"
persistentCounter
:rules="maxLength(512)"
:rules="effectOfOrderRules"
>
<template #counter="{ counter }">
<span>Characters: {{ counter }}</span>
Expand Down Expand Up @@ -193,6 +193,14 @@ const fileNumberRules = customRules(
minLength(5),
maxLength(20)
)
const effectOfOrderRules = computed(() => {
return !!courtOrderData.value.effectOfOrder
? customRules(
minLength(5),
maxLength(512)
)
: []
})

/** Local Functions **/
const submitAddEditCourtOrder = async () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
</h4>
<span>
<InfoChip
v-if="isAmendment"
class="ml-2 py-1"
v-if="isAmendment && !hasAddedParentNotice"
class="ml-4 py-1"
:action="order.action"
/>
</span>
Expand Down Expand Up @@ -56,7 +56,7 @@
cols="3"
class="pt-1 pb-0 mb-0"
>
<h4>{{ courtCommisionNumberLabel }} Number</h4>
<h4>{{ courtCommissionNumberLabel }} Number</h4>
</v-col>
<v-col
cols="9"
Expand Down Expand Up @@ -104,16 +104,18 @@ import { ActionTypes } from '@/enums'
const props = withDefaults(defineProps<{
order: CourtOrderIF,
isAmendment?: boolean,
hasRemovedOrders?: boolean
hasRemovedOrders?: boolean,
hasAddedParentNotice?: boolean
}>(), {
order: null,
isAmendment: false,
hasRemovedOrders: false
hasRemovedOrders: false,
hasAddedParentNotice: false
})

/** Local Properties **/
const courtCommissionLabel = computed(() => props.order?.courtOrder ? 'Court' : 'Securities Commission')
const courtCommisionNumberLabel = computed(() => props.order?.courtOrder ? 'Court File' : 'Commission Order')
const courtCommissionNumberLabel = computed(() => props.order?.courtOrder ? 'Court File' : 'Commission Order')


</script>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@
<span>
<InfoChip
v-if="isAmendment"
class="mt-3 ml-2 py-1"
class="mt-3 py-1"
:class="{ 'ml-4': !notice.securitiesActOrders?.length }"
:action="notice.action"
/>
</span>
Expand Down Expand Up @@ -245,6 +246,7 @@
:order="order"
:isAmendment="isAmendment"
:hasRemovedOrders="notice.action === ActionTypes.REMOVED"
:hasAddedParentNotice="notice.action === ActionTypes.ADDED"
>
<template
v-if="!isSummary && notice.action !== ActionTypes.REMOVED"
Expand Down Expand Up @@ -476,9 +478,6 @@ const removeOrder = (noticeIndex: number, orderIndex: number) => {
action: ActionTypes.REMOVED
}
setSecuritiesActNoticeOrder(noticeIndex, orderIndex, order)

// Set Parent Notice Action
getSecuritiesActNotices.value[noticeIndex].action = ActionTypes.EDITED
} else {
// Remove New/Added Orders
orders.splice(orderIndex, 1)
Expand Down Expand Up @@ -530,7 +529,6 @@ const handleAddEditOrder = (order: CourtOrderIF, orderIndex: number = null, isUn
/** Reset local form state **/
const resetFormDefaults = () => {
// Reset form refs
showOrders.value = false
editOrderIndex.value = -1
editNotice.value = false
editOrder.value = false
Expand All @@ -554,7 +552,7 @@ const setAndCloseNotice = (isUndo = false): void => {
const originalNotice = getOriginalSecuritiesActNotices.value[index]
const isAdded = notice.action === ActionTypes.ADDED
const isRemoved = notice.action === ActionTypes.REMOVED
const isEdited = !isAdded && !isEqual(omit(notice, 'action'), omit(originalNotice, 'action'))
const isEdited = !isAdded && !isEqual(notice.effectiveDateTime, originalNotice.effectiveDateTime)

if (isEdited) {
return { ...notice, action: ActionTypes.EDITED }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,8 @@ const activePanels = ref([])
const activeOrderPanel = ref(null)
const displayNotices = computed((): Array<AddEditSaNoticeIF> => {
return (props.isSummary && props.isAmendment)
? getSecuritiesActNotices.value.filter((notice: AddEditSaNoticeIF) => !!notice.action)
? getSecuritiesActNotices.value.filter((notice: AddEditSaNoticeIF) => !!notice.action ||
notice.securitiesActOrders.some(order => !!order?.action))
: getSecuritiesActNotices.value
})

Expand Down
3 changes: 2 additions & 1 deletion ppr-ui/src/composables/fees/factories/useFeeSummary.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,8 @@ export const hasNoChargeAmendment = (val: UIRegistrationTypes): boolean => {
UIRegistrationTypes.CROWN_SOCIAL_SERVICE_TAX,
UIRegistrationTypes.TRANSITION_TAX_LIEN,
UIRegistrationTypes.TOBACCO_TAX,
UIRegistrationTypes.SPECULATION_VACANCY_TAX
UIRegistrationTypes.SPECULATION_VACANCY_TAX,
UIRegistrationTypes.SECURITY_ACT_NOTICE
]
// it will not be in the UIRegistrationTypes enum list if 'Other' was selected
return hfArray.includes(val) || !Object.values(UIRegistrationTypes).includes(val)
Expand Down
2 changes: 1 addition & 1 deletion ppr-ui/src/utils/date-helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ export const isWithinMinutes = (createDateTime: string, minuteDifferential: numb
*/
export function convertToISO8601LastMinute(dateStr: string): string {
// Parse the date string to create a Date object
const date = new Date(dateStr + 'T00:00:00-08:00')
const date = new Date(dateStr + 'T00:00:00-00:00')

// Set the time to the last minute of the day (23:59:59)
date.setHours(23, 59, 59, 999)
Expand Down
14 changes: 9 additions & 5 deletions ppr-ui/src/utils/registration-helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,11 @@ export function setAmendmentList (baseList:Array<any>, addList:Array<any>, delet
notices: Array<AddEditSaNoticeIF>, addNotices: Array<AddEditSaNoticeIF>, deleteNotices: Array<AddEditSaNoticeIF>
): { addNotices: Array<AddEditSaNoticeIF>; deleteNotices: Array<AddEditSaNoticeIF> } {
notices?.forEach(notice => {
// Include Added/Amended Notices in ADD block
if ([ActionTypes.ADDED, ActionTypes.EDITED].includes(notice?.action)) {
// Check for child order edits. Any order changes would result in an amendment to the entire notice
const hasOrderChange = notice.securitiesActOrders.some(order => !!order.action)

// Include Added/Amended Notices or Notices that contain Added/Amended Orders into ADD block
if ([ActionTypes.ADDED, ActionTypes.EDITED].includes(notice?.action) || hasOrderChange) {
// Clean and format notice and orders
const formattedNotice = {
...removeEmptyProperties(notice),
Expand All @@ -79,11 +82,12 @@ export function setAmendmentList (baseList:Array<any>, addList:Array<any>, delet
orderDate: convertToISO8601LastMinute(order.orderDate.split('T')[0])
}))
} as AddEditSaNoticeIF

addNotices.push(formattedNotice)
}
// Include Removed/Amended Notices in DELETE block
if ([ActionTypes.REMOVED, ActionTypes.EDITED].includes(notice?.action)) deleteNotices.push(notice)

// Include Removed/Amended Notices or Notices that contain Removed/Amended Orders in DELETE block
if ([ActionTypes.REMOVED, ActionTypes.EDITED].includes(notice?.action) ||
(notice?.action !== ActionTypes.ADDED && hasOrderChange)) deleteNotices.push(notice)
})
return { addNotices, deleteNotices }
}
Expand Down
Loading