diff --git a/app/controllers/admin/indexes/item/settings.js b/app/controllers/admin/indexes/item/settings.js deleted file mode 100644 index 2a0d847..0000000 --- a/app/controllers/admin/indexes/item/settings.js +++ /dev/null @@ -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](); - // } -} diff --git a/tests/unit/controllers/admin/indexes/item/settings-test.js b/tests/unit/controllers/admin/indexes/item/settings-test.js deleted file mode 100644 index e469112..0000000 --- a/tests/unit/controllers/admin/indexes/item/settings-test.js +++ /dev/null @@ -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); - }); -});