Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: set catalog from url (#3776) #3778

Merged
merged 1 commit into from
Nov 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ export const buildAggregatedProjectTitle = (
HCA_DCP_CATEGORY_KEY.PROJECT_TITLE
)
),
url: "", //getAggregatedProjectTitleUrl(entityResponse),
url: getAggregatedProjectTitleUrl(entityResponse),
};
};

Expand Down
14 changes: 7 additions & 7 deletions explorer/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 explorer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
"test:anvil-catalog": "playwright test -c playwright_anvil-catalog.config.ts"
},
"dependencies": {
"@clevercanary/data-explorer-ui": "0.54.0",
"@clevercanary/data-explorer-ui": "0.55.0",
"@emotion/react": "11.11.1",
"@emotion/styled": "11.11.0",
"@mdx-js/loader": "^2.3.0",
Expand Down
11 changes: 9 additions & 2 deletions explorer/pages/[entityListType]/[...params].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,10 @@ export const getStaticPaths: GetStaticPaths<PageUrl> = async () => {

const resultParams: { params: PageUrl }[] = [];
if (entityConfig.detail.staticLoad && entityConfig.getId) {
const { fetchAllEntities, path } = getEntityService(entityConfig);
const { fetchAllEntities, path } = getEntityService(
entityConfig,
undefined
);
const data = await fetchAllEntities(path);
const tabs = entityConfig.detail?.tabs.map((tab) => tab.route) ?? [];

Expand Down Expand Up @@ -140,14 +143,18 @@ export const getStaticProps: GetStaticProps<AzulEntityStaticResponse> = async ({
await seedDatabase(entityConfig.route, entityConfig);
}
// Grab the entity detail, either from database or API.
const { fetchEntityDetail, path } = getEntityService(entityConfig);
const { fetchEntityDetail, path } = getEntityService(
entityConfig,
undefined
);
// When the entity detail is to be fetched from API, we only do so for the first tab.
if (!entityConfig.staticLoad && params?.params?.[PARAMS_INDEX_TAB]) {
return { props };
}
props.data = await fetchEntityDetail(
(params as PageUrl).params[PARAMS_INDEX_UUID],
path,
undefined,
undefined
);
}
Expand Down
2 changes: 1 addition & 1 deletion explorer/pages/[entityListType]/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ export const getStaticProps: GetStaticProps<
const { entities } = appConfig;
const entityConfig = getEntityConfig(entities, entityListType);
const { staticLoad } = entityConfig;
const { fetchAllEntities } = getEntityService(entityConfig); // Determine the type of fetch, either from an API endpoint or a TSV.
const { fetchAllEntities } = getEntityService(entityConfig, undefined); // Determine the type of fetch, either from an API endpoint or a TSV.

// Seed database.
if (entityConfig && staticLoad) {
Expand Down