setQuickInstall(null)}
- onConfirm={() => {
- const ext = quickInstall;
- setQuickInstall(null);
- if (ext?.latestVersion) void install(ext, ext.latestVersion, false);
- }}
+ role="alertdialog"
+ showClose={false}
title={`Install ${quickInstall?.name ?? ''}?`}
- message={`${quickInstall?.author ? `By ${quickInstall.author.displayName}. ` : ''}It is installed for every user and turned on for them; they can turn it off in their settings. What it may do in each mailbox:`}
- details={quickInstall ? (
+ description={`${quickInstall?.author ? `By ${quickInstall.author.displayName}. ` : ''}${quickPluginsOff
+ ? 'It is installed for every user. Plugins are off for users, so it only runs once you turn them on.'
+ : 'It is installed for every user and turned on for them; they can turn it off in their settings.'} What it may do in each mailbox:`}
+ footer={(
+ <>
+
+ {quickPluginsOff && (
+
+ )}
+
+ >
+ )}
+ >
+ {quickInstall && (
- ) : null}
- confirmText="Install"
- cancelText="Cancel"
- />
+ )}
+
{updates && noticeCount > 0 && (
diff --git a/app/(main)/admin/_pages/turn-on-plugins.ts b/app/(main)/admin/_pages/turn-on-plugins.ts
index 7788026b5..a04dddeca 100644
--- a/app/(main)/admin/_pages/turn-on-plugins.ts
+++ b/app/(main)/admin/_pages/turn-on-plugins.ts
@@ -44,6 +44,18 @@ export async function offerToTurnOnPlugins(
}
}
+/** Whether plugins are off for users; null when the policy can't be read. */
+export async function pluginsOffForUsers(): Promise {
+ try {
+ const res = await apiFetch('/api/admin/policy');
+ if (!res.ok) return null;
+ const policy = (await res.json()) as SettingsPolicy;
+ return !policy.features?.pluginsEnabled;
+ } catch {
+ return null;
+ }
+}
+
/** The line added to the "installed" message for each outcome. */
export function turnOnNote(outcome: TurnOnOutcome): string {
switch (outcome) {