mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
Aspect List - added spinner and refresh (#6693)
* Adding spinner for loading aspects * Added metadata update and test
This commit is contained in:
@@ -15,6 +15,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { MinimalNode } from '@alfresco/js-api';
|
||||
import { async, TestBed } from '@angular/core/testing';
|
||||
import { CardViewBaseItemModel } from '../models/card-view-baseitem.model';
|
||||
import { CardViewUpdateService, transformKeyToObject } from './card-view-update.service';
|
||||
@@ -82,5 +83,13 @@ describe('CardViewUpdateService', () => {
|
||||
);
|
||||
cardViewUpdateService.clicked(property);
|
||||
}));
|
||||
|
||||
it('should send updated node when aspect changed', async(() => {
|
||||
const fakeNode: MinimalNode = <MinimalNode> { id: 'Bigfoot'};
|
||||
cardViewUpdateService.updatedAspect$.subscribe((node: MinimalNode) => {
|
||||
expect(node.id).toBe('Bigfoot');
|
||||
});
|
||||
cardViewUpdateService.updateNodeAspect(fakeNode);
|
||||
}));
|
||||
});
|
||||
});
|
||||
|
@@ -15,6 +15,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { MinimalNode } from '@alfresco/js-api';
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Subject } from 'rxjs';
|
||||
import { CardViewBaseItemModel } from '../models/card-view-baseitem.model';
|
||||
@@ -44,6 +45,7 @@ export class CardViewUpdateService {
|
||||
itemUpdated$ = new Subject<UpdateNotification>();
|
||||
itemClicked$ = new Subject<ClickNotification>();
|
||||
updateItem$ = new Subject<CardViewBaseItemModel>();
|
||||
updatedAspect$ = new Subject<MinimalNode>();
|
||||
|
||||
update(property: CardViewBaseItemModel, newValue: any) {
|
||||
this.itemUpdated$.next({
|
||||
@@ -66,4 +68,8 @@ export class CardViewUpdateService {
|
||||
this.updateItem$.next(notification);
|
||||
}
|
||||
|
||||
updateNodeAspect(node: MinimalNode) {
|
||||
this.updatedAspect$.next(node);
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user