diff --git a/.eslintrc b/.eslintrc index 1b93a1aaa..e54b82667 100644 --- a/.eslintrc +++ b/.eslintrc @@ -117,7 +117,7 @@ } }, { - "files": "test/playwright/**", + "files": "apps/dashboard-parcel/test/playwright/**", "extends": "plugin:playwright/recommended" }, { diff --git a/README-lib.md b/README-lib.md index 910934048..833ad2e4b 100644 --- a/README-lib.md +++ b/README-lib.md @@ -1,4 +1,12 @@ -# VEDA Dashboard + + +# VEDA Dashboard - Component Library ![VEDA logo](./docs/media/nasa-veda-logo-pos.svg) diff --git a/apps/dashboard-parcel/README.md b/apps/dashboard-parcel/README.md new file mode 100644 index 000000000..6a0778da7 --- /dev/null +++ b/apps/dashboard-parcel/README.md @@ -0,0 +1,33 @@ +# VEDA Dashboard (Parcel) + +![VEDA logo](../../docs/media/nasa-veda-logo-pos.svg) + +> **Note**: This is the Parcel-based dashboard. A migration to Vite is planned for v7. +> See [#1900](https://github.com/NASA-IMPACT/veda-ui/issues/1900) for details. + +VEDA is a dashboard to explore data. + +This repository contains the UI component of VEDA where development of new features happens. +If you're looking to add content check the [veda-config](https://github.com/NASA-IMPACT/veda-config) repository. + +## Content documentation + +**⚠️ The content configuration should not happen on this repository, but on your instance of [veda-config](https://github.com/NASA-IMPACT/veda-config).** + +The following documentation will guide you through the process of configuring the content. + +- Check [CONFIGURATION](../../docs/content/CONFIGURATION.md) to see a list of configuration options for VEDA. +- Check [CONTENT](../../docs/content/CONTENT.md) for how to structure the content pieces. +- Check [PAGE_OVERRIDES](../../docs/content/PAGE_OVERRIDES.md) for all the layout overrides available to you and how they work. + + +## Development documentation + +Check the documentation below for how to setup and develop features for `veda-ui`. + +- **Start here**: Check [SETUP.md](../../docs/development/SETUP.md) for instructions on how to set up your local development environment. +- Check [ARCHITECTURE](../../docs/development/ARCHITECTURE.md) docs to read about architecture. +- Check [PAGE_OVERRIDES](../../docs/development/PAGE_OVERRIDES.md) for information about the component/content overriding feature. + +## License +This project is licensed under **Apache 2**, see the [LICENSE](../../LICENSE) file for more details. \ No newline at end of file diff --git a/app/index.html b/apps/dashboard-parcel/index.html similarity index 98% rename from app/index.html rename to apps/dashboard-parcel/index.html index 72b696217..c289864f6 100644 --- a/app/index.html +++ b/apps/dashboard-parcel/index.html @@ -134,7 +134,7 @@

{{appTitle}}

} - + \ No newline at end of file diff --git a/posthtml.config.js b/apps/dashboard-parcel/posthtml.config.js similarity index 100% rename from posthtml.config.js rename to apps/dashboard-parcel/posthtml.config.js diff --git a/test/playwright/generateTestData.js b/apps/dashboard-parcel/test/playwright/generateTestData.js similarity index 100% rename from test/playwright/generateTestData.js rename to apps/dashboard-parcel/test/playwright/generateTestData.js diff --git a/test/playwright/pages/aboutPage.ts b/apps/dashboard-parcel/test/playwright/pages/aboutPage.ts similarity index 100% rename from test/playwright/pages/aboutPage.ts rename to apps/dashboard-parcel/test/playwright/pages/aboutPage.ts diff --git a/test/playwright/pages/basePage.ts b/apps/dashboard-parcel/test/playwright/pages/basePage.ts similarity index 100% rename from test/playwright/pages/basePage.ts rename to apps/dashboard-parcel/test/playwright/pages/basePage.ts diff --git a/test/playwright/pages/catalogPage.ts b/apps/dashboard-parcel/test/playwright/pages/catalogPage.ts similarity index 100% rename from test/playwright/pages/catalogPage.ts rename to apps/dashboard-parcel/test/playwright/pages/catalogPage.ts diff --git a/test/playwright/pages/consentBanner.ts b/apps/dashboard-parcel/test/playwright/pages/consentBanner.ts similarity index 100% rename from test/playwright/pages/consentBanner.ts rename to apps/dashboard-parcel/test/playwright/pages/consentBanner.ts diff --git a/test/playwright/pages/contactModal.ts b/apps/dashboard-parcel/test/playwright/pages/contactModal.ts similarity index 100% rename from test/playwright/pages/contactModal.ts rename to apps/dashboard-parcel/test/playwright/pages/contactModal.ts diff --git a/test/playwright/pages/datasetPage.ts b/apps/dashboard-parcel/test/playwright/pages/datasetPage.ts similarity index 100% rename from test/playwright/pages/datasetPage.ts rename to apps/dashboard-parcel/test/playwright/pages/datasetPage.ts diff --git a/test/playwright/pages/datasetSelectorComponent.ts b/apps/dashboard-parcel/test/playwright/pages/datasetSelectorComponent.ts similarity index 100% rename from test/playwright/pages/datasetSelectorComponent.ts rename to apps/dashboard-parcel/test/playwright/pages/datasetSelectorComponent.ts diff --git a/test/playwright/pages/explorePage.ts b/apps/dashboard-parcel/test/playwright/pages/explorePage.ts similarity index 100% rename from test/playwright/pages/explorePage.ts rename to apps/dashboard-parcel/test/playwright/pages/explorePage.ts diff --git a/test/playwright/pages/footerComponent.ts b/apps/dashboard-parcel/test/playwright/pages/footerComponent.ts similarity index 100% rename from test/playwright/pages/footerComponent.ts rename to apps/dashboard-parcel/test/playwright/pages/footerComponent.ts diff --git a/test/playwright/pages/headerComponent.ts b/apps/dashboard-parcel/test/playwright/pages/headerComponent.ts similarity index 100% rename from test/playwright/pages/headerComponent.ts rename to apps/dashboard-parcel/test/playwright/pages/headerComponent.ts diff --git a/test/playwright/pages/notebookConnectModal.ts b/apps/dashboard-parcel/test/playwright/pages/notebookConnectModal.ts similarity index 100% rename from test/playwright/pages/notebookConnectModal.ts rename to apps/dashboard-parcel/test/playwright/pages/notebookConnectModal.ts diff --git a/test/playwright/pages/storiesPage.ts b/apps/dashboard-parcel/test/playwright/pages/storiesPage.ts similarity index 100% rename from test/playwright/pages/storiesPage.ts rename to apps/dashboard-parcel/test/playwright/pages/storiesPage.ts diff --git a/test/playwright/tests/about.spec.ts b/apps/dashboard-parcel/test/playwright/tests/about.spec.ts similarity index 100% rename from test/playwright/tests/about.spec.ts rename to apps/dashboard-parcel/test/playwright/tests/about.spec.ts diff --git a/test/playwright/tests/exploration.spec.ts b/apps/dashboard-parcel/test/playwright/tests/exploration.spec.ts similarity index 100% rename from test/playwright/tests/exploration.spec.ts rename to apps/dashboard-parcel/test/playwright/tests/exploration.spec.ts diff --git a/test/playwright/tests/exploreAoi.spec.ts b/apps/dashboard-parcel/test/playwright/tests/exploreAoi.spec.ts similarity index 100% rename from test/playwright/tests/exploreAoi.spec.ts rename to apps/dashboard-parcel/test/playwright/tests/exploreAoi.spec.ts diff --git a/test/playwright/tests/footerNavigation.spec.ts b/apps/dashboard-parcel/test/playwright/tests/footerNavigation.spec.ts similarity index 100% rename from test/playwright/tests/footerNavigation.spec.ts rename to apps/dashboard-parcel/test/playwright/tests/footerNavigation.spec.ts diff --git a/test/playwright/tests/stories.spec.ts b/apps/dashboard-parcel/test/playwright/tests/stories.spec.ts similarity index 92% rename from test/playwright/tests/stories.spec.ts rename to apps/dashboard-parcel/test/playwright/tests/stories.spec.ts index 454747ac6..e295956fd 100644 --- a/test/playwright/tests/stories.spec.ts +++ b/apps/dashboard-parcel/test/playwright/tests/stories.spec.ts @@ -2,7 +2,7 @@ import { test, expect } from '../pages/basePage'; const stories = JSON.parse( // eslint-disable-next-line @typescript-eslint/no-require-imports - require('fs').readFileSync('test/playwright/playwrightTestData.json', 'utf8') + require('fs').readFileSync('apps/dashboard-parcel/test/playwright/playwrightTestData.json', 'utf8') )['stories']; test('load stories on /stories route', async ({ diff --git a/test/playwright/tests/storiesRouting.spec.ts b/apps/dashboard-parcel/test/playwright/tests/storiesRouting.spec.ts similarity index 96% rename from test/playwright/tests/storiesRouting.spec.ts rename to apps/dashboard-parcel/test/playwright/tests/storiesRouting.spec.ts index d59a1283c..bd94c5b2c 100644 --- a/test/playwright/tests/storiesRouting.spec.ts +++ b/apps/dashboard-parcel/test/playwright/tests/storiesRouting.spec.ts @@ -2,7 +2,7 @@ import { test, expect } from '../pages/basePage'; const stories = JSON.parse( // eslint-disable-next-line @typescript-eslint/no-require-imports - require('fs').readFileSync('test/playwright/playwrightTestData.json', 'utf8') + require('fs').readFileSync('apps/dashboard-parcel/test/playwright/playwrightTestData.json', 'utf8') )['stories']; test.describe('stories card routing', () => { diff --git a/test/playwright/tests/topNavigation.spec.ts b/apps/dashboard-parcel/test/playwright/tests/topNavigation.spec.ts similarity index 100% rename from test/playwright/tests/topNavigation.spec.ts rename to apps/dashboard-parcel/test/playwright/tests/topNavigation.spec.ts diff --git a/test/playwright/tests/widget.spec.ts b/apps/dashboard-parcel/test/playwright/tests/widget.spec.ts similarity index 100% rename from test/playwright/tests/widget.spec.ts rename to apps/dashboard-parcel/test/playwright/tests/widget.spec.ts diff --git a/test/utils.js b/apps/dashboard-parcel/test/utils.js similarity index 100% rename from test/utils.js rename to apps/dashboard-parcel/test/utils.js diff --git a/utils/link-next.sh b/apps/dashboard-parcel/utils/link-next.sh similarity index 100% rename from utils/link-next.sh rename to apps/dashboard-parcel/utils/link-next.sh diff --git a/docs/development/DEPLOYMENT.md b/docs/development/DEPLOYMENT.md index c1ca72736..e494f8555 100644 --- a/docs/development/DEPLOYMENT.md +++ b/docs/development/DEPLOYMENT.md @@ -20,5 +20,5 @@ The app can then be run by any web server. If you want to use any other parcel feature it is also possible. Example: ``` -PARCEL_BUNDLE_ANALYZER=true yarn parcel build app/index.html +PARCEL_BUNDLE_ANALYZER=true yarn parcel build apps/dashboard-parcel/index.html ``` diff --git a/gulpfile.js b/gulpfile.js index 84119fee7..8333058e6 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -110,7 +110,8 @@ function parcelBuildLib(cb) { // package.json to use. When running this directly from the UI repo (for // development) we need to actively point parcel to the correct target // otherwise the site doesn't get built. -const parcelTarget = process.cwd() === __dirname ? ['app/index.html'] : []; +const parcelTarget = + process.cwd() === __dirname ? ['apps/dashboard-parcel/index.html'] : []; function parcelServe(cb) { portscanner.findAPortNotInUse(9000, 9999, function (error, port) { diff --git a/jest.config.js b/jest.config.js index 922114058..16bf26554 100644 --- a/jest.config.js +++ b/jest.config.js @@ -211,5 +211,5 @@ module.exports = { // Whether to use watchman for file crawling // watchman: true, - modulePathIgnorePatterns: ['/test/playwright/'] + modulePathIgnorePatterns: ['/apps/dashboard-parcel/test/playwright/'] }; diff --git a/package.json b/package.json index ee576b633..cff3d7cb1 100644 --- a/package.json +++ b/package.json @@ -31,7 +31,7 @@ "lint:css": "stylelint 'packages/veda-ui/src/styles/**/**' 'packages/veda-ui/src/**/*.(js|ts|tsx|jsx)'", "ts-check": "yarn tsc --noEmit --skipLibCheck", "test": "TZ=UTC jest", - "pretest:e2e": "node test/playwright/generateTestData.js", + "pretest:e2e": "node apps/dashboard-parcel/test/playwright/generateTestData.js", "test:e2e": "yarn playwright test", "test:e2e:ui": "yarn playwright test --ui", "release": "release-it --", @@ -41,7 +41,7 @@ }, "targets": { "veda-app": { - "source": "./app/index.html", + "source": "./apps/dashboard-parcel/index.html", "context": "browser" } }, @@ -269,7 +269,7 @@ "$uswds": "~/packages/veda-ui/src/uswds", "$libs": "~/packages/veda-ui/src/libs", "$graphics": "~/packages/veda-ui/graphics", - "$test": "~/test", + "$test": "~/apps/dashboard-parcel/test", "$mock": "~/mock", "$static": "~/static" }, diff --git a/packages/veda-ui/src/components/common/page-footer/footer.test.tsx b/packages/veda-ui/src/components/common/page-footer/footer.test.tsx index dc3e50abb..b91bf0de9 100644 --- a/packages/veda-ui/src/components/common/page-footer/footer.test.tsx +++ b/packages/veda-ui/src/components/common/page-footer/footer.test.tsx @@ -5,7 +5,7 @@ import NasaLogoColor from '../nasa-logo-color'; import { NavItem } from '../page-header/types.js'; import PageFooter from './index'; -import { VedaUIConfigProvider } from '$test/utils.js'; +import { VedaUIConfigProvider } from '$test/utils'; import { navItems } from '$mock/veda.config.js'; const defaultFooterSetting = { diff --git a/packages/veda-ui/src/components/common/page-header/page-header.test.tsx b/packages/veda-ui/src/components/common/page-header/page-header.test.tsx index e9352d920..63773633d 100644 --- a/packages/veda-ui/src/components/common/page-header/page-header.test.tsx +++ b/packages/veda-ui/src/components/common/page-header/page-header.test.tsx @@ -6,7 +6,7 @@ import { BrowserRouter } from 'react-router-dom'; import NasaLogoColor from '../nasa-logo-color'; import { NavItem } from './types'; import PageHeader from './index'; -import { VedaUIConfigProvider } from '$test/utils.js'; +import { VedaUIConfigProvider } from '$test/utils'; import { navItems } from '$mock/veda.config.js'; // @NOTE: Possible Test cases diff --git a/playwright.config.ts b/playwright.config.ts index 258f3ee2a..18882e54a 100644 --- a/playwright.config.ts +++ b/playwright.config.ts @@ -1,7 +1,11 @@ import { defineConfig, devices } from '@playwright/test'; +/** + * E2E Tests for the Dashboard Application (apps/dashboard-parcel) + */ export default defineConfig({ - testDir: './test', + testDir: './apps/dashboard-parcel/test/playwright/tests', + testMatch: '**/*.spec.ts', fullyParallel: true, forbidOnly: !!process.env.CI, retries: process.env.CI ? 2 : 0, diff --git a/tsconfig.json b/tsconfig.json index a6c912d30..79623d0e5 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -17,7 +17,7 @@ "$data-layer/*": ["packages/veda-ui/src/data-layer/*"], "$uswds": ["packages/veda-ui/src/uswds/"], "$graphics/*": ["packages/veda-ui/graphics/*"], - "$test/*": ["test/*"], + "$test/*": ["apps/dashboard-parcel/test/*"], "$mock/*": ["mock/*"], "$storybook": ["storybook/*"] }