fix: Enable management of notifications without SMTP configured

closes #6046
This commit is contained in:
Tom Moor
2023-10-21 21:36:11 -04:00
parent 9f6c90c86a
commit 3bf35affb1

View File

@@ -139,45 +139,15 @@ function Notifications() {
</Text>
{env.EMAIL_ENABLED ? (
<>
<SettingRow
label={t("Email address")}
name="email"
description={t(
"Your email address should be updated in your SSO provider."
)}
>
<Input type="email" value={user.email} readOnly />
</SettingRow>
<h2>{t("Notifications")}</h2>
{options.map((option) => {
const setting = user.subscribedToEventType(option.event);
return (
<SettingRow
key={option.event}
visible={option.visible}
label={
<Flex align="center" gap={4}>
{option.icon} {option.title}
</Flex>
}
name={option.event}
description={option.description}
>
<Switch
key={option.event}
id={option.event}
name={option.event}
checked={!!setting}
onChange={handleChange}
/>
</SettingRow>
);
})}
</>
<SettingRow
label={t("Email address")}
name="email"
description={t(
"Your email address should be updated in your SSO provider."
)}
>
<Input type="email" value={user.email} readOnly />
</SettingRow>
) : (
<Notice>
<Trans>
@@ -187,6 +157,34 @@ function Notifications() {
</Trans>
</Notice>
)}
<h2>{t("Notifications")}</h2>
{options.map((option) => {
const setting = user.subscribedToEventType(option.event);
return (
<SettingRow
key={option.event}
visible={option.visible}
label={
<Flex align="center" gap={4}>
{option.icon} {option.title}
</Flex>
}
name={option.event}
description={option.description}
>
<Switch
key={option.event}
id={option.event}
name={option.event}
checked={!!setting}
onChange={handleChange}
/>
</SettingRow>
);
})}
</Scene>
);
}