Futureproofing for rxjs 8 and the deprecation of the empty() function.
All the references to empty() have been replaced with the EMPTY constant.
Places where empty() was imported without being used have been removed.
Signed-off-by: Shula Link <slink@gchrl.org>
Signed-off-by: Jane Sandberg <js7389@princeton.edu>
* Create and consume BroadcastChannel broadcasts
*/
import {Injectable, EventEmitter} from '@angular/core';
-import {empty} from 'rxjs';
interface BroadcastSub {
channel: any; // BroadcastChannel
*/
import {Injectable, EventEmitter} from '@angular/core';
import {DomSanitizer, SafeUrl} from '@angular/platform-browser';
-import {empty} from 'rxjs';
@Injectable()
export class FileExportService {
import {Injectable} from '@angular/core';
-import {empty, throwError} from 'rxjs';
+import {EMPTY, throwError} from 'rxjs';
import {map} from 'rxjs/operators';
import {AuthService} from '@eg/core/auth.service';
import {GridDataSource} from '@eg/share/grid/grid';
// to submit a search
if (this.firstRun) {
this.firstRun = false;
- return empty();
+ return EMPTY;
}
const joins = this.generateSearchJoins();
import {Component, OnInit, AfterViewInit, OnDestroy, Input, ViewChild} from '@angular/core';
-import {empty, throwError, Observable, from, Subscription} from 'rxjs';
+import {EMPTY, throwError, Observable, from, Subscription} from 'rxjs';
import {map} from 'rxjs/operators';
import {Router, ActivatedRoute, ParamMap} from '@angular/router';
import {Pager} from '@eg/share/util/pager';
gridSource.getRows = (pager: Pager, sort: any[]) => {
this.provider = this.providerRecord.current();
if (!this.provider) {
- return empty();
+ return EMPTY;
}
let addresses = this.provider.addresses();
import {Component, OnInit, AfterViewInit, OnDestroy, Input, ViewChild} from '@angular/core';
-import {empty, throwError, Observable, from, Subscription} from 'rxjs';
+import {EMPTY, throwError, Observable, from, Subscription} from 'rxjs';
import {map} from 'rxjs/operators';
import {Router, ActivatedRoute, ParamMap} from '@angular/router';
import {Pager} from '@eg/share/util/pager';
gridSource.getRows = (pager: Pager, sort: any[]) => {
this.provider = this.providerRecord.current();
if (!this.provider) {
- return empty();
+ return EMPTY;
}
let attributes = this.provider.attributes();
import {Component, OnInit, AfterViewInit, Input, ViewChild} from '@angular/core';
-import {empty, throwError, Observable, from} from 'rxjs';
+import {EMPTY, throwError, Observable, from} from 'rxjs';
import {map} from 'rxjs/operators';
import {Router, ActivatedRoute, ParamMap} from '@angular/router';
import {Pager} from '@eg/share/util/pager';
gridSource.getRows = (pager: Pager, sort: any[]) => {
if (!this.contactId) {
- return empty();
+ return EMPTY;
}
const cid = this.contactId;
const contact = this.providerRecord.current().contacts().filter( c => c.id() === cid)[0];
import {Component, OnInit, AfterViewInit, OnDestroy, Input, Output, ViewChild, EventEmitter, ChangeDetectorRef} from '@angular/core';
-import {empty, throwError, Observable, from, Subscription} from 'rxjs';
+import {EMPTY, throwError, Observable, from, Subscription} from 'rxjs';
import {map} from 'rxjs/operators';
import {Router, ActivatedRoute, ParamMap} from '@angular/router';
import {Pager} from '@eg/share/util/pager';
gridSource.getRows = (pager: Pager, sort: any[]) => {
this.provider = this.providerRecord.current();
if (!this.provider) {
- return empty();
+ return EMPTY;
}
let contacts = this.provider.contacts();
import {Component, OnInit, Output, EventEmitter, ViewChild} from '@angular/core';
-import {empty, throwError, Observable, from} from 'rxjs';
+import {throwError, Observable, from} from 'rxjs';
import {map} from 'rxjs/operators';
import {Router, ActivatedRoute, ParamMap} from '@angular/router';
import {IdlService, IdlObject} from '@eg/core/idl.service';
import {Component, OnInit, AfterViewInit, OnDestroy, Input, Output, EventEmitter, ViewChild, ChangeDetectorRef} from '@angular/core';
-import {empty, throwError, Observable, from, Subscription} from 'rxjs';
+import {EMPTY, throwError, Observable, from, Subscription} from 'rxjs';
import {map} from 'rxjs/operators';
import {Router, ActivatedRoute, ParamMap} from '@angular/router';
import {Pager} from '@eg/share/util/pager';
gridSource.getRows = (pager: Pager, sort: any[]) => {
this.provider = this.providerRecord.current();
if (!this.provider) {
- return empty();
+ return EMPTY;
}
let edi_accounts = this.provider.edi_accounts();
import {Component, OnInit, AfterViewInit, OnDestroy, Input, ViewChild} from '@angular/core';
import {NgForm} from '@angular/forms';
-import {empty, throwError, Observable, from, Subscription} from 'rxjs';
+import {EMPTY, throwError, Observable, from, Subscription} from 'rxjs';
import {map} from 'rxjs/operators';
import {Router, ActivatedRoute, ParamMap} from '@angular/router';
import {Pager} from '@eg/share/util/pager';
gridSource.getRows = (pager: Pager, sort: any[]) => {
this.provider = this.providerRecord.current();
if (!this.provider) {
- return empty();
+ return EMPTY;
}
let holdings = this.provider.holdings_subfields();
import {Injectable} from '@angular/core';
-import {empty, throwError} from 'rxjs';
+import {EMPTY, throwError} from 'rxjs';
import {map} from 'rxjs/operators';
import {NetService} from '@eg/core/net.service';
import {AuthService} from '@eg/core/auth.service';
// to submit a search
if (this.firstRun) {
this.firstRun = false;
- return empty();
+ return EMPTY;
}
const currentSearch = this.generateAcqSearch(searchType, gridSource.filters);
import {Injectable} from '@angular/core';
-import {empty, throwError} from 'rxjs';
+import {throwError} from 'rxjs';
import {map} from 'rxjs/operators';
import {PcrudService} from '@eg/core/pcrud.service';
import {IdlObject} from '@eg/core/idl.service';
import {Component, Input, ViewChild, TemplateRef, OnInit, Renderer2} from '@angular/core';
-import {Observable, from, empty, throwError} from 'rxjs';
+import {Observable, from, throwError} from 'rxjs';
import {DialogComponent} from '@eg/share/dialog/dialog.component';
import {AlertDialogComponent} from '@eg/share/dialog/alert.component';
import {IdlService, IdlObject} from '@eg/core/idl.service';
import {Component, Input, ViewChild, OnInit} from '@angular/core';
-import {empty} from 'rxjs';
+import {EMPTY} from 'rxjs';
import {map, tap, concatMap} from 'rxjs/operators';
import {IdlService, IdlObject} from '@eg/core/idl.service';
import {NgbTabset, NgbTabChangeEvent} from '@ng-bootstrap/ng-bootstrap';
if (!this.contextOrgLoaded) {
// Still determining the default context org unit.
- return empty();
+ return EMPTY;
}
return this.net.request(
import {FmRecordEditorComponent} from '@eg/share/fm-editor/fm-editor.component';
import {ClonePortalEntriesDialogComponent} from './clone-portal-entries-dialog.component';
import {ConfirmDialogComponent} from '@eg/share/dialog/confirm.component';
-import {merge, Observable, empty} from 'rxjs';
+import {merge, Observable, EMPTY} from 'rxjs';
@Component({
templateUrl: './staff-portal-page.component.html'
const delObs = (overwrite) ?
this.pcrud.search('cusppe', { owner: tgt }, {}, {}) :
- empty();
+ EMPTY;
const newObs = this.pcrud.search('cusppe', { owner: src }, {}, {});
merge(delObs, newObs).subscribe(
entry => {
import {Component, Input, ViewChild, TemplateRef, OnInit} from '@angular/core';
-import {Observable, from, empty, throwError} from 'rxjs';
+import {Observable, from, EMPTY, throwError} from 'rxjs';
import {DialogComponent} from '@eg/share/dialog/dialog.component';
import {IdlService, IdlObject} from '@eg/core/idl.service';
import {PcrudService} from '@eg/core/pcrud.service';
this.permEntries = (term: string) => {
- if (term === null || term === undefined) { return empty(); }
+ if (term === null || term === undefined) { return EMPTY; }
term = ('' + term).toLowerCase();
// Find entries whose code or description match the search term
import {Component, OnInit, ViewChild} from '@angular/core';
-import {Observable, empty} from 'rxjs';
+import {Observable, EMPTY} from 'rxjs';
import {map, switchMap} from 'rxjs/operators';
import {IdlObject} from '@eg/core/idl.service';
import {Pager} from '@eg/share/util/pager';
this.axisCbox.selectedId = this.browse.authorityAxis;
this.authorityAxis = this.axisCbox.selected;
} else {
- return empty();
+ return EMPTY;
}
}
import {Injectable} from '@angular/core';
-import {Observable, empty} from 'rxjs';
+import {Observable, EMPTY} from 'rxjs';
import {map, switchMap} from 'rxjs/operators';
import {IdlObject} from '@eg/core/idl.service';
import {Pager} from '@eg/share/util/pager';
loadAuthorities(): Observable<any> {
if (!this.searchTerm || !this.authorityAxis) {
- return empty();
+ return EMPTY;
}
return this.net.request(
import {Component, OnInit, ViewChild} from '@angular/core';
import {Router, ActivatedRoute, ParamMap} from '@angular/router';
-import {Observable, empty} from 'rxjs';
+import {Observable} from 'rxjs';
import {map, switchMap} from 'rxjs/operators';
import {NgbTabset, NgbTabChangeEvent} from '@ng-bootstrap/ng-bootstrap';
import {IdlObject} from '@eg/core/idl.service';
import {Component, OnInit, Input, ViewChild, ViewEncapsulation
} from '@angular/core';
import {Router} from '@angular/router';
-import {Observable, Observer, of, empty} from 'rxjs';
+import {Observable, Observer, of, EMPTY} from 'rxjs';
import {map, tap, concatMap} from 'rxjs/operators';
import {Pager} from '@eg/share/util/pager';
import {IdlObject, IdlService} from '@eg/core/idl.service';
this.emptyLibsCheckbox.checked(settings['cat.holdings_show_empty_org']);
this.gridDataSource.getRows = (pager: Pager, sort: any[]) => {
- if (!this.contextOrgLoaded) { return empty(); }
+ if (!this.contextOrgLoaded) { return EMPTY; }
return this.fetchHoldings(pager);
};
import {Component, Input, OnInit, ViewChild} from '@angular/core';
-import {Observable, empty, from} from 'rxjs';
+import {Observable, EMPTY, from} from 'rxjs';
import {map, tap, switchMap} from 'rxjs/operators';
import {IdlObject} from '@eg/core/idl.service';
import {Pager} from '@eg/share/util/pager';
return this.loadIds(pager, sort);
}
- return empty();
+ return EMPTY;
};
this.cellTextGenerator = {
this.bibIds.slice(pager.offset, pager.offset + pager.limit));
} else {
- return empty();
+ return EMPTY;
}
// ID is the currently only supported sort column. If other
return from(promise).pipe(switchMap(bibIds => {
- if (bibIds.length === 0) { return empty(); }
+ if (bibIds.length === 0) { return EMPTY; }
return this.pcrud.search('rmsr', {id: bibIds}, {
order_by: orderBy,
import {Component, OnInit, Input, ViewChild} from '@angular/core';
-import {Observable, throwError, from, empty} from 'rxjs';
+import {Observable, throwError, from, EMPTY} from 'rxjs';
import {tap, map, switchMap} from 'rxjs/operators';
import {NetService} from '@eg/core/net.service';
import {IdlService, IdlObject} from '@eg/core/idl.service';
ngOnInit() {
this.tagDataSource = term => {
- if (!this.curTagType) { return empty(); }
+ if (!this.curTagType) { return EMPTY; }
return this.pcrud.search(
'acpt', {