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
2 changes: 1 addition & 1 deletion app/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "name-request",
"version": "5.6.0",
"version": "5.6.0a",
"private": true,
"appName": "Name Request UI",
"sbcName": "SBC Common Components",
Expand Down
61 changes: 45 additions & 16 deletions app/src/components/new-request/stats.vue
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
nudge-left="45"
content-class="bottom-tooltip wait-time-tooltip"
transition="fade-transition"
:disabled="isMobile"
:disabled="isMobile || !showPriorityTooltip"
>
<template #activator="{ on }">
<div
Expand All @@ -46,7 +46,8 @@
</template>
<span>
If you need your name reviewed as quickly as possible, Priority requests
are available for a fee ($100.00).
are available for a fee ($100.00). Priority name requests are usually
reviewed within 1 to 2 business days.
</span>
</v-tooltip>
</v-col>
Expand All @@ -60,7 +61,7 @@
nudge-left="45"
content-class="bottom-tooltip new-submission-wait-time-tooltip"
transition="fade-transition"
:disabled="isMobile"
:disabled="isMobile || !showRegularTooltip"
>
<template #activator="{ on }">
<div
Expand Down Expand Up @@ -112,8 +113,8 @@ export default class Stats extends Vue {

async created (): Promise<void> {
if (
GetFeatureFlag('hardcoded_regular_wait_time') === 0 ||
GetFeatureFlag('hardcoded_priority_wait_time') === 0
GetFeatureFlag('hardcoded_regular_wait_time') < 0 ||
GetFeatureFlag('hardcoded_priority_wait_time') < 0
) {
const stats = await NamexServices.fetchStats()
if (stats) this.setStats(stats)
Expand All @@ -126,22 +127,50 @@ export default class Stats extends Vue {

/** The regular wait time, in days. */
get regularWaitTime (): string | number {
const regularWaitTime = GetFeatureFlag('hardcoded_regular_wait_time')
if (regularWaitTime > 0) {
return regularWaitTime
} else {
return (this.getStats?.regular_wait_time ?? '-')
const flagRaw = GetFeatureFlag('hardcoded_regular_wait_time')
Copy link
Collaborator

Choose a reason for hiding this comment

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

Remember to update the check in created() (lines 116-117) so that the API stats are fetched if the FF is < 0 (ie, if it's -1 then we fetch from API).

const flagVal = Number(flagRaw)

if (Number.isFinite(flagVal)) {
if (flagVal > 0) return flagVal
if (flagVal === 0) return '-'
}

const statVal = this.getStats?.regular_wait_time
const statNum = Number(statVal)
if (Number.isFinite(statNum) && statNum > 0) {
return statNum
}

return '-'
}

/** The priority wait time, in hours. */
/** The priority wait time, in days. */
get priorityWaitTime (): string | number {
const priorityWaitTime = GetFeatureFlag('hardcoded_priority_wait_time')
if (priorityWaitTime > 0) {
return priorityWaitTime
} else {
return (this.getStats?.priority_wait_time ?? '-')
const flagRaw = GetFeatureFlag('hardcoded_priority_wait_time')
const flagVal = Number(flagRaw)

if (Number.isFinite(flagVal)) {
if (flagVal > 0) return flagVal
if (flagVal === 0) return '-'
}

const statVal = this.getStats?.priority_wait_time
const statNum = Number(statVal)
if (Number.isFinite(statNum) && statNum > 0) {
return statNum
}

return '-'
}

get showRegularTooltip (): boolean {
const val = Number(this.regularWaitTime)
return Number.isFinite(val) && val > 0
}

get showPriorityTooltip (): boolean {
const val = Number(this.priorityWaitTime)
return Number.isFinite(val) && val > 0
}
}
</script>
Expand Down
Loading