-
Notifications
You must be signed in to change notification settings - Fork 48
31112 define disabled wait time and change priority wait time to Days #851
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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 | ||
|
|
@@ -35,7 +35,7 @@ | |
| {{ priorityWaitTime }} | ||
| </div> | ||
| <div class="stats-unit"> | ||
| Hours | ||
| Days | ||
| </div> | ||
| </div> | ||
| <div class="stats-content-inner-2"> | ||
|
|
@@ -61,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 | ||
|
|
@@ -111,11 +111,22 @@ export default class Stats extends Vue { | |
|
|
||
| async created (): Promise<void> { | ||
| if ( | ||
| /* | ||
| * Feature-flag semantics for hardcoded_*_wait_time: | ||
| * - flag > 0 : use the flag value (explicit positive wait time). | ||
| * - flag === 0 OR FF disabled: fall back to backend stats. | ||
| * - flag < 0 : flag indicates the wait time is disabled. | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Using the word "disabled" here again is confusing. How about saying "flag indicates API value should be used"? |
||
| */ | ||
| GetFeatureFlag('hardcoded_regular_wait_time') === 0 || | ||
| GetFeatureFlag('hardcoded_priority_wait_time') === 0 | ||
| ) { | ||
| const stats = await NamexServices.fetchStats() | ||
| if (stats) this.setStats(stats) | ||
| try { | ||
| const stats = await NamexServices.fetchStats() | ||
| console.info('[stats] fetched stats', stats) | ||
| if (stats) this.setStats(stats) | ||
| } catch (error) { | ||
| console.error('Error fetching stats:', error) | ||
| } | ||
| } | ||
| } | ||
|
|
||
|
|
@@ -125,22 +136,42 @@ 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 flagVal = GetFeatureFlag('hardcoded_regular_wait_time') | ||
|
|
||
| if (flagVal > 0) return flagVal | ||
| if (flagVal < 0) return '-' | ||
|
|
||
| const statVal = this.getStats?.regular_wait_time | ||
| if (statVal > 0) { | ||
| return statVal | ||
| } | ||
|
|
||
| return '-' | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah, this is simple and effective now 👍
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Question: do we ever want to display "0" on the page? The current code doesn't support that. |
||
| } | ||
|
|
||
| /** 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 flagVal = GetFeatureFlag('hardcoded_priority_wait_time') | ||
|
|
||
| if (flagVal > 0) return flagVal | ||
| if (flagVal < 0) return '-' | ||
|
|
||
| const statVal = this.getStats?.priority_wait_time | ||
| if (statVal > 0) { | ||
| return statVal | ||
| } | ||
|
|
||
| return '-' | ||
| } | ||
|
|
||
| get showRegularTooltip (): boolean { | ||
| const val = Number(this.regularWaitTime) | ||
| return Number.isFinite(val) && val > 0 | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| } | ||
|
|
||
| get showPriorityTooltip (): boolean { | ||
| const val = Number(this.priorityWaitTime) | ||
| return Number.isFinite(val) && val > 0 | ||
| } | ||
| } | ||
| </script> | ||
|
|
||

There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the FF is "disabled", it's still providing a value.
I think it makes sense for the "disabled" value to be 0. It's like that right now:
