// Copyright (c) 2019, InfluxFramework LLC
// For license information, please see license.txt

influxframework.ui.form.on("Notification Settings", {
	onload: (frm) => {
		influxframework.breadcrumbs.add({
			label: __("Settings"),
			route: "#modules/Settings",
			type: "Custom",
		});
		frm.set_query("subscribed_documents", () => {
			return {
				filters: {
					istable: 0,
				},
			};
		});
	},

	refresh: (frm) => {
		if (influxframework.user.has_role("System Manager")) {
			frm.add_custom_button(__("Go to Notification Settings List"), () => {
				influxframework.set_route("List", "Notification Settings");
			});
		}
	},
});
