Files
discourse/app/assets/javascripts/discourse/components/groups-form-interaction-fields.js.es6
Jarek Radosz fe588cc7f8 DEV: Fix function prototype deprecations (#8681)
* DEV: Fix the function prototype observers deprecation

DEPRECATION: Function prototype extensions have been deprecated, please migrate from function(){}.observes('foo') to observer('foo', function() {}). [deprecation id: function-prototype-extensions.observes] See https://deprecations.emberjs.com/v3.x/#toc_function-prototype-extensions-observes for more details.

* DEV: Fix the function prototype event listeners deprecation

DEPRECATION: Function prototype extensions have been deprecated, please migrate from function(){}.on('foo') to on('foo', function() {}). [deprecation id: function-prototype-extensions.on] See https://deprecations.emberjs.com/v3.x/#toc_function-prototype-extensions-on for more details.

* DEV: Simplify `default as` imports

Co-authored-by: Joffrey JAFFEUX <j.jaffeux@gmail.com>
2020-01-16 18:56:53 +01:00

58 lines
1.5 KiB
JavaScript

import Component from "@ember/component";
import discourseComputed from "discourse-common/utils/decorators";
export default Component.extend({
init() {
this._super(...arguments);
this.visibilityLevelOptions = [
{
name: I18n.t(
"admin.groups.manage.interaction.visibility_levels.public"
),
value: 0
},
{
name: I18n.t(
"admin.groups.manage.interaction.visibility_levels.logged_on_users"
),
value: 1
},
{
name: I18n.t(
"admin.groups.manage.interaction.visibility_levels.members"
),
value: 2
},
{
name: I18n.t("admin.groups.manage.interaction.visibility_levels.staff"),
value: 3
},
{
name: I18n.t(
"admin.groups.manage.interaction.visibility_levels.owners"
),
value: 4
}
];
this.aliasLevelOptions = [
{ name: I18n.t("groups.alias_levels.nobody"), value: 0 },
{ name: I18n.t("groups.alias_levels.only_admins"), value: 1 },
{ name: I18n.t("groups.alias_levels.mods_and_admins"), value: 2 },
{ name: I18n.t("groups.alias_levels.members_mods_and_admins"), value: 3 },
{ name: I18n.t("groups.alias_levels.owners_mods_and_admins"), value: 4 },
{ name: I18n.t("groups.alias_levels.everyone"), value: 99 }
];
},
@discourseComputed(
"siteSettings.email_in",
"model.automatic",
"currentUser.admin"
)
showEmailSettings(emailIn, automatic, isAdmin) {
return emailIn && isAdmin && !automatic;
}
});