Remove excess controller
This commit is contained in:
parent
60f79f080a
commit
2c39e0a26d
2 changed files with 0 additions and 106 deletions
|
|
@ -1,92 +0,0 @@
|
|||
import Controller from '@ember/controller';
|
||||
// import { action, get, set } from '@ember/object';
|
||||
// import { capitalize } from '@ember/string';
|
||||
// import arrayEquals from 'meiliadmin/utils/array-equals';
|
||||
// import { ContentSaveOutline, Check, CircleMedium } from 'ember-mdi';
|
||||
|
||||
export default class AdminIndexesItemSettingsController extends Controller {
|
||||
// @action
|
||||
// save(name, value) {
|
||||
// const fnName = `update${capitalize(name)}`;
|
||||
// return this.model.index[fnName](value);
|
||||
// }
|
||||
// @action
|
||||
// async cancel(name) {
|
||||
// console.log(...arguments, this.model[name]);
|
||||
// const fnName = `get${capitalize(name)}`;
|
||||
// this.model[name] = await this.model.index[fnName]();
|
||||
// console.log(this.model[name]);
|
||||
// }
|
||||
// emptyObj = {};
|
||||
// ContentSaveOutline = ContentSaveOutline;
|
||||
// Check = Check;
|
||||
// CircleMedium = CircleMedium;
|
||||
// get rankingRulesFields() {
|
||||
// const arr = [];
|
||||
// // eslint-disable-next-line ember/no-get
|
||||
// const rankingRules = get(this, 'model.settings.rankingRules');
|
||||
// Object.keys(this.model.stats.fieldDistribution).forEach((key) => {
|
||||
// const asc = `${key}:asc`;
|
||||
// const desc = `${key}:desc`;
|
||||
// if (!rankingRules.includes(asc)) {
|
||||
// arr.push(asc);
|
||||
// }
|
||||
// if (!rankingRules.includes(desc)) {
|
||||
// arr.push(desc);
|
||||
// }
|
||||
// });
|
||||
// return arr;
|
||||
// }
|
||||
// @action
|
||||
// selectNewRankingRule(value) {
|
||||
// this.model.settings.rankingRules.addObject(value);
|
||||
// }
|
||||
// @action
|
||||
// removeRankingRule(value) {
|
||||
// this.model.settings.rankingRules.removeObject(value);
|
||||
// }
|
||||
// @action
|
||||
// saveStrToJSON(prop, emptyValue, str) {
|
||||
// if (typeof str !== 'string' || str === '') {
|
||||
// this.model.settings[prop] = emptyValue;
|
||||
// } else {
|
||||
// this.model.settings[prop] = JSON.parse(str);
|
||||
// }
|
||||
// }
|
||||
// @action
|
||||
// save() {
|
||||
// const fields = Object.keys(this.model.stats.fieldDistribution);
|
||||
// const settings = Object.assign({}, this.model.settings);
|
||||
// ['displayedAttributes', 'searchableAttributes'].forEach((prop) => {
|
||||
// if (arrayEquals(settings[prop].sort(), fields.sort())) {
|
||||
// settings[prop] = ['*'];
|
||||
// }
|
||||
// });
|
||||
// return this.model.index.updateSettings(settings);
|
||||
// }
|
||||
// @action
|
||||
// reorderItems(itemModels) {
|
||||
// set(this.model.settings, 'rankingRules', itemModels);
|
||||
// }
|
||||
// @action
|
||||
// setAttributeValue(key, item) {
|
||||
// let arr = this.model[key];
|
||||
// if (arr.length === 1 && arr[0] === '*') {
|
||||
// arr = Array.from(this.model.index.fields);
|
||||
// }
|
||||
// if (arr.includes(item)) {
|
||||
// arr = arr.filter((i) => i !== item);
|
||||
// } else {
|
||||
// arr = arr.concat([item]);
|
||||
// }
|
||||
// set(this.model, key, arr);
|
||||
// }
|
||||
// @action
|
||||
// update(key, value) {
|
||||
// this.model.index[key](value);
|
||||
// }
|
||||
// @action
|
||||
// reset(key) {
|
||||
// this.model.index[key]();
|
||||
// }
|
||||
}
|
||||
|
|
@ -1,14 +0,0 @@
|
|||
import { module, test } from 'qunit';
|
||||
import { setupTest } from 'ember-qunit';
|
||||
|
||||
module('Unit | Controller | admin/indexes/item/settings', function (hooks) {
|
||||
setupTest(hooks);
|
||||
|
||||
// TODO: Replace this with your real tests.
|
||||
test('it exists', function (assert) {
|
||||
let controller = this.owner.lookup(
|
||||
'controller:admin/indexes/item/settings'
|
||||
);
|
||||
assert.ok(controller);
|
||||
});
|
||||
});
|
||||
Loading…
Reference in a new issue