DEV: Update linting (#191)
This commit is contained in:
+15
-16
@@ -2,18 +2,18 @@ GEM
|
||||
remote: https://rubygems.org/
|
||||
specs:
|
||||
ast (2.4.2)
|
||||
json (2.6.3)
|
||||
json (2.7.1)
|
||||
language_server-protocol (3.17.0.3)
|
||||
parallel (1.23.0)
|
||||
parser (3.2.2.4)
|
||||
parallel (1.24.0)
|
||||
parser (3.3.0.3)
|
||||
ast (~> 2.4.1)
|
||||
racc
|
||||
prettier_print (1.2.1)
|
||||
racc (1.7.3)
|
||||
rainbow (3.1.1)
|
||||
regexp_parser (2.8.2)
|
||||
regexp_parser (2.9.0)
|
||||
rexml (3.2.6)
|
||||
rubocop (1.57.2)
|
||||
rubocop (1.59.0)
|
||||
json (~> 2.3)
|
||||
language_server-protocol (>= 3.17.0)
|
||||
parallel (~> 1.10)
|
||||
@@ -21,19 +21,19 @@ GEM
|
||||
rainbow (>= 2.2.2, < 4.0)
|
||||
regexp_parser (>= 1.8, < 3.0)
|
||||
rexml (>= 3.2.5, < 4.0)
|
||||
rubocop-ast (>= 1.28.1, < 2.0)
|
||||
rubocop-ast (>= 1.30.0, < 2.0)
|
||||
ruby-progressbar (~> 1.7)
|
||||
unicode-display_width (>= 2.4.0, < 3.0)
|
||||
rubocop-ast (1.30.0)
|
||||
parser (>= 3.2.1.0)
|
||||
rubocop-capybara (2.19.0)
|
||||
rubocop-capybara (2.20.0)
|
||||
rubocop (~> 1.41)
|
||||
rubocop-discourse (3.4.0)
|
||||
rubocop (>= 1.1.0)
|
||||
rubocop-rspec (>= 2.0.0)
|
||||
rubocop-factory_bot (2.24.0)
|
||||
rubocop (~> 1.33)
|
||||
rubocop-rspec (2.25.0)
|
||||
rubocop-discourse (3.6.0)
|
||||
rubocop (>= 1.59.0)
|
||||
rubocop-rspec (>= 2.25.0)
|
||||
rubocop-factory_bot (2.25.1)
|
||||
rubocop (~> 1.41)
|
||||
rubocop-rspec (2.26.1)
|
||||
rubocop (~> 1.40)
|
||||
rubocop-capybara (~> 2.17)
|
||||
rubocop-factory_bot (~> 2.22)
|
||||
@@ -43,12 +43,11 @@ GEM
|
||||
unicode-display_width (2.5.0)
|
||||
|
||||
PLATFORMS
|
||||
arm64-darwin-21
|
||||
x86_64-linux
|
||||
ruby
|
||||
|
||||
DEPENDENCIES
|
||||
rubocop-discourse
|
||||
syntax_tree
|
||||
|
||||
BUNDLED WITH
|
||||
2.4.21
|
||||
2.5.4
|
||||
|
||||
@@ -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>
|
||||
+4
-7
@@ -1,13 +1,10 @@
|
||||
{
|
||||
"name": "discourse-adplugin",
|
||||
"version": "1.0.0",
|
||||
"repository": "[email protected]:discourse/discourse-adplugin.git",
|
||||
"author": "Discourse",
|
||||
"license": "MIT",
|
||||
"private": true,
|
||||
"devDependencies": {
|
||||
"@discourse/lint-configs": "^1.0.0",
|
||||
"ember-template-lint": "^5.11.2",
|
||||
"eslint": "^8.52.0",
|
||||
"@discourse/lint-configs": "^1.3.5",
|
||||
"ember-template-lint": "^5.13.0",
|
||||
"eslint": "^8.56.0",
|
||||
"prettier": "^2.8.8"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,7 +6,6 @@
|
||||
# version: 1.2.5
|
||||
# authors: Vi and Sarah (@ladydanger and @cyberkoi)
|
||||
# url: https://github.com/discourse/discourse-adplugin
|
||||
# transpile_js: true
|
||||
|
||||
register_asset "stylesheets/adplugin.scss"
|
||||
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
require "rails_helper"
|
||||
|
||||
describe AdPlugin::HouseAdSetting do
|
||||
let(:defaults) { AdPlugin::HouseAdSetting::DEFAULTS }
|
||||
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
require "rails_helper"
|
||||
|
||||
describe AdPlugin::HouseAd do
|
||||
let(:valid_attrs) do
|
||||
{
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
require "rails_helper"
|
||||
|
||||
describe AdPlugin::HouseAdsController do
|
||||
let(:admin) { Fabricate(:admin) }
|
||||
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
require "rails_helper"
|
||||
|
||||
describe AdPlugin::HouseAdSettingsController do
|
||||
let(:admin) { Fabricate(:admin) }
|
||||
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
require "rails_helper"
|
||||
|
||||
RSpec.describe SiteController do
|
||||
fab!(:user) { Fabricate(:user) }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user