Skip to content

Commit

Permalink
MDL-72544 output: set default core/toast message type to information.
Browse files Browse the repository at this point in the history
Update existing code to set type to warning as appropriate.
  • Loading branch information
paulholden committed Sep 24, 2021
1 parent 214adb7 commit e8d7817
Show file tree
Hide file tree
Showing 13 changed files with 14 additions and 12 deletions.
2 changes: 1 addition & 1 deletion lib/amd/build/copy_to_clipboard.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion lib/amd/build/copy_to_clipboard.min.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion lib/amd/build/toast.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion lib/amd/build/toast.min.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion lib/amd/src/copy_to_clipboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ const displaySuccessToast = copyButton => getSuccessText(copyButton)
* @private
*/
const displayFailureToast = () => getFailureText()
.then(message => addToast(message, {}));
.then(message => addToast(message, {type: 'warning'}));

/**
* Fetches the failure message to show to the user.
Expand Down
3 changes: 2 additions & 1 deletion lib/amd/src/toast.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ export const addToastRegion = async(parent) => {
* @param {Object} configuration
* @param {String} [configuration.title]
* @param {String} [configuration.subtitle]
* @param {String} [configuration.type] Optional type of the toast notification ('success', 'info', 'warning' or 'danger')
* @param {String} [configuration.type=info] Optional type of the toast notification ('success', 'info', 'warning' or 'danger')
* @param {Boolean} [configuration.autohide=true]
* @param {Boolean} [configuration.closeButton=false]
* @param {Number} [configuration.delay=4000]
Expand All @@ -74,6 +74,7 @@ export const addToastRegion = async(parent) => {
export const add = async(message, configuration) => {
const pendingPromise = new Pending('addToastRegion');
configuration = {
type: 'info',
closeButton: false,
autohide: true,
delay: 4000,
Expand Down
Loading

0 comments on commit e8d7817

Please sign in to comment.