DEV: Update linting (#191)
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
import Ember from "ember";
|
||||
import MultiSelectComponent from "select-kit/components/multi-select";
|
||||
const { makeArray } = Ember;
|
||||
import { computed } from "@ember/object";
|
||||
import { makeArray } from "discourse-common/lib/helpers";
|
||||
import MultiSelectComponent from "select-kit/components/multi-select";
|
||||
|
||||
export default MultiSelectComponent.extend({
|
||||
classNames: ["house-ads-chooser"],
|
||||
@@ -36,7 +35,7 @@ export default MultiSelectComponent.extend({
|
||||
actions: {
|
||||
onChange(value) {
|
||||
const settingValue = makeArray(value).join(this.tokenSeparator);
|
||||
this.attrs.onChange && this.attrs.onChange(settingValue);
|
||||
this.onChange?.(settingValue);
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import Controller, { inject as controller } from "@ember/controller";
|
||||
import { not, or } from "@ember/object/computed";
|
||||
import { inject as service } from "@ember/service";
|
||||
import { ajax } from "discourse/lib/ajax";
|
||||
import { popupAjaxError } from "discourse/lib/ajax-error";
|
||||
import { propertyNotEqual } from "discourse/lib/computed";
|
||||
@@ -8,6 +9,7 @@ import I18n from "I18n";
|
||||
|
||||
export default Controller.extend(bufferedProperty("model"), {
|
||||
adminPluginsHouseAds: controller("adminPlugins.houseAds"),
|
||||
router: service(),
|
||||
|
||||
saving: false,
|
||||
savingStatus: "",
|
||||
@@ -71,7 +73,7 @@ export default Controller.extend(bufferedProperty("model"), {
|
||||
if (!houseAds.includes(model)) {
|
||||
houseAds.pushObject(model);
|
||||
}
|
||||
this.transitionToRoute(
|
||||
this.router.transitionTo(
|
||||
"adminPlugins.houseAds.show",
|
||||
model.get("id")
|
||||
);
|
||||
@@ -96,7 +98,7 @@ export default Controller.extend(bufferedProperty("model"), {
|
||||
const model = this.get("model");
|
||||
|
||||
if (!model.get("id")) {
|
||||
this.transitionToRoute("adminPlugins.houseAds.index");
|
||||
this.router.transitionTo("adminPlugins.houseAds.index");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -105,7 +107,7 @@ export default Controller.extend(bufferedProperty("model"), {
|
||||
})
|
||||
.then(() => {
|
||||
houseAds.removeObject(model);
|
||||
this.transitionToRoute("adminPlugins.houseAds.index");
|
||||
this.router.transitionTo("adminPlugins.houseAds.index");
|
||||
})
|
||||
.catch(popupAjaxError);
|
||||
},
|
||||
|
||||
@@ -1,9 +1,12 @@
|
||||
import { action } from "@ember/object";
|
||||
import { inject as service } from "@ember/service";
|
||||
import DiscourseRoute from "discourse/routes/discourse";
|
||||
|
||||
export default DiscourseRoute.extend({
|
||||
router: service(),
|
||||
|
||||
@action
|
||||
moreSettings() {
|
||||
this.transitionTo("adminSiteSettingsCategory", "ad_plugin");
|
||||
this.router.transitionTo("adminSiteSettingsCategory", "ad_plugin");
|
||||
},
|
||||
});
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<DSection @class="house-ads-settings content-body">
|
||||
<section class="house-ads-settings content-body">
|
||||
<div>{{i18n "admin.adplugin.house_ads.description"}}</div>
|
||||
|
||||
{{#if houseAds.length}}
|
||||
@@ -37,8 +37,8 @@
|
||||
<DButton
|
||||
@label="admin.adplugin.house_ads.more_settings"
|
||||
@icon="cog"
|
||||
class="btn-default"
|
||||
@action={{route-action "moreSettings"}}
|
||||
class="btn-default"
|
||||
/>
|
||||
</form>
|
||||
{{else}}
|
||||
@@ -48,4 +48,4 @@
|
||||
{{/link-to}}
|
||||
</p>
|
||||
{{/if}}
|
||||
</DSection>
|
||||
</section>
|
||||
@@ -1,5 +1,5 @@
|
||||
<DSection @class="edit-house-ad content-body">
|
||||
<h1><TextField @class="house-ad-name" @value={{buffered.name}} /></h1>
|
||||
<section class="edit-house-ad content-body">
|
||||
<h1><TextField @value={{buffered.name}} class="house-ad-name" /></h1>
|
||||
<div class="controls">
|
||||
<AceEditor @content={{buffered.html}} @mode="html" />
|
||||
</div>
|
||||
@@ -7,9 +7,9 @@
|
||||
<div class="visibility-settings">
|
||||
<div>
|
||||
<Input
|
||||
class="visible-to-logged-in-checkbox"
|
||||
@type="checkbox"
|
||||
@checked={{this.buffered.visible_to_logged_in_users}}
|
||||
class="visible-to-logged-in-checkbox"
|
||||
/>
|
||||
<span>{{i18n "admin.adplugin.house_ads.show_to_logged_in_users"}}</span>
|
||||
</div>
|
||||
@@ -27,8 +27,8 @@
|
||||
<DButton
|
||||
@action={{action "save"}}
|
||||
@disabled={{disableSave}}
|
||||
class="btn-primary save-button"
|
||||
@label="admin.adplugin.house_ads.save"
|
||||
class="btn-primary save-button"
|
||||
/>
|
||||
|
||||
{{#if saving}}
|
||||
@@ -41,8 +41,8 @@
|
||||
|
||||
<DButton
|
||||
@action={{action "destroy"}}
|
||||
class="btn-danger delete-button"
|
||||
@label="admin.adplugin.house_ads.delete"
|
||||
class="btn-danger delete-button"
|
||||
/>
|
||||
</div>
|
||||
</DSection>
|
||||
</section>
|
||||
Reference in New Issue
Block a user