From 87a7b31a3147cd027964df1555d033f24f551927 Mon Sep 17 00:00:00 2001 From: Nate Kelley Date: Mon, 12 May 2025 09:58:28 -0600 Subject: [PATCH] fix cookies clearout --- web/package-lock.json | 108 +++++++++--------- web/package.json | 18 +-- .../bar-chart-navigation.spec.ts | 44 +++---- .../components/features/auth/LoginForm.tsx | 4 +- 4 files changed, 88 insertions(+), 86 deletions(-) diff --git a/web/package-lock.json b/web/package-lock.json index 125dba479..6e13a552b 100644 --- a/web/package-lock.json +++ b/web/package-lock.json @@ -30,11 +30,11 @@ "@radix-ui/react-tooltip": "^1.2.6", "@supabase/ssr": "^0.6.1", "@supabase/supabase-js": "^2.49.4", - "@tanstack/query-sync-storage-persister": "^5.75.7", - "@tanstack/react-form": "^1.11.0", - "@tanstack/react-query": "^5.75.7", - "@tanstack/react-query-devtools": "^5.75.7", - "@tanstack/react-query-persist-client": "^5.75.7", + "@tanstack/query-sync-storage-persister": "^5.76.0", + "@tanstack/react-form": "^1.11.1", + "@tanstack/react-query": "^5.76.0", + "@tanstack/react-query-devtools": "^5.76.0", + "@tanstack/react-query-persist-client": "^5.76.0", "@tanstack/react-table": "^8.21.3", "@tanstack/react-virtual": "^3.13.8", "@types/jest": "^29.5.14", @@ -53,7 +53,7 @@ "dom-to-image": "^2.6.0", "email-validator": "^2.0.4", "font-color-contrast": "^11.1.0", - "framer-motion": "^12.10.5", + "framer-motion": "^12.11.0", "intersection-observer": "^0.12.2", "jest": "^29.7.0", "jest-environment-jsdom": "^29.7.0", @@ -68,7 +68,7 @@ "next-themes": "^0.4.6", "papaparse": "^5.5.2", "pluralize": "^8.0.0", - "posthog-js": "^1.240.5", + "posthog-js": "^1.240.6", "prettier": "^3.5.3", "prettier-plugin-tailwindcss": "^0.6.11", "react": "^18", @@ -82,7 +82,7 @@ "rehype-raw": "^7.0.0", "remark-gfm": "^4.0.1", "sonner": "^2.0.3", - "tailwind-merge": "^3.2.0", + "tailwind-merge": "^3.3.0", "ts-jest": "^29.3.2", "use-context-selector": "^2.0.0", "utility-types": "^3.11.0", @@ -122,7 +122,7 @@ "eslint-config-prettier": "^10.1.5", "eslint-plugin-storybook": "^0.12.0", "msw-storybook-addon": "^2.0.4", - "sass": "^1.87.0", + "sass": "^1.88.0", "tailwind-scrollbar": "^4.0.2", "tailwindcss": "4.1.6", "tailwindcss-animate": "^1.0.7", @@ -6815,9 +6815,9 @@ } }, "node_modules/@tanstack/query-core": { - "version": "5.75.7", - "resolved": "https://registry.npmjs.org/@tanstack/query-core/-/query-core-5.75.7.tgz", - "integrity": "sha512-4BHu0qnxUHOSnTn3ow9fIoBKTelh0GY08yn1IO9cxjBTsGvnxz1ut42CHZqUE3Vl/8FAjcHsj8RNJMoXvjgHEA==", + "version": "5.76.0", + "resolved": "https://registry.npmjs.org/@tanstack/query-core/-/query-core-5.76.0.tgz", + "integrity": "sha512-FN375hb8ctzfNAlex5gHI6+WDXTNpe0nbxp/d2YJtnP+IBM6OUm7zcaoCW6T63BawGOYZBbKC0iPvr41TteNVg==", "license": "MIT", "funding": { "type": "github", @@ -6825,9 +6825,9 @@ } }, "node_modules/@tanstack/query-devtools": { - "version": "5.74.7", - "resolved": "https://registry.npmjs.org/@tanstack/query-devtools/-/query-devtools-5.74.7.tgz", - "integrity": "sha512-nSNlfuGdnHf4yB0S+BoNYOE1o3oAH093weAYZolIHfS2stulyA/gWfSk/9H4ZFk5mAAHb5vNqAeJOmbdcGPEQw==", + "version": "5.76.0", + "resolved": "https://registry.npmjs.org/@tanstack/query-devtools/-/query-devtools-5.76.0.tgz", + "integrity": "sha512-1p92nqOBPYVqVDU0Ua5nzHenC6EGZNrLnB2OZphYw8CNA1exuvI97FVgIKON7Uug3uQqvH/QY8suUKpQo8qHNQ==", "license": "MIT", "funding": { "type": "github", @@ -6835,12 +6835,12 @@ } }, "node_modules/@tanstack/query-persist-client-core": { - "version": "5.75.7", - "resolved": "https://registry.npmjs.org/@tanstack/query-persist-client-core/-/query-persist-client-core-5.75.7.tgz", - "integrity": "sha512-VI6gYsw9TOGd62n9fKrC7gdp0rvxjF7rf5l/9U+QWm0GcjO0MdBt3VMCp4pyVHJKlz4H89N7jKp6svDPLRDXLg==", + "version": "5.76.0", + "resolved": "https://registry.npmjs.org/@tanstack/query-persist-client-core/-/query-persist-client-core-5.76.0.tgz", + "integrity": "sha512-xcTZjILf4q49Nsl6wcnhBYZ4O0gpnuNwV6vPIEWIrwTuSNWz2zd/g9bc8SxnXy7xCV8SM1H0IJn8KjLQIUb2ag==", "license": "MIT", "dependencies": { - "@tanstack/query-core": "5.75.7" + "@tanstack/query-core": "5.76.0" }, "funding": { "type": "github", @@ -6848,13 +6848,13 @@ } }, "node_modules/@tanstack/query-sync-storage-persister": { - "version": "5.75.7", - "resolved": "https://registry.npmjs.org/@tanstack/query-sync-storage-persister/-/query-sync-storage-persister-5.75.7.tgz", - "integrity": "sha512-jJGhyf5KzMZQCGCNwEAxL/wE+ptlgiGdZhsBHqVHaI39i6xmVeYxhi/S1c2kB6ii7kYSkU7doWtplB8IHexW0w==", + "version": "5.76.0", + "resolved": "https://registry.npmjs.org/@tanstack/query-sync-storage-persister/-/query-sync-storage-persister-5.76.0.tgz", + "integrity": "sha512-N8d8voY61XkM+jfXTySduLrevD6wRM3pwQ1kG0syLiWWx/sX2+CpaTMSPr0GggjQuhmjhUPo83LaV+e449tizA==", "license": "MIT", "dependencies": { - "@tanstack/query-core": "5.75.7", - "@tanstack/query-persist-client-core": "5.75.7" + "@tanstack/query-core": "5.76.0", + "@tanstack/query-persist-client-core": "5.76.0" }, "funding": { "type": "github", @@ -6909,12 +6909,12 @@ } }, "node_modules/@tanstack/react-query": { - "version": "5.75.7", - "resolved": "https://registry.npmjs.org/@tanstack/react-query/-/react-query-5.75.7.tgz", - "integrity": "sha512-JYcH1g5pNjKXNQcvvnCU/PueaYg05uKBDHlWIyApspv7r5C0BM12n6ysa2QF2T+1tlPnNXOob8vr8o96Nx0GxQ==", + "version": "5.76.0", + "resolved": "https://registry.npmjs.org/@tanstack/react-query/-/react-query-5.76.0.tgz", + "integrity": "sha512-dZLYzVuUFZJkenxd8o01oyFimeLBmSkaUviPHuDzXe7LSLO4WTTx92jwJlNUXOOHzg6t0XknklZ15cjhYNSDjA==", "license": "MIT", "dependencies": { - "@tanstack/query-core": "5.75.7" + "@tanstack/query-core": "5.76.0" }, "funding": { "type": "github", @@ -6925,36 +6925,36 @@ } }, "node_modules/@tanstack/react-query-devtools": { - "version": "5.75.7", - "resolved": "https://registry.npmjs.org/@tanstack/react-query-devtools/-/react-query-devtools-5.75.7.tgz", - "integrity": "sha512-VUzHvxcUAz7oSeX/TlVyDgNxajLAF+b12Z3OfSxCrAdWynELfWohwzCn1iT2NEjnGTb3X3ryzQxeWuWMyMwCmQ==", + "version": "5.76.0", + "resolved": "https://registry.npmjs.org/@tanstack/react-query-devtools/-/react-query-devtools-5.76.0.tgz", + "integrity": "sha512-RoyRzH5XJB//OhAdzQTutesw9uHyNZroLp/I7NDAQf8OVJKTTcoaYBmaw5pmB2e3bVdgqFu6nHFZUr5j5qBdZw==", "license": "MIT", "dependencies": { - "@tanstack/query-devtools": "5.74.7" + "@tanstack/query-devtools": "5.76.0" }, "funding": { "type": "github", "url": "https://github.com/sponsors/tannerlinsley" }, "peerDependencies": { - "@tanstack/react-query": "^5.75.7", + "@tanstack/react-query": "^5.76.0", "react": "^18 || ^19" } }, "node_modules/@tanstack/react-query-persist-client": { - "version": "5.75.7", - "resolved": "https://registry.npmjs.org/@tanstack/react-query-persist-client/-/react-query-persist-client-5.75.7.tgz", - "integrity": "sha512-DJ52g5NVoTja5aSTuhWDDGl2GDODIPPqKI0awowNxzUlsNCPxvEF2p8mkyb6Dsuo/T5OjLSeDjZTgk003DVBWQ==", + "version": "5.76.0", + "resolved": "https://registry.npmjs.org/@tanstack/react-query-persist-client/-/react-query-persist-client-5.76.0.tgz", + "integrity": "sha512-QPKgkHX1yC1Ec21FTQHBTbQcHYI+6157DgsmxABp94H7/ZUJ3szZ7wdpdBPQyZ9VxBXlKRN+aNZkOPC90+r/uA==", "license": "MIT", "dependencies": { - "@tanstack/query-persist-client-core": "5.75.7" + "@tanstack/query-persist-client-core": "5.76.0" }, "funding": { "type": "github", "url": "https://github.com/sponsors/tannerlinsley" }, "peerDependencies": { - "@tanstack/react-query": "^5.75.7", + "@tanstack/react-query": "^5.76.0", "react": "^18 || ^19" } }, @@ -12332,12 +12332,12 @@ } }, "node_modules/framer-motion": { - "version": "12.10.5", - "resolved": "https://registry.npmjs.org/framer-motion/-/framer-motion-12.10.5.tgz", - "integrity": "sha512-p6VF1YkwWvNDFzg5IQ5lqPx11Td4TQ6LqDnshV7sWj0Nrp4dwz2/aEzmgh9WA9ridcTIJ625Fr0oiuhgqIoFwQ==", + "version": "12.11.0", + "resolved": "https://registry.npmjs.org/framer-motion/-/framer-motion-12.11.0.tgz", + "integrity": "sha512-BaBPmkhaC2l0n619Kt1nQaxSdUdyyz5V1Z7EKJ1CcraOTZitgVx0RTbL8lmg2XesaFi6o8MPBIhkWDIvzDpGaQ==", "license": "MIT", "dependencies": { - "motion-dom": "^12.10.5", + "motion-dom": "^12.11.0", "motion-utils": "^12.9.4", "tslib": "^2.4.0" }, @@ -16916,9 +16916,9 @@ } }, "node_modules/motion-dom": { - "version": "12.10.5", - "resolved": "https://registry.npmjs.org/motion-dom/-/motion-dom-12.10.5.tgz", - "integrity": "sha512-F7XKmhxXEH/y3aWWf0N2w69wNSN+6PcJ1seqR1WolClmXpPhj+xwzs9j5CpsMFzeHR1D7irl3JcWMToPRwX6Hg==", + "version": "12.11.0", + "resolved": "https://registry.npmjs.org/motion-dom/-/motion-dom-12.11.0.tgz", + "integrity": "sha512-CItkGYJenn5ZsbzTX0D9mE0UWdjdd9r535FrxEXhzR8Kwa9I2dLr1uhEJgQPWbgaIJ6i0sNFnf2T9NvVDWQVBw==", "license": "MIT", "dependencies": { "motion-utils": "^12.9.4" @@ -18148,9 +18148,9 @@ "license": "MIT" }, "node_modules/posthog-js": { - "version": "1.240.5", - "resolved": "https://registry.npmjs.org/posthog-js/-/posthog-js-1.240.5.tgz", - "integrity": "sha512-sLaDiN0TrGQnF94ed85wo044ifJ5U9rBlIVe5rueLUtusE2Gc/Vis7VcHOjbBeAaJXCHwOcs/TUZZNxbRGzNgw==", + "version": "1.240.6", + "resolved": "https://registry.npmjs.org/posthog-js/-/posthog-js-1.240.6.tgz", + "integrity": "sha512-Pz5r/LrMchGf9jCVnTXJrbyMhKriZRGLSZ5qt8c8QrPkmG2JOnFHNWmmBlu+iqmzbY3+oROrhwyP4IgQl2z34w==", "license": "SEE LICENSE IN LICENSE", "dependencies": { "core-js": "^3.38.1", @@ -19598,9 +19598,9 @@ "license": "MIT" }, "node_modules/sass": { - "version": "1.87.0", - "resolved": "https://registry.npmjs.org/sass/-/sass-1.87.0.tgz", - "integrity": "sha512-d0NoFH4v6SjEK7BoX810Jsrhj7IQSYHAHLi/iSpgqKc7LaIDshFRlSg5LOymf9FqQhxEHs2W5ZQXlvy0KD45Uw==", + "version": "1.88.0", + "resolved": "https://registry.npmjs.org/sass/-/sass-1.88.0.tgz", + "integrity": "sha512-sF6TWQqjFvr4JILXzG4ucGOLELkESHL+I5QJhh7CNaE+Yge0SI+ehCatsXhJ7ymU1hAFcIS3/PBpjdIbXoyVbg==", "devOptional": true, "license": "MIT", "dependencies": { @@ -20633,9 +20633,9 @@ "license": "MIT" }, "node_modules/tailwind-merge": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/tailwind-merge/-/tailwind-merge-3.2.0.tgz", - "integrity": "sha512-FQT/OVqCD+7edmmJpsgCsY820RTD5AkBryuG5IUqR5YQZSdj5xlH5nLgH7YPths7WsLPSpSBNneJdM8aS8aeFA==", + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/tailwind-merge/-/tailwind-merge-3.3.0.tgz", + "integrity": "sha512-fyW/pEfcQSiigd5SNn0nApUOxx0zB/dm6UDU/rEwc2c3sX2smWUNbapHv+QRqLGVp9GWX3THIa7MUGPo+YkDzQ==", "license": "MIT", "funding": { "type": "github", diff --git a/web/package.json b/web/package.json index 83db85399..67d234f06 100644 --- a/web/package.json +++ b/web/package.json @@ -42,11 +42,11 @@ "@radix-ui/react-tooltip": "^1.2.6", "@supabase/ssr": "^0.6.1", "@supabase/supabase-js": "^2.49.4", - "@tanstack/query-sync-storage-persister": "^5.75.7", - "@tanstack/react-form": "^1.11.0", - "@tanstack/react-query": "^5.75.7", - "@tanstack/react-query-devtools": "^5.75.7", - "@tanstack/react-query-persist-client": "^5.75.7", + "@tanstack/query-sync-storage-persister": "^5.76.0", + "@tanstack/react-form": "^1.11.1", + "@tanstack/react-query": "^5.76.0", + "@tanstack/react-query-devtools": "^5.76.0", + "@tanstack/react-query-persist-client": "^5.76.0", "@tanstack/react-table": "^8.21.3", "@tanstack/react-virtual": "^3.13.8", "@types/jest": "^29.5.14", @@ -65,7 +65,7 @@ "dom-to-image": "^2.6.0", "email-validator": "^2.0.4", "font-color-contrast": "^11.1.0", - "framer-motion": "^12.10.5", + "framer-motion": "^12.11.0", "intersection-observer": "^0.12.2", "jest": "^29.7.0", "jest-environment-jsdom": "^29.7.0", @@ -80,7 +80,7 @@ "next-themes": "^0.4.6", "papaparse": "^5.5.2", "pluralize": "^8.0.0", - "posthog-js": "^1.240.5", + "posthog-js": "^1.240.6", "prettier": "^3.5.3", "prettier-plugin-tailwindcss": "^0.6.11", "react": "^18", @@ -94,7 +94,7 @@ "rehype-raw": "^7.0.0", "remark-gfm": "^4.0.1", "sonner": "^2.0.3", - "tailwind-merge": "^3.2.0", + "tailwind-merge": "^3.3.0", "ts-jest": "^29.3.2", "use-context-selector": "^2.0.0", "utility-types": "^3.11.0", @@ -134,7 +134,7 @@ "eslint-config-prettier": "^10.1.5", "eslint-plugin-storybook": "^0.12.0", "msw-storybook-addon": "^2.0.4", - "sass": "^1.87.0", + "sass": "^1.88.0", "tailwind-scrollbar": "^4.0.2", "tailwindcss": "4.1.6", "tailwindcss-animate": "^1.0.7", diff --git a/web/playwright-tests/bar-chart-navigation.spec.ts b/web/playwright-tests/bar-chart-navigation.spec.ts index d7732e1a0..06e82f990 100644 --- a/web/playwright-tests/bar-chart-navigation.spec.ts +++ b/web/playwright-tests/bar-chart-navigation.spec.ts @@ -71,7 +71,10 @@ test('Can open sql editor', async ({ page }) => { await page.goto('http://localhost:3000/app/metrics/45c17750-2b61-5683-ba8d-ff6c6fefacee/chart'); await expect(page.getByTestId('segmented-trigger-sql')).toBeVisible(); await page.getByTestId('segmented-trigger-sql').click(); - await page.goto('http://localhost:3000/app/metrics/45c17750-2b61-5683-ba8d-ff6c6fefacee/sql'); + await page.waitForTimeout(55); + await page.waitForLoadState('networkidle'); + await page.waitForLoadState('domcontentloaded'); + await page.waitForLoadState('load'); await expect(page.getByRole('button', { name: 'Run' })).toBeVisible(); await expect(page.getByTestId('segmented-trigger-sql')).toHaveAttribute('data-state', 'active'); }); @@ -105,24 +108,23 @@ test('Bar chart span clicking works', async ({ page }) => { await page.getByTestId('edit-chart-button').getByRole('button').click(); await expect(page.getByText('Edit chart')).toBeVisible({ timeout: 15000 }); - await page - .locator('div') - .filter({ hasText: /^Edit chart$/ }) - .getByRole('button') - .click(); - await page.waitForTimeout(55); - await page.getByTestId('edit-chart-button').getByRole('button').click(); - await page.waitForTimeout(55); - await page - .locator('div') - .filter({ hasText: /^Edit chart$/ }) - .getByRole('button') - .click(); - await page.getByTestId('edit-chart-button').getByRole('button').click(); - await page.waitForTimeout(55); - await page - .locator('div') - .filter({ hasText: /^Edit chart$/ }) - .getByRole('button') - .click(); +}); + +test('Can navigate to bar chart from favorites', async ({ page }) => { + await page.goto('http://localhost:3000/app/metrics/45c17750-2b61-5683-ba8d-ff6c6fefacee/chart'); + await page.getByTestId('three-dot-menu-button').click(); + await expect(page.getByText('Add to favorites')).toBeVisible(); + await page.getByRole('menuitem', { name: 'Add to favorites' }).click(); + await expect(page.getByRole('link', { name: 'Yearly Sales Revenue -' })).toBeVisible(); + await page.getByRole('link', { name: 'Home' }).click(); + await page.reload(); + await page.waitForTimeout(55); + await page.waitForLoadState('networkidle'); + await page.waitForLoadState('domcontentloaded'); + await page.waitForLoadState('load'); + await page.getByRole('link', { name: 'Yearly Sales Revenue -' }).click(); + await expect(page.getByTestId('metric-view-chart-content')).toBeVisible(); + await page.getByRole('link', { name: 'Yearly Sales Revenue -' }).getByRole('button').click(); + await page.waitForTimeout(55); + await page.waitForLoadState('networkidle'); }); diff --git a/web/src/components/features/auth/LoginForm.tsx b/web/src/components/features/auth/LoginForm.tsx index de3cd3c3d..c3e3a1baa 100644 --- a/web/src/components/features/auth/LoginForm.tsx +++ b/web/src/components/features/auth/LoginForm.tsx @@ -188,7 +188,6 @@ const LoginOptions: React.FC<{ }); const onSubmitClickPreflight = useMemoizedFn(async (d: { email: string; password: string }) => { - clearAllCookies(); onSubmitClick(d); }); @@ -256,7 +255,8 @@ const LoginOptions: React.FC<{ className="space-y-3" onSubmit={(v) => { v.preventDefault(); - onSubmitClickPreflight({ + clearAllCookies(); + onSubmitClick({ email, password });