Skip to content

Commit

Permalink
update/move package
Browse files Browse the repository at this point in the history
  • Loading branch information
craigrbarnes committed Sep 5, 2024
1 parent fdc3ad3 commit b4183fb
Show file tree
Hide file tree
Showing 8 changed files with 382 additions and 706 deletions.
576 changes: 114 additions & 462 deletions package-lock.json

Large diffs are not rendered by default.

5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
"devDependencies": {
"@axe-core/react": "^4.10.0",
"@next/eslint-plugin-next": "^14.2.3",
"@rollup/plugin-typescript": "^11.1.6",
"@swc/cli": "^0.3.9",
"@swc/core": "^1.3.62",
"@testing-library/jest-dom": "^5.16.5",
Expand All @@ -54,14 +55,15 @@
"@typescript-eslint/eslint-plugin": "^5.62.0",
"@typescript-eslint/parser": "^5.62.0",
"autoprefixer": "^10.4.20",
"eslint": "8.56.0",
"eslint": "8.57.0",
"eslint-config-next": "^14.2.6",
"eslint-config-prettier": "^8.8.0",
"eslint-plugin-import": "^2.27.5",
"eslint-plugin-jsx-a11y": "^6.6.1",
"eslint-plugin-prettier": "^5.2.1",
"eslint-plugin-react": "^7.30.1",
"eslint-plugin-react-hooks": "^4.6.0",
"jest": "^29.5.0",
"jest-canvas-mock": "^2.4.0",
"jest-environment-jsdom": "^29.7.0",
"lerna": ">=6.6.2 <7.0.0",
Expand All @@ -77,6 +79,7 @@
"rollup-swc-preserve-directives": "^0.5.0",
"terser-webpack-plugin": "^5.3.3",
"ts-jest": "^29.1.2",
"ts-node": "^10.9.2",
"ts-node-dev": "^2.0.0",
"typescript": "^5.5.4"
}
Expand Down
10 changes: 3 additions & 7 deletions packages/frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@
"jsonpath-plus": "^8.0.0",
"mantine-react-table": "^2.0.0-beta.6",
"minisearch": "^6.3.0",
"next": "^14.2.5",
"next": "^14.2.8",
"next-compose-plugins": "^2.2.1",
"next-images": "^1.8.5",
"pluralize": "^8.0.0",
Expand Down Expand Up @@ -131,25 +131,21 @@
"@types/react": "^18.2.21",
"@types/react-dom": "^18.2.7",
"@types/react-table": "^7.7.15",
"@types/recharts": "^1.8.23",
"@types/recharts": "^1.8.29",
"@types/tinycolor2": "^1.4.4",
"@types/uuid": "^9.0.4",
"autoprefixer": "^10.4.15",
"css-loader": "^6.8.1",
"html-webpack-plugin": "^5.5.0",
"jest": "^29.5.0",
"react-what-changed": "^1.1.2",
"rollup": "^3.29.1",
"rollup-plugin-copy": "^3.5.0",
"rollup-plugin-dts": "^5.3.0",
"rollup-plugin-peer-deps-external": "^2.2.4",
"rollup-plugin-postcss": "^4.0.2",
"rollup-plugin-sourcemaps": "^0.6.3",
"style-loader": "^3.3.2",
"tailwindcss": "^3.3.3",
"ts-jest": "^29.1.1",
"postcss": "^8.4.29",
"swr": "^2.1.5"
"swr": "^2.2.5"
},
"peerDependencies": {
"@gen3/core": "^0.10.33",
Expand Down
19 changes: 17 additions & 2 deletions packages/frontend/src/features/Discovery/Discovery.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import React, { useMemo, useState } from 'react';
import { Select, Tabs } from '@mantine/core';
import { DiscoveryConfig, DiscoveryIndexConfig } from './types';
import DiscoveryIndexPanel from './DiscoveryIndexPanel';
import { Select, Tabs } from '@mantine/core';
import MessagePanel from '../../components/MessagePanel';

const extractLabel = (c: DiscoveryIndexConfig, idx: number) =>
c.label ?? c.features?.pageTitle?.text ?? `Index ${idx.toString()}`;
Expand All @@ -19,6 +20,20 @@ const Discovery = ({ discoveryConfig }: DiscoveryProps) => {
});
}, [discoveryConfig.metadataConfig]);

if (menuItems.length === 0) {
return <MessagePanel message="No discovery configuration" />;
}

if (menuItems.length === 1) {
// no need for tabs
return (
<DiscoveryIndexPanel
discoveryConfig={discoveryConfig.metadataConfig[0]}
indexSelector={null}
/>
);
}

return (
<div className="flex flex-col items-center p-4 w-full bg-base-lightest">
<Tabs
Expand All @@ -29,7 +44,7 @@ const Discovery = ({ discoveryConfig }: DiscoveryProps) => {
}}
>
<Tabs.List>
{menuItems.map((item, i) => (
{menuItems.map((item) => (
<Tabs.Tab key={item.value} value={item.value}>
{item.label}
</Tabs.Tab>
Expand Down
Loading

0 comments on commit b4183fb

Please sign in to comment.