(core) Adding a flag for the UI to check if emails are enabled

Summary:
Front-end code can now test if emails are enabled
and hide some parts of UI based on it.

Test Plan:
Only secondery text was hidden on add users dialog.
Tested manually.

Reviewers: georgegevoian

Reviewed By: georgegevoian

Subscribers: georgegevoian

Differential Revision: https://phab.getgrist.com/D4221
This commit is contained in:
Jarosław Sadziński
2024-04-02 13:22:58 +02:00
parent c87d835533
commit 03ead0d1ca
7 changed files with 23 additions and 12 deletions

View File

@@ -16,6 +16,7 @@ import {
cssMemberText,
} from "app/client/ui/UserItem";
import {createUserImage, cssUserImage} from "app/client/ui/UserImage";
import {getGristConfig} from 'app/common/urlUtils';
import {Computed, computed, dom, DomElementArg, Holder, IDisposableOwner, Observable, styled} from "grainjs";
import {cssMenuItem} from "popweasel";
@@ -111,10 +112,9 @@ export function buildACMemberEmail(
)),
cssMemberText(
cssMemberPrimaryPlus(t("Invite new member")),
cssMemberSecondaryPlus(
// dom.text(use => `We'll email an invite to ${use(emailObs)}`)
dom.text(use => t("We'll email an invite to {{email}}", {email: use(emailObs)})) // TODO i18next
)
getGristConfig().notifierEnabled ? cssMemberSecondaryPlus(
dom.text(use => t("We'll email an invite to {{email}}", {email: use(emailObs)}))
) : null,
),
testId("um-add-email")
)