* schema file undelete description * update with main * update with origin * update * create controller; hook up to badge_achievements * almost done with implementation * push up what I have * complete implementation; generalize snackbar usage * start writing tests * add confirmation text entry step to test * Fix delete via JS * implement danger notice for errors * complete cypress test * create ErrorAlert CustomEvent and implement * fix failing badge_achievements spec * start applying PR review changes * hook up Preact Modal * fix cypress tests * remove old comment Co-authored-by: Nick Taylor <nick@forem.com> * consolidate messaging functions Co-authored-by: Michael Kohl <citizen428@forem.com> Co-authored-by: Nick Taylor <nick@forem.com>
31 lines
823 B
JavaScript
31 lines
823 B
JavaScript
/**
|
|
* A function to generate an error alert within the /admin/ space.
|
|
*
|
|
* @function errorAlert
|
|
* @param {Object} modalProps Properties of the Error Alert
|
|
* @param {string} modalProps.errMsg The error message displayed within the alert.
|
|
*/
|
|
|
|
export const displayErrorAlert = function (errMsg) {
|
|
return document.dispatchEvent(
|
|
new CustomEvent('error:generate', {
|
|
detail: { errMsg },
|
|
}),
|
|
);
|
|
};
|
|
|
|
/**
|
|
* A function to generate a snackbar within the /admin/ space.
|
|
*
|
|
* @function displaySnackbar
|
|
* @param {Object} modalProps Properties of the Snackbar
|
|
* @param {string} modalProps.message The message displayed within the snackbar.
|
|
*/
|
|
|
|
export const displaySnackbar = function (message) {
|
|
return document.dispatchEvent(
|
|
new CustomEvent('snackbar:add', {
|
|
detail: { message },
|
|
}),
|
|
);
|
|
};
|