{{i18n "admin.config_areas.flags.description"}} | diff --git a/app/assets/javascripts/admin/addon/controllers/admin-config-flags-settings.js b/app/assets/javascripts/admin/addon/controllers/admin-config-flags-settings.js new file mode 100644 index 00000000000..99ca29e0cda --- /dev/null +++ b/app/assets/javascripts/admin/addon/controllers/admin-config-flags-settings.js @@ -0,0 +1,12 @@ +import Controller from "@ember/controller"; +import { action } from "@ember/object"; + +export default class AdminConfigFlagsSettingsController extends Controller { + filter = ""; + queryParams = ["filter"]; + + @action + filterChangedCallback(filterData) { + this.set("filter", filterData.filter); + } +} diff --git a/app/assets/javascripts/admin/addon/controllers/admin-config-flags.js b/app/assets/javascripts/admin/addon/controllers/admin-config-flags.js new file mode 100644 index 00000000000..d551e80283a --- /dev/null +++ b/app/assets/javascripts/admin/addon/controllers/admin-config-flags.js @@ -0,0 +1,12 @@ +import Controller from "@ember/controller"; +import { service } from "@ember/service"; + +export default class AdminConfigFlagsSettingsController extends Controller { + @service router; + + get hideTabs() { + return ["adminConfig.flags.new", "adminConfig.flags.edit"].includes( + this.router.currentRouteName + ); + } +} diff --git a/app/assets/javascripts/admin/addon/routes/admin-config-flags-edit.js b/app/assets/javascripts/admin/addon/routes/admin-config-flags-edit.js index f8fc09a4d2f..bbeeba7d0f3 100644 --- a/app/assets/javascripts/admin/addon/routes/admin-config-flags-edit.js +++ b/app/assets/javascripts/admin/addon/routes/admin-config-flags-edit.js @@ -1,10 +1,15 @@ -import Route from "@ember/routing/route"; import { service } from "@ember/service"; +import DiscourseRoute from "discourse/routes/discourse"; +import I18n from "discourse-i18n"; -export default class AdminConfigFlagsEditRoute extends Route { +export default class AdminConfigFlagsEditRoute extends DiscourseRoute { @service site; model(params) { return this.site.flagTypes.findBy("id", parseInt(params.flag_id, 10)); } + + titleToken() { + return I18n.t("admin.config_areas.flags.edit_header"); + } } diff --git a/app/assets/javascripts/admin/addon/routes/admin-config-flags-settings.js b/app/assets/javascripts/admin/addon/routes/admin-config-flags-settings.js new file mode 100644 index 00000000000..ee2d03bfa58 --- /dev/null +++ b/app/assets/javascripts/admin/addon/routes/admin-config-flags-settings.js @@ -0,0 +1,8 @@ +import DiscourseRoute from "discourse/routes/discourse"; +import I18n from "discourse-i18n"; + +export default class AdminConfigFlagsIndexRoute extends DiscourseRoute { + titleToken() { + return I18n.t("admin.config_areas.flags.settings"); + } +} diff --git a/app/assets/javascripts/admin/addon/routes/admin-route-map.js b/app/assets/javascripts/admin/addon/routes/admin-route-map.js index 98feb3260b0..2f7704c042b 100644 --- a/app/assets/javascripts/admin/addon/routes/admin-route-map.js +++ b/app/assets/javascripts/admin/addon/routes/admin-route-map.js @@ -214,6 +214,7 @@ export default function () { this.route("index", { path: "/" }); this.route("new"); this.route("edit", { path: "/:flag_id" }); + this.route("settings"); }); this.route("about"); diff --git a/app/assets/javascripts/admin/addon/templates/config-flags-settings.hbs b/app/assets/javascripts/admin/addon/templates/config-flags-settings.hbs new file mode 100644 index 00000000000..57d321fcbcc --- /dev/null +++ b/app/assets/javascripts/admin/addon/templates/config-flags-settings.hbs @@ -0,0 +1,5 @@ +
---|