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