This repository has been archived by the owner on Mar 25, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 63
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: repair "group by" filter (#1060)
PR Close #1008
- Loading branch information
1 parent
7a765aa
commit 7315b2e
Showing
19 changed files
with
148 additions
and
186 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import { Grouping } from '../models'; | ||
|
||
export function reorderAvailableGroupings(availableGroupings: Grouping[], selectedGroupings: Grouping[]): Grouping[] { | ||
const selectedKeys = selectedGroupings.map(el => el.key); | ||
const notSelected = availableGroupings.filter(el => !selectedKeys.includes(el.key)); | ||
return [ ...selectedGroupings, ...notSelected]; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 8 additions & 9 deletions
17
src/app/ssh-keys/ssh-key-filter/ssh-key-filter.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,20 @@ | ||
import { | ||
Component, | ||
EventEmitter, | ||
Input, | ||
Output | ||
} from '@angular/core'; | ||
import { Grouping } from '../../shared/models/grouping.model'; | ||
|
||
import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core'; | ||
import { Grouping } from '../../shared/models'; | ||
import { reorderAvailableGroupings } from '../../shared/utils/reorder-groupings'; | ||
|
||
@Component({ | ||
selector: 'cs-ssh-key-filter', | ||
templateUrl: 'ssh-key-filter.component.html' | ||
}) | ||
export class ShhKeyFilterComponent { | ||
export class ShhKeyFilterComponent implements OnInit { | ||
@Input() public accounts: Array<Account>; | ||
@Input() public selectedAccountIds: Array<string> = []; | ||
@Input() public selectedGroupings: Array<Grouping> = []; | ||
@Input() public groupings: Array<Grouping>; | ||
@Output() public onGroupingsChange = new EventEmitter<Array<Grouping>>(); | ||
@Output() public onAccountsChange = new EventEmitter<Array<string>>(); | ||
|
||
public ngOnInit() { | ||
this.groupings = reorderAvailableGroupings(this.groupings, this.selectedGroupings); | ||
} | ||
} |
55 changes: 27 additions & 28 deletions
55
src/app/template/containers/template-filter.container.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,30 @@ | ||
<cs-top-bar> | ||
<cs-template-filters | ||
[dialogMode]="dialogMode" | ||
[showIsoSwitch]="showIsoSwitch" | ||
<cs-template-filters | ||
*loading="loading$ | async" | ||
[dialogMode]="dialogMode" | ||
[showIsoSwitch]="showIsoSwitch" | ||
|
||
[accounts]="accounts$ | async" | ||
[domains]="domains$ | async" | ||
[osTypes]="osTypes$ | async" | ||
[zones]="zones$ | async" | ||
[groups]="groups$ | async" | ||
[availableGroupings]="availableGroupings" | ||
[query]="query$ | async" | ||
[accounts]="accounts$ | async" | ||
[domains]="domains$ | async" | ||
[osTypes]="osTypes$ | async" | ||
[zones]="zones$ | async" | ||
[groups]="groups$ | async" | ||
[availableGroupings]="availableGroupings" | ||
[query]="query$ | async" | ||
|
||
[viewMode]="selectedViewMode$ | async" | ||
[selectedAccountIds]="selectedAccountIds$ | async" | ||
[selectedGroupings]="selectedGroupings$ | async" | ||
[selectedZones]="selectedZones$ | async" | ||
[selectedTypes]="selectedTypes$ | async" | ||
[selectedOsFamilies]="selectedOsFamilies$ | async" | ||
[selectedGroups]="selectedGroups$ | async" | ||
[viewMode]="selectedViewMode$ | async" | ||
[selectedAccountIds]="selectedAccountIds$ | async" | ||
[selectedGroupings]="selectedGroupings$ | async" | ||
[selectedZones]="selectedZones$ | async" | ||
[selectedTypes]="selectedTypes$ | async" | ||
[selectedOsFamilies]="selectedOsFamilies$ | async" | ||
[selectedGroups]="selectedGroups$ | async" | ||
|
||
(viewModeChange)="onViewModeChange($event)" | ||
(selectedAccountsChange)="onAccountsChange($event)" | ||
(selectedGroupingsChange)="onGroupingsChange($event)" | ||
(selectedTypesChange)="onTypesChange($event)" | ||
(selectedZonesChange)="onZonesChange($event)" | ||
(selectedGroupsChange)="onGroupsChange($event)" | ||
(selectedOsFamiliesChange)="onOsFamiliesChange($event)" | ||
(queryChange)="onQueryChange($event)" | ||
></cs-template-filters> | ||
</cs-top-bar> | ||
(viewModeChange)="onViewModeChange($event)" | ||
(selectedAccountsChange)="onAccountsChange($event)" | ||
(selectedGroupingsChange)="onGroupingsChange($event)" | ||
(selectedTypesChange)="onTypesChange($event)" | ||
(selectedZonesChange)="onZonesChange($event)" | ||
(selectedGroupsChange)="onGroupsChange($event)" | ||
(selectedOsFamiliesChange)="onOsFamiliesChange($event)" | ||
(queryChange)="onQueryChange($event)" | ||
></cs-template-filters> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.