mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[ADF-3593] remove rxjs-compat layer (#3886)
* remove rxjs-compat layer * add rxjs linter * observable new instead of create * lint fixes * disable rxjs-no-subject-value for certain scenarios * fix auth rxjs
This commit is contained in:
committed by
Eugenio Romano
parent
ccc52d40dd
commit
f5a7b07370
@@ -112,7 +112,7 @@ describe('ContentNodeDialogService', () => {
|
||||
|
||||
it('should be able to open the dialog using a folder id', fakeAsync(() => {
|
||||
spyOn(documentListService, 'getFolderNode').and.returnValue(of(fakeNode));
|
||||
service.openFileBrowseDialogByFolderId('fake-folder-id').subscribe();
|
||||
service.openFileBrowseDialogByFolderId('fake-folder-id').subscribe(() => {});
|
||||
tick();
|
||||
expect(spyOnDialogOpen).toHaveBeenCalled();
|
||||
}));
|
||||
@@ -120,7 +120,7 @@ describe('ContentNodeDialogService', () => {
|
||||
it('should be able to open the dialog for files using the first user site', fakeAsync(() => {
|
||||
spyOn(sitesService, 'getSites').and.returnValue(of(fakeSiteList));
|
||||
spyOn(documentListService, 'getFolderNode').and.returnValue(of(fakeNode));
|
||||
service.openFileBrowseDialogBySite().subscribe();
|
||||
service.openFileBrowseDialogBySite().subscribe(() => {});
|
||||
tick();
|
||||
expect(spyOnDialogOpen).toHaveBeenCalled();
|
||||
}));
|
||||
@@ -128,7 +128,7 @@ describe('ContentNodeDialogService', () => {
|
||||
it('should be able to open the dialog for folder using the first user site', fakeAsync(() => {
|
||||
spyOn(sitesService, 'getSites').and.returnValue(of(fakeSiteList));
|
||||
spyOn(documentListService, 'getFolderNode').and.returnValue(of(fakeNode));
|
||||
service.openFolderBrowseDialogBySite().subscribe();
|
||||
service.openFolderBrowseDialogBySite().subscribe(() => {});
|
||||
tick();
|
||||
expect(spyOnDialogOpen).toHaveBeenCalled();
|
||||
}));
|
||||
|
@@ -85,7 +85,7 @@ describe('ContentNodeSelectorComponent', () => {
|
||||
contentNodeSelectorService = TestBed.get(ContentNodeSelectorService);
|
||||
cnSearchSpy = spyOn(contentNodeSelectorService, 'search').and.callThrough();
|
||||
searchSpy = spyOn(searchService, 'searchByQueryBody').and.callFake(() => {
|
||||
return Observable.create((observer: Observer<NodePaging>) => {
|
||||
return new Observable((observer: Observer<NodePaging>) => {
|
||||
_observer = observer;
|
||||
});
|
||||
});
|
||||
|
@@ -15,6 +15,8 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
/* tslint:disable:rxjs-no-subject-value */
|
||||
|
||||
import {
|
||||
AfterContentInit, Component, ContentChild, ElementRef, EventEmitter, HostListener, Input, NgZone,
|
||||
OnChanges, OnDestroy, OnInit, Output, SimpleChanges, TemplateRef, ViewChild, ViewEncapsulation
|
||||
|
@@ -42,14 +42,14 @@ export class DocumentListServiceMock extends DocumentListService {
|
||||
if (this.getFolderReject) {
|
||||
return throwError(this.getFolderRejectError);
|
||||
}
|
||||
return Observable.create(observer => {
|
||||
return new Observable(observer => {
|
||||
observer.next(this.getFolderResult);
|
||||
observer.complete();
|
||||
});
|
||||
}
|
||||
|
||||
deleteNode(nodeId: string) {
|
||||
return Observable.create(observer => {
|
||||
return new Observable(observer => {
|
||||
observer.next();
|
||||
observer.complete();
|
||||
});
|
||||
|
@@ -148,12 +148,12 @@ export class SearchControlComponent implements OnInit, OnDestroy {
|
||||
|
||||
ngOnDestroy(): void {
|
||||
if (this.focusSubject) {
|
||||
this.focusSubject.unsubscribe();
|
||||
this.focusSubject.complete();
|
||||
this.focusSubject = null;
|
||||
}
|
||||
|
||||
if (this.toggleSearch) {
|
||||
this.toggleSearch.unsubscribe();
|
||||
this.toggleSearch.complete();
|
||||
this.toggleSearch = null;
|
||||
}
|
||||
}
|
||||
|
@@ -81,7 +81,6 @@ export class SearchTriggerDirective implements ControlValueAccessor, OnDestroy {
|
||||
this.onDestroy$.complete();
|
||||
|
||||
if (this.escapeEventStream) {
|
||||
this.escapeEventStream.unsubscribe();
|
||||
this.escapeEventStream = null;
|
||||
}
|
||||
if ( this.closingActionsSubscription ) {
|
||||
@@ -127,7 +126,8 @@ export class SearchTriggerDirective implements ControlValueAccessor, OnDestroy {
|
||||
filter((event: MouseEvent | TouchEvent) => {
|
||||
const clickTarget = event.target as HTMLElement;
|
||||
return this._panelOpen && clickTarget !== this.element.nativeElement;
|
||||
})
|
||||
}),
|
||||
takeUntil(this.onDestroy$)
|
||||
);
|
||||
}
|
||||
|
||||
@@ -191,11 +191,11 @@ export class SearchTriggerDirective implements ControlValueAccessor, OnDestroy {
|
||||
|
||||
return merge(firstStable, optionChanges)
|
||||
.pipe(
|
||||
takeUntil(this.onDestroy$),
|
||||
switchMap(() => {
|
||||
this.searchPanel.setVisibility();
|
||||
return this.panelClosingActions;
|
||||
})
|
||||
}),
|
||||
takeUntil(this.onDestroy$)
|
||||
)
|
||||
.subscribe(event => this.setValueAndClose(event));
|
||||
}
|
||||
|
Reference in New Issue
Block a user