Commit 70a88b75 authored by Andreas Fernandez's avatar Andreas Fernandez Committed by Daniel Goerz
Browse files

[TASK] Rephrase notifications in Admin Tools

This patch rephrases the notifications rendered in the Admin Tools. Some
notifications now contain a better description of their respective
meaning or what the consequences of certain actions are.

Additionally, useless rendering of notifications that are never available
in some responses have been removed.

Resolves: #91461
Releases: master, 10.4
Change-Id: I94be58c4ecba2f7c0639866aef830168d2459dba
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/64550


Tested-by: default avatarTYPO3com <noreply@typo3.com>
Tested-by: Daniel Goerz's avatarDaniel Goerz <daniel.goerz@posteo.de>
Reviewed-by: Daniel Goerz's avatarDaniel Goerz <daniel.goerz@posteo.de>
parent b1810f8e
......@@ -83,7 +83,7 @@ class EnvironmentCheck extends AbstractInteractableModule {
$errorBadge.removeClass('label-error').addClass('label-warning').text(warningCount).show();
}
} else {
Notification.error('Something went wrong');
Notification.error('Something went wrong', 'The request was not processed successfully. Please check the browser\'s console and TYPO3\'s log.');
}
},
(error: ResponseError): void => {
......
......@@ -136,7 +136,7 @@ class FolderStructure extends AbstractInteractableModule {
}
this.getStatus();
} else {
Notification.error('Something went wrong');
Notification.error('Something went wrong', 'The request was not processed successfully. Please check the browser\'s console and TYPO3\'s log.');
}
},
(error: ResponseError): void => {
......
......@@ -56,7 +56,7 @@ class ImageProcessing extends AbstractInteractableModule {
Modal.setButtons(data.buttons);
this.runTests();
} else {
Notification.error('Something went wrong');
Notification.error('Something went wrong', 'The request was not processed successfully. Please check the browser\'s console and TYPO3\'s log.');
}
},
(error: ResponseError): void => {
......
......@@ -54,7 +54,7 @@ class MailTest extends AbstractInteractableModule {
modalContent.empty().append(data.html);
Modal.setButtons(data.buttons);
} else {
Notification.error('Something went wrong');
Notification.error('Something went wrong', 'The request was not processed successfully. Please check the browser\'s console and TYPO3\'s log.');
}
},
(error: ResponseError): void => {
......@@ -86,12 +86,12 @@ class MailTest extends AbstractInteractableModule {
$outputContainer.html(aMessage);
});
} else {
Notification.error('Something went wrong');
Notification.error('Something went wrong', 'The request was not processed successfully. Please check the browser\'s console and TYPO3\'s log.');
}
},
(): void => {
// 500 can happen here if the mail configuration is broken
Notification.error('Something went wrong');
Notification.error('Something went wrong', 'The request was not processed successfully. Please check the browser\'s console and TYPO3\'s log.');
},
).finally((): void => {
this.setModalButtonsState(true);
......
......@@ -37,7 +37,7 @@ class PhpInfo extends AbstractInteractableModule {
if (data.success === true) {
modalContent.empty().append(data.html);
} else {
Notification.error('Something went wrong');
Notification.error('Something went wrong', 'The request was not processed successfully. Please check the browser\'s console and TYPO3\'s log.');
}
},
(error: ResponseError): void => {
......
......@@ -37,7 +37,7 @@ class SystemInformation extends AbstractInteractableModule {
if (data.success === true) {
modalContent.empty().append(data.html);
} else {
Notification.error('Something went wrong');
Notification.error('Something went wrong', 'The request was not processed successfully. Please check the browser\'s console and TYPO3\'s log.');
}
},
(error: ResponseError): void => {
......
......@@ -43,7 +43,8 @@ class Cache extends AbstractInlineModule {
// In case the clear cache action fails (typically 500 from server), do not kill the entire
// install tool, instead show a notification that something went wrong.
Notification.error(
'Clearing caches went wrong on the server side. Check the system for broken extensions or missing database tables and try again',
'Clearing caches failed',
'Clearing caches went wrong on the server side. Check the system for broken extensions or missing database tables and try again.',
);
},
)
......
......@@ -75,7 +75,7 @@ class ClearTables extends AbstractInteractableModule {
});
}
} else {
Notification.error('Something went wrong');
Notification.error('Something went wrong', 'The request was not processed successfully. Please check the browser\'s console and TYPO3\'s log.');
}
},
(error: ResponseError): void => {
......@@ -100,10 +100,10 @@ class ClearTables extends AbstractInteractableModule {
const data = await response.resolve();
if (data.success === true && Array.isArray(data.status)) {
data.status.forEach((element: any): void => {
Notification.success(element.message);
Notification.success(element.title, element.message);
});
} else {
Notification.error('Something went wrong');
Notification.error('Something went wrong', 'The request was not processed successfully. Please check the browser\'s console and TYPO3\'s log.');
}
this.getStats();
},
......
......@@ -74,7 +74,7 @@ class ClearTypo3tempFiles extends AbstractInteractableModule {
});
}
} else {
Notification.error('Something went wrong');
Notification.error('Something went wrong', 'The request was not processed successfully. Please check the browser\'s console and TYPO3\'s log.');
}
},
(error: ResponseError): void => {
......@@ -100,11 +100,11 @@ class ClearTypo3tempFiles extends AbstractInteractableModule {
const data = await response.resolve();
if (data.success === true && Array.isArray(data.status)) {
data.status.forEach((element: any): void => {
Notification.success(element.message);
Notification.success(element.title, element.message);
});
this.getStats();
} else {
Notification.error('Something went wrong');
Notification.error('Something went wrong', 'The request was not processed successfully. Please check the browser\'s console and TYPO3\'s log.');
}
},
(error: ResponseError): void => {
......
......@@ -51,7 +51,7 @@ class CreateAdmin extends AbstractInteractableModule {
modalContent.empty().append(data.html);
Modal.setButtons(data.buttons);
} else {
Notification.error('Something went wrong');
Notification.error('Something went wrong', 'The request was not processed successfully. Please check the browser\'s console and TYPO3\'s log.');
}
},
(error: ResponseError): void => {
......@@ -82,14 +82,10 @@ class CreateAdmin extends AbstractInteractableModule {
const data = await response.resolve();
if (data.success === true && Array.isArray(data.status)) {
data.status.forEach((element: any): void => {
if (element.severity === 2) {
Notification.error(element.message);
} else {
Notification.success(element.title);
}
Notification.showMessage(element.title, element.message, element.severity);
});
} else {
Notification.error('Something went wrong');
Notification.error('Something went wrong', 'The request was not processed successfully. Please check the browser\'s console and TYPO3\'s log.');
}
}, (error: ResponseError): void => {
Router.handleAjaxError(error, modalContent);
......
......@@ -65,7 +65,7 @@ class DatabaseAnalyzer extends AbstractInteractableModule {
Modal.setButtons(data.buttons);
this.analyze();
} else {
Notification.error('Something went wrong');
Notification.error('Something went wrong', 'The request was not processed successfully. Please check the browser\'s console and TYPO3\'s log.');
}
},
(error: ResponseError): void => {
......@@ -143,7 +143,7 @@ class DatabaseAnalyzer extends AbstractInteractableModule {
outputContainer.append(InfoBox.render(Severity.ok, 'Database schema is up to date. Good job!', ''));
}
} else {
Notification.error('Something went wrong');
Notification.error('Something went wrong', 'The request was not processed successfully. Please check the browser\'s console and TYPO3\'s log.');
}
},
(error: ResponseError): void => {
......@@ -176,12 +176,10 @@ class DatabaseAnalyzer extends AbstractInteractableModule {
.then(
async (response: AjaxResponse): Promise<any> => {
const data = await response.resolve();
if (data.success === true) {
if (Array.isArray(data.status)) {
data.status.forEach((element: any): void => {
Notification.showMessage(element.title, element.message, element.severity);
});
}
if (Array.isArray(data.status)) {
data.status.forEach((element: any): void => {
Notification.showMessage(element.title, element.message, element.severity);
});
}
this.analyze();
},
......
......@@ -36,13 +36,16 @@ class DumpAutoload extends AbstractInlineModule {
});
}
} else {
Notification.error('Something went wrong');
Notification.error('Something went wrong', 'The request was not processed successfully. Please check the browser\'s console and TYPO3\'s log.');
}
},
(): void => {
// In case the dump action fails (typically 500 from server), do not kill the entire
// install tool, instead show a notification that something went wrong.
Notification.error('Dumping autoload files went wrong on the server side. Check the system for broken extensions and try again');
Notification.error(
'Autoloader not dumped',
'Dumping autoload files failed for unknown reasons. Check the system for broken extensions and try again.'
);
}
)
.finally((): void => {
......
......@@ -32,17 +32,20 @@ class ResetBackendUserUc extends AbstractInlineModule {
if (data.success === true && Array.isArray(data.status)) {
if (data.status.length > 0) {
data.status.forEach((element: any): void => {
Notification.success(element.message);
Notification.success(element.title, element.message);
});
}
} else {
Notification.error('Something went wrong ...');
Notification.error('Something went wrong', 'The request was not processed successfully. Please check the browser\'s console and TYPO3\'s log.');
}
},
(): void => {
// In case the dump action fails (typically 500 from server), do not kill the entire
// In case the reset action fails (typically 500 from server), do not kill the entire
// install tool, instead show a notification that something went wrong.
Notification.error('Dumping autoload files went wrong on the server side. Check the system for broken extensions and try again');
Notification.error(
'Reset preferences of all backend users failed',
'Resetting preferences of all backend users failed for an unknown reason. Please check your server\'s logs for further investigation.'
);
}
)
.finally((): void => {
......
......@@ -50,7 +50,7 @@ class ChangeInstallToolPassword extends AbstractInteractableModule {
modalContent.empty().append(data.html);
Modal.setButtons(data.buttons);
} else {
Notification.error('Something went wrong');
Notification.error('Something went wrong', 'The request was not processed successfully. Please check the browser\'s console and TYPO3\'s log.');
}
},
(error: ResponseError): void => {
......@@ -75,10 +75,10 @@ class ChangeInstallToolPassword extends AbstractInteractableModule {
const data = await response.resolve();
if (data.success === true && Array.isArray(data.status)) {
data.status.forEach((element: any): void => {
Notification.showMessage('', element.message, element.severity);
Notification.showMessage(element.title, element.message, element.severity);
});
} else {
Notification.error('Something went wrong');
Notification.error('Something went wrong', 'The request was not processed successfully. Please check the browser\'s console and TYPO3\'s log.');
}
}, (error: ResponseError): void => {
Router.handleAjaxError(error, modalContent);
......
......@@ -82,11 +82,6 @@ class ExtensionConfiguration extends AbstractInteractableModule {
async (response: AjaxResponse): Promise<any> => {
const data = await response.resolve();
if (data.success === true) {
if (Array.isArray(data.status)) {
data.status.forEach((element: any): void => {
Notification.success(element.title, element.message);
});
}
modalContent.html(data.html);
this.initializeWrap();
}
......@@ -130,7 +125,7 @@ class ExtensionConfiguration extends AbstractInteractableModule {
ModuleMenu.App.refreshMenu();
}
} else {
Notification.error('Something went wrong');
Notification.error('Something went wrong', 'The request was not processed successfully. Please check the browser\'s console and TYPO3\'s log.');
}
},
(error: ResponseError): void => {
......
......@@ -47,7 +47,7 @@ class Features extends AbstractInteractableModule {
modalContent.empty().append(data.html);
Modal.setButtons(data.buttons);
} else {
Notification.error('Something went wrong');
Notification.error('Something went wrong', 'The request was not processed successfully. Please check the browser\'s console and TYPO3\'s log.');
}
},
(error: ResponseError): void => {
......@@ -78,7 +78,7 @@ class Features extends AbstractInteractableModule {
});
this.getContent();
} else {
Notification.error('Something went wrong');
Notification.error('Something went wrong', 'The request was not processed successfully. Please check the browser\'s console and TYPO3\'s log.');
}
},
(error: ResponseError): void => {
......
......@@ -98,11 +98,6 @@ class LocalConfiguration extends AbstractInteractableModule {
async (response: AjaxResponse): Promise<any> => {
const data = await response.resolve();
if (data.success === true) {
if (Array.isArray(data.status)) {
data.status.forEach((element: any): void => {
Notification.success(element.title, element.message);
});
}
modalContent.html(data.html);
Modal.setButtons(data.buttons);
}
......@@ -144,7 +139,7 @@ class LocalConfiguration extends AbstractInteractableModule {
Notification.showMessage(element.title, element.message, element.severity);
});
} else {
Notification.error('Something went wrong');
Notification.error('Something went wrong', 'The request was not processed successfully. Please check the browser\'s console and TYPO3\'s log.');
}
}, (error: ResponseError): void => {
Router.handleAjaxError(error, modalContent);
......
......@@ -62,7 +62,7 @@ class Presets extends AbstractInteractableModule {
modalContent.empty().append(data.html);
Modal.setButtons(data.buttons);
} else {
Notification.error('Something went wrong');
Notification.error('Something went wrong', 'The request was not processed successfully. Please check the browser\'s console and TYPO3\'s log.');
}
},
(error: ResponseError): void => {
......@@ -92,7 +92,7 @@ class Presets extends AbstractInteractableModule {
if (data.success === true && data.html !== 'undefined' && data.html.length > 0) {
modalContent.empty().append(data.html);
} else {
Notification.error('Something went wrong');
Notification.error('Something went wrong', 'The request was not processed successfully. Please check the browser\'s console and TYPO3\'s log.');
}
},
(error: ResponseError): void => {
......@@ -120,7 +120,7 @@ class Presets extends AbstractInteractableModule {
Notification.showMessage(element.title, element.message, element.severity);
});
} else {
Notification.error('Something went wrong');
Notification.error('Something went wrong', 'The request was not processed successfully. Please check the browser\'s console and TYPO3\'s log.');
}
},
(error: ResponseError): void => {
......
......@@ -56,11 +56,6 @@ class SystemMaintainer extends AbstractInteractableModule {
async (response: AjaxResponse): Promise<any> => {
const data = await response.resolve();
if (data.success === true) {
if (Array.isArray(data.status)) {
data.status.forEach((element: any): void => {
Notification.success(element.title, element.message);
});
}
modalContent.html(data.html);
Modal.setButtons(data.buttons);
if (Array.isArray(data.users)) {
......@@ -119,7 +114,7 @@ class SystemMaintainer extends AbstractInteractableModule {
});
}
} else {
Notification.error('Something went wrong');
Notification.error('Something went wrong', 'The request was not processed successfully. Please check the browser\'s console and TYPO3\'s log.');
}
}, (error: ResponseError): void => {
Router.handleAjaxError(error, modalContent);
......
......@@ -122,7 +122,7 @@ class CoreUpdate extends AbstractInteractableModule {
modalContent.empty().append(data.html);
Modal.setButtons(data.buttons);
} else {
Notification.error('Something went wrong');
Notification.error('Something went wrong', 'The request was not processed successfully. Please check the browser\'s console and TYPO3\'s log.');
}
},
(error: ResponseError): void => {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment