Refactor feedback handling across components: Replace alert and confirm calls with centralized feedback functions for improved user experience. Update various components to utilize showError, showSuccess, and confirmAction for consistent messaging and confirmation dialogs. Enhance UI responsiveness and maintainability by streamlining feedback logic.

This commit is contained in:
Torsten Schulz (local)
2026-03-19 16:18:51 +01:00
parent 56610dfa4e
commit 814837f47c
35 changed files with 1097 additions and 1017 deletions

View File

@@ -52,6 +52,11 @@ export function showApiError(context, error, fallback = 'tr:error.network') {
showError(context, fallback, fallback);
}
export async function confirmAction(context, options = {}) {
const refs = getRootRefs(context);
return refs.chooseDialog?.open?.(options) ?? false;
}
export default {
install(app) {
const getAppContext = () => app._instance?.proxy;
@@ -61,7 +66,8 @@ export default {
showSuccess: (...args) => showSuccess(getAppContext(), ...args),
showInfo: (...args) => showInfo(getAppContext(), ...args),
showError: (...args) => showError(getAppContext(), ...args),
showApiError: (...args) => showApiError(getAppContext(), ...args)
showApiError: (...args) => showApiError(getAppContext(), ...args),
confirmAction: (...args) => confirmAction(getAppContext(), ...args)
};
}
};