-
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
Update group cards further #928
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,9 +15,11 @@ interface ResourceGroupHeaderProps { | |
isCollapsed: boolean | ||
resourcesToShowWhenCollapsed: number | ||
quickLinks: QuickLink[] | ||
tooltipText: string | ||
} | ||
|
||
const ResourceGroupHeader = ({group, isMobile, setCollapsed, collapsible, isCollapsed, resourcesToShowWhenCollapsed, quickLinks}: ResourceGroupHeaderProps) => { | ||
const ResourceGroupHeader = ({group, isMobile, setCollapsed, collapsible, isCollapsed, resourcesToShowWhenCollapsed, quickLinks, tooltipText}: ResourceGroupHeaderProps) => { | ||
if (!tooltipText) tooltipText="Click to load the default (and most recent) analysis"; | ||
const setModalResource = useContext(SetModalResourceContext); | ||
Comment on lines
+22
to
23
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Suggestion: don't set a default here. Make sure every usage of |
||
if (!setModalResource) throw new Error("Context not provided!") | ||
|
||
|
@@ -34,7 +36,7 @@ const ResourceGroupHeader = ({group, isMobile, setCollapsed, collapsible, isColl | |
|
||
<HeaderRow> | ||
{group.groupUrl ? ( | ||
<TooltipWrapper description={`Click to load the default (and most recent) analysis for ${group.groupDisplayName || group.groupName}`}> | ||
<TooltipWrapper description={`${tooltipText} for ${group.groupDisplayName || group.groupName}`}> | ||
<GroupLink style={{ fontSize: '2rem', fontWeight: '500'}} href={group.groupUrl} target="_blank" rel="noreferrer"> | ||
{group.groupDisplayName || group.groupName} | ||
</GroupLink> | ||
|
@@ -118,12 +120,13 @@ interface ResourceGroupProps { | |
numGroups: number | ||
sortMethod: string | ||
quickLinks: QuickLink[] | ||
tooltipText: string | ||
} | ||
|
||
/** | ||
* Displays a single resource group (e.g. a single pathogen) | ||
*/ | ||
export const ResourceGroup = ({group, elWidth, numGroups, sortMethod, quickLinks}: ResourceGroupProps) => { | ||
export const ResourceGroup = ({group, elWidth, numGroups, sortMethod, quickLinks, tooltipText}: ResourceGroupProps) => { | ||
const {collapseThreshold, resourcesToShowWhenCollapsed} = collapseThresolds(numGroups); | ||
const collapsible = group.resources.length > collapseThreshold; | ||
const [isCollapsed, setCollapsed] = useState(collapsible); // if it is collapsible, start collapsed | ||
|
@@ -140,7 +143,7 @@ export const ResourceGroup = ({group, elWidth, numGroups, sortMethod, quickLinks | |
<ResourceGroupHeader group={group} quickLinks={quickLinks} | ||
setCollapsed={setCollapsed} collapsible={collapsible} | ||
isCollapsed={isCollapsed} resourcesToShowWhenCollapsed={resourcesToShowWhenCollapsed} | ||
isMobile={isMobile} | ||
isMobile={isMobile} tooltipText={tooltipText} | ||
/> | ||
|
||
<IndividualResourceContainer $maxResourceWidth={maxResourceWidth}> | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -115,8 +115,12 @@ class GroupsPage extends React.Component { | |
|
||
<ListResources | ||
resourceType="dataset" | ||
defaultGroupLinks={true} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [crystal ball gazing -- not a request for changes] Implicit in the original design is that card titles will become links by simply adding the card name to the current URL. It works well for the groups page (e.g. Also, for what it's worth, the ¹ Depends on how card titles are chosen of course, but the blab group will probably have a "229e" card and /groups/blab/229e is 404. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
I would think on the individual groups page, the titles would not include |
||
versioned={false} | ||
resourceListingCallback={resourceListingCallback}/> | ||
resourceListingCallback={resourceListingCallback} | ||
// FIXME I do not love this text string; suggestions welcome | ||
tooltipText="Click to load the group page" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [suggestion] "Click to view this group in isolation, including additional information specific to that group" Won't look nice if you then tack on There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The Nextstrain docs for Groups call it a "splash page", so we can follow that pattern here: "Click to view the individual group splash page" There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Or something less wordy:
|
||
/> | ||
|
||
<HugeSpacer /> | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are quite a few tooltips within the resources UI, so I'd consider a prop name such as
defaultGroupLinksTooltip
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not the entire text and gets added to later. I would call it something like
groupTooltipPrefix
.