[ACA-1045] use ADF favorite node directive (#118)

This commit is contained in:
Cilibiu Bogdan
2017-12-06 20:29:41 +02:00
committed by Denys Vuika
parent 6625ddf845
commit 8424fc8cdb
16 changed files with 20 additions and 570 deletions

View File

@@ -33,10 +33,10 @@
class="secondary-options">
<button
mat-menu-item
#favorite="favorite"
[app-favorite-node]="documentList.selection">
<mat-icon [ngClass]="{ 'icon-highlight': favorite.hasFavorites() }">
{{ favorite.hasFavorites() ? 'star' :'star_border' }}
#selection="adfFavorite"
[adf-node-favorite]="documentList.selection">
<mat-icon [ngClass]="{ 'icon-highlight': selection.hasFavorites() }">
{{ selection.hasFavorites() ? 'star' :'star_border' }}
</mat-icon>
<span>{{ 'APP.ACTIONS.FAVORITE' | translate }}</span>
</button>

View File

@@ -98,14 +98,6 @@ describe('RecentFiles Routed Component', () => {
expect(component.refresh).toHaveBeenCalled();
});
it('should reload on toggleFavorite event', () => {
fixture.detectChanges();
contentService.toggleFavorite.next();
expect(component.refresh).toHaveBeenCalled();
});
it('should reload on move node event', () => {
fixture.detectChanges();

View File

@@ -46,8 +46,7 @@ export class RecentFilesComponent extends PageComponent implements OnInit, OnDes
this.subscriptions = this.subscriptions.concat([
this.content.deleteNode.subscribe(() => this.refresh()),
this.content.moveNode.subscribe(() => this.refresh()),
this.content.restoreNode.subscribe(() => this.refresh()),
this.content.toggleFavorite.subscribe(() => this.refresh())
this.content.restoreNode.subscribe(() => this.refresh())
]);
}