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> </Text>
{env.EMAIL_ENABLED ? ( {env.EMAIL_ENABLED ? (
<> <SettingRow
<SettingRow label={t("Email address")}
label={t("Email address")} name="email"
name="email" description={t(
description={t( "Your email address should be updated in your SSO provider."
"Your email address should be updated in your SSO provider." )}
)} >
> <Input type="email" value={user.email} readOnly />
<Input type="email" value={user.email} readOnly /> </SettingRow>
</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>
);
})}
</>
) : ( ) : (
<Notice> <Notice>
<Trans> <Trans>
@@ -187,6 +157,34 @@ function Notifications() {
</Trans> </Trans>
</Notice> </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> </Scene>
); );
} }