-
Notifications
You must be signed in to change notification settings - Fork 63
feat(listAll): add listAll and account filter #535
Conversation
# Conflicts: # src/app/shared/shared.module.ts # src/app/spare-drive/spare-drive-filter/spare-drive-filter.component.ts # src/app/vm/vm-filter/vm-filter.component.ts
@@ -40,6 +40,7 @@ export abstract class BaseBackendService<M extends BaseModel> { | |||
} | |||
|
|||
public getList(params?: {}, customApiFormat?: ApiFormat): Observable<Array<M>> { | |||
params = Object.assign(params || {}, { 'listAll': 'true' }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
params equal to {} by default. no need to check params || {}
use Object.assign({}, params, {listall...})
@@ -90,10 +91,20 @@ export class VmListComponent implements OnInit { | |||
this.outputs = { | |||
onClick: this.showDetail | |||
}; | |||
|
|||
if (this.authService.isAdmin()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's better to add this item to groupings and then filter out
return user ? user.name: account; | ||
} | ||
|
||
private sortByAccount(accounts) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this function should take volumes list and accounts
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use accounts = [] by default
private sortByAccount(accounts) { | ||
let result: Array<Volume> = []; | ||
if (accounts && accounts.length != 0) { | ||
accounts.forEach(account => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do return visibleVolumes.filter(volume=> accounts.find(a=>a.name === volume.account)
@ksendart |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remove ROOT/ prefix in Account filter select
# Conflicts: # src/app/shared/shared.module.ts
#305