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 src/engineering_platform/assets/dashboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -5845,6 +5845,12 @@ function initializeNoProjectSelectedBanner() {
banner.hidden = true;
try { localStorage.setItem(noProjectDismissalStorageKey, "true"); } catch {}
});
$("dashboardProject")?.addEventListener("change", (event) => {
// Choosing the explicit global/no-project context is a fresh operator
// choice, rather than a continuation of a formerly dismissed notice.
if (event.currentTarget.value !== "") return;
try { localStorage.removeItem(noProjectDismissalStorageKey); } catch {}
});
}
initializeNoProjectSelectedBanner();
applyDashboardLocale();
Expand Down
13 changes: 13 additions & 0 deletions tests/engineering/dashboard.spec.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,19 @@ test("dismisses the no-project banner for the current browser", async ({ page })
await expect(banner).toBeHidden();
});

test("shows the no-project banner again after explicitly choosing no project", async ({ page }) => {
const noProjectUrl = new URL(dashboardUrl);
noProjectUrl.search = "";
await page.goto(noProjectUrl.href, { waitUntil: "domcontentloaded" });
const banner = page.getByTestId("no-project-selected");
await page.locator("#noProjectSelectedDismiss").click();
await expect(banner).toBeHidden();
const navigation = page.waitForNavigation({ waitUntil: "domcontentloaded" });
await page.locator("#dashboardProject").dispatchEvent("change");
await navigation;
await expect(banner).toBeVisible();
});

test.afterAll(async () => {
if (dashboard && dashboard.exitCode === null && dashboard.signalCode === null) {
const exited = new Promise((resolve) => dashboard.once("exit", resolve));
Expand Down
Loading