mgr/dashboard: fix linting errors

Signed-off-by: Pere Diaz Bou <pdiazbou@redhat.com>
This commit is contained in:
Pere Diaz Bou 2022-07-05 10:10:23 +02:00
parent 3c308804d5
commit 90869173ee
4 changed files with 11 additions and 3 deletions

View File

@ -167,7 +167,7 @@ describe('IscsiTargetFormComponent', () => {
httpTesting.expectOne('ui-api/iscsi/settings').flush(SETTINGS);
httpTesting.expectOne('ui-api/iscsi/portals').flush(PORTALS);
httpTesting.expectOne('ui-api/iscsi/version').flush(VERSION);
httpTesting.expectOne('api/block/image?offset=0&limit=-1').flush(RBD_LIST);
httpTesting.expectOne('api/block/image?offset=0&limit=-1&search=&sort=%3Ename').flush(RBD_LIST);
httpTesting.expectOne('api/iscsi/target').flush(LIST_TARGET);
httpTesting.verify();
});

View File

@ -658,7 +658,7 @@ export class TableComponent implements AfterContentChecked, OnInit, OnChanges, O
context.search = this.userConfig.search;
if (this.userConfig.sorts?.length) {
const sort = this.userConfig.sorts[0];
context.sort = `${sort.dir == 'desc' ? '<' : '>'}${sort.prop}`;
context.sort = `${sort.dir === 'desc' ? '<' : '>'}${sort.prop}`;
}
this.fetchData.emit(context);
this.updating = true;

View File

@ -171,6 +171,11 @@ paths:
name: search
schema:
type: string
- default: ''
in: query
name: sort
schema:
type: string
responses:
'200':
content:

View File

@ -430,7 +430,8 @@ class RbdService(object):
return joint_refs
@classmethod
def rbd_pool_list(cls, pool_names: List[str], namespace=None, offset=0, limit=0, search='', sort=''):
def rbd_pool_list(cls, pool_names: List[str], namespace=None, offset=0, limit=0,
search='', sort=''):
offset = int(offset)
limit = int(limit)
# let's use -1 to denotate we want ALL images for now. Iscsi currently gathers
@ -451,6 +452,8 @@ class RbdService(object):
result = []
end = offset + limit
if len(sort) < 2:
sort = '>name'
descending = sort[0] == '<'
sort_by = sort[1:]
if sort_by == 'pool_name':