[ACS-5839] migrate to latest JS-API types (#8859)

* [ci:force] migrate Minimal Node to Node

* [ci:force] remove js-api wrappers and use real types

* [ci:force] remove js-api wrappers and use real types

* [ci:force] fix linting errors

* [ci:force] fix linting errors

* [ci:force] security fixes

* [ci:force] sonarcloud bug fixes

* [ci:force] dead code elimination, sonar suggested fixes
This commit is contained in:
Denys Vuika
2023-08-29 20:56:40 +01:00
committed by GitHub
parent a5b05b3e5f
commit 3b4ce3b857
51 changed files with 1337 additions and 1984 deletions

View File

@@ -16,43 +16,41 @@
*/
import { UpdateNotification, CardViewBaseItemModel, CardViewUpdateService } from '@alfresco/adf-core';
import { MinimalNode } from '@alfresco/js-api';
import { Node } from '@alfresco/js-api';
import { Injectable } from '@angular/core';
import { Subject } from 'rxjs';
import { BaseCardViewContentUpdate } from '../../interfaces/base-card-view-content-update.interface';
@Injectable({
providedIn: 'root'
providedIn: 'root'
})
export class CardViewContentUpdateService implements BaseCardViewContentUpdate {
itemUpdated$ = new Subject<UpdateNotification>();
updatedAspect$ = new Subject<Node>();
itemUpdated$ = new Subject<UpdateNotification>();
constructor(private cardViewUpdateService: CardViewUpdateService) {
this.linkVariables();
}
updatedAspect$ = new Subject<MinimalNode>();
update(property: CardViewBaseItemModel, newValue: any) {
this.cardViewUpdateService.update(property, newValue);
}
constructor(private cardViewUpdateService: CardViewUpdateService) {
this.linkVariables();
}
updateElement(notification: CardViewBaseItemModel) {
this.cardViewUpdateService.updateElement(notification);
}
update(property: CardViewBaseItemModel, newValue: any) {
this.cardViewUpdateService.update(property, newValue);
}
updateNodeAspect(node: Node) {
this.updatedAspect$.next(node);
}
updateElement(notification: CardViewBaseItemModel) {
this.cardViewUpdateService.updateElement(notification);
}
private linkVariables() {
this.linkItemUpdated();
}
updateNodeAspect(node: MinimalNode) {
this.updatedAspect$.next(node);
}
private linkVariables() {
this.linkItemUpdated();
}
private linkItemUpdated() {
this.cardViewUpdateService.itemUpdated$.subscribe(res => {
this.itemUpdated$.next(res);
});
}
private linkItemUpdated() {
this.cardViewUpdateService.itemUpdated$.subscribe((res) => {
this.itemUpdated$.next(res);
});
}
}