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

Service catalog item page #535

Merged
merged 1 commit into from
Oct 30, 2024

Conversation

gosiexon-zen
Copy link
Contributor

@gosiexon-zen gosiexon-zen commented Oct 24, 2024

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:
Screenshot 2024-10-29 at 14 53 12

For small screens:
Screenshot 2024-10-29 at 14 51 49

Checklist

  • 📗 all commit messages follow the conventional commits standard
  • ⬅️ changes are compatible with RTL direction
  • ♿ Changes to the UI are tested for accessibility and compliant with WCAG 2.1.
  • 📝 changes are tested in Chrome, Firefox, Safari and Edge
  • 📱 changes are responsive and tested in mobile
  • 👍 PR is approved by @zendesk/vikings

@gosiexon-zen gosiexon-zen requested review from a team as code owners October 24, 2024 11:44
</ToggleButton>
</LeftColumn>
<RightColumn>
{/* Placeholder for Request a service button */}
Copy link

@pfemo pfemo Oct 24, 2024

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?

Copy link
Contributor Author

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.

Copy link

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 🙌

Copy link
Contributor Author

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"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems like there's an issue with the screenshot 😄
image

Copy link
Contributor Author

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.

@kubraokcu kubraokcu added the g11n-commented Commented by Globalization label label Oct 24, 2024
Comment on lines 22 to 23
text-overflow: ellipsis;
width: 100%;
Copy link
Contributor

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

Copy link
Contributor Author

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>
Copy link
Contributor

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, Changed

Comment on lines 48 to 88
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)};
}
`;
Copy link
Contributor

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:

Copy link
Contributor Author

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 = () => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo: toogle

Copy link
Contributor Author

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}>
Copy link
Contributor

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

Copy link
Contributor Author

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

Comment on lines 26 to 38
const Container = styled.div`
display: flex;
flex-direction: row;
justify-content: space-between;
gap: 120px;

@media (max-width: 768px) {
flex-direction: column;
}
`;
Copy link
Contributor

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

Copy link
Contributor Author

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.

Copy link
Contributor Author

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) {
Copy link
Contributor

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

Copy link
Contributor Author

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

Comment on lines +39 to +44
border-bottom: ${(props) => props.theme.borders.sm}
${(props) => getColorV8("grey", 300, props.theme)};
padding-bottom: ${(props) => props.theme.space.lg};
Copy link
Contributor

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

Copy link
Contributor Author

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

Copy link

@kubraokcu kubraokcu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍🏼🌐

@kubraokcu kubraokcu added g11n-approved Commented by Globalization label and removed g11n-commented Commented by Globalization label labels Oct 29, 2024
@gosiexon-zen gosiexon-zen force-pushed the mbien/service-catalog-item-page branch from 48d72ff to 1804f84 Compare October 29, 2024 14:10
Copy link
Contributor

@Fredx87 Fredx87 left a 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 */
Copy link
Contributor

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

@gosiexon-zen gosiexon-zen force-pushed the mbien/service-catalog-item-page branch from 1804f84 to 482b957 Compare October 30, 2024 12:39
@gosiexon-zen gosiexon-zen merged commit 298585b into service-catalog-eap Oct 30, 2024
5 checks passed
@gosiexon-zen gosiexon-zen deleted the mbien/service-catalog-item-page branch October 30, 2024 13:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
g11n-approved Commented by Globalization label
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants