-
Notifications
You must be signed in to change notification settings - Fork 174
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
Add generic alert #395
Add generic alert #395
Conversation
Co-Authored-By: jesusreal <[email protected]>
Co-Authored-By: jesusreal <[email protected]>
core/src/Alert.html
Outdated
}) | ||
}); | ||
processedData.links.forEach(l => { | ||
this.addCLickListener(l.url, l.elemId); |
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.
here as well :)
this.addCLickListener(l.url, l.elemId); | |
this.addClickListener(l.url, l.elemId); |
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.
Already pushed that one :)
core/src/Alert.html
Outdated
oncreate() { | ||
const defaultSettings = { | ||
text: | ||
'I am a Luigi alert with extremely relevant information for the user', |
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.
Should we display an alert with the default value? I don't see any values from showing this kind of message. Maybe we shouldn't show the alert at all in this situation?
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.
Great point. I will display a message in the browser console if an alert has no text and will not display the alert in the UI. Additionally, I will remove the default values for alerts, since this makes no sense:
const defaultSettings = {
type: 'info',
links: undefined
};
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.
Alerts work good.
Could you just update the overview page - there are links to the uxManager methods
that redirect to the same view (backdrop, confirmation modal + now it would also be alerts). We can squash those links to just one.
class="fd-form__control" | ||
data-cy="luigi-alert-text" | ||
/> | ||
With text (if alert has not text it is not displayed) |
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.
Tiny thing but: has no text 😉
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.
both updates are done
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 couple of comments to the js file
client/src/luigi-client.js
Outdated
* @param {('info'|'success'|'warning'|'error')} settings.type sets the type of the alert | ||
* @param {Object} settings.links provides links data | ||
* @param {Object} settings.links.LINK_KEY object containing the data for a concrete link. | ||
* Read above on how to use the key to for the link to be properly rendered in the alert message. |
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.
* Read above on how to use the key to for the link to be properly rendered in the alert message. | |
* To properly render the link in the alert message refer to the description of the **settings.links.LINK.KEY** parameter. |
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.
Almost, it is settings.text
instead of settings.links.LINK.KEY
. I will commit it separately.
Co-Authored-By: jesusreal <[email protected]>
Co-Authored-By: jesusreal <[email protected]>
Co-Authored-By: jesusreal <[email protected]>
Co-Authored-By: jesusreal <[email protected]>
Co-Authored-By: jesusreal <[email protected]>
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.
LGTM. Great work!
Description
Changes proposed in this pull request:
Related issue(s)