Skip to content
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

fix(dashboard filters): add "previous quarter" as option #30506

Open
wants to merge 28 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
001d61e
Added previous quarter to date filer
personofnorank Oct 3, 2024
1383614
Added previous quarter logic to custom frame
personofnorank Oct 3, 2024
06124a4
Added previous quarter logic to custom frame
personofnorank Oct 3, 2024
aa31f1a
Fixed bug in quarter variable declaration
personofnorank Oct 3, 2024
5246b5a
Fixed unexpected lexical declaration in case block
personofnorank Oct 3, 2024
8614cc7
Updated previous quarter language in response to feedback from @micha…
personofnorank Oct 3, 2024
13db748
Added unit test for previous calendar quarter filter
personofnorank Oct 3, 2024
d1f8921
Fixed syntax error
personofnorank Oct 4, 2024
962c51c
Added previous quarter coverage to getTimeOffset.test.ts
personofnorank Oct 4, 2024
392cd0c
Deleted two spaces as required by prettier
personofnorank Oct 4, 2024
13c8ffa
get_since_until should return two dates not one
personofnorank Oct 4, 2024
30e2e2d
get_since_until should return two dates not one
personofnorank Oct 4, 2024
c36bdb8
Prettier/lint fixes
personofnorank Oct 4, 2024
83e411e
Removed trailing whitespace
personofnorank Oct 7, 2024
7333ffe
Removed trailing whitespace
personofnorank Oct 7, 2024
ced2a80
removed unnecessary 'else' after 'return'
personofnorank Oct 9, 2024
f7f5177
hopefully made Prettier happy by using vim-prettier to edit
personofnorank Oct 9, 2024
8846476
Using correct methods to set date
personofnorank Oct 10, 2024
3f6d97b
Replaced previous calendar quarter tests with suggestion from @michae…
personofnorank Oct 10, 2024
7c854df
Fixed missing declaration in test
personofnorank Oct 10, 2024
2f6e28b
fixed typo in tests
personofnorank Oct 17, 2024
f638353
Added previous quarter range to date_parser.py
personofnorank Oct 17, 2024
8fab40e
Aligned date parser tests with date parser logic
personofnorank Oct 17, 2024
bc154da
Corrected syntax for getTimeOffset in getTimeOffset.test.ts
personofnorank Oct 18, 2024
28d7f43
comparator syntax
personofnorank Oct 18, 2024
7cd7f4d
fixed wrong assignment types in getTimeOffset
personofnorank Oct 18, 2024
f506ec2
timeRangeFilter
personofnorank Oct 19, 2024
8bab026
Same test for pcq as for other date ranges
personofnorank Oct 19, 2024
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
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,10 @@ export const parseDttmToDate = (
now.setMonth(now.getMonth() - 1);
}
return now;
case 'previous quarter':
personofnorank marked this conversation as resolved.
Show resolved Hide resolved
quarter = Math.floor(now.getMonth() / 3);
now.setDate(now.getFullYear(), quarter * 3 - 3, 1);
return now;
case 'previous calendar year':
if (isEndDate) {
now.setFullYear(now.getFullYear(), 0, 1); // end date is the last day of the previous year
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,12 @@ export type CommonRangeType =

export const PreviousCalendarWeek = 'previous calendar week';
export const PreviousCalendarMonth = 'previous calendar month';
export const PreviousQuarter = 'previous quarter';
personofnorank marked this conversation as resolved.
Show resolved Hide resolved
export const PreviousCalendarYear = 'previous calendar year';
export type CalendarRangeType =
| typeof PreviousCalendarWeek
| typeof PreviousCalendarMonth
| typeof PreviousQuarter
| typeof PreviousCalendarYear;

export const CurrentDay = 'Current day';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import {
SelectOptionType,
PreviousCalendarWeek,
PreviousCalendarMonth,
PreviousQuarter,
PreviousCalendarYear,
CommonRangeType,
CalendarRangeType,
Expand Down Expand Up @@ -56,6 +57,7 @@ export const COMMON_RANGE_VALUES_SET = new Set(
export const CALENDAR_RANGE_OPTIONS: SelectOptionType[] = [
{ value: PreviousCalendarWeek, label: t('previous calendar week') },
{ value: PreviousCalendarMonth, label: t('previous calendar month') },
{ value: PreviousQuarter, label: t('previous quarter') },
{ value: PreviousCalendarYear, label: t('previous calendar year') },
];
export const CALENDAR_RANGE_VALUES_SET = new Set(
Expand Down Expand Up @@ -119,6 +121,7 @@ export const COMMON_RANGE_SET: Set<CommonRangeType> = new Set([
export const CALENDAR_RANGE_SET: Set<CalendarRangeType> = new Set([
PreviousCalendarWeek,
PreviousCalendarMonth,
PreviousQuarter,
PreviousCalendarYear,
]);

Expand Down