mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-31 17:38:48 +00:00
[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:
committed by
Eugenio Romano
parent
fc9f04c6c6
commit
bbea17fe37
@@ -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
|
||||
});
|
||||
}
|
||||
|
Reference in New Issue
Block a user