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
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
## Friday, April 11th, 2025

### Fixed

- Fixed submission timestamp filter calculations for Looker dashboards so that any dates in the future won't be showing null data

## Thursday, April 10th, 2025

### Added
Expand Down
2 changes: 1 addition & 1 deletion __tests__/lib/lookerUtils.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ describe("getLookerSubmissionTimestampDateFilter", () => {

const result = getLookerSubmissionTimestampDateFilter(startDate, endDate);

expect(result).toEqual("2024-05-08 to 3024-06-10");
expect(result).toEqual("2024-05-08 to today");
});

it("returns a date filter from the startDate to endDate when startDate and endDate are defined and the message is completed", () => {
Expand Down
5 changes: 3 additions & 2 deletions __tests__/lib/messageUtils.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -142,9 +142,10 @@ describe("getDashboard", () => {
const template = "feature_callout";
Copy link
Member

Choose a reason for hiding this comment

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

Nit: how about clarifying that the expected result here is today?

const msgId = "a:bc"; // weird chars to test URI encoding
const startDate = "2024-03-08";
const endDate = "2025-06-28";
const endDate = "3025-06-28";
const dashboardId = getDashboardIdForTemplate(template);
const submissionDate = "2024-03-08 to 2025-06-28";
// The end date should be today to avoid showing null data for dates in the future
const submissionDate = "2024-03-08 to today";

const result = getDashboard(
template,
Expand Down
4 changes: 2 additions & 2 deletions app/columns.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,12 @@ function OffsiteLink(href: string, linkText: any) {
return (
<a
href={href}
className="text-xs/[180%] whitespace-nowrap flex flex-row items-center gap-x-1"
className="text-xs/[180%] whitespace-nowrap"
target="_blank"
rel="noreferrer"
>
{linkText}
<SquareArrowOutUpRight size={10} />
<SquareArrowOutUpRight size={10} className="inline ml-1" />
</a>
);
}
Expand Down
16 changes: 5 additions & 11 deletions lib/lookerUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,19 +41,13 @@ export function getLookerSubmissionTimestampDateFilter(
): string {
if (isCompleted && startDate && endDate) {
// This case covers completed experiments with defined startDate and
// endDate from the Experimenter API.
return `${startDate} to ${endDate}`;
} else if (
!isCompleted &&
startDate &&
endDate &&
new Date() < new Date(endDate)
) {
// This case covers experiments that haven't reached their proposed end date.
// endDate from the Experimenter API, with the endDate being today or earlier.
return `${startDate} to ${endDate}`;
} else if (startDate) {
// This case covers experiments that are still ongoing past their proposed
// end date.
// This case covers experiments that haven't reached their proposed end date.
// This case also covers experiments that are still ongoing past their proposed
// to prevent issues with the Looker dashboards showing no data for to dates in
// the future.
return `${startDate} to today`;
} else {
// This case covers any messages with undefined startDate and endDate.
Expand Down