-
-
Notifications
You must be signed in to change notification settings - Fork 56
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
allow for modifying Alert copy-button behavior #555
Conversation
Use nunjucks-templates to modify AlertDetail copy-button behaviour
✅ Deploy Preview for peaceful-beignet-dcf974 ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
to allow for configuring this web console setting in the backend: alerta/alerta-webui#555
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.
Looks good. Approved together with alerta/alerta#1814 (dependent)
* Add CLIPBOARD_TEMPLATE setting to allow for configuring this web console setting in the backend: alerta/alerta-webui#555 * fix lintin errors * Add test for CLIPBOARD_TEMPLATE setting demonstrate that clipboard_template is returned by the api when CLIPBOARD_TEMPLATE is set in the backend --------- Co-authored-by: Kenneth Hardy <kenneth@hardy.se>
What do you say - does this need more work, or are we fine like this? |
Can you include a screenshot in the PR description? Thanks. |
Actually ignore that. There's probably nothing different. I'll merge. |
Use nunjucks-templates to modify AlertDetail copy-button behavior
Description
Sometimes you want the ability to copy an alert so you can paste into a third party system (slack, email, etc) in human-readable way. This PR allows for setting a nunjuck-template used for formatting the JSON before putting it in the clipboard.
Fixes #522
Changes
clipboard_template
setting is set, the webui uses its contents as template for the AlertDetail copy buttonclipboard_template
is not set, it defaults to previous behaviorIf you think this is a good idea and merge this, I will add PR's for adding the setting in the backend, and also add it to the docs.
Ex:
Provided following alert-json
and this template
would put the following text in your clipboard