unified selection state (#433)

* selection state

* use unified selection state

* cleanup tests

* remove "console.log"

* remove old selection property

* remove coma
This commit is contained in:
Denys Vuika
2018-06-19 08:16:53 +01:00
committed by GitHub
parent abd63ba0a4
commit 1a53f8d2aa
13 changed files with 171 additions and 169 deletions

View File

@@ -2,13 +2,13 @@
<div class="inner-layout__header">
<adf-breadcrumb root="APP.BROWSE.SEARCH.TITLE">
</adf-breadcrumb>
<adf-toolbar class="inline" *ngIf="hasSelection">
<adf-toolbar class="inline" *ngIf="!selection.isEmpty">
<button
color="primary"
mat-icon-button
*ngIf="selectedFile"
*ngIf="selection.file"
title="{{ 'APP.ACTIONS.VIEW' | translate }}"
(click)="showPreview(selectedFile)">
(click)="showPreview(selection.file)">
<mat-icon>open_in_browser</mat-icon>
</button>
@@ -16,7 +16,7 @@
color="primary"
mat-icon-button
title="{{ 'APP.ACTIONS.DOWNLOAD' | translate }}"
[acaDownloadNodes]="selectedNodes">
[acaDownloadNodes]="selection.nodes">
<mat-icon>get_app</mat-icon>
</button>
@@ -38,24 +38,24 @@
<mat-menu #actionsMenu="matMenu" [overlapTrigger]="false">
<button
mat-menu-item
#selection="adfFavorite"
[adf-node-favorite]="selectedNodes">
<mat-icon color="primary" *ngIf="selection.hasFavorites()">star</mat-icon>
<mat-icon *ngIf="!selection.hasFavorites()">star_border</mat-icon>
#favorites="adfFavorite"
[adf-node-favorite]="selection.nodes">
<mat-icon color="primary" *ngIf="favorites.hasFavorites()">star</mat-icon>
<mat-icon *ngIf="!favorites.hasFavorites()">star_border</mat-icon>
<span>{{ 'APP.ACTIONS.FAVORITE' | translate }}</span>
</button>
<button
mat-menu-item
[acaCopyNode]="selectedNodes">
[acaCopyNode]="selection.nodes">
<mat-icon>content_copy</mat-icon>
<span>{{ 'APP.ACTIONS.COPY' | translate }}</span>
</button>
<button
mat-menu-item
*ngIf="selectedFile"
[acaNodeVersions]="selectedFile">
*ngIf="selection.file"
[acaNodeVersions]="selection.file">
<mat-icon>history</mat-icon>
<span>{{ 'APP.ACTIONS.VERSIONS' | translate }}</span>
</button>
@@ -128,7 +128,7 @@
</div>
</div>
<div class="inner-layout__side-panel" *ngIf="infoDrawerOpened">
<aca-info-drawer [node]="lastSelectedNode"></aca-info-drawer>
<aca-info-drawer [node]="selection.last"></aca-info-drawer>
</div>
</div>
</div>