Skip to content

Commit

Permalink
Merge pull request #176 from shaangill025/fix_22832_followup
Browse files Browse the repository at this point in the history
UI: Application Status Followup Fixes
  • Loading branch information
shaangill025 authored Oct 11, 2024
2 parents a083b5f + f9e5426 commit 31c6282
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 15 deletions.
11 changes: 6 additions & 5 deletions strr-web/composables/useChipFlavour.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ export const useChipFlavour = () => {
text: tStatuses(translationKey)
})

const examinerOrHostStatusMap = (flavour: AlertsFlavourE, key: string) => ({
const examinerOrHostStatusMap = (flavour: AlertsFlavourE, commonKey: string, hostSpecificKey?: string) => ({
alert: flavour,
text: isExaminer
? tStatuses(`examinerStatuses.${key}`)
: tStatuses(`hostStatuses.${key}`)
? tStatuses(`examinerStatuses.${commonKey}`)
: tStatuses(`hostStatuses.${hostSpecificKey || commonKey}`)
})

const getChipFlavour = (status: string): StatusChipFlavoursI['flavour'] => {
Expand Down Expand Up @@ -53,14 +53,15 @@ export const useChipFlavour = () => {
return examinerOrHostStatusMap(AlertsFlavourE.SUCCESS, 'autoApproved')
case ApplicationStatusE.PROVISIONALLY_APPROVED:
case HostApplicationStatusE.PROVISIONALLY_APPROVED:
case ExaminerApplicationStatusE.PROVISIONALLY_APPROVED:
return examinerOrHostStatusMap(AlertsFlavourE.SUCCESS, 'provisionalApproved')
case ExaminerApplicationStatusE.PROVISIONALLY_APPROVED:
case HostApplicationStatusE.PROVISIONAL_REVIEW:
return examinerOrHostStatusMap(AlertsFlavourE.SUCCESS, 'provisionalApproved', 'provisionalReview')
case ApplicationStatusE.FULL_REVIEW_APPROVED:
case HostApplicationStatusE.FULL_REVIEW_APPROVED:
case ExaminerApplicationStatusE.FULL_REVIEW_APPROVED:
return examinerOrHostStatusMap(AlertsFlavourE.SUCCESS, 'fullReviewApproved')
case ApplicationStatusE.PROVISIONAL_REVIEW:
case HostApplicationStatusE.PROVISIONAL_REVIEW:
case ExaminerApplicationStatusE.PROVISIONAL_REVIEW:
return examinerOrHostStatusMap(AlertsFlavourE.SUCCESS, 'provisionalReview')
case ApplicationStatusE.FULL_REVIEW:
Expand Down
8 changes: 4 additions & 4 deletions strr-web/enums/application-status-e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export enum HostApplicationStatusE {
AUTO_APPROVED = 'Approved', // eslint-disable-next-line @typescript-eslint/no-duplicate-enum-values
PROVISIONALLY_APPROVED = 'Approved', // eslint-disable-next-line @typescript-eslint/no-duplicate-enum-values
FULL_REVIEW_APPROVED = 'Approved',
PROVISIONAL_REVIEW = 'Approved Provisional', // eslint-disable-next-line @typescript-eslint/no-duplicate-enum-values
PROVISIONAL_REVIEW = 'Approved \u2013 Provisional', // eslint-disable-next-line @typescript-eslint/no-duplicate-enum-values
FULL_REVIEW = 'Pending Approval',
DECLINED = 'Declined'
}
Expand All @@ -28,9 +28,9 @@ export enum ExaminerApplicationStatusE {
DRAFT = 'Draft',
PAYMENT_DUE = 'Payment Due',
PAID = 'Paid',
AUTO_APPROVED = 'Approved Automatic',
PROVISIONALLY_APPROVED = 'Approved Provisional',
FULL_REVIEW_APPROVED = 'Approved Examined',
AUTO_APPROVED = 'Approved \u2013 Automatic',
PROVISIONALLY_APPROVED = 'Approved \u2013 Provisional',
FULL_REVIEW_APPROVED = 'Approved \u2013 Examined',
PROVISIONAL_REVIEW = 'Provisional Examination',
FULL_REVIEW = 'Full Examination',
DECLINED = 'Declined'
Expand Down
10 changes: 5 additions & 5 deletions strr-web/lang/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,24 +64,24 @@
"statuses": {
"examinerStatuses": {
"paid": "Paid",
"autoApproved": "Approved - Automatic",
"provisionalApproved": "Approved - Provisional",
"autoApproved": "Approved \u2013 Automatic",
"provisionalApproved": "Approved \u2013 Provisional",
"provisionalReview": "Provisional Examination",
"fullReviewApproved": "Approved - Examined",
"fullReviewApproved": "Approved \u2013 Examined",
"fullReview": "Full Examination"
},
"hostStatuses": {
"paid": "Pending Approval",
"autoApproved": "Approved",
"provisionalApproved": "Approved",
"provisionalReview": "Approved - Provisional",
"provisionalReview": "Approved \u2013 Provisional",
"fullReviewApproved": "Approved",
"fullReview": "Pending Approval"
},
"draft": "Draft",
"paymentDue": "Payment Due",
"declined": "Declined",
"additionalInfoRequested": "ADDITIONAL INFO REQUESTED",
"additionalInfoRequested": "Additional Info Requested",
"active": "Active",
"expired": "Expired",
"suspended": "Suspended",
Expand Down
2 changes: 1 addition & 1 deletion strr-web/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "strr-web",
"version": "0.1.30",
"version": "0.1.31",
"description": "Short Term Rental Registration UI - Mono repo workspace",
"scripts": {
"preinstall": "npx only-allow pnpm",
Expand Down

0 comments on commit 31c6282

Please sign in to comment.