Skip to content

Commit d8991f6

Browse files
authored
Merge pull request #869 from stevenc987/main
31897-FIX: WAIT TIME, Estimated Review Time
2 parents f544cf1 + 82e674b commit d8991f6

3 files changed

Lines changed: 31 additions & 3 deletions

File tree

app/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "name-request",
3-
"version": "5.9.0",
3+
"version": "5.9.1",
44
"private": true,
55
"engines": {
66
"node": ">=24"

app/src/components/existing-request/existing-request-display.vue

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -200,10 +200,10 @@
200200
v-bind="attrs"
201201
class="dotted-underline app-blue font-weight-regular cursor-default"
202202
v-on="on"
203-
>{{ getRegularWaitTime }}</span>
203+
>{{ getRegularEstimateReviewDate }}</span>
204204
</template>
205205
This is an estimate only, actual review date may vary. Staff are
206-
currently reviewing Name Requests submitted on {{ getRegularWaitTime }}.
206+
currently reviewing Name Requests submitted on {{ getRegularEstimateReviewDate.split(" (")[0] }}.
207207
</v-tooltip>
208208
</v-col>
209209

@@ -369,6 +369,7 @@ export default class ExistingRequestDisplay extends Mixins(
369369
@Getter(useStore) getNrId!: number
370370
@Getter(useStore) getNrState!: NrState
371371
@Getter(useStore) getRegularWaitTime!: string | number
372+
@Getter(useStore) getRegularEstimateReviewDate!: string
372373
@Getter(useStore) isMobile!: boolean
373374
374375
@Action(useStore) editExistingRequest!: ActionBindingIF

app/src/store/getters.ts

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1332,3 +1332,30 @@ export const getRegularWaitTime = (state: StateIF): string | number => {
13321332
if (statVal > 0) return statVal
13331333
return '-'
13341334
}
1335+
1336+
function formatDate(statVal: number): string {
1337+
const today = new Date();
1338+
const result = new Date(today);
1339+
1340+
result.setDate(today.getDate() + statVal);
1341+
const formatted = result.toLocaleDateString('en-CA', {
1342+
year: 'numeric',
1343+
month: 'long',
1344+
day: 'numeric'
1345+
});
1346+
if (statVal > 1) {
1347+
return formatted + " (" + statVal + " days)"
1348+
} else {
1349+
return formatted + " (" + statVal + " day)"
1350+
}
1351+
}
1352+
1353+
export const getRegularEstimateReviewDate = (state: StateIF): string => {
1354+
const flagVal = GetFeatureFlag('hardcoded_regular_wait_time')
1355+
if (flagVal > 0) return formatDate(flagVal)
1356+
if (flagVal < 0) return '-'
1357+
1358+
const statVal = getStats(state)?.regular_wait_time
1359+
if (statVal > 0) return formatDate(statVal)
1360+
return '-'
1361+
}

0 commit comments

Comments
 (0)