[ADF-4268] Info drawer fixes (#4709)

* show error popups

* proper error handling

* update tests

* update code as per review

* remove old implementation

* remove old code
This commit is contained in:
Denys Vuika
2019-05-13 07:24:49 +01:00
committed by Eugenio Romano
parent fc9f04c6c6
commit bbea17fe37
5 changed files with 86 additions and 34 deletions

View File

@@ -16,7 +16,7 @@
*/
import { Injectable } from '@angular/core';
import { Observable, Subject } from 'rxjs';
import { Subject } from 'rxjs';
import { CardViewBaseItemModel } from '../models/card-view-baseitem.model';
export interface UpdateNotification {
@@ -41,23 +41,18 @@ export function transformKeyToObject(key: string, value): Object {
})
export class CardViewUpdateService {
// Observable sources
private itemUpdatedSource = new Subject<UpdateNotification>();
private itemClickedSource = new Subject<ClickNotification>();
// Observable streams
public itemUpdated$ = <Observable<UpdateNotification>> this.itemUpdatedSource.asObservable();
public itemClicked$ = <Observable<ClickNotification>> this.itemClickedSource.asObservable();
itemUpdated$ = new Subject<UpdateNotification>();
itemClicked$ = new Subject<ClickNotification>();
update(property: CardViewBaseItemModel, newValue: any) {
this.itemUpdatedSource.next({
this.itemUpdated$.next({
target: property,
changed: transformKeyToObject(property.key, newValue)
});
}
clicked(property: CardViewBaseItemModel) {
this.itemClickedSource.next({
this.itemClicked$.next({
target: property
});
}