-
Notifications
You must be signed in to change notification settings - Fork 403
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
Service catalog item page #535
Service catalog item page #535
Conversation
</ToggleButton> | ||
</LeftColumn> | ||
<RightColumn> | ||
{/* Placeholder for Request a service button */} |
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.
Why not add the request button as well in this PR and have it be a dull button?
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.
Actually we can add it 😄 we have another Jira for that, we usually split view for for different functionalities/parts and create tasks for that.
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.
Ah okay; totally up to you. I just wondered as it seemed like the only thing missing it might have made sense to just include it to reduce overhead of reviews, opening PRs etc. but I'll let you decide what level of separation you prefer 🙌
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.
Right, I added it and adjusted a styles a bit but it still needs some adjustments for mobile view.
- translation: | ||
key: "service-catalog.item.read-more" | ||
title: "Button to show whole description of the service catalog item" | ||
screenshot: "https://drive.google.com/file/d/1pXglNRRqa23LoA7CuZOiAKQAuwkRKFqN/view?usp=drive_link" |
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 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.
Thanks, I fixed the screenshots.
text-overflow: ellipsis; | ||
width: 100%; |
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 need these 2 lines
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.
yep, removed
return ( | ||
<Container> | ||
<LeftColumn> | ||
<ItemTitle>{serviceCatalogItem.name}</ItemTitle> |
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 set tag="h1"
for 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.
Ok, Changed
const ToggleButton = styled(Button)` | ||
margin-top: ${(props) => props.theme.space.sm}; | ||
color: ${(props) => getColorV8("blue", 600, props.theme)}; | ||
font-size: ${(props) => props.theme.fontSizes.md}; | ||
&:hover { | ||
text-decoration: none; | ||
color: ${(props) => getColorV8("blue", 600, props.theme)}; | ||
} | ||
`; |
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 don't think we should force a blue color as in the design, but let Garden use the theme link color, which we are setting here:
"buttons.anchor": css` |
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.
That's true, I followed the design but Guide has it's own theme so I removed the color property here.
const [isExpanded, setIsExpanded] = useState<boolean>(false); | ||
const { t } = useTranslation(); | ||
|
||
const toogleDescription = () => { |
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.
typo: toogle
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.
thanks, changed
<CollapsibleDescription expanded={isExpanded}> | ||
{serviceCatalogItem.description} | ||
</CollapsibleDescription> | ||
<ToggleButton isLink onClick={toogleDescription}> |
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 think we should hide this button for screen readers with aria-hidden="true"
. If the screen reader already reads all the text even if it is clamped to 3 lines, it doesn't make sense to have this button for screen readers. We need to check if the description is red entirely first
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.
Right, screen reader reads all of the description also the hidden part. So I added aria-hidden
const Container = styled.div` | ||
display: flex; | ||
flex-direction: row; | ||
justify-content: space-between; | ||
gap: 120px; | ||
|
||
@media (max-width: 768px) { | ||
flex-direction: column; | ||
} | ||
`; |
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.
Are we sure we want this behavior for mobile? Just flipping the flex-direction and keeping the 120px gap? From the design, it seems that on mobile the button is a sticky footer, but I am not sure.
I also don't like we are setting the gap to an hardcoded 120px value, but if that is the value we don't have alternatives
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 removed the 120px value and changed it to space.xl
and also added this value to the right and left margin property of the columns.
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 changed a bit style for mobile but I will work more on that. I see that we have some global css properties for footer and container and this sticky button doesn't look like the one on the design.
justify-content: space-between; | ||
gap: 120px; | ||
|
||
@media (max-width: 768px) { |
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 not hardcode the breakpoint value but read it from the theme ( p.theme.breakpoints.md
) or use the mediaquery utility
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.
Thanks, changed to the theme variable
border-bottom: ${(props) => props.theme.borders.sm} | ||
${(props) => getColorV8("grey", 300, props.theme)}; | ||
padding-bottom: ${(props) => props.theme.space.lg}; |
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.
Are we sure that we always want to show a bottom border even if no options are available? I think the grey line is more like a separator between the description and the options, but we don't have a design for a page without options.
In any case these border and padding should not be set on the whole column but only on the first part, but it is ok to do it in the PR where we will introduce the options
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.
Ok I will work more on that in the PR with form fields
7a42141
to
48d72ff
Compare
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.
👍🏼🌐
48d72ff
to
1804f84
Compare
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.
Added a comment. For the mobile styles, it is ok to revisit them in the PR with the ticket fields
@media (max-width: ${(props) => props.theme.breakpoints.md}) { | ||
position: sticky; | ||
bottom: 0; | ||
background: white; /* Ensure the button doesn't overlap content */ |
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 should use props.theme.colors.background
, the background could be different than white
1804f84
to
482b957
Compare
Description
Added view for service catalog single item. For now showing only Title and description and button for submmiting a request (without any action). Data is mocked for now as backend is still in development and we are merging into feature branch not master.
Implement rendering the Service Catalog Item Name and description
Screenshots
Collapsible description:
https://github.com/user-attachments/assets/2e672b5e-0bb3-4243-a879-d2358666ab0d
With button:
For small screens:
Checklist