Clear code
This commit is contained in:
parent
92446c3196
commit
300bf883e3
5 changed files with 17 additions and 42 deletions
|
|
@ -10,7 +10,7 @@ Router.map(function () {
|
|||
this.route('admin', function () {
|
||||
this.route('indexes', function () {
|
||||
this.route('item', { path: '/:index_uid' }, function () {
|
||||
this.route('settings', function () {});
|
||||
this.route('settings');
|
||||
this.route('info');
|
||||
this.route('edit');
|
||||
this.route('documents', function () {
|
||||
|
|
|
|||
|
|
@ -150,7 +150,7 @@ export const settings = [
|
|||
return item;
|
||||
});
|
||||
|
||||
const allSettings = {
|
||||
settings.unshift({
|
||||
uri: urlSettingsPrefix,
|
||||
fileMatch: [urlSettingsPrefix],
|
||||
schema: {
|
||||
|
|
@ -163,17 +163,9 @@ const allSettings = {
|
|||
}, {}),
|
||||
additionalProperties: false,
|
||||
},
|
||||
};
|
||||
});
|
||||
|
||||
settings.unshift(allSettings);
|
||||
|
||||
// TODO: do it async, not in main stream
|
||||
// languages.json.jsonDefaults.setDiagnosticsOptions({
|
||||
// validate: true,
|
||||
// schemas: indexSettings,
|
||||
// });
|
||||
|
||||
export default class AdminIndexesItemSettingsIndexRoute extends Route {
|
||||
export default class AdminIndexesItemSettingsRoute extends Route {
|
||||
model() {
|
||||
const index = this.modelFor('admin.indexes.item');
|
||||
|
||||
|
|
@ -1,6 +1,14 @@
|
|||
{{!-- <Tabs>
|
||||
<Tab @route="admin.indexes.item.settings.index" @text="All" />
|
||||
<Tab @route="admin.indexes.item.settings.specific" @text="Specific" />
|
||||
</Tabs> --}}
|
||||
<Form::Listbox
|
||||
@value={{this.model.currentSetting}}
|
||||
@values={{this.model.settings}}
|
||||
@onChange={{set this.model 'currentSetting'}}
|
||||
class="w-72"
|
||||
as |setting|
|
||||
>
|
||||
{{if setting.name (namelize setting.name) 'All settings'}}
|
||||
</Form::Listbox>
|
||||
|
||||
{{outlet}}
|
||||
<IndexSetting
|
||||
@setting={{this.model.currentSetting}}
|
||||
@index={{this.model.index}}
|
||||
/>
|
||||
|
|
|
|||
|
|
@ -1,14 +0,0 @@
|
|||
<Form::Listbox
|
||||
@value={{this.model.currentSetting}}
|
||||
@values={{this.model.settings}}
|
||||
@onChange={{set this.model 'currentSetting'}}
|
||||
class="w-72"
|
||||
as |setting|
|
||||
>
|
||||
{{if setting.name (namelize setting.name) 'All settings'}}
|
||||
</Form::Listbox>
|
||||
|
||||
<IndexSetting
|
||||
@setting={{this.model.currentSetting}}
|
||||
@index={{this.model.index}}
|
||||
/>
|
||||
|
|
@ -1,11 +0,0 @@
|
|||
import { module, test } from 'qunit';
|
||||
import { setupTest } from 'meiliadmin/tests/helpers';
|
||||
|
||||
module('Unit | Route | admin/indexes/item/settings/index', function (hooks) {
|
||||
setupTest(hooks);
|
||||
|
||||
test('it exists', function (assert) {
|
||||
let route = this.owner.lookup('route:admin/indexes/item/settings/index');
|
||||
assert.ok(route);
|
||||
});
|
||||
});
|
||||
Loading…
Reference in a new issue