Skip to content

Commit

Permalink
chore: upgrade findable and allow toggling all columns (#203, #204) (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
hunterckx authored Jan 10, 2025
1 parent 5d050df commit f4bdff4
Show file tree
Hide file tree
Showing 5 changed files with 195 additions and 40 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export const AnalyzeGenome = ({
>
{analyze.label}
</Button>
<DropdownMenu {...MENU_PROPS} Button={renderButton}>
<DropdownMenu {...MENU_PROPS} button={renderButton}>
{({ closeMenu }): JSX.Element[] =>
views.map((view, i) => (
<MenuItem
Expand Down
155 changes: 150 additions & 5 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"build-brc-db": "esrun files/build-catalog.ts"
},
"dependencies": {
"@databiosphere/findable-ui": "15.0.2",
"@databiosphere/findable-ui": "^21.0.0",
"@emotion/react": "^11.13.3",
"@emotion/styled": "^11.13.0",
"@mdx-js/loader": "^3.0.1",
Expand Down
61 changes: 32 additions & 29 deletions pages/_app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import type { AppProps } from "next/app";
import { StyledFooter } from "../app/components/Layout/components/Footer/footer.styles";
import { config } from "../app/config/config";
import { mergeAppTheme } from "../app/theme/theme";
import { GoogleSignInAuthenticationProvider } from "@databiosphere/findable-ui/lib/providers/googleSignInAuthentication/provider";

const DEFAULT_ENTITY_LIST_TYPE = "organisms";

Expand Down Expand Up @@ -60,35 +61,37 @@ function MyApp({ Component, pageProps }: AppPropsWithComponent): JSX.Element {
<Head pageTitle={pageTitle} />
<CssBaseline />
<SystemStatusProvider>
<LayoutStateProvider>
<AppLayout>
<DXHeader {...header} />
<ExploreStateProvider entityListType={entityListType}>
<Main>
<ErrorBoundary
fallbackRender={({
error,
reset,
}: {
error: DataExplorerError;
reset: () => void;
}): JSX.Element => (
<Error
errorMessage={error.message}
requestUrlMessage={error.requestUrlMessage}
rootPath={redirectRootToPath}
onReset={reset}
/>
)}
>
<Component {...pageProps} />
<Floating {...floating} />
</ErrorBoundary>
</Main>
</ExploreStateProvider>
<StyledFooter {...footer} />
</AppLayout>
</LayoutStateProvider>
<GoogleSignInAuthenticationProvider>
<LayoutStateProvider>
<AppLayout>
<DXHeader {...header} />
<ExploreStateProvider entityListType={entityListType}>
<Main>
<ErrorBoundary
fallbackRender={({
error,
reset,
}: {
error: DataExplorerError;
reset: () => void;
}): JSX.Element => (
<Error
errorMessage={error.message}
requestUrlMessage={error.requestUrlMessage}
rootPath={redirectRootToPath}
onReset={reset}
/>
)}
>
<Component {...pageProps} />
<Floating {...floating} />
</ErrorBoundary>
</Main>
</ExploreStateProvider>
<StyledFooter {...footer} />
</AppLayout>
</LayoutStateProvider>
</GoogleSignInAuthenticationProvider>
</SystemStatusProvider>
</DXConfigProvider>
</ThemeProvider>
Expand Down
15 changes: 11 additions & 4 deletions site-config/brc-analytics/local/index/genomeEntityConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ export const genomeEntityConfig: BRCEntityConfig<BRCDataCatalogGenome> = {
component: C.AnalyzeGenome,
viewBuilder: V.buildAnalyzeGenome,
} as ComponentConfig<typeof C.AnalyzeGenome, BRCDataCatalogGenome>,
disableSorting: true,
enableSorting: false,
header: BRC_DATA_CATALOG_CATEGORY_LABEL.ANALYZE_GENOME,
id: BRC_DATA_CATALOG_CATEGORY_KEY.ANALYZE_GENOME,
width: "auto",
Expand Down Expand Up @@ -145,9 +145,16 @@ export const genomeEntityConfig: BRCEntityConfig<BRCDataCatalogGenome> = {
width: { max: "0.5fr", min: "142px" },
},
],
defaultSort: {
desc: SORT_DIRECTION.ASCENDING,
id: BRC_DATA_CATALOG_CATEGORY_KEY.SPECIES,
tableOptions: {
initialState: {
columnVisibility: {},
sorting: [
{
desc: SORT_DIRECTION.ASCENDING,
id: BRC_DATA_CATALOG_CATEGORY_KEY.SPECIES,
},
],
},
},
} as ListConfig<BRCDataCatalogGenome>,
listView: {
Expand Down

0 comments on commit f4bdff4

Please sign in to comment.