Skip to content

Commit

Permalink
Updating UI label "Last Period" => "Previous Period" (#3621)
Browse files Browse the repository at this point in the history
  • Loading branch information
AdityaHegde authored Dec 5, 2023
1 parent e5273d9 commit 876dbe2
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 9 deletions.
2 changes: 1 addition & 1 deletion docs/docs/reference/rill-iso-extensions.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ We have extended the ISO 8601 standard to specify ranges like `Week-to-Date`.
| rill-QTD | Quarter to Date | Yes | No |
| rill-YTD | Year to Date | Yes | No |
| rill-YTD | Year to Date | Yes | No |
| rill-PP | Last Period | No | Yes |
| rill-PP | Previous Period | No | Yes |
| rill-PD | Previous Day | No | Yes |
| rill-PW | Previous Week | No | Yes |
| rill-PM | Previous Month | No | Yes |
Expand Down
2 changes: 1 addition & 1 deletion web-common/src/lib/time/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -412,7 +412,7 @@ export const TIME_GRAIN: Record<AvailableTimeGrain, TimeGrain> = {
/** The default configurations for time comparisons. */
export const TIME_COMPARISON = {
[TimeComparisonOption.CONTIGUOUS]: {
label: "Last period",
label: "Previous period",
shorthand: "prev. period",
description: "Compare the current time range to the previous time range",
comparisonType: TimeComparisonOption.CONTIGUOUS,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -168,9 +168,13 @@ available_time_ranges:
await page.getByLabel("Select time comparison option").click();
// Assert the options available
await Promise.all(
["Last Period", "Previous day", "Previous week", "Previous month"].map(
(label) =>
expect(page.getByRole("menuitem", { name: label })).toBeVisible()
[
"Previous Period",
"Previous day",
"Previous week",
"Previous month",
].map((label) =>
expect(page.getByRole("menuitem", { name: label })).toBeVisible()
)
);
// Select Previous week
Expand All @@ -195,12 +199,12 @@ available_time_ranges:
await page.getByLabel("Select time comparison option").click();
// Assert the options available
await Promise.all(
["Last Period", "Previous week"].map((label) =>
["Previous Period", "Previous week"].map((label) =>
expect(page.getByRole("menuitem", { name: label })).toBeVisible()
)
);
// Select Last 6 hours
await page.getByRole("menuitem", { name: "Last Period" }).click();
await page.getByRole("menuitem", { name: "Previous Period" }).click();
// Wait for time range menu to close
await expect(
page.getByRole("menu", { name: "Time comparison selector" })
Expand Down
4 changes: 2 additions & 2 deletions web-local/test/ui/dashboards.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -203,11 +203,11 @@ test.describe("dashboard", () => {
.click();

/*
There is a bug where if you programmatically click the Time Range Selector button right after clicking the "Last Period" menu item,
There is a bug where if you programmatically click the Time Range Selector button right after clicking the "Previous Period" menu item,
the comparison menu closes, the time range menu opens, and then the comparison menu opens again. You can reproduce with a script like this in console
after opening up comparison menu when "no comparison" is selected:
(() => {
document.evaluate("//button[contains(., 'last period')]", document, null, XPathResult.ANY_TYPE, null ).iterateNext().click();
document.evaluate("//button[contains(., 'previous period')]", document, null, XPathResult.ANY_TYPE, null ).iterateNext().click();
document.querySelector('[aria-label="Select time range"]').click();
})()
Expand Down

1 comment on commit 876dbe2

@github-actions
Copy link
Contributor

Choose a reason for hiding this comment

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

Please sign in to comment.