From 55d8ec05724db8f10e7e67415ba0e4be2d222d3a Mon Sep 17 00:00:00 2001 From: Mark Stacey Date: Mon, 30 Jan 2023 09:37:04 -0330 Subject: [PATCH] Document `displayWarning` as deprecated (#17465) The `displayWarning` action creator will show the error in various different places in the UI. This is confusing for users, we should stop doing this. Instead we can consider each error case separately. If there is a scenario where it's appropriate to tell a user about an error, we should build that case into the relevant UI and use localized error messages. --- ui/store/actions.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/ui/store/actions.js b/ui/store/actions.js index 2d18a4905..c1a66c005 100644 --- a/ui/store/actions.js +++ b/ui/store/actions.js @@ -2358,6 +2358,16 @@ export function hideLoadingIndication() { }; } +/** + * An action creator for display a warning to the user in various places in the + * UI. It will not be cleared until a new warning replaces it or `hideWarning` + * is called. + * + * @deprecated This way of displaying a warning is confusing for users and + * should no longer be used. + * @param {string} text - The warning text to show. + * @returns The action to display the warning. + */ export function displayWarning(text) { return { type: actionConstants.DISPLAY_WARNING,