-
Notifications
You must be signed in to change notification settings - Fork 138
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
Improve the Dashboard Landing Page Experience #2615
Conversation
327c323
to
7df36d9
Compare
7df36d9
to
824f816
Compare
45b7464
to
2bad9ba
Compare
showFavorite, | ||
favorite = false, | ||
updateFavorite = () => { | ||
// do nothing |
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.
TBD?
If you legit mean do nothing as a default... maybe use _.noop
just so you don't need to have a comment.
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.
Oh -- well don't add code that has no use 😛 I didn't reverse lookup usage lol
frontend/src/concepts/areas/types.ts
Outdated
@@ -28,6 +28,8 @@ export enum SupportedArea { | |||
USER_MANAGEMENT = 'user-management', | |||
ACCELERATOR_PROFILES = 'accelerator-profiles', | |||
|
|||
HOME = 'home', |
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.
Nit, can we get this at the top of the enum?
@@ -1126,6 +1126,7 @@ export type DashboardCommonConfig = { | |||
disableProjects: boolean; | |||
disableModelServing: boolean; | |||
disableProjectSharing: boolean; | |||
disableHome: boolean; |
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.
Ideally we should add this to the backend type too... we really need one shared type lol
frontend/src/pages/home/Home.tsx
Outdated
<HintBody> | ||
Your home page summarizes the projects you have access to, and includes helpful | ||
resources such as quick starts. | ||
<br /> |
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.
Paragraph tags not a better use-case? It may be a personal feel, but I think if you're going to break a line, you should also have a gap.
<br /> | ||
The old{' '} | ||
<Button | ||
style={{ fontSize: 'initial' }} |
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.
Is this necessary? What is impacting the fontSize?
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.
PF inline link buttons set the font size smaller. This overrides the setting.
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.
Could you log a bug against PF if they cannot provide inline styles like that?
This seems like one of those "override it because it's wrong" and not "we want to do it because we want styles to be prescriptive" -- which has been the DS Projects & Home page goal here.
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.
I would like to see the bug logged as a comment above weird edge-case code so we know when we can remove it
<CardBody> | ||
<Stack hasGutter> | ||
<Bullseye> | ||
<img height={32} src={imgSrc} alt="" /> |
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.
We really shouldn't have no alt
-- fairly certain that violates a11y.
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.
It really depends on the usage of the image. If it's decorative and not meant to convey specific information, an empty alt will allow a decorative image to be hidden: https://www.w3.org/WAI/tutorials/images/decorative/
onSelect: () => void; | ||
} | ||
|
||
const OrganizeCard: React.FC<OrganizeCardProps> = ({ |
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.
Its own file please.
<PageSection data-testid="landing-page-organize" variant="light" {...rest}> | ||
<Stack hasGutter> | ||
<TextContent> | ||
<Text component="h1"> |
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.
Unless this is the Home component, I don't imagine you should say h1
-- since it's not the top level control. Wouldn't this be h2
at the min?
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.
We don't have a single title here so there is no main
h1. a11y folks tell me multiple h1's are better than none.
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.
Yeah, ideally we can have one h1 and then have subsequent h2s that are beneath the h1, to convey the information architecture of the page. However, we couldn't really tell what makes sense to have as the main heading of the page that all of the other headings are a part of. Ideally, we could add another heading that would be the h1, but I imagine that changes the design a bit.
const qsContext = React.useContext<QuickStartContextValues>(QuickStartContext); | ||
const { components, loaded, loadError } = useWatchComponents(false); | ||
const [shownQuickStarts, setShownQuickStarts] = React.useState<OdhDocument[]>([]); | ||
|
||
React.useEffect(() => { | ||
if (loaded && !loadError) { | ||
const quickStarts = | ||
qsContext.allQuickStarts?.slice(0, 4).map((quickStart) => { | ||
const odhDoc = quickStart as unknown as OdhDocument; | ||
const odhApp = components.find((c) => c.metadata.name === odhDoc.spec.appName); | ||
const updatedDoc = { | ||
...odhDoc, | ||
spec: { ...odhDoc.spec, type: OdhDocumentType.QuickStart }, | ||
}; | ||
if (odhApp) { | ||
updatedDoc.spec.appDisplayName = odhApp.spec.displayName; | ||
updatedDoc.spec.img = odhDoc.spec.img || odhApp.spec.img; | ||
updatedDoc.spec.description = odhDoc.spec.description || odhApp.spec.description; | ||
} | ||
return updatedDoc; | ||
}) ?? []; | ||
setShownQuickStarts(quickStarts); | ||
} | ||
}, [loaded, loadError, qsContext.allQuickStarts, components]); |
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.
Dang, this is probably best not done by this component and you just return a list of items, then slice out you 5 -- you're trying to duplicate the wonky logic we have for Components -- which is currently on the backend (so not sharable code 😞).
Can we do a little organization and just make it a hook for "enabled components" or something that you steal the first 5 or filter and steal the first 5?
Also I believe this is a memo with extra steps -- not sure this async methodology is needed.
}; | ||
|
||
const OrganizeSection: React.FC<OrganizeSectionProps> = ({ allowCreateProjects, ...rest }) => { | ||
const { pipelinesServer } = usePipelinesAPI(); |
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.
API is not available outside a project context... I think you mean to check the useIsAreaAvailable
for Pipelines.
frontend/src/pages/home/Home.tsx
Outdated
|
||
const Home: React.FC = () => { | ||
const navigate = useNavigate(); | ||
const [hintHidden, setHintHidden] = useLocalStorage('rhodsNewLandingPageMessage', null); |
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.
2bad9ba
to
8ab998f
Compare
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
PR needs rebase. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
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.
Temp review -- we will break down the PR, so this is not needed changes with this PR.
<Route path="/" element={<HomePage />} /> | ||
<Route path="/applications" element={<InstalledApplications />} /> |
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.
You have a feature flag but it is not going to be used to redirect the home back to InstalledApplications
?
<Button aria-label="close" isInline variant="plain" onClick={onClose}> | ||
<TimesIcon /> | ||
<Button aria-label={closeAlt || 'close'} isInline variant="plain" onClick={onClose}> | ||
<TimesIcon alt={`close ${closeAlt}`} /> |
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.
Shouldn't you default closeAlt
to close
in the props? Wouldn't this just be close
if you omit the property?
<br /> | ||
The old{' '} | ||
<Button | ||
style={{ fontSize: 'initial' }} |
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.
I would like to see the bug logged as a comment above weird edge-case code so we know when we can remove it
|
||
return ( | ||
<> | ||
{!hintHidden ? ( |
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.
can we move this whole hint block into another component? It has a lot of text and nuance that really doesn't belong to the Home page component.
Closes: RHOAISTRAT-119
Description
Adds a new landing page.
Screenshots
How Has This Been Tested?
Test Impact
Request review criteria:
Self checklist (all need to be checked):
If you have UI changes:
After the PR is posted & before it merges:
main