From 43d952a97ab4831fe511d8559d7748e9ec576223 Mon Sep 17 00:00:00 2001 From: Dima K Date: Sat, 11 Jan 2025 13:10:25 -0800 Subject: [PATCH] Update Host Details as per latest design --- strr-base-web/app/utils/date.ts | 7 +- .../app/components/ApplicationDetails.vue | 50 ----- .../components/ApplicationDetailsSection.vue | 23 +-- .../app/components/ApplicationInfoHeader.vue | 34 ++++ .../app/components/HostDetailsView.vue | 183 +++++++++++------- .../app/components/PlatformDetailsView.vue | 13 -- .../app/components/StrataHotelDetailsView.vue | 13 -- strr-examiner-web/app/locales/en-CA.ts | 31 ++- .../app/pages/examine/[applicationId].vue | 6 +- strr-examiner-web/app/store/examiner.ts | 17 +- 10 files changed, 200 insertions(+), 177 deletions(-) delete mode 100644 strr-examiner-web/app/components/ApplicationDetails.vue create mode 100644 strr-examiner-web/app/components/ApplicationInfoHeader.vue diff --git a/strr-base-web/app/utils/date.ts b/strr-base-web/app/utils/date.ts index ab595133b..62bae8518 100644 --- a/strr-base-web/app/utils/date.ts +++ b/strr-base-web/app/utils/date.ts @@ -55,16 +55,19 @@ export function dateToStringPacific (date: Date | string, format = 'y-MM-dd') { /** * Calculates the number of full days remaining until a given end date. + * If isElapsed is true, it calculates the number of full days since the end date. * * @param end - The ISO datestring for the end value. * @returns The number of full days remaining until the end date. */ -export function dayCountdown (end: string): number { +export function dayCountdown (end: string, isElapsed: boolean = false): number { const startDate = DateTime.utc() // get current utc date const endDate = DateTime.fromISO(end, { setZone: true }).toUTC() // get given end date and convert to utc // get difference in days https://moment.github.io/luxon/#/math?id=diffs - const diff = endDate.diff(startDate, 'days').toObject().days + const diff = isElapsed + ? startDate.diff(endDate, 'days').toObject().days ?? 0 + : endDate.diff(startDate, 'days').toObject().days // round difference down return Math.floor(diff) diff --git a/strr-examiner-web/app/components/ApplicationDetails.vue b/strr-examiner-web/app/components/ApplicationDetails.vue deleted file mode 100644 index 8f936047a..000000000 --- a/strr-examiner-web/app/components/ApplicationDetails.vue +++ /dev/null @@ -1,50 +0,0 @@ - - - - diff --git a/strr-examiner-web/app/components/ApplicationDetailsSection.vue b/strr-examiner-web/app/components/ApplicationDetailsSection.vue index e1c184ef9..cedec798e 100644 --- a/strr-examiner-web/app/components/ApplicationDetailsSection.vue +++ b/strr-examiner-web/app/components/ApplicationDetailsSection.vue @@ -1,34 +1,17 @@ diff --git a/strr-examiner-web/app/components/ApplicationInfoHeader.vue b/strr-examiner-web/app/components/ApplicationInfoHeader.vue new file mode 100644 index 000000000..9ab456582 --- /dev/null +++ b/strr-examiner-web/app/components/ApplicationInfoHeader.vue @@ -0,0 +1,34 @@ + + + + + diff --git a/strr-examiner-web/app/components/HostDetailsView.vue b/strr-examiner-web/app/components/HostDetailsView.vue index 470e62fd0..7f616e26c 100644 --- a/strr-examiner-web/app/components/HostDetailsView.vue +++ b/strr-examiner-web/app/components/HostDetailsView.vue @@ -1,116 +1,149 @@