Skip to content
Snippets Groups Projects
Unverified Commit 4e8716c6 authored by Alexander Lesnenko's avatar Alexander Lesnenko Committed by GitHub
Browse files

Add approved domains for notifications setting (#17685)

parent 5e961419
No related branches found
No related tags found
No related merge requests found
import { updateIn } from "icepick";
import _ from "underscore";
import { t } from "ttag";
import { PLUGIN_ADMIN_SETTINGS_UPDATES } from "metabase/plugins";
import { hasPremiumFeature } from "metabase-enterprise/settings";
if (hasPremiumFeature("advanced_config")) {
PLUGIN_ADMIN_SETTINGS_UPDATES.push(sections =>
updateIn(sections, ["general", "settings"], settings => {
const index = settings.findIndex(({ key }) => key === "admin-email");
return [
..._.head(settings, index + 1),
{
key: "subscription-allowed-domains",
display_name: t`Approved domains for notifications`,
type: "string",
},
..._.tail(settings, index + 1),
];
}),
);
}
......@@ -7,8 +7,6 @@ MetabaseSettings.docsTag = () => "latest";
MetabaseSettings.isEnterprise = () => true;
// PLUGINS:
// import "./management";
import "./audit_app";
import "./tools";
import "./sandboxes";
......@@ -21,3 +19,4 @@ import "./store";
import "./snippets";
import "./sharing";
import "./moderation";
import "./advanced_config";
......@@ -56,6 +56,8 @@ declare module "underscore" {
declare function any<T>(a: Array<T>, pred: (val: T) => boolean): boolean;
declare function contains<T>(a: Array<T>, val: T): boolean;
declare function head<T>(a: Array<T>, n?: number): Array<T>;
declare function tail<T>(a: Array<T>, n?: number): Array<T>;
declare function initial<T>(a: Array<T>, n?: number): Array<T>;
declare function rest<T>(a: Array<T>, index?: number): Array<T>;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment