notifyStatus implemented

This commit is contained in:
ronronscelestes 2021-09-13 17:35:16 +02:00
parent c343bab43a
commit 3f22cb306d
2 changed files with 12 additions and 2 deletions

View File

@ -17,6 +17,7 @@ import { Grid, GridItem } from '@strapi/parts/Grid';
import { H3 } from '@strapi/parts/Text';
import { TextInput } from '@strapi/parts/TextInput';
import { Button } from '@strapi/parts/Button';
import { useNotifyAT } from '@strapi/parts/LiveRegions';
import CheckIcon from '@strapi/icons/CheckIcon';
import Configuration from './components/Configuration';
import schema from '../../utils/schema';
@ -35,6 +36,7 @@ const SettingsPage = () => {
const toggleNotification = useNotification();
const { formatMessage } = useIntl();
const { lockApp, unlockApp } = useOverlayBlocker();
const { notifyStatus } = useNotifyAT();
useFocusWhenNavigate();
const [formErrors, setFormErrors] = useState({});
@ -98,6 +100,13 @@ const SettingsPage = () => {
fetchEmailSettings()
.then(config => {
notifyStatus(
formatMessage({
id: 'Settings.email.plugin.notification.data.loaded',
defaultMessage: 'Email settings data has been loaded',
})
);
setConfig(config);
const testAddressFound = get(config, 'settings.testAddress');
@ -116,7 +125,7 @@ const SettingsPage = () => {
})
)
.finally(() => setIsLoading(false));
}, [formatMessage, toggleNotification]);
}, [formatMessage, toggleNotification, notifyStatus]);
if (isLoading) {
return (

View File

@ -14,5 +14,6 @@
"Settings.email.plugin.notification.test.error": "Failed to send a test mail to {to}",
"Settings.email.plugin.notification.test.success": "Email test succeeded, check the {to} mailbox",
"Settings.email.plugin.subTitle": "Test the settings for the email plugin",
"Settings.email.plugin.title": "Email settings"
"Settings.email.plugin.title": "Email settings",
"Settings.email.plugin.notification.data.loaded": "Email settings data has been loaded"
}