Skip to content

Commit 86bd86b

Browse files
authored
Merge pull request #297 from paviliondev/fix_tests_and_deprecations
FIX: tests and deprecations
2 parents 577501e + 777b17f commit 86bd86b

File tree

229 files changed

+5059
-9496
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

229 files changed

+5059
-9496
lines changed

.eslintrc

Lines changed: 0 additions & 3 deletions
This file was deleted.

.prettierrc

Lines changed: 0 additions & 1 deletion
This file was deleted.

.prettierrc.cjs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
module.exports = require("@discourse/lint-configs/prettier");

.template-lintrc.cjs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
module.exports = require("@discourse/lint-configs/template-lint");

.template-lintrc.js

Lines changed: 0 additions & 4 deletions
This file was deleted.

.travis.yml

Lines changed: 0 additions & 10 deletions
This file was deleted.

assets/javascripts/discourse/templates/components/custom-field-input.hbs renamed to assets/javascripts/discourse/components/custom-field-input.hbs

Lines changed: 24 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
1-
{{#if showInputs}}
1+
{{#if this.showInputs}}
22
<td>
33
{{wizard-subscription-selector
4-
value=field.klass
4+
value=this.field.klass
55
feature="custom_field"
66
attribute="klass"
7-
onChange=(action (mut field.klass))
7+
onChange=(action (mut this.field.klass))
88
options=(hash none="admin.wizard.custom_field.klass.select")
99
}}
1010
</td>
1111
<td>
1212
{{wizard-subscription-selector
13-
value=field.type
13+
value=this.field.type
1414
feature="custom_field"
1515
attribute="type"
16-
onChange=(action (mut field.type))
16+
onChange=(action (mut this.field.type))
1717
options=(hash none="admin.wizard.custom_field.type.select")
1818
}}
1919
</td>
@@ -25,48 +25,52 @@
2525
</td>
2626
<td class="multi-select">
2727
{{multi-select
28-
value=field.serializers
29-
content=serializerContent
30-
onChange=(action (mut field.serializers))
28+
value=this.field.serializers
29+
content=this.serializerContent
30+
onChange=(action (mut this.field.serializers))
3131
options=(hash none="admin.wizard.custom_field.serializers.select")
3232
}}
3333
</td>
3434
<td class="actions">
35-
{{#if loading}}
35+
{{#if this.loading}}
3636
{{loading-spinner size="small"}}
3737
{{else}}
38-
{{#if saveIcon}}
39-
{{d-icon saveIcon}}
38+
{{#if this.saveIcon}}
39+
{{d-icon this.saveIcon}}
4040
{{/if}}
4141
{{/if}}
4242
{{d-button
4343
action=(action "destroy")
4444
icon="trash-alt"
4545
class="destroy"
46-
disabled=destroyDisabled
46+
disabled=this.destroyDisabled
4747
}}
4848
{{d-button
4949
icon="save"
5050
action=(action "save")
51-
disabled=saveDisabled
51+
disabled=this.saveDisabled
5252
class="save"
5353
}}
54-
{{d-button action=(action "close") icon="times" disabled=closeDisabled}}
54+
{{d-button
55+
action=(action "close")
56+
icon="times"
57+
disabled=this.closeDisabled
58+
}}
5559
</td>
5660
{{else}}
57-
<td><label>{{field.klass}}</label></td>
58-
<td><label>{{field.type}}</label></td>
59-
<td class="input"><label>{{field.name}}</label></td>
61+
<td><label>{{this.field.klass}}</label></td>
62+
<td><label>{{this.field.type}}</label></td>
63+
<td class="input"><label>{{this.field.name}}</label></td>
6064
<td class="multi-select">
61-
{{#if isExternal}}
65+
{{#if this.isExternal}}
6266
&mdash;
6367
{{else}}
64-
{{#each field.serializers as |serializer|}}
68+
{{#each this.field.serializers as |serializer|}}
6569
<label>{{serializer}}</label>
6670
{{/each}}
6771
{{/if}}
6872
</td>
69-
{{#if isExternal}}
73+
{{#if this.isExternal}}
7074
<td class="external">
7175
<label title={{i18n "admin.wizard.custom_field.external.title"}}>
7276
{{i18n "admin.wizard.custom_field.external.label"}}

assets/javascripts/discourse/components/custom-field-input.js.es6 renamed to assets/javascripts/discourse/components/custom-field-input.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import Component from "@ember/component";
2-
import discourseComputed, { observes } from "discourse-common/utils/decorators";
32
import { alias, equal, or } from "@ember/object/computed";
3+
import discourseComputed, { observes } from "discourse-common/utils/decorators";
44
import I18n from "I18n";
55

66
export default Component.extend({
@@ -17,6 +17,7 @@ export default Component.extend({
1717
isExternal: equal("field.id", "external"),
1818

1919
didInsertElement() {
20+
this._super(...arguments);
2021
this.set("originalField", JSON.parse(JSON.stringify(this.field)));
2122
},
2223

@@ -119,7 +120,12 @@ export default Component.extend({
119120
} else {
120121
this.set("saveIcon", "times");
121122
}
122-
setTimeout(() => this.set("saveIcon", null), 10000);
123+
setTimeout(() => {
124+
if (this.isDestroyed) {
125+
return;
126+
}
127+
this.set("saveIcon", null);
128+
}, 10000);
123129
});
124130
},
125131
},

assets/javascripts/discourse/components/custom-user-selector.js.es6 renamed to assets/javascripts/discourse/components/custom-user-selector.js

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
1+
import { isEmpty } from "@ember/utils";
2+
import Handlebars from "handlebars";
3+
import $ from "jquery";
4+
import TextField from "discourse/components/text-field";
5+
import { renderAvatar } from "discourse/helpers/user-avatar";
6+
import userSearch from "discourse/lib/user-search";
17
import {
28
default as computed,
39
observes,
410
} from "discourse-common/utils/decorators";
5-
import { renderAvatar } from "discourse/helpers/user-avatar";
6-
import userSearch from "discourse/lib/user-search";
711
import I18n from "I18n";
8-
import Handlebars from "handlebars";
9-
import { isEmpty } from "@ember/utils";
10-
import TextField from "discourse/components/text-field";
1112

1213
const template = function (params) {
1314
const options = params.options;

assets/javascripts/discourse/components/custom-wizard-category-selector.js.es6 renamed to assets/javascripts/discourse/components/custom-wizard-category-selector.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import CategorySelector from "select-kit/components/category-selector";
21
import { computed } from "@ember/object";
32
import { makeArray } from "discourse-common/lib/helpers";
3+
import CategorySelector from "select-kit/components/category-selector";
44

55
export default CategorySelector.extend({
66
classNames: ["category-selector", "wizard-category-selector"],

0 commit comments

Comments
 (0)