-
Notifications
You must be signed in to change notification settings - Fork 48
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
Port new resource-listing “cards” UI for use to display datasets on /groups and /community #870
Comments
FYI I'm planning to make some edits to static-site/src/components/ListResources/Showcase.jsx proposed in #849 (comment). We may run into conflicts here, but I suspect that as long as you use the
|
@genehack happy to talk through any design questions you have here (as they arise). Perhaps a couple of points as to what I was thinking:
|
Thanks, I was gonna use our 1:1 time today to get a bootstrapping brain dump from you on this. 😁 |
Convert the two existing uses into the callback form. This does not add any new functionality, it only re-arranges implementation of existing functionality.
* conditionalize display of "List known update" in IndividualResource TooltipWrapper * conditionalize display of "Most recent snapshot" in ResourceGroup * conditionalize use of Showcase in ListResources based on length of showcaseCards prop * conditionalize use of SortOptions in ListResources based on initial group lacking a lastUpdated field * extend groups page with custom useDataFetch callback to hit charon/getAvailableResources endpoint
…urces [#870] * conditionalize display of "List known update" in IndividualResource TooltipWrapper * conditionalize display of "Most recent snapshot" in ResourceGroup * conditionalize use of Showcase in ListResources based on length of showcaseCards prop * conditionalize use of SortOptions in ListResources based on initial group lacking a lastUpdated field * extend groups page with custom useDataFetch callback to hit charon/getAvailableResources endpoint
Noting that Heroku deployment is currently blocked on making |
I mean, we could just fix the linting errors highlighted by the failing build step (which you can run locally as well), which'll let this PR be built as a Heroku review app and even merged. Not a great long term state, but doesn't seem like something that should block this work. |
One of the linting errors is ESLint claiming the variable in a function type isn't being used — that is, the linting errors are because we're linting Typescript code with a linter that doesn't understand Typescript. I don't know how to fix that without fixing the linting — maybe I'm missing some angle? |
You can fix the warning by adding the dependency to diff --git a/static-site/src/components/ListResources/index.tsx b/static-site/src/components/ListResources/index.tsx
index 467dec9d..d0443f97 100644
--- a/static-site/src/components/ListResources/index.tsx
+++ b/static-site/src/components/ListResources/index.tsx
@@ -123,6 +123,8 @@ interface ListResourcesResponsiveProps {
defaultGroupLinks: boolean
groupDisplayNames: GroupDisplayNames
showcase: Card[]
+ // <https://github.com/nextstrain/nextstrain.org/issues/905>
+ // eslint-disable-next-line no-unused-vars
parserCallBackFxn: (response: Response) => Promise<{ pathPrefix: string; pathVersions: PathVersions; }>;
}
diff --git a/static-site/src/components/ListResources/useDataFetch.ts b/static-site/src/components/ListResources/useDataFetch.ts
index 49b9634e..372d30a9 100644
--- a/static-site/src/components/ListResources/useDataFetch.ts
+++ b/static-site/src/components/ListResources/useDataFetch.ts
@@ -20,6 +20,8 @@ export function useDataFetch(
versioned: boolean,
defaultGroupLinks: boolean,
groupDisplayNames: GroupDisplayNames,
+ // <https://github.com/nextstrain/nextstrain.org/issues/905>
+ // eslint-disable-next-line no-unused-vars
parserCallBack: (response: Response) => Promise<{ pathPrefix:string, pathVersions:PathVersions }>
) : {groups: Group[] | undefined, dataFetchError: boolean | undefined} {
const [groups, setGroups] = useState<Group[]>();
@@ -66,7 +68,7 @@ export function useDataFetch(
}
fetchAndParse();
- }, [sourceId, versioned, defaultGroupLinks, groupDisplayNames]);
+ }, [sourceId, versioned, defaultGroupLinks, groupDisplayNames, parserCallBack]);
return {groups, dataFetchError}
}
|
Convert the two existing uses into the callback form. This does not add any new functionality, it only re-arranges implementation of existing functionality.
…urces [#870] * conditionalize display of "List known update" in IndividualResource TooltipWrapper * conditionalize display of "Most recent snapshot" in ResourceGroup * conditionalize use of Showcase in ListResources based on length of showcaseCards prop * conditionalize use of SortOptions in ListResources based on initial group lacking a lastUpdated field * extend groups page with custom useDataFetch callback to hit charon/getAvailableResources endpoint
Convert the two existing uses into the callback form. This does not add any new functionality, it only re-arranges implementation of existing functionality.
…urces [#870] * conditionalize display of "List known update" in IndividualResource TooltipWrapper * conditionalize display of "Most recent snapshot" in ResourceGroup * conditionalize use of Showcase in ListResources based on length of showcaseCards prop * conditionalize use of SortOptions in ListResources based on initial group lacking a lastUpdated field * extend groups page with custom useDataFetch callback to hit charon/getAvailableResources endpoint
Added the dep to |
Convert the two existing uses into the callback form. This does not add any new functionality, it only re-arranges implementation of existing functionality.
…urces [#870] * conditionalize display of "List known update" in IndividualResource TooltipWrapper * conditionalize display of "Most recent snapshot" in ResourceGroup * conditionalize use of Showcase in ListResources based on length of showcaseCards prop * conditionalize use of SortOptions in ListResources based on initial group lacking a lastUpdated field * extend groups page with custom useDataFetch callback to hit charon/getAvailableResources endpoint
Convert the two existing uses into the callback form. This does not add any new functionality, it only re-arranges implementation of existing functionality.
…urces [#870] * conditionalize display of "List known update" in IndividualResource TooltipWrapper * conditionalize display of "Most recent snapshot" in ResourceGroup * conditionalize use of Showcase in ListResources based on length of showcaseCards prop * conditionalize use of SortOptions in ListResources based on initial group lacking a lastUpdated field * extend groups page with custom useDataFetch callback to hit charon/getAvailableResources endpoint
…urces [#870] * conditionalize display of "List known update" in IndividualResource TooltipWrapper * conditionalize display of "Most recent snapshot" in ResourceGroup * conditionalize use of Showcase in ListResources based on length of showcaseCards prop * conditionalize use of SortOptions in ListResources based on initial group lacking a lastUpdated field * extend groups page with custom useDataFetch callback to hit charon/getAvailableResources endpoint
Convert the two existing uses into the callback form. This does not add any new functionality, it only re-arranges implementation of existing functionality.
…urces [#870] * conditionalize display of "List known update" in IndividualResource TooltipWrapper * conditionalize display of "Most recent snapshot" in ResourceGroup * conditionalize use of Showcase in ListResources based on length of showcaseCards prop * conditionalize use of SortOptions in ListResources based on initial group lacking a lastUpdated field * extend groups page with custom useDataFetch callback to hit charon/getAvailableResources endpoint
…urces [#870] * conditionalize display of "List known update" in IndividualResource TooltipWrapper * conditionalize display of "Most recent snapshot" in ResourceGroup * conditionalize use of Showcase in ListResources based on length of showcaseCards prop * conditionalize use of SortOptions in ListResources based on initial group lacking a lastUpdated field * extend groups page with custom useDataFetch callback to hit charon/getAvailableResources endpoint
…urces [#870] * conditionalize display of "List known update" in IndividualResource TooltipWrapper * conditionalize display of "Most recent snapshot" in ResourceGroup * conditionalize use of Showcase in ListResources based on length of showcaseCards prop * conditionalize use of SortOptions in ListResources based on initial group lacking a lastUpdated field * extend groups page with custom useDataFetch callback to hit charon/getAvailableResources endpoint
Convert the two existing uses into the callback form. This does not add any new functionality, it only re-arranges implementation of existing functionality.
…urces [#870] * conditionalize display of "List known update" in IndividualResource TooltipWrapper * conditionalize display of "Most recent snapshot" in ResourceGroup * conditionalize use of Showcase in ListResources based on length of showcaseCards prop * conditionalize use of SortOptions in ListResources based on initial group lacking a lastUpdated field * extend groups page with custom useDataFetch callback to hit charon/getAvailableResources endpoint
Convert the two existing uses into the callback form. This does not add any new functionality, it only re-arranges implementation of existing functionality.
…urces [#870] * conditionalize display of "List known update" in IndividualResource TooltipWrapper * conditionalize display of "Most recent snapshot" in ResourceGroup * conditionalize use of Showcase in ListResources based on length of showcaseCards prop * conditionalize use of SortOptions in ListResources based on initial group lacking a lastUpdated field * extend groups page with custom useDataFetch callback to hit charon/getAvailableResources endpoint
…urces [#870] * conditionalize display of "List known update" in IndividualResource TooltipWrapper * conditionalize display of "Most recent snapshot" in ResourceGroup * conditionalize use of Showcase in ListResources based on length of showcaseCards prop * conditionalize use of SortOptions in ListResources based on initial group lacking a lastUpdated field * extend groups page with custom useDataFetch callback to hit charon/getAvailableResources endpoint
Convert the two existing uses into the callback form. This does not add any new functionality, it only re-arranges implementation of existing functionality.
…urces [#870] * make the Resource.lastUpdated property optional * conditionalize display of "List known update" in IndividualResource TooltipWrapper * conditionalize display of "Most recent snapshot" in ResourceGroup * conditionalize use of Showcase in ListResources based on length of showcaseCards prop * conditionalize use of SortOptions in ListResources based on initial group lacking a lastUpdated field * extend groups page with ListResources callback to hit charon/getAvailableResources endpoint
out of scope for the main thrust of the branch, but quiets the typechecker.
…urces [#870] * make the Resource.lastUpdated property optional * conditionalize display of "List known update" in IndividualResource TooltipWrapper * conditionalize display of "Most recent snapshot" in ResourceGroup * conditionalize use of Showcase in ListResources based on length of showcaseCards prop * conditionalize use of SortOptions in ListResources based on initial group lacking a lastUpdated field * extend groups page with ListResources callback to hit charon/getAvailableResources endpoint
out of scope for the main thrust of the branch, but quiets the typechecker.
Convert the two existing uses into the callback form. This does not add any new functionality, it only re-arranges implementation of existing functionality.
…urces [#870] * make the Resource.lastUpdated property optional * conditionalize display of "List known update" in IndividualResource TooltipWrapper * conditionalize display of "Most recent snapshot" in ResourceGroup * conditionalize use of Showcase in ListResources based on length of showcaseCards prop * conditionalize use of SortOptions in ListResources based on initial group lacking a lastUpdated field * extend groups page with ListResources callback to hit charon/getAvailableResources endpoint
out of scope for the main thrust of the branch, but quiets the typechecker.
Convert the two existing uses into the callback form. This does not add any new functionality, it only re-arranges implementation of existing functionality.
…urces [#870] * make the Resource.lastUpdated property optional * conditionalize display of "List known update" in IndividualResource TooltipWrapper * conditionalize display of "Most recent snapshot" in ResourceGroup * conditionalize use of Showcase in ListResources based on length of showcaseCards prop * conditionalize use of SortOptions in ListResources based on initial group lacking a lastUpdated field * extend groups page with ListResources callback to hit charon/getAvailableResources endpoint
out of scope for the main thrust of the branch, but quiets the typechecker.
Convert the two existing uses into the callback form. This does not add any new functionality, it only re-arranges implementation of existing functionality.
…urces [#870] * make the Resource.lastUpdated property optional * conditionalize display of "List known update" in IndividualResource TooltipWrapper * conditionalize display of "Most recent snapshot" in ResourceGroup * conditionalize use of Showcase in ListResources based on length of showcaseCards prop * conditionalize use of SortOptions in ListResources based on initial group lacking a lastUpdated field * extend groups page with ListResources callback to hit charon/getAvailableResources endpoint
out of scope for the main thrust of the branch, but quiets the typechecker.
Replace Datasets DatasetSelect component on groups page with ListResources [#870]
This causes the group name to be rendered as a link to the group page. This still uses the default tooltip, which is (IMO) wrong for the links on the `/groups` page.
* If not provided, defaults to the former hard-coded tooltip value * Includes changes to all `tooltipText` to be provided at to the `ListResources` component, as that's the level that knows what the tooltip for all the card should be As noted in the `FIXME` comment: I'm not wild about the text I came up with for the groups page and would welcome a better phrasing.
Work breakdown:
useDataFetch
code to pull groups data when given appropriate argumentsuseDataFetch
code to transform groups data into expected shape/groups
page to useResourceList
componentconvert narratives into simple list as suggestedfetch()
calls during the card render to hit thegetSourceInfo
endpoint to retrieve theavatar
field and inject it over the default image? (feels expensive.)nextstrain
/groups
The text was updated successfully, but these errors were encountered: