Rename filters indexUids statuses types

This commit is contained in:
Stanislav Romanov 2023-03-02 10:33:09 +03:00
parent 8ef2cb5f8f
commit 6ad43d2851
3 changed files with 20 additions and 23 deletions

View file

@ -10,13 +10,13 @@ export default class AdminTasksIndexController extends Controller {
taskStatuses = taskStatuses;
taskTypes = taskTypes;
queryParams = ['limit', 'status', 'type', 'indexUid'];
queryParams = ['limit', 'statuses', 'types', 'indexUids'];
@tracked limit = 20;
@tracked from;
@tracked status;
@tracked type;
@tracked indexUid;
@tracked statuses;
@tracked types;
@tracked indexUids;
@use
tasks = resource(() => {
@ -25,9 +25,9 @@ export default class AdminTasksIndexController extends Controller {
const params = {
limit: this.limit,
from: this.from,
status: this.status,
type: this.type,
indexUid: this.indexUid,
statuses: this.statuses,
types: this.types,
indexUids: this.indexUids,
};
this.meilisearch.getTasks(params).then((data) => {

View file

@ -8,9 +8,9 @@ export default class AdminTasksIndexRoute extends Route {
queryParams = {
limit: { refreshModel: true },
status: { refreshModel: true },
type: { refreshModel: true },
indexUid: { refreshModel: true },
statuses: { refreshModel: true },
types: { refreshModel: true },
indexUids: { refreshModel: true },
};
model() {

View file

@ -1,31 +1,31 @@
<Headers::H1 @title='Tasks' />
<div class='sm:flex sm:flex-nowrap'>
{{! indexUid }}
{{! indexUids }}
<Form::Listbox
@prefixValue={{'Index: '}}
@value={{nu-co this.indexUid 'none'}}
@value={{nu-co this.indexUids 'none'}}
@values={{map-by 'uid' @model.indexes.results}}
@onChange={{set this 'indexUid'}}
@onChange={{set this 'indexUids'}}
@allowClear={{true}}
/>
{{! status }}
{{! statuses }}
<Form::Listbox
@prefixValue={{'Status: '}}
@value={{nu-co this.status 'none'}}
@value={{nu-co this.statuses 'none'}}
@values={{this.taskStatuses}}
@onChange={{set this 'status'}}
@onChange={{set this 'statuses'}}
@allowClear={{true}}
class='sm:ml-4 sm:flex-none'
/>
{{! status }}
{{! types }}
<Form::Listbox
@prefixValue={{'Type: '}}
@value={{nu-co this.type 'none'}}
@value={{nu-co this.types 'none'}}
@values={{this.taskTypes}}
@onChange={{set this 'type'}}
@onChange={{set this 'types'}}
@allowClear={{true}}
class='sm:ml-4 sm:flex-none'
/>
@ -49,10 +49,7 @@
>{{data.uid}}</LinkTo>
</Column>
<Column @prop='indexUid'>
<LinkTo
@route='admin.indexes.item'
@model={{data.indexUid}}
>{{data.indexUid}}</LinkTo>
{{data.indexUid}}
</Column>
<Column @prop='status'>
<Badge @label={{data.status}} @style={{data.style}} />