From 62c76f90372e69c8d17aeb80605b26125b08c728 Mon Sep 17 00:00:00 2001 From: Sanjay Babu Date: Sat, 19 Oct 2024 16:43:44 -0700 Subject: [PATCH 1/2] ATS client push UI: New ATSUserCreateModal, SubmissionForm, ATSUserLinkModal, atsService updated --- .../housing/submission/SubmissionForm.vue | 26 ++- .../components/user/ATSUserCreateModal.vue | 171 ++++++++++++++++++ .../src/components/user/ATSUserLinkModal.vue | 32 +++- frontend/src/services/atsService.ts | 8 + 4 files changed, 227 insertions(+), 10 deletions(-) create mode 100644 frontend/src/components/user/ATSUserCreateModal.vue diff --git a/frontend/src/components/housing/submission/SubmissionForm.vue b/frontend/src/components/housing/submission/SubmissionForm.vue index 09b0af84..e7811dcb 100644 --- a/frontend/src/components/housing/submission/SubmissionForm.vue +++ b/frontend/src/components/housing/submission/SubmissionForm.vue @@ -17,6 +17,7 @@ import { TextArea } from '@/components/form'; import ATSUserLinkModal from '@/components/user/ATSUserLinkModal.vue'; +import ATSUserCreateModal from '@/components/user/ATSUserCreateModal.vue'; import ATSUserDetailsModal from '@/components/user/ATSUserDetailsModal.vue'; import { Button, Message, useToast } from '@/lib/primevue'; import { submissionService, userService } from '@/services'; @@ -60,6 +61,7 @@ const assigneeOptions: Ref> = ref([]); const atsClientNumber: Ref = ref(undefined); const atsUserLinkModalVisible: Ref = ref(false); const atsUserDetailsModalVisible: Ref = ref(false); +const atsUserCreateModalVisible: Ref = ref(false); const formRef: Ref | null> = ref(null); const initialFormValues: Ref = ref(undefined); const showCancelMessage: Ref = ref(false); @@ -632,7 +634,15 @@ onMounted(async () => { class="h-2rem ml-2" @click="atsUserLinkModalVisible = true" > - Link to ATS + Search ATS + + { + diff --git a/frontend/src/components/user/ATSUserCreateModal.vue b/frontend/src/components/user/ATSUserCreateModal.vue new file mode 100644 index 00000000..e28422d7 --- /dev/null +++ b/frontend/src/components/user/ATSUserCreateModal.vue @@ -0,0 +1,171 @@ + + + + diff --git a/frontend/src/components/user/ATSUserLinkModal.vue b/frontend/src/components/user/ATSUserLinkModal.vue index 954b5e4d..fc737429 100644 --- a/frontend/src/components/user/ATSUserLinkModal.vue +++ b/frontend/src/components/user/ATSUserLinkModal.vue @@ -1,18 +1,17 @@ @@ -136,6 +152,8 @@ onMounted(async () => { data-key="atsClientNumber" :rows="5" :paginator="true" + paginator-template="RowsPerPageDropdown CurrentPageReport PrevPageLink NextPageLink " + current-page-report-template="{first}-{last} of {totalRecords}" > { header="First Name" /> { - diff --git a/frontend/src/components/user/ATSUserLinkModal.vue b/frontend/src/components/user/ATSUserLinkModal.vue index fc737429..7c82ff69 100644 --- a/frontend/src/components/user/ATSUserLinkModal.vue +++ b/frontend/src/components/user/ATSUserLinkModal.vue @@ -1,13 +1,12 @@ @@ -96,7 +73,7 @@ onMounted(async () => { class="app-info-dialog w-max" >
@@ -149,7 +126,7 @@ onMounted(async () => { class="datatable mt-3 mb-2" :value="users" selection-mode="single" - data-key="atsClientNumber" + data-key="clientId" :rows="5" :paginator="true" paginator-template="RowsPerPageDropdown CurrentPageReport PrevPageLink NextPageLink " @@ -165,7 +142,7 @@ onMounted(async () => { @@ -175,38 +152,39 @@ onMounted(async () => { sortable /> -
+
- diff --git a/frontend/src/services/atsService.ts b/frontend/src/services/atsService.ts index adfdddb5..76368cac 100644 --- a/frontend/src/services/atsService.ts +++ b/frontend/src/services/atsService.ts @@ -1,5 +1,7 @@ import { appAxios } from './interceptors'; +import type { ATSClientResource } from '@/types'; + export default { /** * @function searchATSUsers @@ -16,7 +18,7 @@ export default { * @function createATSClient * @returns {Promise} An axios response */ - createATSClient(data?: any) { + createATSClient(data?: ATSClientResource) { return appAxios().post('ats/client', data); } }; diff --git a/frontend/src/types/ATSClientResource.ts b/frontend/src/types/ATSClientResource.ts new file mode 100644 index 00000000..d5111d26 --- /dev/null +++ b/frontend/src/types/ATSClientResource.ts @@ -0,0 +1,46 @@ +export type RelLink = { + '@type': string; + rel: string; + href: string; + method: string; +}; + +export type AddressResource = { + '@type': string; + links: RelLink[]; + addressId: number; + addressLine1: string; + addressLine2: string | null; + city: string; + provinceCode: string; + countryCode: string; + postalCode: string | null; + primaryPhone: string | null; + secondaryPhone: string | null; + fax: string | null; + email: string | null; + createdBy: string | null; + createdDateTime: number | null; + updatedBy: string | null; + updatedDateTime: number | null; +}; + +export type ATSClientResource = { + '@type': string | undefined; + links: RelLink[] | undefined; + clientId: number | undefined; + address: AddressResource; + businessOrgCode: string | null; + firstName: string; + formattedAddress: string; + surName: string; + companyName: string | null; + organizationNumber: string | null; + confirmedIndicator: boolean; + createdBy: string | undefined; + createdDateTime: number | undefined; + updatedBy: string | undefined; + updatedDateTime: number | undefined; + regionName: string | undefined; + optOutOfBCStatSurveyInd: string | undefined; +}; diff --git a/frontend/src/types/ATSUser.ts b/frontend/src/types/ATSUser.ts deleted file mode 100644 index 7dbd7cb8..00000000 --- a/frontend/src/types/ATSUser.ts +++ /dev/null @@ -1,8 +0,0 @@ -export type ATSUser = { - address: string; - atsClientNumber?: string | undefined; - email: string; - firstName: string; - phone: string; - lastName: string; -}; diff --git a/frontend/src/types/index.ts b/frontend/src/types/index.ts index f5d2a2b0..e6d3bdb7 100644 --- a/frontend/src/types/index.ts +++ b/frontend/src/types/index.ts @@ -1,5 +1,5 @@ export type { AccessRequest } from './AccessRequest'; -export type { ATSUser } from './ATSUser'; +export type { ATSClientResource } from './ATSClientResource'; export type { BasicBCeIDAttribute } from './BasicBCeIDAttribute'; export type { BringForward } from './BringForward'; export type { BusinessBCeIDAttribute } from './BusinessBCeIDAttribute';