forked from hazza/dspace-angular
117616: Auto-fixed new linting rules
This commit is contained in:
@@ -51,16 +51,16 @@ import { BrowserOnlyPipe } from '../../../shared/utils/browser-only.pipe';
|
||||
},
|
||||
],
|
||||
imports: [
|
||||
PaginationComponent,
|
||||
AsyncPipe,
|
||||
NgbAccordionModule,
|
||||
TranslateModule,
|
||||
NgbNavModule,
|
||||
ThemedSearchComponent,
|
||||
BrowserOnlyPipe,
|
||||
NgxPaginationModule,
|
||||
SelectableListItemControlComponent,
|
||||
ListableObjectComponentLoaderComponent,
|
||||
NgbAccordionModule,
|
||||
NgbNavModule,
|
||||
NgxPaginationModule,
|
||||
PaginationComponent,
|
||||
SelectableListItemControlComponent,
|
||||
ThemedSearchComponent,
|
||||
TranslateModule,
|
||||
],
|
||||
standalone: true,
|
||||
})
|
||||
|
@@ -26,10 +26,10 @@ import { BulkAccessSettingsComponent } from './settings/bulk-access-settings.com
|
||||
templateUrl: './bulk-access.component.html',
|
||||
styleUrls: ['./bulk-access.component.scss'],
|
||||
imports: [
|
||||
TranslateModule,
|
||||
BulkAccessSettingsComponent,
|
||||
BulkAccessBrowseComponent,
|
||||
BtnDisabledDirective,
|
||||
BulkAccessBrowseComponent,
|
||||
BulkAccessSettingsComponent,
|
||||
TranslateModule,
|
||||
],
|
||||
standalone: true,
|
||||
changeDetection: ChangeDetectionStrategy.OnPush,
|
||||
|
@@ -14,9 +14,9 @@ import { AccessControlFormContainerComponent } from '../../../shared/access-cont
|
||||
styleUrls: ['./bulk-access-settings.component.scss'],
|
||||
exportAs: 'dsBulkSettings',
|
||||
imports: [
|
||||
AccessControlFormContainerComponent,
|
||||
NgbAccordionModule,
|
||||
TranslateModule,
|
||||
AccessControlFormContainerComponent,
|
||||
],
|
||||
standalone: true,
|
||||
})
|
||||
|
@@ -27,7 +27,7 @@ import {
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
import {
|
||||
Observable,
|
||||
of as observableOf,
|
||||
of,
|
||||
} from 'rxjs';
|
||||
|
||||
import { AuthorizationDataService } from '../../core/data/feature-authorization/authorization-data.service';
|
||||
@@ -85,7 +85,7 @@ describe('EPeopleRegistryComponent', () => {
|
||||
}), this.allEpeople));
|
||||
},
|
||||
getActiveEPerson(): Observable<EPerson> {
|
||||
return observableOf(this.activeEPerson);
|
||||
return of(this.activeEPerson);
|
||||
},
|
||||
searchByScope(scope: string, query: string, options: FindListOptions = {}): Observable<RemoteData<PaginatedList<EPerson>>> {
|
||||
if (scope === 'email') {
|
||||
@@ -129,7 +129,7 @@ describe('EPeopleRegistryComponent', () => {
|
||||
this.allEpeople = this.allEpeople.filter((ePerson2: EPerson) => {
|
||||
return (ePerson2.uuid !== ePerson.uuid);
|
||||
});
|
||||
return observableOf(true);
|
||||
return of(true);
|
||||
},
|
||||
editEPerson(ePerson: EPerson) {
|
||||
this.activeEPerson = ePerson;
|
||||
@@ -145,7 +145,7 @@ describe('EPeopleRegistryComponent', () => {
|
||||
},
|
||||
};
|
||||
authorizationService = jasmine.createSpyObj('authorizationService', {
|
||||
isAuthorized: observableOf(true),
|
||||
isAuthorized: of(true),
|
||||
});
|
||||
builderService = getMockFormBuilderService();
|
||||
|
||||
@@ -180,7 +180,7 @@ describe('EPeopleRegistryComponent', () => {
|
||||
fixture = TestBed.createComponent(EPeopleRegistryComponent);
|
||||
component = fixture.componentInstance;
|
||||
modalService = TestBed.inject(NgbModal);
|
||||
spyOn(modalService, 'open').and.returnValue(Object.assign({ componentInstance: Object.assign({ response: observableOf(true) }) }));
|
||||
spyOn(modalService, 'open').and.returnValue(Object.assign({ componentInstance: Object.assign({ response: of(true) }) }));
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
@@ -261,7 +261,7 @@ describe('EPeopleRegistryComponent', () => {
|
||||
|
||||
|
||||
it('should hide delete EPerson button when the isAuthorized returns false', () => {
|
||||
spyOn(authorizationService, 'isAuthorized').and.returnValue(observableOf(false));
|
||||
spyOn(authorizationService, 'isAuthorized').and.returnValue(of(false));
|
||||
component.initialisePage();
|
||||
fixture.detectChanges();
|
||||
|
||||
|
@@ -67,14 +67,14 @@ import { EPersonFormComponent } from './eperson-form/eperson-form.component';
|
||||
selector: 'ds-epeople-registry',
|
||||
templateUrl: './epeople-registry.component.html',
|
||||
imports: [
|
||||
TranslateModule,
|
||||
RouterModule,
|
||||
AsyncPipe,
|
||||
EPersonFormComponent,
|
||||
ReactiveFormsModule,
|
||||
ThemedLoadingComponent,
|
||||
PaginationComponent,
|
||||
NgClass,
|
||||
PaginationComponent,
|
||||
ReactiveFormsModule,
|
||||
RouterModule,
|
||||
ThemedLoadingComponent,
|
||||
TranslateModule,
|
||||
],
|
||||
standalone: true,
|
||||
})
|
||||
|
@@ -25,7 +25,7 @@ import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
import {
|
||||
Observable,
|
||||
of as observableOf,
|
||||
of,
|
||||
} from 'rxjs';
|
||||
|
||||
import { AuthService } from '../../../core/auth/auth.service';
|
||||
@@ -91,7 +91,7 @@ describe('EPersonFormComponent', () => {
|
||||
activeEPerson: null,
|
||||
allEpeople: mockEPeople,
|
||||
getActiveEPerson(): Observable<EPerson> {
|
||||
return observableOf(this.activeEPerson);
|
||||
return of(this.activeEPerson);
|
||||
},
|
||||
searchByScope(scope: string, query: string, options: FindListOptions = {}): Observable<RemoteData<PaginatedList<EPerson>>> {
|
||||
if (scope === 'email') {
|
||||
@@ -115,7 +115,7 @@ describe('EPersonFormComponent', () => {
|
||||
this.allEpeople = this.allEpeople.filter((ePerson2: EPerson) => {
|
||||
return (ePerson2.uuid !== ePerson.uuid);
|
||||
});
|
||||
return observableOf(true);
|
||||
return of(true);
|
||||
},
|
||||
create(ePerson: EPerson): Observable<RemoteData<EPerson>> {
|
||||
this.allEpeople = [...this.allEpeople, ePerson];
|
||||
@@ -210,7 +210,7 @@ describe('EPersonFormComponent', () => {
|
||||
});
|
||||
authService = new AuthServiceStub();
|
||||
authorizationService = jasmine.createSpyObj('authorizationService', {
|
||||
isAuthorized: observableOf(true),
|
||||
isAuthorized: of(true),
|
||||
|
||||
});
|
||||
groupsDataService = jasmine.createSpyObj('groupsDataService', {
|
||||
@@ -389,7 +389,7 @@ describe('EPersonFormComponent', () => {
|
||||
});
|
||||
describe('without active EPerson', () => {
|
||||
beforeEach(() => {
|
||||
spyOn(ePersonDataServiceStub, 'getActiveEPerson').and.returnValue(observableOf(undefined));
|
||||
spyOn(ePersonDataServiceStub, 'getActiveEPerson').and.returnValue(of(undefined));
|
||||
component.onSubmit();
|
||||
fixture.detectChanges();
|
||||
});
|
||||
@@ -429,7 +429,7 @@ describe('EPersonFormComponent', () => {
|
||||
},
|
||||
},
|
||||
});
|
||||
spyOn(ePersonDataServiceStub, 'getActiveEPerson').and.returnValue(observableOf(expectedWithId));
|
||||
spyOn(ePersonDataServiceStub, 'getActiveEPerson').and.returnValue(of(expectedWithId));
|
||||
component.ngOnInit();
|
||||
component.onSubmit();
|
||||
fixture.detectChanges();
|
||||
@@ -485,10 +485,10 @@ describe('EPersonFormComponent', () => {
|
||||
spyOn(authService, 'impersonate').and.callThrough();
|
||||
eperson = EPersonMock;
|
||||
component.epersonInitial = eperson;
|
||||
component.canDelete$ = observableOf(true);
|
||||
spyOn(component.epersonService, 'getActiveEPerson').and.returnValue(observableOf(eperson));
|
||||
component.canDelete$ = of(true);
|
||||
spyOn(component.epersonService, 'getActiveEPerson').and.returnValue(of(eperson));
|
||||
modalService = (component as any).modalService;
|
||||
spyOn(modalService, 'open').and.returnValue(Object.assign({ componentInstance: Object.assign({ response: observableOf(true) }) }));
|
||||
spyOn(modalService, 'open').and.returnValue(Object.assign({ componentInstance: Object.assign({ response: of(true) }) }));
|
||||
component.ngOnInit();
|
||||
fixture.detectChanges();
|
||||
});
|
||||
@@ -499,7 +499,7 @@ describe('EPersonFormComponent', () => {
|
||||
});
|
||||
|
||||
it('the delete button should be hidden if the ePerson cannot be deleted', () => {
|
||||
component.canDelete$ = observableOf(false);
|
||||
component.canDelete$ = of(false);
|
||||
fixture.detectChanges();
|
||||
const deleteButton = fixture.debugElement.query(By.css('.delete-button'));
|
||||
expect(deleteButton).toBeNull();
|
||||
|
@@ -27,7 +27,7 @@ import {
|
||||
import {
|
||||
combineLatest as observableCombineLatest,
|
||||
Observable,
|
||||
of as observableOf,
|
||||
of,
|
||||
Subscription,
|
||||
} from 'rxjs';
|
||||
import {
|
||||
@@ -78,14 +78,14 @@ import { ValidateEmailNotTaken } from './validators/email-taken.validator';
|
||||
selector: 'ds-eperson-form',
|
||||
templateUrl: './eperson-form.component.html',
|
||||
imports: [
|
||||
FormComponent,
|
||||
AsyncPipe,
|
||||
TranslateModule,
|
||||
ThemedLoadingComponent,
|
||||
BtnDisabledDirective,
|
||||
FormComponent,
|
||||
HasNoValuePipe,
|
||||
PaginationComponent,
|
||||
RouterLink,
|
||||
HasNoValuePipe,
|
||||
BtnDisabledDirective,
|
||||
ThemedLoadingComponent,
|
||||
TranslateModule,
|
||||
],
|
||||
standalone: true,
|
||||
})
|
||||
@@ -357,7 +357,7 @@ export class EPersonFormComponent implements OnInit, OnDestroy {
|
||||
|
||||
this.groups$ = this.activeEPerson$.pipe(
|
||||
switchMap((eperson) => {
|
||||
return observableCombineLatest([observableOf(eperson), this.paginationService.getFindListOptions(this.config.id, {
|
||||
return observableCombineLatest([of(eperson), this.paginationService.getFindListOptions(this.config.id, {
|
||||
currentPage: 1,
|
||||
elementsPerPage: this.config.pageSize,
|
||||
})]);
|
||||
@@ -366,7 +366,7 @@ export class EPersonFormComponent implements OnInit, OnDestroy {
|
||||
if (eperson != null) {
|
||||
return this.groupsDataService.findListByHref(eperson._links.groups.href, findListOptions, true, true, followLink('object'));
|
||||
}
|
||||
return observableOf(undefined);
|
||||
return of(undefined);
|
||||
}),
|
||||
);
|
||||
|
||||
@@ -379,14 +379,14 @@ export class EPersonFormComponent implements OnInit, OnDestroy {
|
||||
if (hasValue(eperson)) {
|
||||
return this.authorizationService.isAuthorized(FeatureID.LoginOnBehalfOf, eperson.self);
|
||||
} else {
|
||||
return observableOf(false);
|
||||
return of(false);
|
||||
}
|
||||
}),
|
||||
);
|
||||
this.canDelete$ = this.activeEPerson$.pipe(
|
||||
switchMap((eperson) => this.authorizationService.isAuthorized(FeatureID.CanDelete, hasValue(eperson) ? eperson.self : undefined)),
|
||||
);
|
||||
this.canReset$ = observableOf(true);
|
||||
this.canReset$ = of(true);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -540,16 +540,16 @@ export class EPersonFormComponent implements OnInit, OnDestroy {
|
||||
take(1),
|
||||
switchMap((confirm: boolean) => {
|
||||
if (confirm && hasValue(eperson.id)) {
|
||||
this.canDelete$ = observableOf(false);
|
||||
this.canDelete$ = of(false);
|
||||
return this.epersonService.deleteEPerson(eperson).pipe(
|
||||
getFirstCompletedRemoteData(),
|
||||
map((restResponse: RemoteData<NoContent>) => ({ restResponse, eperson })),
|
||||
);
|
||||
} else {
|
||||
return observableOf(null);
|
||||
return of(null);
|
||||
}
|
||||
}),
|
||||
finalize(() => this.canDelete$ = observableOf(true)),
|
||||
finalize(() => this.canDelete$ = of(true)),
|
||||
);
|
||||
}),
|
||||
).subscribe(({ restResponse, eperson }: { restResponse: RemoteData<NoContent> | null, eperson: EPerson }) => {
|
||||
|
@@ -27,7 +27,7 @@ import { TranslateModule } from '@ngx-translate/core';
|
||||
import { Operation } from 'fast-json-patch';
|
||||
import {
|
||||
Observable,
|
||||
of as observableOf,
|
||||
of,
|
||||
} from 'rxjs';
|
||||
|
||||
import { DSONameService } from '../../../core/breadcrumbs/dso-name.service';
|
||||
@@ -116,7 +116,7 @@ describe('GroupFormComponent', () => {
|
||||
activeGroup: null,
|
||||
createdGroup: null,
|
||||
getActiveGroup(): Observable<Group> {
|
||||
return observableOf(this.activeGroup);
|
||||
return of(this.activeGroup);
|
||||
},
|
||||
getGroupRegistryRouterLink(): string {
|
||||
return '/access-control/groups';
|
||||
@@ -137,7 +137,7 @@ describe('GroupFormComponent', () => {
|
||||
this.activeGroup = null;
|
||||
},
|
||||
findById(id: string) {
|
||||
return observableOf({ payload: null, hasSucceeded: true });
|
||||
return of({ payload: null, hasSucceeded: true });
|
||||
},
|
||||
findByHref(href: string) {
|
||||
return createSuccessfulRemoteDataObject$(this.createdGroup);
|
||||
@@ -164,7 +164,7 @@ describe('GroupFormComponent', () => {
|
||||
},
|
||||
};
|
||||
authorizationService = jasmine.createSpyObj('authorizationService', {
|
||||
isAuthorized: observableOf(true),
|
||||
isAuthorized: of(true),
|
||||
});
|
||||
dsoDataServiceStub = {
|
||||
findByHref(href: string): Observable<RemoteData<DSpaceObject>> {
|
||||
@@ -330,7 +330,7 @@ describe('GroupFormComponent', () => {
|
||||
},
|
||||
},
|
||||
});
|
||||
spyOn(groupsDataServiceStub, 'getActiveGroup').and.returnValue(observableOf(expected));
|
||||
spyOn(groupsDataServiceStub, 'getActiveGroup').and.returnValue(of(expected));
|
||||
spyOn(groupsDataServiceStub, 'patch').and.returnValue(createSuccessfulRemoteDataObject$(expected2));
|
||||
component.ngOnInit();
|
||||
});
|
||||
@@ -417,7 +417,7 @@ describe('GroupFormComponent', () => {
|
||||
},
|
||||
});
|
||||
spyOn(component.submitForm, 'emit');
|
||||
spyOn(dsoDataServiceStub, 'findByHref').and.returnValue(observableOf(expected));
|
||||
spyOn(dsoDataServiceStub, 'findByHref').and.returnValue(of(expected));
|
||||
|
||||
fixture.detectChanges();
|
||||
component.initialisePage();
|
||||
@@ -471,11 +471,11 @@ describe('GroupFormComponent', () => {
|
||||
|
||||
beforeEach(async () => {
|
||||
spyOn(groupsDataServiceStub, 'delete').and.callThrough();
|
||||
component.activeGroup$ = observableOf({
|
||||
component.activeGroup$ = of({
|
||||
id: 'active-group',
|
||||
permanent: false,
|
||||
} as Group);
|
||||
component.canEdit$ = observableOf(true);
|
||||
component.canEdit$ = of(true);
|
||||
|
||||
component.initialisePage();
|
||||
|
||||
|
@@ -87,13 +87,13 @@ import { ValidateGroupExists } from './validators/group-exists.validator';
|
||||
selector: 'ds-group-form',
|
||||
templateUrl: './group-form.component.html',
|
||||
imports: [
|
||||
FormComponent,
|
||||
AlertComponent,
|
||||
AsyncPipe,
|
||||
TranslateModule,
|
||||
ContextHelpDirective,
|
||||
FormComponent,
|
||||
MembersListComponent,
|
||||
SubgroupsListComponent,
|
||||
TranslateModule,
|
||||
],
|
||||
standalone: true,
|
||||
})
|
||||
|
@@ -32,7 +32,7 @@ import {
|
||||
} from '@ngx-translate/core';
|
||||
import {
|
||||
Observable,
|
||||
of as observableOf,
|
||||
of,
|
||||
} from 'rxjs';
|
||||
|
||||
import { DSONameService } from '../../../../core/breadcrumbs/dso-name.service';
|
||||
@@ -113,7 +113,7 @@ describe('MembersListComponent', () => {
|
||||
epersonMembers: epersonMembers,
|
||||
epersonNonMembers: epersonNonMembers,
|
||||
getActiveGroup(): Observable<Group> {
|
||||
return observableOf(activeGroup);
|
||||
return of(activeGroup);
|
||||
},
|
||||
getEPersonMembers() {
|
||||
return this.epersonMembers;
|
||||
@@ -127,7 +127,7 @@ describe('MembersListComponent', () => {
|
||||
this.epersonNonMembers.splice(index, 1);
|
||||
}
|
||||
});
|
||||
return observableOf(new RestResponse(true, 200, 'Success'));
|
||||
return of(new RestResponse(true, 200, 'Success'));
|
||||
},
|
||||
clearGroupsRequests() {
|
||||
// empty
|
||||
@@ -147,7 +147,7 @@ describe('MembersListComponent', () => {
|
||||
});
|
||||
// Add eperson to list of non-members
|
||||
this.epersonNonMembers = [...this.epersonNonMembers, epersonToDelete];
|
||||
return observableOf(new RestResponse(true, 200, 'Success'));
|
||||
return of(new RestResponse(true, 200, 'Success'));
|
||||
},
|
||||
};
|
||||
builderService = getMockFormBuilderService();
|
||||
|
@@ -25,7 +25,7 @@ import {
|
||||
combineLatest as observableCombineLatest,
|
||||
Observable,
|
||||
ObservedValueOf,
|
||||
of as observableOf,
|
||||
of,
|
||||
Subscription,
|
||||
} from 'rxjs';
|
||||
import {
|
||||
@@ -103,14 +103,14 @@ export interface EPersonListActionConfig {
|
||||
selector: 'ds-members-list',
|
||||
templateUrl: './members-list.component.html',
|
||||
imports: [
|
||||
TranslateModule,
|
||||
ContextHelpDirective,
|
||||
ReactiveFormsModule,
|
||||
PaginationComponent,
|
||||
AsyncPipe,
|
||||
RouterLink,
|
||||
NgClass,
|
||||
BtnDisabledDirective,
|
||||
ContextHelpDirective,
|
||||
NgClass,
|
||||
PaginationComponent,
|
||||
ReactiveFormsModule,
|
||||
RouterLink,
|
||||
TranslateModule,
|
||||
],
|
||||
standalone: true,
|
||||
})
|
||||
@@ -260,7 +260,7 @@ export class MembersListComponent implements OnInit, OnDestroy {
|
||||
* @param possibleMember EPerson that is a possible member (being tested) of the group currently being edited
|
||||
*/
|
||||
isMemberOfGroup(possibleMember: EPerson): Observable<boolean> {
|
||||
return observableOf(true);
|
||||
return of(true);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -31,7 +31,7 @@ import {
|
||||
} from '@ngx-translate/core';
|
||||
import {
|
||||
Observable,
|
||||
of as observableOf,
|
||||
of,
|
||||
} from 'rxjs';
|
||||
import { EPersonMock2 } from 'src/app/shared/testing/eperson.mock';
|
||||
|
||||
@@ -108,7 +108,7 @@ describe('SubgroupsListComponent', () => {
|
||||
subgroups: subgroups,
|
||||
groupNonMembers: groupNonMembers,
|
||||
getActiveGroup(): Observable<Group> {
|
||||
return observableOf(this.activeGroup);
|
||||
return of(this.activeGroup);
|
||||
},
|
||||
getSubgroups(): Group {
|
||||
return this.subgroups;
|
||||
@@ -138,7 +138,7 @@ describe('SubgroupsListComponent', () => {
|
||||
this.groupNonMembers.splice(index, 1);
|
||||
}
|
||||
});
|
||||
return observableOf(new RestResponse(true, 200, 'Success'));
|
||||
return of(new RestResponse(true, 200, 'Success'));
|
||||
},
|
||||
clearGroupsRequests() {
|
||||
// empty
|
||||
@@ -155,7 +155,7 @@ describe('SubgroupsListComponent', () => {
|
||||
});
|
||||
// Add group to list of non-members
|
||||
this.groupNonMembers = [...this.groupNonMembers, subgroupToDelete];
|
||||
return observableOf(new RestResponse(true, 200, 'Success'));
|
||||
return of(new RestResponse(true, 200, 'Success'));
|
||||
},
|
||||
};
|
||||
routerStub = new RouterMock();
|
||||
|
@@ -59,12 +59,12 @@ enum SubKey {
|
||||
selector: 'ds-subgroups-list',
|
||||
templateUrl: './subgroups-list.component.html',
|
||||
imports: [
|
||||
RouterLink,
|
||||
AsyncPipe,
|
||||
ContextHelpDirective,
|
||||
TranslateModule,
|
||||
ReactiveFormsModule,
|
||||
PaginationComponent,
|
||||
ReactiveFormsModule,
|
||||
RouterLink,
|
||||
TranslateModule,
|
||||
],
|
||||
standalone: true,
|
||||
})
|
||||
|
@@ -9,7 +9,7 @@ import {
|
||||
} from '@angular/router';
|
||||
import {
|
||||
Observable,
|
||||
of as observableOf,
|
||||
of,
|
||||
} from 'rxjs';
|
||||
|
||||
import { AuthService } from '../../core/auth/auth.service';
|
||||
@@ -37,7 +37,7 @@ describe('GroupPageGuard', () => {
|
||||
|
||||
function init() {
|
||||
halEndpointService = jasmine.createSpyObj(['getEndpoint']);
|
||||
( halEndpointService as any ).getEndpoint.and.returnValue(observableOf(groupsEndpointUrl));
|
||||
( halEndpointService as any ).getEndpoint.and.returnValue(of(groupsEndpointUrl));
|
||||
|
||||
authorizationService = jasmine.createSpyObj(['isAuthorized']);
|
||||
// NOTE: value is set in beforeEach
|
||||
@@ -46,7 +46,7 @@ describe('GroupPageGuard', () => {
|
||||
( router as any ).parseUrl.and.returnValue = {};
|
||||
|
||||
authService = jasmine.createSpyObj(['isAuthenticated']);
|
||||
( authService as any ).isAuthenticated.and.returnValue(observableOf(true));
|
||||
( authService as any ).isAuthenticated.and.returnValue(of(true));
|
||||
|
||||
TestBed.configureTestingModule({
|
||||
providers: [
|
||||
@@ -69,7 +69,7 @@ describe('GroupPageGuard', () => {
|
||||
describe('canActivate', () => {
|
||||
describe('when the current user can manage the group', () => {
|
||||
beforeEach(() => {
|
||||
( authorizationService as any ).isAuthorized.and.returnValue(observableOf(true));
|
||||
( authorizationService as any ).isAuthorized.and.returnValue(of(true));
|
||||
});
|
||||
|
||||
it('should return true', (done) => {
|
||||
@@ -89,7 +89,7 @@ describe('GroupPageGuard', () => {
|
||||
|
||||
describe('when the current user can not manage the group', () => {
|
||||
beforeEach(() => {
|
||||
(authorizationService as any).isAuthorized.and.returnValue(observableOf(false));
|
||||
(authorizationService as any).isAuthorized.and.returnValue(of(false));
|
||||
});
|
||||
|
||||
it('should not return true', (done) => {
|
||||
|
@@ -6,7 +6,7 @@ import {
|
||||
} from '@angular/router';
|
||||
import {
|
||||
Observable,
|
||||
of as observableOf,
|
||||
of,
|
||||
} from 'rxjs';
|
||||
import { map } from 'rxjs/operators';
|
||||
|
||||
@@ -33,6 +33,6 @@ export const groupPageGuard = (
|
||||
getObjectUrl = defaultGroupPageGetObjectUrl,
|
||||
getEPersonUuid?: StringGuardParamFn,
|
||||
): CanActivateFn => someFeatureAuthorizationGuard(
|
||||
() => observableOf([FeatureID.CanManageGroup]),
|
||||
() => of([FeatureID.CanManageGroup]),
|
||||
getObjectUrl,
|
||||
getEPersonUuid);
|
||||
|
@@ -25,7 +25,6 @@ import { provideMockStore } from '@ngrx/store/testing';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
import {
|
||||
Observable,
|
||||
of as observableOf,
|
||||
of,
|
||||
} from 'rxjs';
|
||||
|
||||
@@ -95,11 +94,11 @@ describe('GroupsRegistryComponent', () => {
|
||||
(authorizationService as any).isAuthorized.and.callFake((featureId?: FeatureID) => {
|
||||
switch (featureId) {
|
||||
case FeatureID.AdministratorOf:
|
||||
return observableOf(isAdmin);
|
||||
return of(isAdmin);
|
||||
case FeatureID.CanManageGroup:
|
||||
return observableOf(canManageGroup);
|
||||
return of(canManageGroup);
|
||||
case FeatureID.CanDelete:
|
||||
return observableOf(true);
|
||||
return of(true);
|
||||
default:
|
||||
throw new Error(`setIsAuthorized: this fake implementation does not support ${featureId}.`);
|
||||
}
|
||||
|
@@ -19,7 +19,7 @@ import {
|
||||
combineLatest as observableCombineLatest,
|
||||
EMPTY,
|
||||
Observable,
|
||||
of as observableOf,
|
||||
of,
|
||||
Subscription,
|
||||
} from 'rxjs';
|
||||
import {
|
||||
@@ -68,14 +68,14 @@ import { followLink } from '../../shared/utils/follow-link-config.model';
|
||||
selector: 'ds-groups-registry',
|
||||
templateUrl: './groups-registry.component.html',
|
||||
imports: [
|
||||
AsyncPipe,
|
||||
BtnDisabledDirective,
|
||||
NgbTooltipModule,
|
||||
PaginationComponent,
|
||||
ReactiveFormsModule,
|
||||
RouterLink,
|
||||
ThemedLoadingComponent,
|
||||
TranslateModule,
|
||||
RouterLink,
|
||||
ReactiveFormsModule,
|
||||
AsyncPipe,
|
||||
PaginationComponent,
|
||||
NgbTooltipModule,
|
||||
BtnDisabledDirective,
|
||||
],
|
||||
standalone: true,
|
||||
})
|
||||
@@ -179,7 +179,7 @@ export class GroupsRegistryComponent implements OnInit, OnDestroy {
|
||||
getRemoteDataPayload(),
|
||||
switchMap((groups: PaginatedList<Group>) => {
|
||||
if (groups.page.length === 0) {
|
||||
return observableOf(buildPaginatedList(groups.pageInfo, []));
|
||||
return of(buildPaginatedList(groups.pageInfo, []));
|
||||
}
|
||||
return this.authorizationService.isAuthorized(FeatureID.AdministratorOf).pipe(
|
||||
switchMap((isSiteAdmin: boolean) => {
|
||||
@@ -224,7 +224,7 @@ export class GroupsRegistryComponent implements OnInit, OnDestroy {
|
||||
|
||||
canManageGroup$(isSiteAdmin: boolean, group: Group): Observable<boolean> {
|
||||
if (isSiteAdmin) {
|
||||
return observableOf(true);
|
||||
return of(true);
|
||||
} else {
|
||||
return this.authorizationService.isAuthorized(FeatureID.CanManageGroup, group.self);
|
||||
}
|
||||
@@ -283,7 +283,7 @@ export class GroupsRegistryComponent implements OnInit, OnDestroy {
|
||||
return this.dSpaceObjectDataService.findByHref(group._links.object.href).pipe(
|
||||
getFirstSucceededRemoteData(),
|
||||
map((rd: RemoteData<DSpaceObject>) => hasValue(rd) && hasValue(rd.payload)),
|
||||
catchError(() => observableOf(false)),
|
||||
catchError(() => of(false)),
|
||||
);
|
||||
}
|
||||
|
||||
|
@@ -33,10 +33,10 @@ import { FileDropzoneNoUploaderComponent } from '../../shared/upload/file-dropzo
|
||||
selector: 'ds-batch-import-page',
|
||||
templateUrl: './batch-import-page.component.html',
|
||||
imports: [
|
||||
TranslateModule,
|
||||
FormsModule,
|
||||
UiSwitchModule,
|
||||
FileDropzoneNoUploaderComponent,
|
||||
FormsModule,
|
||||
TranslateModule,
|
||||
UiSwitchModule,
|
||||
],
|
||||
standalone: true,
|
||||
})
|
||||
|
@@ -10,7 +10,9 @@ import { MetadataImportPageComponent } from './metadata-import-page.component';
|
||||
selector: 'ds-metadata-import-page',
|
||||
templateUrl: '../../shared/theme-support/themed.component.html',
|
||||
standalone: true,
|
||||
imports: [MetadataImportPageComponent],
|
||||
imports: [
|
||||
MetadataImportPageComponent,
|
||||
],
|
||||
})
|
||||
export class ThemedMetadataImportPageComponent extends ThemedComponent<MetadataImportPageComponent> {
|
||||
protected getComponentName(): string {
|
||||
|
@@ -30,10 +30,7 @@ import {
|
||||
TranslateService,
|
||||
} from '@ngx-translate/core';
|
||||
import { PaginationService } from 'ngx-pagination';
|
||||
import {
|
||||
of as observableOf,
|
||||
of,
|
||||
} from 'rxjs';
|
||||
import { of } from 'rxjs';
|
||||
|
||||
import { RouteService } from '../../../core/services/route.service';
|
||||
import { MockActivatedRoute } from '../../../shared/mocks/active-router.mock';
|
||||
@@ -94,8 +91,8 @@ describe('LdnServiceFormEditComponent', () => {
|
||||
|
||||
beforeEach(async () => {
|
||||
ldnServicesService = jasmine.createSpyObj('ldnServicesService', {
|
||||
create: observableOf(null),
|
||||
update: observableOf(null),
|
||||
create: of(null),
|
||||
update: of(null),
|
||||
findById: createSuccessfulRemoteDataObject$({}),
|
||||
});
|
||||
|
||||
|
@@ -71,10 +71,10 @@ import { notifyPatterns } from '../ldn-services-patterns/ldn-service-coar-patter
|
||||
]),
|
||||
],
|
||||
imports: [
|
||||
AsyncPipe,
|
||||
NgbDropdownModule,
|
||||
ReactiveFormsModule,
|
||||
TranslateModule,
|
||||
NgbDropdownModule,
|
||||
AsyncPipe,
|
||||
],
|
||||
})
|
||||
export class LdnServiceFormComponent implements OnInit, OnDestroy {
|
||||
|
@@ -2,7 +2,7 @@ import {
|
||||
cold,
|
||||
getTestScheduler,
|
||||
} from 'jasmine-marbles';
|
||||
import { of as observableOf } from 'rxjs';
|
||||
import { of } from 'rxjs';
|
||||
import { TestScheduler } from 'rxjs/testing';
|
||||
|
||||
import { RemoteDataBuildService } from '../../../core/cache/builders/remote-data-build.service';
|
||||
@@ -71,12 +71,12 @@ describe('LdnServicesService test', () => {
|
||||
generateRequestId: requestUUID,
|
||||
send: true,
|
||||
removeByHrefSubstring: {},
|
||||
getByHref: observableOf(responseCacheEntry),
|
||||
getByUUID: observableOf(responseCacheEntry),
|
||||
getByHref: of(responseCacheEntry),
|
||||
getByUUID: of(responseCacheEntry),
|
||||
});
|
||||
|
||||
halService = jasmine.createSpyObj('halService', {
|
||||
getEndpoint: observableOf(endpointURL),
|
||||
getEndpoint: of(endpointURL),
|
||||
});
|
||||
|
||||
rdbService = jasmine.createSpyObj('rdbService', {
|
||||
@@ -107,7 +107,7 @@ describe('LdnServicesService test', () => {
|
||||
it('should find service by inbound pattern', (done) => {
|
||||
const params = [new RequestParam('pattern', 'testPattern')];
|
||||
const findListOptions = Object.assign(new FindListOptions(), {}, { searchParams: params });
|
||||
spyOn(service, 'searchBy').and.returnValue(observableOf(null));
|
||||
spyOn(service, 'searchBy').and.returnValue(of(null));
|
||||
spyOn((service as any).searchData, 'searchBy').and.returnValue(createSuccessfulRemoteDataObject$(createPaginatedList([mockLdnService])));
|
||||
|
||||
service.findByInboundPattern('testPattern').subscribe(() => {
|
||||
@@ -120,7 +120,7 @@ describe('LdnServicesService test', () => {
|
||||
const constraints = [{ void: true }];
|
||||
const files = [new File([],'fileName')];
|
||||
spyOn(service as any, 'getInvocationFormData');
|
||||
spyOn(service, 'getBrowseEndpoint').and.returnValue(observableOf('testEndpoint'));
|
||||
spyOn(service, 'getBrowseEndpoint').and.returnValue(of('testEndpoint'));
|
||||
service.invoke('serviceName', 'serviceId', constraints, files).subscribe(result => {
|
||||
expect((service as any).getInvocationFormData).toHaveBeenCalledWith(constraints, files);
|
||||
expect(service.getBrowseEndpoint).toHaveBeenCalled();
|
||||
|
@@ -52,13 +52,13 @@ import { LdnService } from '../ldn-services-model/ldn-services.model';
|
||||
styleUrls: ['./ldn-services-directory.component.scss'],
|
||||
changeDetection: ChangeDetectionStrategy.Default,
|
||||
imports: [
|
||||
TranslateModule,
|
||||
AsyncPipe,
|
||||
NgClass,
|
||||
PaginationComponent,
|
||||
RouterLink,
|
||||
TranslateModule,
|
||||
TruncatableComponent,
|
||||
TruncatablePartComponent,
|
||||
NgClass,
|
||||
RouterLink,
|
||||
],
|
||||
standalone: true,
|
||||
})
|
||||
|
@@ -6,7 +6,9 @@ import { SuggestionSourcesComponent } from '../../../notifications/suggestions/s
|
||||
selector: 'ds-admin-notifications-publication-claim-page',
|
||||
templateUrl: './admin-notifications-publication-claim-page.component.html',
|
||||
styleUrls: ['./admin-notifications-publication-claim-page.component.scss'],
|
||||
imports: [ SuggestionSourcesComponent ],
|
||||
imports: [
|
||||
SuggestionSourcesComponent,
|
||||
],
|
||||
standalone: true,
|
||||
})
|
||||
export class AdminNotificationsPublicationClaimPageComponent {
|
||||
|
@@ -42,9 +42,9 @@ import {
|
||||
standalone: true,
|
||||
imports: [
|
||||
AdminNotifyMetricsComponent,
|
||||
AsyncPipe,
|
||||
RouterLink,
|
||||
TranslateModule,
|
||||
AsyncPipe,
|
||||
],
|
||||
})
|
||||
|
||||
|
@@ -20,8 +20,8 @@ import { AdminNotifyLogsResultComponent } from '../admin-notify-logs-result/admi
|
||||
],
|
||||
standalone: true,
|
||||
imports: [
|
||||
RouterLink,
|
||||
AdminNotifyLogsResultComponent,
|
||||
RouterLink,
|
||||
TranslateModule,
|
||||
],
|
||||
})
|
||||
|
@@ -32,9 +32,9 @@ import { ThemedSearchComponent } from '../../../../shared/search/themed-search.c
|
||||
],
|
||||
standalone: true,
|
||||
imports: [
|
||||
AsyncPipe,
|
||||
SearchLabelsComponent,
|
||||
ThemedSearchComponent,
|
||||
AsyncPipe,
|
||||
TranslateModule,
|
||||
],
|
||||
})
|
||||
|
@@ -20,8 +20,8 @@ import { AdminNotifyLogsResultComponent } from '../admin-notify-logs-result/admi
|
||||
],
|
||||
standalone: true,
|
||||
imports: [
|
||||
RouterLink,
|
||||
AdminNotifyLogsResultComponent,
|
||||
RouterLink,
|
||||
TranslateModule,
|
||||
],
|
||||
})
|
||||
|
@@ -7,10 +7,7 @@ import {
|
||||
import { RouterModule } from '@angular/router';
|
||||
import { NgbModal } from '@ng-bootstrap/ng-bootstrap';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
import {
|
||||
of as observableOf,
|
||||
of,
|
||||
} from 'rxjs';
|
||||
import { of } from 'rxjs';
|
||||
|
||||
import { SearchConfigurationService } from '../../../core/shared/search/search-configuration.service';
|
||||
import { SEARCH_CONFIG_SERVICE } from '../../../my-dspace-page/my-dspace-configuration.service';
|
||||
@@ -120,7 +117,7 @@ describe('AdminNotifySearchResultComponent', () => {
|
||||
fixture = TestBed.createComponent(AdminNotifySearchResultComponent);
|
||||
component = fixture.componentInstance;
|
||||
modalService = TestBed.inject(NgbModal);
|
||||
spyOn(modalService, 'open').and.returnValue(Object.assign({ componentInstance: Object.assign({ response: observableOf(true) }) }));
|
||||
spyOn(modalService, 'open').and.returnValue(Object.assign({ componentInstance: Object.assign({ response: of(true) }) }));
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
|
@@ -39,12 +39,12 @@ import { AdminNotifyMessagesService } from '../services/admin-notify-messages.se
|
||||
],
|
||||
standalone: true,
|
||||
imports: [
|
||||
TranslateModule,
|
||||
DatePipe,
|
||||
AsyncPipe,
|
||||
DatePipe,
|
||||
RouterLink,
|
||||
TranslateModule,
|
||||
TruncatableComponent,
|
||||
TruncatablePartComponent,
|
||||
RouterLink,
|
||||
],
|
||||
})
|
||||
/**
|
||||
|
@@ -9,7 +9,7 @@ import { Router } from '@angular/router';
|
||||
import { RouterTestingModule } from '@angular/router/testing';
|
||||
import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
import { of as observableOf } from 'rxjs';
|
||||
import { of } from 'rxjs';
|
||||
|
||||
import { BitstreamFormatDataService } from '../../../../core/data/bitstream-format-data.service';
|
||||
import { BitstreamFormat } from '../../../../core/shared/bitstream-format.model';
|
||||
@@ -51,7 +51,7 @@ describe('AddBitstreamFormatComponent', () => {
|
||||
notificationService = new NotificationsServiceStub();
|
||||
bitstreamFormatDataService = jasmine.createSpyObj('bitstreamFormatDataService', {
|
||||
createBitstreamFormat: createSuccessfulRemoteDataObject$({}),
|
||||
clearBitStreamFormatRequests: observableOf(null),
|
||||
clearBitStreamFormatRequests: of(null),
|
||||
});
|
||||
|
||||
TestBed.configureTestingModule({
|
||||
@@ -98,7 +98,7 @@ describe('AddBitstreamFormatComponent', () => {
|
||||
notificationService = new NotificationsServiceStub();
|
||||
bitstreamFormatDataService = jasmine.createSpyObj('bitstreamFormatDataService', {
|
||||
createBitstreamFormat: createFailedRemoteDataObject$('Error', 500),
|
||||
clearBitStreamFormatRequests: observableOf(null),
|
||||
clearBitStreamFormatRequests: of(null),
|
||||
});
|
||||
|
||||
TestBed.configureTestingModule({
|
||||
|
@@ -9,7 +9,7 @@ import { RouterModule } from '@angular/router';
|
||||
import { provideMockStore } from '@ngrx/store/testing';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
import { hot } from 'jasmine-marbles';
|
||||
import { of as observableOf } from 'rxjs';
|
||||
import { of } from 'rxjs';
|
||||
|
||||
import { BitstreamFormatDataService } from '../../../core/data/bitstream-format-data.service';
|
||||
import { PaginationService } from '../../../core/pagination/pagination.service';
|
||||
@@ -88,14 +88,14 @@ describe('BitstreamFormatsComponent', () => {
|
||||
notificationsServiceStub = new NotificationsServiceStub();
|
||||
|
||||
bitstreamFormatService = jasmine.createSpyObj('bitstreamFormatService', {
|
||||
findAll: observableOf(mockFormatsRD),
|
||||
findAll: of(mockFormatsRD),
|
||||
find: createSuccessfulRemoteDataObject$(mockFormatsList[0]),
|
||||
getSelectedBitstreamFormats: hot('a', { a: mockFormatsList }),
|
||||
selectBitstreamFormat: {},
|
||||
deselectBitstreamFormat: {},
|
||||
deselectAllBitstreamFormats: {},
|
||||
delete: createSuccessfulRemoteDataObject$({}),
|
||||
clearBitStreamFormatRequests: observableOf('cleared'),
|
||||
clearBitStreamFormatRequests: of('cleared'),
|
||||
});
|
||||
|
||||
paginationService = new PaginationServiceStub();
|
||||
@@ -225,14 +225,14 @@ describe('BitstreamFormatsComponent', () => {
|
||||
notificationsServiceStub = new NotificationsServiceStub();
|
||||
|
||||
bitstreamFormatService = jasmine.createSpyObj('bitstreamFormatService', {
|
||||
findAll: observableOf(mockFormatsRD),
|
||||
findAll: of(mockFormatsRD),
|
||||
find: createSuccessfulRemoteDataObject$(mockFormatsList[0]),
|
||||
getSelectedBitstreamFormats: observableOf(mockFormatsList),
|
||||
getSelectedBitstreamFormats: of(mockFormatsList),
|
||||
selectBitstreamFormat: {},
|
||||
deselectBitstreamFormat: {},
|
||||
deselectAllBitstreamFormats: {},
|
||||
delete: createNoContentRemoteDataObject$(),
|
||||
clearBitStreamFormatRequests: observableOf('cleared'),
|
||||
clearBitStreamFormatRequests: of('cleared'),
|
||||
});
|
||||
|
||||
paginationService = new PaginationServiceStub();
|
||||
@@ -282,14 +282,14 @@ describe('BitstreamFormatsComponent', () => {
|
||||
notificationsServiceStub = new NotificationsServiceStub();
|
||||
|
||||
bitstreamFormatService = jasmine.createSpyObj('bitstreamFormatService', {
|
||||
findAll: observableOf(mockFormatsRD),
|
||||
findAll: of(mockFormatsRD),
|
||||
find: createSuccessfulRemoteDataObject$(mockFormatsList[0]),
|
||||
getSelectedBitstreamFormats: observableOf(mockFormatsList),
|
||||
getSelectedBitstreamFormats: of(mockFormatsList),
|
||||
selectBitstreamFormat: {},
|
||||
deselectBitstreamFormat: {},
|
||||
deselectAllBitstreamFormats: {},
|
||||
delete: createFailedRemoteDataObject$(),
|
||||
clearBitStreamFormatRequests: observableOf('cleared'),
|
||||
clearBitStreamFormatRequests: of('cleared'),
|
||||
});
|
||||
|
||||
paginationService = new PaginationServiceStub();
|
||||
|
@@ -38,9 +38,9 @@ import { PaginationComponentOptions } from '../../../shared/pagination/paginatio
|
||||
templateUrl: './bitstream-formats.component.html',
|
||||
imports: [
|
||||
AsyncPipe,
|
||||
PaginationComponent,
|
||||
RouterLink,
|
||||
TranslateModule,
|
||||
PaginationComponent,
|
||||
],
|
||||
standalone: true,
|
||||
})
|
||||
|
@@ -12,7 +12,7 @@ import {
|
||||
import { RouterTestingModule } from '@angular/router/testing';
|
||||
import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
import { of as observableOf } from 'rxjs';
|
||||
import { of } from 'rxjs';
|
||||
|
||||
import { BitstreamFormatDataService } from '../../../../core/data/bitstream-format-data.service';
|
||||
import { RemoteData } from '../../../../core/data/remote-data';
|
||||
@@ -44,7 +44,7 @@ describe('EditBitstreamFormatComponent', () => {
|
||||
bitstreamFormat.extensions = null;
|
||||
|
||||
const routeStub = {
|
||||
data: observableOf({
|
||||
data: of({
|
||||
bitstreamFormat: createSuccessfulRemoteDataObject(bitstreamFormat),
|
||||
}),
|
||||
};
|
||||
|
@@ -30,9 +30,9 @@ import { FormatFormComponent } from '../format-form/format-form.component';
|
||||
selector: 'ds-edit-bitstream-format',
|
||||
templateUrl: './edit-bitstream-format.component.html',
|
||||
imports: [
|
||||
AsyncPipe,
|
||||
FormatFormComponent,
|
||||
TranslateModule,
|
||||
AsyncPipe,
|
||||
],
|
||||
standalone: true,
|
||||
})
|
||||
|
@@ -14,7 +14,7 @@ import { RouterLink } from '@angular/router';
|
||||
import { RouterTestingModule } from '@angular/router/testing';
|
||||
import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
import { of as observableOf } from 'rxjs';
|
||||
import { of } from 'rxjs';
|
||||
import { FormBuilderService } from 'src/app/shared/form/builder/form-builder.service';
|
||||
|
||||
import { ConfigurationDataService } from '../../../core/data/configuration-data.service';
|
||||
@@ -178,7 +178,7 @@ describe('MetadataRegistryComponent', () => {
|
||||
}));
|
||||
|
||||
it('should cancel editing the selected schema when clicked again', waitForAsync(() => {
|
||||
comp.activeMetadataSchema$ = observableOf(mockSchemasList[0] as MetadataSchema);
|
||||
comp.activeMetadataSchema$ = of(mockSchemasList[0] as MetadataSchema);
|
||||
spyOn(registryService, 'cancelEditMetadataSchema');
|
||||
row.click();
|
||||
fixture.detectChanges();
|
||||
@@ -193,7 +193,7 @@ describe('MetadataRegistryComponent', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
spyOn(registryService, 'deleteMetadataSchema').and.callThrough();
|
||||
comp.selectedMetadataSchemaIDs$ = observableOf(selectedSchemas.map((selectedSchema: MetadataSchema) => selectedSchema.id));
|
||||
comp.selectedMetadataSchemaIDs$ = of(selectedSchemas.map((selectedSchema: MetadataSchema) => selectedSchema.id));
|
||||
comp.deleteSchemas();
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
@@ -43,12 +43,12 @@ import { MetadataSchemaFormComponent } from './metadata-schema-form/metadata-sch
|
||||
templateUrl: './metadata-registry.component.html',
|
||||
styleUrls: ['./metadata-registry.component.scss'],
|
||||
imports: [
|
||||
MetadataSchemaFormComponent,
|
||||
TranslateModule,
|
||||
AsyncPipe,
|
||||
PaginationComponent,
|
||||
MetadataSchemaFormComponent,
|
||||
NgClass,
|
||||
PaginationComponent,
|
||||
RouterLink,
|
||||
TranslateModule,
|
||||
],
|
||||
standalone: true,
|
||||
})
|
||||
|
@@ -9,7 +9,7 @@ import {
|
||||
import { RouterTestingModule } from '@angular/router/testing';
|
||||
import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
import { of as observableOf } from 'rxjs';
|
||||
import { of } from 'rxjs';
|
||||
|
||||
import { MetadataSchema } from '../../../../core/metadata/metadata-schema.model';
|
||||
import { RegistryService } from '../../../../core/registry/registry.service';
|
||||
@@ -72,7 +72,7 @@ describe('MetadataSchemaFormComponent', () => {
|
||||
|
||||
describe('without an active schema', () => {
|
||||
beforeEach(() => {
|
||||
component.activeMetadataSchema$ = observableOf(undefined);
|
||||
component.activeMetadataSchema$ = of(undefined);
|
||||
component.onSubmit();
|
||||
fixture.detectChanges();
|
||||
});
|
||||
@@ -91,7 +91,7 @@ describe('MetadataSchemaFormComponent', () => {
|
||||
} as MetadataSchema);
|
||||
|
||||
beforeEach(() => {
|
||||
component.activeMetadataSchema$ = observableOf(expectedWithId);
|
||||
component.activeMetadataSchema$ = of(expectedWithId);
|
||||
component.onSubmit();
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
@@ -37,8 +37,8 @@ import { FormComponent } from '../../../../shared/form/form.component';
|
||||
templateUrl: './metadata-schema-form.component.html',
|
||||
imports: [
|
||||
AsyncPipe,
|
||||
TranslateModule,
|
||||
FormComponent,
|
||||
TranslateModule,
|
||||
],
|
||||
standalone: true,
|
||||
})
|
||||
|
@@ -9,7 +9,7 @@ import {
|
||||
import { RouterTestingModule } from '@angular/router/testing';
|
||||
import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
import { of as observableOf } from 'rxjs';
|
||||
import { of } from 'rxjs';
|
||||
|
||||
import { MetadataField } from '../../../../core/metadata/metadata-field.model';
|
||||
import { MetadataSchema } from '../../../../core/metadata/metadata-schema.model';
|
||||
@@ -86,7 +86,7 @@ describe('MetadataFieldFormComponent', () => {
|
||||
|
||||
describe('without an active field', () => {
|
||||
beforeEach(() => {
|
||||
spyOn(registryService, 'getActiveMetadataField').and.returnValue(observableOf(undefined));
|
||||
spyOn(registryService, 'getActiveMetadataField').and.returnValue(of(undefined));
|
||||
component.onSubmit();
|
||||
fixture.detectChanges();
|
||||
});
|
||||
@@ -107,7 +107,7 @@ describe('MetadataFieldFormComponent', () => {
|
||||
});
|
||||
|
||||
beforeEach(() => {
|
||||
spyOn(registryService, 'getActiveMetadataField').and.returnValue(observableOf(expectedWithId));
|
||||
spyOn(registryService, 'getActiveMetadataField').and.returnValue(of(expectedWithId));
|
||||
component.onSubmit();
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
@@ -32,9 +32,9 @@ import { FormComponent } from '../../../../shared/form/form.component';
|
||||
selector: 'ds-metadata-field-form',
|
||||
templateUrl: './metadata-field-form.component.html',
|
||||
imports: [
|
||||
AsyncPipe,
|
||||
FormComponent,
|
||||
TranslateModule,
|
||||
AsyncPipe,
|
||||
],
|
||||
standalone: true,
|
||||
})
|
||||
|
@@ -11,7 +11,7 @@ import { ActivatedRoute } from '@angular/router';
|
||||
import { RouterTestingModule } from '@angular/router/testing';
|
||||
import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
import { of as observableOf } from 'rxjs';
|
||||
import { of } from 'rxjs';
|
||||
|
||||
import { ConfigurationDataService } from '../../../core/data/configuration-data.service';
|
||||
import { buildPaginatedList } from '../../../core/data/paginated-list.model';
|
||||
@@ -224,7 +224,7 @@ describe('MetadataSchemaComponent', () => {
|
||||
}));
|
||||
|
||||
it('should cancel editing the selected field when clicked again', waitForAsync(() => {
|
||||
comp.activeField$ = observableOf(mockFieldsList[2] as MetadataField);
|
||||
comp.activeField$ = of(mockFieldsList[2] as MetadataField);
|
||||
spyOn(registryService, 'cancelEditMetadataField');
|
||||
row.click();
|
||||
fixture.detectChanges();
|
||||
@@ -239,7 +239,7 @@ describe('MetadataSchemaComponent', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
spyOn(registryService, 'deleteMetadataField').and.callThrough();
|
||||
comp.selectedMetadataFieldIDs$ = observableOf(selectedFields.map((metadataField: MetadataField) => metadataField.id));
|
||||
comp.selectedMetadataFieldIDs$ = of(selectedFields.map((metadataField: MetadataField) => metadataField.id));
|
||||
comp.deleteFields();
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
@@ -19,7 +19,7 @@ import {
|
||||
BehaviorSubject,
|
||||
combineLatest,
|
||||
Observable,
|
||||
of as observableOf,
|
||||
of,
|
||||
Subscription,
|
||||
zip,
|
||||
} from 'rxjs';
|
||||
@@ -53,12 +53,12 @@ import { MetadataFieldFormComponent } from './metadata-field-form/metadata-field
|
||||
styleUrls: ['./metadata-schema.component.scss'],
|
||||
imports: [
|
||||
AsyncPipe,
|
||||
VarDirective,
|
||||
MetadataFieldFormComponent,
|
||||
TranslateModule,
|
||||
PaginationComponent,
|
||||
NgClass,
|
||||
PaginationComponent,
|
||||
RouterLink,
|
||||
TranslateModule,
|
||||
VarDirective,
|
||||
],
|
||||
standalone: true,
|
||||
})
|
||||
@@ -126,7 +126,7 @@ export class MetadataSchemaComponent implements OnDestroy, OnInit {
|
||||
*/
|
||||
private updateFields() {
|
||||
this.metadataFields$ = this.paginationService.getCurrentPagination(this.config.id, this.config).pipe(
|
||||
switchMap((currentPagination) => combineLatest([this.metadataSchema$, this.needsUpdate$, observableOf(currentPagination)])),
|
||||
switchMap((currentPagination) => combineLatest([this.metadataSchema$, this.needsUpdate$, of(currentPagination)])),
|
||||
switchMap(([schema, update, currentPagination]: [MetadataSchema, boolean, PaginationComponentOptions]) => {
|
||||
if (update) {
|
||||
this.needsUpdate$.next(false);
|
||||
|
@@ -18,7 +18,7 @@ import {
|
||||
TranslateLoader,
|
||||
TranslateModule,
|
||||
} from '@ngx-translate/core';
|
||||
import { of as observableOf } from 'rxjs';
|
||||
import { of } from 'rxjs';
|
||||
import { DspaceRestService } from 'src/app/core/dspace-rest/dspace-rest.service';
|
||||
import { RawRestResponse } from 'src/app/core/dspace-rest/raw-rest-response.model';
|
||||
import { TranslateLoaderMock } from 'src/app/shared/mocks/translate-loader.mock';
|
||||
@@ -80,7 +80,7 @@ describe('FiltersComponent', () => {
|
||||
|
||||
describe('toggle', () => {
|
||||
beforeEach(() => {
|
||||
spyOn(component, 'getFilteredCollections').and.returnValue(observableOf(expected));
|
||||
spyOn(component, 'getFilteredCollections').and.returnValue(of(expected));
|
||||
spyOn(component.results, 'deserialize');
|
||||
spyOn(component.accordionComponent, 'expand').and.callThrough();
|
||||
component.submit();
|
||||
|
@@ -30,10 +30,10 @@ import { FilteredCollections } from './filtered-collections.model';
|
||||
templateUrl: './filtered-collections.component.html',
|
||||
styleUrls: ['./filtered-collections.component.scss'],
|
||||
imports: [
|
||||
TranslateModule,
|
||||
NgbAccordionModule,
|
||||
FiltersComponent,
|
||||
KeyValuePipe,
|
||||
NgbAccordionModule,
|
||||
TranslateModule,
|
||||
],
|
||||
standalone: true,
|
||||
})
|
||||
|
@@ -11,7 +11,7 @@ import { By } from '@angular/platform-browser';
|
||||
import { Router } from '@angular/router';
|
||||
import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
import { of as observableOf } from 'rxjs';
|
||||
import { of } from 'rxjs';
|
||||
|
||||
import { AuthorizationDataService } from '../../../../core/data/feature-authorization/authorization-data.service';
|
||||
import { ScriptDataService } from '../../../../core/data/processes/script-data.service';
|
||||
@@ -59,7 +59,7 @@ describe('FilteredItemsExportCsvComponent', () => {
|
||||
invoke: createSuccessfulRemoteDataObject$(process),
|
||||
});
|
||||
authorizationDataService = jasmine.createSpyObj('authorizationService', {
|
||||
isAuthorized: observableOf(true),
|
||||
isAuthorized: of(true),
|
||||
});
|
||||
|
||||
notificationsService = new NotificationsServiceStub();
|
||||
@@ -110,7 +110,7 @@ describe('FilteredItemsExportCsvComponent', () => {
|
||||
describe('when the user is not an admin', () => {
|
||||
beforeEach(waitForAsync(() => {
|
||||
initBeforeEachAsync();
|
||||
(authorizationDataService.isAuthorized as jasmine.Spy).and.returnValue(observableOf(false));
|
||||
(authorizationDataService.isAuthorized as jasmine.Spy).and.returnValue(of(false));
|
||||
}));
|
||||
beforeEach(() => {
|
||||
initBeforeEach();
|
||||
|
@@ -35,7 +35,11 @@ import { QueryPredicate } from '../query-predicate.model';
|
||||
styleUrls: ['./filtered-items-export-csv.component.scss'],
|
||||
templateUrl: './filtered-items-export-csv.component.html',
|
||||
standalone: true,
|
||||
imports: [NgbTooltipModule, AsyncPipe, TranslateModule],
|
||||
imports: [
|
||||
AsyncPipe,
|
||||
NgbTooltipModule,
|
||||
TranslateModule,
|
||||
],
|
||||
})
|
||||
/**
|
||||
* Display a button to export the MetadataQuery (aka Filtered Items) Report results as csv
|
||||
|
@@ -61,14 +61,14 @@ import { QueryPredicate } from './query-predicate.model';
|
||||
templateUrl: './filtered-items.component.html',
|
||||
styleUrls: ['./filtered-items.component.scss'],
|
||||
imports: [
|
||||
ReactiveFormsModule,
|
||||
NgbAccordionModule,
|
||||
TranslateModule,
|
||||
AsyncPipe,
|
||||
FiltersComponent,
|
||||
BtnDisabledDirective,
|
||||
FilteredItemsExportCsvComponent,
|
||||
FiltersComponent,
|
||||
NgbAccordionModule,
|
||||
ReactiveFormsModule,
|
||||
ThemedLoadingComponent,
|
||||
TranslateModule,
|
||||
],
|
||||
standalone: true,
|
||||
})
|
||||
|
@@ -8,7 +8,9 @@ import { ThemedConfigurationSearchPageComponent } from '../../search-page/themed
|
||||
templateUrl: './admin-search-page.component.html',
|
||||
styleUrls: ['./admin-search-page.component.scss'],
|
||||
standalone: true,
|
||||
imports: [ThemedConfigurationSearchPageComponent],
|
||||
imports: [
|
||||
ThemedConfigurationSearchPageComponent,
|
||||
],
|
||||
})
|
||||
|
||||
/**
|
||||
|
@@ -19,7 +19,10 @@ import { SearchResultGridElementComponent } from '../../../../../shared/object-g
|
||||
styleUrls: ['./collection-admin-search-result-grid-element.component.scss'],
|
||||
templateUrl: './collection-admin-search-result-grid-element.component.html',
|
||||
standalone: true,
|
||||
imports: [CollectionSearchResultGridElementComponent, RouterLink],
|
||||
imports: [
|
||||
CollectionSearchResultGridElementComponent,
|
||||
RouterLink,
|
||||
],
|
||||
})
|
||||
/**
|
||||
* The component for displaying a list element for a collection search result on the admin search page
|
||||
|
@@ -19,7 +19,10 @@ import { SearchResultGridElementComponent } from '../../../../../shared/object-g
|
||||
styleUrls: ['./community-admin-search-result-grid-element.component.scss'],
|
||||
templateUrl: './community-admin-search-result-grid-element.component.html',
|
||||
standalone: true,
|
||||
imports: [CommunitySearchResultGridElementComponent, RouterLink],
|
||||
imports: [
|
||||
CommunitySearchResultGridElementComponent,
|
||||
RouterLink,
|
||||
],
|
||||
})
|
||||
/**
|
||||
* The component for displaying a list element for a community search result on the admin search page
|
||||
|
@@ -31,7 +31,10 @@ import { ItemAdminSearchResultActionsComponent } from '../../item-admin-search-r
|
||||
styleUrls: ['./item-admin-search-result-grid-element.component.scss'],
|
||||
templateUrl: './item-admin-search-result-grid-element.component.html',
|
||||
standalone: true,
|
||||
imports: [ItemAdminSearchResultActionsComponent, DynamicComponentLoaderDirective],
|
||||
imports: [
|
||||
DynamicComponentLoaderDirective,
|
||||
ItemAdminSearchResultActionsComponent,
|
||||
],
|
||||
})
|
||||
/**
|
||||
* The component for displaying a list element for an item search result on the admin search page
|
||||
|
@@ -20,7 +20,11 @@ import { SearchResultListElementComponent } from '../../../../../shared/object-l
|
||||
styleUrls: ['./collection-admin-search-result-list-element.component.scss'],
|
||||
templateUrl: './collection-admin-search-result-list-element.component.html',
|
||||
standalone: true,
|
||||
imports: [CollectionSearchResultListElementComponent, RouterLink, TranslateModule],
|
||||
imports: [
|
||||
CollectionSearchResultListElementComponent,
|
||||
RouterLink,
|
||||
TranslateModule,
|
||||
],
|
||||
})
|
||||
/**
|
||||
* The component for displaying a list element for a collection search result on the admin search page
|
||||
|
@@ -20,7 +20,11 @@ import { SearchResultListElementComponent } from '../../../../../shared/object-l
|
||||
styleUrls: ['./community-admin-search-result-list-element.component.scss'],
|
||||
templateUrl: './community-admin-search-result-list-element.component.html',
|
||||
standalone: true,
|
||||
imports: [CommunitySearchResultListElementComponent, RouterLink, TranslateModule],
|
||||
imports: [
|
||||
CommunitySearchResultListElementComponent,
|
||||
RouterLink,
|
||||
TranslateModule,
|
||||
],
|
||||
})
|
||||
/**
|
||||
* The component for displaying a list element for a community search result on the admin search page
|
||||
|
@@ -15,7 +15,10 @@ import { ItemAdminSearchResultActionsComponent } from '../../item-admin-search-r
|
||||
styleUrls: ['./item-admin-search-result-list-element.component.scss'],
|
||||
templateUrl: './item-admin-search-result-list-element.component.html',
|
||||
standalone: true,
|
||||
imports: [ListableObjectComponentLoaderComponent, ItemAdminSearchResultActionsComponent],
|
||||
imports: [
|
||||
ItemAdminSearchResultActionsComponent,
|
||||
ListableObjectComponentLoaderComponent,
|
||||
],
|
||||
})
|
||||
/**
|
||||
* The component for displaying a list element for an item search result on the admin search page
|
||||
|
@@ -23,7 +23,11 @@ import { getItemEditRoute } from '../../../item-page/item-page-routing-paths';
|
||||
styleUrls: ['./item-admin-search-result-actions.component.scss'],
|
||||
templateUrl: './item-admin-search-result-actions.component.html',
|
||||
standalone: true,
|
||||
imports: [NgClass, RouterLink, TranslateModule],
|
||||
imports: [
|
||||
NgClass,
|
||||
RouterLink,
|
||||
TranslateModule,
|
||||
],
|
||||
})
|
||||
/**
|
||||
* The component for displaying the actions for a list element for an item search result on the admin search page
|
||||
|
@@ -10,7 +10,9 @@ import { AdminSearchPageComponent } from './admin-search-page.component';
|
||||
selector: 'ds-admin-search-page',
|
||||
templateUrl: '../../shared/theme-support/themed.component.html',
|
||||
standalone: true,
|
||||
imports: [AdminSearchPageComponent],
|
||||
imports: [
|
||||
AdminSearchPageComponent,
|
||||
],
|
||||
})
|
||||
export class ThemedAdminSearchPageComponent extends ThemedComponent<AdminSearchPageComponent> {
|
||||
|
||||
|
@@ -96,7 +96,9 @@ describe('AdminSidebarSectionComponent', () => {
|
||||
selector: 'ds-test-cmp',
|
||||
template: ``,
|
||||
standalone: true,
|
||||
imports: [RouterTestingModule],
|
||||
imports: [
|
||||
RouterTestingModule,
|
||||
],
|
||||
})
|
||||
class TestComponent {
|
||||
}
|
||||
|
@@ -27,7 +27,12 @@ import { BrowserOnlyPipe } from '../../../shared/utils/browser-only.pipe';
|
||||
templateUrl: './admin-sidebar-section.component.html',
|
||||
styleUrls: ['./admin-sidebar-section.component.scss'],
|
||||
standalone: true,
|
||||
imports: [NgClass, RouterLink, TranslateModule, BrowserOnlyPipe],
|
||||
imports: [
|
||||
BrowserOnlyPipe,
|
||||
NgClass,
|
||||
RouterLink,
|
||||
TranslateModule,
|
||||
],
|
||||
|
||||
})
|
||||
export class AdminSidebarSectionComponent extends AbstractMenuSectionComponent implements OnInit {
|
||||
|
@@ -19,7 +19,7 @@ import {
|
||||
NgbModalRef,
|
||||
} from '@ng-bootstrap/ng-bootstrap';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
import { of as observableOf } from 'rxjs';
|
||||
import { of } from 'rxjs';
|
||||
|
||||
import { AuthService } from '../../core/auth/auth.service';
|
||||
import { AuthorizationDataService } from '../../core/data/feature-authorization/authorization-data.service';
|
||||
@@ -57,7 +57,7 @@ describe('AdminSidebarComponent', () => {
|
||||
|
||||
|
||||
const routeStub = {
|
||||
data: observableOf({
|
||||
data: of({
|
||||
dso: createSuccessfulRemoteDataObject(mockItem),
|
||||
}),
|
||||
children: [],
|
||||
@@ -65,16 +65,16 @@ describe('AdminSidebarComponent', () => {
|
||||
|
||||
const mockNgbModal = {
|
||||
open: jasmine.createSpy('open').and.returnValue(
|
||||
{ componentInstance: {}, closed: observableOf({}) } as NgbModalRef,
|
||||
{ componentInstance: {}, closed: of({}) } as NgbModalRef,
|
||||
),
|
||||
};
|
||||
|
||||
|
||||
beforeEach(waitForAsync(() => {
|
||||
authorizationService = jasmine.createSpyObj('authorizationService', {
|
||||
isAuthorized: observableOf(true),
|
||||
isAuthorized: of(true),
|
||||
});
|
||||
scriptService = jasmine.createSpyObj('scriptService', { scriptWithNameExistsAndCanExecute: observableOf(true) });
|
||||
scriptService = jasmine.createSpyObj('scriptService', { scriptWithNameExistsAndCanExecute: of(true) });
|
||||
TestBed.configureTestingModule({
|
||||
imports: [TranslateModule.forRoot(), NoopAnimationsModule, RouterTestingModule, AdminSidebarComponent],
|
||||
providers: [
|
||||
@@ -98,10 +98,10 @@ describe('AdminSidebarComponent', () => {
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
spyOn(menuService, 'getMenuTopSections').and.returnValue(observableOf([]));
|
||||
spyOn(menuService, 'getMenuTopSections').and.returnValue(of([]));
|
||||
fixture = TestBed.createComponent(AdminSidebarComponent);
|
||||
comp = fixture.componentInstance; // SearchPageComponent test instance
|
||||
comp.sections = observableOf([]);
|
||||
comp.sections = of([]);
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
|
@@ -12,7 +12,7 @@ import {
|
||||
} from '@angular/core';
|
||||
import { ActivatedRoute } from '@angular/router';
|
||||
import { NgbDropdownModule } from '@ng-bootstrap/ng-bootstrap';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
import { TranslatePipe } from '@ngx-translate/core';
|
||||
import {
|
||||
BehaviorSubject,
|
||||
combineLatest,
|
||||
@@ -45,7 +45,14 @@ import { BrowserOnlyPipe } from '../../shared/utils/browser-only.pipe';
|
||||
styleUrls: ['./admin-sidebar.component.scss'],
|
||||
animations: [slideSidebar],
|
||||
standalone: true,
|
||||
imports: [NgbDropdownModule, NgClass, NgComponentOutlet, AsyncPipe, TranslateModule, BrowserOnlyPipe],
|
||||
imports: [
|
||||
AsyncPipe,
|
||||
BrowserOnlyPipe,
|
||||
NgbDropdownModule,
|
||||
NgClass,
|
||||
NgComponentOutlet,
|
||||
TranslatePipe,
|
||||
],
|
||||
})
|
||||
export class AdminSidebarComponent extends MenuComponent implements OnInit {
|
||||
/**
|
||||
|
@@ -8,7 +8,7 @@ import { By } from '@angular/platform-browser';
|
||||
import { NoopAnimationsModule } from '@angular/platform-browser/animations';
|
||||
import { Router } from '@angular/router';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
import { of as observableOf } from 'rxjs';
|
||||
import { of } from 'rxjs';
|
||||
|
||||
import { MenuService } from '../../../shared/menu/menu.service';
|
||||
import { MenuItemModels } from '../../../shared/menu/menu-section.model';
|
||||
@@ -39,7 +39,7 @@ describe('ExpandableAdminSidebarSectionComponent', () => {
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
spyOn(menuService, 'getSubSectionsByParentID').and.returnValue(observableOf([{
|
||||
spyOn(menuService, 'getSubSectionsByParentID').and.returnValue(of([{
|
||||
id: 'test',
|
||||
visible: true,
|
||||
model: {} as MenuItemModels,
|
||||
@@ -90,7 +90,7 @@ describe('ExpandableAdminSidebarSectionComponent', () => {
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
spyOn(menuService, 'getSubSectionsByParentID').and.returnValue(observableOf([]));
|
||||
spyOn(menuService, 'getSubSectionsByParentID').and.returnValue(of([]));
|
||||
fixture = TestBed.createComponent(ExpandableAdminSidebarSectionComponent);
|
||||
component = fixture.componentInstance;
|
||||
spyOn(component as any, 'getMenuItemComponent').and.returnValue(TestComponent);
|
||||
|
@@ -37,7 +37,13 @@ import { AdminSidebarSectionComponent } from '../admin-sidebar-section/admin-sid
|
||||
styleUrls: ['./expandable-admin-sidebar-section.component.scss'],
|
||||
animations: [rotate, slide, bgColor],
|
||||
standalone: true,
|
||||
imports: [NgClass, NgComponentOutlet, AsyncPipe, TranslateModule, BrowserOnlyPipe],
|
||||
imports: [
|
||||
AsyncPipe,
|
||||
BrowserOnlyPipe,
|
||||
NgClass,
|
||||
NgComponentOutlet,
|
||||
TranslateModule,
|
||||
],
|
||||
})
|
||||
|
||||
export class ExpandableAdminSidebarSectionComponent extends AdminSidebarSectionComponent implements OnInit {
|
||||
|
@@ -15,7 +15,9 @@ import { AdminSidebarComponent } from './admin-sidebar.component';
|
||||
styleUrls: [],
|
||||
templateUrl: '../../shared/theme-support/themed.component.html',
|
||||
standalone: true,
|
||||
imports: [AdminSidebarComponent],
|
||||
imports: [
|
||||
AdminSidebarComponent,
|
||||
],
|
||||
})
|
||||
export class ThemedAdminSidebarComponent extends ThemedComponent<AdminSidebarComponent> {
|
||||
|
||||
|
@@ -17,7 +17,11 @@ import {
|
||||
styleUrls: ['./workflow-item-admin-workflow-actions.component.scss'],
|
||||
templateUrl: './workflow-item-admin-workflow-actions.component.html',
|
||||
standalone: true,
|
||||
imports: [NgClass, RouterLink, TranslateModule],
|
||||
imports: [
|
||||
NgClass,
|
||||
RouterLink,
|
||||
TranslateModule,
|
||||
],
|
||||
})
|
||||
/**
|
||||
* The component for displaying the actions for a list element for a workflow-item on the admin workflow search page
|
||||
|
@@ -34,7 +34,12 @@ import { ErrorComponent } from '../../../../../../shared/error/error.component';
|
||||
styleUrls: ['./supervision-order-group-selector.component.scss'],
|
||||
templateUrl: './supervision-order-group-selector.component.html',
|
||||
standalone: true,
|
||||
imports: [FormsModule, ErrorComponent, EpersonGroupListComponent, TranslateModule],
|
||||
imports: [
|
||||
EpersonGroupListComponent,
|
||||
ErrorComponent,
|
||||
FormsModule,
|
||||
TranslateModule,
|
||||
],
|
||||
})
|
||||
export class SupervisionOrderGroupSelectorComponent {
|
||||
|
||||
|
@@ -38,7 +38,12 @@ export interface SupervisionOrderListEntry {
|
||||
templateUrl: './supervision-order-status.component.html',
|
||||
styleUrls: ['./supervision-order-status.component.scss'],
|
||||
standalone: true,
|
||||
imports: [VarDirective, NgbTooltipModule, AsyncPipe, TranslateModule],
|
||||
imports: [
|
||||
AsyncPipe,
|
||||
NgbTooltipModule,
|
||||
TranslateModule,
|
||||
VarDirective,
|
||||
],
|
||||
})
|
||||
export class SupervisionOrderStatusComponent implements OnChanges {
|
||||
|
||||
|
@@ -49,7 +49,12 @@ import {
|
||||
styleUrls: ['./workspace-item-admin-workflow-actions.component.scss'],
|
||||
templateUrl: './workspace-item-admin-workflow-actions.component.html',
|
||||
standalone: true,
|
||||
imports: [SupervisionOrderStatusComponent, NgClass, RouterLink, TranslateModule],
|
||||
imports: [
|
||||
NgClass,
|
||||
RouterLink,
|
||||
SupervisionOrderStatusComponent,
|
||||
TranslateModule,
|
||||
],
|
||||
})
|
||||
/**
|
||||
* The component for displaying the actions for a list element for a workspace-item on the admin workflow search page
|
||||
|
@@ -7,7 +7,7 @@ import {
|
||||
import { NoopAnimationsModule } from '@angular/platform-browser/animations';
|
||||
import { RouterTestingModule } from '@angular/router/testing';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
import { of as observableOf } from 'rxjs';
|
||||
import { of } from 'rxjs';
|
||||
|
||||
import { AuthService } from '../../../../../core/auth/auth.service';
|
||||
import { LinkService } from '../../../../../core/cache/builders/link.service';
|
||||
@@ -71,7 +71,7 @@ describe('WorkflowItemSearchResultAdminWorkflowGridElementComponent', () => {
|
||||
{ provide: ThemeService, useValue: themeService },
|
||||
{
|
||||
provide: TruncatableService, useValue: {
|
||||
isCollapsed: () => observableOf(true),
|
||||
isCollapsed: () => of(true),
|
||||
},
|
||||
},
|
||||
{ provide: BitstreamDataService, useValue: {} },
|
||||
|
@@ -43,7 +43,11 @@ import { WorkflowItemAdminWorkflowActionsComponent } from '../../actions/workflo
|
||||
styleUrls: ['./workflow-item-search-result-admin-workflow-grid-element.component.scss'],
|
||||
templateUrl: './workflow-item-search-result-admin-workflow-grid-element.component.html',
|
||||
standalone: true,
|
||||
imports: [WorkflowItemAdminWorkflowActionsComponent, TranslateModule, DynamicComponentLoaderDirective],
|
||||
imports: [
|
||||
DynamicComponentLoaderDirective,
|
||||
TranslateModule,
|
||||
WorkflowItemAdminWorkflowActionsComponent,
|
||||
],
|
||||
})
|
||||
/**
|
||||
* The component for displaying a grid element for an workflow item on the admin workflow search page
|
||||
|
@@ -7,7 +7,7 @@ import {
|
||||
import { NoopAnimationsModule } from '@angular/platform-browser/animations';
|
||||
import { RouterTestingModule } from '@angular/router/testing';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
import { of as observableOf } from 'rxjs';
|
||||
import { of } from 'rxjs';
|
||||
|
||||
import { AuthService } from '../../../../../core/auth/auth.service';
|
||||
import { LinkService } from '../../../../../core/cache/builders/link.service';
|
||||
@@ -83,7 +83,7 @@ describe('WorkspaceItemSearchResultAdminWorkflowGridElementComponent', () => {
|
||||
{ provide: ThemeService, useValue: themeService },
|
||||
{
|
||||
provide: TruncatableService, useValue: {
|
||||
isCollapsed: () => observableOf(true),
|
||||
isCollapsed: () => of(true),
|
||||
},
|
||||
},
|
||||
{ provide: BitstreamDataService, useValue: {} },
|
||||
|
@@ -56,7 +56,12 @@ import { WorkspaceItemAdminWorkflowActionsComponent } from '../../actions/worksp
|
||||
styleUrls: ['./workspace-item-search-result-admin-workflow-grid-element.component.scss'],
|
||||
templateUrl: './workspace-item-search-result-admin-workflow-grid-element.component.html',
|
||||
standalone: true,
|
||||
imports: [WorkspaceItemAdminWorkflowActionsComponent, AsyncPipe, TranslateModule, DynamicComponentLoaderDirective],
|
||||
imports: [
|
||||
AsyncPipe,
|
||||
DynamicComponentLoaderDirective,
|
||||
TranslateModule,
|
||||
WorkspaceItemAdminWorkflowActionsComponent,
|
||||
],
|
||||
})
|
||||
/**
|
||||
* The component for displaying a grid element for an workflow item on the admin workflow search page
|
||||
|
@@ -39,7 +39,12 @@ import { WorkflowItemAdminWorkflowActionsComponent } from '../../actions/workflo
|
||||
styleUrls: ['./workflow-item-search-result-admin-workflow-list-element.component.scss'],
|
||||
templateUrl: './workflow-item-search-result-admin-workflow-list-element.component.html',
|
||||
standalone: true,
|
||||
imports: [ListableObjectComponentLoaderComponent, WorkflowItemAdminWorkflowActionsComponent, AsyncPipe, TranslateModule],
|
||||
imports: [
|
||||
AsyncPipe,
|
||||
ListableObjectComponentLoaderComponent,
|
||||
TranslateModule,
|
||||
WorkflowItemAdminWorkflowActionsComponent,
|
||||
],
|
||||
})
|
||||
/**
|
||||
* The component for displaying a list element for a workflow item on the admin workflow search page
|
||||
|
@@ -49,7 +49,12 @@ import { WorkspaceItemAdminWorkflowActionsComponent } from '../../actions/worksp
|
||||
styleUrls: ['./workspace-item-search-result-admin-workflow-list-element.component.scss'],
|
||||
templateUrl: './workspace-item-search-result-admin-workflow-list-element.component.html',
|
||||
standalone: true,
|
||||
imports: [ListableObjectComponentLoaderComponent, WorkspaceItemAdminWorkflowActionsComponent, AsyncPipe, TranslateModule],
|
||||
imports: [
|
||||
AsyncPipe,
|
||||
ListableObjectComponentLoaderComponent,
|
||||
TranslateModule,
|
||||
WorkspaceItemAdminWorkflowActionsComponent,
|
||||
],
|
||||
})
|
||||
/**
|
||||
* The component for displaying a list element for a workflow item on the admin workflow search page
|
||||
|
@@ -10,7 +10,9 @@ import { AdminWorkflowPageComponent } from './admin-workflow-page.component';
|
||||
selector: 'ds-admin-workflow-page',
|
||||
templateUrl: '../../shared/theme-support/themed.component.html',
|
||||
standalone: true,
|
||||
imports: [AdminWorkflowPageComponent],
|
||||
imports: [
|
||||
AdminWorkflowPageComponent,
|
||||
],
|
||||
})
|
||||
export class ThemedAdminWorkflowPageComponent extends ThemedComponent<AdminWorkflowPageComponent> {
|
||||
|
||||
|
@@ -60,8 +60,8 @@ import { ThemeService } from './shared/theme-support/theme.service';
|
||||
changeDetection: ChangeDetectionStrategy.OnPush,
|
||||
standalone: true,
|
||||
imports: [
|
||||
ThemedRootComponent,
|
||||
AsyncPipe,
|
||||
ThemedRootComponent,
|
||||
],
|
||||
})
|
||||
export class AppComponent implements OnInit, AfterViewInit {
|
||||
|
@@ -14,7 +14,7 @@ import {
|
||||
TranslateModule,
|
||||
} from '@ngx-translate/core';
|
||||
import { cold } from 'jasmine-marbles';
|
||||
import { of as observableOf } from 'rxjs';
|
||||
import { of } from 'rxjs';
|
||||
|
||||
import { Bitstream } from '../../core/shared/bitstream.model';
|
||||
import { DSpaceObject } from '../../core/shared/dspace-object.model';
|
||||
@@ -45,7 +45,7 @@ describe('BitstreamAuthorizationsComponent', () => {
|
||||
const bitstreamRD = createSuccessfulRemoteDataObject(bitstream);
|
||||
|
||||
const routeStub = {
|
||||
data: observableOf({
|
||||
data: of({
|
||||
bitstream: bitstreamRD,
|
||||
}),
|
||||
};
|
||||
|
@@ -22,10 +22,10 @@ import { ResourcePoliciesComponent } from '../../shared/resource-policies/resour
|
||||
selector: 'ds-bitstream-authorizations',
|
||||
templateUrl: './bitstream-authorizations.component.html',
|
||||
imports: [
|
||||
ResourcePoliciesComponent,
|
||||
AsyncPipe,
|
||||
TranslateModule,
|
||||
ResourcePoliciesComponent,
|
||||
RouterLink,
|
||||
TranslateModule,
|
||||
],
|
||||
standalone: true,
|
||||
})
|
||||
|
@@ -13,7 +13,7 @@ import {
|
||||
Router,
|
||||
} from '@angular/router';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
import { of as observableOf } from 'rxjs';
|
||||
import { of } from 'rxjs';
|
||||
|
||||
import { getForbiddenRoute } from '../../app-routing-paths';
|
||||
import { AuthService } from '../../core/auth/auth.service';
|
||||
@@ -61,16 +61,16 @@ describe('BitstreamDownloadPageComponent', () => {
|
||||
|
||||
function init() {
|
||||
authService = jasmine.createSpyObj('authService', {
|
||||
isAuthenticated: observableOf(true),
|
||||
isAuthenticated: of(true),
|
||||
setRedirectUrl: {},
|
||||
getShortlivedToken: observableOf('token'),
|
||||
getShortlivedToken: of('token'),
|
||||
});
|
||||
authorizationService = jasmine.createSpyObj('authorizationSerivice', {
|
||||
isAuthorized: observableOf(true),
|
||||
isAuthorized: of(true),
|
||||
});
|
||||
|
||||
fileService = jasmine.createSpyObj('fileService', {
|
||||
retrieveFileDownloadLink: observableOf('content-url-with-headers'),
|
||||
retrieveFileDownloadLink: of('content-url-with-headers'),
|
||||
});
|
||||
|
||||
hardRedirectService = jasmine.createSpyObj('hardRedirectService', {
|
||||
@@ -93,13 +93,13 @@ describe('BitstreamDownloadPageComponent', () => {
|
||||
},
|
||||
});
|
||||
activatedRoute = {
|
||||
data: observableOf({
|
||||
data: of({
|
||||
bitstream: createSuccessfulRemoteDataObject(bitstream),
|
||||
}),
|
||||
params: observableOf({
|
||||
params: of({
|
||||
id: 'testid',
|
||||
}),
|
||||
queryParams: observableOf({
|
||||
queryParams: of({
|
||||
accessToken: undefined,
|
||||
}),
|
||||
};
|
||||
@@ -111,13 +111,13 @@ describe('BitstreamDownloadPageComponent', () => {
|
||||
});
|
||||
|
||||
signpostingDataService = jasmine.createSpyObj('SignpostingDataService', {
|
||||
getLinks: observableOf([mocklink, mocklink2]),
|
||||
getLinks: of([mocklink, mocklink2]),
|
||||
});
|
||||
matomoService = jasmine.createSpyObj('MatomoService', {
|
||||
appendVisitorId: observableOf(''),
|
||||
isMatomoEnabled$: observableOf(true),
|
||||
appendVisitorId: of(''),
|
||||
isMatomoEnabled$: of(true),
|
||||
});
|
||||
matomoService.appendVisitorId.and.callFake((link) => observableOf(link));
|
||||
matomoService.appendVisitorId.and.callFake((link) => of(link));
|
||||
}
|
||||
|
||||
function initTestbed() {
|
||||
@@ -161,7 +161,7 @@ describe('BitstreamDownloadPageComponent', () => {
|
||||
describe('when the user is authorized and not logged in', () => {
|
||||
beforeEach(waitForAsync(() => {
|
||||
init();
|
||||
(authService.isAuthenticated as jasmine.Spy).and.returnValue(observableOf(false));
|
||||
(authService.isAuthenticated as jasmine.Spy).and.returnValue(of(false));
|
||||
|
||||
initTestbed();
|
||||
}));
|
||||
@@ -198,7 +198,7 @@ describe('BitstreamDownloadPageComponent', () => {
|
||||
describe('when the user is not authorized and logged in', () => {
|
||||
beforeEach(waitForAsync(() => {
|
||||
init();
|
||||
(authorizationService.isAuthorized as jasmine.Spy).and.returnValue(observableOf(false));
|
||||
(authorizationService.isAuthorized as jasmine.Spy).and.returnValue(of(false));
|
||||
initTestbed();
|
||||
}));
|
||||
beforeEach(() => {
|
||||
@@ -215,8 +215,8 @@ describe('BitstreamDownloadPageComponent', () => {
|
||||
describe('when the user is not authorized and not logged in', () => {
|
||||
beforeEach(waitForAsync(() => {
|
||||
init();
|
||||
(authService.isAuthenticated as jasmine.Spy).and.returnValue(observableOf(false));
|
||||
(authorizationService.isAuthorized as jasmine.Spy).and.returnValue(observableOf(false));
|
||||
(authService.isAuthenticated as jasmine.Spy).and.returnValue(of(false));
|
||||
(authorizationService.isAuthorized as jasmine.Spy).and.returnValue(of(false));
|
||||
initTestbed();
|
||||
}));
|
||||
beforeEach(() => {
|
||||
@@ -236,7 +236,7 @@ describe('BitstreamDownloadPageComponent', () => {
|
||||
describe('when Matomo is enabled', () => {
|
||||
beforeEach(waitForAsync(() => {
|
||||
init();
|
||||
(matomoService.appendVisitorId as jasmine.Spy).and.callFake((link) => observableOf(link + '?visitorId=12345'));
|
||||
(matomoService.appendVisitorId as jasmine.Spy).and.callFake((link) => of(link + '?visitorId=12345'));
|
||||
initTestbed();
|
||||
}));
|
||||
beforeEach(() => {
|
||||
@@ -255,7 +255,7 @@ describe('BitstreamDownloadPageComponent', () => {
|
||||
describe('when Matomo is not enabled', () => {
|
||||
beforeEach(waitForAsync(() => {
|
||||
init();
|
||||
(matomoService.isMatomoEnabled$ as jasmine.Spy).and.returnValue(observableOf(false));
|
||||
(matomoService.isMatomoEnabled$ as jasmine.Spy).and.returnValue(of(false));
|
||||
initTestbed();
|
||||
}));
|
||||
beforeEach(() => {
|
||||
|
@@ -19,7 +19,7 @@ import { TranslateModule } from '@ngx-translate/core';
|
||||
import {
|
||||
combineLatest as observableCombineLatest,
|
||||
Observable,
|
||||
of as observableOf,
|
||||
of,
|
||||
} from 'rxjs';
|
||||
import {
|
||||
filter,
|
||||
@@ -108,7 +108,7 @@ export class BitstreamDownloadPageComponent implements OnInit {
|
||||
const isAuthorized$ = this.authorizationService.isAuthorized(FeatureID.CanDownload, isNotEmpty(bitstream) ? bitstream.self : undefined);
|
||||
const isLoggedIn$ = this.auth.isAuthenticated();
|
||||
const isMatomoEnabled$ = this.matomoService.isMatomoEnabled$();
|
||||
return observableCombineLatest([isAuthorized$, isLoggedIn$, isMatomoEnabled$, accessToken$, observableOf(bitstream)]);
|
||||
return observableCombineLatest([isAuthorized$, isLoggedIn$, isMatomoEnabled$, accessToken$, of(bitstream)]);
|
||||
}),
|
||||
filter(([isAuthorized, isLoggedIn, isMatomoEnabled, accessToken, bitstream]: [boolean, boolean, boolean, string, Bitstream]) => (hasValue(isAuthorized) && hasValue(isLoggedIn)) || hasValue(accessToken)),
|
||||
take(1),
|
||||
@@ -132,7 +132,7 @@ export class BitstreamDownloadPageComponent implements OnInit {
|
||||
map((fileLinkWithVisitorId) => [isAuthorized, isLoggedIn, bitstream, fileLinkWithVisitorId, accessToken]),
|
||||
);
|
||||
}
|
||||
return observableOf([isAuthorized, isLoggedIn, bitstream, fileLink, accessToken]);
|
||||
return of([isAuthorized, isLoggedIn, bitstream, fileLink, accessToken]);
|
||||
}),
|
||||
).subscribe(([isAuthorized, isLoggedIn, bitstream, fileLink, accessToken]: [boolean, boolean, Bitstream, string, string]) => {
|
||||
if (isAuthorized && isLoggedIn && isNotEmpty(fileLink)) {
|
||||
|
@@ -5,7 +5,7 @@ import {
|
||||
} from '@angular/router';
|
||||
import {
|
||||
Observable,
|
||||
of as observableOf,
|
||||
of,
|
||||
} from 'rxjs';
|
||||
import { AuthService } from 'src/app/core/auth/auth.service';
|
||||
import { AuthorizationDataService } from 'src/app/core/data/feature-authorization/authorization-data.service';
|
||||
@@ -29,14 +29,14 @@ describe('bitstreamPageAuthorizationsGuard', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
authorizationService = jasmine.createSpyObj('authorizationService', {
|
||||
isAuthorized: observableOf(true),
|
||||
isAuthorized: of(true),
|
||||
});
|
||||
router = jasmine.createSpyObj('router', {
|
||||
parseUrl: {},
|
||||
navigateByUrl: undefined,
|
||||
});
|
||||
authService = jasmine.createSpyObj('authService', {
|
||||
isAuthenticated: observableOf(true),
|
||||
isAuthenticated: of(true),
|
||||
});
|
||||
|
||||
parentRoute = {
|
||||
|
@@ -1,5 +1,5 @@
|
||||
import { CanActivateFn } from '@angular/router';
|
||||
import { of as observableOf } from 'rxjs';
|
||||
import { of } from 'rxjs';
|
||||
|
||||
import { dsoPageSingleFeatureGuard } from '../core/data/feature-authorization/feature-authorization-guard/dso-page-single-feature.guard';
|
||||
import { FeatureID } from '../core/data/feature-authorization/feature-id';
|
||||
@@ -12,5 +12,5 @@ import { bitstreamPageResolver } from './bitstream-page.resolver';
|
||||
export const bitstreamPageAuthorizationsGuard: CanActivateFn =
|
||||
dsoPageSingleFeatureGuard(
|
||||
() => bitstreamPageResolver,
|
||||
() => observableOf(FeatureID.CanManagePolicies),
|
||||
() => of(FeatureID.CanManagePolicies),
|
||||
);
|
||||
|
@@ -21,7 +21,7 @@ import {
|
||||
DynamicFormService,
|
||||
} from '@ng-dynamic-forms/core';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
import { of as observableOf } from 'rxjs';
|
||||
import { of } from 'rxjs';
|
||||
|
||||
import { DSONameService } from '../../core/breadcrumbs/dso-name.service';
|
||||
import { BitstreamDataService } from '../../core/data/bitstream-data.service';
|
||||
@@ -222,7 +222,7 @@ describe('EditBitstreamPageComponent', () => {
|
||||
{
|
||||
provide: ActivatedRoute,
|
||||
useValue: {
|
||||
data: observableOf({ bitstream: createSuccessfulRemoteDataObject(bitstream) }),
|
||||
data: of({ bitstream: createSuccessfulRemoteDataObject(bitstream) }),
|
||||
snapshot: { queryParams: {} },
|
||||
},
|
||||
},
|
||||
@@ -517,7 +517,7 @@ describe('EditBitstreamPageComponent', () => {
|
||||
{
|
||||
provide: ActivatedRoute,
|
||||
useValue: {
|
||||
data: observableOf({ bitstream: createSuccessfulRemoteDataObject(bitstream) }),
|
||||
data: of({ bitstream: createSuccessfulRemoteDataObject(bitstream) }),
|
||||
snapshot: { queryParams: {} },
|
||||
},
|
||||
},
|
||||
@@ -640,7 +640,7 @@ describe('EditBitstreamPageComponent', () => {
|
||||
{ provide: DynamicFormService, useValue: formService },
|
||||
{ provide: ActivatedRoute,
|
||||
useValue: {
|
||||
data: observableOf({ bitstream: createSuccessfulRemoteDataObject(bitstream) }),
|
||||
data: of({ bitstream: createSuccessfulRemoteDataObject(bitstream) }),
|
||||
snapshot: { queryParams: {} },
|
||||
},
|
||||
},
|
||||
|
@@ -28,7 +28,7 @@ import {
|
||||
combineLatest,
|
||||
combineLatest as observableCombineLatest,
|
||||
Observable,
|
||||
of as observableOf,
|
||||
of,
|
||||
Subscription,
|
||||
} from 'rxjs';
|
||||
import {
|
||||
@@ -83,15 +83,15 @@ import { ThemedThumbnailComponent } from '../../thumbnail/themed-thumbnail.compo
|
||||
templateUrl: './edit-bitstream-page.component.html',
|
||||
changeDetection: ChangeDetectionStrategy.OnPush,
|
||||
imports: [
|
||||
FormComponent,
|
||||
VarDirective,
|
||||
ThemedThumbnailComponent,
|
||||
AsyncPipe,
|
||||
RouterLink,
|
||||
ErrorComponent,
|
||||
ThemedLoadingComponent,
|
||||
TranslateModule,
|
||||
FileSizePipe,
|
||||
FormComponent,
|
||||
RouterLink,
|
||||
ThemedLoadingComponent,
|
||||
ThemedThumbnailComponent,
|
||||
TranslateModule,
|
||||
VarDirective,
|
||||
],
|
||||
standalone: true,
|
||||
})
|
||||
@@ -682,7 +682,7 @@ export class EditBitstreamPageComponent implements OnInit, OnDestroy {
|
||||
}));
|
||||
|
||||
} else {
|
||||
bundle$ = observableOf(this.bundle);
|
||||
bundle$ = of(this.bundle);
|
||||
}
|
||||
if (isNewFormat) {
|
||||
bitstream$ = this.bitstreamService.updateFormat(this.bitstream, this.selectedFormat).pipe(
|
||||
@@ -699,7 +699,7 @@ export class EditBitstreamPageComponent implements OnInit, OnDestroy {
|
||||
}),
|
||||
);
|
||||
} else {
|
||||
bitstream$ = observableOf(this.bitstream);
|
||||
bitstream$ = of(this.bitstream);
|
||||
}
|
||||
|
||||
combineLatest([bundle$, bitstream$]).pipe(
|
||||
|
@@ -8,7 +8,9 @@ import { EditBitstreamPageComponent } from './edit-bitstream-page.component';
|
||||
styleUrls: [],
|
||||
templateUrl: '../../shared/theme-support/themed.component.html',
|
||||
standalone: true,
|
||||
imports: [EditBitstreamPageComponent],
|
||||
imports: [
|
||||
EditBitstreamPageComponent,
|
||||
],
|
||||
})
|
||||
export class ThemedEditBitstreamPageComponent extends ThemedComponent<EditBitstreamPageComponent> {
|
||||
protected getComponentName(): string {
|
||||
|
@@ -10,7 +10,7 @@ import {
|
||||
TranslateLoader,
|
||||
TranslateModule,
|
||||
} from '@ngx-translate/core';
|
||||
import { of as observableOf } from 'rxjs';
|
||||
import { of } from 'rxjs';
|
||||
|
||||
import { TranslateLoaderMock } from '../shared/testing/translate-loader.mock';
|
||||
import { VarDirective } from '../shared/utils/var.directive';
|
||||
@@ -38,12 +38,12 @@ describe('BreadcrumbsComponent', () => {
|
||||
|
||||
beforeEach(waitForAsync(() => {
|
||||
breadcrumbsServiceMock = {
|
||||
breadcrumbs$: observableOf([
|
||||
breadcrumbs$: of([
|
||||
// NOTE: a root breadcrumb is automatically rendered
|
||||
new Breadcrumb('bc 1', 'example.com'),
|
||||
new Breadcrumb('bc 2', 'another.com'),
|
||||
]),
|
||||
showBreadcrumbs$: observableOf(true),
|
||||
showBreadcrumbs$: of(true),
|
||||
} as BreadcrumbsService;
|
||||
|
||||
TestBed.configureTestingModule({
|
||||
|
@@ -20,7 +20,14 @@ import { BreadcrumbsService } from './breadcrumbs.service';
|
||||
templateUrl: './breadcrumbs.component.html',
|
||||
styleUrls: ['./breadcrumbs.component.scss'],
|
||||
standalone: true,
|
||||
imports: [VarDirective, NgTemplateOutlet, RouterLink, NgbTooltipModule, AsyncPipe, TranslateModule],
|
||||
imports: [
|
||||
AsyncPipe,
|
||||
NgbTooltipModule,
|
||||
NgTemplateOutlet,
|
||||
RouterLink,
|
||||
TranslateModule,
|
||||
VarDirective,
|
||||
],
|
||||
})
|
||||
export class BreadcrumbsComponent {
|
||||
|
||||
|
@@ -7,7 +7,7 @@ import {
|
||||
import { cold } from 'jasmine-marbles';
|
||||
import {
|
||||
Observable,
|
||||
of as observableOf,
|
||||
of,
|
||||
Subject,
|
||||
} from 'rxjs';
|
||||
|
||||
@@ -18,7 +18,7 @@ import { BreadcrumbsService } from './breadcrumbs.service';
|
||||
|
||||
class TestBreadcrumbsService implements BreadcrumbsProviderService<string> {
|
||||
getBreadcrumbs(key: string, url: string): Observable<Breadcrumb[]> {
|
||||
return observableOf([new Breadcrumb(key, url)]);
|
||||
return of([new Breadcrumb(key, url)]);
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -7,7 +7,7 @@ import {
|
||||
import {
|
||||
combineLatest,
|
||||
Observable,
|
||||
of as observableOf,
|
||||
of,
|
||||
ReplaySubject,
|
||||
} from 'rxjs';
|
||||
import {
|
||||
@@ -86,7 +86,7 @@ export class BreadcrumbsService {
|
||||
return provider.getBreadcrumbs(key, url);
|
||||
}
|
||||
}
|
||||
return !last ? this.resolveBreadcrumbs(route.firstChild) : observableOf([]);
|
||||
return !last ? this.resolveBreadcrumbs(route.firstChild) : of([]);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -11,7 +11,9 @@ import { BreadcrumbsComponent } from './breadcrumbs.component';
|
||||
styleUrls: [],
|
||||
templateUrl: '../shared/theme-support/themed.component.html',
|
||||
standalone: true,
|
||||
imports: [BreadcrumbsComponent],
|
||||
imports: [
|
||||
BreadcrumbsComponent,
|
||||
],
|
||||
})
|
||||
export class ThemedBreadcrumbsComponent extends ThemedComponent<BreadcrumbsComponent> {
|
||||
protected getComponentName(): string {
|
||||
|
@@ -20,7 +20,7 @@ import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
|
||||
import { Store } from '@ngrx/store';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
import { cold } from 'jasmine-marbles';
|
||||
import { of as observableOf } from 'rxjs';
|
||||
import { of } from 'rxjs';
|
||||
|
||||
import { APP_CONFIG } from '../../../config/app-config.interface';
|
||||
import { environment } from '../../../environments/environment';
|
||||
@@ -96,9 +96,9 @@ describe('BrowseByDateComponent', () => {
|
||||
};
|
||||
|
||||
const activatedRouteStub = Object.assign(new ActivatedRouteStub(), {
|
||||
params: observableOf({}),
|
||||
queryParams: observableOf({}),
|
||||
data: observableOf({ metadata: 'dateissued', metadataField: 'dc.date.issued' }),
|
||||
params: of({}),
|
||||
queryParams: of({}),
|
||||
data: of({ metadata: 'dateissued', metadataField: 'dc.date.issued' }),
|
||||
});
|
||||
|
||||
const mockCdRef = Object.assign({
|
||||
|
@@ -18,7 +18,7 @@ import { TranslateModule } from '@ngx-translate/core';
|
||||
import {
|
||||
combineLatest as observableCombineLatest,
|
||||
Observable,
|
||||
of as observableOf,
|
||||
of,
|
||||
} from 'rxjs';
|
||||
import {
|
||||
distinctUntilChanged,
|
||||
@@ -61,9 +61,9 @@ import {
|
||||
standalone: true,
|
||||
imports: [
|
||||
AsyncPipe,
|
||||
TranslateModule,
|
||||
ThemedLoadingComponent,
|
||||
ThemedBrowseByComponent,
|
||||
ThemedLoadingComponent,
|
||||
TranslateModule,
|
||||
],
|
||||
})
|
||||
/**
|
||||
@@ -94,7 +94,7 @@ export class BrowseByDateComponent extends BrowseByMetadataComponent implements
|
||||
|
||||
ngOnInit(): void {
|
||||
if (!this.renderOnServerSide && !environment.ssr.enableBrowseComponent && isPlatformServer(this.platformId)) {
|
||||
this.loading$ = observableOf(false);
|
||||
this.loading$ = of(false);
|
||||
return;
|
||||
}
|
||||
const sortConfig = new SortOptions('default', SortDirection.ASC);
|
||||
|
@@ -7,7 +7,7 @@ import {
|
||||
import { ActivatedRoute } from '@angular/router';
|
||||
import { StoreModule } from '@ngrx/store';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
import { of as observableOf } from 'rxjs';
|
||||
import { of } from 'rxjs';
|
||||
|
||||
import { environment } from '../../../environments/environment';
|
||||
import { buildPaginatedList } from '../../core/data/paginated-list.model';
|
||||
@@ -25,7 +25,7 @@ import { BrowseByGeospatialDataComponent } from './browse-by-geospatial-data.com
|
||||
// create route stub
|
||||
const scope = 'test scope';
|
||||
const activatedRouteStub = {
|
||||
queryParams: observableOf({
|
||||
queryParams: of({
|
||||
scope: scope,
|
||||
}),
|
||||
};
|
||||
@@ -107,7 +107,7 @@ describe('BrowseByGeospatialDataComponent', () => {
|
||||
fixture = TestBed.createComponent(BrowseByGeospatialDataComponent);
|
||||
component = fixture.componentInstance;
|
||||
spyOn(searchService, 'getFacetValuesFor').and.returnValue(mockPointValues);
|
||||
component.scope$ = observableOf('');
|
||||
component.scope$ = of('');
|
||||
component.ngOnInit();
|
||||
fixture.detectChanges();
|
||||
});
|
||||
@@ -128,7 +128,7 @@ describe('BrowseByGeospatialDataComponent', () => {
|
||||
fixture = TestBed.createComponent(BrowseByGeospatialDataComponent);
|
||||
component = fixture.componentInstance;
|
||||
spyOn(searchService, 'getFacetValuesFor').and.returnValue(mockValues);
|
||||
component.scope$ = observableOf('');
|
||||
component.scope$ = of('');
|
||||
component.ngOnInit();
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
@@ -44,7 +44,12 @@ import { PaginatedSearchOptions } from '../../shared/search/models/paginated-sea
|
||||
templateUrl: './browse-by-geospatial-data.component.html',
|
||||
styleUrls: ['./browse-by-geospatial-data.component.scss'],
|
||||
changeDetection: ChangeDetectionStrategy.OnPush,
|
||||
imports: [GeospatialMapComponent, NgIf, AsyncPipe, TranslateModule],
|
||||
imports: [
|
||||
AsyncPipe,
|
||||
GeospatialMapComponent,
|
||||
NgIf,
|
||||
TranslateModule,
|
||||
],
|
||||
standalone: true,
|
||||
})
|
||||
/**
|
||||
|
@@ -9,7 +9,7 @@ import {
|
||||
import { TranslateService } from '@ngx-translate/core';
|
||||
import {
|
||||
Observable,
|
||||
of as observableOf,
|
||||
of,
|
||||
} from 'rxjs';
|
||||
import {
|
||||
map,
|
||||
@@ -42,7 +42,7 @@ export const browseByGuard: CanActivateFn = (
|
||||
map((browseDefinitionRD: RemoteData<BrowseDefinition>) => browseDefinitionRD.payload),
|
||||
);
|
||||
} else {
|
||||
browseDefinition$ = observableOf(route.data.browseDefinition);
|
||||
browseDefinition$ = of(route.data.browseDefinition);
|
||||
}
|
||||
const scope = route.queryParams.scope ?? route.parent?.params.id;
|
||||
const value = route.queryParams.value;
|
||||
@@ -51,10 +51,10 @@ export const browseByGuard: CanActivateFn = (
|
||||
switchMap((browseDefinition: BrowseDefinition | undefined) => {
|
||||
if (hasValue(browseDefinition)) {
|
||||
route.data = createData(title, id, browseDefinition, metadataTranslated, value, route, scope);
|
||||
return observableOf(true);
|
||||
return of(true);
|
||||
} else {
|
||||
void router.navigate([PAGE_NOT_FOUND_PATH]);
|
||||
return observableOf(false);
|
||||
return of(false);
|
||||
}
|
||||
}),
|
||||
);
|
||||
|
@@ -21,7 +21,7 @@ import { TranslateModule } from '@ngx-translate/core';
|
||||
import { cold } from 'jasmine-marbles';
|
||||
import {
|
||||
Observable,
|
||||
of as observableOf,
|
||||
of,
|
||||
} from 'rxjs';
|
||||
import { RouteService } from 'src/app/core/services/route.service';
|
||||
import { DsoEditMenuComponent } from 'src/app/shared/dso-page/dso-edit-menu/dso-edit-menu.component';
|
||||
@@ -124,7 +124,7 @@ describe('BrowseByMetadataComponent', () => {
|
||||
};
|
||||
|
||||
const activatedRouteStub = Object.assign(new ActivatedRouteStub(), {
|
||||
params: observableOf({}),
|
||||
params: of({}),
|
||||
});
|
||||
|
||||
paginationService = new PaginationServiceStub();
|
||||
@@ -170,7 +170,7 @@ describe('BrowseByMetadataComponent', () => {
|
||||
fixture.detectChanges();
|
||||
browseService = (comp as any).browseService;
|
||||
route = (comp as any).route;
|
||||
route.params = observableOf({});
|
||||
route.params = of({});
|
||||
comp.ngOnInit();
|
||||
fixture.detectChanges();
|
||||
});
|
||||
@@ -190,7 +190,7 @@ describe('BrowseByMetadataComponent', () => {
|
||||
value: 'John Doe',
|
||||
};
|
||||
|
||||
route.params = observableOf(paramsWithValue);
|
||||
route.params = of(paramsWithValue);
|
||||
comp.ngOnInit();
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
@@ -22,7 +22,7 @@ import {
|
||||
BehaviorSubject,
|
||||
combineLatest as observableCombineLatest,
|
||||
Observable,
|
||||
of as observableOf,
|
||||
of,
|
||||
Subscription,
|
||||
} from 'rxjs';
|
||||
import {
|
||||
@@ -68,9 +68,9 @@ export const BBM_PAGINATION_ID = 'bbm';
|
||||
templateUrl: './browse-by-metadata.component.html',
|
||||
imports: [
|
||||
AsyncPipe,
|
||||
TranslateModule,
|
||||
ThemedLoadingComponent,
|
||||
ThemedBrowseByComponent,
|
||||
ThemedLoadingComponent,
|
||||
TranslateModule,
|
||||
],
|
||||
standalone: true,
|
||||
})
|
||||
@@ -186,7 +186,7 @@ export class BrowseByMetadataComponent implements OnInit, OnChanges, OnDestroy {
|
||||
/**
|
||||
* Observable determining if the loading animation needs to be shown
|
||||
*/
|
||||
loading$ = observableOf(true);
|
||||
loading$ = of(true);
|
||||
/**
|
||||
* Whether this component should be rendered or not in SSR
|
||||
*/
|
||||
@@ -213,7 +213,7 @@ export class BrowseByMetadataComponent implements OnInit, OnChanges, OnDestroy {
|
||||
|
||||
ngOnInit(): void {
|
||||
if (this.ssrRenderingDisabled) {
|
||||
this.loading$ = observableOf(false);
|
||||
this.loading$ = of(false);
|
||||
return;
|
||||
}
|
||||
const sortConfig = new SortOptions('default', SortDirection.ASC);
|
||||
|
@@ -31,7 +31,9 @@ class BrowseByTestComponent {
|
||||
selector: 'ds-browse-by-switcher',
|
||||
template: `<ng-template #DynamicComponentLoader dsDynamicComponentLoader></ng-template>`,
|
||||
standalone: true,
|
||||
imports: [DynamicComponentLoaderDirective],
|
||||
imports: [
|
||||
DynamicComponentLoaderDirective,
|
||||
],
|
||||
})
|
||||
class TestBrowseBySwitcherComponent extends BrowseBySwitcherComponent {
|
||||
getComponent(): GenericConstructor<Component> {
|
||||
|
@@ -16,8 +16,8 @@ import { BrowseBySwitcherComponent } from '../browse-by-switcher/browse-by-switc
|
||||
templateUrl: './browse-by-page.component.html',
|
||||
styleUrls: ['./browse-by-page.component.scss'],
|
||||
imports: [
|
||||
BrowseBySwitcherComponent,
|
||||
AsyncPipe,
|
||||
BrowseBySwitcherComponent,
|
||||
],
|
||||
standalone: true,
|
||||
})
|
||||
|
@@ -17,7 +17,11 @@ import { getComponentByBrowseByType } from './browse-by-decorator';
|
||||
@Component({
|
||||
selector: 'ds-browse-by-switcher',
|
||||
templateUrl: '../../shared/abstract-component-loader/abstract-component-loader.component.html',
|
||||
imports: [AsyncPipe, NgComponentOutlet, DynamicComponentLoaderDirective],
|
||||
imports: [
|
||||
AsyncPipe,
|
||||
DynamicComponentLoaderDirective,
|
||||
NgComponentOutlet,
|
||||
],
|
||||
standalone: true,
|
||||
})
|
||||
export class BrowseBySwitcherComponent extends AbstractComponentLoaderComponent<Component> {
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user