-
Notifications
You must be signed in to change notification settings - Fork 49
feat: temporarily updated tooltip content for workspace naming guidel… #1880
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
base: master
Are you sure you want to change the base?
Conversation
Reviewer's GuideTemporarily hide the inline “Learn more” link in the workspace naming guidelines tooltip by replacing it with an empty string and commenting out the original Button, expand the default guideline message with example names and a placeholder link, and sync locale resource files to reflect these message updates. Class diagram for updated workspace naming guidelines messageclassDiagram
class Messages {
+workspaceNamingGuidelines: string
+workspaceDescriptionMaxLength: string
...
}
Messages : +workspaceNamingGuidelines now includes example names and no link
Messages : -defaultMessage changed
Messages : -link replaced with empty string in tooltip
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
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.
Hey @radekkaluzik - I've reviewed your changes and they look great!
Prompt for AI Agents
Please address the comments from this code review:
## Individual Comments
### Comment 1
<location> `src/smart-components/workspaces/create-workspace/schema.tsx:93` </location>
<code_context>
- {intl.formatMessage(messages.learnMore)}
- </Button>
- ),
+ link: '', // RHCLOUD-40659: Temporarily hidden link until Learn More section is ready
+ // link: (
+ // <Button variant="link" href="#" isInline>
</code_context>
<issue_to_address>
Passing an empty string for the 'link' value may result in awkward message rendering.
Consider updating the message template to handle cases where 'link' is empty, such as omitting the placeholder or adjusting formatting to avoid awkward output.
Suggested implementation:
```typescript
values={{
// Pass undefined for link to omit it from the message if not present
link: undefined, // RHCLOUD-40659: Temporarily hidden link until Learn More section is ready
// link: (
// <Button variant="link" href="#" isInline>
// {intl.formatMessage(messages.learnMore)}
// </Button>
// ),
}}
```
You must also update the message template for `workspaceNamingGuidelines` in your `messages` definition (likely in a file such as `src/smart-components/workspaces/messages.ts` or similar).
Change the template to conditionally include the link, for example:
```
defaultMessage: 'Your workspace name must follow the guidelines.{link, select, undefined {} other { {link}}}'
```
Or, if using ICU message syntax, you can use:
```
defaultMessage: 'Your workspace name must follow the guidelines.{link}'
```
And ensure that if `link` is undefined, nothing is rendered in its place.
This ensures that when `link` is not provided, the message renders cleanly without awkward formatting.
</issue_to_address>
### Comment 2
<location> `src/Messages.js:1276` </location>
<code_context>
id: 'workspaceNamingGuidelines',
description: 'Workspace naming guidelines hint',
- defaultMessage: '{link} about the guidelines for naming your workspaces.',
+ defaultMessage:
+ 'Use clear, descriptive workspace names like "Production North America" or "Project-X" to organize assets, control access, and simplify management.{link}',
},
workspaceDescriptionMaxLength: {
</code_context>
<issue_to_address>
The new defaultMessage always includes the {link} placeholder, which may not be appropriate if the link is hidden.
If {link} is not provided, the message may display awkwardly. Consider making the {link} section conditional or creating separate messages for cases with and without the link.
Suggested implementation:
```javascript
workspaceNamingGuidelines: {
id: 'workspaceNamingGuidelines',
description: 'Workspace naming guidelines hint (with link)',
defaultMessage:
'Use clear, descriptive workspace names like "Production North America" or "Project-X" to organize assets, control access, and simplify management. {link}',
},
workspaceNamingGuidelinesNoLink: {
id: 'workspaceNamingGuidelinesNoLink',
description: 'Workspace naming guidelines hint (no link)',
defaultMessage:
'Use clear, descriptive workspace names like "Production North America" or "Project-X" to organize assets, control access, and simplify management.',
},
```
You will also need to update the code that consumes `workspaceNamingGuidelines` to use `workspaceNamingGuidelinesNoLink` when the link is not present, and `workspaceNamingGuidelines` when the link is present.
</issue_to_address>
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
{intl.formatMessage(messages.learnMore)} | ||
</Button> | ||
), | ||
link: '', // RHCLOUD-40659: Temporarily hidden link until Learn More section is ready |
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.
suggestion: Passing an empty string for the 'link' value may result in awkward message rendering.
Consider updating the message template to handle cases where 'link' is empty, such as omitting the placeholder or adjusting formatting to avoid awkward output.
Suggested implementation:
values={{
// Pass undefined for link to omit it from the message if not present
link: undefined, // RHCLOUD-40659: Temporarily hidden link until Learn More section is ready
// link: (
// <Button variant="link" href="#" isInline>
// {intl.formatMessage(messages.learnMore)}
// </Button>
// ),
}}
You must also update the message template for workspaceNamingGuidelines
in your messages
definition (likely in a file such as src/smart-components/workspaces/messages.ts
or similar).
Change the template to conditionally include the link, for example:
defaultMessage: 'Your workspace name must follow the guidelines.{link, select, undefined {} other { {link}}}'
Or, if using ICU message syntax, you can use:
defaultMessage: 'Your workspace name must follow the guidelines.{link}'
And ensure that if link
is undefined, nothing is rendered in its place.
This ensures that when link
is not provided, the message renders cleanly without awkward formatting.
defaultMessage: | ||
'Use clear, descriptive workspace names like "Production North America" or "Project-X" to organize assets, control access, and simplify management.{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.
suggestion: The new defaultMessage always includes the {link} placeholder, which may not be appropriate if the link is hidden.
If {link} is not provided, the message may display awkwardly. Consider making the {link} section conditional or creating separate messages for cases with and without the link.
Suggested implementation:
workspaceNamingGuidelines: {
id: 'workspaceNamingGuidelines',
description: 'Workspace naming guidelines hint (with link)',
defaultMessage:
'Use clear, descriptive workspace names like "Production North America" or "Project-X" to organize assets, control access, and simplify management. {link}',
},
workspaceNamingGuidelinesNoLink: {
id: 'workspaceNamingGuidelinesNoLink',
description: 'Workspace naming guidelines hint (no link)',
defaultMessage:
'Use clear, descriptive workspace names like "Production North America" or "Project-X" to organize assets, control access, and simplify management.',
},
You will also need to update the code that consumes workspaceNamingGuidelines
to use workspaceNamingGuidelinesNoLink
when the link is not present, and workspaceNamingGuidelines
when the link is present.
Description
This is just a temporary update of the Tooltip Content since the Learn more section is not yet finished. It is expected to get back to the previous code later on which is why some parts of the code are commented out.
RHCLOUD-40659
Screenshots
Checklist ☑️
Summary by Sourcery
Temporarily update the workspace naming guidelines tooltip content and hide the Learn More link until the detailed section is complete.
Enhancements: