Skip to content

Commit

Permalink
LINT: make linters happy
Browse files Browse the repository at this point in the history
  • Loading branch information
ZogStriP committed Jan 16, 2025
1 parent 68d955f commit 3d9f356
Showing 1 changed file with 46 additions and 30 deletions.
Original file line number Diff line number Diff line change
@@ -1,38 +1,54 @@
import Component from "@glimmer/component";
import ComboBox from "select-kit/components/combo-box";
import { i18n } from "discourse-i18n";
import { service } from "@ember/service";
import { i18n } from "discourse-i18n";
import ComboBox from "select-kit/components/combo-box";

export default class NotificationLevelWhenAssigned extends Component {
@service siteSettings;
@service siteSettings;

constructor(owner, args) {
super(...arguments);
if (this.siteSettings.assign_enabled) {
args.outletArgs.customAttrNames.push("notification_level_when_assigned");
}
constructor(owner, args) {
super(...arguments);
if (this.siteSettings.assign_enabled) {
args.outletArgs.customAttrNames.push("notification_level_when_assigned");
}
}

get notificationLevelsWhenAssigned() {
// The order matches the "notification level when replying" user preference
return [
{ name: i18n("user.notification_level_when_assigned.watch_topic"), value: "watch_topic" },
{ name: i18n("user.notification_level_when_assigned.track_topic"), value: "track_topic" },
{ name: i18n("user.notification_level_when_assigned.do_nothing"), value: "do_nothing" },
];
}
get notificationLevelsWhenAssigned() {
// The order matches the "notification level when replying" user preference
return [
{
name: i18n("user.notification_level_when_assigned.watch_topic"),
value: "watch_topic",
},
{
name: i18n("user.notification_level_when_assigned.track_topic"),
value: "track_topic",
},
{
name: i18n("user.notification_level_when_assigned.do_nothing"),
value: "do_nothing",
},
];
}

<template>
{{#if this.siteSettings.assign_enabled}}
<div class="controls controls-dropdown" data-setting-name="user-notification-level-when-assigned">
<label>{{i18n "user.notification_level_when_assigned.label"}}</label>
<ComboBox
@content={{this.notificationLevelsWhenAssigned}}
@value={{this.args.outletArgs.model.user_option.notification_level_when_assigned}}
@valueProperty="value"
@onChange={{action (mut this.args.outletArgs.model.user_option.notification_level_when_assigned)}}
/>
</div>
{{/if}}
</template>
}
<template>
{{#if this.siteSettings.assign_enabled}}
<div
class="controls controls-dropdown"
data-setting-name="user-notification-level-when-assigned"
>
<label>{{i18n "user.notification_level_when_assigned.label"}}</label>
<ComboBox
@content={{this.notificationLevelsWhenAssigned}}
@value={{this.args.outletArgs.model.user_option.notification_level_when_assigned}}

Check failure on line 43 in assets/javascripts/discourse/connectors/user-preferences-tracking-topics/notification-level-when-assigned.gjs

View workflow job for this annotation

GitHub Actions / ci / linting

Component templates should avoid "this.args.outletArgs.model.user_option.notification_level_when_assigned" usage, try "@outletArgs.model.user_option.notification_level_when_assigned" instead.
@valueProperty="value"
@onChange={{action
(mut
this.args.outletArgs.model.user_option.notification_level_when_assigned

Check failure on line 47 in assets/javascripts/discourse/connectors/user-preferences-tracking-topics/notification-level-when-assigned.gjs

View workflow job for this annotation

GitHub Actions / ci / linting

Component templates should avoid "this.args.outletArgs.model.user_option.notification_level_when_assigned" usage, try "@outletArgs.model.user_option.notification_level_when_assigned" instead.
)
}}
/>
</div>
{{/if}}
</template>
}

0 comments on commit 3d9f356

Please sign in to comment.