* fix(config): delete KeyAction binding of deleted macro * refactor: use sorter import * fix(macro): read the macro id from route params * fix(keyAction): use NoneAction in keyAction mapping
30 lines
924 B
TypeScript
30 lines
924 B
TypeScript
import { ChangeDetectionStrategy, Component } from '@angular/core';
|
|
import { Store } from '@ngrx/store';
|
|
import { Observable } from 'rxjs/Observable';
|
|
|
|
import { Notification } from 'uhk-common';
|
|
import { AppState, getUndoableNotification } from '../../store';
|
|
import { DismissUndoNotificationAction, UndoLastAction } from '../../store/actions/app';
|
|
|
|
@Component({
|
|
selector: 'uhk-header',
|
|
templateUrl: './uhk-header.html',
|
|
changeDetection: ChangeDetectionStrategy.OnPush
|
|
})
|
|
export class UhkHeader {
|
|
undoableNotification$: Observable<Notification>;
|
|
|
|
constructor(private store: Store<AppState>) {
|
|
this.undoableNotification$ = this.store.select(getUndoableNotification);
|
|
}
|
|
|
|
onUndoLastNotification(data: any): void {
|
|
this.store.dispatch(new UndoLastAction(data));
|
|
}
|
|
|
|
onDismissLastNotification(): void {
|
|
this.store.dispatch(new DismissUndoNotificationAction());
|
|
}
|
|
|
|
}
|