Skip to content
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
5 changes: 4 additions & 1 deletion strr-examiner-web/app/components/ApplicationInfoHeader.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ const exStore = useExaminerStore()
const { activeHeader, activeReg, isFilingHistoryOpen } = storeToRefs(exStore)
const { toggleFilingHistory, checkAndPerformAction } = useHostExpansion()
const localePath = useLocalePath()
const { isSnapshotRoute } = useExaminerRoute()

const getBadgeColor = (status: ApplicationStatus): string => {
switch (status) {
Expand Down Expand Up @@ -89,6 +90,7 @@ const registrationCountdown = computed(() => {
/>
</span>
<UButton
v-if="!isSnapshotRoute"
:label="isFilingHistoryOpen ? t('btn.hideHistory') : t('btn.showHistory')"
:padded="false"
variant="link"
Expand All @@ -100,7 +102,7 @@ const registrationCountdown = computed(() => {
/>
</div>
<UButton
v-if="activeHeader?.status !== ApplicationStatus.PAYMENT_DUE"
v-if="activeHeader?.status !== ApplicationStatus.PAYMENT_DUE && !isSnapshotRoute"
icon="i-mdi-receipt-text-outline"
:padded="false"
variant="link"
Expand All @@ -110,6 +112,7 @@ const registrationCountdown = computed(() => {
>
{{ t('btn.viewReceipt') }}
</UButton>
<SnapshotInfo v-if="isSnapshotRoute" />
</div>
<div class="mb-2 text-sm">
<UBadge
Expand Down
3 changes: 2 additions & 1 deletion strr-examiner-web/app/components/Host/SubHeader.vue
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ const alertFlags = reactive(useFlags())
const { isFeatureEnabled } = useFeatureFlags()
const canEditApplicationAddress = isFeatureEnabled('enable-examiner-edit-address-application')
const { checkAndPerformAction, openHostOwners } = useHostExpansion()
const { isSnapshotRoute } = useExaminerRoute()

const isEditAddressDisabled = computed((): boolean => activeReg.value.status === RegistrationStatus.CANCELLED)

Expand All @@ -31,7 +32,7 @@ const isEditAddressDisabled = computed((): boolean => activeReg.value.status ===
<div class="flex items-center justify-between gap-2">
<strong>{{ t('strr.label.rentalUnit').toUpperCase() }}</strong>
<UButton
v-if="!isApplication || canEditApplicationAddress"
v-if="(!isApplication || canEditApplicationAddress) && !isSnapshotRoute"
variant="link"
size="xs"
color="blue"
Expand Down
3 changes: 2 additions & 1 deletion strr-examiner-web/app/components/Host/SupportingInfo.vue
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ const { t } = useNuxtApp().$i18n
const alertFlags = reactive(useFlags())
const { isFeatureEnabled } = useFeatureFlags()
const isBusinessLicenseDocumentUploadEnabled = isFeatureEnabled('enable-business-license-document-upload')
const { isSnapshotRoute } = useExaminerRoute()

const docStore = useExaminerDocumentStore()
const { isPrUploadOpen } = storeToRefs(docStore)
Expand Down Expand Up @@ -269,7 +270,7 @@ const businessLicenseRegistrationConfig: SupportingDocumentsConfig = {
</ApplicationDetailsSection>
</div>
<div
v-if="!isApplication &&
v-if="!isApplication && !isSnapshotRoute &&
(activeReg?.status === RegistrationStatus.ACTIVE ||
activeReg?.status === RegistrationStatus.SUSPENDED)"
class="col-span-1 flex justify-end"
Expand Down
21 changes: 12 additions & 9 deletions strr-examiner-web/app/components/RegistrationInfoHeader.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ const { t } = useNuxtApp().$i18n
const exStore = useExaminerStore()
const { activeReg, activeHeader, isFilingHistoryOpen } = storeToRefs(exStore)
const { toggleFilingHistory, checkAndPerformAction } = useHostExpansion()
const { isSnapshotRoute } = useExaminerRoute()

const getBadgeColor = (status: RegistrationStatus | RegistrationNocStatus): string => {
switch (status) {
Expand Down Expand Up @@ -63,7 +64,7 @@ const nocCountdown = computed(() => {
<div class="border-b bg-white py-6">
<div class="app-inner-container">
<div class="mb-2">
<div class="mb-4 flex justify-between text-2xl leading-none">
<div class="relative mb-4 flex justify-between text-2xl leading-none">
<div class="flex items-center space-x-3">
<span class="border-r-2 border-gray-700 pr-3 font-bold">
{{ activeReg.registrationNumber }}
Expand All @@ -88,6 +89,7 @@ const nocCountdown = computed(() => {
/>
</span>
<UButton
v-if="!isSnapshotRoute"
:label="isFilingHistoryOpen ? $t('btn.hideHistory') : $t('btn.showHistory')"
:padded="false"
variant="link"
Expand All @@ -98,7 +100,7 @@ const nocCountdown = computed(() => {
/>
</div>
<UButton
v-if="activeHeader?.status !== ApplicationStatus.PAYMENT_DUE"
v-if="activeHeader?.status !== ApplicationStatus.PAYMENT_DUE && !isSnapshotRoute"
icon="i-mdi-receipt-text-outline"
:padded="false"
variant="link"
Expand All @@ -108,10 +110,11 @@ const nocCountdown = computed(() => {
>
{{ $t('btn.viewReceipt') }}
</UButton>
<SnapshotInfo v-if="isSnapshotRoute" />
</div>
<div class="text-sm">
<UBadge
v-if="activeHeader.isSetAside"
v-if="activeHeader?.isSetAside"
class="mr-3 bg-bcGovColor-midGray font-bold uppercase"
:label="t('strr.label.setAside')"
variant="solid"
Expand Down Expand Up @@ -145,7 +148,7 @@ const nocCountdown = computed(() => {
>
<strong>{{ t('strr.label.expiryDate') }}</strong>
{{ dateToString(activeReg.expiryDate, 'y-MM-dd', true) }}
({{ dayCountdown(activeReg.expiryDate.toString()) }} days left)
({{ dayCountdown(activeReg.expiryDate?.toString()) }} days left)
</span>
<template v-if="activeReg.nocEndDate">
| <strong>{{ t('strr.label.nocExpiry') }}</strong>
Expand All @@ -154,20 +157,20 @@ const nocCountdown = computed(() => {
<span v-else-if="nocCountdown && nocCountdown.isExpired" class="font-bold text-red-500"> (EXPIRED)</span>
</template>
| <strong>{{ t('strr.label.assignee') }}</strong>
{{ activeHeader.assignee?.username || '-' }}
<template v-if="activeHeader.decider?.username">
{{ activeHeader?.assignee?.username || '-' }}
<template v-if="activeHeader?.decider?.username">
| <strong>{{ t('strr.label.decider') }}</strong>
{{ activeHeader.decider.username }}
{{ activeHeader?.decider.username }}
</template>
</div>
</div>
<div class="text-sm">
<strong>Application Number:</strong>
{{ activeHeader.applicationNumber }} |
{{ activeHeader?.applicationNumber }} |
<strong>Type:</strong>
{{ getRegistrationType() }} |
<strong>{{ t('strr.label.submitted') }}</strong>
{{ dateToString(activeHeader.applicationDateTime, 'y-MM-dd', true) }}
{{ dateToString(activeHeader?.applicationDateTime, 'y-MM-dd', true) }}
</div>
</div>
</div>
Expand Down
20 changes: 20 additions & 0 deletions strr-examiner-web/app/components/SnapshotInfo.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<script lang="ts" setup>
const { t } = useNuxtApp().$i18n
const exStore = useExaminerStore()
const { snapshotInfo } = storeToRefs(exStore)
</script>

<template>
<div
class="flex flex-col gap-y-2 rounded-xl border-[3px] border-[#E2E8EE]
bg-white px-4 py-3 text-sm md:absolute md:right-0 md:top-0"
data-testid="snapshot-info"
>
<span>
<b>{{ t('strr.label.version') }}</b> {{ snapshotInfo.version }}
</span>
<span>
<b>{{ t('strr.label.date') }}</b> {{ dateToString(snapshotInfo.snapshotDateTime, 'y-MM-dd a', true) }}
</span>
</div>
</template>
85 changes: 85 additions & 0 deletions strr-examiner-web/app/components/SnapshotVersionsTable.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
<script lang="ts" setup>
const { t } = useNuxtApp().$i18n

defineProps<{
snapshots: ApiSnapshot[]
}>()

const localePath = useLocalePath()

const columns = [
{ key: 'version', label: t('table.registrationSnapshots.version') },
{ key: 'date', label: t('table.registrationSnapshots.date') },
{ key: 'decision', label: t('table.registrationSnapshots.decision') },
{ key: 'assignee', label: t('table.registrationSnapshots.assignee') },
{ key: 'action', label: t('table.registrationSnapshots.action'), class: 'w-[200px]' }
]

const onViewSnapshot = async (snapshotEndpoint: string) => {
await navigateTo(localePath(snapshotEndpoint.replace('registrations', 'registration')))
}

</script>

<template>
<div class="app-inner-container mb-4">
<!-- Header -->
<div class="flex items-center justify-between rounded-t-lg bg-[#E2E8EE] px-6 py-4">
<div class="flex items-center gap-2">
<UIcon
name="i-mdi-folder-outline"
class="size-6 text-str-blue"
/>
<h3 class="text-lg text-str-textGray">
{{ t('label.versions') }}
</h3>
</div>
</div>
<!-- Table -->
<UTable
:rows="snapshots"
:columns="columns"
:ui="{
wrapper: 'h-auto',
divide: 'divide-y divide-gray-200',
th: {
base: 'text-sm text-gray-700',
padding: 'px-6 py-3'
},
td: {
base: 'align-middle text-sm text-gray-700 bg-white',
padding: 'px-6'
}
}"
data-testid="snapshot-versions-table"
>
<template #version-data="{ row }">
{{ row.version }}
</template>
<template #date-data="{ row }">
{{ dateToString(row.snapshotDateTime, 'y-MM-dd', true) }}
</template>
<template #decision-data>
-
</template>
<template #assignee-data>
-
</template>
<template #action-data="{ row }">
<UButton
:label="t('btn.viewSnapshot')"
color="primary"
variant="solid"
size="lg"
class="whitespace-nowrap px-6"
data-testid="view-snapshot-button"
@click="onViewSnapshot(row.snapshotEndpoint)"
/>
</template>
</UTable>
</div>
</template>

<style>

</style>
Comment on lines +83 to +85
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

An empty style block here if we can remove it

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cleaned up in next pr

3 changes: 2 additions & 1 deletion strr-examiner-web/app/composables/useExaminerFeatureFlags.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ export const useExaminerFeatureFlags = () => {
isSubmissionDateFilterEnabled: isFeatureEnabled('enable-examiner-submission-date-filter'),
isLastModifiedFilterEnabled: isFeatureEnabled('enable-examiner-last-modified-filter'),
isSplitDashboardTableEnabled: isFeatureEnabled('enable-examiner-split-dashboard-table'),
isHistoricalApplicationsTableEnabled: isFeatureEnabled('enable-examiner-historical-applications-table')
isHistoricalApplicationsTableEnabled: isFeatureEnabled('enable-examiner-historical-applications-table'),
isSnapshotVersionsTableEnabled: isFeatureEnabled('enable-examiner-snapshot-versions-table')
}
}
6 changes: 6 additions & 0 deletions strr-examiner-web/app/composables/useExaminerRoute.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@
import { ApplicationActionsE, RegistrationActionsE } from '@/enums/actions'

export const useExaminerRoute = () => {
const route = useRoute()
const localePath = useLocalePath()
const { setButtonControl, getButtonControl } = useButtonControl()
const exStore = useExaminerStore()
const { activeReg, isApplication, activeHeader } = storeToRefs(exStore)
const { isFeatureEnabled } = useFeatureFlags()

const isSnapshotRoute = computed(() =>
route.name?.toString().includes('snapshots')
)

const updateRouteAndButtons = (
routePrefix: string,
buttonConfig: {
Expand Down Expand Up @@ -266,6 +271,7 @@ export const useExaminerRoute = () => {
}

return {
isSnapshotRoute,
updateRouteAndButtons
}
}
4 changes: 3 additions & 1 deletion strr-examiner-web/app/layouts/examine.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ const localePath = useLocalePath()
const { isApplication } = storeToRefs(useExaminerStore())
const { isFeatureEnabled } = useFeatureFlags()
const enableExaminerDecisions = isFeatureEnabled('enable-examiner-decisions')
const { isSnapshotRoute } = useExaminerRoute()

</script>
<template>
<div class="app-container">
Expand Down Expand Up @@ -47,7 +49,7 @@ const enableExaminerDecisions = isFeatureEnabled('enable-examiner-decisions')
</template>
</NuxtErrorBoundary>
<ConnectButtonControl v-if="!enableExaminerDecisions || isApplication" />
<ActionButtons v-else-if="enableExaminerDecisions" />
<ActionButtons v-else-if="enableExaminerDecisions && !isSnapshotRoute" />
<ConnectFooter />
</div>
</template>
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const {
const { isAssignedToUser, emailContent, emailFormRef, activeRecord, isApplication } = storeToRefs(useExaminerStore())
const { openConfirmActionModal, close: closeConfirmActionModal } = useStrrModals()
const { showDecisionPanel } = useExaminerDecision()
const { isHistoricalApplicationsTableEnabled } = useExaminerFeatureFlags()
const { isHistoricalApplicationsTableEnabled, isSnapshotVersionsTableEnabled } = useExaminerFeatureFlags()

useHead({
title: t('page.dashboardList.title')
Expand Down Expand Up @@ -227,6 +227,10 @@ watch(
v-if="!isApplication && isHistoricalApplicationsTableEnabled"
:applications="(activeRecord as HousRegistrationResponse).header.applications ?? []"
/>
<SnapshotVersionsTable
v-if="!isApplication && isSnapshotVersionsTableEnabled"
:snapshots="(activeRecord as HousRegistrationResponse).snapshots ?? []"
/>
<DecisionPanel />
<AssignmentActions :is-registration-page="true" @refresh="refresh" />
</template>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
<script setup lang="ts">
const { t } = useNuxtApp().$i18n
const route = useRoute()
const { getSnapshotById } = useExaminerStore()
const { activeRecord, snapshotInfo } = storeToRefs(useExaminerStore())

useHead({
title: t('page.snapshot.title')
})

definePageMeta({
layout: 'examine',
middleware: ['auth']
})

const initialMount = ref(true)

const { data: snapshot, status, error } = await useLazyAsyncData<
HousRegistrationResponse | undefined, ApplicationError
>(
'snapshot-details-view',
async () => {
const registrationId = route.params.registrationId as string
const snapshotId = route.params.snapshotId as string
const resp = await getSnapshotById(registrationId, snapshotId)
activeRecord.value = resp.snapshotData // used for the data needed to render the details page
snapshotInfo.value = resp // user for data needed for snapshot info widget on details page
Copy link
Collaborator

@JazzarKarim JazzarKarim Feb 5, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sorry for being nitpicky haha, a super small typo here, used instead of user

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cleaned up in next pr, thanks for noticing

return resp
}
)

watch(
[snapshot, error],
() => {
initialMount.value = false
}
)
</script>

<template>
<div class="app-body">
<ConnectSpinner
v-if="initialMount || status === 'pending'"
overlay
/>
<template v-else>
<ApplicationDetailsView>
<template #header>
<RegistrationInfoHeader />
</template>
</ApplicationDetailsView>
</template>
</div>
</template>
Loading
Loading