From 8eab67fd6f58bd8feeddb80811934384cb01af70 Mon Sep 17 00:00:00 2001 From: Shawn Yama Date: Wed, 11 Sep 2024 16:17:56 -0400 Subject: [PATCH] clean: remove explorer (#4753) --- packages/client/hmi-client/package.json | 193 ++++--- .../hmi-client/src/assets/css/style.scss | 46 +- .../src/components/dataset/tera-dataset.vue | 5 +- .../model/petrinet/tera-model-description.vue | 6 +- .../src/components/navbar/tera-navbar.vue | 21 +- .../src/components/navbar/tera-searchbar.vue | 374 ------------- .../widgets/tera-asset-enrichment.vue | 2 +- packages/client/hmi-client/src/page/Home.vue | 8 +- .../src/page/data-explorer/DataExplorer.vue | 519 ------------------ .../facets/tera-categorical-facet.vue | 293 ---------- .../facets/tera-numerical-facet.vue | 164 ------ .../components/tera-asset-card.vue | 222 -------- .../components/tera-filter-bar.vue | 16 - .../components/tera-preview-panel.vue | 125 ----- .../components/tera-search-item.vue | 46 -- .../components/tera-search-results-list.vue | 321 ----------- .../tera-selected-resources-header-pane.vue | 141 ----- .../page/data-explorer/search-by-example.ts | 34 -- .../client/hmi-client/src/router/index.ts | 7 - .../client/hmi-client/src/router/routes.ts | 16 - .../client/hmi-client/src/services/data.ts | 251 --------- .../hmi-client/src/services/provenance.ts | 6 +- .../client/hmi-client/src/stores/query.ts | 36 -- .../client/hmi-client/src/types/Concept.ts | 7 - .../client/hmi-client/src/types/Dataset.ts | 32 +- .../client/hmi-client/src/types/Filter.ts | 24 - packages/client/hmi-client/src/types/Model.ts | 25 - .../client/hmi-client/src/types/common.ts | 51 -- .../client/hmi-client/src/types/search.ts | 6 - packages/client/hmi-client/src/utils/asset.ts | 16 + .../client/hmi-client/src/utils/data-util.ts | 92 ---- .../client/hmi-client/src/utils/facets.ts | 101 ---- .../hmi-client/src/utils/filters-util.ts | 107 ---- .../tests/unit/utils/data-util.spec.ts | 25 - yarn.lock | 104 ---- 35 files changed, 132 insertions(+), 3310 deletions(-) delete mode 100644 packages/client/hmi-client/src/components/navbar/tera-searchbar.vue delete mode 100644 packages/client/hmi-client/src/page/data-explorer/DataExplorer.vue delete mode 100644 packages/client/hmi-client/src/page/data-explorer/components/facets/tera-categorical-facet.vue delete mode 100644 packages/client/hmi-client/src/page/data-explorer/components/facets/tera-numerical-facet.vue delete mode 100644 packages/client/hmi-client/src/page/data-explorer/components/tera-asset-card.vue delete mode 100644 packages/client/hmi-client/src/page/data-explorer/components/tera-filter-bar.vue delete mode 100644 packages/client/hmi-client/src/page/data-explorer/components/tera-preview-panel.vue delete mode 100644 packages/client/hmi-client/src/page/data-explorer/components/tera-search-item.vue delete mode 100644 packages/client/hmi-client/src/page/data-explorer/components/tera-search-results-list.vue delete mode 100644 packages/client/hmi-client/src/page/data-explorer/components/tera-selected-resources-header-pane.vue delete mode 100644 packages/client/hmi-client/src/page/data-explorer/search-by-example.ts delete mode 100644 packages/client/hmi-client/src/services/data.ts delete mode 100644 packages/client/hmi-client/src/stores/query.ts delete mode 100644 packages/client/hmi-client/src/types/Concept.ts delete mode 100644 packages/client/hmi-client/src/types/Filter.ts delete mode 100644 packages/client/hmi-client/src/types/search.ts create mode 100644 packages/client/hmi-client/src/utils/asset.ts delete mode 100644 packages/client/hmi-client/src/utils/data-util.ts delete mode 100644 packages/client/hmi-client/src/utils/facets.ts delete mode 100644 packages/client/hmi-client/src/utils/filters-util.ts delete mode 100644 packages/client/hmi-client/tests/unit/utils/data-util.spec.ts diff --git a/packages/client/hmi-client/package.json b/packages/client/hmi-client/package.json index 3e8f820ec6..85ce8a611e 100644 --- a/packages/client/hmi-client/package.json +++ b/packages/client/hmi-client/package.json @@ -1,100 +1,97 @@ { - "name": "hmi-client", - "private": true, - "version": "0.0.0", - "scripts": { - "dev": "yarn install && vite --host", - "local": "yarn install && vite --host --config vite.config.local.ts", - "staging": "yarn install && vite --host --config vite.config.staging.ts", - "build": "vue-tsc --noEmit && vite build", - "typecheck": "yarn workspace graph-scaffolder tsc --build && vue-tsc --noEmit", - "preview": "vite preview", - "test": "vitest", - "test:ci": "vitest run", - "test:coverage": "vitest run --coverage", - "test:e2e": "playwright test", - "test:e2e:snapshots": "playwright test --update-snapshots", - "test:ct": "playwright test -c playwright-ct.config.ts" - }, - "dependencies": { - "@carbon/icons-vue": "10.79.1", - "@hsorby/vue3-katex": "0.6.0-rc.7", - "@jupyter/ydoc": "1.0.2", - "@jupyterlab/application": "3.6.8", - "@jupyterlab/apputils": "3.6.8", - "@jupyterlab/cells": "3.6.8", - "@jupyterlab/codemirror": "3.6.8", - "@jupyterlab/completer": "3.6.8", - "@jupyterlab/coreutils": "5.6.7", - "@jupyterlab/outputarea": "3.6.8", - "@jupyterlab/rendermime": "3.6.8", - "@jupyterlab/services": "6.6.7", - "@jupyterlab/theme-light-extension": "3.6.8", - "@jupyterlab/translation": "3.6.8", - "@jupyterlab/ui-components": "3.6.8", - "@lumino/commands": "2.1.3", - "@lumino/coreutils": "2.1.2", - "@lumino/widgets": "2.1.0", - "@uncharted.software/design-tokens": "1.1.0", - "@uncharted.software/facets-core": "3.2.6", - "@uncharted.software/facets-plugins": "3.2.5", - "@vue/runtime-dom": "3.4.38", - "@vueup/vue-quill": "1.2.0", - "ace-builds": "1.32.9", - "axios": "1.7.5", - "chart.js": "4.4.4", - "chartjs-plugin-annotation": "3.0.1", - "chartjs-plugin-datalabels": "2.2.0", - "chroma-js": "2.4.2", - "d3": "7.8.5", - "dagre": "0.8.5", - "eslint-import-resolver-typescript": "3.6.1", - "event-source-polyfill": "1.0.31", - "extended-eventsource": "1.4.9", - "feather-icons": "4.29.2", - "graph-scaffolder": "*", - "katex": "0.16.11", - "lodash": "4.17.21", - "markdown-it": "14.1.0", - "mathlive": "0.89.2", - "mathml-to-latex": "1.2.0", - "oidc-spa": "4.6.2", - "path-browserify": "1.0.1", - "pinia": "2.1.7", - "pixi-viewport": "4.37.0", - "pixi.js": "7.0.5", - "primeflex": "3.3.1", - "primeicons": "7.0.0", - "primevue": "3.53.0", - "pyodide": "0.25.1", - "sass": "1.56.1", - "uuid": "9.0.1", - "vega": "5.30.0", - "vega-embed": "6.25.0", - "vega-lite": "5.19.0", - "vue": "3.4.38", - "vue-feather": "2.0.0", - "vue-gtag": "2.0.1", - "vue-router": "4.2.5", - "vue3-ace-editor": "2.2.4", - "vue3-draggable-resizable": "1.6.5", - "vue3-lottie": "3.2.0" - }, - "devDependencies": { - "@playwright/experimental-ct-vue": "1.31.2", - "@playwright/test": "1.31.2", - "@rushstack/eslint-patch": "1.10.4", - "@types/d3": "7.4.3", - "@types/lodash": "4.17.7", - "@types/markdown-it": "14.1.2", - "@types/node": "18.19.3", - "@vitejs/plugin-vue": "4.6.2", - "@vitest/coverage-c8": "0.24.5", - "jsdom": "24.1.3", - "typescript": "5.4.5", - "vite": "5.4.2", - "vite-svg-loader": "4.0.0", - "vitest": "0.24.5", - "vue-tsc": "1.8.27" - } + "name": "hmi-client", + "private": true, + "version": "0.0.0", + "scripts": { + "dev": "yarn install && vite --host", + "local": "yarn install && vite --host --config vite.config.local.ts", + "staging": "yarn install && vite --host --config vite.config.staging.ts", + "build": "vue-tsc --noEmit && vite build", + "typecheck": "yarn workspace graph-scaffolder tsc --build && vue-tsc --noEmit", + "preview": "vite preview", + "test": "vitest", + "test:ci": "vitest run", + "test:coverage": "vitest run --coverage", + "test:e2e": "playwright test", + "test:e2e:snapshots": "playwright test --update-snapshots", + "test:ct": "playwright test -c playwright-ct.config.ts" + }, + "dependencies": { + "@hsorby/vue3-katex": "0.6.0-rc.7", + "@jupyter/ydoc": "1.0.2", + "@jupyterlab/application": "3.6.8", + "@jupyterlab/apputils": "3.6.8", + "@jupyterlab/cells": "3.6.8", + "@jupyterlab/codemirror": "3.6.8", + "@jupyterlab/completer": "3.6.8", + "@jupyterlab/coreutils": "5.6.7", + "@jupyterlab/outputarea": "3.6.8", + "@jupyterlab/rendermime": "3.6.8", + "@jupyterlab/services": "6.6.7", + "@jupyterlab/theme-light-extension": "3.6.8", + "@jupyterlab/translation": "3.6.8", + "@jupyterlab/ui-components": "3.6.8", + "@lumino/commands": "2.1.3", + "@lumino/coreutils": "2.1.2", + "@lumino/widgets": "2.1.0", + "@uncharted.software/design-tokens": "1.1.0", + "@vue/runtime-dom": "3.4.38", + "@vueup/vue-quill": "1.2.0", + "ace-builds": "1.32.9", + "axios": "1.7.5", + "chart.js": "4.4.4", + "chartjs-plugin-annotation": "3.0.1", + "chartjs-plugin-datalabels": "2.2.0", + "chroma-js": "2.4.2", + "d3": "7.8.5", + "dagre": "0.8.5", + "eslint-import-resolver-typescript": "3.6.1", + "event-source-polyfill": "1.0.31", + "extended-eventsource": "1.4.9", + "feather-icons": "4.29.2", + "graph-scaffolder": "*", + "katex": "0.16.11", + "lodash": "4.17.21", + "markdown-it": "14.1.0", + "mathlive": "0.89.2", + "mathml-to-latex": "1.2.0", + "oidc-spa": "4.6.2", + "path-browserify": "1.0.1", + "pinia": "2.1.7", + "pixi-viewport": "4.37.0", + "pixi.js": "7.0.5", + "primeflex": "3.3.1", + "primeicons": "7.0.0", + "primevue": "3.53.0", + "pyodide": "0.25.1", + "sass": "1.56.1", + "uuid": "9.0.1", + "vega": "5.30.0", + "vega-embed": "6.25.0", + "vega-lite": "5.19.0", + "vue": "3.4.38", + "vue-feather": "2.0.0", + "vue-gtag": "2.0.1", + "vue-router": "4.2.5", + "vue3-ace-editor": "2.2.4", + "vue3-draggable-resizable": "1.6.5", + "vue3-lottie": "3.2.0" + }, + "devDependencies": { + "@playwright/experimental-ct-vue": "1.31.2", + "@playwright/test": "1.31.2", + "@rushstack/eslint-patch": "1.10.4", + "@types/d3": "7.4.3", + "@types/lodash": "4.17.7", + "@types/markdown-it": "14.1.2", + "@types/node": "18.19.3", + "@vitejs/plugin-vue": "4.6.2", + "@vitest/coverage-c8": "0.24.5", + "jsdom": "24.1.3", + "typescript": "5.4.5", + "vite": "5.4.2", + "vite-svg-loader": "4.0.0", + "vitest": "0.24.5", + "vue-tsc": "1.8.27" + } } diff --git a/packages/client/hmi-client/src/assets/css/style.scss b/packages/client/hmi-client/src/assets/css/style.scss index 20deab460a..4ee2c86ff4 100644 --- a/packages/client/hmi-client/src/assets/css/style.scss +++ b/packages/client/hmi-client/src/assets/css/style.scss @@ -116,54 +116,12 @@ margin-right: 0 !important; } - // Styles reused in Document.vue and DataExplorer.vue - TODO: look into changing prime vue styling to reflect this - .p-buttonset { - white-space: nowrap; - - .p-button.p-button-secondary { - border: 1px solid var(--surface-border); - box-shadow: none; - } - - .p-button[active='false'].p-button-secondary, - .p-button[active='false'].p-button-secondary:focus, - .p-button[active='false'].p-button-secondary:enabled { - border-color: var(--surface-border); - background-color: var(--surface-0); - color: var(--text-color-primary); - } - - .p-button[active='false'].p-button-secondary:hover { - border-color: var(--surface-border); - background-color: var(--surface-100); - color: var(--text-color-primary); - } - - .p-button[active='true'].p-button-secondary, - .p-button[active='true'].p-button-secondary:focus, - .p-button[active='true'].p-button-secondary:enabled { - border-color: var(--surface-border); - background-color: var(--surface-highlight); - color: var(--text-color-primary); - } - - .p-button[active='true'].p-button-secondary:hover { - border-color: var(--surface-border); - background-color: var(--surface-highlight); - color: var(--text-color-primary); - } - - .p-button.p-button-sm { - padding: var(--gap-2) var(--gap-3); - } - } - /* Correct button font weight */ .p-button-label { font-weight: var(--font-weight); } - /* Fill checkboxes with color when selected */ + /* Fill checkboxes with color when selected */ .p-checkbox .p-checkbox-box { background-color: var(--surface-0); border-color: var(--surface-border-dark); @@ -254,6 +212,6 @@ padding-left: var(--gap-2); gap: 0; } - } + } } diff --git a/packages/client/hmi-client/src/components/dataset/tera-dataset.vue b/packages/client/hmi-client/src/components/dataset/tera-dataset.vue index 6a8b889f4b..a4fc144599 100644 --- a/packages/client/hmi-client/src/components/dataset/tera-dataset.vue +++ b/packages/client/hmi-client/src/components/dataset/tera-dataset.vue @@ -147,8 +147,7 @@ import { import { AssetType, type CsvAsset, type Dataset, PresignedURL } from '@/types/Types'; import TeraAsset from '@/components/asset/tera-asset.vue'; import type { FeatureConfig } from '@/types/common'; -import type { Source } from '@/types/search'; -import { DatasetSource } from '@/types/search'; +import { DatasetSource } from '@/types/Dataset'; import { useProjects } from '@/composables/project'; import TeraInputText from '@/components/widgets/tera-input-text.vue'; import TeraShowMoreText from '@/components/widgets/tera-show-more-text.vue'; @@ -174,7 +173,7 @@ const props = defineProps({ default: { isPreview: false } as FeatureConfig }, source: { - type: String as PropType, + type: String as PropType, default: DatasetSource.TERARIUM } }); diff --git a/packages/client/hmi-client/src/components/model/petrinet/tera-model-description.vue b/packages/client/hmi-client/src/components/model/petrinet/tera-model-description.vue index 7357e24d0f..e1af1cb58f 100644 --- a/packages/client/hmi-client/src/components/model/petrinet/tera-model-description.vue +++ b/packages/client/hmi-client/src/components/model/petrinet/tera-model-description.vue @@ -49,12 +49,12 @@ import Accordion from 'primevue/accordion'; import AccordionTab from 'primevue/accordiontab'; import Column from 'primevue/column'; import DataTable from 'primevue/datatable'; -import { FeatureConfig, ResultType } from '@/types/common'; +import { FeatureConfig } from '@/types/common'; import type { Author, Dataset, Model } from '@/types/Types'; import TeraShowMoreText from '@/components/widgets/tera-show-more-text.vue'; import TeraModelDiagram from '@/components/model/petrinet/model-diagrams/tera-model-diagram.vue'; import TeraModelEquation from '@/components/model/petrinet/tera-model-equation.vue'; -import { isDataset, isModel } from '@/utils/data-util'; +import { isDataset, isModel, type Asset } from '@/utils/asset'; import TeraProgressSpinner from '@/components/widgets/tera-progress-spinner.vue'; const props = defineProps<{ @@ -88,7 +88,7 @@ const authors = computed(() => { return [...authorsSet].join(', '); }); -const relatedTerariumArtifacts = ref([]); +const relatedTerariumArtifacts = ref([]); const relatedTerariumModels = computed(() => relatedTerariumArtifacts.value.filter((d) => isModel(d)) as Model[]); const relatedTerariumDatasets = computed(() => relatedTerariumArtifacts.value.filter((d) => isDataset(d)) as Dataset[]); diff --git a/packages/client/hmi-client/src/components/navbar/tera-navbar.vue b/packages/client/hmi-client/src/components/navbar/tera-navbar.vue index afdff95642..17950257f4 100644 --- a/packages/client/hmi-client/src/components/navbar/tera-navbar.vue +++ b/packages/client/hmi-client/src/components/navbar/tera-navbar.vue @@ -168,8 +168,8 @@ import Button from 'primevue/button'; import Dialog from 'primevue/dialog'; import Menu from 'primevue/menu'; import { MenuItem } from 'primevue/menuitem'; -import { RoutePath, useCurrentRoute } from '@/router/index'; -import { RouteMetadata, RouteName } from '@/router/routes'; +import { RoutePath } from '@/router/index'; +import { RouteName } from '@/router/routes'; import useAuthStore from '@/stores/auth'; import SplitButton from 'primevue/splitbutton'; import TeraModal from '@/components/widgets/tera-modal.vue'; @@ -198,9 +198,6 @@ const isAboutModalVisible = ref(false); const router = useRouter(); const menuLabel = computed(() => { - if (isDataExplorer.value) { - return 'Explorer'; - } if (useProjects().activeProject.value) { return useProjects().activeProject.value?.name; } @@ -354,18 +351,11 @@ const clearEvaluationScenario = () => { }; const homeItem: MenuItem = { - label: RouteMetadata[RouteName.Home].displayName, - icon: RouteMetadata[RouteName.Home].icon, + label: 'Home', + icon: 'pi pi-home', command: () => router.push(RoutePath.Home) }; -const explorerItem: MenuItem = { - label: RouteMetadata[RouteName.DataExplorer].displayName, - icon: RouteMetadata[RouteName.DataExplorer].icon, - command: () => router.push(RoutePath.DataExplorer) -}; -const navMenuItems = ref([homeItem, explorerItem]); -const currentRoute = useCurrentRoute(); -const isDataExplorer = computed(() => currentRoute.value.name === RouteName.DataExplorer); +const navMenuItems = ref([homeItem]); /* * User Menu @@ -438,7 +428,6 @@ watch( const removedUpdatedProject = remove(items, (item) => item.label === lastProjectUpdated?.name); navMenuItems.value = [ homeItem, - explorerItem, ...removedUpdatedProject, ...sortBy(items, (item) => item.label?.toString().toLowerCase()) ]; diff --git a/packages/client/hmi-client/src/components/navbar/tera-searchbar.vue b/packages/client/hmi-client/src/components/navbar/tera-searchbar.vue deleted file mode 100644 index daec39209b..0000000000 --- a/packages/client/hmi-client/src/components/navbar/tera-searchbar.vue +++ /dev/null @@ -1,374 +0,0 @@ -