Skip to content
Snippets Groups Projects
Commit 3494be5e authored by Joanna Kaźmierczak's avatar Joanna Kaźmierczak
Browse files

checkbox in instance view

parent c8bac178
No related branches found
No related tags found
1 merge request!190Resolve "Improve new layout"
......@@ -6,8 +6,8 @@
<input pInputText class="form-control" name="search" id="search" placeholder="Search" type="text" [(ngModel)]="searchValue">
</span>
<div style="display: flex; margin: 0 20px">
<p-checkbox id="show_my" inputId="show_my" binary="true" [(ngModel)]="showAll" (onChange)="onSelectionChange()" [ngModelOptions]="{standalone: true}" ngDefaultControl></p-checkbox>
<label for="show_my" style="text-wrap: nowrap">Show all instances</label>
<p-checkbox id="show_my" inputId="show_my" binary="true" [(ngModel)]="showMy" (onChange)="onSelectionChange()" [ngModelOptions]="{standalone: true}" ngDefaultControl></p-checkbox>
<label for="show_my" style="text-wrap: nowrap">Show only my instances</label>
</div>
<div style="display: flex">
<p-checkbox *domainRoles="['ROLE_DOMAIN_ADMIN', 'ROLE_SYSTEM_ADMIN', 'ROLE_OPERATOR'];domainId:domainId"
......
......@@ -23,7 +23,7 @@ export enum AppInstanceListSelection {
export class AppInstanceListComponent implements OnInit {
public undeployedVisible = false;
public showAll = false;
public showMy = false;
private readonly item_number_key: string = 'item_number_per_page';
private readonly list_selection_key: string = 'list_selection';
......@@ -85,7 +85,7 @@ export class AppInstanceListComponent implements OnInit {
const ls = AppInstanceListSelection[sessionStorage.getItem(this.list_selection_key)];
if (ls !== undefined) {
this.listSelection = ls;
this.showAll = ls === AppInstanceListSelection.ALL;
this.showMy = ls === AppInstanceListSelection.MY;
}
console.log(this.listSelection);
this.userDataService.selectedDomainId.subscribe(domainId => {
......@@ -124,9 +124,9 @@ export class AppInstanceListComponent implements OnInit {
}
public onSelectionChange() {
this.listSelection = this.showAll
? AppInstanceListSelection.ALL
: AppInstanceListSelection.MY;
this.listSelection = this.showMy
? AppInstanceListSelection.MY
: AppInstanceListSelection.ALL;
sessionStorage.setItem(this.list_selection_key, AppInstanceListSelection[this.listSelection]);
this.update(this.domainId);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment