-
Notifications
You must be signed in to change notification settings - Fork 47
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
Alert (Page) and Alert (Inline) #124
Conversation
Add scratch to Showcase (to be made dynamic later)
This pull request is being automatically deployed with Vercel (learn more). hds-components – ./🔍 Inspect: https://vercel.com/hashicorp/hds-components/8Ra9anNWnPASWrTJWrL4qtXKnYMS hds-flight-website – ./🔍 Inspect: https://vercel.com/hashicorp/hds-flight-website/2BezfVQMtMcBtJqDe5xP4wjh23u3 |
|
@didoo @cveigt ready for another look, please LMK what you think: https://hds-components-git-amy-alert-page-hashicorp.vercel.app/components/alert If you have code changes, feel free to suggest, commit to the branch, or make a new branch, whatever is easiest for you I was thinking we could sync later this week once Alert (Compact), isDismissible, and some light testing in cloud-ui is done. I'll set it up, I made a ticket for me to set that up |
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.
@amyrlam in general the code is OK for me, I have left only a few comments.
don't know if you want to already merge this (in which case let me know and I'll approve) and continue to work in a new branch, or instead continue directly on this
packages/components/tests/dummy/app/templates/components/alert.hbs
Outdated
Show resolved
Hide resolved
'highlight', | ||
'success', | ||
]; | ||
export const MAPPING_COLORS_TO_ICONS = { |
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.
@amyrlam notice: for now this works perfectly, but I've just realized that these icons can be filled or not depending if they are in the "compact" alert or not, so it's likely we'll have to move this mapping logic inside the get icon()
method directly, and use the @type/this.type
as an extra condition to determine which icon to use
@amyrlam @Dhaulagiri @MelSumner can you see now the power of moving the logic in the "right" place? can you imagine doing all these conditionals only at template level?
see how it was before
{{#if (or @icon @color)}} | |
<div class="hds-alert__icon"> | |
{{#if @icon}} | |
<FlightIcon @name={{@icon}} @size="24" @isInlineBlock={{false}} /> | |
{{else if (or (eq @color "neutral") (eq @color "highlight"))}} | |
<FlightIcon @name="info" @size="24" @isInlineBlock={{false}} /> | |
{{else if (eq @color "success")}} | |
<FlightIcon @name="check-circle" @size="24" @isInlineBlock={{false}} /> | |
{{else if (eq @color "warning")}} | |
<FlightIcon @name="alert-triangle" @size="24" @isInlineBlock={{false}} /> | |
{{else if (eq @color "critical")}} | |
<FlightIcon @name="alert-octagon" @size="24" @isInlineBlock={{false}} /> | |
{{/if}} |
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 talked about ^^ in a meeting, I'll address the compact type shortly. I get what you're saying now. Compact type has a different mapping of which default icon it informs. It will have some .hbs logic as well, as certain elements will be hidden, but can discuss when up soon
Co-authored-by: Cristiano Rastelli <cristiano.rastelli@hashicorp.com>
@didoo let's merge this in to limit unnecessary branching? also for ease of code review
|
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.
As suggested by @amyrlam merging this in to limit unnecessary branching
📌 Summary
Add Alert Page implementation (right now as the base
Alert
) with styling📸 Screenshots
See https://hds-components-git-amy-alert-page-hashicorp.vercel.app/components/alert
🔗 External links
https://app.asana.com/0/1201630204387510/1201994286157139/f
👀 How to review
👉 Review by files changed
Reviewer's checklist:
💬 Please consider using conventional comments when reviewing this PR.