Allow FIELDS_IDS to be overridden
This commit is contained in:
parent
70e60f4afe
commit
37fe1c76b9
|
@ -2,10 +2,11 @@ import RestModel from 'discourse/models/rest';
|
||||||
import { default as computed } from 'ember-addons/ember-computed-decorators';
|
import { default as computed } from 'ember-addons/ember-computed-decorators';
|
||||||
|
|
||||||
const THEME_UPLOAD_VAR = 2;
|
const THEME_UPLOAD_VAR = 2;
|
||||||
const FIELDS_IDS = [0, 1];
|
|
||||||
|
|
||||||
const Theme = RestModel.extend({
|
const Theme = RestModel.extend({
|
||||||
|
|
||||||
|
FIELDS_IDS: [0, 1],
|
||||||
|
|
||||||
@computed('theme_fields')
|
@computed('theme_fields')
|
||||||
themeFields(fields) {
|
themeFields(fields) {
|
||||||
|
|
||||||
|
@ -16,7 +17,7 @@ const Theme = RestModel.extend({
|
||||||
|
|
||||||
let hash = {};
|
let hash = {};
|
||||||
fields.forEach(field => {
|
fields.forEach(field => {
|
||||||
if (!field.type_id || FIELDS_IDS.includes(field.type_id)) {
|
if (!field.type_id || this.get('FIELDS_IDS').includes(field.type_id)) {
|
||||||
hash[this.getKey(field)] = field;
|
hash[this.getKey(field)] = field;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue