diff --git a/src/app/access-control/epeople-registry/epeople-registry.component.spec.ts b/src/app/access-control/epeople-registry/epeople-registry.component.spec.ts index 4a09913862..a2fb64b39d 100644 --- a/src/app/access-control/epeople-registry/epeople-registry.component.spec.ts +++ b/src/app/access-control/epeople-registry/epeople-registry.component.spec.ts @@ -99,7 +99,7 @@ describe('EPeopleRegistryComponent', () => { deleteEPerson(ePerson: EPerson): Observable { this.allEpeople = this.allEpeople.filter((ePerson2: EPerson) => { return (ePerson2.uuid !== ePerson.uuid); - }); + }); return observableOf(true); }, editEPerson(ePerson: EPerson) { diff --git a/src/app/access-control/epeople-registry/epeople-registry.component.ts b/src/app/access-control/epeople-registry/epeople-registry.component.ts index fb045ebb88..e632f588a4 100644 --- a/src/app/access-control/epeople-registry/epeople-registry.component.ts +++ b/src/app/access-control/epeople-registry/epeople-registry.component.ts @@ -157,34 +157,34 @@ export class EPeopleRegistryComponent implements OnInit, OnDestroy { } this.findListOptionsSub = this.paginationService.getCurrentPagination(this.config.id, this.config).pipe( switchMap((findListOptions) => { - const query: string = data.query; - const scope: string = data.scope; - if (query != null && this.currentSearchQuery !== query) { - this.router.navigate([this.epersonService.getEPeoplePageRouterLink()], { - queryParamsHandling: 'merge' - }); - this.currentSearchQuery = query; - this.paginationService.resetPage(this.config.id); - } - if (scope != null && this.currentSearchScope !== scope) { - this.router.navigate([this.epersonService.getEPeoplePageRouterLink()], { - queryParamsHandling: 'merge' - }); - this.currentSearchScope = scope; - this.paginationService.resetPage(this.config.id); - - } - return this.epersonService.searchByScope(this.currentSearchScope, this.currentSearchQuery, { - currentPage: findListOptions.currentPage, - elementsPerPage: findListOptions.pageSize + const query: string = data.query; + const scope: string = data.scope; + if (query != null && this.currentSearchQuery !== query) { + this.router.navigate([this.epersonService.getEPeoplePageRouterLink()], { + queryParamsHandling: 'merge' }); + this.currentSearchQuery = query; + this.paginationService.resetPage(this.config.id); } + if (scope != null && this.currentSearchScope !== scope) { + this.router.navigate([this.epersonService.getEPeoplePageRouterLink()], { + queryParamsHandling: 'merge' + }); + this.currentSearchScope = scope; + this.paginationService.resetPage(this.config.id); + + } + return this.epersonService.searchByScope(this.currentSearchScope, this.currentSearchQuery, { + currentPage: findListOptions.currentPage, + elementsPerPage: findListOptions.pageSize + }); + } ), getAllSucceededRemoteData(), ).subscribe((peopleRD) => { - this.ePeople$.next(peopleRD.payload); - this.pageInfoState$.next(peopleRD.payload.pageInfo); - } + this.ePeople$.next(peopleRD.payload); + this.pageInfoState$.next(peopleRD.payload.pageInfo); + } ); } diff --git a/src/app/access-control/epeople-registry/eperson-form/eperson-form.component.spec.ts b/src/app/access-control/epeople-registry/eperson-form/eperson-form.component.spec.ts index fb911e709c..b01f810a67 100644 --- a/src/app/access-control/epeople-registry/eperson-form/eperson-form.component.spec.ts +++ b/src/app/access-control/epeople-registry/eperson-form/eperson-form.component.spec.ts @@ -112,60 +112,60 @@ describe('EPersonFormComponent', () => { createFormGroup(formModel, options = null) { const controls = {}; formModel.forEach( model => { - model.parent = parent; - const controlModel = model; - const controlState = { value: controlModel.value, disabled: controlModel.disabled }; - const controlOptions = this.createAbstractControlOptions(controlModel.validators, controlModel.asyncValidators, controlModel.updateOn); - controls[model.id] = new UntypedFormControl(controlState, controlOptions); + model.parent = parent; + const controlModel = model; + const controlState = { value: controlModel.value, disabled: controlModel.disabled }; + const controlOptions = this.createAbstractControlOptions(controlModel.validators, controlModel.asyncValidators, controlModel.updateOn); + controls[model.id] = new UntypedFormControl(controlState, controlOptions); }); return new UntypedFormGroup(controls, options); }, createAbstractControlOptions(validatorsConfig = null, asyncValidatorsConfig = null, updateOn = null) { return { - validators: validatorsConfig !== null ? this.getValidators(validatorsConfig) : null, + validators: validatorsConfig !== null ? this.getValidators(validatorsConfig) : null, }; }, getValidators(validatorsConfig) { - return this.getValidatorFns(validatorsConfig); + return this.getValidatorFns(validatorsConfig); }, getValidatorFns(validatorsConfig, validatorsToken = this._NG_VALIDATORS) { let validatorFns = []; if (this.isObject(validatorsConfig)) { - validatorFns = Object.keys(validatorsConfig).map(validatorConfigKey => { - const validatorConfigValue = validatorsConfig[validatorConfigKey]; - if (this.isValidatorDescriptor(validatorConfigValue)) { - const descriptor = validatorConfigValue; - return this.getValidatorFn(descriptor.name, descriptor.args, validatorsToken); - } - return this.getValidatorFn(validatorConfigKey, validatorConfigValue, validatorsToken); - }); + validatorFns = Object.keys(validatorsConfig).map(validatorConfigKey => { + const validatorConfigValue = validatorsConfig[validatorConfigKey]; + if (this.isValidatorDescriptor(validatorConfigValue)) { + const descriptor = validatorConfigValue; + return this.getValidatorFn(descriptor.name, descriptor.args, validatorsToken); + } + return this.getValidatorFn(validatorConfigKey, validatorConfigValue, validatorsToken); + }); } return validatorFns; }, getValidatorFn(validatorName, validatorArgs = null, validatorsToken = this._NG_VALIDATORS) { let validatorFn; if (Validators.hasOwnProperty(validatorName)) { // Built-in Angular Validators - validatorFn = Validators[validatorName]; + validatorFn = Validators[validatorName]; } else { // Custom Validators - if (this._DYNAMIC_VALIDATORS && this._DYNAMIC_VALIDATORS.has(validatorName)) { - validatorFn = this._DYNAMIC_VALIDATORS.get(validatorName); - } else if (validatorsToken) { - validatorFn = validatorsToken.find(validator => validator.name === validatorName); - } + if (this._DYNAMIC_VALIDATORS && this._DYNAMIC_VALIDATORS.has(validatorName)) { + validatorFn = this._DYNAMIC_VALIDATORS.get(validatorName); + } else if (validatorsToken) { + validatorFn = validatorsToken.find(validator => validator.name === validatorName); + } } if (validatorFn === undefined) { // throw when no validator could be resolved - throw new Error(`validator '${validatorName}' is not provided via NG_VALIDATORS, NG_ASYNC_VALIDATORS or DYNAMIC_FORM_VALIDATORS`); + throw new Error(`validator '${validatorName}' is not provided via NG_VALIDATORS, NG_ASYNC_VALIDATORS or DYNAMIC_FORM_VALIDATORS`); } if (validatorArgs !== null) { - return validatorFn(validatorArgs); + return validatorFn(validatorArgs); } return validatorFn; - }, + }, isValidatorDescriptor(value) { - if (this.isObject(value)) { - return value.hasOwnProperty('name') && value.hasOwnProperty('args'); - } - return false; + if (this.isObject(value)) { + return value.hasOwnProperty('name') && value.hasOwnProperty('args'); + } + return false; }, isObject(value) { return typeof value === 'object' && value !== null; diff --git a/src/app/access-control/epeople-registry/eperson-form/eperson-form.component.ts b/src/app/access-control/epeople-registry/eperson-form/eperson-form.component.ts index 7665cb24da..b83c8e6cf4 100644 --- a/src/app/access-control/epeople-registry/eperson-form/eperson-form.component.ts +++ b/src/app/access-control/epeople-registry/eperson-form/eperson-form.component.ts @@ -528,14 +528,14 @@ export class EPersonFormComponent implements OnInit, OnDestroy { if (hasValue(this.epersonInitial.email)) { this.epersonRegistrationService.registerEmail(this.epersonInitial.email, null, TYPE_REQUEST_FORGOT).pipe(getFirstCompletedRemoteData()) .subscribe((response: RemoteData) => { - if (response.hasSucceeded) { - this.notificationsService.success(this.translateService.get('admin.access-control.epeople.actions.reset'), - this.translateService.get('forgot-email.form.success.content', {email: this.epersonInitial.email})); - } else { - this.notificationsService.error(this.translateService.get('forgot-email.form.error.head'), - this.translateService.get('forgot-email.form.error.content', {email: this.epersonInitial.email})); - } + if (response.hasSucceeded) { + this.notificationsService.success(this.translateService.get('admin.access-control.epeople.actions.reset'), + this.translateService.get('forgot-email.form.success.content', {email: this.epersonInitial.email})); + } else { + this.notificationsService.error(this.translateService.get('forgot-email.form.error.head'), + this.translateService.get('forgot-email.form.error.content', {email: this.epersonInitial.email})); } + } ); } } diff --git a/src/app/access-control/group-registry/group-form/group-form.component.spec.ts b/src/app/access-control/group-registry/group-form/group-form.component.spec.ts index f8c5f3cd87..7540ae0393 100644 --- a/src/app/access-control/group-registry/group-form/group-form.component.spec.ts +++ b/src/app/access-control/group-registry/group-form/group-form.component.spec.ts @@ -128,60 +128,60 @@ describe('GroupFormComponent', () => { createFormGroup(formModel, options = null) { const controls = {}; formModel.forEach( model => { - model.parent = parent; - const controlModel = model; - const controlState = { value: controlModel.value, disabled: controlModel.disabled }; - const controlOptions = this.createAbstractControlOptions(controlModel.validators, controlModel.asyncValidators, controlModel.updateOn); - controls[model.id] = new UntypedFormControl(controlState, controlOptions); + model.parent = parent; + const controlModel = model; + const controlState = { value: controlModel.value, disabled: controlModel.disabled }; + const controlOptions = this.createAbstractControlOptions(controlModel.validators, controlModel.asyncValidators, controlModel.updateOn); + controls[model.id] = new UntypedFormControl(controlState, controlOptions); }); return new UntypedFormGroup(controls, options); }, createAbstractControlOptions(validatorsConfig = null, asyncValidatorsConfig = null, updateOn = null) { return { - validators: validatorsConfig !== null ? this.getValidators(validatorsConfig) : null, + validators: validatorsConfig !== null ? this.getValidators(validatorsConfig) : null, }; }, getValidators(validatorsConfig) { - return this.getValidatorFns(validatorsConfig); + return this.getValidatorFns(validatorsConfig); }, getValidatorFns(validatorsConfig, validatorsToken = this._NG_VALIDATORS) { let validatorFns = []; if (this.isObject(validatorsConfig)) { - validatorFns = Object.keys(validatorsConfig).map(validatorConfigKey => { - const validatorConfigValue = validatorsConfig[validatorConfigKey]; - if (this.isValidatorDescriptor(validatorConfigValue)) { - const descriptor = validatorConfigValue; - return this.getValidatorFn(descriptor.name, descriptor.args, validatorsToken); - } - return this.getValidatorFn(validatorConfigKey, validatorConfigValue, validatorsToken); - }); + validatorFns = Object.keys(validatorsConfig).map(validatorConfigKey => { + const validatorConfigValue = validatorsConfig[validatorConfigKey]; + if (this.isValidatorDescriptor(validatorConfigValue)) { + const descriptor = validatorConfigValue; + return this.getValidatorFn(descriptor.name, descriptor.args, validatorsToken); + } + return this.getValidatorFn(validatorConfigKey, validatorConfigValue, validatorsToken); + }); } return validatorFns; }, getValidatorFn(validatorName, validatorArgs = null, validatorsToken = this._NG_VALIDATORS) { let validatorFn; if (Validators.hasOwnProperty(validatorName)) { // Built-in Angular Validators - validatorFn = Validators[validatorName]; + validatorFn = Validators[validatorName]; } else { // Custom Validators - if (this._DYNAMIC_VALIDATORS && this._DYNAMIC_VALIDATORS.has(validatorName)) { - validatorFn = this._DYNAMIC_VALIDATORS.get(validatorName); - } else if (validatorsToken) { - validatorFn = validatorsToken.find(validator => validator.name === validatorName); - } + if (this._DYNAMIC_VALIDATORS && this._DYNAMIC_VALIDATORS.has(validatorName)) { + validatorFn = this._DYNAMIC_VALIDATORS.get(validatorName); + } else if (validatorsToken) { + validatorFn = validatorsToken.find(validator => validator.name === validatorName); + } } if (validatorFn === undefined) { // throw when no validator could be resolved - throw new Error(`validator '${validatorName}' is not provided via NG_VALIDATORS, NG_ASYNC_VALIDATORS or DYNAMIC_FORM_VALIDATORS`); + throw new Error(`validator '${validatorName}' is not provided via NG_VALIDATORS, NG_ASYNC_VALIDATORS or DYNAMIC_FORM_VALIDATORS`); } if (validatorArgs !== null) { - return validatorFn(validatorArgs); + return validatorFn(validatorArgs); } return validatorFn; - }, + }, isValidatorDescriptor(value) { - if (this.isObject(value)) { - return value.hasOwnProperty('name') && value.hasOwnProperty('args'); - } - return false; + if (this.isObject(value)) { + return value.hasOwnProperty('name') && value.hasOwnProperty('args'); + } + return false; }, isObject(value) { return typeof value === 'object' && value !== null; diff --git a/src/app/access-control/group-registry/group-form/members-list/members-list.component.ts b/src/app/access-control/group-registry/group-form/members-list/members-list.component.ts index b3e686c012..0e0ef05d77 100644 --- a/src/app/access-control/group-registry/group-form/members-list/members-list.component.ts +++ b/src/app/access-control/group-registry/group-form/members-list/members-list.component.ts @@ -77,21 +77,21 @@ export interface EPersonListActionConfig { export class MembersListComponent implements OnInit, OnDestroy { @Input() - messagePrefix: string; + messagePrefix: string; @Input() - actionConfig: EPersonListActionConfig = { - add: { - css: 'btn-outline-primary', - disabled: false, - icon: 'fas fa-plus fa-fw', - }, - remove: { - css: 'btn-outline-danger', - disabled: false, - icon: 'fas fa-trash-alt fa-fw' - }, - }; + actionConfig: EPersonListActionConfig = { + add: { + css: 'btn-outline-primary', + disabled: false, + icon: 'fas fa-plus fa-fw', + }, + remove: { + css: 'btn-outline-danger', + disabled: false, + icon: 'fas fa-trash-alt fa-fw' + }, + }; /** * EPeople being displayed in search result, initially all members, after search result of search @@ -176,9 +176,9 @@ export class MembersListComponent implements OnInit, OnDestroy { this.paginationService.getCurrentPagination(this.config.id, this.config).pipe( switchMap((currentPagination) => { return this.ePersonDataService.findListByHref(this.groupBeingEdited._links.epersons.href, { - currentPage: currentPagination.currentPage, - elementsPerPage: currentPagination.pageSize - } + currentPage: currentPagination.currentPage, + elementsPerPage: currentPagination.pageSize + } ); }), getAllCompletedRemoteData(), diff --git a/src/app/access-control/group-registry/group-form/subgroup-list/subgroups-list.component.ts b/src/app/access-control/group-registry/group-form/subgroup-list/subgroups-list.component.ts index b154c38b6e..dbd5da162c 100644 --- a/src/app/access-control/group-registry/group-form/subgroup-list/subgroups-list.component.ts +++ b/src/app/access-control/group-registry/group-form/subgroup-list/subgroups-list.component.ts @@ -40,7 +40,7 @@ enum SubKey { export class SubgroupsListComponent implements OnInit, OnDestroy { @Input() - messagePrefix: string; + messagePrefix: string; /** * Result of search groups, initially all groups @@ -125,12 +125,12 @@ export class SubgroupsListComponent implements OnInit, OnDestroy { SubKey.Members, this.paginationService.getCurrentPagination(this.config.id, this.config).pipe( switchMap((config) => this.groupDataService.findListByHref(this.groupBeingEdited._links.subgroups.href, { - currentPage: config.currentPage, - elementsPerPage: config.pageSize - }, - true, - true, - followLink('object') + currentPage: config.currentPage, + elementsPerPage: config.pageSize + }, + true, + true, + followLink('object') )) ).subscribe((rd: RemoteData>) => { this.subGroups$.next(rd); diff --git a/src/app/access-control/group-registry/group-form/validators/group-exists.validator.ts b/src/app/access-control/group-registry/group-form/validators/group-exists.validator.ts index 88f22413e9..421242d2b1 100644 --- a/src/app/access-control/group-registry/group-form/validators/group-exists.validator.ts +++ b/src/app/access-control/group-registry/group-form/validators/group-exists.validator.ts @@ -16,9 +16,9 @@ export class ValidateGroupExists { static createValidator(groupDataService: GroupDataService) { return (control: AbstractControl): Promise | Observable => { return groupDataService.searchGroups(control.value, { - currentPage: 1, - elementsPerPage: 100 - }) + currentPage: 1, + elementsPerPage: 100 + }) .pipe( getFirstSucceededRemoteListPayload(), map( (groups: Group[]) => { diff --git a/src/app/access-control/group-registry/groups-registry.component.ts b/src/app/access-control/group-registry/groups-registry.component.ts index ccfd155e39..28c1f93336 100644 --- a/src/app/access-control/group-registry/groups-registry.component.ts +++ b/src/app/access-control/group-registry/groups-registry.component.ts @@ -159,14 +159,14 @@ export class GroupsRegistryComponent implements OnInit, OnDestroy { ]).pipe( map(([canDelete, canManageGroup, hasLinkedDSO, subgroups, members]: [boolean, boolean, boolean, RemoteData>, RemoteData>]) => { - const groupDtoModel: GroupDtoModel = new GroupDtoModel(); - groupDtoModel.ableToDelete = canDelete && !hasLinkedDSO; - groupDtoModel.ableToEdit = canManageGroup; - groupDtoModel.group = group; - groupDtoModel.subgroups = subgroups.payload; - groupDtoModel.epersons = members.payload; - return groupDtoModel; - } + const groupDtoModel: GroupDtoModel = new GroupDtoModel(); + groupDtoModel.ableToDelete = canDelete && !hasLinkedDSO; + groupDtoModel.ableToEdit = canManageGroup; + groupDtoModel.group = group; + groupDtoModel.subgroups = subgroups.payload; + groupDtoModel.epersons = members.payload; + return groupDtoModel; + } ) ); } else { @@ -185,7 +185,7 @@ export class GroupsRegistryComponent implements OnInit, OnDestroy { }); this.subs.push(this.searchSub); - } + } canManageGroup$(isSiteAdmin: boolean, group: Group): Observable { if (isSiteAdmin) { @@ -210,7 +210,7 @@ export class GroupsRegistryComponent implements OnInit, OnDestroy { this.translateService.get(this.messagePrefix + 'notification.deleted.failure.title', { name: this.dsoNameService.getName(group.group) }), this.translateService.get(this.messagePrefix + 'notification.deleted.failure.content', { cause: rd.errorMessage })); } - }); + }); } } diff --git a/src/app/admin/admin-registries/bitstream-formats/add-bitstream-format/add-bitstream-format.component.ts b/src/app/admin/admin-registries/bitstream-formats/add-bitstream-format/add-bitstream-format.component.ts index 132343dcf0..5d48ea6ef9 100644 --- a/src/app/admin/admin-registries/bitstream-formats/add-bitstream-format/add-bitstream-format.component.ts +++ b/src/app/admin/admin-registries/bitstream-formats/add-bitstream-format/add-bitstream-format.component.ts @@ -35,16 +35,16 @@ export class AddBitstreamFormatComponent { this.bitstreamFormatDataService.createBitstreamFormat(bitstreamFormat).pipe( getFirstCompletedRemoteData(), ).subscribe((response: RemoteData) => { - if (response.hasSucceeded) { - this.notificationService.success(this.translateService.get('admin.registries.bitstream-formats.create.success.head'), - this.translateService.get('admin.registries.bitstream-formats.create.success.content')); - this.router.navigate([getBitstreamFormatsModuleRoute()]); - this.bitstreamFormatDataService.clearBitStreamFormatRequests().subscribe(); - } else { - this.notificationService.error(this.translateService.get('admin.registries.bitstream-formats.create.failure.head'), - this.translateService.get('admin.registries.bitstream-formats.create.failure.content')); - } + if (response.hasSucceeded) { + this.notificationService.success(this.translateService.get('admin.registries.bitstream-formats.create.success.head'), + this.translateService.get('admin.registries.bitstream-formats.create.success.content')); + this.router.navigate([getBitstreamFormatsModuleRoute()]); + this.bitstreamFormatDataService.clearBitStreamFormatRequests().subscribe(); + } else { + this.notificationService.error(this.translateService.get('admin.registries.bitstream-formats.create.failure.head'), + this.translateService.get('admin.registries.bitstream-formats.create.failure.content')); } + } ); } } diff --git a/src/app/admin/admin-registries/bitstream-formats/bitstream-formats.component.spec.ts b/src/app/admin/admin-registries/bitstream-formats/bitstream-formats.component.spec.ts index 8a44240b7e..d598cdc4b2 100644 --- a/src/app/admin/admin-registries/bitstream-formats/bitstream-formats.component.spec.ts +++ b/src/app/admin/admin-registries/bitstream-formats/bitstream-formats.component.spec.ts @@ -212,34 +212,34 @@ describe('BitstreamFormatsComponent', () => { describe('deleteFormats success', () => { beforeEach(waitForAsync(() => { - notificationsServiceStub = new NotificationsServiceStub(); + notificationsServiceStub = new NotificationsServiceStub(); - scheduler = getTestScheduler(); + scheduler = getTestScheduler(); - bitstreamFormatService = jasmine.createSpyObj('bitstreamFormatService', { - findAll: observableOf(mockFormatsRD), - find: createSuccessfulRemoteDataObject$(mockFormatsList[0]), - getSelectedBitstreamFormats: observableOf(mockFormatsList), - selectBitstreamFormat: {}, - deselectBitstreamFormat: {}, - deselectAllBitstreamFormats: {}, - delete: createNoContentRemoteDataObject$(), - clearBitStreamFormatRequests: observableOf('cleared') - }); + bitstreamFormatService = jasmine.createSpyObj('bitstreamFormatService', { + findAll: observableOf(mockFormatsRD), + find: createSuccessfulRemoteDataObject$(mockFormatsList[0]), + getSelectedBitstreamFormats: observableOf(mockFormatsList), + selectBitstreamFormat: {}, + deselectBitstreamFormat: {}, + deselectAllBitstreamFormats: {}, + delete: createNoContentRemoteDataObject$(), + clearBitStreamFormatRequests: observableOf('cleared') + }); paginationService = new PaginationServiceStub(); TestBed.configureTestingModule({ - imports: [CommonModule, RouterTestingModule.withRoutes([]), TranslateModule.forRoot(), NgbModule], - declarations: [BitstreamFormatsComponent, PaginationComponent, EnumKeysPipe], - providers: [ - { provide: BitstreamFormatDataService, useValue: bitstreamFormatService }, - { provide: HostWindowService, useValue: new HostWindowServiceStub(0) }, - { provide: NotificationsService, useValue: notificationsServiceStub }, - { provide: PaginationService, useValue: paginationService } - ] - }).compileComponents(); - } + imports: [CommonModule, RouterTestingModule.withRoutes([]), TranslateModule.forRoot(), NgbModule], + declarations: [BitstreamFormatsComponent, PaginationComponent, EnumKeysPipe], + providers: [ + { provide: BitstreamFormatDataService, useValue: bitstreamFormatService }, + { provide: HostWindowService, useValue: new HostWindowServiceStub(0) }, + { provide: NotificationsService, useValue: notificationsServiceStub }, + { provide: PaginationService, useValue: paginationService } + ] + }).compileComponents(); + } )); beforeEach(initBeforeEach); @@ -261,34 +261,34 @@ describe('BitstreamFormatsComponent', () => { describe('deleteFormats error', () => { beforeEach(waitForAsync(() => { - notificationsServiceStub = new NotificationsServiceStub(); + notificationsServiceStub = new NotificationsServiceStub(); - scheduler = getTestScheduler(); + scheduler = getTestScheduler(); - bitstreamFormatService = jasmine.createSpyObj('bitstreamFormatService', { - findAll: observableOf(mockFormatsRD), - find: createSuccessfulRemoteDataObject$(mockFormatsList[0]), - getSelectedBitstreamFormats: observableOf(mockFormatsList), - selectBitstreamFormat: {}, - deselectBitstreamFormat: {}, - deselectAllBitstreamFormats: {}, - delete: createFailedRemoteDataObject$(), - clearBitStreamFormatRequests: observableOf('cleared') - }); + bitstreamFormatService = jasmine.createSpyObj('bitstreamFormatService', { + findAll: observableOf(mockFormatsRD), + find: createSuccessfulRemoteDataObject$(mockFormatsList[0]), + getSelectedBitstreamFormats: observableOf(mockFormatsList), + selectBitstreamFormat: {}, + deselectBitstreamFormat: {}, + deselectAllBitstreamFormats: {}, + delete: createFailedRemoteDataObject$(), + clearBitStreamFormatRequests: observableOf('cleared') + }); paginationService = new PaginationServiceStub(); TestBed.configureTestingModule({ - imports: [CommonModule, RouterTestingModule.withRoutes([]), TranslateModule.forRoot(), NgbModule], - declarations: [BitstreamFormatsComponent, PaginationComponent, EnumKeysPipe], - providers: [ - { provide: BitstreamFormatDataService, useValue: bitstreamFormatService }, - { provide: HostWindowService, useValue: new HostWindowServiceStub(0) }, - { provide: NotificationsService, useValue: notificationsServiceStub }, - { provide: PaginationService, useValue: paginationService } - ] - }).compileComponents(); - } + imports: [CommonModule, RouterTestingModule.withRoutes([]), TranslateModule.forRoot(), NgbModule], + declarations: [BitstreamFormatsComponent, PaginationComponent, EnumKeysPipe], + providers: [ + { provide: BitstreamFormatDataService, useValue: bitstreamFormatService }, + { provide: HostWindowService, useValue: new HostWindowServiceStub(0) }, + { provide: NotificationsService, useValue: notificationsServiceStub }, + { provide: PaginationService, useValue: paginationService } + ] + }).compileComponents(); + } )); beforeEach(initBeforeEach); diff --git a/src/app/admin/admin-registries/bitstream-formats/edit-bitstream-format/edit-bitstream-format.component.ts b/src/app/admin/admin-registries/bitstream-formats/edit-bitstream-format/edit-bitstream-format.component.ts index 14b109fe26..88dbcded7b 100644 --- a/src/app/admin/admin-registries/bitstream-formats/edit-bitstream-format/edit-bitstream-format.component.ts +++ b/src/app/admin/admin-registries/bitstream-formats/edit-bitstream-format/edit-bitstream-format.component.ts @@ -49,15 +49,15 @@ export class EditBitstreamFormatComponent implements OnInit { this.bitstreamFormatDataService.updateBitstreamFormat(bitstreamFormat).pipe( getFirstCompletedRemoteData(), ).subscribe((response: RemoteData) => { - if (response.hasSucceeded) { - this.notificationService.success(this.translateService.get('admin.registries.bitstream-formats.edit.success.head'), - this.translateService.get('admin.registries.bitstream-formats.edit.success.content')); - this.router.navigate([getBitstreamFormatsModuleRoute()]); - } else { - this.notificationService.error('admin.registries.bitstream-formats.edit.failure.head', - 'admin.registries.bitstream-formats.create.edit.content'); - } + if (response.hasSucceeded) { + this.notificationService.success(this.translateService.get('admin.registries.bitstream-formats.edit.success.head'), + this.translateService.get('admin.registries.bitstream-formats.edit.success.content')); + this.router.navigate([getBitstreamFormatsModuleRoute()]); + } else { + this.notificationService.error('admin.registries.bitstream-formats.edit.failure.head', + 'admin.registries.bitstream-formats.create.edit.content'); } + } ); } } diff --git a/src/app/admin/admin-registries/metadata-registry/metadata-schema-form/metadata-schema-form.component.ts b/src/app/admin/admin-registries/metadata-registry/metadata-schema-form/metadata-schema-form.component.ts index 1992289ff7..f318f6b2af 100644 --- a/src/app/admin/admin-registries/metadata-registry/metadata-schema-form/metadata-schema-form.component.ts +++ b/src/app/admin/admin-registries/metadata-registry/metadata-schema-form/metadata-schema-form.component.ts @@ -82,33 +82,33 @@ export class MetadataSchemaFormComponent implements OnInit, OnDestroy { this.translateService.get(`${this.messagePrefix}.namespace`) ]).subscribe(([name, namespace]) => { this.name = new DynamicInputModel({ - id: 'name', - label: name, - name: 'name', - validators: { - required: null, - pattern: '^[^. ,]*$', - maxLength: 32, - }, - required: true, - errorMessages: { - pattern: 'error.validation.metadata.name.invalid-pattern', - maxLength: 'error.validation.metadata.name.max-length', - }, - }); + id: 'name', + label: name, + name: 'name', + validators: { + required: null, + pattern: '^[^. ,]*$', + maxLength: 32, + }, + required: true, + errorMessages: { + pattern: 'error.validation.metadata.name.invalid-pattern', + maxLength: 'error.validation.metadata.name.max-length', + }, + }); this.namespace = new DynamicInputModel({ - id: 'namespace', - label: namespace, - name: 'namespace', - validators: { - required: null, - maxLength: 256, - }, - required: true, - errorMessages: { - maxLength: 'error.validation.metadata.namespace.max-length', - }, - }); + id: 'namespace', + label: namespace, + name: 'namespace', + validators: { + required: null, + maxLength: 256, + }, + required: true, + errorMessages: { + maxLength: 'error.validation.metadata.namespace.max-length', + }, + }); this.formModel = [ new DynamicFormGroupModel( { diff --git a/src/app/admin/admin-registries/metadata-schema/metadata-field-form/metadata-field-form.component.ts b/src/app/admin/admin-registries/metadata-schema/metadata-field-form/metadata-field-form.component.ts index 773e0600fb..db5a871e93 100644 --- a/src/app/admin/admin-registries/metadata-schema/metadata-field-form/metadata-field-form.component.ts +++ b/src/app/admin/admin-registries/metadata-schema/metadata-field-form/metadata-field-form.component.ts @@ -140,10 +140,10 @@ export class MetadataFieldFormComponent implements OnInit, OnDestroy { }); this.formModel = [ new DynamicFormGroupModel( - { - id: 'metadatadatafieldgroup', - group:[this.element, this.qualifier, this.scopeNote] - }) + { + id: 'metadatadatafieldgroup', + group:[this.element, this.qualifier, this.scopeNote] + }) ]; this.formGroup = this.formBuilderService.createFormGroup(this.formModel); this.registryService.getActiveMetadataField().subscribe((field: MetadataField): void => { diff --git a/src/app/admin/admin-workflow-page/admin-workflow-search-results/actions/workspace-item/supervision-order-status/supervision-order-status.component.spec.ts b/src/app/admin/admin-workflow-page/admin-workflow-search-results/actions/workspace-item/supervision-order-status/supervision-order-status.component.spec.ts index 2f4ed631cc..0671fc808b 100644 --- a/src/app/admin/admin-workflow-page/admin-workflow-search-results/actions/workspace-item/supervision-order-status/supervision-order-status.component.spec.ts +++ b/src/app/admin/admin-workflow-page/admin-workflow-search-results/actions/workspace-item/supervision-order-status/supervision-order-status.component.spec.ts @@ -30,7 +30,7 @@ describe('SupervisionOrderStatusComponent', () => { NO_ERRORS_SCHEMA ] }) - .compileComponents(); + .compileComponents(); }); beforeEach(() => { diff --git a/src/app/admin/admin-workflow-page/admin-workflow-search-results/actions/workspace-item/workspace-item-admin-workflow-actions.component.spec.ts b/src/app/admin/admin-workflow-page/admin-workflow-search-results/actions/workspace-item/workspace-item-admin-workflow-actions.component.spec.ts index a8f0581ec0..0c5ac008e4 100644 --- a/src/app/admin/admin-workflow-page/admin-workflow-search-results/actions/workspace-item/workspace-item-admin-workflow-actions.component.spec.ts +++ b/src/app/admin/admin-workflow-page/admin-workflow-search-results/actions/workspace-item/workspace-item-admin-workflow-actions.component.spec.ts @@ -11,7 +11,7 @@ import { URLCombiner } from '../../../../../core/url-combiner/url-combiner'; import { WorkspaceItemAdminWorkflowActionsComponent } from './workspace-item-admin-workflow-actions.component'; import { WorkspaceItem } from '../../../../../core/submission/models/workspaceitem.model'; import { - getWorkspaceItemDeleteRoute, + getWorkspaceItemDeleteRoute, } from '../../../../../workflowitems-edit-page/workflowitems-edit-page-routing-paths'; import { Item } from '../../../../../core/shared/item.model'; import { RemoteData } from '../../../../../core/data/remote-data'; diff --git a/src/app/admin/admin-workflow-page/admin-workflow-search-results/actions/workspace-item/workspace-item-admin-workflow-actions.component.ts b/src/app/admin/admin-workflow-page/admin-workflow-search-results/actions/workspace-item/workspace-item-admin-workflow-actions.component.ts index 36678460da..7bf9c6d816 100644 --- a/src/app/admin/admin-workflow-page/admin-workflow-search-results/actions/workspace-item/workspace-item-admin-workflow-actions.component.ts +++ b/src/app/admin/admin-workflow-page/admin-workflow-search-results/actions/workspace-item/workspace-item-admin-workflow-actions.component.ts @@ -11,7 +11,7 @@ import { SupervisionOrderGroupSelectorComponent } from './supervision-order-group-selector/supervision-order-group-selector.component'; import { - getWorkspaceItemDeleteRoute + getWorkspaceItemDeleteRoute } from '../../../../../workflowitems-edit-page/workflowitems-edit-page-routing-paths'; import { ITEM_EDIT_AUTHORIZATIONS_PATH } from '../../../../../item-page/edit-item-page/edit-item-page.routing-paths'; import { WorkspaceItem } from '../../../../../core/submission/models/workspaceitem.model'; diff --git a/src/app/admin/admin-workflow-page/admin-workflow-search-results/admin-workflow-search-result-grid-element/workflow-item/workflow-item-search-result-admin-workflow-grid-element.component.ts b/src/app/admin/admin-workflow-page/admin-workflow-search-results/admin-workflow-search-result-grid-element/workflow-item/workflow-item-search-result-admin-workflow-grid-element.component.ts index fd9d21e227..8e7b381eb6 100644 --- a/src/app/admin/admin-workflow-page/admin-workflow-search-results/admin-workflow-search-result-grid-element/workflow-item/workflow-item-search-result-admin-workflow-grid-element.component.ts +++ b/src/app/admin/admin-workflow-page/admin-workflow-search-results/admin-workflow-search-result-grid-element/workflow-item/workflow-item-search-result-admin-workflow-grid-element.component.ts @@ -75,25 +75,25 @@ export class WorkflowItemSearchResultAdminWorkflowGridElementComponent extends S this.dso = this.linkService.resolveLink(this.dso, followLink('item')); this.item$ = (this.dso.item as Observable>).pipe(getAllSucceededRemoteData(), getRemoteDataPayload()); this.item$.pipe(take(1)).subscribe((item: Item) => { - const componentFactory = this.componentFactoryResolver.resolveComponentFactory(this.getComponent(item)); + const componentFactory = this.componentFactoryResolver.resolveComponentFactory(this.getComponent(item)); - const viewContainerRef = this.listableObjectDirective.viewContainerRef; - viewContainerRef.clear(); + const viewContainerRef = this.listableObjectDirective.viewContainerRef; + viewContainerRef.clear(); - const componentRef = viewContainerRef.createComponent( - componentFactory, - 0, - undefined, - [ - [this.badges.nativeElement], - [this.buttons.nativeElement] - ]); - (componentRef.instance as any).object = item; - (componentRef.instance as any).index = this.index; - (componentRef.instance as any).linkType = this.linkType; - (componentRef.instance as any).listID = this.listID; - componentRef.changeDetectorRef.detectChanges(); - } + const componentRef = viewContainerRef.createComponent( + componentFactory, + 0, + undefined, + [ + [this.badges.nativeElement], + [this.buttons.nativeElement] + ]); + (componentRef.instance as any).object = item; + (componentRef.instance as any).index = this.index; + (componentRef.instance as any).linkType = this.linkType; + (componentRef.instance as any).listID = this.listID; + componentRef.changeDetectorRef.detectChanges(); + } ); } diff --git a/src/app/admin/admin-workflow-page/admin-workflow-search-results/admin-workflow-search-result-grid-element/workspace-item/workspace-item-search-result-admin-workflow-grid-element.component.ts b/src/app/admin/admin-workflow-page/admin-workflow-search-results/admin-workflow-search-result-grid-element/workspace-item/workspace-item-search-result-admin-workflow-grid-element.component.ts index d6f39e79fe..d37b45bf9d 100644 --- a/src/app/admin/admin-workflow-page/admin-workflow-search-results/admin-workflow-search-result-grid-element/workspace-item/workspace-item-search-result-admin-workflow-grid-element.component.ts +++ b/src/app/admin/admin-workflow-page/admin-workflow-search-results/admin-workflow-search-result-grid-element/workspace-item/workspace-item-search-result-admin-workflow-grid-element.component.ts @@ -100,25 +100,25 @@ export class WorkspaceItemSearchResultAdminWorkflowGridElementComponent extends this.dso = this.linkService.resolveLink(this.dso, followLink('item')); this.item$ = (this.dso.item as Observable>).pipe(getAllSucceededRemoteData(), getRemoteDataPayload()); this.item$.pipe(take(1)).subscribe((item: Item) => { - const componentFactory = this.componentFactoryResolver.resolveComponentFactory(this.getComponent(item)); + const componentFactory = this.componentFactoryResolver.resolveComponentFactory(this.getComponent(item)); - const viewContainerRef = this.listableObjectDirective.viewContainerRef; - viewContainerRef.clear(); + const viewContainerRef = this.listableObjectDirective.viewContainerRef; + viewContainerRef.clear(); - const componentRef = viewContainerRef.createComponent( - componentFactory, - 0, - undefined, - [ - [this.badges.nativeElement], - [this.buttons.nativeElement] - ]); - (componentRef.instance as any).object = item; - (componentRef.instance as any).index = this.index; - (componentRef.instance as any).linkType = this.linkType; - (componentRef.instance as any).listID = this.listID; - componentRef.changeDetectorRef.detectChanges(); - } + const componentRef = viewContainerRef.createComponent( + componentFactory, + 0, + undefined, + [ + [this.badges.nativeElement], + [this.buttons.nativeElement] + ]); + (componentRef.instance as any).object = item; + (componentRef.instance as any).index = this.index; + (componentRef.instance as any).linkType = this.linkType; + (componentRef.instance as any).listID = this.listID; + componentRef.changeDetectorRef.detectChanges(); + } ); this.item$.pipe( diff --git a/src/app/app-routing.module.ts b/src/app/app-routing.module.ts index deb68f1ea9..5a14779abb 100644 --- a/src/app/app-routing.module.ts +++ b/src/app/app-routing.module.ts @@ -248,7 +248,7 @@ import { ThemedPageErrorComponent } from './page-error/themed-page-error.compone initialNavigation: 'enabledBlocking', preloadingStrategy: NoPreloading, onSameUrlNavigation: 'reload', -}) + }) ], exports: [RouterModule], }) diff --git a/src/app/bitstream-page/bitstream-page.resolver.ts b/src/app/bitstream-page/bitstream-page.resolver.ts index db2af2d554..bbaf368c52 100644 --- a/src/app/bitstream-page/bitstream-page.resolver.ts +++ b/src/app/bitstream-page/bitstream-page.resolver.ts @@ -11,7 +11,7 @@ import { getFirstCompletedRemoteData } from '../core/shared/operators'; * The self links defined in this list are expected to be requested somewhere in the near future * Requesting them as embeds will limit the number of requests */ - export const BITSTREAM_PAGE_LINKS_TO_FOLLOW: FollowLinkConfig[] = [ +export const BITSTREAM_PAGE_LINKS_TO_FOLLOW: FollowLinkConfig[] = [ followLink('bundle', {}, followLink('primaryBitstream'), followLink('item')), followLink('format') ]; @@ -37,12 +37,12 @@ export class BitstreamPageResolver implements Resolve> { getFirstCompletedRemoteData(), ); } - /** + /** * Method that returns the follow links to already resolve * The self links defined in this list are expected to be requested somewhere in the near future * Requesting them as embeds will limit the number of requests */ - get followLinks(): FollowLinkConfig[] { - return BITSTREAM_PAGE_LINKS_TO_FOLLOW; - } + get followLinks(): FollowLinkConfig[] { + return BITSTREAM_PAGE_LINKS_TO_FOLLOW; + } } diff --git a/src/app/bitstream-page/edit-bitstream-page/edit-bitstream-page.component.spec.ts b/src/app/bitstream-page/edit-bitstream-page/edit-bitstream-page.component.spec.ts index b83f2b9664..ad8f13b0d2 100644 --- a/src/app/bitstream-page/edit-bitstream-page/edit-bitstream-page.component.spec.ts +++ b/src/app/bitstream-page/edit-bitstream-page/edit-bitstream-page.component.spec.ts @@ -129,11 +129,11 @@ describe('EditBitstreamPageComponent', () => { const result = createSuccessfulRemoteDataObject$(bundle); primaryBitstreamService = jasmine.createSpyObj('PrimaryBitstreamService', - { - put: result, - create: result, - delete: result, - }); + { + put: result, + create: result, + delete: result, + }); }); @@ -535,120 +535,120 @@ describe('EditBitstreamPageComponent', () => { }); }); - describe('ignore OTHERCONTENT bundle', () => { + describe('ignore OTHERCONTENT bundle', () => { - const bundleName = 'OTHERCONTENT'; + const bundleName = 'OTHERCONTENT'; - beforeEach(waitForAsync(() => { + beforeEach(waitForAsync(() => { - bitstream = Object.assign(new Bitstream(), { - metadata: { - 'dc.description': [ - { - value: 'Bitstream description' - } - ], - 'dc.title': [ - { - value: 'Bitstream title' - } - ], - 'iiif.label': [ - { - value: 'chapter one' - } - ], - 'iiif.toc': [ - { - value: 'chapter one' - } - ], - 'iiif.image.width': [ - { - value: '2400' - } - ], - 'iiif.image.height': [ - { - value: '2800' - } - ], - }, - format: createSuccessfulRemoteDataObject$(allFormats[2]), - _links: { - self: 'bitstream-selflink' - }, - bundle: createSuccessfulRemoteDataObject$({ - _links: { - primaryBitstream: { - href: 'bundle-selflink' - } - }, - item: createSuccessfulRemoteDataObject$(Object.assign(new Item(), { - uuid: 'some-uuid', - firstMetadataValue(keyOrKeys: string | string[], valueFilter?: MetadataValueFilter): string { - return 'True'; - } - })) - }), - }); - bitstreamService = jasmine.createSpyObj('bitstreamService', { - findById: createSuccessfulRemoteDataObject$(bitstream), - findByHref: createSuccessfulRemoteDataObject$(bitstream), - update: createSuccessfulRemoteDataObject$(bitstream), - updateFormat: createSuccessfulRemoteDataObject$(bitstream), - commitUpdates: {}, - patch: {} - }); - - dsoNameService = jasmine.createSpyObj('dsoNameService', { - getName: bundleName - }); - - TestBed.configureTestingModule({ - imports: [TranslateModule.forRoot(), RouterTestingModule], - declarations: [EditBitstreamPageComponent, FileSizePipe, VarDirective], - providers: [ - {provide: NotificationsService, useValue: notificationsService}, - {provide: DynamicFormService, useValue: formService}, - {provide: ActivatedRoute, - useValue: { - data: observableOf({bitstream: createSuccessfulRemoteDataObject(bitstream)}), - snapshot: {queryParams: {}} - } - }, - {provide: BitstreamDataService, useValue: bitstreamService}, - {provide: DSONameService, useValue: dsoNameService}, - {provide: BitstreamFormatDataService, useValue: bitstreamFormatService}, - { provide: PrimaryBitstreamService, useValue: primaryBitstreamService }, - ChangeDetectorRef + bitstream = Object.assign(new Bitstream(), { + metadata: { + 'dc.description': [ + { + value: 'Bitstream description' + } ], - schemas: [NO_ERRORS_SCHEMA] - }).compileComponents(); - })); + 'dc.title': [ + { + value: 'Bitstream title' + } + ], + 'iiif.label': [ + { + value: 'chapter one' + } + ], + 'iiif.toc': [ + { + value: 'chapter one' + } + ], + 'iiif.image.width': [ + { + value: '2400' + } + ], + 'iiif.image.height': [ + { + value: '2800' + } + ], + }, + format: createSuccessfulRemoteDataObject$(allFormats[2]), + _links: { + self: 'bitstream-selflink' + }, + bundle: createSuccessfulRemoteDataObject$({ + _links: { + primaryBitstream: { + href: 'bundle-selflink' + } + }, + item: createSuccessfulRemoteDataObject$(Object.assign(new Item(), { + uuid: 'some-uuid', + firstMetadataValue(keyOrKeys: string | string[], valueFilter?: MetadataValueFilter): string { + return 'True'; + } + })) + }), + }); + bitstreamService = jasmine.createSpyObj('bitstreamService', { + findById: createSuccessfulRemoteDataObject$(bitstream), + findByHref: createSuccessfulRemoteDataObject$(bitstream), + update: createSuccessfulRemoteDataObject$(bitstream), + updateFormat: createSuccessfulRemoteDataObject$(bitstream), + commitUpdates: {}, + patch: {} + }); + + dsoNameService = jasmine.createSpyObj('dsoNameService', { + getName: bundleName + }); + + TestBed.configureTestingModule({ + imports: [TranslateModule.forRoot(), RouterTestingModule], + declarations: [EditBitstreamPageComponent, FileSizePipe, VarDirective], + providers: [ + {provide: NotificationsService, useValue: notificationsService}, + {provide: DynamicFormService, useValue: formService}, + {provide: ActivatedRoute, + useValue: { + data: observableOf({bitstream: createSuccessfulRemoteDataObject(bitstream)}), + snapshot: {queryParams: {}} + } + }, + {provide: BitstreamDataService, useValue: bitstreamService}, + {provide: DSONameService, useValue: dsoNameService}, + {provide: BitstreamFormatDataService, useValue: bitstreamFormatService}, + { provide: PrimaryBitstreamService, useValue: primaryBitstreamService }, + ChangeDetectorRef + ], + schemas: [NO_ERRORS_SCHEMA] + }).compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(EditBitstreamPageComponent); + comp = fixture.componentInstance; + fixture.detectChanges(); + router = TestBed.inject(Router); + spyOn(router, 'navigate'); + }); + + describe('EditBitstreamPageComponent with IIIF fields', () => { + let rawForm; beforeEach(() => { - fixture = TestBed.createComponent(EditBitstreamPageComponent); - comp = fixture.componentInstance; - fixture.detectChanges(); - router = TestBed.inject(Router); - spyOn(router, 'navigate'); + rawForm = comp.formGroup.getRawValue(); }); - describe('EditBitstreamPageComponent with IIIF fields', () => { - let rawForm; - - beforeEach(() => { - rawForm = comp.formGroup.getRawValue(); - }); - - it('should NOT set is IIIF to true', () => { - expect(comp.isIIIF).toBeFalse(); - }); - it('should put the \"IIIF Label\" input not to be shown', () => { - expect(rawForm.iiifLabelContainer).toBeFalsy(); - }); + it('should NOT set is IIIF to true', () => { + expect(comp.isIIIF).toBeFalse(); }); + it('should put the \"IIIF Label\" input not to be shown', () => { + expect(rawForm.iiifLabelContainer).toBeFalsy(); + }); + }); }); }); diff --git a/src/app/bitstream-page/edit-bitstream-page/edit-bitstream-page.component.ts b/src/app/bitstream-page/edit-bitstream-page/edit-bitstream-page.component.ts index b77d2151a9..7157113337 100644 --- a/src/app/bitstream-page/edit-bitstream-page/edit-bitstream-page.component.ts +++ b/src/app/bitstream-page/edit-bitstream-page/edit-bitstream-page.component.ts @@ -135,9 +135,9 @@ export class EditBitstreamPageComponent implements OnInit, OnDestroy { * The Dynamic Switch Model for the file's name */ primaryBitstreamModel = new DynamicCustomSwitchModel({ - id: 'primaryBitstream', - name: 'primaryBitstream' - } + id: 'primaryBitstream', + name: 'primaryBitstream' + } ); /** @@ -170,15 +170,15 @@ export class EditBitstreamPageComponent implements OnInit, OnDestroy { * The Dynamic Input Model for the iiif label */ iiifLabelModel = new DsDynamicInputModel({ - hasSelectableMetadata: false, metadataFields: [], repeatable: false, submissionId: '', - id: 'iiifLabel', - name: 'iiifLabel' - }, - { - grid: { - host: 'col col-lg-6 d-inline-block' - } - }); + hasSelectableMetadata: false, metadataFields: [], repeatable: false, submissionId: '', + id: 'iiifLabel', + name: 'iiifLabel' + }, + { + grid: { + host: 'col col-lg-6 d-inline-block' + } + }); iiifLabelContainer = new DynamicFormGroupModel({ id: 'iiifLabelContainer', group: [this.iiifLabelModel] @@ -382,7 +382,7 @@ export class EditBitstreamPageComponent implements OnInit, OnDestroy { private notificationsService: NotificationsService, private bitstreamFormatService: BitstreamFormatDataService, private primaryBitstreamService: PrimaryBitstreamService, - ) { + ) { } /** diff --git a/src/app/bitstream-page/legacy-bitstream-url.resolver.ts b/src/app/bitstream-page/legacy-bitstream-url.resolver.ts index 948bec2473..33acc7f669 100644 --- a/src/app/bitstream-page/legacy-bitstream-url.resolver.ts +++ b/src/app/bitstream-page/legacy-bitstream-url.resolver.ts @@ -28,21 +28,21 @@ export class LegacyBitstreamUrlResolver implements Resolve */ resolve(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Observable> { - const prefix = route.params.prefix; - const suffix = route.params.suffix; - const filename = route.params.filename; + const prefix = route.params.prefix; + const suffix = route.params.suffix; + const filename = route.params.filename; - let sequenceId = route.params.sequence_id; - if (hasNoValue(sequenceId)) { - sequenceId = route.queryParams.sequenceId; - } + let sequenceId = route.params.sequence_id; + if (hasNoValue(sequenceId)) { + sequenceId = route.queryParams.sequenceId; + } - return this.bitstreamDataService.findByItemHandle( - `${prefix}/${suffix}`, - sequenceId, - filename, - ).pipe( - getFirstCompletedRemoteData() - ); + return this.bitstreamDataService.findByItemHandle( + `${prefix}/${suffix}`, + sequenceId, + filename, + ).pipe( + getFirstCompletedRemoteData() + ); } } diff --git a/src/app/browse-by/browse-by-date-page/browse-by-date-page.component.spec.ts b/src/app/browse-by/browse-by-date-page/browse-by-date-page.component.spec.ts index e41d3a45b2..8745971e93 100644 --- a/src/app/browse-by/browse-by-date-page/browse-by-date-page.component.spec.ts +++ b/src/app/browse-by/browse-by-date-page/browse-by-date-page.component.spec.ts @@ -61,11 +61,11 @@ describe('BrowseByDatePageComponent', () => { } }); - const mockBrowseService = { - getBrowseEntriesFor: (options: BrowseEntrySearchOptions) => toRemoteData([]), - getBrowseItemsFor: (value: string, options: BrowseEntrySearchOptions) => toRemoteData([firstItem]), - getFirstItemFor: (definition: string, scope?: string, sortDirection?: SortDirection) => null - }; + const mockBrowseService = { + getBrowseEntriesFor: (options: BrowseEntrySearchOptions) => toRemoteData([]), + getBrowseItemsFor: (value: string, options: BrowseEntrySearchOptions) => toRemoteData([firstItem]), + getFirstItemFor: (definition: string, scope?: string, sortDirection?: SortDirection) => null + }; const mockDsoService = { findById: () => createSuccessfulRemoteDataObject$(mockCommunity) diff --git a/src/app/browse-by/browse-by-metadata-page/browse-by-metadata-page.component.ts b/src/app/browse-by/browse-by-metadata-page/browse-by-metadata-page.component.ts index 113bc67c92..b8765efae9 100644 --- a/src/app/browse-by/browse-by-metadata-page/browse-by-metadata-page.component.ts +++ b/src/app/browse-by/browse-by-metadata-page/browse-by-metadata-page.component.ts @@ -110,7 +110,7 @@ export class BrowseByMetadataPageComponent implements OnInit, OnDestroy { /** * The authority key (may be undefined) associated with {@link #value}. */ - authority: string; + authority: string; /** * The current startsWith option (fetched and updated from query-params) @@ -133,11 +133,11 @@ export class BrowseByMetadataPageComponent implements OnInit, OnDestroy { this.fetchThumbnails = this.appConfig.browseBy.showThumbnails; this.paginationConfig = Object.assign(new PaginationComponentOptions(), { - id: BBM_PAGINATION_ID, - currentPage: 1, - pageSize: this.appConfig.browseBy.pageSize, - }); - } + id: BBM_PAGINATION_ID, + currentPage: 1, + pageSize: this.appConfig.browseBy.pageSize, + }); + } ngOnInit(): void { @@ -152,28 +152,28 @@ export class BrowseByMetadataPageComponent implements OnInit, OnDestroy { return [Object.assign({}, routeParams, queryParams),currentPage,currentSort]; }) ).subscribe(([params, currentPage, currentSort]: [Params, PaginationComponentOptions, SortOptions]) => { - this.browseId = params.id || this.defaultBrowseId; - this.authority = params.authority; + this.browseId = params.id || this.defaultBrowseId; + this.authority = params.authority; - if (typeof params.value === 'string'){ - this.value = params.value.trim(); - } else { - this.value = ''; - } + if (typeof params.value === 'string'){ + this.value = params.value.trim(); + } else { + this.value = ''; + } - if (typeof params.startsWith === 'string'){ - this.startsWith = params.startsWith.trim(); - } + if (typeof params.startsWith === 'string'){ + this.startsWith = params.startsWith.trim(); + } - if (isNotEmpty(this.value)) { - this.updatePageWithItems( - browseParamsToOptions(params, currentPage, currentSort, this.browseId, this.fetchThumbnails), this.value, this.authority); - } else { - this.updatePage(browseParamsToOptions(params, currentPage, currentSort, this.browseId, false)); - } - this.updateParent(params.scope); - this.updateLogo(); - })); + if (isNotEmpty(this.value)) { + this.updatePageWithItems( + browseParamsToOptions(params, currentPage, currentSort, this.browseId, this.fetchThumbnails), this.value, this.authority); + } else { + this.updatePage(browseParamsToOptions(params, currentPage, currentSort, this.browseId, false)); + } + this.updateParent(params.scope); + this.updateLogo(); + })); this.updateStartsWithTextOptions(); } @@ -290,9 +290,9 @@ export class BrowseByMetadataPageComponent implements OnInit, OnDestroy { * @returns BrowseEntrySearchOptions instance */ export function getBrowseSearchOptions(defaultBrowseId: string, - paginationConfig: PaginationComponentOptions, - sortConfig: SortOptions, - fetchThumbnails?: boolean) { + paginationConfig: PaginationComponentOptions, + sortConfig: SortOptions, + fetchThumbnails?: boolean) { if (!hasValue(fetchThumbnails)) { fetchThumbnails = false; } @@ -309,10 +309,10 @@ export function getBrowseSearchOptions(defaultBrowseId: string, * @param fetchThumbnail Optional parameter for requesting thumbnail images */ export function browseParamsToOptions(params: any, - paginationConfig: PaginationComponentOptions, - sortConfig: SortOptions, - metadata?: string, - fetchThumbnail?: boolean): BrowseEntrySearchOptions { + paginationConfig: PaginationComponentOptions, + sortConfig: SortOptions, + metadata?: string, + fetchThumbnail?: boolean): BrowseEntrySearchOptions { return new BrowseEntrySearchOptions( metadata, paginationConfig, diff --git a/src/app/browse-by/browse-by-taxonomy-page/browse-by-taxonomy-page.component.spec.ts b/src/app/browse-by/browse-by-taxonomy-page/browse-by-taxonomy-page.component.spec.ts index c724017b1f..ffd1fb4318 100644 --- a/src/app/browse-by/browse-by-taxonomy-page/browse-by-taxonomy-page.component.spec.ts +++ b/src/app/browse-by/browse-by-taxonomy-page/browse-by-taxonomy-page.component.spec.ts @@ -36,7 +36,7 @@ describe('BrowseByTaxonomyPageComponent', () => { ], schemas: [NO_ERRORS_SCHEMA] }) - .compileComponents(); + .compileComponents(); }); beforeEach(() => { diff --git a/src/app/browse-by/browse-by-taxonomy-page/browse-by-taxonomy-page.component.ts b/src/app/browse-by/browse-by-taxonomy-page/browse-by-taxonomy-page.component.ts index cf6345bf39..c14495d4e7 100644 --- a/src/app/browse-by/browse-by-taxonomy-page/browse-by-taxonomy-page.component.ts +++ b/src/app/browse-by/browse-by-taxonomy-page/browse-by-taxonomy-page.component.ts @@ -86,9 +86,9 @@ export class BrowseByTaxonomyPageComponent implements OnInit, OnDestroy { * @param detail VocabularyEntryDetail to be added */ onSelect(detail: VocabularyEntryDetail): void { - this.selectedItems.push(detail); - this.filterValues = this.selectedItems - .map((item: VocabularyEntryDetail) => `${item.value},equals`); + this.selectedItems.push(detail); + this.filterValues = this.selectedItems + .map((item: VocabularyEntryDetail) => `${item.value},equals`); this.updateQueryParams(); } diff --git a/src/app/collection-page/collection-form/collection-form.component.ts b/src/app/collection-page/collection-form/collection-form.component.ts index ebb03df3b9..6c6909d1e0 100644 --- a/src/app/collection-page/collection-form/collection-form.component.ts +++ b/src/app/collection-page/collection-form/collection-form.component.ts @@ -98,9 +98,9 @@ export class CollectionFormComponent extends ComColFormComponent imp // retrieve all entity types to populate the dropdowns selection entities$.subscribe((entityTypes: ItemType[]) => { - entityTypes - .filter((type: ItemType) => type.label !== NONE_ENTITY_TYPE) - .forEach((type: ItemType, index: number) => { + entityTypes + .filter((type: ItemType) => type.label !== NONE_ENTITY_TYPE) + .forEach((type: ItemType, index: number) => { this.entityTypeSelection.add({ disabled: false, label: type.label, @@ -112,10 +112,10 @@ export class CollectionFormComponent extends ComColFormComponent imp } }); - this.formModel = [...collectionFormModels, this.entityTypeSelection]; + this.formModel = [...collectionFormModels, this.entityTypeSelection]; - super.ngOnInit(); - this.chd.detectChanges(); + super.ngOnInit(); + this.chd.detectChanges(); }); } diff --git a/src/app/collection-page/collection-item-mapper/collection-item-mapper.component.ts b/src/app/collection-page/collection-item-mapper/collection-item-mapper.component.ts index e0e4aaf930..30013e4f63 100644 --- a/src/app/collection-page/collection-item-mapper/collection-item-mapper.component.ts +++ b/src/app/collection-page/collection-item-mapper/collection-item-mapper.component.ts @@ -176,16 +176,16 @@ export class CollectionItemMapperComponent implements OnInit { map((collectionRD: RemoteData) => collectionRD.payload), switchMap((collection: Collection) => observableCombineLatest(ids.map((id: string) => { - if (remove) { - return this.itemDataService.removeMappingFromCollection(id, collection.id).pipe( - getFirstCompletedRemoteData() - ); - } else { - return this.itemDataService.mapToCollection(id, collection._links.self.href).pipe( - getFirstCompletedRemoteData() - ); - } + if (remove) { + return this.itemDataService.removeMappingFromCollection(id, collection.id).pipe( + getFirstCompletedRemoteData() + ); + } else { + return this.itemDataService.mapToCollection(id, collection._links.self.href).pipe( + getFirstCompletedRemoteData() + ); } + } )) ) ); diff --git a/src/app/collection-page/create-collection-page/create-collection-page.guard.ts b/src/app/collection-page/create-collection-page/create-collection-page.guard.ts index ca84231912..bdb0af1cd1 100644 --- a/src/app/collection-page/create-collection-page/create-collection-page.guard.ts +++ b/src/app/collection-page/create-collection-page/create-collection-page.guard.ts @@ -38,6 +38,6 @@ export class CreateCollectionPageGuard implements CanActivate { this.router.navigate(['/404']); } }) - ); + ); } } diff --git a/src/app/collection-page/edit-collection-page/collection-access-control/collection-access-control.component.spec.ts b/src/app/collection-page/edit-collection-page/collection-access-control/collection-access-control.component.spec.ts index 04da8bbcd9..c926686fb7 100644 --- a/src/app/collection-page/edit-collection-page/collection-access-control/collection-access-control.component.spec.ts +++ b/src/app/collection-page/edit-collection-page/collection-access-control/collection-access-control.component.spec.ts @@ -10,7 +10,7 @@ xdescribe('CollectionAccessControlComponent', () => { await TestBed.configureTestingModule({ declarations: [ CollectionAccessControlComponent ] }) - .compileComponents(); + .compileComponents(); }); beforeEach(() => { diff --git a/src/app/collection-page/edit-collection-page/collection-source/collection-source-controls/collection-source-controls.component.ts b/src/app/collection-page/edit-collection-page/collection-source/collection-source-controls/collection-source-controls.component.ts index 7113c25e9f..a84f8929b9 100644 --- a/src/app/collection-page/edit-collection-page/collection-source/collection-source-controls/collection-source-controls.component.ts +++ b/src/app/collection-page/edit-collection-page/collection-source/collection-source-controls/collection-source-controls.component.ts @@ -101,29 +101,29 @@ export class CollectionSourceControlsComponent implements OnDestroy { map((rd) => rd.payload), hasValueOperator(), ).subscribe((process: Process) => { - if (process.processStatus.toString() !== ProcessStatus[ProcessStatus.COMPLETED].toString() && + if (process.processStatus.toString() !== ProcessStatus[ProcessStatus.COMPLETED].toString() && process.processStatus.toString() !== ProcessStatus[ProcessStatus.FAILED].toString()) { - // Ping the current process state every 5s - setTimeout(() => { - this.requestService.setStaleByHrefSubstring(process._links.self.href); - }, 5000); - } - if (process.processStatus.toString() === ProcessStatus[ProcessStatus.FAILED].toString()) { - this.notificationsService.error(this.translateService.get('collection.source.controls.test.failed')); - this.testConfigRunning$.next(false); - } - if (process.processStatus.toString() === ProcessStatus[ProcessStatus.COMPLETED].toString()) { - this.bitstreamService.findByHref(process._links.output.href).pipe(getFirstSucceededRemoteDataPayload()).subscribe((bitstream) => { - this.httpClient.get(bitstream._links.content.href, {responseType: 'text'}).subscribe((data: any) => { - const output = data.replaceAll(new RegExp('.*\\@(.*)', 'g'), '$1') - .replaceAll('The script has started', '') - .replaceAll('The script has completed', ''); - this.notificationsService.info(this.translateService.get('collection.source.controls.test.completed'), output); - }); - }); - this.testConfigRunning$.next(false); - } + // Ping the current process state every 5s + setTimeout(() => { + this.requestService.setStaleByHrefSubstring(process._links.self.href); + }, 5000); } + if (process.processStatus.toString() === ProcessStatus[ProcessStatus.FAILED].toString()) { + this.notificationsService.error(this.translateService.get('collection.source.controls.test.failed')); + this.testConfigRunning$.next(false); + } + if (process.processStatus.toString() === ProcessStatus[ProcessStatus.COMPLETED].toString()) { + this.bitstreamService.findByHref(process._links.output.href).pipe(getFirstSucceededRemoteDataPayload()).subscribe((bitstream) => { + this.httpClient.get(bitstream._links.content.href, {responseType: 'text'}).subscribe((data: any) => { + const output = data.replaceAll(new RegExp('.*\\@(.*)', 'g'), '$1') + .replaceAll('The script has started', '') + .replaceAll('The script has completed', ''); + this.notificationsService.info(this.translateService.get('collection.source.controls.test.completed'), output); + }); + }); + this.testConfigRunning$.next(false); + } + } )); } @@ -153,24 +153,24 @@ export class CollectionSourceControlsComponent implements OnDestroy { map((rd) => rd.payload), hasValueOperator(), ).subscribe((process) => { - if (process.processStatus.toString() !== ProcessStatus[ProcessStatus.COMPLETED].toString() && + if (process.processStatus.toString() !== ProcessStatus[ProcessStatus.COMPLETED].toString() && process.processStatus.toString() !== ProcessStatus[ProcessStatus.FAILED].toString()) { - // Ping the current process state every 5s - setTimeout(() => { - this.requestService.setStaleByHrefSubstring(process._links.self.href); - this.requestService.setStaleByHrefSubstring(this.collection._links.self.href); - }, 5000); - } - if (process.processStatus.toString() === ProcessStatus[ProcessStatus.FAILED].toString()) { - this.notificationsService.error(this.translateService.get('collection.source.controls.import.failed')); - this.importRunning$.next(false); - } - if (process.processStatus.toString() === ProcessStatus[ProcessStatus.COMPLETED].toString()) { - this.notificationsService.success(this.translateService.get('collection.source.controls.import.completed')); + // Ping the current process state every 5s + setTimeout(() => { + this.requestService.setStaleByHrefSubstring(process._links.self.href); this.requestService.setStaleByHrefSubstring(this.collection._links.self.href); - this.importRunning$.next(false); - } + }, 5000); } + if (process.processStatus.toString() === ProcessStatus[ProcessStatus.FAILED].toString()) { + this.notificationsService.error(this.translateService.get('collection.source.controls.import.failed')); + this.importRunning$.next(false); + } + if (process.processStatus.toString() === ProcessStatus[ProcessStatus.COMPLETED].toString()) { + this.notificationsService.success(this.translateService.get('collection.source.controls.import.completed')); + this.requestService.setStaleByHrefSubstring(this.collection._links.self.href); + this.importRunning$.next(false); + } + } )); } @@ -200,24 +200,24 @@ export class CollectionSourceControlsComponent implements OnDestroy { map((rd) => rd.payload), hasValueOperator(), ).subscribe((process) => { - if (process.processStatus.toString() !== ProcessStatus[ProcessStatus.COMPLETED].toString() && + if (process.processStatus.toString() !== ProcessStatus[ProcessStatus.COMPLETED].toString() && process.processStatus.toString() !== ProcessStatus[ProcessStatus.FAILED].toString()) { - // Ping the current process state every 5s - setTimeout(() => { - this.requestService.setStaleByHrefSubstring(process._links.self.href); - this.requestService.setStaleByHrefSubstring(this.collection._links.self.href); - }, 5000); - } - if (process.processStatus.toString() === ProcessStatus[ProcessStatus.FAILED].toString()) { - this.notificationsService.error(this.translateService.get('collection.source.controls.reset.failed')); - this.reImportRunning$.next(false); - } - if (process.processStatus.toString() === ProcessStatus[ProcessStatus.COMPLETED].toString()) { - this.notificationsService.success(this.translateService.get('collection.source.controls.reset.completed')); + // Ping the current process state every 5s + setTimeout(() => { + this.requestService.setStaleByHrefSubstring(process._links.self.href); this.requestService.setStaleByHrefSubstring(this.collection._links.self.href); - this.reImportRunning$.next(false); - } + }, 5000); } + if (process.processStatus.toString() === ProcessStatus[ProcessStatus.FAILED].toString()) { + this.notificationsService.error(this.translateService.get('collection.source.controls.reset.failed')); + this.reImportRunning$.next(false); + } + if (process.processStatus.toString() === ProcessStatus[ProcessStatus.COMPLETED].toString()) { + this.notificationsService.success(this.translateService.get('collection.source.controls.reset.completed')); + this.requestService.setStaleByHrefSubstring(this.collection._links.self.href); + this.reImportRunning$.next(false); + } + } )); } diff --git a/src/app/collection-page/edit-collection-page/edit-collection-page.routing.module.ts b/src/app/collection-page/edit-collection-page/edit-collection-page.routing.module.ts index c4481985c0..efab4749fd 100644 --- a/src/app/collection-page/edit-collection-page/edit-collection-page.routing.module.ts +++ b/src/app/collection-page/edit-collection-page/edit-collection-page.routing.module.ts @@ -64,7 +64,7 @@ import { CollectionAccessControlComponent } from './collection-access-control/co component: CollectionAccessControlComponent, data: { title: 'collection.edit.tabs.access-control.title', showBreadcrumbs: true } }, -/* { + /* { path: 'authorizations', component: CollectionAuthorizationsComponent, data: { title: 'collection.edit.tabs.authorizations.title', showBreadcrumbs: true } diff --git a/src/app/community-list-page/community-list-service.spec.ts b/src/app/community-list-page/community-list-service.spec.ts index 410dd9f804..7781b6f4c0 100644 --- a/src/app/community-list-page/community-list-service.spec.ts +++ b/src/app/community-list-page/community-list-service.spec.ts @@ -38,10 +38,10 @@ describe('CommunityListService', () => { id: 'ce64f48e-2c9b-411a-ac36-ee429c0e6a88', uuid: 'ce64f48e-2c9b-411a-ac36-ee429c0e6a88', }), - Object.assign(new Community(), { - id: '59ee713b-ee53-4220-8c3f-9860dc84fe33', - uuid: '59ee713b-ee53-4220-8c3f-9860dc84fe33', - }) + Object.assign(new Community(), { + id: '59ee713b-ee53-4220-8c3f-9860dc84fe33', + uuid: '59ee713b-ee53-4220-8c3f-9860dc84fe33', + }) ]; mockCollectionsPage1 = [ Object.assign(new Collection(), { diff --git a/src/app/community-list-page/community-list-service.ts b/src/app/community-list-page/community-list-service.ts index 9a8841f6da..21ede06a7d 100644 --- a/src/app/community-list-page/community-list-service.ts +++ b/src/app/community-list-page/community-list-service.ts @@ -150,15 +150,15 @@ export class CommunityListService { */ private getTopCommunities(options: FindListOptions): Observable> { return this.communityDataService.findTop({ - currentPage: options.currentPage, - elementsPerPage: this.pageSize, - sort: { - field: options.sort.field, - direction: options.sort.direction - } - }, - followLink('subcommunities', { findListOptions: this.configOnePage }), - followLink('collections', { findListOptions: this.configOnePage })) + currentPage: options.currentPage, + elementsPerPage: this.pageSize, + sort: { + field: options.sort.field, + direction: options.sort.direction + } + }, + followLink('subcommunities', { findListOptions: this.configOnePage }), + followLink('collections', { findListOptions: this.configOnePage })) .pipe( getFirstSucceededRemoteData(), map((results) => results.payload), @@ -173,9 +173,9 @@ export class CommunityListService { * @param expandedNodes List of expanded nodes; if a node is not expanded its subcommunities and collections need not be added to the list */ public transformListOfCommunities(listOfPaginatedCommunities: PaginatedList, - level: number, - parent: FlatNode, - expandedNodes: FlatNode[]): Observable { + level: number, + parent: FlatNode, + expandedNodes: FlatNode[]): Observable { if (isNotEmpty(listOfPaginatedCommunities.page)) { let currentPage = listOfPaginatedCommunities.currentPage; if (isNotEmpty(parent)) { @@ -222,11 +222,11 @@ export class CommunityListService { let subcoms = []; for (let i = 1; i <= currentCommunityPage; i++) { const nextSetOfSubcommunitiesPage = this.communityDataService.findByParent(community.uuid, { - elementsPerPage: this.pageSize, - currentPage: i - }, - followLink('subcommunities', { findListOptions: this.configOnePage }), - followLink('collections', { findListOptions: this.configOnePage })) + elementsPerPage: this.pageSize, + currentPage: i + }, + followLink('subcommunities', { findListOptions: this.configOnePage }), + followLink('collections', { findListOptions: this.configOnePage })) .pipe( getFirstCompletedRemoteData(), switchMap((rd: RemoteData>) => { diff --git a/src/app/community-list-page/community-list/community-list.component.spec.ts b/src/app/community-list-page/community-list/community-list.component.spec.ts index ce6b27dbeb..815f70005e 100644 --- a/src/app/community-list-page/community-list/community-list.component.spec.ts +++ b/src/app/community-list-page/community-list/community-list.component.spec.ts @@ -27,11 +27,11 @@ describe('CommunityListComponent', () => { uuid: 'ce64f48e-2c9b-411a-ac36-ee429c0e6a88', name: 'subcommunity1', }), - Object.assign(new Community(), { - id: '59ee713b-ee53-4220-8c3f-9860dc84fe33', - uuid: '59ee713b-ee53-4220-8c3f-9860dc84fe33', - name: 'subcommunity2', - }) + Object.assign(new Community(), { + id: '59ee713b-ee53-4220-8c3f-9860dc84fe33', + uuid: '59ee713b-ee53-4220-8c3f-9860dc84fe33', + name: 'subcommunity2', + }) ]; const mockCollectionsPage1 = [ Object.assign(new Collection(), { diff --git a/src/app/community-page/community-form/community-form.component.ts b/src/app/community-page/community-form/community-form.component.ts index fa4809738d..4c42161c3c 100644 --- a/src/app/community-page/community-form/community-form.component.ts +++ b/src/app/community-page/community-form/community-form.component.ts @@ -85,7 +85,7 @@ export class CommunityFormComponent extends ComColFormComponent imple ngOnChanges(changes: SimpleChanges) { const dsoChange: SimpleChange = changes.dso; if (this.dso && dsoChange && !dsoChange.isFirstChange()) { - super.ngOnInit(); + super.ngOnInit(); } } } diff --git a/src/app/community-page/create-community-page/create-community-page.guard.ts b/src/app/community-page/create-community-page/create-community-page.guard.ts index 835fbb6589..c488dc57f8 100644 --- a/src/app/community-page/create-community-page/create-community-page.guard.ts +++ b/src/app/community-page/create-community-page/create-community-page.guard.ts @@ -38,7 +38,7 @@ export class CreateCommunityPageGuard implements CanActivate { this.router.navigate(['/404']); } } - ) - ); + ) + ); } } diff --git a/src/app/community-page/edit-community-page/community-access-control/community-access-control.component.spec.ts b/src/app/community-page/edit-community-page/community-access-control/community-access-control.component.spec.ts index d895cfd820..a3f7935f55 100644 --- a/src/app/community-page/edit-community-page/community-access-control/community-access-control.component.spec.ts +++ b/src/app/community-page/edit-community-page/community-access-control/community-access-control.component.spec.ts @@ -10,7 +10,7 @@ xdescribe('CommunityAccessControlComponent', () => { await TestBed.configureTestingModule({ declarations: [ CommunityAccessControlComponent ] }) - .compileComponents(); + .compileComponents(); }); beforeEach(() => { diff --git a/src/app/community-page/sub-collection-list/community-page-sub-collection-list.component.spec.ts b/src/app/community-page/sub-collection-list/community-page-sub-collection-list.component.spec.ts index bca3c42a95..3da92f1493 100644 --- a/src/app/community-page/sub-collection-list/community-page-sub-collection-list.component.spec.ts +++ b/src/app/community-page/sub-collection-list/community-page-sub-collection-list.component.spec.ts @@ -45,54 +45,54 @@ describe('CommunityPageSubCollectionList Component', () => { ] } }), - Object.assign(new Community(), { - id: '123456789-2', - metadata: { - 'dc.title': [ - { language: 'en_US', value: 'Collection 2' } - ] - } - }), - Object.assign(new Community(), { - id: '123456789-3', - metadata: { - 'dc.title': [ - { language: 'en_US', value: 'Collection 3' } - ] - } - }), - Object.assign(new Community(), { - id: '123456789-4', - metadata: { - 'dc.title': [ - { language: 'en_US', value: 'Collection 4' } - ] - } - }), - Object.assign(new Community(), { - id: '123456789-5', - metadata: { - 'dc.title': [ - { language: 'en_US', value: 'Collection 5' } - ] - } - }), - Object.assign(new Community(), { - id: '123456789-6', - metadata: { - 'dc.title': [ - { language: 'en_US', value: 'Collection 6' } - ] - } - }), - Object.assign(new Community(), { - id: '123456789-7', - metadata: { - 'dc.title': [ - { language: 'en_US', value: 'Collection 7' } - ] - } - }) + Object.assign(new Community(), { + id: '123456789-2', + metadata: { + 'dc.title': [ + { language: 'en_US', value: 'Collection 2' } + ] + } + }), + Object.assign(new Community(), { + id: '123456789-3', + metadata: { + 'dc.title': [ + { language: 'en_US', value: 'Collection 3' } + ] + } + }), + Object.assign(new Community(), { + id: '123456789-4', + metadata: { + 'dc.title': [ + { language: 'en_US', value: 'Collection 4' } + ] + } + }), + Object.assign(new Community(), { + id: '123456789-5', + metadata: { + 'dc.title': [ + { language: 'en_US', value: 'Collection 5' } + ] + } + }), + Object.assign(new Community(), { + id: '123456789-6', + metadata: { + 'dc.title': [ + { language: 'en_US', value: 'Collection 6' } + ] + } + }), + Object.assign(new Community(), { + id: '123456789-7', + metadata: { + 'dc.title': [ + { language: 'en_US', value: 'Collection 7' } + ] + } + }) ]; const mockCommunity = Object.assign(new Community(), { diff --git a/src/app/community-page/sub-collection-list/community-page-sub-collection-list.component.ts b/src/app/community-page/sub-collection-list/community-page-sub-collection-list.component.ts index 3a77149e5b..7f8c4db9d8 100644 --- a/src/app/community-page/sub-collection-list/community-page-sub-collection-list.component.ts +++ b/src/app/community-page/sub-collection-list/community-page-sub-collection-list.component.ts @@ -74,8 +74,8 @@ export class CommunityPageSubCollectionListComponent implements OnInit, OnDestro * Initialise the list of collections */ initPage() { - const pagination$ = this.paginationService.getCurrentPagination(this.config.id, this.config); - const sort$ = this.paginationService.getCurrentSort(this.config.id, this.sortConfig); + const pagination$ = this.paginationService.getCurrentPagination(this.config.id, this.config); + const sort$ = this.paginationService.getCurrentSort(this.config.id, this.sortConfig); observableCombineLatest([pagination$, sort$]).pipe( switchMap(([currentPagination, currentSort]) => { diff --git a/src/app/community-page/sub-community-list/community-page-sub-community-list.component.spec.ts b/src/app/community-page/sub-community-list/community-page-sub-community-list.component.spec.ts index 0a14fe6dd1..37ce7e496a 100644 --- a/src/app/community-page/sub-community-list/community-page-sub-community-list.component.spec.ts +++ b/src/app/community-page/sub-community-list/community-page-sub-community-list.component.spec.ts @@ -45,54 +45,54 @@ describe('CommunityPageSubCommunityListComponent Component', () => { ] } }), - Object.assign(new Community(), { - id: '123456789-2', - metadata: { - 'dc.title': [ - { language: 'en_US', value: 'SubCommunity 2' } - ] - } - }), - Object.assign(new Community(), { - id: '123456789-3', - metadata: { - 'dc.title': [ - { language: 'en_US', value: 'SubCommunity 3' } - ] - } - }), - Object.assign(new Community(), { - id: '12345678942', - metadata: { - 'dc.title': [ - { language: 'en_US', value: 'SubCommunity 4' } - ] - } - }), - Object.assign(new Community(), { - id: '123456789-5', - metadata: { - 'dc.title': [ - { language: 'en_US', value: 'SubCommunity 5' } - ] - } - }), - Object.assign(new Community(), { - id: '123456789-6', - metadata: { - 'dc.title': [ - { language: 'en_US', value: 'SubCommunity 6' } - ] - } - }), - Object.assign(new Community(), { - id: '123456789-7', - metadata: { - 'dc.title': [ - { language: 'en_US', value: 'SubCommunity 7' } - ] - } - }) + Object.assign(new Community(), { + id: '123456789-2', + metadata: { + 'dc.title': [ + { language: 'en_US', value: 'SubCommunity 2' } + ] + } + }), + Object.assign(new Community(), { + id: '123456789-3', + metadata: { + 'dc.title': [ + { language: 'en_US', value: 'SubCommunity 3' } + ] + } + }), + Object.assign(new Community(), { + id: '12345678942', + metadata: { + 'dc.title': [ + { language: 'en_US', value: 'SubCommunity 4' } + ] + } + }), + Object.assign(new Community(), { + id: '123456789-5', + metadata: { + 'dc.title': [ + { language: 'en_US', value: 'SubCommunity 5' } + ] + } + }), + Object.assign(new Community(), { + id: '123456789-6', + metadata: { + 'dc.title': [ + { language: 'en_US', value: 'SubCommunity 6' } + ] + } + }), + Object.assign(new Community(), { + id: '123456789-7', + metadata: { + 'dc.title': [ + { language: 'en_US', value: 'SubCommunity 7' } + ] + } + }) ]; const mockCommunity = Object.assign(new Community(), { diff --git a/src/app/core/auth/auth-request.service.ts b/src/app/core/auth/auth-request.service.ts index 7c1f17dec2..b9fdd90176 100644 --- a/src/app/core/auth/auth-request.service.ts +++ b/src/app/core/auth/auth-request.service.ts @@ -24,7 +24,7 @@ export abstract class AuthRequestService { constructor(protected halService: HALEndpointService, protected requestService: RequestService, private rdbService: RemoteDataBuildService - ) { + ) { } /** diff --git a/src/app/core/auth/auth.effects.ts b/src/app/core/auth/auth.effects.ts index 281355b769..708ad48f20 100644 --- a/src/app/core/auth/auth.effects.ts +++ b/src/app/core/auth/auth.effects.ts @@ -58,7 +58,7 @@ import { AuthorizationDataService } from '../data/feature-authorization/authoriz // Action Types that do not break/prevent the user from an idle state const IDLE_TIMER_IGNORE_TYPES: string[] = [...Object.values(AuthActionTypes).filter((t: string) => t !== AuthActionTypes.UNSET_USER_AS_IDLE), - ...Object.values(RequestActionTypes), ...Object.values(NotificationsActionTypes)]; + ...Object.values(RequestActionTypes), ...Object.values(NotificationsActionTypes)]; @Injectable() export class AuthEffects { @@ -213,7 +213,7 @@ export class AuthEffects { * authorizations endpoint, to be sure to have consistent responses after a login with external idp * */ - invalidateAuthorizationsRequestCache$ = createEffect(() => this.actions$ + invalidateAuthorizationsRequestCache$ = createEffect(() => this.actions$ .pipe(ofType(StoreActionTypes.REHYDRATE), tap(() => this.authorizationsService.invalidateAuthorizationsRequestCache()) ), { dispatch: false }); diff --git a/src/app/core/auth/auth.interceptor.ts b/src/app/core/auth/auth.interceptor.ts index 672879f436..de0662ff07 100644 --- a/src/app/core/auth/auth.interceptor.ts +++ b/src/app/core/auth/auth.interceptor.ts @@ -208,7 +208,7 @@ export class AuthInterceptor implements HttpInterceptor { status: 500, timestamp: Date.now(), path: '' - }; + }; } } else { authStatus.error = error; diff --git a/src/app/core/auth/models/auth-status.model.ts b/src/app/core/auth/models/auth-status.model.ts index d18b1ccf9a..272f281474 100644 --- a/src/app/core/auth/models/auth-status.model.ts +++ b/src/app/core/auth/models/auth-status.model.ts @@ -28,14 +28,14 @@ export class AuthStatus implements CacheableObject { * The unique identifier of this auth status */ @autoserialize - id: string; + id: string; /** * The type for this AuthStatus */ @excludeFromEquals @autoserialize - type: ResourceType; + type: ResourceType; /** * The UUID of this auth status @@ -43,25 +43,25 @@ export class AuthStatus implements CacheableObject { * It is based on the ID, so it will be the same for each refresh. */ @deserializeAs(new IDToUUIDSerializer('auth-status'), 'id') - uuid: string; + uuid: string; /** * True if REST API is up and running, should never return false */ @autoserialize - okay: boolean; + okay: boolean; /** * If the auth status represents an authenticated state */ @autoserialize - authenticated: boolean; + authenticated: boolean; /** * The {@link HALLink}s for this AuthStatus */ @deserialize - _links: { + _links: { self: HALLink; eperson: HALLink; specialGroups: HALLink; @@ -72,32 +72,32 @@ export class AuthStatus implements CacheableObject { * Will be undefined unless the eperson {@link HALLink} has been resolved. */ @link(EPERSON) - eperson?: Observable>; + eperson?: Observable>; /** * The SpecialGroup of this auth status * Will be undefined unless the SpecialGroup {@link HALLink} has been resolved. */ @link(GROUP, true) - specialGroups?: Observable>>; + specialGroups?: Observable>>; /** * True if the token is valid, false if there was no token or the token wasn't valid */ @autoserialize - token?: AuthTokenInfo; + token?: AuthTokenInfo; /** * Authentication error if there was one for this status */ // TODO should be refactored to use the RemoteData error @autoserialize - error?: AuthError; + error?: AuthError; /** * All authentication methods enabled at the backend */ @autoserialize - authMethods: AuthMethod[]; + authMethods: AuthMethod[]; } diff --git a/src/app/core/auth/models/short-lived-token.model.ts b/src/app/core/auth/models/short-lived-token.model.ts index 3786bd8e6a..45137d1c2e 100644 --- a/src/app/core/auth/models/short-lived-token.model.ts +++ b/src/app/core/auth/models/short-lived-token.model.ts @@ -17,19 +17,19 @@ export class ShortLivedToken implements CacheableObject { */ @excludeFromEquals @autoserialize - type: ResourceType; + type: ResourceType; /** * The value for this ShortLivedToken */ @autoserializeAs('token') - value: string; + value: string; /** * The {@link HALLink}s for this ShortLivedToken */ @deserialize - _links: { + _links: { self: HALLink; }; } diff --git a/src/app/core/auth/server-auth-request.service.ts b/src/app/core/auth/server-auth-request.service.ts index 058322acce..976c5cc3df 100644 --- a/src/app/core/auth/server-auth-request.service.ts +++ b/src/app/core/auth/server-auth-request.service.ts @@ -45,11 +45,11 @@ export class ServerAuthRequestService extends AuthRequestService { map((response: HttpResponse) => response.headers.get(XSRF_RESPONSE_HEADER)), // Use that token to create an HttpHeaders object map((xsrfToken: string) => new HttpHeaders() - .set('Content-Type', 'application/json; charset=utf-8') - // set the token as the XSRF header - .set(XSRF_REQUEST_HEADER, xsrfToken) - // and as the DSPACE-XSRF-COOKIE - .set('Cookie', `${DSPACE_XSRF_COOKIE}=${xsrfToken}`)), + .set('Content-Type', 'application/json; charset=utf-8') + // set the token as the XSRF header + .set(XSRF_REQUEST_HEADER, xsrfToken) + // and as the DSPACE-XSRF-COOKIE + .set('Cookie', `${DSPACE_XSRF_COOKIE}=${xsrfToken}`)), map((headers: HttpHeaders) => // Create a new PostRequest using those headers and the given href new PostRequest( diff --git a/src/app/core/browse/browse-definition-data.service.ts b/src/app/core/browse/browse-definition-data.service.ts index bc495a51f4..b7cc3daa6f 100644 --- a/src/app/core/browse/browse-definition-data.service.ts +++ b/src/app/core/browse/browse-definition-data.service.ts @@ -25,9 +25,9 @@ import { BrowseDefinition } from '../shared/browse-definition.model'; * Use a GET request specific for BrowseDefinitions. */ export const createAndSendBrowseDefinitionGetRequest = (requestService: RequestService, - responseMsToLive: number, - href$: string | Observable, - useCachedVersionIfAvailable: boolean = true): void => { + responseMsToLive: number, + href$: string | Observable, + useCachedVersionIfAvailable: boolean = true): void => { if (isNotEmpty(href$)) { if (typeof href$ === 'string') { href$ = observableOf(href$); diff --git a/src/app/core/cache/builders/build-decorators.ts b/src/app/core/cache/builders/build-decorators.ts index 9e5ebaed85..01c4622122 100644 --- a/src/app/core/cache/builders/build-decorators.ts +++ b/src/app/core/cache/builders/build-decorators.ts @@ -65,7 +65,7 @@ export const link = ( resourceType: ResourceType, isList = false, linkName?: keyof T['_links'], - ) => { +) => { return (target: T, propertyName: string) => { let targetMap = linkMap.get(target.constructor); diff --git a/src/app/core/cache/models/self-link.model.ts b/src/app/core/cache/models/self-link.model.ts index a87acdd506..903a779495 100644 --- a/src/app/core/cache/models/self-link.model.ts +++ b/src/app/core/cache/models/self-link.model.ts @@ -3,9 +3,9 @@ import { autoserialize } from 'cerialize'; export class SelfLink { @autoserialize - self: string; + self: string; @autoserialize - uuid: string; + uuid: string; } diff --git a/src/app/core/cache/object-cache.effects.ts b/src/app/core/cache/object-cache.effects.ts index fa2bf6f690..5d6899c9ba 100644 --- a/src/app/core/cache/object-cache.effects.ts +++ b/src/app/core/cache/object-cache.effects.ts @@ -16,7 +16,7 @@ export class ObjectCacheEffects { * This assumes that the server cached everything a negligible * time ago, and will likely need to be revisited later */ - fixTimestampsOnRehydrate = createEffect(() => this.actions$ + fixTimestampsOnRehydrate = createEffect(() => this.actions$ .pipe(ofType(StoreActionTypes.REHYDRATE), map(() => new ResetObjectCacheTimestampsAction(new Date().getTime())) )); diff --git a/src/app/core/cache/object-cache.service.ts b/src/app/core/cache/object-cache.service.ts index 9ca0216210..5b2bfc7957 100644 --- a/src/app/core/cache/object-cache.service.ts +++ b/src/app/core/cache/object-cache.service.ts @@ -82,12 +82,12 @@ export class ObjectCacheService { const cacheEntry$ = this.getByHref(href); const altLinks$ = cacheEntry$.pipe(map((entry: ObjectCacheEntry) => entry.alternativeLinks), take(1)); const childLinks$ = cacheEntry$.pipe(map((entry: ObjectCacheEntry) => { - return Object - .entries(entry.data._links) - .filter(([key, value]: [string, HALLink]) => key !== 'self') - .map(([key, value]: [string, HALLink]) => value.href); - }), - take(1) + return Object + .entries(entry.data._links) + .filter(([key, value]: [string, HALLink]) => key !== 'self') + .map(([key, value]: [string, HALLink]) => value.href); + }), + take(1) ); this.removeLinksFromAlternativeLinkIndex(altLinks$); this.removeLinksFromAlternativeLinkIndex(childLinks$); @@ -96,8 +96,8 @@ export class ObjectCacheService { private removeLinksFromAlternativeLinkIndex(links$: Observable) { links$.subscribe((links: string[]) => links.forEach((link: string) => { - this.store.dispatch(new RemoveFromIndexBySubstringAction(IndexName.ALTERNATIVE_OBJECT_LINK, link)); - } + this.store.dispatch(new RemoveFromIndexBySubstringAction(IndexName.ALTERNATIVE_OBJECT_LINK, link)); + } )); } @@ -129,14 +129,14 @@ export class ObjectCacheService { getObjectByHref(href: string): Observable { return this.getByHref(href).pipe( map((entry: ObjectCacheEntry) => { - if (isNotEmpty(entry.patches)) { - const flatPatch: Operation[] = [].concat(...entry.patches.map((patch) => patch.operations)); - const patchedData = applyPatch(entry.data, flatPatch, undefined, false).newDocument; - return Object.assign({}, entry, { data: patchedData }); - } else { - return entry; - } + if (isNotEmpty(entry.patches)) { + const flatPatch: Operation[] = [].concat(...entry.patches.map((patch) => patch.operations)); + const patchedData = applyPatch(entry.data, flatPatch, undefined, false).newDocument; + return Object.assign({}, entry, { data: patchedData }); + } else { + return entry; } + } ), map((entry: ObjectCacheEntry) => { const type: GenericConstructor = getClassForType((entry.data as any).type); diff --git a/src/app/core/cache/server-sync-buffer.effects.ts b/src/app/core/cache/server-sync-buffer.effects.ts index 9571d4af5b..b3fe7ac34f 100644 --- a/src/app/core/cache/server-sync-buffer.effects.ts +++ b/src/app/core/cache/server-sync-buffer.effects.ts @@ -32,7 +32,7 @@ export class ServerSyncBufferEffects { * Then dispatch a CommitSSBAction * When the delay is running, no new AddToSSBActions are processed in this effect */ - setTimeoutForServerSync = createEffect(() => this.actions$ + setTimeoutForServerSync = createEffect(() => this.actions$ .pipe( ofType(ServerSyncBufferActionTypes.ADD), exhaustMap((action: AddToSSBAction) => { @@ -50,7 +50,7 @@ export class ServerSyncBufferEffects { * When the list of actions is not empty, also dispatch an EmptySSBAction * When the list is empty dispatch a NO_ACTION placeholder action */ - commitServerSyncBuffer = createEffect(() => this.actions$ + commitServerSyncBuffer = createEffect(() => this.actions$ .pipe( ofType(ServerSyncBufferActionTypes.COMMIT), switchMap((action: CommitSSBAction) => { @@ -78,8 +78,8 @@ export class ServerSyncBufferEffects { /* Add extra action to array, to make sure the ServerSyncBuffer is emptied afterwards */ if (isNotEmpty(actions) && isNotUndefined(actions[0])) { return observableCombineLatest(...actions).pipe( - switchMap((array) => [...array, new EmptySSBAction(action.payload)]) - ); + switchMap((array) => [...array, new EmptySSBAction(action.payload)]) + ); } else { return observableOf(new NoOpAction()); } diff --git a/src/app/core/cache/server-sync-buffer.reducer.ts b/src/app/core/cache/server-sync-buffer.reducer.ts index 3e8944aa73..cb26bf29ed 100644 --- a/src/app/core/cache/server-sync-buffer.reducer.ts +++ b/src/app/core/cache/server-sync-buffer.reducer.ts @@ -86,9 +86,9 @@ function addToServerSyncQueue(state: ServerSyncBufferState, action: AddToSSBActi * the new state, with a new entry added to the buffer */ function emptyServerSyncQueue(state: ServerSyncBufferState, action: EmptySSBAction): ServerSyncBufferState { - let newBuffer = []; - if (hasValue(action.payload)) { - newBuffer = state.buffer.filter((entry) => entry.method !== action.payload); - } - return Object.assign({}, state, { buffer: newBuffer }); + let newBuffer = []; + if (hasValue(action.payload)) { + newBuffer = state.buffer.filter((entry) => entry.method !== action.payload); + } + return Object.assign({}, state, { buffer: newBuffer }); } diff --git a/src/app/core/config/models/bulk-access-condition-options.model.ts b/src/app/core/config/models/bulk-access-condition-options.model.ts index d84e14b95d..f4c6845397 100644 --- a/src/app/core/config/models/bulk-access-condition-options.model.ts +++ b/src/app/core/config/models/bulk-access-condition-options.model.ts @@ -20,19 +20,19 @@ export class BulkAccessConditionOptions extends ConfigObject { */ @excludeFromEquals @autoserialize - type: ResourceType; + type: ResourceType; @autoserializeAs(String, 'name') - uuid: string; + uuid: string; @autoserialize - id: string; + id: string; @autoserialize - itemAccessConditionOptions: AccessesConditionOption[]; + itemAccessConditionOptions: AccessesConditionOption[]; @autoserialize - bitstreamAccessConditionOptions: AccessesConditionOption[]; + bitstreamAccessConditionOptions: AccessesConditionOption[]; _links: { self: HALLink }; } diff --git a/src/app/core/config/models/config-accesses-conditions-options.model.ts b/src/app/core/config/models/config-accesses-conditions-options.model.ts index 244b501908..64199be0eb 100644 --- a/src/app/core/config/models/config-accesses-conditions-options.model.ts +++ b/src/app/core/config/models/config-accesses-conditions-options.model.ts @@ -3,43 +3,43 @@ */ export class AccessesConditionOption { - /** + /** * The name for this Access Condition */ - name: string; + name: string; - /** + /** * The groupName for this Access Condition */ - groupName: string; + groupName: string; - /** + /** * A boolean representing if this Access Condition has a start date */ - hasStartDate: boolean; + hasStartDate: boolean; - /** + /** * A boolean representing if this Access Condition has an end date */ - hasEndDate: boolean; + hasEndDate: boolean; - /** + /** * Maximum value of the start date */ - endDateLimit?: string; + endDateLimit?: string; - /** + /** * Maximum value of the end date */ - startDateLimit?: string; + startDateLimit?: string; - /** + /** * Maximum value of the start date */ - maxStartDate?: string; + maxStartDate?: string; - /** + /** * Maximum value of the end date */ - maxEndDate?: string; + maxEndDate?: string; } diff --git a/src/app/core/config/models/config-submission-access.model.ts b/src/app/core/config/models/config-submission-access.model.ts index 7db96acf2b..5688ff0e0f 100644 --- a/src/app/core/config/models/config-submission-access.model.ts +++ b/src/app/core/config/models/config-submission-access.model.ts @@ -17,25 +17,25 @@ export class SubmissionAccessModel extends ConfigObject { * A list of available item access conditions */ @autoserialize - accessConditionOptions: AccessesConditionOption[]; + accessConditionOptions: AccessesConditionOption[]; /** * Boolean that indicates whether the current item must be findable via search or browse. */ @autoserialize - discoverable: boolean; + discoverable: boolean; /** * Boolean that indicates whether or not the user can change the discoverable flag. */ @autoserialize - canChangeDiscoverable: boolean; + canChangeDiscoverable: boolean; /** * The links to all related resources returned by the rest api. */ @deserialize - _links: { + _links: { self: HALLink }; diff --git a/src/app/core/config/models/config-submission-definition.model.ts b/src/app/core/config/models/config-submission-definition.model.ts index b07917e032..ce8280330a 100644 --- a/src/app/core/config/models/config-submission-definition.model.ts +++ b/src/app/core/config/models/config-submission-definition.model.ts @@ -18,20 +18,20 @@ export class SubmissionDefinitionModel extends ConfigObject { * A boolean representing if this submission definition is the default or not */ @autoserialize - isDefault: boolean; + isDefault: boolean; /** * A list of SubmissionSectionModel that are present in this submission definition */ // TODO refactor using remotedata @deserialize - sections: PaginatedList; + sections: PaginatedList; /** * The links to all related resources returned by the rest api. */ @deserialize - _links: { + _links: { self: HALLink, collections: HALLink, sections: HALLink diff --git a/src/app/core/config/models/config-submission-form.model.ts b/src/app/core/config/models/config-submission-form.model.ts index 90f94882bd..c778d9964d 100644 --- a/src/app/core/config/models/config-submission-form.model.ts +++ b/src/app/core/config/models/config-submission-form.model.ts @@ -23,5 +23,5 @@ export class SubmissionFormModel extends ConfigObject { * An array of [FormRowModel] that are present in this form */ @autoserialize - rows: FormRowModel[]; + rows: FormRowModel[]; } diff --git a/src/app/core/config/models/config-submission-section.model.ts b/src/app/core/config/models/config-submission-section.model.ts index bdc884dfa4..77575d639d 100644 --- a/src/app/core/config/models/config-submission-section.model.ts +++ b/src/app/core/config/models/config-submission-section.model.ts @@ -22,31 +22,31 @@ export class SubmissionSectionModel extends ConfigObject { * The header for this section */ @autoserialize - header: string; + header: string; /** * A boolean representing if this submission section is the mandatory or not */ @autoserialize - mandatory: boolean; + mandatory: boolean; /** * A string representing the kind of section object */ @autoserialize - sectionType: SectionsType; + sectionType: SectionsType; /** * The [SubmissionSectionVisibility] object for this section */ @autoserialize - visibility: SubmissionSectionVisibility; + visibility: SubmissionSectionVisibility; /** * The {@link HALLink}s for this SubmissionSectionModel */ @deserialize - _links: { + _links: { self: HALLink; config: HALLink; }; diff --git a/src/app/core/config/models/config-submission-upload.model.ts b/src/app/core/config/models/config-submission-upload.model.ts index f6897da2e3..4d1a661e50 100644 --- a/src/app/core/config/models/config-submission-upload.model.ts +++ b/src/app/core/config/models/config-submission-upload.model.ts @@ -16,22 +16,22 @@ export class SubmissionUploadModel extends ConfigObject { * A list of available bitstream access conditions */ @autoserialize - accessConditionOptions: AccessConditionOption[]; + accessConditionOptions: AccessConditionOption[]; /** * An object representing the configuration describing the bitstream metadata form */ @link(SUBMISSION_FORMS_TYPE) - metadata?: Observable>; + metadata?: Observable>; @autoserialize - required: boolean; + required: boolean; @autoserialize - maxSize: number; + maxSize: number; @deserialize - _links: { + _links: { metadata: HALLink self: HALLink }; diff --git a/src/app/core/config/models/config.model.ts b/src/app/core/config/models/config.model.ts index 170aa334ed..7b2787c7c5 100644 --- a/src/app/core/config/models/config.model.ts +++ b/src/app/core/config/models/config.model.ts @@ -23,13 +23,13 @@ export abstract class ConfigObject implements CacheableObject { */ @excludeFromEquals @autoserialize - type: ResourceType; + type: ResourceType; /** * The links to all related resources returned by the rest api. */ @deserialize - _links: { + _links: { self: HALLink, [name: string]: HALLink }; diff --git a/src/app/core/core-state.model.ts b/src/app/core/core-state.model.ts index b8211fdb55..1d7aca67a4 100644 --- a/src/app/core/core-state.model.ts +++ b/src/app/core/core-state.model.ts @@ -1,5 +1,5 @@ import { - BitstreamFormatRegistryState + BitstreamFormatRegistryState } from '../admin/admin-registries/bitstream-formats/bitstream-format.reducers'; import { ObjectCacheState } from './cache/object-cache.reducer'; import { ServerSyncBufferState } from './cache/server-sync-buffer.reducer'; diff --git a/src/app/core/data/base-response-parsing.service.ts b/src/app/core/data/base-response-parsing.service.ts index 18e6623683..10bbe33197 100644 --- a/src/app/core/data/base-response-parsing.service.ts +++ b/src/app/core/data/base-response-parsing.service.ts @@ -64,7 +64,7 @@ export abstract class BaseResponseParsingService { } else if (isRestDataObject(data._embedded[property])) { object[property] = this.retrieveObjectOrUrl(parsedObj); } else if (Array.isArray(parsedObj)) { - object[property] = parsedObj.map((obj) => this.retrieveObjectOrUrl(obj)); + object[property] = parsedObj.map((obj) => this.retrieveObjectOrUrl(obj)); } } }); @@ -102,8 +102,8 @@ export abstract class BaseResponseParsingService { protected processArray(data: any, request: RestRequest): ObjectDomain[] { let array: ObjectDomain[] = []; data.forEach((datum) => { - array = [...array, this.process(datum, request)]; - } + array = [...array, this.process(datum, request)]; + } ); return array; } diff --git a/src/app/core/data/base/base-data.service.ts b/src/app/core/data/base/base-data.service.ts index edd6d9e2a4..6337bf4951 100644 --- a/src/app/core/data/base/base-data.service.ts +++ b/src/app/core/data/base/base-data.service.ts @@ -373,10 +373,10 @@ export class BaseDataService implements HALDataServic return this.hasCachedResponse(href$).pipe( switchMap((hasCachedResponse) => { if (hasCachedResponse) { - return this.rdbService.buildSingle(href$).pipe( - getFirstCompletedRemoteData(), - map((rd => rd.hasFailed)) - ); + return this.rdbService.buildSingle(href$).pipe( + getFirstCompletedRemoteData(), + map((rd => rd.hasFailed)) + ); } return observableOf(false); }) diff --git a/src/app/core/data/base/find-all-data.spec.ts b/src/app/core/data/base/find-all-data.spec.ts index 6a73e032d0..c1d3002617 100644 --- a/src/app/core/data/base/find-all-data.spec.ts +++ b/src/app/core/data/base/find-all-data.spec.ts @@ -143,8 +143,8 @@ describe('FindAllDataImpl', () => { options = {}; (service as any).getFindAllHref(options).subscribe((value) => { - expect(value).toBe(endpoint); - }, + expect(value).toBe(endpoint); + }, ); }); diff --git a/src/app/core/data/browse-response-parsing.service.spec.ts b/src/app/core/data/browse-response-parsing.service.spec.ts index 9fa7239ef7..3e6d727b96 100644 --- a/src/app/core/data/browse-response-parsing.service.spec.ts +++ b/src/app/core/data/browse-response-parsing.service.spec.ts @@ -26,22 +26,22 @@ describe('BrowseResponseParsingService', () => { describe('', () => { const mockFlatBrowse = { - id: 'title', - browseType: 'flatBrowse', - type: 'browse', - }; + id: 'title', + browseType: 'flatBrowse', + type: 'browse', + }; const mockValueList = { - id: 'author', - browseType: 'valueList', - type: 'browse', - }; + id: 'author', + browseType: 'valueList', + type: 'browse', + }; const mockHierarchicalBrowse = { - id: 'srsc', - browseType: 'hierarchicalBrowse', - type: 'browse', - }; + id: 'srsc', + browseType: 'hierarchicalBrowse', + type: 'browse', + }; it('should deserialize flatBrowses correctly', () => { let deserialized = service.deserialize(mockFlatBrowse); diff --git a/src/app/core/data/dso-redirect.service.ts b/src/app/core/data/dso-redirect.service.ts index 35aecac2bd..8c15a33a3f 100644 --- a/src/app/core/data/dso-redirect.service.ts +++ b/src/app/core/data/dso-redirect.service.ts @@ -42,7 +42,7 @@ class DsoByIdOrUUIDDataService extends IdentifiableDataService { // interpolate id/uuid as query parameter (endpoint: string, resourceID: string): string => { return endpoint.replace(/{\?id}/, `?id=${resourceID}`) - .replace(/{\?uuid}/, `?uuid=${resourceID}`); + .replace(/{\?uuid}/, `?uuid=${resourceID}`); }, ); } diff --git a/src/app/core/data/dspace-rest-response-parsing.service.ts b/src/app/core/data/dspace-rest-response-parsing.service.ts index 500afc4aff..106410bad5 100644 --- a/src/app/core/data/dspace-rest-response-parsing.service.ts +++ b/src/app/core/data/dspace-rest-response-parsing.service.ts @@ -184,8 +184,8 @@ export class DspaceRestResponseParsingService implements ResponseParsingService protected processArray(data: any, request: RestRequest): ObjectDomain[] { let array: ObjectDomain[] = []; data.forEach((datum) => { - array = [...array, this.process(datum, request)]; - } + array = [...array, this.process(datum, request)]; + } ); return array; } diff --git a/src/app/core/data/feature-authorization/feature-authorization-guard/statistics-administrator.guard.ts b/src/app/core/data/feature-authorization/feature-authorization-guard/statistics-administrator.guard.ts index 680495686e..7e2a827876 100644 --- a/src/app/core/data/feature-authorization/feature-authorization-guard/statistics-administrator.guard.ts +++ b/src/app/core/data/feature-authorization/feature-authorization-guard/statistics-administrator.guard.ts @@ -11,17 +11,17 @@ import { FeatureID } from '../feature-id'; * management rights */ @Injectable({ - providedIn: 'root' + providedIn: 'root' }) export class StatisticsAdministratorGuard extends SingleFeatureAuthorizationGuard { - constructor(protected authorizationService: AuthorizationDataService, protected router: Router, protected authService: AuthService) { - super(authorizationService, router, authService); - } + constructor(protected authorizationService: AuthorizationDataService, protected router: Router, protected authService: AuthService) { + super(authorizationService, router, authService); + } - /** + /** * Check group management rights */ - getFeatureID(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Observable { - return observableOf(FeatureID.CanViewUsageStatistics); - } + getFeatureID(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Observable { + return observableOf(FeatureID.CanViewUsageStatistics); + } } diff --git a/src/app/core/data/find-list-options.model.ts b/src/app/core/data/find-list-options.model.ts index dc567d4b53..8e37cb49fd 100644 --- a/src/app/core/data/find-list-options.model.ts +++ b/src/app/core/data/find-list-options.model.ts @@ -5,11 +5,11 @@ import { RequestParam } from '../cache/models/request-param.model'; * The options for a find list request */ export class FindListOptions { - scopeID?: string; - elementsPerPage?: number; - currentPage?: number; - sort?: SortOptions; - searchParams?: RequestParam[]; - startsWith?: string; - fetchThumbnail?: boolean; + scopeID?: string; + elementsPerPage?: number; + currentPage?: number; + sort?: SortOptions; + searchParams?: RequestParam[]; + startsWith?: string; + fetchThumbnail?: boolean; } diff --git a/src/app/core/data/href-only-data.service.spec.ts b/src/app/core/data/href-only-data.service.spec.ts index bf7d2890ea..ed0386f705 100644 --- a/src/app/core/data/href-only-data.service.spec.ts +++ b/src/app/core/data/href-only-data.service.spec.ts @@ -23,60 +23,60 @@ describe(`HrefOnlyDataService`, () => { expect((service as any).dataService).toBeInstanceOf(BaseDataService); }); - describe(`findByHref`, () => { - beforeEach(() => { - spy = spyOn((service as any).dataService, 'findByHref').and.returnValue(createSuccessfulRemoteDataObject$(null)); - }); + describe(`findByHref`, () => { + beforeEach(() => { + spy = spyOn((service as any).dataService, 'findByHref').and.returnValue(createSuccessfulRemoteDataObject$(null)); + }); - it(`should forward to findByHref on the internal DataService`, () => { - service.findByHref(href, false, false, ...followLinks); - expect(spy).toHaveBeenCalledWith(href, false, false, ...followLinks); - }); + it(`should forward to findByHref on the internal DataService`, () => { + service.findByHref(href, false, false, ...followLinks); + expect(spy).toHaveBeenCalledWith(href, false, false, ...followLinks); + }); - describe(`when useCachedVersionIfAvailable is omitted`, () => { - it(`should call findByHref on the internal DataService with useCachedVersionIfAvailable = true`, () => { - service.findByHref(href); - expect(spy).toHaveBeenCalledWith(jasmine.anything(), true, jasmine.anything()); - }); - }); - - describe(`when reRequestOnStale is omitted`, () => { - it(`should call findByHref on the internal DataService with reRequestOnStale = true`, () => { - service.findByHref(href); - expect(spy).toHaveBeenCalledWith(jasmine.anything(), jasmine.anything(), true); - }); + describe(`when useCachedVersionIfAvailable is omitted`, () => { + it(`should call findByHref on the internal DataService with useCachedVersionIfAvailable = true`, () => { + service.findByHref(href); + expect(spy).toHaveBeenCalledWith(jasmine.anything(), true, jasmine.anything()); }); }); - describe(`findListByHref`, () => { - beforeEach(() => { - spy = spyOn((service as any).dataService, 'findListByHref').and.returnValue(createSuccessfulRemoteDataObject$(null)); - }); - - it(`should delegate to findListByHref on the internal DataService`, () => { - service.findListByHref(href, findListOptions, false, false, ...followLinks); - expect(spy).toHaveBeenCalledWith(href, findListOptions, false, false, ...followLinks); - }); - - describe(`when findListOptions is omitted`, () => { - it(`should call findListByHref on the internal DataService with findListOptions = {}`, () => { - service.findListByHref(href); - expect(spy).toHaveBeenCalledWith(jasmine.anything(), {}, jasmine.anything(), jasmine.anything()); - }); - }); - - describe(`when useCachedVersionIfAvailable is omitted`, () => { - it(`should call findListByHref on the internal DataService with useCachedVersionIfAvailable = true`, () => { - service.findListByHref(href); - expect(spy).toHaveBeenCalledWith(jasmine.anything(), jasmine.anything(), true, jasmine.anything()); - }); - }); - - describe(`when reRequestOnStale is omitted`, () => { - it(`should call findListByHref on the internal DataService with reRequestOnStale = true`, () => { - service.findListByHref(href); - expect(spy).toHaveBeenCalledWith(jasmine.anything(), jasmine.anything(), jasmine.anything(), true); - }); + describe(`when reRequestOnStale is omitted`, () => { + it(`should call findByHref on the internal DataService with reRequestOnStale = true`, () => { + service.findByHref(href); + expect(spy).toHaveBeenCalledWith(jasmine.anything(), jasmine.anything(), true); }); }); + }); + + describe(`findListByHref`, () => { + beforeEach(() => { + spy = spyOn((service as any).dataService, 'findListByHref').and.returnValue(createSuccessfulRemoteDataObject$(null)); + }); + + it(`should delegate to findListByHref on the internal DataService`, () => { + service.findListByHref(href, findListOptions, false, false, ...followLinks); + expect(spy).toHaveBeenCalledWith(href, findListOptions, false, false, ...followLinks); + }); + + describe(`when findListOptions is omitted`, () => { + it(`should call findListByHref on the internal DataService with findListOptions = {}`, () => { + service.findListByHref(href); + expect(spy).toHaveBeenCalledWith(jasmine.anything(), {}, jasmine.anything(), jasmine.anything()); + }); + }); + + describe(`when useCachedVersionIfAvailable is omitted`, () => { + it(`should call findListByHref on the internal DataService with useCachedVersionIfAvailable = true`, () => { + service.findListByHref(href); + expect(spy).toHaveBeenCalledWith(jasmine.anything(), jasmine.anything(), true, jasmine.anything()); + }); + }); + + describe(`when reRequestOnStale is omitted`, () => { + it(`should call findListByHref on the internal DataService with reRequestOnStale = true`, () => { + service.findListByHref(href); + expect(spy).toHaveBeenCalledWith(jasmine.anything(), jasmine.anything(), jasmine.anything(), true); + }); + }); + }); }); diff --git a/src/app/core/data/object-updates/object-updates.effects.spec.ts b/src/app/core/data/object-updates/object-updates.effects.spec.ts index ffd20a7300..b78e77e06d 100644 --- a/src/app/core/data/object-updates/object-updates.effects.spec.ts +++ b/src/app/core/data/object-updates/object-updates.effects.spec.ts @@ -85,8 +85,8 @@ describe('ObjectUpdatesEffects', () => { updatesEffects.removeAfterDiscardOrReinstateOnUndo$.pipe( filter(((action) => hasValue(action)))) .subscribe((t) => { - expect(t).toEqual(removeAction); - } + expect(t).toEqual(removeAction); + } ) ; }); @@ -101,8 +101,8 @@ describe('ObjectUpdatesEffects', () => { actions = hot('a', { a: new DiscardObjectUpdatesAction(testURL, infoNotification) }); actions = hot('b', { b: new ReinstateObjectUpdatesAction(testURL) }); updatesEffects.removeAfterDiscardOrReinstateOnUndo$.subscribe((t) => { - expect(t).toEqual(new NoOpAction()); - } + expect(t).toEqual(new NoOpAction()); + } ); }); }); diff --git a/src/app/core/data/object-updates/object-updates.effects.ts b/src/app/core/data/object-updates/object-updates.effects.ts index 1dfdc95f23..5d5b032c56 100644 --- a/src/app/core/data/object-updates/object-updates.effects.ts +++ b/src/app/core/data/object-updates/object-updates.effects.ts @@ -52,7 +52,7 @@ export class ObjectUpdatesEffects { /** * Effect that makes sure all last fired ObjectUpdatesActions are stored in the map of this service, with the url as their key */ - mapLastActions$ = createEffect(() => this.actions$ + mapLastActions$ = createEffect(() => this.actions$ .pipe( ofType(...Object.values(ObjectUpdatesActionTypes)), map((action: ObjectUpdatesAction) => { @@ -69,16 +69,16 @@ export class ObjectUpdatesEffects { /** * Effect that makes sure all last fired NotificationActions are stored in the notification map of this service, with the id as their key */ - mapLastNotificationActions$ = createEffect(() => this.actions$ + mapLastNotificationActions$ = createEffect(() => this.actions$ .pipe( ofType(...Object.values(NotificationsActionTypes)), map((action: RemoveNotificationAction) => { - const id: string = action.payload.id || action.payload || this.allIdentifier; - if (hasNoValue(this.notificationActionMap$[id])) { - this.notificationActionMap$[id] = new Subject(); - } - this.notificationActionMap$[id].next(action); + const id: string = action.payload.id || action.payload || this.allIdentifier; + if (hasNoValue(this.notificationActionMap$[id])) { + this.notificationActionMap$[id] = new Subject(); } + this.notificationActionMap$[id].next(action); + } ) ), { dispatch: false }); @@ -88,51 +88,51 @@ export class ObjectUpdatesEffects { * When a REINSTATE action is fired during the timeout, a NO_ACTION action will be returned * When any other ObjectUpdatesAction is fired during the timeout, a RemoteObjectUpdatesAction will be returned */ - removeAfterDiscardOrReinstateOnUndo$ = createEffect(() => this.actions$ + removeAfterDiscardOrReinstateOnUndo$ = createEffect(() => this.actions$ .pipe( ofType(ObjectUpdatesActionTypes.DISCARD), switchMap((action: DiscardObjectUpdatesAction) => { - const url: string = action.payload.url; - const notification: INotification = action.payload.notification; - const timeOut = notification.options.timeOut; + const url: string = action.payload.url; + const notification: INotification = action.payload.notification; + const timeOut = notification.options.timeOut; - let removeAction: Action = new RemoveObjectUpdatesAction(action.payload.url); - if (action.payload.discardAll) { - removeAction = new RemoveAllObjectUpdatesAction(); - } - - return observableRace( - // Either wait for the delay and perform a remove action - observableOf(removeAction).pipe(delay(timeOut)), - // Or wait for a a user action - this.actionMap$[url].pipe( - take(1), - tap(() => { - this.notificationsService.remove(notification); - }), - map((updateAction: ObjectUpdatesAction) => { - if (updateAction.type === ObjectUpdatesActionTypes.REINSTATE) { - // If someone reinstated, do nothing, just let the reinstating happen - return new NoOpAction(); - } - // If someone performed another action, assume the user does not want to reinstate and remove all changes - return removeAction; - }) - ), - this.notificationActionMap$[notification.id].pipe( - filter((notificationsAction: NotificationsActions) => notificationsAction.type === NotificationsActionTypes.REMOVE_NOTIFICATION), - map(() => { - return removeAction; - }) - ), - this.notificationActionMap$[this.allIdentifier].pipe( - filter((notificationsAction: NotificationsActions) => notificationsAction.type === NotificationsActionTypes.REMOVE_ALL_NOTIFICATIONS), - map(() => { - return removeAction; - }) - ) - ); + let removeAction: Action = new RemoveObjectUpdatesAction(action.payload.url); + if (action.payload.discardAll) { + removeAction = new RemoveAllObjectUpdatesAction(); } + + return observableRace( + // Either wait for the delay and perform a remove action + observableOf(removeAction).pipe(delay(timeOut)), + // Or wait for a a user action + this.actionMap$[url].pipe( + take(1), + tap(() => { + this.notificationsService.remove(notification); + }), + map((updateAction: ObjectUpdatesAction) => { + if (updateAction.type === ObjectUpdatesActionTypes.REINSTATE) { + // If someone reinstated, do nothing, just let the reinstating happen + return new NoOpAction(); + } + // If someone performed another action, assume the user does not want to reinstate and remove all changes + return removeAction; + }) + ), + this.notificationActionMap$[notification.id].pipe( + filter((notificationsAction: NotificationsActions) => notificationsAction.type === NotificationsActionTypes.REMOVE_NOTIFICATION), + map(() => { + return removeAction; + }) + ), + this.notificationActionMap$[this.allIdentifier].pipe( + filter((notificationsAction: NotificationsActions) => notificationsAction.type === NotificationsActionTypes.REMOVE_ALL_NOTIFICATIONS), + map(() => { + return removeAction; + }) + ) + ); + } ) )); diff --git a/src/app/core/data/object-updates/object-updates.service.ts b/src/app/core/data/object-updates/object-updates.service.ts index 2fb6d47d31..21d5adb2d4 100644 --- a/src/app/core/data/object-updates/object-updates.service.ts +++ b/src/app/core/data/object-updates/object-updates.service.ts @@ -139,16 +139,16 @@ export class ObjectUpdatesService { return objectUpdates.pipe( hasValueOperator(), map((objectEntry) => { - const fieldUpdates: FieldUpdates = {}; - for (const object of initialFields) { - let fieldUpdate = objectEntry.fieldUpdates[object.uuid]; - if (isEmpty(fieldUpdate)) { - fieldUpdate = { field: object, changeType: undefined }; + const fieldUpdates: FieldUpdates = {}; + for (const object of initialFields) { + let fieldUpdate = objectEntry.fieldUpdates[object.uuid]; + if (isEmpty(fieldUpdate)) { + fieldUpdate = { field: object, changeType: undefined }; + } + fieldUpdates[object.uuid] = fieldUpdate; } - fieldUpdates[object.uuid] = fieldUpdate; - } - return fieldUpdates; - })); + return fieldUpdates; + })); } /** @@ -234,7 +234,7 @@ export class ObjectUpdatesService { .pipe( select(virtualMetadataSourceSelector(url, relationship)), map((virtualMetadataSource) => virtualMetadataSource && virtualMetadataSource[item]), - ); + ); } /** diff --git a/src/app/core/data/paginated-list.model.ts b/src/app/core/data/paginated-list.model.ts index 415bfe234e..f1714f638f 100644 --- a/src/app/core/data/paginated-list.model.ts +++ b/src/app/core/data/paginated-list.model.ts @@ -64,13 +64,13 @@ export class PaginatedList extends CacheableObject { * The type of the list */ @excludeFromEquals - type = PAGINATED_LIST; + type = PAGINATED_LIST; /** * The type of objects in the list */ @autoserialize - objectType?: ResourceType; + objectType?: ResourceType; /** * The list of objects that represents the current page @@ -81,13 +81,13 @@ export class PaginatedList extends CacheableObject { * the {@link PageInfo} object */ @autoserialize - pageInfo?: PageInfo; + pageInfo?: PageInfo; /** * The {@link HALLink}s for this PaginatedList */ @deserialize - _links: { + _links: { self: HALLink; page: HALLink[]; first?: HALLink; diff --git a/src/app/core/data/primary-bitstream.service.ts b/src/app/core/data/primary-bitstream.service.ts index 488cb5d22e..850f6de02a 100644 --- a/src/app/core/data/primary-bitstream.service.ts +++ b/src/app/core/data/primary-bitstream.service.ts @@ -64,7 +64,7 @@ export class PrimaryBitstreamService { endpointURL, primaryBitstreamSelfLink, this.getHttpOptions() - ); + ); this.requestService.send(request); diff --git a/src/app/core/data/relationship-data.service.spec.ts b/src/app/core/data/relationship-data.service.spec.ts index 4432d5213a..56f3ab95bb 100644 --- a/src/app/core/data/relationship-data.service.spec.ts +++ b/src/app/core/data/relationship-data.service.spec.ts @@ -264,7 +264,7 @@ describe('RelationshipDataService', () => { authority: 'virtual::related-creator', place: 3, }), - Object.assign(new MetadataValue(), { + Object.assign(new MetadataValue(), { language: null, value: 'Related Creator with authority - unauthorized', authority: 'virtual::related-creator-unauthorized', diff --git a/src/app/core/data/relationship-data.service.ts b/src/app/core/data/relationship-data.service.ts index 29198c4878..bf5cd0f192 100644 --- a/src/app/core/data/relationship-data.service.ts +++ b/src/app/core/data/relationship-data.service.ts @@ -169,7 +169,7 @@ export class RelationshipDataService extends IdentifiableDataService observableCombineLatest( rel.leftItem.pipe(getFirstSucceededRemoteData(), getRemoteDataPayload()), rel.rightItem.pipe(getFirstSucceededRemoteData(), getRemoteDataPayload()) - ) + ) ), take(1) ).subscribe(([item1, item2]) => { @@ -237,7 +237,7 @@ export class RelationshipDataService extends IdentifiableDataService>) => relationshipListRD.payload.page), - mergeMap((relationship: Relationship) => { - return observableCombineLatest([ - this.itemService.findByHref(relationship._links.leftItem.href).pipe(compareItemsByUUID(item2)), - this.itemService.findByHref(relationship._links.rightItem.href).pipe(compareItemsByUUID(item2)) - ]).pipe( - map(([isLeftItem, isRightItem]) => isLeftItem || isRightItem), - map((isMatch) => isMatch ? relationship : undefined) - ); - }), - filter((relationship) => hasValue(relationship)), - take(1) - ); + getFirstSucceededRemoteData(), + // the mergemap below will emit all elements of the list as separate events + mergeMap((relationshipListRD: RemoteData>) => relationshipListRD.payload.page), + mergeMap((relationship: Relationship) => { + return observableCombineLatest([ + this.itemService.findByHref(relationship._links.leftItem.href).pipe(compareItemsByUUID(item2)), + this.itemService.findByHref(relationship._links.rightItem.href).pipe(compareItemsByUUID(item2)) + ]).pipe( + map(([isLeftItem, isRightItem]) => isLeftItem || isRightItem), + map((isMatch) => isMatch ? relationship : undefined) + ); + }), + filter((relationship) => hasValue(relationship)), + take(1) + ); } /** @@ -494,31 +494,31 @@ export class RelationshipDataService extends IdentifiableDataService>> { const searchParams = [ - { - fieldName: 'typeId', - fieldValue: typeId - }, - { - fieldName: 'focusItem', - fieldValue: itemUuid - }, - { - fieldName: 'relationshipLabel', - fieldValue: relationshipLabel - }, - { - fieldName: 'size', - fieldValue: arrayOfItemIds.length - }, - { - fieldName: 'embed', - fieldValue: 'leftItem' - }, - { - fieldName: 'embed', - fieldValue: 'rightItem' - }, - ]; + { + fieldName: 'typeId', + fieldValue: typeId + }, + { + fieldName: 'focusItem', + fieldValue: itemUuid + }, + { + fieldName: 'relationshipLabel', + fieldValue: relationshipLabel + }, + { + fieldName: 'size', + fieldValue: arrayOfItemIds.length + }, + { + fieldName: 'embed', + fieldValue: 'leftItem' + }, + { + fieldName: 'embed', + fieldValue: 'rightItem' + }, + ]; arrayOfItemIds.forEach( (itemId) => { searchParams.push( diff --git a/src/app/core/data/relationship-type-data.service.ts b/src/app/core/data/relationship-type-data.service.ts index 3020e52d47..9a67b28097 100644 --- a/src/app/core/data/relationship-type-data.service.ts +++ b/src/app/core/data/relationship-type-data.service.ts @@ -62,33 +62,33 @@ export class RelationshipTypeDataService extends BaseDataService { // Retrieve all relationship types from the server in a single page return this.findAllData.findAll({ currentPage: 1, elementsPerPage: 9999 }, true, true, followLink('leftType'), followLink('rightType')) - .pipe( - getFirstSucceededRemoteData(), - // Emit each type in the page array separately - switchMap((typeListRD: RemoteData>) => typeListRD.payload.page), - // Check each type individually, to see if it matches the provided types - mergeMap((relationshipType: RelationshipType) => { - if (relationshipType.leftwardType === relationshipTypeLabel) { - return this.checkType(relationshipType, firstItemType, secondItemType); - } else if (relationshipType.rightwardType === relationshipTypeLabel) { - return this.checkType(relationshipType, secondItemType, firstItemType); - } else { - return [null]; - } - }), - // Wait for all types to be checked and emit once, with the results combined back into an - // array - toArray(), - // Look for a match in the array and emit it if found, or null if one isn't found - map((types: RelationshipType[]) => { - const match = types.find((type: RelationshipType) => hasValue(type)); - if (hasValue(match)) { - return match; - } else { - return null; - } - }), - ); + .pipe( + getFirstSucceededRemoteData(), + // Emit each type in the page array separately + switchMap((typeListRD: RemoteData>) => typeListRD.payload.page), + // Check each type individually, to see if it matches the provided types + mergeMap((relationshipType: RelationshipType) => { + if (relationshipType.leftwardType === relationshipTypeLabel) { + return this.checkType(relationshipType, firstItemType, secondItemType); + } else if (relationshipType.rightwardType === relationshipTypeLabel) { + return this.checkType(relationshipType, secondItemType, firstItemType); + } else { + return [null]; + } + }), + // Wait for all types to be checked and emit once, with the results combined back into an + // array + toArray(), + // Look for a match in the array and emit it if found, or null if one isn't found + map((types: RelationshipType[]) => { + const match = types.find((type: RelationshipType) => hasValue(type)); + if (hasValue(match)) { + return match; + } else { + return null; + } + }), + ); } /** diff --git a/src/app/core/data/request-entry.model.ts b/src/app/core/data/request-entry.model.ts index 1555c99ed4..9448f9cb8f 100644 --- a/src/app/core/data/request-entry.model.ts +++ b/src/app/core/data/request-entry.model.ts @@ -6,8 +6,8 @@ import { ResponseState } from './response-state.model'; * An entry for a request in the NgRx store */ export class RequestEntry { - request: RestRequestWithResponseParser; - state: RequestEntryState; - response: ResponseState; - lastUpdated: number; + request: RestRequestWithResponseParser; + state: RequestEntryState; + response: ResponseState; + lastUpdated: number; } diff --git a/src/app/core/data/request.effects.ts b/src/app/core/data/request.effects.ts index 889d909bfa..8b3f78c82c 100644 --- a/src/app/core/data/request.effects.ts +++ b/src/app/core/data/request.effects.ts @@ -25,7 +25,7 @@ import { RequestEntry } from './request-entry.model'; @Injectable() export class RequestEffects { - execute = createEffect(() => this.actions$.pipe( + execute = createEffect(() => this.actions$.pipe( ofType(RequestActionTypes.EXECUTE), mergeMap((action: RequestExecuteAction) => { return this.requestService.getByUUID(action.payload).pipe( @@ -64,7 +64,7 @@ export class RequestEffects { * This assumes that the server cached everything a negligible * time ago, and will likely need to be revisited later */ - fixTimestampsOnRehydrate = createEffect(() => this.actions$ + fixTimestampsOnRehydrate = createEffect(() => this.actions$ .pipe(ofType(StoreActionTypes.REHYDRATE), map(() => new ResetResponseTimestampsAction(new Date().getTime())) )); diff --git a/src/app/core/data/request.service.ts b/src/app/core/data/request.service.ts index 1f6680203e..2c10c4e4f5 100644 --- a/src/app/core/data/request.service.ts +++ b/src/app/core/data/request.service.ts @@ -188,14 +188,14 @@ export class RequestService { private fixRequestHeaders() { return (source: Observable): Observable => { return source.pipe(map((entry: RequestEntry) => { - // Headers break after being retrieved from the store (because of lazy initialization) - // Combining them with a new object fixes this issue - if (hasValue(entry) && hasValue(entry.request) && hasValue(entry.request.options) && hasValue(entry.request.options.headers)) { - entry = cloneDeep(entry); - entry.request.options.headers = Object.assign(new HttpHeaders(), entry.request.options.headers); - } - return entry; - }) + // Headers break after being retrieved from the store (because of lazy initialization) + // Combining them with a new object fixes this issue + if (hasValue(entry) && hasValue(entry.request) && hasValue(entry.request.options) && hasValue(entry.request.options.headers)) { + entry = cloneDeep(entry); + entry.request.options.headers = Object.assign(new HttpHeaders(), entry.request.options.headers); + } + return entry; + }) ); }; } @@ -331,7 +331,7 @@ export class RequestService { map((request: RequestEntry) => isStale(request.state)), filter((stale: boolean) => stale), take(1), - ); + ); } /** diff --git a/src/app/core/data/response-state.model.ts b/src/app/core/data/response-state.model.ts index 97203fcdd5..1f7863e9c8 100644 --- a/src/app/core/data/response-state.model.ts +++ b/src/app/core/data/response-state.model.ts @@ -5,9 +5,9 @@ import { UnCacheableObject } from '../shared/uncacheable-object.model'; * The response substate in the NgRx store */ export class ResponseState { - timeCompleted: number; - statusCode: number; - errorMessage?: string; - payloadLink?: HALLink; - unCacheableObject?: UnCacheableObject; + timeCompleted: number; + statusCode: number; + errorMessage?: string; + payloadLink?: HALLink; + unCacheableObject?: UnCacheableObject; } diff --git a/src/app/core/data/rest-request.model.ts b/src/app/core/data/rest-request.model.ts index 05b583639b..1009b1bf01 100644 --- a/src/app/core/data/rest-request.model.ts +++ b/src/app/core/data/rest-request.model.ts @@ -6,15 +6,15 @@ import { HttpOptions } from '../dspace-rest/dspace-rest.service'; * A request to the DSpace REST API */ export abstract class RestRequest { - public responseMsToLive = environment.cache.msToLive.default; - public isMultipart = false; + public responseMsToLive = environment.cache.msToLive.default; + public isMultipart = false; - constructor( + constructor( public uuid: string, public href: string, public method: RestRequestMethod = RestRequestMethod.GET, public body?: any, public options?: HttpOptions, - ) { - } + ) { + } } diff --git a/src/app/core/data/root.model.ts b/src/app/core/data/root.model.ts index a2d2518dde..2bba5f2043 100644 --- a/src/app/core/data/root.model.ts +++ b/src/app/core/data/root.model.ts @@ -18,37 +18,37 @@ export class Root implements CacheableObject { */ @excludeFromEquals @autoserialize - type: ResourceType; + type: ResourceType; /** * The url for the dspace UI */ @autoserialize - dspaceUI: string; + dspaceUI: string; /** * The repository Name */ @autoserialize - dspaceName: string; + dspaceName: string; /** * The url for the rest api */ @autoserialize - dspaceServer: string; + dspaceServer: string; /** * The current DSpace version */ @autoserialize - dspaceVersion: string; + dspaceVersion: string; /** * The {@link HALLink}s for the root object */ @deserialize - _links: { + _links: { self: HALLink; [k: string]: HALLink | HALLink[]; }; diff --git a/src/app/core/dspace-rest/dspace.serializer.spec.ts b/src/app/core/dspace-rest/dspace.serializer.spec.ts index 331254c502..5bca2c9f1f 100644 --- a/src/app/core/dspace-rest/dspace.serializer.spec.ts +++ b/src/app/core/dspace-rest/dspace.serializer.spec.ts @@ -5,13 +5,13 @@ import { DSpaceSerializer } from './dspace.serializer'; class TestModel implements HALResource { @autoserialize - id: string; + id: string; @autoserialize - name: string; + name: string; @deserialize - _links: { + _links: { self: HALLink; parents: HALLink; }; diff --git a/src/app/core/eperson/models/eperson-dto.model.ts b/src/app/core/eperson/models/eperson-dto.model.ts index 0e79902196..81bc5b9a31 100644 --- a/src/app/core/eperson/models/eperson-dto.model.ts +++ b/src/app/core/eperson/models/eperson-dto.model.ts @@ -5,17 +5,17 @@ import { EPerson } from './eperson.model'; */ export class EpersonDtoModel { - /** + /** * The EPerson linked to this object */ - public eperson: EPerson; - /** + public eperson: EPerson; + /** * Whether or not the linked EPerson is able to be deleted */ - public ableToDelete: boolean; - /** + public ableToDelete: boolean; + /** * Whether or not this EPerson is member of group on page it is being used on */ - public memberOfGroup: boolean; + public memberOfGroup: boolean; } diff --git a/src/app/core/eperson/models/group.model.ts b/src/app/core/eperson/models/group.model.ts index f147cc53a6..b21322283b 100644 --- a/src/app/core/eperson/models/group.model.ts +++ b/src/app/core/eperson/models/group.model.ts @@ -40,7 +40,7 @@ export class Group extends DSpaceObject { * The {@link HALLink}s for this Group */ @deserialize - _links: { + _links: { self: HALLink; subgroups: HALLink; epersons: HALLink; diff --git a/src/app/core/index/index.effects.ts b/src/app/core/index/index.effects.ts index 18d639023f..4c9335ee54 100644 --- a/src/app/core/index/index.effects.ts +++ b/src/app/core/index/index.effects.ts @@ -24,7 +24,7 @@ import { CoreState } from '../core-state.model'; @Injectable() export class UUIDIndexEffects { - addObject$ = createEffect(() => this.actions$ + addObject$ = createEffect(() => this.actions$ .pipe( ofType(ObjectCacheActionTypes.ADD), filter((action: AddToObjectCacheAction) => hasValue(action.payload.objectToCache.uuid)), @@ -41,7 +41,7 @@ export class UUIDIndexEffects { * Adds an alternative link to an object to the ALTERNATIVE_OBJECT_LINK index * When the self link of the objectToCache is not the same as the alternativeLink */ - addAlternativeObjectLink$ = createEffect(() => this.actions$ + addAlternativeObjectLink$ = createEffect(() => this.actions$ .pipe( ofType(ObjectCacheActionTypes.ADD), map((action: AddToObjectCacheAction) => { @@ -59,7 +59,7 @@ export class UUIDIndexEffects { }) )); - removeObject$ = createEffect(() => this.actions$ + removeObject$ = createEffect(() => this.actions$ .pipe( ofType(ObjectCacheActionTypes.REMOVE), map((action: RemoveFromObjectCacheAction) => { @@ -70,18 +70,18 @@ export class UUIDIndexEffects { }) )); - addRequest$ = createEffect(() => this.actions$ + addRequest$ = createEffect(() => this.actions$ .pipe( ofType(RequestActionTypes.CONFIGURE), filter((action: RequestConfigureAction) => action.payload.method === RestRequestMethod.GET), switchMap((action: RequestConfigureAction) => { const href = getUrlWithoutEmbedParams(action.payload.href); return this.store.pipe( - select(uuidFromHrefSelector(href)), - take(1), - map((uuid: string) => [action, uuid]) - ); - } + select(uuidFromHrefSelector(href)), + take(1), + map((uuid: string) => [action, uuid]) + ); + } ), switchMap(([action, uuid]: [RequestConfigureAction, string]) => { let actions = []; diff --git a/src/app/core/json-patch/json-patch-operations.effects.ts b/src/app/core/json-patch/json-patch-operations.effects.ts index 3acfcba910..c6decf2110 100644 --- a/src/app/core/json-patch/json-patch-operations.effects.ts +++ b/src/app/core/json-patch/json-patch-operations.effects.ts @@ -17,7 +17,7 @@ export class JsonPatchOperationsEffects { /** * Dispatches a FlushPatchOperationsAction for every dispatched CommitPatchOperationsAction */ - commit$ = createEffect(() => this.actions$.pipe( + commit$ = createEffect(() => this.actions$.pipe( ofType(JsonPatchOperationsActionTypes.COMMIT_JSON_PATCH_OPERATIONS), map((action: CommitPatchOperationsAction) => { return new FlushPatchOperationsAction(action.payload.resourceType, action.payload.resourceId); diff --git a/src/app/core/json-patch/json-patch-operations.service.ts b/src/app/core/json-patch/json-patch-operations.service.ts index 1dfbd404cc..ccdc0ba7a2 100644 --- a/src/app/core/json-patch/json-patch-operations.service.ts +++ b/src/app/core/json-patch/json-patch-operations.service.ts @@ -100,7 +100,7 @@ export abstract class JsonPatchOperationsService { // TODO to enabled again when https://github.com/DSpace/dspace-angular/issues/739 will be resolved const epersonLang$: Observable = observableOf([]); -/* if (isAuthenticated && isLoaded) { + /* if (isAuthenticated && isLoaded) { epersonLang$ = this.authService.getAuthenticatedUserFromStore().pipe( take(1), map((eperson) => { @@ -176,11 +176,11 @@ export class LocaleService { divisor = 1; } languages.forEach( (lang) => { - let value = lang + ';q='; - let quality = (v - idx++) / v; - quality = ((languages.length > 10) ? quality.toFixed(2) : quality) as number; - value += quality / divisor; - langWithPrior.push(value); + let value = lang + ';q='; + let quality = (v - idx++) / v; + quality = ((languages.length > 10) ? quality.toFixed(2) : quality) as number; + value += quality / divisor; + langWithPrior.push(value); }); return langWithPrior; } diff --git a/src/app/core/metadata/metadata-field.model.ts b/src/app/core/metadata/metadata-field.model.ts index e9fd0fd1cf..3ed6586f98 100644 --- a/src/app/core/metadata/metadata-field.model.ts +++ b/src/app/core/metadata/metadata-field.model.ts @@ -25,37 +25,37 @@ export class MetadataField extends ListableObject implements HALResource { */ @excludeFromEquals @autoserialize - type: ResourceType; + type: ResourceType; /** * The identifier of this metadata field */ @autoserialize - id: number; + id: number; /** * The element of this metadata field */ @autoserialize - element: string; + element: string; /** * The qualifier of this metadata field */ @autoserialize - qualifier: string; + qualifier: string; /** * The scope note of this metadata field */ @autoserialize - scopeNote: string; + scopeNote: string; /** * The {@link HALLink}s for this MetadataField */ @deserialize - _links: { + _links: { self: HALLink, schema: HALLink }; @@ -65,7 +65,7 @@ export class MetadataField extends ListableObject implements HALResource { * Will be undefined unless the schema {@link HALLink} has been resolved. */ @link(METADATA_SCHEMA) - schema?: Observable>; + schema?: Observable>; /** * Method to print this metadata field as a string without the schema diff --git a/src/app/core/metadata/metadata-schema.model.ts b/src/app/core/metadata/metadata-schema.model.ts index 252113b3e4..063ba020ca 100644 --- a/src/app/core/metadata/metadata-schema.model.ts +++ b/src/app/core/metadata/metadata-schema.model.ts @@ -19,29 +19,29 @@ export class MetadataSchema extends ListableObject implements HALResource { * The unique identifier for this metadata schema */ @autoserialize - id: number; + id: number; /** * The object type */ @excludeFromEquals @autoserialize - type: ResourceType; + type: ResourceType; /** * A unique prefix that defines this schema */ @autoserialize - prefix: string; + prefix: string; /** * The namespace of this metadata schema */ @autoserialize - namespace: string; + namespace: string; @deserialize - _links: { + _links: { self: HALLink, }; diff --git a/src/app/core/metadata/metadata.service.ts b/src/app/core/metadata/metadata.service.ts index 204c925e6b..7efdee34e9 100644 --- a/src/app/core/metadata/metadata.service.ts +++ b/src/app/core/metadata/metadata.service.ts @@ -308,11 +308,11 @@ export class MetadataService { true, followLink('primaryBitstream'), followLink('bitstreams', { - findListOptions: { - // limit the number of bitstreams used to find the citation pdf url to the number - // shown by default on an item page - elementsPerPage: this.appConfig.item.bitstream.pageSize - } + findListOptions: { + // limit the number of bitstreams used to find the citation pdf url to the number + // shown by default on an item page + elementsPerPage: this.appConfig.item.bitstream.pageSize + } }, followLink('format')), ).pipe( getFirstSucceededRemoteDataPayload(), diff --git a/src/app/core/orcid/model/orcid-history.model.ts b/src/app/core/orcid/model/orcid-history.model.ts index ef8f30e0a3..6389312ed8 100644 --- a/src/app/core/orcid/model/orcid-history.model.ts +++ b/src/app/core/orcid/model/orcid-history.model.ts @@ -19,49 +19,49 @@ export class OrcidHistory extends CacheableObject { */ @excludeFromEquals @autoserialize - type: ResourceType; + type: ResourceType; /** * The identifier of this Orcid History record */ @autoserialize - id: number; + id: number; /** * The name of the related entity */ @autoserialize - entityName: string; + entityName: string; /** * The identifier of the profileItem of this Orcid History record. */ @autoserialize - profileItemId: string; + profileItemId: string; /** * The identifier of the entity related to this Orcid History record. */ @autoserialize - entityId: string; + entityId: string; /** * The type of the entity related to this Orcid History record. */ @autoserialize - entityType: string; + entityType: string; /** * The response status coming from ORCID api. */ @autoserialize - status: number; + status: number; /** * The putCode assigned by ORCID to the entity. */ @autoserialize - putCode: string; + putCode: string; /** * The last send attempt timestamp. @@ -82,7 +82,7 @@ export class OrcidHistory extends CacheableObject { * The {@link HALLink}s for this Orcid History record */ @deserialize - _links: { + _links: { self: HALLink, }; diff --git a/src/app/core/orcid/model/orcid-queue.model.ts b/src/app/core/orcid/model/orcid-queue.model.ts index 2a1c3f1d82..cce1c2e7f2 100644 --- a/src/app/core/orcid/model/orcid-queue.model.ts +++ b/src/app/core/orcid/model/orcid-queue.model.ts @@ -19,49 +19,49 @@ export class OrcidQueue extends CacheableObject { */ @excludeFromEquals @autoserialize - type: ResourceType; + type: ResourceType; /** * The identifier of this Orcid Queue record */ @autoserialize - id: number; + id: number; /** * The record description. */ @autoserialize - description: string; + description: string; /** * The identifier of the profileItem of this Orcid Queue record. */ @autoserialize - profileItemId: string; + profileItemId: string; /** * The identifier of the entity related to this Orcid Queue record. */ @autoserialize - entityId: string; + entityId: string; /** * The type of this Orcid Queue record. */ @autoserialize - recordType: string; + recordType: string; /** * The operation related to this Orcid Queue record. */ @autoserialize - operation: string; + operation: string; /** * The {@link HALLink}s for this Orcid Queue record */ @deserialize - _links: { + _links: { self: HALLink, }; diff --git a/src/app/core/orcid/orcid-queue-data.service.ts b/src/app/core/orcid/orcid-queue-data.service.ts index 77149c4bf8..7db55461c7 100644 --- a/src/app/core/orcid/orcid-queue-data.service.ts +++ b/src/app/core/orcid/orcid-queue-data.service.ts @@ -50,12 +50,12 @@ export class OrcidQueueDataService extends IdentifiableDataService { */ searchByProfileItemId(itemId: string, paginationOptions: PaginationComponentOptions, useCachedVersionIfAvailable = true, reRequestOnStale = true): Observable>> { return this.searchData.searchBy('findByProfileItem', { - searchParams: [new RequestParam('profileItemId', itemId)], - elementsPerPage: paginationOptions.pageSize, - currentPage: paginationOptions.currentPage, - }, - useCachedVersionIfAvailable, - reRequestOnStale, + searchParams: [new RequestParam('profileItemId', itemId)], + elementsPerPage: paginationOptions.pageSize, + currentPage: paginationOptions.currentPage, + }, + useCachedVersionIfAvailable, + reRequestOnStale, ); } diff --git a/src/app/core/pagination/pagination.service.ts b/src/app/core/pagination/pagination.service.ts index 90d307ff4f..950d65037c 100644 --- a/src/app/core/pagination/pagination.service.ts +++ b/src/app/core/pagination/pagination.service.ts @@ -71,10 +71,10 @@ export class PaginationService { const sortDirection$ = this.routeService.getQueryParameterValue(`${paginationId}.sd`); const sortField$ = this.routeService.getQueryParameterValue(`${paginationId}.sf`); return observableCombineLatest([sortDirection$, sortField$]).pipe(map(([sortDirection, sortField]) => { - const field = sortField || defaultSort?.field; - const direction = SortDirection[sortDirection] || defaultSort?.direction; - return new SortOptions(field, direction); - }) + const field = sortField || defaultSort?.field; + const direction = SortDirection[sortDirection] || defaultSort?.direction; + return new SortOptions(field, direction); + }) ); } diff --git a/src/app/core/profile/model/researcher-profile.model.ts b/src/app/core/profile/model/researcher-profile.model.ts index 6c8b19db40..fa4337e6be 100644 --- a/src/app/core/profile/model/researcher-profile.model.ts +++ b/src/app/core/profile/model/researcher-profile.model.ts @@ -24,28 +24,28 @@ export class ResearcherProfile extends CacheableObject { */ @excludeFromEquals @autoserialize - type: ResourceType; + type: ResourceType; /** * The identifier of this Researcher Profile */ @autoserialize - id: string; + id: string; @deserializeAs('id') - uuid: string; + uuid: string; /** * The visibility of this Researcher Profile */ @autoserialize - visible: boolean; + visible: boolean; /** * The {@link HALLink}s for this Researcher Profile */ @deserialize - _links: { + _links: { self: HALLink, item: HALLink, eperson: HALLink @@ -56,6 +56,6 @@ export class ResearcherProfile extends CacheableObject { * Will be undefined unless the item {@link HALLink} has been resolved. */ @link(ITEM) - item?: Observable>; + item?: Observable>; } diff --git a/src/app/core/resource-policy/models/resource-policy.model.ts b/src/app/core/resource-policy/models/resource-policy.model.ts index b0608dfbca..3bbbd36755 100644 --- a/src/app/core/resource-policy/models/resource-policy.model.ts +++ b/src/app/core/resource-policy/models/resource-policy.model.ts @@ -26,50 +26,50 @@ export class ResourcePolicy implements CacheableObject { * The identifier for this Resource Policy */ @autoserialize - id: string; + id: string; /** * The name for this Resource Policy */ @autoserialize - name: string; + name: string; /** * The description for this Resource Policy */ @autoserialize - description: string; + description: string; /** * The classification or this Resource Policy */ @autoserialize - policyType: PolicyType; + policyType: PolicyType; /** * The action that is allowed by this Resource Policy */ @autoserialize - action: ActionType; + action: ActionType; /** * The first day of validity of the policy (format YYYY-MM-DD) */ @autoserialize - startDate: string; + startDate: string; /** * The last day of validity of the policy (format YYYY-MM-DD) */ @autoserialize - endDate: string; + endDate: string; /** * The object type */ @excludeFromEquals @autoserialize - type: ResourceType; + type: ResourceType; /** * The universally unique identifier for this Resource Policy @@ -77,13 +77,13 @@ export class ResourcePolicy implements CacheableObject { * It is based on the ID, so it will be the same for each refresh. */ @deserializeAs(new IDToUUIDSerializer('resource-policy'), 'id') - uuid: string; + uuid: string; /** * The {@link HALLink}s for this ResourcePolicy */ @deserialize - _links: { + _links: { eperson: HALLink, group: HALLink, self: HALLink, @@ -94,12 +94,12 @@ export class ResourcePolicy implements CacheableObject { * Will be undefined unless the version {@link HALLink} has been resolved. */ @link(EPERSON) - eperson?: Observable>; + eperson?: Observable>; /** * The group linked by this resource policy * Will be undefined unless the version {@link HALLink} has been resolved. */ @link(GROUP) - group?: Observable>; + group?: Observable>; } diff --git a/src/app/core/router/router.effects.ts b/src/app/core/router/router.effects.ts index 5df38aa1fc..c63dc84c66 100644 --- a/src/app/core/router/router.effects.ts +++ b/src/app/core/router/router.effects.ts @@ -11,7 +11,7 @@ export class RouterEffects { * Effect that fires a new RouteUpdateAction when then path of route is changed * @type {Observable} */ - routeChange$ = createEffect(() => this.actions$ + routeChange$ = createEffect(() => this.actions$ .pipe( ofType(ROUTER_NAVIGATION), pairwise(), diff --git a/src/app/core/services/link-head.service.spec.ts b/src/app/core/services/link-head.service.spec.ts index 017fe6af03..ff572bb178 100644 --- a/src/app/core/services/link-head.service.spec.ts +++ b/src/app/core/services/link-head.service.spec.ts @@ -6,40 +6,40 @@ import { LinkHeadService } from './link-head.service'; describe('LinkHeadService', () => { - let service: LinkHeadService; + let service: LinkHeadService; - const renderer2: Renderer2 = { - createRenderer: jasmine.createSpy('createRenderer'), - createElement: jasmine.createSpy('createElement'), - setAttribute: jasmine.createSpy('setAttribute'), - appendChild: jasmine.createSpy('appendChild') - } as unknown as Renderer2; + const renderer2: Renderer2 = { + createRenderer: jasmine.createSpy('createRenderer'), + createElement: jasmine.createSpy('createElement'), + setAttribute: jasmine.createSpy('setAttribute'), + appendChild: jasmine.createSpy('appendChild') + } as unknown as Renderer2; - beforeEach(waitForAsync(() => { - return TestBed.configureTestingModule({ - providers: [ - MockProvider(RendererFactory2, { - createRenderer: () => renderer2 - }), - { provide: Document, useExisting: DOCUMENT }, - ] - }); - })); - - beforeEach(() => { - service = new LinkHeadService(TestBed.inject(RendererFactory2), TestBed.inject(DOCUMENT)); + beforeEach(waitForAsync(() => { + return TestBed.configureTestingModule({ + providers: [ + MockProvider(RendererFactory2, { + createRenderer: () => renderer2 + }), + { provide: Document, useExisting: DOCUMENT }, + ] }); + })); - describe('link', () => { - it('should create a link tag', () => { - const link = service.addTag({ - href: 'test', - type: 'application/atom+xml', - rel: 'alternate', - title: 'Sitewide Atom feed' - }); - expect(link).not.toBeUndefined(); - }); + beforeEach(() => { + service = new LinkHeadService(TestBed.inject(RendererFactory2), TestBed.inject(DOCUMENT)); + }); + + describe('link', () => { + it('should create a link tag', () => { + const link = service.addTag({ + href: 'test', + type: 'application/atom+xml', + rel: 'alternate', + title: 'Sitewide Atom feed' + }); + expect(link).not.toBeUndefined(); }); + }); }); diff --git a/src/app/core/services/route.effects.ts b/src/app/core/services/route.effects.ts index 2b19761d21..af65a553e1 100644 --- a/src/app/core/services/route.effects.ts +++ b/src/app/core/services/route.effects.ts @@ -11,13 +11,13 @@ export class RouteEffects { * Effect that resets the route state on reroute * @type {Observable} */ - routeChange$ = createEffect(() => this.actions$ + routeChange$ = createEffect(() => this.actions$ .pipe( ofType(RouterActionTypes.ROUTE_UPDATE), map(() => new ResetRouteStateAction()), )); - afterResetChange$ = createEffect(() => this.actions$ + afterResetChange$ = createEffect(() => this.actions$ .pipe( ofType(RouteActionTypes.RESET), tap(() => this.service.setCurrentRouteInfo()), diff --git a/src/app/core/shared/authorization.model.ts b/src/app/core/shared/authorization.model.ts index f7bbf78889..2cb195562b 100644 --- a/src/app/core/shared/authorization.model.ts +++ b/src/app/core/shared/authorization.model.ts @@ -23,10 +23,10 @@ export class Authorization extends DSpaceObject { * Unique identifier for this authorization */ @autoserialize - id: string; + id: string; @deserialize - _links: { + _links: { self: HALLink; eperson: HALLink; feature: HALLink; @@ -38,17 +38,17 @@ export class Authorization extends DSpaceObject { * Null if the authorization grants access to anonymous users */ @link(EPERSON) - eperson?: Observable>; + eperson?: Observable>; /** * The Feature enabled by this Authorization */ @link(FEATURE) - feature?: Observable>; + feature?: Observable>; /** * The Object this authorization applies to */ @link(ITEM) - object?: Observable>; + object?: Observable>; } diff --git a/src/app/core/shared/bitstream-format.model.ts b/src/app/core/shared/bitstream-format.model.ts index 9e8dc5e1fe..fd501d2946 100644 --- a/src/app/core/shared/bitstream-format.model.ts +++ b/src/app/core/shared/bitstream-format.model.ts @@ -20,43 +20,43 @@ export class BitstreamFormat implements CacheableObject { */ @excludeFromEquals @autoserialize - type: ResourceType; + type: ResourceType; /** * Short description of this Bitstream Format */ @autoserialize - shortDescription: string; + shortDescription: string; /** * Description of this Bitstream Format */ @autoserialize - description: string; + description: string; /** * String representing the MIME type of this Bitstream Format */ @autoserialize - mimetype: string; + mimetype: string; /** * The level of support the system offers for this Bitstream Format */ @autoserialize - supportLevel: BitstreamFormatSupportLevel; + supportLevel: BitstreamFormatSupportLevel; /** * True if the Bitstream Format is used to store system information, rather than the content of items in the system */ @autoserialize - internal: boolean; + internal: boolean; /** * String representing this Bitstream Format's file extension */ @autoserialize - extensions: string[]; + extensions: string[]; /** * Universally unique identifier for this Bitstream Format @@ -64,7 +64,7 @@ export class BitstreamFormat implements CacheableObject { * It is based on the ID, so it will be the same for each refresh. */ @deserializeAs(new IDToUUIDSerializer('bitstream-format'), 'id') - uuid: string; + uuid: string; /** * Identifier for this Bitstream Format @@ -72,13 +72,13 @@ export class BitstreamFormat implements CacheableObject { * but might not be unique across different object types */ @autoserialize - id: string; + id: string; /** * The {@link HALLink}s for this BitstreamFormat */ @deserialize - _links: { + _links: { self: HALLink; }; } diff --git a/src/app/core/shared/bitstream.model.ts b/src/app/core/shared/bitstream.model.ts index c855325d2d..50a00b74c4 100644 --- a/src/app/core/shared/bitstream.model.ts +++ b/src/app/core/shared/bitstream.model.ts @@ -20,25 +20,25 @@ export class Bitstream extends DSpaceObject implements ChildHALResource { * The size of this bitstream in bytes */ @autoserialize - sizeBytes: number; + sizeBytes: number; /** * The description of this Bitstream */ @autoserialize - description: string; + description: string; /** * The name of the Bundle this Bitstream is part of */ @autoserialize - bundleName: string; + bundleName: string; /** * The {@link HALLink}s for this Bitstream */ @deserialize - _links: { + _links: { self: HALLink; bundle: HALLink; format: HALLink; @@ -51,21 +51,21 @@ export class Bitstream extends DSpaceObject implements ChildHALResource { * Will be undefined unless the thumbnail {@link HALLink} has been resolved. */ @link(BITSTREAM, false, 'thumbnail') - thumbnail?: Observable>; + thumbnail?: Observable>; /** * The BitstreamFormat of this Bitstream * Will be undefined unless the format {@link HALLink} has been resolved. */ @link(BITSTREAM_FORMAT, false, 'format') - format?: Observable>; + format?: Observable>; /** * The owning bundle for this Bitstream * Will be undefined unless the bundle{@link HALLink} has been resolved. */ @link(BUNDLE) - bundle?: Observable>; + bundle?: Observable>; getParentLinkKey(): keyof this['_links'] { return 'format'; diff --git a/src/app/core/shared/browse-definition.model.ts b/src/app/core/shared/browse-definition.model.ts index a5bed53c9f..1e3a15ccaf 100644 --- a/src/app/core/shared/browse-definition.model.ts +++ b/src/app/core/shared/browse-definition.model.ts @@ -7,7 +7,7 @@ import { CacheableObject } from '../cache/cacheable-object.model'; export abstract class BrowseDefinition extends CacheableObject { @autoserialize - id: string; + id: string; /** * Get the render type of the BrowseDefinition model diff --git a/src/app/core/shared/browse-entry.model.ts b/src/app/core/shared/browse-entry.model.ts index d4842e1294..d74808bcf0 100644 --- a/src/app/core/shared/browse-entry.model.ts +++ b/src/app/core/shared/browse-entry.model.ts @@ -20,41 +20,41 @@ export class BrowseEntry extends ListableObject implements TypedObject { */ @excludeFromEquals @autoserialize - type: ResourceType; + type: ResourceType; /** * The authority string of this browse entry */ @autoserialize - authority: string; + authority: string; /** * The value of this browse entry */ @autoserialize - value: string; + value: string; /** * The language of the value of this browse entry */ @autoserializeAs('valueLang') - language: string; + language: string; /** * Thumbnail link used when browsing items with showThumbs config enabled. */ @autoserializeAs('thumbnail') - thumbnail: string; + thumbnail: string; /** * The count of this browse entry */ @excludeFromEquals @autoserialize - count: number; + count: number; @deserialize - _links: { + _links: { self: HALLink; entries: HALLink; thumbnail: HALLink; diff --git a/src/app/core/shared/bundle.model.ts b/src/app/core/shared/bundle.model.ts index 36b7012e47..c78a4d7414 100644 --- a/src/app/core/shared/bundle.model.ts +++ b/src/app/core/shared/bundle.model.ts @@ -22,7 +22,7 @@ export class Bundle extends DSpaceObject { * The {@link HALLink}s for this Bundle */ @deserialize - _links: { + _links: { self: HALLink; primaryBitstream: HALLink; bitstreams: HALLink; @@ -34,19 +34,19 @@ export class Bundle extends DSpaceObject { * Will be undefined unless the primaryBitstream {@link HALLink} has been resolved. */ @link(BITSTREAM) - primaryBitstream?: Observable>; + primaryBitstream?: Observable>; /** * The list of Bitstreams that are direct children of this Bundle * Will be undefined unless the bitstreams {@link HALLink} has been resolved. */ @link(BITSTREAM, true) - bitstreams?: Observable>>; + bitstreams?: Observable>>; - /** + /** * The owning item for this Bundle * Will be undefined unless the Item{@link HALLink} has been resolved. */ @link(ITEM) - item?: Observable>; + item?: Observable>; } diff --git a/src/app/core/shared/collection.model.ts b/src/app/core/shared/collection.model.ts index c97c61eceb..929d971a61 100644 --- a/src/app/core/shared/collection.model.ts +++ b/src/app/core/shared/collection.model.ts @@ -25,13 +25,13 @@ export class Collection extends DSpaceObject implements ChildHALResource, Handle @excludeFromEquals @autoserialize - archivedItemsCount: number; + archivedItemsCount: number; /** * The {@link HALLink}s for this Collection */ @deserialize - _links: { + _links: { license: HALLink; harvester: HALLink; mappedItems: HALLink; @@ -52,28 +52,28 @@ export class Collection extends DSpaceObject implements ChildHALResource, Handle * Will be undefined unless the license {@link HALLink} has been resolved. */ @link(LICENSE) - license?: Observable>; + license?: Observable>; /** * The logo for this Collection * Will be undefined unless the logo {@link HALLink} has been resolved. */ @link(BITSTREAM) - logo?: Observable>; + logo?: Observable>; /** * The default access conditions for this Collection * Will be undefined unless the defaultAccessConditions {@link HALLink} has been resolved. */ @link(RESOURCE_POLICY, true) - defaultAccessConditions?: Observable>>; + defaultAccessConditions?: Observable>>; /** * The Community that is a direct parent of this Collection * Will be undefined unless the parent community HALLink has been resolved. */ @link(COMMUNITY, false) - parentCommunity?: Observable>; + parentCommunity?: Observable>; /** * A string representing the unique handle of this Collection diff --git a/src/app/core/shared/community.model.ts b/src/app/core/shared/community.model.ts index 03b47fb024..6e9ad271a9 100644 --- a/src/app/core/shared/community.model.ts +++ b/src/app/core/shared/community.model.ts @@ -21,13 +21,13 @@ export class Community extends DSpaceObject implements ChildHALResource, HandleO @excludeFromEquals @autoserialize - archivedItemsCount: number; + archivedItemsCount: number; /** * The {@link HALLink}s for this Community */ @deserialize - _links: { + _links: { collections: HALLink; logo: HALLink; subcommunities: HALLink; @@ -41,28 +41,28 @@ export class Community extends DSpaceObject implements ChildHALResource, HandleO * Will be undefined unless the logo {@link HALLink} has been resolved. */ @link(BITSTREAM) - logo?: Observable>; + logo?: Observable>; /** * The list of Collections that are direct children of this Community * Will be undefined unless the collections {@link HALLink} has been resolved. */ @link(COLLECTION, true) - collections?: Observable>>; + collections?: Observable>>; /** * The list of Communities that are direct children of this Community * Will be undefined unless the subcommunities {@link HALLink} has been resolved. */ @link(COMMUNITY, true) - subcommunities?: Observable>>; + subcommunities?: Observable>>; /** * The Community that is a direct parent of this Community * Will be undefined unless the parent community HALLink has been resolved. */ @link(COMMUNITY, false) - parentCommunity?: Observable>; + parentCommunity?: Observable>; /** * A string representing the unique handle of this Community diff --git a/src/app/core/shared/configuration-property.model.ts b/src/app/core/shared/configuration-property.model.ts index 874e80f08d..2cf62684e2 100644 --- a/src/app/core/shared/configuration-property.model.ts +++ b/src/app/core/shared/configuration-property.model.ts @@ -18,31 +18,31 @@ export class ConfigurationProperty implements CacheableObject { */ @excludeFromEquals @autoserialize - type: ResourceType; + type: ResourceType; /** * The uuid of the configuration property * The name is used as id for configuration properties */ @autoserializeAs(String, 'name') - uuid: string; + uuid: string; /** * The name of the configuration property */ @autoserialize - name: string; + name: string; /** * The values of the configuration property */ @autoserialize - values: string[]; + values: string[]; /** * The links of the configuration property */ @deserialize - _links: { self: HALLink }; + _links: { self: HALLink }; } diff --git a/src/app/core/shared/content-source.model.ts b/src/app/core/shared/content-source.model.ts index 7e888f2332..85af216308 100644 --- a/src/app/core/shared/content-source.model.ts +++ b/src/app/core/shared/content-source.model.ts @@ -32,40 +32,40 @@ export class ContentSource extends CacheableObject { * and we need a custom responseparser for ContentSource responses */ @excludeFromEquals - type: ResourceType = CONTENT_SOURCE; + type: ResourceType = CONTENT_SOURCE; /** * Unique identifier, this is necessary to store the ContentSource in FieldUpdates * Because the ContentSource coming from the REST API doesn't have a UUID, we're using the selflink */ @deserializeAs('self') - uuid: string; + uuid: string; /** * OAI Provider / Source */ @autoserializeAs('oai_source') - oaiSource: string; + oaiSource: string; /** * OAI Specific set ID */ @deserializeAs(new ContentSourceSetSerializer(), 'oai_set_id') @serializeAs(new ContentSourceSetSerializer(), 'oai_set_id') - oaiSetId: string; + oaiSetId: string; /** * The ID of the metadata format used */ @autoserializeAs('metadata_config_id') - metadataConfigId: string; + metadataConfigId: string; /** * Type of content being harvested * Defaults to 'NONE', meaning the collection doesn't harvest its content from an external source */ @autoserializeAs('harvest_type') - harvestType = ContentSourceHarvestType.None; + harvestType = ContentSourceHarvestType.None; /** * The available metadata configurations @@ -76,31 +76,31 @@ export class ContentSource extends CacheableObject { * The current harvest status */ @autoserializeAs('harvest_status') - harvestStatus: string; + harvestStatus: string; /** * The last's harvest start time */ @autoserializeAs('harvest_start_time') - harvestStartTime: string; + harvestStartTime: string; /** * When the collection was last harvested */ @autoserializeAs('last_harvested') - lastHarvested: string; + lastHarvested: string; /** * The current harvest message */ @autoserializeAs('harvest_message') - message: string; + message: string; /** * The {@link HALLink}s for this ContentSource */ @deserialize - _links: { + _links: { self: HALLink }; } diff --git a/src/app/core/shared/dspace-object.model.ts b/src/app/core/shared/dspace-object.model.ts index 6f5d45544d..637d7e8125 100644 --- a/src/app/core/shared/dspace-object.model.ts +++ b/src/app/core/shared/dspace-object.model.ts @@ -36,20 +36,20 @@ export class DSpaceObject extends ListableObject implements CacheableObject { */ @excludeFromEquals @autoserializeAs(String, 'uuid') - id: string; + id: string; /** * The universally unique ide ntifier of this DSpaceObject */ @autoserializeAs(String) - uuid: string; + uuid: string; /** * A string representing the kind of DSpaceObject, e.g. community, item, … */ @excludeFromEquals @autoserialize - type: ResourceType; + type: ResourceType; /** * A shorthand to get this DSpaceObject's self link @@ -90,10 +90,10 @@ export class DSpaceObject extends ListableObject implements CacheableObject { */ @excludeFromEquals @autoserializeAs(MetadataMapSerializer) - metadata: MetadataMap; + metadata: MetadataMap; @deserialize - _links: { + _links: { self: HALLink; }; diff --git a/src/app/core/shared/external-source-entry.model.ts b/src/app/core/shared/external-source-entry.model.ts index 39a5df754e..5eb9ae92d8 100644 --- a/src/app/core/shared/external-source-entry.model.ts +++ b/src/app/core/shared/external-source-entry.model.ts @@ -19,44 +19,44 @@ export class ExternalSourceEntry extends ListableObject { * Unique identifier */ @autoserialize - id: string; + id: string; /** * The object type */ @excludeFromEquals @autoserialize - type: ResourceType; + type: ResourceType; /** * The value to display */ @autoserialize - display: string; + display: string; /** * The value to store the entry with */ @autoserialize - value: string; + value: string; /** * The ID of the external source this entry originates from */ @autoserialize - externalSource: string; + externalSource: string; /** * Metadata of the entry */ @autoserializeAs(MetadataMapSerializer) - metadata: MetadataMap; + metadata: MetadataMap; /** * The {@link HALLink}s for this ExternalSourceEntry */ @deserialize - _links: { + _links: { self: HALLink; }; diff --git a/src/app/core/shared/external-source.model.ts b/src/app/core/shared/external-source.model.ts index 6a1a803122..46c8ee1000 100644 --- a/src/app/core/shared/external-source.model.ts +++ b/src/app/core/shared/external-source.model.ts @@ -23,38 +23,38 @@ export class ExternalSource extends CacheableObject { */ @excludeFromEquals @autoserialize - type: ResourceType; + type: ResourceType; /** * Unique identifier */ @autoserialize - id: string; + id: string; /** * The name of this external source */ @autoserialize - name: string; + name: string; /** * Is the source hierarchical? */ @autoserialize - hierarchical: boolean; + hierarchical: boolean; /** * The list of entity types that are compatible with this external source * Will be undefined unless the entityTypes {@link HALLink} has been resolved. */ @link(ITEM_TYPE, true) - entityTypes?: Observable>>; + entityTypes?: Observable>>; /** * The {@link HALLink}s for this ExternalSource */ @deserialize - _links: { + _links: { self: HALLink; entries: HALLink; entityTypes: HALLink; diff --git a/src/app/core/shared/feature.model.ts b/src/app/core/shared/feature.model.ts index 2ba5d8d4e1..07ca4920ad 100644 --- a/src/app/core/shared/feature.model.ts +++ b/src/app/core/shared/feature.model.ts @@ -16,22 +16,22 @@ export class Feature extends DSpaceObject { * Unique identifier for this feature */ @autoserialize - id: string; + id: string; /** * A human readable description of the feature's purpose */ @autoserialize - description: string; + description: string; /** * A list of resource types this feature applies to */ @autoserialize - resourcetypes: string[]; + resourcetypes: string[]; @deserialize - _links: { + _links: { self: HALLink; }; } diff --git a/src/app/core/shared/flat-browse-definition.model.ts b/src/app/core/shared/flat-browse-definition.model.ts index 086fca891b..6e5d09b6ec 100644 --- a/src/app/core/shared/flat-browse-definition.model.ts +++ b/src/app/core/shared/flat-browse-definition.model.ts @@ -18,14 +18,14 @@ export class FlatBrowseDefinition extends NonHierarchicalBrowseDefinition { * The object type */ @excludeFromEquals - type: ResourceType = FLAT_BROWSE_DEFINITION; + type: ResourceType = FLAT_BROWSE_DEFINITION; get self(): string { return this._links.self.href; } @deserialize - _links: { + _links: { self: HALLink; items: HALLink; }; diff --git a/src/app/core/shared/hal-endpoint.service.ts b/src/app/core/shared/hal-endpoint.service.ts index 8b6316a6ce..28d7a700f2 100644 --- a/src/app/core/shared/hal-endpoint.service.ts +++ b/src/app/core/shared/hal-endpoint.service.ts @@ -17,7 +17,7 @@ export class HALEndpointService { constructor( private requestService: RequestService, private rdbService: RemoteDataBuildService -) { + ) { } public getRootHref(): string { diff --git a/src/app/core/shared/hal-resource.model.ts b/src/app/core/shared/hal-resource.model.ts index 6e4fe1f502..92abe6090b 100644 --- a/src/app/core/shared/hal-resource.model.ts +++ b/src/app/core/shared/hal-resource.model.ts @@ -12,7 +12,7 @@ export class HALResource { * The {@link HALLink}s for this {@link HALResource} */ @deserialize - _links: { + _links: { /** * The {@link HALLink} that refers to this {@link HALResource} diff --git a/src/app/core/shared/hierarchical-browse-definition.model.ts b/src/app/core/shared/hierarchical-browse-definition.model.ts index d561fff643..b6592573c7 100644 --- a/src/app/core/shared/hierarchical-browse-definition.model.ts +++ b/src/app/core/shared/hierarchical-browse-definition.model.ts @@ -18,23 +18,23 @@ export class HierarchicalBrowseDefinition extends BrowseDefinition { * The object type */ @excludeFromEquals - type: ResourceType = HIERARCHICAL_BROWSE_DEFINITION; + type: ResourceType = HIERARCHICAL_BROWSE_DEFINITION; @autoserialize - facetType: string; + facetType: string; @autoserialize - vocabulary: string; + vocabulary: string; @autoserializeAs('metadata') - metadataKeys: string[]; + metadataKeys: string[]; get self(): string { return this._links.self.href; } @deserialize - _links: { + _links: { self: HALLink; vocabulary: HALLink; }; diff --git a/src/app/core/shared/item-relationships/item-type.model.ts b/src/app/core/shared/item-relationships/item-type.model.ts index c51c3b9035..6fe4c1f422 100644 --- a/src/app/core/shared/item-relationships/item-type.model.ts +++ b/src/app/core/shared/item-relationships/item-type.model.ts @@ -19,16 +19,16 @@ export class ItemType implements CacheableObject { */ @excludeFromEquals @autoserialize - type: ResourceType; + type: ResourceType; /** * The identifier of this ItemType */ @autoserialize - id: string; + id: string; @autoserialize - label: string; + label: string; /** * The universally unique identifier of this ItemType @@ -36,13 +36,13 @@ export class ItemType implements CacheableObject { * It is based on the ID, so it will be the same for each refresh. */ @deserializeAs(new IDToUUIDSerializer(ItemType.type.value), 'id') - uuid: string; + uuid: string; /** * The {@link HALLink}s for this ItemType */ @deserialize - _links: { + _links: { self: HALLink, }; } diff --git a/src/app/core/shared/item-relationships/relationship-type.model.ts b/src/app/core/shared/item-relationships/relationship-type.model.ts index 73e3a7b47c..51758a208c 100644 --- a/src/app/core/shared/item-relationships/relationship-type.model.ts +++ b/src/app/core/shared/item-relationships/relationship-type.model.ts @@ -23,19 +23,19 @@ export class RelationshipType implements CacheableObject { */ @excludeFromEquals @autoserialize - type: ResourceType; + type: ResourceType; /** * The label that describes this RelationshipType */ @autoserialize - label: string; + label: string; /** * The identifier of this RelationshipType */ @autoserialize - id: string; + id: string; /** * The universally unique identifier of this RelationshipType @@ -43,49 +43,49 @@ export class RelationshipType implements CacheableObject { * It is based on the ID, so it will be the same for each refresh. */ @deserializeAs(new IDToUUIDSerializer(RelationshipType.type.value), 'id') - uuid: string; + uuid: string; /** * The label that describes the Relation to the left of this RelationshipType */ @autoserialize - leftwardType: string; + leftwardType: string; /** * The maximum amount of Relationships allowed to the left of this RelationshipType */ @autoserialize - leftMaxCardinality: number; + leftMaxCardinality: number; /** * The minimum amount of Relationships allowed to the left of this RelationshipType */ @autoserialize - leftMinCardinality: number; + leftMinCardinality: number; /** * The label that describes the Relation to the right of this RelationshipType */ @autoserialize - rightwardType: string; + rightwardType: string; /** * The maximum amount of Relationships allowed to the right of this RelationshipType */ @autoserialize - rightMaxCardinality: number; + rightMaxCardinality: number; /** * The minimum amount of Relationships allowed to the right of this RelationshipType */ @autoserialize - rightMinCardinality: number; + rightMinCardinality: number; /** * The {@link HALLink}s for this RelationshipType */ @deserialize - _links: { + _links: { self: HALLink; leftType: HALLink; rightType: HALLink; @@ -96,12 +96,12 @@ export class RelationshipType implements CacheableObject { * Will be undefined unless the leftType {@link HALLink} has been resolved. */ @link(ITEM_TYPE) - leftType?: Observable>; + leftType?: Observable>; /** * The type of Item found on the right side of this RelationshipType * Will be undefined unless the rightType {@link HALLink} has been resolved. */ @link(ITEM_TYPE) - rightType?: Observable>; + rightType?: Observable>; } diff --git a/src/app/core/shared/item-relationships/relationship.model.ts b/src/app/core/shared/item-relationships/relationship.model.ts index db12e1d862..8e631f4c7f 100644 --- a/src/app/core/shared/item-relationships/relationship.model.ts +++ b/src/app/core/shared/item-relationships/relationship.model.ts @@ -25,7 +25,7 @@ export class Relationship implements CacheableObject { */ @excludeFromEquals @autoserialize - type: ResourceType; + type: ResourceType; /** * The universally unique identifier of this Relationship @@ -33,43 +33,43 @@ export class Relationship implements CacheableObject { * It is based on the ID, so it will be the same for each refresh. */ @deserializeAs(new IDToUUIDSerializer(Relationship.type.value), 'id') - uuid: string; + uuid: string; /** * The identifier of this Relationship */ @autoserialize - id: string; + id: string; /** * The place of the Item to the left side of this Relationship */ @autoserialize - leftPlace: number; + leftPlace: number; /** * The place of the Item to the right side of this Relationship */ @autoserialize - rightPlace: number; + rightPlace: number; /** * The name variant of the Item to the left side of this Relationship */ @autoserialize - leftwardValue: string; + leftwardValue: string; /** * The name variant of the Item to the right side of this Relationship */ @autoserialize - rightwardValue: string; + rightwardValue: string; /** * The {@link HALLink}s for this Relationship */ @deserialize - _links: { + _links: { self: HALLink; leftItem: HALLink; rightItem: HALLink; @@ -81,20 +81,20 @@ export class Relationship implements CacheableObject { * Will be undefined unless the leftItem {@link HALLink} has been resolved. */ @link(ITEM) - leftItem?: Observable>; + leftItem?: Observable>; /** * The item on the right side of this relationship * Will be undefined unless the rightItem {@link HALLink} has been resolved. */ @link(ITEM) - rightItem?: Observable>; + rightItem?: Observable>; /** * The RelationshipType for this Relationship * Will be undefined unless the relationshipType {@link HALLink} has been resolved. */ @link(RELATIONSHIP_TYPE) - relationshipType?: Observable>; + relationshipType?: Observable>; } diff --git a/src/app/core/shared/item-request.model.ts b/src/app/core/shared/item-request.model.ts index 35dacc67c4..9965d1f67e 100644 --- a/src/app/core/shared/item-request.model.ts +++ b/src/app/core/shared/item-request.model.ts @@ -18,70 +18,70 @@ export class ItemRequest implements CacheableObject { */ @excludeFromEquals @autoserialize - type: ResourceType; + type: ResourceType; /** * opaque string which uniquely identifies this request */ @autoserialize - token: string; + token: string; /** * true if the request is for all bitstreams of the item. */ @autoserialize - allfiles: boolean; + allfiles: boolean; /** * email address of the person requesting the files. */ @autoserialize - requestEmail: string; + requestEmail: string; /** * Human-readable name of the person requesting the files. */ @autoserialize - requestName: string; + requestName: string; /** * arbitrary message provided by the person requesting the files. */ @autoserialize - requestMessage: string; + requestMessage: string; /** * date that the request was recorded. */ @autoserialize - requestDate: string; + requestDate: string; /** * true if the request has been granted. */ @autoserialize - acceptRequest: boolean; + acceptRequest: boolean; /** * date that the request was granted or denied. */ @autoserialize - decisionDate: string; + decisionDate: string; /** * date on which the request is considered expired. */ @autoserialize - expires: string; + expires: string; /** * UUID of the requested Item. */ @autoserialize - itemId: string; + itemId: string; /** * UUID of the requested bitstream. */ @autoserialize - bitstreamId: string; + bitstreamId: string; /** * The {@link HALLink}s for this ItemRequest */ @deserialize - _links: { + _links: { self: HALLink; item: HALLink; bitstream: HALLink; diff --git a/src/app/core/shared/item.model.ts b/src/app/core/shared/item.model.ts index 20fc275ee2..fcfc6be026 100644 --- a/src/app/core/shared/item.model.ts +++ b/src/app/core/shared/item.model.ts @@ -39,37 +39,37 @@ export class Item extends DSpaceObject implements ChildHALResource, HandleObject * A string representing the unique handle of this Item */ @autoserialize - handle: string; + handle: string; /** * The Date of the last modification of this Item */ @deserializeAs(Date) - lastModified: Date; + lastModified: Date; /** * A boolean representing if this Item is currently archived or not */ @autoserializeAs(Boolean, 'inArchive') - isArchived: boolean; + isArchived: boolean; /** * A boolean representing if this Item is currently discoverable or not */ @autoserializeAs(Boolean, 'discoverable') - isDiscoverable: boolean; + isDiscoverable: boolean; /** * A boolean representing if this Item is currently withdrawn or not */ @autoserializeAs(Boolean, 'withdrawn') - isWithdrawn: boolean; + isWithdrawn: boolean; /** * The {@link HALLink}s for this Item */ @deserialize - _links: { + _links: { mappedCollections: HALLink; relationships: HALLink; bundles: HALLink; @@ -87,49 +87,49 @@ export class Item extends DSpaceObject implements ChildHALResource, HandleObject * Will be undefined unless the owningCollection {@link HALLink} has been resolved. */ @link(COLLECTION) - owningCollection?: Observable>; + owningCollection?: Observable>; /** * The version this item represents in its history * Will be undefined unless the version {@link HALLink} has been resolved. */ @link(VERSION) - version?: Observable>; + version?: Observable>; /** * The list of Bundles inside this Item * Will be undefined unless the bundles {@link HALLink} has been resolved. */ @link(BUNDLE, true) - bundles?: Observable>>; + bundles?: Observable>>; /** * The list of Relationships this Item has with others * Will be undefined unless the relationships {@link HALLink} has been resolved. */ @link(RELATIONSHIP, true) - relationships?: Observable>>; + relationships?: Observable>>; /** * The thumbnail for this Item * Will be undefined unless the thumbnail {@link HALLink} has been resolved. */ @link(BITSTREAM, false, 'thumbnail') - thumbnail?: Observable>; + thumbnail?: Observable>; /** * The access status for this Item * Will be undefined unless the access status {@link HALLink} has been resolved. */ @link(ACCESS_STATUS) - accessStatus?: Observable>; + accessStatus?: Observable>; /** * The identifier data for this Item * Will be undefined unless the identifiers {@link HALLink} has been resolved. */ @link(IDENTIFIERS, false, 'identifiers') - identifiers?: Observable>; + identifiers?: Observable>; /** * Method that returns as which type of object this object should be rendered diff --git a/src/app/core/shared/license.model.ts b/src/app/core/shared/license.model.ts index 2b2477c1f8..324aaca4b4 100644 --- a/src/app/core/shared/license.model.ts +++ b/src/app/core/shared/license.model.ts @@ -12,11 +12,11 @@ export class License extends DSpaceObject { * Is the license custom? */ @autoserialize - custom: boolean; + custom: boolean; /** * The text of the license */ @autoserialize - text: string; + text: string; } diff --git a/src/app/core/shared/metadata.models.ts b/src/app/core/shared/metadata.models.ts index e74e1f9927..6327fda5a0 100644 --- a/src/app/core/shared/metadata.models.ts +++ b/src/app/core/shared/metadata.models.ts @@ -32,26 +32,26 @@ export class MetadataValue implements MetadataValueInterface { /** The language. */ @autoserialize - language: string; + language: string; /** The string value. */ @autoserialize - value: string; + value: string; /** * The place of this MetadataValue within its list of metadata * This is used to render metadata in a specific custom order */ @autoserialize - place: number; + place: number; /** The authority key used for authority-controlled metadata */ @autoserialize - authority: string; + authority: string; /** The authority confidence value */ @autoserialize - confidence: number; + confidence: number; /** * Returns true if this Metadatum's authority key starts with 'virtual::' diff --git a/src/app/core/shared/metadata.utils.ts b/src/app/core/shared/metadata.utils.ts index 87a90b53a3..27180e63f9 100644 --- a/src/app/core/shared/metadata.utils.ts +++ b/src/app/core/shared/metadata.utils.ts @@ -33,7 +33,7 @@ export class Metadata { * @returns {MetadataValue[]} the matching values or an empty array. */ public static all(mapOrMaps: MetadataMapInterface | MetadataMapInterface[], keyOrKeys: string | string[], - filter?: MetadataValueFilter): MetadataValue[] { + filter?: MetadataValueFilter): MetadataValue[] { const mdMaps: MetadataMapInterface[] = mapOrMaps instanceof Array ? mapOrMaps : [mapOrMaps]; const matches: MetadataValue[] = []; for (const mdMap of mdMaps) { @@ -64,7 +64,7 @@ export class Metadata { * @returns {string[]} the matching string values or an empty array. */ public static allValues(mapOrMaps: MetadataMapInterface | MetadataMapInterface[], keyOrKeys: string | string[], - filter?: MetadataValueFilter): string[] { + filter?: MetadataValueFilter): string[] { return Metadata.all(mapOrMaps, keyOrKeys, filter).map((mdValue) => mdValue.value); } @@ -77,7 +77,7 @@ export class Metadata { * @returns {MetadataValue} the first matching value, or `undefined`. */ public static first(mdMapOrMaps: MetadataMapInterface | MetadataMapInterface[], keyOrKeys: string | string[], - filter?: MetadataValueFilter): MetadataValue { + filter?: MetadataValueFilter): MetadataValue { const mdMaps: MetadataMapInterface[] = mdMapOrMaps instanceof Array ? mdMapOrMaps : [mdMapOrMaps]; for (const mdMap of mdMaps) { for (const key of Metadata.resolveKeys(mdMap, keyOrKeys)) { @@ -98,7 +98,7 @@ export class Metadata { * @returns {string} the first matching string value, or `undefined`. */ public static firstValue(mdMapOrMaps: MetadataMapInterface | MetadataMapInterface[], keyOrKeys: string | string[], - filter?: MetadataValueFilter): string { + filter?: MetadataValueFilter): string { const value = Metadata.first(mdMapOrMaps, keyOrKeys, filter); return isUndefined(value) ? undefined : value.value; } @@ -112,7 +112,7 @@ export class Metadata { * @returns {boolean} whether a match is found. */ public static has(mdMapOrMaps: MetadataMapInterface | MetadataMapInterface[], keyOrKeys: string | string[], - filter?: MetadataValueFilter): boolean { + filter?: MetadataValueFilter): boolean { return isNotUndefined(Metadata.first(mdMapOrMaps, keyOrKeys, filter)); } @@ -209,11 +209,11 @@ export class Metadata { .forEach((key: string) => { const orderedValues = sortBy(groupedList[key], ['order']); metadataMap[key] = orderedValues.map((value: MetadatumViewModel) => { - const val = Object.assign(new MetadataValue(), value); - delete (val as any).order; - delete (val as any).key; - return val; - } + const val = Object.assign(new MetadataValue(), value); + delete (val as any).order; + delete (val as any).key; + return val; + } ); }); return metadataMap; diff --git a/src/app/core/shared/non-hierarchical-browse-definition.ts b/src/app/core/shared/non-hierarchical-browse-definition.ts index d5481fcc8d..b6ce161b6c 100644 --- a/src/app/core/shared/non-hierarchical-browse-definition.ts +++ b/src/app/core/shared/non-hierarchical-browse-definition.ts @@ -11,14 +11,14 @@ import { BrowseDefinition } from './browse-definition.model'; export abstract class NonHierarchicalBrowseDefinition extends BrowseDefinition { @autoserialize - sortOptions: SortOption[]; + sortOptions: SortOption[]; @autoserializeAs('order') - defaultSortOrder: string; + defaultSortOrder: string; @autoserializeAs('metadata') - metadataKeys: string[]; + metadataKeys: string[]; @autoserialize - dataType: BrowseByDataType; + dataType: BrowseByDataType; } diff --git a/src/app/core/shared/page-info.model.ts b/src/app/core/shared/page-info.model.ts index ccb0aae471..8084fc6cb1 100644 --- a/src/app/core/shared/page-info.model.ts +++ b/src/app/core/shared/page-info.model.ts @@ -12,31 +12,31 @@ export class PageInfo implements HALResource { * The number of elements on a page */ @autoserializeAs(Number, 'size') - elementsPerPage: number; + elementsPerPage: number; /** * The total number of elements in the entire set */ @autoserialize - totalElements: number; + totalElements: number; /** * The total number of pages */ @autoserialize - totalPages: number; + totalPages: number; /** * The number of the current page, zero-based */ @autoserializeAs(Number, 'number') - currentPage: number; + currentPage: number; /** * The {@link HALLink}s for this PageInfo */ @deserialize - _links: { + _links: { first: HALLink; prev: HALLink; next: HALLink; diff --git a/src/app/core/shared/search/search-filter.service.ts b/src/app/core/shared/search/search-filter.service.ts index 80ba200d38..b453704cbd 100644 --- a/src/app/core/shared/search/search-filter.service.ts +++ b/src/app/core/shared/search/search-filter.service.ts @@ -100,10 +100,10 @@ export class SearchFilterService { const sortDirection$ = this.routeService.getQueryParameterValue('sortDirection'); const sortField$ = this.routeService.getQueryParameterValue('sortField'); return observableCombineLatest(sortDirection$, sortField$).pipe(map(([sortDirection, sortField]) => { - const field = sortField || defaultSort.field; - const direction = SortDirection[sortDirection] || defaultSort.direction; - return new SortOptions(field, direction); - } + const field = sortField || defaultSort.field; + const direction = SortDirection[sortDirection] || defaultSort.direction; + return new SortOptions(field, direction); + } )); } @@ -135,11 +135,11 @@ export class SearchFilterService { ); return observableCombineLatest(values$, prefixValues$).pipe( map(([values, prefixValues]) => { - if (isNotEmpty(values)) { - return values; - } - return prefixValues; + if (isNotEmpty(values)) { + return values; } + return prefixValues; + } ) ); } diff --git a/src/app/core/shared/search/search-filters/search-config.model.ts b/src/app/core/shared/search/search-filters/search-config.model.ts index c971fe0430..940ae86763 100644 --- a/src/app/core/shared/search/search-filters/search-config.model.ts +++ b/src/app/core/shared/search/search-filters/search-config.model.ts @@ -17,31 +17,31 @@ export class SearchConfig implements CacheableObject { * The id of this search configuration. */ @autoserialize - id: string; + id: string; /** * The configured filters. */ @autoserialize - filters: FilterConfig[]; + filters: FilterConfig[]; /** * The configured sort options. */ @autoserialize - sortOptions: SortConfig[]; + sortOptions: SortConfig[]; /** * The object type. */ @autoserialize - type: ResourceType; + type: ResourceType; /** * The {@link HALLink}s for this Item */ @deserialize - _links: { + _links: { facets: HALLink; objects: HALLink; self: HALLink; diff --git a/src/app/core/shared/sort-option.model.ts b/src/app/core/shared/sort-option.model.ts index c735e87b9a..b179d159b6 100644 --- a/src/app/core/shared/sort-option.model.ts +++ b/src/app/core/shared/sort-option.model.ts @@ -2,8 +2,8 @@ import { autoserialize } from 'cerialize'; export class SortOption { @autoserialize - name: string; + name: string; @autoserialize - metadata: string; + metadata: string; } diff --git a/src/app/core/shared/template-item.model.ts b/src/app/core/shared/template-item.model.ts index cb8a45cd68..64038ace1f 100644 --- a/src/app/core/shared/template-item.model.ts +++ b/src/app/core/shared/template-item.model.ts @@ -19,6 +19,6 @@ export class TemplateItem extends Item { * The Collection that this item is a template for */ @link(COLLECTION) - templateItemOf: Observable>; + templateItemOf: Observable>; } diff --git a/src/app/core/shared/value-list-browse-definition.model.ts b/src/app/core/shared/value-list-browse-definition.model.ts index 3378263962..f2eb2766d2 100644 --- a/src/app/core/shared/value-list-browse-definition.model.ts +++ b/src/app/core/shared/value-list-browse-definition.model.ts @@ -18,14 +18,14 @@ export class ValueListBrowseDefinition extends NonHierarchicalBrowseDefinition { * The object type */ @excludeFromEquals - type: ResourceType = VALUE_LIST_BROWSE_DEFINITION; + type: ResourceType = VALUE_LIST_BROWSE_DEFINITION; get self(): string { return this._links.self.href; } @deserialize - _links: { + _links: { self: HALLink; entries: HALLink; }; diff --git a/src/app/core/shared/version-history.model.ts b/src/app/core/shared/version-history.model.ts index 1e75b8f321..6f1e8d53ca 100644 --- a/src/app/core/shared/version-history.model.ts +++ b/src/app/core/shared/version-history.model.ts @@ -19,7 +19,7 @@ export class VersionHistory extends DSpaceObject { static type = VERSION_HISTORY; @deserialize - _links: { + _links: { self: HALLink; versions: HALLink; draftVersion: HALLink; @@ -29,30 +29,30 @@ export class VersionHistory extends DSpaceObject { * The identifier of this Version History */ @autoserialize - id: string; + id: string; /** * The summary of this Version History */ @autoserialize - summary: string; + summary: string; /** * The name of the submitter of this Version History */ @autoserialize - submitterName: string; + submitterName: string; /** * Whether exist a workspace item */ @autoserialize - draftVersion: boolean; + draftVersion: boolean; /** * The list of versions within this history */ @excludeFromEquals @link(VERSION, true) - versions: Observable>>; + versions: Observable>>; } diff --git a/src/app/core/shared/version.model.ts b/src/app/core/shared/version.model.ts index 7207637a21..03f8ce739b 100644 --- a/src/app/core/shared/version.model.ts +++ b/src/app/core/shared/version.model.ts @@ -22,7 +22,7 @@ export class Version extends DSpaceObject { static type = VERSION; @deserialize - _links: { + _links: { self: HALLink; item: HALLink; versionhistory: HALLink; @@ -33,50 +33,50 @@ export class Version extends DSpaceObject { * The identifier of this Version */ @autoserialize - id: string; + id: string; /** * The version number of the version's history this version represents */ @autoserialize - version: number; + version: number; /** * The summary for the changes made in this version */ @autoserialize - summary: string; + summary: string; /** * The name of the submitter of this version */ @autoserialize - submitterName: string; + submitterName: string; /** * The Date this version was created */ @deserialize - created: Date; + created: Date; /** * The full version history this version is apart of */ @excludeFromEquals @link(VERSION_HISTORY) - versionhistory: Observable>; + versionhistory: Observable>; /** * The item this version represents */ @excludeFromEquals @link(ITEM) - item: Observable>; + item: Observable>; /** * The e-person who created this version */ @excludeFromEquals @link(EPERSON) - eperson: Observable>; + eperson: Observable>; } diff --git a/src/app/core/statistics/models/usage-report.model.ts b/src/app/core/statistics/models/usage-report.model.ts index da976a8b90..9a4ed799ae 100644 --- a/src/app/core/statistics/models/usage-report.model.ts +++ b/src/app/core/statistics/models/usage-report.model.ts @@ -21,19 +21,19 @@ export class UsageReport extends HALResource { */ @excludeFromEquals @autoserialize - type: ResourceType; + type: ResourceType; @autoserialize - id: string; + id: string; @autoserializeAs('report-type') - reportType: string; + reportType: string; @autoserialize - points: Point[]; + points: Point[]; @deserialize - _links: { + _links: { self: HALLink; }; } diff --git a/src/app/core/submission/models/submission-cc-license-url.model.ts b/src/app/core/submission/models/submission-cc-license-url.model.ts index a7c933ecb1..6310da1c9e 100644 --- a/src/app/core/submission/models/submission-cc-license-url.model.ts +++ b/src/app/core/submission/models/submission-cc-license-url.model.ts @@ -16,8 +16,8 @@ export class SubmissionCcLicenceUrl extends HALResource { */ @excludeFromEquals @autoserialize - type: ResourceType; + type: ResourceType; @autoserialize - url: string; + url: string; } diff --git a/src/app/core/submission/models/submission-cc-license.model.ts b/src/app/core/submission/models/submission-cc-license.model.ts index 92c48fdbfe..9cfe188364 100644 --- a/src/app/core/submission/models/submission-cc-license.model.ts +++ b/src/app/core/submission/models/submission-cc-license.model.ts @@ -16,16 +16,16 @@ export class SubmissionCcLicence extends HALResource { */ @excludeFromEquals @autoserialize - type: ResourceType; + type: ResourceType; @autoserialize - id: string; + id: string; @autoserialize - name: string; + name: string; @autoserialize - fields: Field[]; + fields: Field[]; } export interface Field { diff --git a/src/app/core/submission/models/submission-object.model.ts b/src/app/core/submission/models/submission-object.model.ts index e2d1a4396b..622f1e93e4 100644 --- a/src/app/core/submission/models/submission-object.model.ts +++ b/src/app/core/submission/models/submission-object.model.ts @@ -31,38 +31,38 @@ export abstract class SubmissionObject extends DSpaceObject implements Cacheable @excludeFromEquals @autoserialize - id: string; + id: string; /** * The SubmissionObject last modified date */ @autoserialize - lastModified: Date; + lastModified: Date; /** * The collection this submission applies to * Will be undefined unless the collection {@link HALLink} has been resolved. */ @link(COLLECTION) - collection?: Observable> | Collection; + collection?: Observable> | Collection; /** * The SubmissionObject's last section's data */ @autoserialize - sections: WorkspaceitemSectionsObject; + sections: WorkspaceitemSectionsObject; /** * The SubmissionObject's last section's errors */ @autoserialize - errors: SubmissionObjectError[]; + errors: SubmissionObjectError[]; /** * The {@link HALLink}s for this SubmissionObject */ @deserialize - _links: { + _links: { self: HALLink; collection: HALLink; item: HALLink; @@ -81,21 +81,21 @@ export abstract class SubmissionObject extends DSpaceObject implements Cacheable */ @link(ITEM) /* This was changed from 'Observable> | Item' to 'any' to prevent issues in templates with async */ - item?: any; + item?: any; /** * The configuration object that define this submission * Will be undefined unless the submissionDefinition {@link HALLink} has been resolved. */ @link(SubmissionDefinitionsModel.type) - submissionDefinition?: Observable> | SubmissionDefinitionsModel; + submissionDefinition?: Observable> | SubmissionDefinitionsModel; /** * The submitter for this SubmissionObject * Will be undefined unless the submitter {@link HALLink} has been resolved. */ @link(EPERSON) - submitter?: Observable> | EPerson; + submitter?: Observable> | EPerson; /** * The submission supervision order @@ -103,6 +103,6 @@ export abstract class SubmissionObject extends DSpaceObject implements Cacheable */ @link(SUPERVISION_ORDER) /* This was changed from 'Observable> | WorkspaceItem' to 'any' to prevent issues in templates with async */ - supervisionOrders?: Observable>>; + supervisionOrders?: Observable>>; } diff --git a/src/app/core/submission/models/workflowitem.model.ts b/src/app/core/submission/models/workflowitem.model.ts index b8054a66d0..f4f60bf34a 100644 --- a/src/app/core/submission/models/workflowitem.model.ts +++ b/src/app/core/submission/models/workflowitem.model.ts @@ -19,5 +19,5 @@ export class WorkflowItem extends SubmissionObject { * It is based on the ID, so it will be the same for each refresh. */ @deserializeAs(new IDToUUIDSerializer(WorkflowItem.type.value), 'id') - uuid: string; + uuid: string; } diff --git a/src/app/core/submission/models/workspaceitem.model.ts b/src/app/core/submission/models/workspaceitem.model.ts index 62f21cb2f3..9908909c31 100644 --- a/src/app/core/submission/models/workspaceitem.model.ts +++ b/src/app/core/submission/models/workspaceitem.model.ts @@ -19,5 +19,5 @@ export class WorkspaceItem extends SubmissionObject { * It is based on the ID, so it will be the same for each refresh. */ @deserializeAs(new IDToUUIDSerializer(WorkspaceItem.type.value), 'id') - uuid: string; + uuid: string; } diff --git a/src/app/core/submission/resolver/submission-object.resolver.ts b/src/app/core/submission/resolver/submission-object.resolver.ts index 09561fbafa..92a10366fc 100644 --- a/src/app/core/submission/resolver/submission-object.resolver.ts +++ b/src/app/core/submission/resolver/submission-object.resolver.ts @@ -13,29 +13,29 @@ import { IdentifiableDataService } from '../../data/base/identifiable-data.servi */ @Injectable() export class SubmissionObjectResolver implements Resolve> { - constructor( + constructor( protected dataService: IdentifiableDataService, protected store: Store, - ) { - } + ) { + } - /** + /** * Method for resolving an item based on the parameters in the current route * @param {ActivatedRouteSnapshot} route The current ActivatedRouteSnapshot * @param {RouterStateSnapshot} state The current RouterStateSnapshot * @returns Observable<> Emits the found item based on the parameters in the current route, * or an error if something went wrong */ - resolve(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Observable> { - const itemRD$ = this.dataService.findById(route.params.id, - true, - false, - followLink('item'), - ).pipe( - getFirstCompletedRemoteData(), - switchMap((wfiRD: RemoteData) => wfiRD.payload.item as Observable>), - getFirstCompletedRemoteData() - ); - return itemRD$; - } + resolve(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Observable> { + const itemRD$ = this.dataService.findById(route.params.id, + true, + false, + followLink('item'), + ).pipe( + getFirstCompletedRemoteData(), + switchMap((wfiRD: RemoteData) => wfiRD.payload.item as Observable>), + getFirstCompletedRemoteData() + ); + return itemRD$; + } } diff --git a/src/app/core/submission/vocabularies/models/vocabulary-entry-detail.model.ts b/src/app/core/submission/vocabularies/models/vocabulary-entry-detail.model.ts index 2e066bae95..de9e2cc8f3 100644 --- a/src/app/core/submission/vocabularies/models/vocabulary-entry-detail.model.ts +++ b/src/app/core/submission/vocabularies/models/vocabulary-entry-detail.model.ts @@ -17,19 +17,19 @@ export class VocabularyEntryDetail extends VocabularyEntry { * The unique id of the entry */ @autoserialize - id: string; + id: string; /** * In an hierarchical vocabulary representing if entry is selectable as value */ @autoserialize - selectable: boolean; + selectable: boolean; /** * The {@link HALLink}s for this ExternalSourceEntry */ @deserialize - _links: { + _links: { self: HALLink; vocabulary: HALLink; parent: HALLink; diff --git a/src/app/core/submission/vocabularies/models/vocabulary-entry.model.ts b/src/app/core/submission/vocabularies/models/vocabulary-entry.model.ts index d1e9adf8a9..c89fa2e8f5 100644 --- a/src/app/core/submission/vocabularies/models/vocabulary-entry.model.ts +++ b/src/app/core/submission/vocabularies/models/vocabulary-entry.model.ts @@ -21,25 +21,25 @@ export class VocabularyEntry extends ListableObject { * The identifier of this vocabulary entry */ @autoserialize - authority: string; + authority: string; /** * The display value of this vocabulary entry */ @autoserialize - display: string; + display: string; /** * The value of this vocabulary entry */ @autoserialize - value: string; + value: string; /** * An object containing additional information related to this vocabulary entry */ @autoserialize - otherInformation: OtherInformation; + otherInformation: OtherInformation; /** * A string representing the kind of vocabulary entry @@ -52,7 +52,7 @@ export class VocabularyEntry extends ListableObject { * The {@link HALLink}s for this ExternalSourceEntry */ @deserialize - _links: { + _links: { self: HALLink; vocabularyEntryDetail?: HALLink; }; diff --git a/src/app/core/submission/vocabularies/models/vocabulary-find-options.model.ts b/src/app/core/submission/vocabularies/models/vocabulary-find-options.model.ts index 7feacd591b..6a31e20319 100644 --- a/src/app/core/submission/vocabularies/models/vocabulary-find-options.model.ts +++ b/src/app/core/submission/vocabularies/models/vocabulary-find-options.model.ts @@ -15,7 +15,7 @@ export class VocabularyFindOptions extends FindListOptions { public elementsPerPage?: number, public currentPage?: number, public sort?: SortOptions - ) { + ) { super(); const searchParams = []; diff --git a/src/app/core/submission/vocabularies/models/vocabulary-options.model.ts b/src/app/core/submission/vocabularies/models/vocabulary-options.model.ts index fd103718e1..7f54b8599d 100644 --- a/src/app/core/submission/vocabularies/models/vocabulary-options.model.ts +++ b/src/app/core/submission/vocabularies/models/vocabulary-options.model.ts @@ -14,7 +14,7 @@ export class VocabularyOptions { closed: boolean; constructor(name: string, - closed: boolean = false) { + closed: boolean = false) { this.name = name; this.closed = closed; } diff --git a/src/app/core/submission/vocabularies/models/vocabulary.model.ts b/src/app/core/submission/vocabularies/models/vocabulary.model.ts index 9cfc779115..958f9bd7ee 100644 --- a/src/app/core/submission/vocabularies/models/vocabulary.model.ts +++ b/src/app/core/submission/vocabularies/models/vocabulary.model.ts @@ -20,32 +20,32 @@ export class Vocabulary implements CacheableObject { * The identifier of this Vocabulary */ @autoserialize - id: string; + id: string; /** * The name of this Vocabulary */ @autoserialize - name: string; + name: string; /** * True if it is possible to scroll all the entries in the vocabulary without providing a filter parameter */ @autoserialize - scrollable: boolean; + scrollable: boolean; /** * True if the vocabulary exposes a tree structure where some entries are parent of others */ @autoserialize - hierarchical: boolean; + hierarchical: boolean; /** * For hierarchical vocabularies express the preference to preload the tree at a specific * level of depth (0 only the top nodes are shown, 1 also their children are preloaded and so on) */ @autoserialize - preloadLevel: any; + preloadLevel: any; /** * A string representing the kind of Vocabulary model @@ -55,13 +55,13 @@ export class Vocabulary implements CacheableObject { public type: any; @link(VOCABULARY_ENTRY, true) - entries?: Observable>>; + entries?: Observable>>; /** * The {@link HALLink}s for this Vocabulary */ @deserialize - _links: { + _links: { self: HALLink, entries: HALLink }; diff --git a/src/app/core/supervision-order/models/supervision-order.model.ts b/src/app/core/supervision-order/models/supervision-order.model.ts index e881c06d1b..64d9aaf9b7 100644 --- a/src/app/core/supervision-order/models/supervision-order.model.ts +++ b/src/app/core/supervision-order/models/supervision-order.model.ts @@ -24,21 +24,21 @@ export class SupervisionOrder implements CacheableObject { * The identifier for this Supervision Order */ @autoserialize - id: string; + id: string; /** * The object type */ @excludeFromEquals @autoserialize - type: ResourceType; + type: ResourceType; /** * The object type */ @excludeFromEquals @autoserialize - ordertype: string; + ordertype: string; /** * The universally unique identifier for this Supervision Order @@ -46,13 +46,13 @@ export class SupervisionOrder implements CacheableObject { * It is based on the ID, so it will be the same for each refresh. */ @deserializeAs(new IDToUUIDSerializer('supervision-order'), 'id') - uuid: string; + uuid: string; /** * The {@link HALLink}s for this SupervisionOrder */ @deserialize - _links: { + _links: { item: HALLink, group: HALLink, self: HALLink, @@ -63,12 +63,12 @@ export class SupervisionOrder implements CacheableObject { * Will be undefined unless the item {@link HALLink} has been resolved. */ @link(ITEM) - item?: Observable>; + item?: Observable>; /** * The group linked by this supervision order * Will be undefined unless the version {@link HALLink} has been resolved. */ @link(GROUP) - group?: Observable>; + group?: Observable>; } diff --git a/src/app/core/tasks/models/advanced-workflow-info.model.ts b/src/app/core/tasks/models/advanced-workflow-info.model.ts index 87991a375c..6e5feec357 100644 --- a/src/app/core/tasks/models/advanced-workflow-info.model.ts +++ b/src/app/core/tasks/models/advanced-workflow-info.model.ts @@ -6,6 +6,6 @@ import { autoserialize } from 'cerialize'; export abstract class AdvancedWorkflowInfo { @autoserialize - id: string; + id: string; } diff --git a/src/app/core/tasks/models/rating-advanced-workflow-info.model.ts b/src/app/core/tasks/models/rating-advanced-workflow-info.model.ts index b7861d4fe4..dfa7a7f4b4 100644 --- a/src/app/core/tasks/models/rating-advanced-workflow-info.model.ts +++ b/src/app/core/tasks/models/rating-advanced-workflow-info.model.ts @@ -17,12 +17,12 @@ export class RatingAdvancedWorkflowInfo extends AdvancedWorkflowInfo { * Whether the description is required. */ @autoserialize - descriptionRequired: boolean; + descriptionRequired: boolean; /** * The maximum value. */ @autoserialize - maxValue: number; + maxValue: number; } diff --git a/src/app/core/tasks/models/select-reviewer-advanced-workflow-info.model.ts b/src/app/core/tasks/models/select-reviewer-advanced-workflow-info.model.ts index b87770596e..87f60aaa33 100644 --- a/src/app/core/tasks/models/select-reviewer-advanced-workflow-info.model.ts +++ b/src/app/core/tasks/models/select-reviewer-advanced-workflow-info.model.ts @@ -14,6 +14,6 @@ export class SelectReviewerAdvancedWorkflowInfo extends AdvancedWorkflowInfo { static type: ResourceType = SELECT_REVIEWER_ADVANCED_WORKFLOW_INFO; @autoserialize - group: string; + group: string; } diff --git a/src/app/core/tasks/models/task-object.model.ts b/src/app/core/tasks/models/task-object.model.ts index dc4aa8b5ae..329b9683ec 100644 --- a/src/app/core/tasks/models/task-object.model.ts +++ b/src/app/core/tasks/models/task-object.model.ts @@ -27,19 +27,19 @@ export class TaskObject extends DSpaceObject implements CacheableObject { * The task identifier */ @autoserialize - id: string; + id: string; /** * The workflow step */ @autoserialize - step: string; + step: string; /** * The {@link HALLink}s for this TaskObject */ @deserialize - _links: { + _links: { self: HALLink; owner: HALLink; group: HALLink; @@ -52,14 +52,14 @@ export class TaskObject extends DSpaceObject implements CacheableObject { * Will be undefined unless the eperson {@link HALLink} has been resolved. */ @link(EPERSON, false, 'owner') - eperson?: Observable>; + eperson?: Observable>; /** * The Group for this task * Will be undefined unless the group {@link HALLink} has been resolved. */ @link(GROUP) - group?: Observable>; + group?: Observable>; /** * The WorkflowItem for this task @@ -67,13 +67,13 @@ export class TaskObject extends DSpaceObject implements CacheableObject { */ @link(WORKFLOWITEM) /* This was changed from 'WorkflowItem | Observable>' to 'any' to prevent issues in templates with async */ - workflowitem?: any; + workflowitem?: any; /** * The task action type * Will be undefined unless the group {@link HALLink} has been resolved. */ @link(WORKFLOW_ACTION, false, 'action') - action: Observable>; + action: Observable>; } diff --git a/src/app/core/tasks/models/workflow-action-object.model.ts b/src/app/core/tasks/models/workflow-action-object.model.ts index 0896e6b8f8..9c37d94f4a 100644 --- a/src/app/core/tasks/models/workflow-action-object.model.ts +++ b/src/app/core/tasks/models/workflow-action-object.model.ts @@ -16,30 +16,30 @@ export class WorkflowAction extends DSpaceObject { * The workflow action's identifier */ @autoserialize - id: string; + id: string; /** * The options available for this workflow action */ @autoserialize - options: string[]; + options: string[]; /** * Whether this action has advanced options */ @autoserialize - advanced: boolean; + advanced: boolean; /** * The advanced options that the user can select at this action */ @autoserialize - advancedOptions: string[]; + advancedOptions: string[]; /** * The advanced info required by the advanced options */ @autoserialize - advancedInfo: AdvancedWorkflowInfo[]; + advancedInfo: AdvancedWorkflowInfo[]; } diff --git a/src/app/core/utilities/equatable.spec.ts b/src/app/core/utilities/equatable.spec.ts index 037cea8cc5..aed60b826b 100644 --- a/src/app/core/utilities/equatable.spec.ts +++ b/src/app/core/utilities/equatable.spec.ts @@ -16,7 +16,7 @@ class Dog extends EquatableObject { class Owner extends EquatableObject { @excludeFromEquals - favouriteFood: string; + favouriteFood: string; constructor( public name: string, diff --git a/src/app/core/xsrf/xsrf.interceptor.ts b/src/app/core/xsrf/xsrf.interceptor.ts index c728a5cbd0..17e2dff710 100644 --- a/src/app/core/xsrf/xsrf.interceptor.ts +++ b/src/app/core/xsrf/xsrf.interceptor.ts @@ -42,79 +42,79 @@ import { XSRF_COOKIE, XSRF_REQUEST_HEADER, XSRF_RESPONSE_HEADER } from './xsrf.c @Injectable() export class XsrfInterceptor implements HttpInterceptor { - constructor(private tokenExtractor: HttpXsrfTokenExtractor, private cookieService: CookieService) { - } + constructor(private tokenExtractor: HttpXsrfTokenExtractor, private cookieService: CookieService) { + } - /** + /** * Intercept http requests and add the XSRF/CSRF token to the X-Forwarded-For header * @param httpRequest * @param next */ - intercept(req: HttpRequest, next: HttpHandler): Observable> { - // Ensure EVERY request from Angular includes "withCredentials: true". - // This allows Angular to receive & send cookies via a CORS request (to - // the backend). ONLY requests with credentials will: - // 1. Ensure a user's browser sends the server-side XSRF cookie back to - // the backend - // 2. Ensure a user's browser saves changes to the server-side XSRF - // cookie (to ensure it is kept in sync with client side cookie) - req = req.clone({ withCredentials: true }); + intercept(req: HttpRequest, next: HttpHandler): Observable> { + // Ensure EVERY request from Angular includes "withCredentials: true". + // This allows Angular to receive & send cookies via a CORS request (to + // the backend). ONLY requests with credentials will: + // 1. Ensure a user's browser sends the server-side XSRF cookie back to + // the backend + // 2. Ensure a user's browser saves changes to the server-side XSRF + // cookie (to ensure it is kept in sync with client side cookie) + req = req.clone({ withCredentials: true }); - // Get request URL - const reqUrl = req.url.toLowerCase(); + // Get request URL + const reqUrl = req.url.toLowerCase(); - // Get root URL of configured REST API - const restUrl = new RESTURLCombiner('/').toString().toLowerCase(); + // Get root URL of configured REST API + const restUrl = new RESTURLCombiner('/').toString().toLowerCase(); - // Skip any non-mutating request. This is because our REST API does NOT - // require CSRF verification for read-only requests like GET or HEAD - // Also skip any request which is NOT to our trusted/configured REST API - if (req.method !== 'GET' && req.method !== 'HEAD' && reqUrl.startsWith(restUrl)) { - // parse token from XSRF-TOKEN (client-side) cookie - const token = this.tokenExtractor.getToken() as string; + // Skip any non-mutating request. This is because our REST API does NOT + // require CSRF verification for read-only requests like GET or HEAD + // Also skip any request which is NOT to our trusted/configured REST API + if (req.method !== 'GET' && req.method !== 'HEAD' && reqUrl.startsWith(restUrl)) { + // parse token from XSRF-TOKEN (client-side) cookie + const token = this.tokenExtractor.getToken() as string; - // send token in request's X-XSRF-TOKEN header (anti-CSRF security) to backend - if (token !== null && !req.headers.has(XSRF_REQUEST_HEADER)) { - req = req.clone({ headers: req.headers.set(XSRF_REQUEST_HEADER, token) }); - } - } - // Pass to next interceptor, but intercept EVERY response event as well - return next.handle(req).pipe( - // Check event that came back...is it an HttpResponse from backend? - tap((response) => { - if (response instanceof HttpResponse) { - // For every response that comes back, check for the custom - // DSPACE-XSRF-TOKEN header sent from the backend. - if (response.headers.has(XSRF_RESPONSE_HEADER)) { - // value of header is a new XSRF token - this.saveXsrfToken(response.headers.get(XSRF_RESPONSE_HEADER)); - } - } - }), - catchError((error) => { - if (error instanceof HttpErrorResponse) { - // For every error that comes back, also check for the custom - // DSPACE-XSRF-TOKEN header sent from the backend. - if (error.headers.has(XSRF_RESPONSE_HEADER)) { - // value of header is a new XSRF token - this.saveXsrfToken(error.headers.get(XSRF_RESPONSE_HEADER)); - } - } - // Return error response as is. - return throwError(error); - }) - ) as any; + // send token in request's X-XSRF-TOKEN header (anti-CSRF security) to backend + if (token !== null && !req.headers.has(XSRF_REQUEST_HEADER)) { + req = req.clone({ headers: req.headers.set(XSRF_REQUEST_HEADER, token) }); + } } + // Pass to next interceptor, but intercept EVERY response event as well + return next.handle(req).pipe( + // Check event that came back...is it an HttpResponse from backend? + tap((response) => { + if (response instanceof HttpResponse) { + // For every response that comes back, check for the custom + // DSPACE-XSRF-TOKEN header sent from the backend. + if (response.headers.has(XSRF_RESPONSE_HEADER)) { + // value of header is a new XSRF token + this.saveXsrfToken(response.headers.get(XSRF_RESPONSE_HEADER)); + } + } + }), + catchError((error) => { + if (error instanceof HttpErrorResponse) { + // For every error that comes back, also check for the custom + // DSPACE-XSRF-TOKEN header sent from the backend. + if (error.headers.has(XSRF_RESPONSE_HEADER)) { + // value of header is a new XSRF token + this.saveXsrfToken(error.headers.get(XSRF_RESPONSE_HEADER)); + } + } + // Return error response as is. + return throwError(error); + }) + ) as any; + } - /** + /** * Save XSRF token found in response * @param token token found */ - private saveXsrfToken(token: string) { - // Save token value as a *new* value of our client-side XSRF-TOKEN cookie. - // This is the cookie that is parsed by Angular's tokenExtractor(), - // which we will send back in the X-XSRF-TOKEN header per Angular best practices. - this.cookieService.remove(XSRF_COOKIE); - this.cookieService.set(XSRF_COOKIE, token); - } + private saveXsrfToken(token: string) { + // Save token value as a *new* value of our client-side XSRF-TOKEN cookie. + // This is the cookie that is parsed by Angular's tokenExtractor(), + // which we will send back in the X-XSRF-TOKEN header per Angular best practices. + this.cookieService.remove(XSRF_COOKIE); + this.cookieService.set(XSRF_COOKIE, token); + } } diff --git a/src/app/curation-form/curation-form.component.ts b/src/app/curation-form/curation-form.component.ts index 2c0e900a66..81be8d0ed7 100644 --- a/src/app/curation-form/curation-form.component.ts +++ b/src/app/curation-form/curation-form.component.ts @@ -31,7 +31,7 @@ export class CurationFormComponent implements OnInit { form: UntypedFormGroup; @Input() - dsoHandle: string; + dsoHandle: string; constructor( private scriptDataService: ScriptDataService, diff --git a/src/app/dso-shared/dso-edit-metadata/dso-edit-metadata.component.ts b/src/app/dso-shared/dso-edit-metadata/dso-edit-metadata.component.ts index 0533a78688..3849460220 100644 --- a/src/app/dso-shared/dso-edit-metadata/dso-edit-metadata.component.ts +++ b/src/app/dso-shared/dso-edit-metadata/dso-edit-metadata.component.ts @@ -186,8 +186,8 @@ export class DsoEditMetadataComponent implements OnInit, OnDestroy { this.notificationsService.error(this.translateService.instant(`${this.dsoType}.edit.metadata.notifications.error.title`), rd.errorMessage); } else { this.notificationsService.success( - this.translateService.instant(`${this.dsoType}.edit.metadata.notifications.saved.title`), - this.translateService.instant(`${this.dsoType}.edit.metadata.notifications.saved.content`) + this.translateService.instant(`${this.dsoType}.edit.metadata.notifications.saved.title`), + this.translateService.instant(`${this.dsoType}.edit.metadata.notifications.saved.content`) ); this.dso = rd.payload; this.initForm(); diff --git a/src/app/entity-groups/research-entities/item-list-elements/search-result-list-elements/org-unit/org-unit-search-result-list-element.component.spec.ts b/src/app/entity-groups/research-entities/item-list-elements/search-result-list-elements/org-unit/org-unit-search-result-list-element.component.spec.ts index 9609a9582a..e0e907636f 100644 --- a/src/app/entity-groups/research-entities/item-list-elements/search-result-list-elements/org-unit/org-unit-search-result-list-element.component.spec.ts +++ b/src/app/entity-groups/research-entities/item-list-elements/search-result-list-elements/org-unit/org-unit-search-result-list-element.component.spec.ts @@ -69,11 +69,11 @@ describe('OrgUnitSearchResultListElementComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ imports: [TranslateModule.forRoot({ - loader: { - provide: TranslateLoader, - useClass: TranslateLoaderMock - } + loader: { + provide: TranslateLoader, + useClass: TranslateLoaderMock } + } )], declarations: [ OrgUnitSearchResultListElementComponent , TruncatePipe], providers: [ @@ -139,11 +139,11 @@ describe('OrgUnitSearchResultListElementComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ imports: [TranslateModule.forRoot({ - loader: { - provide: TranslateLoader, - useClass: TranslateLoaderMock - } + loader: { + provide: TranslateLoader, + useClass: TranslateLoaderMock } + } )], declarations: [OrgUnitSearchResultListElementComponent, TruncatePipe], providers: [ diff --git a/src/app/entity-groups/research-entities/item-list-elements/search-result-list-elements/person/person-search-result-list-element.component.spec.ts b/src/app/entity-groups/research-entities/item-list-elements/search-result-list-elements/person/person-search-result-list-element.component.spec.ts index 31018520f6..fbd2cd8fda 100644 --- a/src/app/entity-groups/research-entities/item-list-elements/search-result-list-elements/person/person-search-result-list-element.component.spec.ts +++ b/src/app/entity-groups/research-entities/item-list-elements/search-result-list-elements/person/person-search-result-list-element.component.spec.ts @@ -69,11 +69,11 @@ describe('PersonSearchResultListElementComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ imports: [TranslateModule.forRoot({ - loader: { - provide: TranslateLoader, - useClass: TranslateLoaderMock - } + loader: { + provide: TranslateLoader, + useClass: TranslateLoaderMock } + } )], declarations: [PersonSearchResultListElementComponent, TruncatePipe], providers: [ @@ -139,11 +139,11 @@ describe('PersonSearchResultListElementComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ imports: [TranslateModule.forRoot({ - loader: { - provide: TranslateLoader, - useClass: TranslateLoaderMock - } + loader: { + provide: TranslateLoader, + useClass: TranslateLoaderMock } + } )], declarations: [PersonSearchResultListElementComponent, TruncatePipe], providers: [ diff --git a/src/app/entity-groups/research-entities/metadata-representations/project/project-item-metadata-list-element.component.ts b/src/app/entity-groups/research-entities/metadata-representations/project/project-item-metadata-list-element.component.ts index a38a1f5cff..c4da6e21a6 100644 --- a/src/app/entity-groups/research-entities/metadata-representations/project/project-item-metadata-list-element.component.ts +++ b/src/app/entity-groups/research-entities/metadata-representations/project/project-item-metadata-list-element.component.ts @@ -21,6 +21,6 @@ export class ProjectItemMetadataListElementComponent extends ItemMetadataReprese constructor( public dsoNameService: DSONameService ) { - super(); + super(); } } diff --git a/src/app/entity-groups/research-entities/submission/item-list-elements/org-unit/org-unit-search-result-list-submission-element.component.ts b/src/app/entity-groups/research-entities/submission/item-list-elements/org-unit/org-unit-search-result-list-submission-element.component.ts index ef58007bae..cfa52bba97 100644 --- a/src/app/entity-groups/research-entities/submission/item-list-elements/org-unit/org-unit-search-result-list-submission-element.component.ts +++ b/src/app/entity-groups/research-entities/submission/item-list-elements/org-unit/org-unit-search-result-list-submission-element.component.ts @@ -68,8 +68,8 @@ export class OrgUnitSearchResultListSubmissionElementComponent extends SearchRes this.relationshipService.getNameVariant(this.listID, this.dso.uuid) .pipe(take(1)) .subscribe((nameVariant: string) => { - this.selectedName = nameVariant || defaultValue; - } + this.selectedName = nameVariant || defaultValue; + } ); } this.showThumbnails = this.appConfig.browseBy.showThumbnails; @@ -106,9 +106,9 @@ export class OrgUnitSearchResultListSubmissionElementComponent extends SearchRes this.itemDataService.update(updatedItem).pipe(take(1)).subscribe(); }).catch(() => { // user clicked cancel: use the name variant only for this relation, no further action required - }).finally(() => { - this.select(value); - }); + }).finally(() => { + this.select(value); + }); } } diff --git a/src/app/entity-groups/research-entities/submission/item-list-elements/person/person-search-result-list-submission-element.component.ts b/src/app/entity-groups/research-entities/submission/item-list-elements/person/person-search-result-list-submission-element.component.ts index c9826e440b..459a65cf5f 100644 --- a/src/app/entity-groups/research-entities/submission/item-list-elements/person/person-search-result-list-submission-element.component.ts +++ b/src/app/entity-groups/research-entities/submission/item-list-elements/person/person-search-result-list-submission-element.component.ts @@ -63,7 +63,7 @@ export class PersonSearchResultListSubmissionElementComponent extends SearchResu .pipe(take(1)) .subscribe((nameVariant: string) => { this.selectedName = nameVariant || defaultValue; - } + } ); this.showThumbnails = this.appConfig.browseBy.showThumbnails; } @@ -84,25 +84,25 @@ export class PersonSearchResultListSubmissionElementComponent extends SearchResu this.openModal(value) .then(() => { // user clicked ok: store the name variant in the item - const newName: MetadataValue = new MetadataValue(); - newName.value = value; + const newName: MetadataValue = new MetadataValue(); + newName.value = value; - const existingNames: MetadataValue[] = this.dso.metadata[this.alternativeField] || []; - const alternativeNames = { [this.alternativeField]: [...existingNames, newName] }; - const updatedItem = + const existingNames: MetadataValue[] = this.dso.metadata[this.alternativeField] || []; + const alternativeNames = { [this.alternativeField]: [...existingNames, newName] }; + const updatedItem = Object.assign({}, this.dso, { metadata: { ...this.dso.metadata, ...alternativeNames }, }); - this.itemDataService.update(updatedItem).pipe(take(1)).subscribe(); - this.itemDataService.commitUpdates(); - }).catch(() => { + this.itemDataService.update(updatedItem).pipe(take(1)).subscribe(); + this.itemDataService.commitUpdates(); + }).catch(() => { // user clicked cancel: use the name variant only for this relation, no further action required - }).finally(() => { - this.select(value); - }); + }).finally(() => { + this.select(value); + }); } } diff --git a/src/app/health-page/health-info/health-info.component.spec.ts b/src/app/health-page/health-info/health-info.component.spec.ts index 5a9b8bf0aa..113fb2382d 100644 --- a/src/app/health-page/health-info/health-info.component.spec.ts +++ b/src/app/health-page/health-info/health-info.component.spec.ts @@ -30,7 +30,7 @@ describe('HealthInfoComponent', () => { ], schemas: [NO_ERRORS_SCHEMA] }) - .compileComponents(); + .compileComponents(); }); beforeEach(() => { diff --git a/src/app/health-page/health-page.component.spec.ts b/src/app/health-page/health-page.component.spec.ts index f3847ab092..1d96248399 100644 --- a/src/app/health-page/health-page.component.spec.ts +++ b/src/app/health-page/health-page.component.spec.ts @@ -50,7 +50,7 @@ describe('HealthPageComponent', () => { { provide: HealthService, useValue: healthService } ] }) - .compileComponents(); + .compileComponents(); }); beforeEach(() => { diff --git a/src/app/health-page/health-panel/health-component/health-component.component.spec.ts b/src/app/health-page/health-panel/health-component/health-component.component.spec.ts index a8ec2b65e0..6f27a4f873 100644 --- a/src/app/health-page/health-panel/health-component/health-component.component.spec.ts +++ b/src/app/health-page/health-panel/health-component/health-component.component.spec.ts @@ -35,7 +35,7 @@ describe('HealthComponentComponent', () => { ], schemas: [NO_ERRORS_SCHEMA] }) - .compileComponents(); + .compileComponents(); }); beforeEach(() => { diff --git a/src/app/health-page/health-panel/health-status/health-status.component.spec.ts b/src/app/health-page/health-panel/health-status/health-status.component.spec.ts index f0f61ebdbb..5c6e9e51ec 100644 --- a/src/app/health-page/health-panel/health-status/health-status.component.spec.ts +++ b/src/app/health-page/health-panel/health-status/health-status.component.spec.ts @@ -24,7 +24,7 @@ describe('HealthStatusComponent', () => { ], declarations: [ HealthStatusComponent ] }) - .compileComponents(); + .compileComponents(); }); beforeEach(() => { diff --git a/src/app/health-page/health.service.ts b/src/app/health-page/health.service.ts index 7c238769a1..b5260f3db7 100644 --- a/src/app/health-page/health.service.ts +++ b/src/app/health-page/health.service.ts @@ -6,27 +6,27 @@ import { RawRestResponse } from '../core/dspace-rest/raw-rest-response.model'; import { HALEndpointService } from '../core/shared/hal-endpoint.service'; @Injectable({ - providedIn: 'root' + providedIn: 'root' }) export class HealthService { - constructor(protected halService: HALEndpointService, + constructor(protected halService: HALEndpointService, protected restService: DspaceRestService) { - } - /** + } + /** * @returns health data */ - getHealth(): Observable { - return this.halService.getEndpoint('/actuator').pipe( - map((restURL: string) => restURL + '/health'), - switchMap((endpoint: string) => this.restService.get(endpoint))); - } + getHealth(): Observable { + return this.halService.getEndpoint('/actuator').pipe( + map((restURL: string) => restURL + '/health'), + switchMap((endpoint: string) => this.restService.get(endpoint))); + } - /** + /** * @returns information of server */ - getInfo(): Observable { - return this.halService.getEndpoint('/actuator').pipe( - map((restURL: string) => restURL + '/info'), - switchMap((endpoint: string) => this.restService.get(endpoint))); - } + getInfo(): Observable { + return this.halService.getEndpoint('/actuator').pipe( + map((restURL: string) => restURL + '/info'), + switchMap((endpoint: string) => this.restService.get(endpoint))); + } } diff --git a/src/app/home-page/recent-item-list/recent-item-list.component.spec.ts b/src/app/home-page/recent-item-list/recent-item-list.component.spec.ts index edcb4f84f8..392059e3dc 100644 --- a/src/app/home-page/recent-item-list/recent-item-list.component.spec.ts +++ b/src/app/home-page/recent-item-list/recent-item-list.component.spec.ts @@ -49,7 +49,7 @@ describe('RecentItemListComponent', () => { { provide: PLATFORM_ID, useValue: 'browser' }, ], }) - .compileComponents(); + .compileComponents(); }); beforeEach(() => { diff --git a/src/app/home-page/top-level-community-list/top-level-community-list.component.spec.ts b/src/app/home-page/top-level-community-list/top-level-community-list.component.spec.ts index d1a3d3631f..694bee0cdd 100644 --- a/src/app/home-page/top-level-community-list/top-level-community-list.component.spec.ts +++ b/src/app/home-page/top-level-community-list/top-level-community-list.component.spec.ts @@ -47,54 +47,54 @@ describe('TopLevelCommunityList Component', () => { ] } }), - Object.assign(new Community(), { - id: '123456789-2', - metadata: { - 'dc.title': [ - { language: 'en_US', value: 'TopCommunity 2' } - ] - } - }), - Object.assign(new Community(), { - id: '123456789-3', - metadata: { - 'dc.title': [ - { language: 'en_US', value: 'TopCommunity 3' } - ] - } - }), - Object.assign(new Community(), { - id: '12345678942', - metadata: { - 'dc.title': [ - { language: 'en_US', value: 'TopCommunity 4' } - ] - } - }), - Object.assign(new Community(), { - id: '123456789-5', - metadata: { - 'dc.title': [ - { language: 'en_US', value: 'TopCommunity 5' } - ] - } - }), - Object.assign(new Community(), { - id: '123456789-6', - metadata: { - 'dc.title': [ - { language: 'en_US', value: 'TopCommunity 6' } - ] - } - }), - Object.assign(new Community(), { - id: '123456789-7', - metadata: { - 'dc.title': [ - { language: 'en_US', value: 'TopCommunity 7' } - ] - } - }) + Object.assign(new Community(), { + id: '123456789-2', + metadata: { + 'dc.title': [ + { language: 'en_US', value: 'TopCommunity 2' } + ] + } + }), + Object.assign(new Community(), { + id: '123456789-3', + metadata: { + 'dc.title': [ + { language: 'en_US', value: 'TopCommunity 3' } + ] + } + }), + Object.assign(new Community(), { + id: '12345678942', + metadata: { + 'dc.title': [ + { language: 'en_US', value: 'TopCommunity 4' } + ] + } + }), + Object.assign(new Community(), { + id: '123456789-5', + metadata: { + 'dc.title': [ + { language: 'en_US', value: 'TopCommunity 5' } + ] + } + }), + Object.assign(new Community(), { + id: '123456789-6', + metadata: { + 'dc.title': [ + { language: 'en_US', value: 'TopCommunity 6' } + ] + } + }), + Object.assign(new Community(), { + id: '123456789-7', + metadata: { + 'dc.title': [ + { language: 'en_US', value: 'TopCommunity 7' } + ] + } + }) ]; communityDataServiceStub = { diff --git a/src/app/import-external-page/import-external-page.component.spec.ts b/src/app/import-external-page/import-external-page.component.spec.ts index 00bdd4be28..f63145c8c2 100644 --- a/src/app/import-external-page/import-external-page.component.spec.ts +++ b/src/app/import-external-page/import-external-page.component.spec.ts @@ -16,7 +16,7 @@ describe('ImportExternalPageComponent', () => { ], schemas: [NO_ERRORS_SCHEMA] }) - .compileComponents(); + .compileComponents(); })); beforeEach(() => { diff --git a/src/app/info/info-routing-paths.ts b/src/app/info/info-routing-paths.ts index a18de2c611..a7fba45a6c 100644 --- a/src/app/info/info-routing-paths.ts +++ b/src/app/info/info-routing-paths.ts @@ -5,17 +5,17 @@ export const PRIVACY_PATH = 'privacy'; export const FEEDBACK_PATH = 'feedback'; export function getEndUserAgreementPath() { - return getSubPath(END_USER_AGREEMENT_PATH); + return getSubPath(END_USER_AGREEMENT_PATH); } export function getPrivacyPath() { - return getSubPath(PRIVACY_PATH); + return getSubPath(PRIVACY_PATH); } export function getFeedbackPath() { - return getSubPath(FEEDBACK_PATH); + return getSubPath(FEEDBACK_PATH); } function getSubPath(path: string) { - return `${getInfoModulePath()}/${path}`; + return `${getInfoModulePath()}/${path}`; } diff --git a/src/app/info/info-routing.module.ts b/src/app/info/info-routing.module.ts index 4c497461e7..ee0086926a 100644 --- a/src/app/info/info-routing.module.ts +++ b/src/app/info/info-routing.module.ts @@ -21,28 +21,28 @@ const imports = [ ]) ]; - if (environment.info.enableEndUserAgreement) { - imports.push( - RouterModule.forChild([ - { - path: END_USER_AGREEMENT_PATH, - component: ThemedEndUserAgreementComponent, - resolve: { breadcrumb: I18nBreadcrumbResolver }, - data: { title: 'info.end-user-agreement.title', breadcrumbKey: 'info.end-user-agreement' } - } - ])); - } - if (environment.info.enablePrivacyStatement) { - imports.push( - RouterModule.forChild([ - { - path: PRIVACY_PATH, - component: ThemedPrivacyComponent, - resolve: { breadcrumb: I18nBreadcrumbResolver }, - data: { title: 'info.privacy.title', breadcrumbKey: 'info.privacy' } - } - ])); - } +if (environment.info.enableEndUserAgreement) { + imports.push( + RouterModule.forChild([ + { + path: END_USER_AGREEMENT_PATH, + component: ThemedEndUserAgreementComponent, + resolve: { breadcrumb: I18nBreadcrumbResolver }, + data: { title: 'info.end-user-agreement.title', breadcrumbKey: 'info.end-user-agreement' } + } + ])); +} +if (environment.info.enablePrivacyStatement) { + imports.push( + RouterModule.forChild([ + { + path: PRIVACY_PATH, + component: ThemedPrivacyComponent, + resolve: { breadcrumb: I18nBreadcrumbResolver }, + data: { title: 'info.privacy.title', breadcrumbKey: 'info.privacy' } + } + ])); +} @NgModule({ imports: [ diff --git a/src/app/init.service.spec.ts b/src/app/init.service.spec.ts index a05f06c78f..f126aca1a4 100644 --- a/src/app/init.service.spec.ts +++ b/src/app/init.service.spec.ts @@ -91,7 +91,7 @@ describe('InitService', () => { it('should call resolveAppConfig() in APP_CONFIG factory', () => { const factory = ( ConcreteInitServiceMock.providers() - .find((p: any) => p.provide === APP_CONFIG) as any + .find((p: any) => p.provide === APP_CONFIG) as any ).useFactory; // this factory is called _before_ InitService is instantiated @@ -103,7 +103,7 @@ describe('InitService', () => { it('should defer to init() in APP_INITIALIZER factory', () => { const factory = ( ConcreteInitServiceMock.providers() - .find((p: any) => p.provide === APP_INITIALIZER) as any + .find((p: any) => p.provide === APP_INITIALIZER) as any ).useFactory; // we don't care about the dependencies here diff --git a/src/app/init.service.ts b/src/app/init.service.ts index 9fef2ca4ed..f3b56d15f8 100644 --- a/src/app/init.service.ts +++ b/src/app/init.service.ts @@ -158,8 +158,8 @@ export abstract class InitService { // Load all the languages that are defined as active from the config file this.translate.addLangs( environment.languages - .filter((LangConfig) => LangConfig.active === true) - .map((a) => a.code) + .filter((LangConfig) => LangConfig.active === true) + .map((a) => a.code) ); // Load the default language from the config file diff --git a/src/app/item-page/bitstreams/request-a-copy/bitstream-request-a-copy-page.component.ts b/src/app/item-page/bitstreams/request-a-copy/bitstream-request-a-copy-page.component.ts index 77e1049d87..13a79bb9a9 100644 --- a/src/app/item-page/bitstreams/request-a-copy/bitstream-request-a-copy-page.component.ts +++ b/src/app/item-page/bitstreams/request-a-copy/bitstream-request-a-copy-page.component.ts @@ -64,7 +64,7 @@ export class BitstreamRequestACopyPageComponent implements OnInit, OnDestroy { }), email: new UntypedFormControl('', { validators: [Validators.required, - Validators.pattern('^[a-z0-9._%+-]+@[a-z0-9.-]+\.[a-z]{2,4}$')] + Validators.pattern('^[a-z0-9._%+-]+@[a-z0-9.-]+\.[a-z]{2,4}$')] }), allfiles: new UntypedFormControl(''), message: new UntypedFormControl(''), diff --git a/src/app/item-page/bitstreams/upload/upload-bitstream.component.ts b/src/app/item-page/bitstreams/upload/upload-bitstream.component.ts index 56b88806ed..a4a20ab73f 100644 --- a/src/app/item-page/bitstreams/upload/upload-bitstream.component.ts +++ b/src/app/item-page/bitstreams/upload/upload-bitstream.component.ts @@ -134,9 +134,9 @@ export class UploadBitstreamComponent implements OnInit, OnDestroy { } } else { this.bundles = environment.bundle.standardBundles.map((defaultBundle: string) => Object.assign(new Bundle(), { - _name: defaultBundle, - type: 'bundle' - }) + _name: defaultBundle, + type: 'bundle' + }) ); } return observableOf(remoteData.payload.page); diff --git a/src/app/item-page/edit-item-page/edit-item-page.component.ts b/src/app/item-page/edit-item-page/edit-item-page.component.ts index 652b85916e..d6fb5d4f26 100644 --- a/src/app/item-page/edit-item-page/edit-item-page.component.ts +++ b/src/app/item-page/edit-item-page/edit-item-page.component.ts @@ -50,9 +50,9 @@ export class EditItemPageComponent implements OnInit { let enabled = observableOf(true); if (isNotEmpty(child.canActivate)) { enabled = observableCombineLatest(child.canActivate.map((guardConstructor: GenericConstructor) => { - const guard: CanActivate = this.injector.get(guardConstructor); - return guard.canActivate(this.route.snapshot, this.router.routerState.snapshot); - }) + const guard: CanActivate = this.injector.get(guardConstructor); + return guard.canActivate(this.route.snapshot, this.router.routerState.snapshot); + }) ).pipe( map((canActivateOutcomes: any[]) => canActivateOutcomes.every((e) => e === true)) ); diff --git a/src/app/item-page/edit-item-page/item-access-control/item-access-control.component.spec.ts b/src/app/item-page/edit-item-page/item-access-control/item-access-control.component.spec.ts index d841b97e2a..b186406009 100644 --- a/src/app/item-page/edit-item-page/item-access-control/item-access-control.component.spec.ts +++ b/src/app/item-page/edit-item-page/item-access-control/item-access-control.component.spec.ts @@ -10,7 +10,7 @@ xdescribe('ItemAccessControlComponent', () => { await TestBed.configureTestingModule({ declarations: [ ItemAccessControlComponent ] }) - .compileComponents(); + .compileComponents(); }); beforeEach(() => { diff --git a/src/app/item-page/edit-item-page/item-authorizations/item-authorizations.component.ts b/src/app/item-page/edit-item-page/item-authorizations/item-authorizations.component.ts index 08a58de382..de5ec83a43 100644 --- a/src/app/item-page/edit-item-page/item-authorizations/item-authorizations.component.ts +++ b/src/app/item-page/edit-item-page/item-authorizations/item-authorizations.component.ts @@ -109,7 +109,7 @@ export class ItemAuthorizationsComponent implements OnInit, OnDestroy { * Initialize the component, setting up the bundle and bitstream within the item */ ngOnInit(): void { - this.getBundlesPerItem(); + this.getBundlesPerItem(); } /** diff --git a/src/app/item-page/edit-item-page/item-collection-mapper/item-collection-mapper.component.ts b/src/app/item-page/edit-item-page/item-collection-mapper/item-collection-mapper.component.ts index d94abfaa9f..c463bea847 100644 --- a/src/app/item-page/edit-item-page/item-collection-mapper/item-collection-mapper.component.ts +++ b/src/app/item-page/edit-item-page/item-collection-mapper/item-collection-mapper.component.ts @@ -181,7 +181,7 @@ export class ItemCollectionMapperComponent implements OnInit { observableCombineLatest( this.filterIds(ids, excludingIds).map((id: string) => this.itemDataService.mapToCollection(itemId, id).pipe(getFirstCompletedRemoteData()) - )) + )) ) ); diff --git a/src/app/item-page/edit-item-page/item-move/item-move.component.ts b/src/app/item-page/edit-item-page/item-move/item-move.component.ts index 0f9df588a1..1f55dafec6 100644 --- a/src/app/item-page/edit-item-page/item-move/item-move.component.ts +++ b/src/app/item-page/edit-item-page/item-move/item-move.component.ts @@ -70,8 +70,8 @@ export class ItemMoveComponent implements OnInit { map((item) => getItemPageRoute(item)) ); this.itemRD$.subscribe((rd) => { - this.item = rd.payload; - } + this.item = rd.payload; + } ); this.itemRD$.pipe( getFirstSucceededRemoteData(), @@ -125,7 +125,7 @@ export class ItemMoveComponent implements OnInit { false, true, followLink('owningCollection') - )), + )), getFirstCompletedRemoteData() ).subscribe(() => { this.processing = false; diff --git a/src/app/item-page/edit-item-page/item-register-doi/item-register-doi.component.ts b/src/app/item-page/edit-item-page/item-register-doi/item-register-doi.component.ts index 54878c6026..2c0f3632a4 100644 --- a/src/app/item-page/edit-item-page/item-register-doi/item-register-doi.component.ts +++ b/src/app/item-page/edit-item-page/item-register-doi/item-register-doi.component.ts @@ -48,18 +48,18 @@ export class ItemRegisterDoiComponent extends AbstractSimpleItemActionComponent )as Observable>; this.itemRD$.pipe(first()).subscribe((rd) => { - this.item = rd.payload; - this.itemPageRoute = getItemPageRoute(this.item); - this.identifiers$ = this.identifierDataService.getIdentifierDataFor(this.item).pipe( - map((identifierRD) => { - if (identifierRD.statusCode !== 401 && hasValue(identifierRD.payload)) { - return identifierRD.payload.identifiers; - } else { - return null; - } - }), - ); - } + this.item = rd.payload; + this.itemPageRoute = getItemPageRoute(this.item); + this.identifiers$ = this.identifierDataService.getIdentifierDataFor(this.item).pipe( + map((identifierRD) => { + if (identifierRD.statusCode !== 401 && hasValue(identifierRD.payload)) { + return identifierRD.payload.identifiers; + } else { + return null; + } + }), + ); + } ); this.confirmMessage = 'item.edit.' + this.messageKey + '.confirm'; diff --git a/src/app/item-page/edit-item-page/item-relationships/edit-relationship-list/edit-relationship-list.component.ts b/src/app/item-page/edit-item-page/item-relationships/edit-relationship-list/edit-relationship-list.component.ts index 4f7ece790f..5801c2f6ff 100644 --- a/src/app/item-page/edit-item-page/item-relationships/edit-relationship-list/edit-relationship-list.component.ts +++ b/src/app/item-page/edit-item-page/item-relationships/edit-relationship-list/edit-relationship-list.component.ts @@ -284,15 +284,15 @@ export class EditRelationshipListComponent implements OnInit, OnDestroy { const relatedItem = searchResult.indexableObject; subscriptions.push(this.relationshipService.getNameVariant(this.listId, relatedItem.uuid).pipe( map((nameVariant) => { - const update = { - uuid: this.relationshipType.id + '-' + searchResult.indexableObject.uuid, - nameVariant, - type: this.relationshipType, - relatedItem, - } as RelationshipIdentifiable; - this.objectUpdatesService.saveAddFieldUpdate(this.url, update); - return update; - }) + const update = { + uuid: this.relationshipType.id + '-' + searchResult.indexableObject.uuid, + nameVariant, + type: this.relationshipType, + relatedItem, + } as RelationshipIdentifiable; + this.objectUpdatesService.saveAddFieldUpdate(this.url, update); + return update; + }) )); }); @@ -361,21 +361,21 @@ export class EditRelationshipListComponent implements OnInit, OnDestroy { let apiCall; if (isLeft) { apiCall = this.relationshipService.searchByItemsAndType( this.relationshipType.id, this.item.uuid, this.relationshipType.leftwardType ,[relatedItem.id] ).pipe( - getFirstSucceededRemoteData(), - getRemoteDataPayload(), - ); + getFirstSucceededRemoteData(), + getRemoteDataPayload(), + ); } else { apiCall = this.relationshipService.searchByItemsAndType( this.relationshipType.id, this.item.uuid, this.relationshipType.rightwardType ,[relatedItem.id] ).pipe( - getFirstSucceededRemoteData(), - getRemoteDataPayload(), - ); + getFirstSucceededRemoteData(), + getRemoteDataPayload(), + ); } return apiCall.pipe( map( (res: PaginatedList) => res.page[0]) ); } - )); + )); } @@ -398,7 +398,7 @@ export class EditRelationshipListComponent implements OnInit, OnDestroy { defaultIfEmpty([]), map((relatedItems) => { return identifiables.filter( (identifiable, index) => { - return relatedItems[index].uuid === relatedItem.uuid; + return relatedItems[index].uuid === relatedItem.uuid; }); } ), @@ -555,7 +555,7 @@ export class EditRelationshipListComponent implements OnInit, OnDestroy { toArray(), // if the pipe above completes without emitting anything, emit an empty array instead defaultIfEmpty([]) - )), + )), switchMap((nextFields: RelationshipIdentifiable[]) => { // Get a list that contains the unsaved changes for the page, as well as the page of // RelationshipIdentifiables, as a single list of FieldUpdates diff --git a/src/app/item-page/edit-item-page/item-relationships/item-relationships.component.ts b/src/app/item-page/edit-item-page/item-relationships/item-relationships.component.ts index 8f7c43e79f..803e3fda3f 100644 --- a/src/app/item-page/edit-item-page/item-relationships/item-relationships.component.ts +++ b/src/app/item-page/edit-item-page/item-relationships/item-relationships.component.ts @@ -78,9 +78,9 @@ export class ItemRelationshipsComponent extends AbstractItemUpdateComponent { const label = this.item.firstMetadataValue('dspace.entity.type'); if (label !== undefined) { this.relationshipTypes$ = this.relationshipTypeService.searchByEntityType(label, true, true, ...this.getRelationshipTypeFollowLinks()) - .pipe( - map((relationshipTypes: PaginatedList) => relationshipTypes.page) - ); + .pipe( + map((relationshipTypes: PaginatedList) => relationshipTypes.page) + ); this.entityType$ = this.entityTypeService.getEntityTypeByLabel(label).pipe( getFirstSucceededRemoteData(), @@ -155,18 +155,18 @@ export class ItemRelationshipsComponent extends AbstractItemUpdateComponent { deleteRelationships(deleteRelationshipIDs: DeleteRelationship[]): Observable[]> { return observableZip(...deleteRelationshipIDs.map((deleteRelationship) => { - let copyVirtualMetadata: string; - if (deleteRelationship.keepLeftVirtualMetadata && deleteRelationship.keepRightVirtualMetadata) { - copyVirtualMetadata = 'all'; - } else if (deleteRelationship.keepLeftVirtualMetadata) { - copyVirtualMetadata = 'left'; - } else if (deleteRelationship.keepRightVirtualMetadata) { - copyVirtualMetadata = 'right'; - } else { - copyVirtualMetadata = 'none'; - } - return this.relationshipService.deleteRelationship(deleteRelationship.uuid, copyVirtualMetadata); + let copyVirtualMetadata: string; + if (deleteRelationship.keepLeftVirtualMetadata && deleteRelationship.keepRightVirtualMetadata) { + copyVirtualMetadata = 'all'; + } else if (deleteRelationship.keepLeftVirtualMetadata) { + copyVirtualMetadata = 'left'; + } else if (deleteRelationship.keepRightVirtualMetadata) { + copyVirtualMetadata = 'right'; + } else { + copyVirtualMetadata = 'none'; } + return this.relationshipService.deleteRelationship(deleteRelationship.uuid, copyVirtualMetadata); + } )); } diff --git a/src/app/item-page/edit-item-page/item-status/item-status.component.ts b/src/app/item-page/edit-item-page/item-status/item-status.component.ts index be7e6bc907..bda994017e 100644 --- a/src/app/item-page/edit-item-page/item-status/item-status.component.ts +++ b/src/app/item-page/edit-item-page/item-status/item-status.component.ts @@ -170,7 +170,7 @@ export class ItemStatusComponent implements OnInit { map((enabled: boolean) => { return enabled && (pending || no_doi); } - )); + )); }), // Switch map pushes the register DOI operation onto a copy of the base array then returns to the pipe switchMap((showDoi: boolean) => { diff --git a/src/app/item-page/edit-item-page/simple-item-action/abstract-simple-item-action.component.ts b/src/app/item-page/edit-item-page/simple-item-action/abstract-simple-item-action.component.ts index 5f215864cf..a85462d23b 100644 --- a/src/app/item-page/edit-item-page/simple-item-action/abstract-simple-item-action.component.ts +++ b/src/app/item-page/edit-item-page/simple-item-action/abstract-simple-item-action.component.ts @@ -51,9 +51,9 @@ export class AbstractSimpleItemActionComponent implements OnInit { )as Observable>; this.itemRD$.pipe(first()).subscribe((rd) => { - this.item = rd.payload; - this.itemPageRoute = getItemPageRoute(this.item); - } + this.item = rd.payload; + this.itemPageRoute = getItemPageRoute(this.item); + } ); this.confirmMessage = 'item.edit.' + this.messageKey + '.confirm'; diff --git a/src/app/item-page/full/field-components/file-section/full-file-section.component.ts b/src/app/item-page/full/field-components/file-section/full-file-section.component.ts index d34edeb025..fef340c6c1 100644 --- a/src/app/item-page/full/field-components/file-section/full-file-section.component.ts +++ b/src/app/item-page/full/field-components/file-section/full-file-section.component.ts @@ -75,10 +75,10 @@ export class FullFileSectionComponent extends FileSectionComponent implements On followLink('thumbnail'), )), tap((rd: RemoteData>) => { - if (hasValue(rd.errorMessage)) { - this.notificationsService.error(this.translateService.get('file-section.error.header'), `${rd.statusCode} ${rd.errorMessage}`); - } + if (hasValue(rd.errorMessage)) { + this.notificationsService.error(this.translateService.get('file-section.error.header'), `${rd.statusCode} ${rd.errorMessage}`); } + } ) ); @@ -93,10 +93,10 @@ export class FullFileSectionComponent extends FileSectionComponent implements On followLink('thumbnail'), )), tap((rd: RemoteData>) => { - if (hasValue(rd.errorMessage)) { - this.notificationsService.error(this.translateService.get('file-section.error.header'), `${rd.statusCode} ${rd.errorMessage}`); - } + if (hasValue(rd.errorMessage)) { + this.notificationsService.error(this.translateService.get('file-section.error.header'), `${rd.statusCode} ${rd.errorMessage}`); } + } ) ); diff --git a/src/app/item-page/full/full-item-page.component.ts b/src/app/item-page/full/full-item-page.component.ts index 31dd2c5fc2..5c813ecb87 100644 --- a/src/app/item-page/full/full-item-page.component.ts +++ b/src/app/item-page/full/full-item-page.component.ts @@ -69,8 +69,8 @@ export class FullItemPageComponent extends ItemPageComponent implements OnInit, map((item: Item) => item.metadata),); this.subs.push(this.route.data.subscribe((data: Data) => { - this.fromSubmissionObject = hasValue(data.wfi) || hasValue(data.wsi); - }) + this.fromSubmissionObject = hasValue(data.wfi) || hasValue(data.wsi); + }) ); } diff --git a/src/app/item-page/media-viewer/media-viewer-video/language-helper.ts b/src/app/item-page/media-viewer/media-viewer-video/language-helper.ts index b27ab9983f..49063c6cbe 100644 --- a/src/app/item-page/media-viewer/media-viewer-video/language-helper.ts +++ b/src/app/item-page/media-viewer/media-viewer-video/language-helper.ts @@ -2,188 +2,188 @@ export const languageHelper = { ab: 'Abkhazian', aa: 'Afar', af: 'Afrikaans', - ak: 'Akan', - sq: 'Albanian', - am: 'Amharic', - ar: 'Arabic', - an: 'Aragonese', - hy: 'Armenian', - as: 'Assamese', + ak: 'Akan', + sq: 'Albanian', + am: 'Amharic', + ar: 'Arabic', + an: 'Aragonese', + hy: 'Armenian', + as: 'Assamese', av: 'Avaric', - ae: 'Avestan', - ay: 'Aymara', - az: 'Azerbaijani', - bm: 'Bambara', - ba: 'Bashkir', - eu: 'Basque', - be: 'Belarusian', - bn: 'Bengali (Bangla)', - bh: 'Bihari', - bi: 'Bislama', - bs: 'Bosnian', - br: 'Breton', - bg: 'Bulgarian', - my: 'Burmese', - ca: 'Catalan', - ch: 'Chamorro', - ce: 'Chechen', - ny: 'Chichewa, Chewa, Nyanja', - zh: 'Chinese', - cv: 'Chuvash', - kw: 'Cornish', - co: 'Corsican', - cr: 'Cree', - hr: 'Croatian', - cs: 'Czech', - da: 'Danish', + ae: 'Avestan', + ay: 'Aymara', + az: 'Azerbaijani', + bm: 'Bambara', + ba: 'Bashkir', + eu: 'Basque', + be: 'Belarusian', + bn: 'Bengali (Bangla)', + bh: 'Bihari', + bi: 'Bislama', + bs: 'Bosnian', + br: 'Breton', + bg: 'Bulgarian', + my: 'Burmese', + ca: 'Catalan', + ch: 'Chamorro', + ce: 'Chechen', + ny: 'Chichewa, Chewa, Nyanja', + zh: 'Chinese', + cv: 'Chuvash', + kw: 'Cornish', + co: 'Corsican', + cr: 'Cree', + hr: 'Croatian', + cs: 'Czech', + da: 'Danish', dv: 'Divehi, Dhivehi, Maldivian', - nl: 'Dutch', - dz: 'Dzongkha', - en: 'English', - eo: 'Esperanto', - et: 'Estonian', - ee: 'Ewe', - fo: 'Faroese', - fj: 'Fijian', - fi: 'Finnish', - fr: 'French', - ff: 'Fula, Fulah, Pulaar, Pular', - gl: 'Galician', - gd: 'Gaelic (Scottish)', - gv: 'Gaelic (Manx)', - ka: 'Georgian', - de: 'German', - el: 'Greek', + nl: 'Dutch', + dz: 'Dzongkha', + en: 'English', + eo: 'Esperanto', + et: 'Estonian', + ee: 'Ewe', + fo: 'Faroese', + fj: 'Fijian', + fi: 'Finnish', + fr: 'French', + ff: 'Fula, Fulah, Pulaar, Pular', + gl: 'Galician', + gd: 'Gaelic (Scottish)', + gv: 'Gaelic (Manx)', + ka: 'Georgian', + de: 'German', + el: 'Greek', gn: 'Guarani', - gu: 'Gujarati', - ht: 'Haitian Creole', - ha: 'Hausa', - he: 'Hebrew', - hz: 'Herero', - hi: 'Hindi', - ho: 'Hiri Motu', - hu: 'Hungarian', - is: 'Icelandic', - io: 'Ido', - ig: 'Igbo', + gu: 'Gujarati', + ht: 'Haitian Creole', + ha: 'Hausa', + he: 'Hebrew', + hz: 'Herero', + hi: 'Hindi', + ho: 'Hiri Motu', + hu: 'Hungarian', + is: 'Icelandic', + io: 'Ido', + ig: 'Igbo', in: 'Indonesian', - ia: 'Interlingua', - ie: 'Interlingue', - iu: 'Inuktitut', - ik: 'Inupiak', - ga: 'Irish', - it: 'Italian', - ja: 'Japanese', - jv: 'Javanese', - kl: 'Kalaallisut, Greenlandic', - kn: 'Kannada', - kr: 'Kanuri', - ks: 'Kashmiri', - kk: 'Kazakh', - km: 'Khmer', - ki: 'Kikuyu', - rw: 'Kinyarwanda (Rwanda)', - rn: 'Kirundi', - ky: 'Kyrgyz', - kv: 'Komi', - kg: 'Kongo', - ko: 'Korean', - ku: 'Kurdish', - kj: 'Kwanyama', - lo: 'Lao', - la: 'Latin', - lv: 'Latvian (Lettish)', - li: 'Limburgish ( Limburger)', - ln: 'Lingala', - lt: 'Lithuanian', - lu: 'Luga-Katanga', - lg: 'Luganda, Ganda', - lb: 'Luxembourgish', - mk: 'Macedonian', - mg: 'Malagasy', - ms: 'Malay', - ml: 'Malayalam', - mt: 'Maltese', - mi: 'Maori', - mr: 'Marathi', - mh: 'Marshallese', - mo: 'Moldavian', - mn: 'Mongolian', - na: 'Nauru', - nv: 'Navajo', - ng: 'Ndonga', - nd: 'Northern Ndebele', - ne: 'Nepali', - no: 'Norwegian', - nb: 'Norwegian bokmål', - nn: 'Norwegian nynorsk', - oc: 'Occitan', - oj: 'Ojibwe', - cu: 'Old Church Slavonic, Old Bulgarian', - or: 'Oriya', - om: 'Oromo (Afaan Oromo)', - os: 'Ossetian', - pi: 'Pāli', - ps: 'Pashto, Pushto', - fa: 'Persian (Farsi)', - pl: 'Polish', - pt: 'Portuguese', - pa: 'Punjabi (Eastern)', - qu: 'Quechua', - rm: 'Romansh', - ro: 'Romanian', - ru: 'Russian', - se: 'Sami', - sm: 'Samoan', - sg: 'Sango', - sa: 'Sanskrit', - sr: 'Serbian', - sh: 'Serbo-Croatian', - st: 'Sesotho', - tn: 'Setswana', - sn: 'Shona', - ii: 'Sichuan Yi, Nuosu', - sd: 'Sindhi', - si: 'Sinhalese', - ss: 'Siswati (Swati)', - sk: 'Slovak', - sl: 'Slovenian', - so: 'Somali', - nr: 'Southern Ndebele', - es: 'Spanish', - su: 'Sundanese', - sw: 'Swahili (Kiswahili)', - sv: 'Swedish', - tl: 'Tagalog', - ty: 'Tahitian', - tg: 'Tajik', - ta: 'Tamil', - tt: 'Tatar', - te: 'Telugu', - th: 'Thai', - bo: 'Tibetan', - ti: 'Tigrinya', - to: 'Tonga', - ts: 'Tsonga', - tr: 'Turkish', - tk: 'Turkmen', - tw: 'Twi', - ug: 'Uyghur', - uk: 'Ukrainian', - ur: 'Urdu', - uz: 'Uzbek', - ve: 'Venda', - vi: 'Vietnamese', - vo: 'Volapük', - wa: 'Wallon', - cy: 'Welsh', - wo: 'Wolof', - fy: 'Western Frisian', - xh: 'Xhosa', + ia: 'Interlingua', + ie: 'Interlingue', + iu: 'Inuktitut', + ik: 'Inupiak', + ga: 'Irish', + it: 'Italian', + ja: 'Japanese', + jv: 'Javanese', + kl: 'Kalaallisut, Greenlandic', + kn: 'Kannada', + kr: 'Kanuri', + ks: 'Kashmiri', + kk: 'Kazakh', + km: 'Khmer', + ki: 'Kikuyu', + rw: 'Kinyarwanda (Rwanda)', + rn: 'Kirundi', + ky: 'Kyrgyz', + kv: 'Komi', + kg: 'Kongo', + ko: 'Korean', + ku: 'Kurdish', + kj: 'Kwanyama', + lo: 'Lao', + la: 'Latin', + lv: 'Latvian (Lettish)', + li: 'Limburgish ( Limburger)', + ln: 'Lingala', + lt: 'Lithuanian', + lu: 'Luga-Katanga', + lg: 'Luganda, Ganda', + lb: 'Luxembourgish', + mk: 'Macedonian', + mg: 'Malagasy', + ms: 'Malay', + ml: 'Malayalam', + mt: 'Maltese', + mi: 'Maori', + mr: 'Marathi', + mh: 'Marshallese', + mo: 'Moldavian', + mn: 'Mongolian', + na: 'Nauru', + nv: 'Navajo', + ng: 'Ndonga', + nd: 'Northern Ndebele', + ne: 'Nepali', + no: 'Norwegian', + nb: 'Norwegian bokmål', + nn: 'Norwegian nynorsk', + oc: 'Occitan', + oj: 'Ojibwe', + cu: 'Old Church Slavonic, Old Bulgarian', + or: 'Oriya', + om: 'Oromo (Afaan Oromo)', + os: 'Ossetian', + pi: 'Pāli', + ps: 'Pashto, Pushto', + fa: 'Persian (Farsi)', + pl: 'Polish', + pt: 'Portuguese', + pa: 'Punjabi (Eastern)', + qu: 'Quechua', + rm: 'Romansh', + ro: 'Romanian', + ru: 'Russian', + se: 'Sami', + sm: 'Samoan', + sg: 'Sango', + sa: 'Sanskrit', + sr: 'Serbian', + sh: 'Serbo-Croatian', + st: 'Sesotho', + tn: 'Setswana', + sn: 'Shona', + ii: 'Sichuan Yi, Nuosu', + sd: 'Sindhi', + si: 'Sinhalese', + ss: 'Siswati (Swati)', + sk: 'Slovak', + sl: 'Slovenian', + so: 'Somali', + nr: 'Southern Ndebele', + es: 'Spanish', + su: 'Sundanese', + sw: 'Swahili (Kiswahili)', + sv: 'Swedish', + tl: 'Tagalog', + ty: 'Tahitian', + tg: 'Tajik', + ta: 'Tamil', + tt: 'Tatar', + te: 'Telugu', + th: 'Thai', + bo: 'Tibetan', + ti: 'Tigrinya', + to: 'Tonga', + ts: 'Tsonga', + tr: 'Turkish', + tk: 'Turkmen', + tw: 'Twi', + ug: 'Uyghur', + uk: 'Ukrainian', + ur: 'Urdu', + uz: 'Uzbek', + ve: 'Venda', + vi: 'Vietnamese', + vo: 'Volapük', + wa: 'Wallon', + cy: 'Welsh', + wo: 'Wolof', + fy: 'Western Frisian', + xh: 'Xhosa', yi: 'Yiddish', - yo: 'Yoruba', - za: 'Zhuang, Chuang', - zu: 'Zulu' + yo: 'Yoruba', + za: 'Zhuang, Chuang', + zu: 'Zulu' }; diff --git a/src/app/item-page/mirador-viewer/mirador-viewer.component.spec.ts b/src/app/item-page/mirador-viewer/mirador-viewer.component.spec.ts index 2727391dff..c35c9ee96d 100644 --- a/src/app/item-page/mirador-viewer/mirador-viewer.component.spec.ts +++ b/src/app/item-page/mirador-viewer/mirador-viewer.component.spec.ts @@ -118,7 +118,7 @@ describe('MiradorViewerComponent with multiple images', () => { set: { providers: [ { provide: MiradorViewerService, useValue: viewerService } - ] + ] } }).compileComponents(); })); diff --git a/src/app/item-page/mirador-viewer/mirador-viewer.component.ts b/src/app/item-page/mirador-viewer/mirador-viewer.component.ts index fee8046272..575abea86c 100644 --- a/src/app/item-page/mirador-viewer/mirador-viewer.component.ts +++ b/src/app/item-page/mirador-viewer/mirador-viewer.component.ts @@ -104,10 +104,10 @@ export class MiradorViewerComponent implements OnInit { // menu by hiding it for smaller viewports. This will not be // responsive to resizing. this.hostWindowService.widthCategory - .pipe(take(1)) - .subscribe((category: WidthCategory) => { - this.notMobile = !(category === WidthCategory.XS || category === WidthCategory.SM); - }); + .pipe(take(1)) + .subscribe((category: WidthCategory) => { + this.notMobile = !(category === WidthCategory.XS || category === WidthCategory.SM); + }); // Set the multi property. The default mirador configuration adds a right // thumbnail navigation panel to the viewer when multi is 'true'. diff --git a/src/app/item-page/mirador-viewer/mirador-viewer.service.ts b/src/app/item-page/mirador-viewer/mirador-viewer.service.ts index c7a0affd53..24154334c6 100644 --- a/src/app/item-page/mirador-viewer/mirador-viewer.service.ts +++ b/src/app/item-page/mirador-viewer/mirador-viewer.service.ts @@ -2,7 +2,7 @@ import { Injectable, isDevMode } from '@angular/core'; import { Observable } from 'rxjs'; import { Item } from '../../core/shared/item.model'; import { - getFirstCompletedRemoteData, + getFirstCompletedRemoteData, } from '../../core/shared/operators'; import { filter, last, map, mergeMap, switchMap } from 'rxjs/operators'; import { RemoteData } from '../../core/data/remote-data'; @@ -39,43 +39,43 @@ export class MiradorViewerService { */ getImageCount(item: Item, bitstreamDataService: BitstreamDataService, bundleDataService: BundleDataService): Observable { - let count = 0; - return bundleDataService.findAllByItem(item).pipe( + let count = 0; + return bundleDataService.findAllByItem(item).pipe( + getFirstCompletedRemoteData(), + map((bundlesRD: RemoteData>) => { + return bundlesRD.payload; + }), + map((paginatedList: PaginatedList) => paginatedList.page), + switchMap((bundles: Bundle[]) => bundles), + filter((b: Bundle) => this.isIiifBundle(b.name)), + mergeMap((bundle: Bundle) => { + return bitstreamDataService.findAllByItemAndBundleName(item, bundle.name, { + currentPage: 1, + elementsPerPage: 5 + }, true, true, ...this.LINKS_TO_FOLLOW).pipe( getFirstCompletedRemoteData(), - map((bundlesRD: RemoteData>) => { - return bundlesRD.payload; + map((bitstreamsRD: RemoteData>) => { + return bitstreamsRD.payload; }), - map((paginatedList: PaginatedList) => paginatedList.page), - switchMap((bundles: Bundle[]) => bundles), - filter((b: Bundle) => this.isIiifBundle(b.name)), - mergeMap((bundle: Bundle) => { - return bitstreamDataService.findAllByItemAndBundleName(item, bundle.name, { - currentPage: 1, - elementsPerPage: 5 - }, true, true, ...this.LINKS_TO_FOLLOW).pipe( - getFirstCompletedRemoteData(), - map((bitstreamsRD: RemoteData>) => { - return bitstreamsRD.payload; - }), - map((paginatedList: PaginatedList) => paginatedList.page), - switchMap((bitstreams: Bitstream[]) => bitstreams), - switchMap((bitstream: Bitstream) => bitstream.format.pipe( - getFirstCompletedRemoteData(), - map((formatRD: RemoteData) => { - return formatRD.payload; - }), - map((format: BitstreamFormat) => { - if (format.mimetype.includes('image')) { - count++; - } - return count; - }), - ) - ) - ); - }), - last() - ); + map((paginatedList: PaginatedList) => paginatedList.page), + switchMap((bitstreams: Bitstream[]) => bitstreams), + switchMap((bitstream: Bitstream) => bitstream.format.pipe( + getFirstCompletedRemoteData(), + map((formatRD: RemoteData) => { + return formatRD.payload; + }), + map((format: BitstreamFormat) => { + if (format.mimetype.includes('image')) { + count++; + } + return count; + }), + ) + ) + ); + }), + last() + ); } isIiifBundle(bundleName: string): boolean { diff --git a/src/app/item-page/simple/field-components/file-section/themed-file-section.component.ts b/src/app/item-page/simple/field-components/file-section/themed-file-section.component.ts index ba5a9e87c0..ef6c879c94 100644 --- a/src/app/item-page/simple/field-components/file-section/themed-file-section.component.ts +++ b/src/app/item-page/simple/field-components/file-section/themed-file-section.component.ts @@ -4,8 +4,8 @@ import {Component, Input} from '@angular/core'; import {Item} from '../../../../core/shared/item.model'; @Component({ - selector: 'ds-themed-item-page-file-section', - templateUrl: '../../../../shared/theme-support/themed.component.html', + selector: 'ds-themed-item-page-file-section', + templateUrl: '../../../../shared/theme-support/themed.component.html', }) export class ThemedFileSectionComponent extends ThemedComponent { @@ -14,15 +14,15 @@ export class ThemedFileSectionComponent extends ThemedComponent { - return import(`../../../../../themes/${themeName}/app/item-page/simple/field-components/file-section/file-section.component`); + return import(`../../../../../themes/${themeName}/app/item-page/simple/field-components/file-section/file-section.component`); } protected importUnthemedComponent(): Promise { - return import(`./file-section.component`); + return import(`./file-section.component`); } } diff --git a/src/app/item-page/simple/field-components/specific-field/abstract/item-page-abstract-field.component.ts b/src/app/item-page/simple/field-components/specific-field/abstract/item-page-abstract-field.component.ts index f29bef31a7..0f180f421a 100644 --- a/src/app/item-page/simple/field-components/specific-field/abstract/item-page-abstract-field.component.ts +++ b/src/app/item-page/simple/field-components/specific-field/abstract/item-page-abstract-field.component.ts @@ -4,8 +4,8 @@ import { Item } from '../../../../../core/shared/item.model'; import { ItemPageFieldComponent } from '../item-page-field.component'; @Component({ - selector: 'ds-item-page-abstract-field', - templateUrl: '../item-page-field.component.html' + selector: 'ds-item-page-abstract-field', + templateUrl: '../item-page-field.component.html' }) /** * This component is used for displaying the abstract (dc.description.abstract) of an item @@ -28,7 +28,7 @@ export class ItemPageAbstractFieldComponent extends ItemPageFieldComponent { * In this component, we want to display values for metadata 'dc.description.abstract' */ fields: string[] = [ - 'dc.description.abstract' + 'dc.description.abstract' ]; /** diff --git a/src/app/item-page/simple/field-components/specific-field/date/item-page-date-field.component.ts b/src/app/item-page/simple/field-components/specific-field/date/item-page-date-field.component.ts index 5a7d56b7da..64da8a1c26 100644 --- a/src/app/item-page/simple/field-components/specific-field/date/item-page-date-field.component.ts +++ b/src/app/item-page/simple/field-components/specific-field/date/item-page-date-field.component.ts @@ -4,8 +4,8 @@ import { Item } from '../../../../../core/shared/item.model'; import { ItemPageFieldComponent } from '../item-page-field.component'; @Component({ - selector: 'ds-item-page-date-field', - templateUrl: '../item-page-field.component.html' + selector: 'ds-item-page-date-field', + templateUrl: '../item-page-field.component.html' }) /** * This component is used for displaying the issue date (dc.date.issued) metadata of an item @@ -28,7 +28,7 @@ export class ItemPageDateFieldComponent extends ItemPageFieldComponent { * In this component, we want to display values for metadata 'dc.date.issued' */ fields: string[] = [ - 'dc.date.issued' + 'dc.date.issued' ]; /** diff --git a/src/app/item-page/simple/field-components/specific-field/item-page-field.component.ts b/src/app/item-page/simple/field-components/specific-field/item-page-field.component.ts index fc526dabcc..1527db1f5f 100644 --- a/src/app/item-page/simple/field-components/specific-field/item-page-field.component.ts +++ b/src/app/item-page/simple/field-components/specific-field/item-page-field.component.ts @@ -13,12 +13,12 @@ import { getRemoteDataPayload } from '../../../../core/shared/operators'; */ @Component({ - templateUrl: './item-page-field.component.html' + templateUrl: './item-page-field.component.html' }) export class ItemPageFieldComponent { - constructor(protected browseDefinitionDataService: BrowseDefinitionDataService) { - } + constructor(protected browseDefinitionDataService: BrowseDefinitionDataService) { + } /** * The item to display metadata for diff --git a/src/app/item-page/simple/item-types/shared/item.component.spec.ts b/src/app/item-page/simple/item-types/shared/item.component.spec.ts index 5bf08fc004..4737b1b8a8 100644 --- a/src/app/item-page/simple/item-types/shared/item.component.spec.ts +++ b/src/app/item-page/simple/item-types/shared/item.component.spec.ts @@ -101,13 +101,13 @@ export function getItemPageFieldsTest(mockItem: Item, component) { TestBed.configureTestingModule({ imports: [ - TranslateModule.forRoot({ - loader: { - provide: TranslateLoader, - useClass: TranslateLoaderMock - } - }), - RouterTestingModule, + TranslateModule.forRoot({ + loader: { + provide: TranslateLoader, + useClass: TranslateLoaderMock + } + }), + RouterTestingModule, ], declarations: [component, GenericItemPageFieldComponent, TruncatePipe], providers: [ diff --git a/src/app/item-page/simple/item-types/shared/item.component.ts b/src/app/item-page/simple/item-types/shared/item.component.ts index 93e6a0b346..96f211243e 100644 --- a/src/app/item-page/simple/item-types/shared/item.component.ts +++ b/src/app/item-page/simple/item-types/shared/item.component.ts @@ -61,12 +61,12 @@ export class ItemComponent implements OnInit { */ back = () => { this.routeService.getPreviousUrl().pipe( - take(1) - ).subscribe( - (url => { - this.router.navigateByUrl(url); - }) - ); + take(1) + ).subscribe( + (url => { + this.router.navigateByUrl(url); + }) + ); }; ngOnInit(): void { diff --git a/src/app/item-page/simple/related-items/related-items-component.ts b/src/app/item-page/simple/related-items/related-items-component.ts index 29b7425314..8504cbd3f3 100644 --- a/src/app/item-page/simple/related-items/related-items-component.ts +++ b/src/app/item-page/simple/related-items/related-items-component.ts @@ -66,7 +66,7 @@ export class RelatedItemsComponent extends AbstractIncrementalListComponent(); + response = new EventEmitter(); versionNumber: number; diff --git a/src/app/item-page/versions/item-versions.component.ts b/src/app/item-page/versions/item-versions.component.ts index 700a35552c..923fff1f2b 100644 --- a/src/app/item-page/versions/item-versions.component.ts +++ b/src/app/item-page/versions/item-versions.component.ts @@ -243,14 +243,14 @@ export class ItemVersionsComponent implements OnDestroy, OnInit { return this.versionService.update(updatedVersion).pipe(getFirstCompletedRemoteData()); }), ).subscribe((updatedVersionRD: RemoteData) => { - if (updatedVersionRD.hasSucceeded) { - this.notificationsService.success(null, this.translateService.get(successMessageKey, {'version': this.versionBeingEditedNumber})); - this.getAllVersions(this.versionHistory$); - } else { - this.notificationsService.warning(null, this.translateService.get(failureMessageKey, {'version': this.versionBeingEditedNumber})); - } - this.disableVersionEditing(); + if (updatedVersionRD.hasSucceeded) { + this.notificationsService.success(null, this.translateService.get(successMessageKey, {'version': this.versionBeingEditedNumber})); + this.getAllVersions(this.versionHistory$); + } else { + this.notificationsService.warning(null, this.translateService.get(failureMessageKey, {'version': this.versionBeingEditedNumber})); } + this.disableVersionEditing(); + } ); } diff --git a/src/app/my-dspace-page/collection-selector/collection-selector.component.spec.ts b/src/app/my-dspace-page/collection-selector/collection-selector.component.spec.ts index af043b447b..50de38826e 100644 --- a/src/app/my-dspace-page/collection-selector/collection-selector.component.spec.ts +++ b/src/app/my-dspace-page/collection-selector/collection-selector.component.spec.ts @@ -123,7 +123,7 @@ describe('CollectionSelectorComponent', () => { ], schemas: [NO_ERRORS_SCHEMA] }) - .compileComponents(); + .compileComponents(); })); beforeEach(() => { diff --git a/src/app/my-dspace-page/my-dspace-new-submission/my-dspace-new-submission.component.ts b/src/app/my-dspace-page/my-dspace-new-submission/my-dspace-new-submission.component.ts index 0694fc63bf..0d5018b6b0 100644 --- a/src/app/my-dspace-page/my-dspace-new-submission/my-dspace-new-submission.component.ts +++ b/src/app/my-dspace-page/my-dspace-new-submission/my-dspace-new-submission.component.ts @@ -72,10 +72,10 @@ export class MyDSpaceNewSubmissionComponent implements OnDestroy, OnInit { ngOnInit() { this.uploadFilesOptions.autoUpload = false; this.sub = this.halService.getEndpoint('workspaceitems').pipe(first()).subscribe((url) => { - this.uploadFilesOptions.url = url; - this.uploadFilesOptions.authToken = this.authService.buildAuthHeader(); - this.changeDetectorRef.detectChanges(); - } + this.uploadFilesOptions.url = url; + this.uploadFilesOptions.authToken = this.authService.buildAuthHeader(); + this.changeDetectorRef.detectChanges(); + } ); } diff --git a/src/app/navbar/navbar.effects.ts b/src/app/navbar/navbar.effects.ts index dc3a29e1bf..4da48a9e91 100644 --- a/src/app/navbar/navbar.effects.ts +++ b/src/app/navbar/navbar.effects.ts @@ -21,7 +21,7 @@ export class NavbarEffects { * Effect that collapses the public menu on window resize * @type {Observable} */ - resize$ = createEffect(() => this.actions$ + resize$ = createEffect(() => this.actions$ .pipe( ofType(HostWindowActionTypes.RESIZE), map(() => new CollapseMenuAction(this.menuID)) @@ -31,7 +31,7 @@ export class NavbarEffects { * Effect that collapses the public menu on reroute * @type {Observable} */ - routeChange$ = createEffect(() => this.actions$ + routeChange$ = createEffect(() => this.actions$ .pipe( ofType(ROUTER_NAVIGATION), map(() => new CollapseMenuAction(this.menuID)) @@ -40,7 +40,7 @@ export class NavbarEffects { * Effect that collapses the public menu when the admin sidebar opens * @type {Observable} */ - openAdminSidebar$ = createEffect(() => this.actions$ + openAdminSidebar$ = createEffect(() => this.actions$ .pipe( ofType(MenuActionTypes.EXPAND_MENU_PREVIEW), switchMap((action: ExpandMenuPreviewAction) => { diff --git a/src/app/process-page/detail/process-detail.component.ts b/src/app/process-page/detail/process-detail.component.ts index a043d60c57..c2b74a37c3 100644 --- a/src/app/process-page/detail/process-detail.component.ts +++ b/src/app/process-page/detail/process-detail.component.ts @@ -212,14 +212,14 @@ export class ProcessDetailComponent implements OnInit, OnDestroy { }) ); }); - this.outputLogFileUrl$.pipe(take(1), + this.outputLogFileUrl$.pipe(take(1), switchMap((url: string) => { return this.getTextFile(url); }), finalize(() => this.zone.run(() => this.retrievingOutputLogs$.next(false))) ).subscribe((logs: string) => { - this.outputLogs$.next(logs); - }); + this.outputLogs$.next(logs); + }); } getTextFile(filename: string): Observable { diff --git a/src/app/process-page/form/process-form.component.ts b/src/app/process-page/form/process-form.component.ts index 70eb3160a8..7960f81bf0 100644 --- a/src/app/process-page/form/process-form.component.ts +++ b/src/app/process-page/form/process-form.component.ts @@ -78,11 +78,11 @@ export class ProcessFormComponent implements OnInit { } const stringParameters: ProcessParameter[] = this.parameters.map((parameter: ProcessParameter) => { - return { - name: parameter.name, - value: this.checkValue(parameter) - }; - } + return { + name: parameter.name, + value: this.checkValue(parameter) + }; + } ); this.scriptService.invoke(this.selectedScript.id, stringParameters, this.files) .pipe(getFirstCompletedRemoteData()) diff --git a/src/app/process-page/form/script-help/script-help.component.spec.ts b/src/app/process-page/form/script-help/script-help.component.spec.ts index abfe8f9da1..731a663c91 100644 --- a/src/app/process-page/form/script-help/script-help.component.spec.ts +++ b/src/app/process-page/form/script-help/script-help.component.spec.ts @@ -40,7 +40,7 @@ describe('ScriptHelpComponent', () => { declarations: [ ScriptHelpComponent ], schemas: [NO_ERRORS_SCHEMA] }) - .compileComponents(); + .compileComponents(); })); beforeEach(() => { diff --git a/src/app/process-page/form/scripts-select/scripts-select.component.ts b/src/app/process-page/form/scripts-select/scripts-select.component.ts index 4c7fe3bdf7..f91eca68ee 100644 --- a/src/app/process-page/form/scripts-select/scripts-select.component.ts +++ b/src/app/process-page/form/scripts-select/scripts-select.component.ts @@ -95,7 +95,7 @@ export class ScriptsSelectComponent implements OnInit, OnDestroy { @Input() set script(value: Script) { - this._selectedScript = value; + this._selectedScript = value; } ngOnDestroy(): void { diff --git a/src/app/process-page/overview/process-overview.component.ts b/src/app/process-page/overview/process-overview.component.ts index 7fa3b12dac..2f7b16d687 100644 --- a/src/app/process-page/overview/process-overview.component.ts +++ b/src/app/process-page/overview/process-overview.component.ts @@ -124,10 +124,10 @@ export class ProcessOverviewComponent implements OnInit, OnDestroy { } this.isProcessingSub = this.processBulkDeleteService.isProcessing$() .subscribe((isProcessing) => { - if (!isProcessing) { - this.closeModal(); - this.setProcesses(); - } - }); + if (!isProcessing) { + this.closeModal(); + this.setProcesses(); + } + }); } } diff --git a/src/app/process-page/process-page-routing.paths.ts b/src/app/process-page/process-page-routing.paths.ts index d8a95d8177..781bf9a51c 100644 --- a/src/app/process-page/process-page-routing.paths.ts +++ b/src/app/process-page/process-page-routing.paths.ts @@ -3,7 +3,7 @@ import { URLCombiner } from '../core/url-combiner/url-combiner'; export const PROCESS_MODULE_PATH = 'processes'; export const getProcessListRoute = () => - `/${PROCESS_MODULE_PATH}`; + `/${PROCESS_MODULE_PATH}`; export const getProcessDetailRoute = (processId: string) => - new URLCombiner(getProcessListRoute(), processId).toString(); + new URLCombiner(getProcessListRoute(), processId).toString(); diff --git a/src/app/process-page/processes/process.model.ts b/src/app/process-page/processes/process.model.ts index d5f6e77d32..6468fe3bc8 100644 --- a/src/app/process-page/processes/process.model.ts +++ b/src/app/process-page/processes/process.model.ts @@ -26,55 +26,55 @@ export class Process implements CacheableObject { */ @excludeFromEquals @autoserialize - type: ResourceType; + type: ResourceType; /** * The identifier for this process */ @autoserialize - processId: string; + processId: string; /** * The UUID for the user that started the process */ @autoserialize - userId: string; + userId: string; /** * The start time for this process */ @autoserialize - startTime: string; + startTime: string; /** * The end time for this process */ @autoserialize - endTime: string; + endTime: string; /** * The name of the script run by this process */ @autoserialize - scriptName: string; + scriptName: string; /** * The status of this process */ @autoserialize - processStatus: ProcessStatus; + processStatus: ProcessStatus; /** * The parameters for this process */ @autoserialize - parameters: ProcessParameter[]; + parameters: ProcessParameter[]; /** * The {@link HALLink}s for this Process */ @deserialize - _links: { + _links: { self: HALLink, script: HALLink, output: HALLink, @@ -86,12 +86,12 @@ export class Process implements CacheableObject { * Will be undefined unless the script {@link HALLink} has been resolved. */ @link(SCRIPT) - script?: Observable>; + script?: Observable>; /** * The output logs created by this Process * Will be undefined unless the output {@link HALLink} has been resolved. */ @link(PROCESS_OUTPUT_TYPE) - output?: Observable>; + output?: Observable>; } diff --git a/src/app/process-page/scripts/script.model.ts b/src/app/process-page/scripts/script.model.ts index afb1d41524..a381d3b771 100644 --- a/src/app/process-page/scripts/script.model.ts +++ b/src/app/process-page/scripts/script.model.ts @@ -19,37 +19,37 @@ export class Script implements CacheableObject { */ @excludeFromEquals @autoserialize - type: ResourceType; + type: ResourceType; /** * The identifier of this script */ @autoserialize - id: string; + id: string; /** * The name of this script */ @autoserialize - name: string; + name: string; /** * A short description of this script */ @autoserialize - description: string; + description: string; /** * The available parameters for this script */ @autoserialize - parameters: ScriptParameter[]; + parameters: ScriptParameter[]; /** * The {@link HALLink}s for this Script */ @deserialize - _links: { + _links: { self: HALLink, }; } diff --git a/src/app/profile-page/profile-page-security-form/profile-page-security-form.component.ts b/src/app/profile-page/profile-page-security-form/profile-page-security-form.component.ts index 04292ea96e..48018e5191 100644 --- a/src/app/profile-page/profile-page-security-form/profile-page-security-form.component.ts +++ b/src/app/profile-page/profile-page-security-form/profile-page-security-form.component.ts @@ -57,13 +57,13 @@ export class ProfilePageSecurityFormComponent implements OnInit { * Indicates whether the "checkPasswordEmpty" needs to be added or not */ @Input() - passwordCanBeEmpty = true; + passwordCanBeEmpty = true; /** * Prefix for the form's label messages of this component */ @Input() - FORM_PREFIX: string; + FORM_PREFIX: string; private subs: Subscription[] = []; diff --git a/src/app/profile-page/profile-page.component.spec.ts b/src/app/profile-page/profile-page.component.spec.ts index 709ed56790..4d7083d07b 100644 --- a/src/app/profile-page/profile-page.component.spec.ts +++ b/src/app/profile-page/profile-page.component.spec.ts @@ -288,27 +288,27 @@ describe('ProfilePageComponent', () => { }); }); - describe('check for specialGroups', () => { - it('should contains specialGroups list', () => { - const specialGroupsEle = fixture.debugElement.query(By.css('[data-test="specialGroups"]')); - expect(specialGroupsEle).toBeTruthy(); - }); + describe('check for specialGroups', () => { + it('should contains specialGroups list', () => { + const specialGroupsEle = fixture.debugElement.query(By.css('[data-test="specialGroups"]')); + expect(specialGroupsEle).toBeTruthy(); + }); - it('should not contains specialGroups list', () => { - component.specialGroupsRD$ = null; - fixture.detectChanges(); - const specialGroupsEle = fixture.debugElement.query(By.css('[data-test="specialGroups"]')); - expect(specialGroupsEle).toBeFalsy(); - }); + it('should not contains specialGroups list', () => { + component.specialGroupsRD$ = null; + fixture.detectChanges(); + const specialGroupsEle = fixture.debugElement.query(By.css('[data-test="specialGroups"]')); + expect(specialGroupsEle).toBeFalsy(); + }); - it('should not contains specialGroups list', () => { - component.specialGroupsRD$ = EmptySpecialGroupDataMock$; - fixture.detectChanges(); - const specialGroupsEle = fixture.debugElement.query(By.css('[data-test="specialGroups"]')); - expect(specialGroupsEle).toBeFalsy(); + it('should not contains specialGroups list', () => { + component.specialGroupsRD$ = EmptySpecialGroupDataMock$; + fixture.detectChanges(); + const specialGroupsEle = fixture.debugElement.query(By.css('[data-test="specialGroups"]')); + expect(specialGroupsEle).toBeFalsy(); + }); }); }); - }); describe('isResearcherProfileEnabled', () => { diff --git a/src/app/register-email-form/register-email-form.component.ts b/src/app/register-email-form/register-email-form.component.ts index 37cae4cf9f..0c5ea0e25c 100644 --- a/src/app/register-email-form/register-email-form.component.ts +++ b/src/app/register-email-form/register-email-form.component.ts @@ -39,13 +39,13 @@ export class RegisterEmailFormComponent implements OnDestroy, OnInit { * The message prefix */ @Input() - MESSAGE_PREFIX: string; + MESSAGE_PREFIX: string; /** * Type of register request to be done, register new email or forgot password (same endpoint) */ @Input() - typeRequest: string = null; + typeRequest: string = null; public AlertTypeEnum = AlertType; @@ -165,13 +165,13 @@ export class RegisterEmailFormComponent implements OnDestroy, OnInit { }), take(1), ).subscribe((token) => { - if (isNotEmpty(token)) { - this.registration(token); - } else { - console.error('reCaptcha error'); - this.showNotification('error'); - } + if (isNotEmpty(token)) { + this.registration(token); + } else { + console.error('reCaptcha error'); + this.showNotification('error'); } + } )); } else { this.registration(); @@ -191,7 +191,7 @@ export class RegisterEmailFormComponent implements OnDestroy, OnInit { this.notificationService.success(this.translateService.get(`${this.MESSAGE_PREFIX}.success.head`), this.translateService.get(`${this.MESSAGE_PREFIX}.success.content`, {email: this.email.value})); this.router.navigate(['/home']); - } else if (response.statusCode === 422) { + } else if (response.statusCode === 422) { this.notificationService.error(this.translateService.get(`${this.MESSAGE_PREFIX}.error.head`), this.translateService.get(`${this.MESSAGE_PREFIX}.error.maildomain`, {domains: this.validMailDomains.join(', ')})); } else { this.notificationService.error(this.translateService.get(`${this.MESSAGE_PREFIX}.error.head`), diff --git a/src/app/register-page/create-profile/create-profile.component.spec.ts b/src/app/register-page/create-profile/create-profile.component.spec.ts index d5a1fea8b2..c21fc034b1 100644 --- a/src/app/register-page/create-profile/create-profile.component.spec.ts +++ b/src/app/register-page/create-profile/create-profile.component.spec.ts @@ -53,24 +53,24 @@ describe('CreateProfileComponent', () => { value: 'First' } ], - 'eperson.lastname': [ + 'eperson.lastname': [ { value: 'Last' }, ], - 'eperson.phone': [ + 'eperson.phone': [ { value: 'Phone' } ], - 'eperson.language': [ + 'eperson.language': [ { value: 'en' } ] }, email: 'test@email.org', - password: 'password', + password: 'password', canLogIn: true, requireCertificate: false }; diff --git a/src/app/request-copy/deny-request-copy/themed-deny-request-copy.component.ts b/src/app/request-copy/deny-request-copy/themed-deny-request-copy.component.ts index 664e4c541b..60c1e7ba32 100644 --- a/src/app/request-copy/deny-request-copy/themed-deny-request-copy.component.ts +++ b/src/app/request-copy/deny-request-copy/themed-deny-request-copy.component.ts @@ -12,15 +12,15 @@ import { DenyRequestCopyComponent } from 'src/themes/custom/app/request-copy/den templateUrl: './../../shared/theme-support/themed.component.html', }) export class ThemedDenyRequestCopyComponent extends ThemedComponent { - protected getComponentName(): string { - return 'DenyRequestCopyComponent'; - } + protected getComponentName(): string { + return 'DenyRequestCopyComponent'; + } - protected importThemedComponent(themeName: string): Promise { - return import(`../../../themes/${themeName}/app/request-copy/deny-request-copy/deny-request-copy.component`); - } + protected importThemedComponent(themeName: string): Promise { + return import(`../../../themes/${themeName}/app/request-copy/deny-request-copy/deny-request-copy.component`); + } - protected importUnthemedComponent(): Promise { - return import('./deny-request-copy.component'); - } + protected importUnthemedComponent(): Promise { + return import('./deny-request-copy.component'); + } } diff --git a/src/app/search-page/search-page-routing.module.ts b/src/app/search-page/search-page-routing.module.ts index 9e39ad1bc9..57eaa585d2 100644 --- a/src/app/search-page/search-page-routing.module.ts +++ b/src/app/search-page/search-page-routing.module.ts @@ -12,13 +12,13 @@ import { ThemedConfigurationSearchPageComponent } from './themed-configuration-s imports: [ SearchPageModule, RouterModule.forChild([{ - path: '', - resolve: { breadcrumb: I18nBreadcrumbResolver }, data: { title: 'search.title', breadcrumbKey: 'search' }, - children: [ - { path: '', component: ThemedSearchPageComponent }, - { path: ':configuration', component: ThemedConfigurationSearchPageComponent, canActivate: [ConfigurationSearchPageGuard] } - ] - }] + path: '', + resolve: { breadcrumb: I18nBreadcrumbResolver }, data: { title: 'search.title', breadcrumbKey: 'search' }, + children: [ + { path: '', component: ThemedSearchPageComponent }, + { path: ':configuration', component: ThemedConfigurationSearchPageComponent, canActivate: [ConfigurationSearchPageGuard] } + ] + }] ) ], providers: [ diff --git a/src/app/search-page/themed-configuration-search-page.component.ts b/src/app/search-page/themed-configuration-search-page.component.ts index e367ee5238..e1c412a822 100644 --- a/src/app/search-page/themed-configuration-search-page.component.ts +++ b/src/app/search-page/themed-configuration-search-page.component.ts @@ -39,19 +39,19 @@ export class ThemedConfigurationSearchPageComponent extends ThemedComponent; + configuration$: Observable; /** * The current context */ @Input() - context: Context; + context: Context; protected inAndOutputNames: (keyof ConfigurationSearchPageComponent & keyof this)[] = ['context', 'configuration', 'fixedFilterQuery', 'inPlaceSearch', 'searchEnabled', 'sideBarWidth']; diff --git a/src/app/shared/access-control-form-container/access-control-array-form/access-control-array-form.component.spec.ts b/src/app/shared/access-control-form-container/access-control-array-form/access-control-array-form.component.spec.ts index 964eb30de2..72ad8e3d88 100644 --- a/src/app/shared/access-control-form-container/access-control-array-form/access-control-array-form.component.spec.ts +++ b/src/app/shared/access-control-form-container/access-control-array-form/access-control-array-form.component.spec.ts @@ -19,7 +19,7 @@ describe('AccessControlArrayFormComponent', () => { imports: [ CommonModule, FormsModule, SharedBrowseByModule, TranslateModule.forRoot(), NgbDatepickerModule ], declarations: [ AccessControlArrayFormComponent, ToDatePipe ] }) - .compileComponents(); + .compileComponents(); }); beforeEach(() => { diff --git a/src/app/shared/access-control-form-container/access-control-form-container.component.spec.ts b/src/app/shared/access-control-form-container/access-control-form-container.component.spec.ts index 4d02f7a52d..cf1a950938 100644 --- a/src/app/shared/access-control-form-container/access-control-form-container.component.spec.ts +++ b/src/app/shared/access-control-form-container/access-control-form-container.component.spec.ts @@ -24,12 +24,12 @@ describe('AccessControlFormContainerComponent', () => { let fixture: ComponentFixture>; -// Mock NgbModal + // Mock NgbModal @Component({selector: 'ds-ngb-modal', template: ''}) class MockNgbModalComponent { } -// Mock dependencies + // Mock dependencies const mockBulkAccessControlService = { createPayloadFile: jasmine.createSpy('createPayloadFile').and.returnValue({file: 'mocked-file'}), executeScript: jasmine.createSpy('executeScript').and.returnValue(of('success')), diff --git a/src/app/shared/access-control-form-container/item-access-control-select-bitstreams-modal/item-access-control-select-bitstreams-modal.component.spec.ts b/src/app/shared/access-control-form-container/item-access-control-select-bitstreams-modal/item-access-control-select-bitstreams-modal.component.spec.ts index f60d9a70e7..f8ab92ea1c 100644 --- a/src/app/shared/access-control-form-container/item-access-control-select-bitstreams-modal/item-access-control-select-bitstreams-modal.component.spec.ts +++ b/src/app/shared/access-control-form-container/item-access-control-select-bitstreams-modal/item-access-control-select-bitstreams-modal.component.spec.ts @@ -10,7 +10,7 @@ xdescribe('ItemAccessControlSelectBitstreamsModalComponent', () => { await TestBed.configureTestingModule({ declarations: [ ItemAccessControlSelectBitstreamsModalComponent ] }) - .compileComponents(); + .compileComponents(); }); beforeEach(() => { diff --git a/src/app/shared/browse-by/shared-browse-by.module.ts b/src/app/shared/browse-by/shared-browse-by.module.ts index ae42576e9b..9999a494a3 100644 --- a/src/app/shared/browse-by/shared-browse-by.module.ts +++ b/src/app/shared/browse-by/shared-browse-by.module.ts @@ -9,7 +9,7 @@ import { AccessControlRoutingModule } from '../../access-control/access-control- @NgModule({ declarations: [ BrowseByComponent, -], + ], imports: [ ResultsBackButtonModule, BrowseByRoutingModule, diff --git a/src/app/shared/collection-dropdown/collection-dropdown.component.ts b/src/app/shared/collection-dropdown/collection-dropdown.component.ts index 713b32fabe..5a4d8ce5e9 100644 --- a/src/app/shared/collection-dropdown/collection-dropdown.component.ts +++ b/src/app/shared/collection-dropdown/collection-dropdown.component.ts @@ -151,18 +151,18 @@ export class CollectionDropdownComponent implements OnInit, OnDestroy { ngOnInit() { this.isLoading.next(false); this.subs.push(this.searchField.valueChanges.pipe( - debounceTime(500), - distinctUntilChanged(), - startWith('') - ).subscribe( - (next) => { - if (hasValue(next) && next !== this.currentQuery) { - this.resetPagination(); - this.currentQuery = next; - this.populateCollectionList(this.currentQuery, this.currentPage); - } + debounceTime(500), + distinctUntilChanged(), + startWith('') + ).subscribe( + (next) => { + if (hasValue(next) && next !== this.currentQuery) { + this.resetPagination(); + this.currentQuery = next; + this.populateCollectionList(this.currentQuery, this.currentPage); } - )); + } + )); // Workaround for prevent the scroll of main page when this component is placed in a dialog setTimeout(() => this.el.nativeElement.querySelector('input').focus(), 0); } @@ -212,41 +212,41 @@ export class CollectionDropdownComponent implements OnInit, OnDestroy { let searchListService$: Observable>>; if (this.entityType) { searchListService$ = this.collectionDataService - .getAuthorizedCollectionByEntityType( - query, - this.entityType, - findOptions, - true, - followLink('parentCommunity')); + .getAuthorizedCollectionByEntityType( + query, + this.entityType, + findOptions, + true, + followLink('parentCommunity')); } else { searchListService$ = this.collectionDataService - .getAuthorizedCollection(query, findOptions, true, true, followLink('parentCommunity')); + .getAuthorizedCollection(query, findOptions, true, true, followLink('parentCommunity')); } this.searchListCollection$ = searchListService$.pipe( - getFirstCompletedRemoteData(), - switchMap((collectionsRD: RemoteData>) => { - this.searchComplete.emit(); - if (collectionsRD.hasSucceeded && collectionsRD.payload.totalElements > 0) { - if (this.searchListCollection.length >= collectionsRD.payload.totalElements) { - this.hasNextPage = false; - } - this.emitSelectionEvents(collectionsRD); - return observableFrom(collectionsRD.payload.page).pipe( - mergeMap((collection: Collection) => collection.parentCommunity.pipe( - getFirstSucceededRemoteDataPayload(), - map((community: Community) => ({ - communities: [{ id: community.id, name: this.dsoNameService.getName(community) }], - collection: { id: collection.id, uuid: collection.id, name: this.dsoNameService.getName(collection) } - }) - ))), - reduce((acc: any, value: any) => [...acc, value], []), - ); - } else { + getFirstCompletedRemoteData(), + switchMap((collectionsRD: RemoteData>) => { + this.searchComplete.emit(); + if (collectionsRD.hasSucceeded && collectionsRD.payload.totalElements > 0) { + if (this.searchListCollection.length >= collectionsRD.payload.totalElements) { this.hasNextPage = false; - return observableOf([]); } - }) - ); + this.emitSelectionEvents(collectionsRD); + return observableFrom(collectionsRD.payload.page).pipe( + mergeMap((collection: Collection) => collection.parentCommunity.pipe( + getFirstSucceededRemoteDataPayload(), + map((community: Community) => ({ + communities: [{ id: community.id, name: this.dsoNameService.getName(community) }], + collection: { id: collection.id, uuid: collection.id, name: this.dsoNameService.getName(collection) } + }) + ))), + reduce((acc: any, value: any) => [...acc, value], []), + ); + } else { + this.hasNextPage = false; + return observableOf([]); + } + }) + ); this.subs.push( this.searchListCollection$.subscribe((list: CollectionListEntry[]) => { this.searchListCollection.push(...list); diff --git a/src/app/shared/comcol/comcol-forms/comcol-form/comcol-form.component.spec.ts b/src/app/shared/comcol/comcol-forms/comcol-form/comcol-form.component.spec.ts index 3f74f05118..2dfcc3c166 100644 --- a/src/app/shared/comcol/comcol-forms/comcol-form/comcol-form.component.spec.ts +++ b/src/app/shared/comcol/comcol-forms/comcol-form/comcol-form.component.spec.ts @@ -135,18 +135,18 @@ describe('ComColFormComponent', () => { expect(comp.submitForm.emit).toHaveBeenCalledWith( { dso: Object.assign({}, comp.dso, { - metadata: { - 'dc.title': [{ - value: 'New Community Title', - language: null, - }], - 'dc.description.abstract': [{ - value: 'Community description', - language: null, - }], - }, - type: Community.type, - } + metadata: { + 'dc.title': [{ + value: 'New Community Title', + language: null, + }], + 'dc.description.abstract': [{ + value: 'Community description', + language: null, + }], + }, + type: Community.type, + } ), uploader: undefined, deleteLogo: false, diff --git a/src/app/shared/comcol/comcol-forms/create-comcol-page/create-comcol-page.component.ts b/src/app/shared/comcol/comcol-forms/create-comcol-page/create-comcol-page.component.ts index 9034bffe8e..d0c467a408 100644 --- a/src/app/shared/comcol/comcol-forms/create-comcol-page/create-comcol-page.component.ts +++ b/src/app/shared/comcol/comcol-forms/create-comcol-page/create-comcol-page.component.ts @@ -83,10 +83,10 @@ export class CreateComColPageComponent i this.parentUUID$.pipe( take(1), mergeMap((uuid: string) => { - const params = uuid ? [new RequestParam('parent', uuid)] : []; - return this.dsoDataService.create(dso, ...params) - .pipe(getFirstSucceededRemoteDataPayload() - ); + const params = uuid ? [new RequestParam('parent', uuid)] : []; + return this.dsoDataService.create(dso, ...params) + .pipe(getFirstSucceededRemoteDataPayload() + ); })) .subscribe((dsoRD: TDomain) => { if (isNotUndefined(dsoRD)) { diff --git a/src/app/shared/comcol/comcol-forms/edit-comcol-page/comcol-metadata/comcol-metadata.component.ts b/src/app/shared/comcol/comcol-forms/edit-comcol-page/comcol-metadata/comcol-metadata.component.ts index b9bcb206d9..e28d5e9b5c 100644 --- a/src/app/shared/comcol/comcol-forms/edit-comcol-page/comcol-metadata/comcol-metadata.component.ts +++ b/src/app/shared/comcol/comcol-forms/edit-comcol-page/comcol-metadata/comcol-metadata.component.ts @@ -87,6 +87,6 @@ export class ComcolMetadataComponent imp take(1) ).subscribe((dsoRD: RemoteData) => { this.router.navigate([this.frontendURL + dsoRD.payload.id]); - }); + }); } } diff --git a/src/app/shared/comcol/comcol-forms/edit-comcol-page/comcol-role/comcol-role.component.ts b/src/app/shared/comcol/comcol-forms/edit-comcol-page/comcol-role/comcol-role.component.ts index 5ae22d754e..75fccc9e90 100644 --- a/src/app/shared/comcol/comcol-forms/edit-comcol-page/comcol-role/comcol-role.component.ts +++ b/src/app/shared/comcol/comcol-forms/edit-comcol-page/comcol-role/comcol-role.component.ts @@ -30,7 +30,7 @@ export class ComcolRoleComponent implements OnInit { * The community or collection to manage. */ @Input() - dso: Community | Collection; + dso: Community | Collection; /** * The role to manage diff --git a/src/app/shared/comcol/comcol-page-handle/themed-comcol-page-handle.component.ts b/src/app/shared/comcol/comcol-page-handle/themed-comcol-page-handle.component.ts index e7a7caf7be..3e75771f7b 100644 --- a/src/app/shared/comcol/comcol-page-handle/themed-comcol-page-handle.component.ts +++ b/src/app/shared/comcol/comcol-page-handle/themed-comcol-page-handle.component.ts @@ -14,10 +14,10 @@ import { ComcolPageHandleComponent } from './comcol-page-handle.component'; export class ThemedComcolPageHandleComponent extends ThemedComponent { -// Optional title + // Optional title @Input() title: string; -// The value of "handle" + // The value of "handle" @Input() content: string; inAndOutputNames: (keyof ComcolPageHandleComponent & keyof this)[] = ['title', 'content']; diff --git a/src/app/shared/confirmation-modal/confirmation-modal.component.ts b/src/app/shared/confirmation-modal/confirmation-modal.component.ts index 46eb4cedc5..212c1ec960 100644 --- a/src/app/shared/confirmation-modal/confirmation-modal.component.ts +++ b/src/app/shared/confirmation-modal/confirmation-modal.component.ts @@ -24,7 +24,7 @@ export class ConfirmationModalComponent { * An event fired when the cancel or confirm button is clicked, with respectively false or true */ @Output() - response = new EventEmitter(); + response = new EventEmitter(); constructor( protected activeModal: NgbActiveModal, diff --git a/src/app/shared/cookies/browser-klaro.service.spec.ts b/src/app/shared/cookies/browser-klaro.service.spec.ts index 7fd72b54b3..9233686e13 100644 --- a/src/app/shared/cookies/browser-klaro.service.spec.ts +++ b/src/app/shared/cookies/browser-klaro.service.spec.ts @@ -342,7 +342,7 @@ describe('BrowserKlaroService', () => { ... new ConfigurationProperty(), name: googleAnalytics, values: [], - } + } ) ) .withArgs(REGISTRATION_VERIFICATION_ENABLED_KEY) diff --git a/src/app/shared/cookies/browser-klaro.service.ts b/src/app/shared/cookies/browser-klaro.service.ts index 445b86863b..845602a3bd 100644 --- a/src/app/shared/cookies/browser-klaro.service.ts +++ b/src/app/shared/cookies/browser-klaro.service.ts @@ -298,11 +298,11 @@ export class BrowserKlaroService extends KlaroService { .pipe( take(1), switchMap((operations: Operation[]) => { - if (isNotEmpty(operations)) { - return this.ePersonService.patch(user, operations); - } - return observableOf(undefined); + if (isNotEmpty(operations)) { + return this.ePersonService.patch(user, operations); } + return observableOf(undefined); + } ) ).subscribe(); } diff --git a/src/app/shared/date.util.spec.ts b/src/app/shared/date.util.spec.ts index 4576ea497c..ad91879032 100644 --- a/src/app/shared/date.util.spec.ts +++ b/src/app/shared/date.util.spec.ts @@ -2,106 +2,106 @@ import { dateToString, dateToNgbDateStruct, dateToISOFormat, isValidDate, yearFr describe('Date Utils', () => { - describe('dateToISOFormat', () => { - it('should convert Date to YYYY-MM-DDThh:mm:ssZ string', () => { - // NOTE: month is zero indexed which is why it increases by one - expect(dateToISOFormat(new Date(Date.UTC(2022, 5, 3)))).toEqual('2022-06-03T00:00:00Z'); - }); - it('should convert Date string to YYYY-MM-DDThh:mm:ssZ string', () => { - expect(dateToISOFormat('2022-06-03')).toEqual('2022-06-03T00:00:00Z'); - }); - it('should convert Month string to YYYY-MM-DDThh:mm:ssZ string', () => { - expect(dateToISOFormat('2022-06')).toEqual('2022-06-01T00:00:00Z'); - }); - it('should convert Year string to YYYY-MM-DDThh:mm:ssZ string', () => { - expect(dateToISOFormat('2022')).toEqual('2022-01-01T00:00:00Z'); - }); - it('should convert ISO Date string to YYYY-MM-DDThh:mm:ssZ string', () => { - // NOTE: Time is always zeroed out as proven by this test. - expect(dateToISOFormat('2022-06-03T03:24:04Z')).toEqual('2022-06-03T00:00:00Z'); - }); - it('should convert NgbDateStruct to YYYY-MM-DDThh:mm:ssZ string', () => { - // NOTE: month is zero indexed which is why it increases by one - const date = new Date(Date.UTC(2022, 5, 3)); - expect(dateToISOFormat(dateToNgbDateStruct(date))).toEqual('2022-06-03T00:00:00Z'); - }); + describe('dateToISOFormat', () => { + it('should convert Date to YYYY-MM-DDThh:mm:ssZ string', () => { + // NOTE: month is zero indexed which is why it increases by one + expect(dateToISOFormat(new Date(Date.UTC(2022, 5, 3)))).toEqual('2022-06-03T00:00:00Z'); }); + it('should convert Date string to YYYY-MM-DDThh:mm:ssZ string', () => { + expect(dateToISOFormat('2022-06-03')).toEqual('2022-06-03T00:00:00Z'); + }); + it('should convert Month string to YYYY-MM-DDThh:mm:ssZ string', () => { + expect(dateToISOFormat('2022-06')).toEqual('2022-06-01T00:00:00Z'); + }); + it('should convert Year string to YYYY-MM-DDThh:mm:ssZ string', () => { + expect(dateToISOFormat('2022')).toEqual('2022-01-01T00:00:00Z'); + }); + it('should convert ISO Date string to YYYY-MM-DDThh:mm:ssZ string', () => { + // NOTE: Time is always zeroed out as proven by this test. + expect(dateToISOFormat('2022-06-03T03:24:04Z')).toEqual('2022-06-03T00:00:00Z'); + }); + it('should convert NgbDateStruct to YYYY-MM-DDThh:mm:ssZ string', () => { + // NOTE: month is zero indexed which is why it increases by one + const date = new Date(Date.UTC(2022, 5, 3)); + expect(dateToISOFormat(dateToNgbDateStruct(date))).toEqual('2022-06-03T00:00:00Z'); + }); + }); - describe('dateToString', () => { - it('should convert Date to YYYY-MM-DD string', () => { - // NOTE: month is zero indexed which is why it increases by one - expect(dateToString(new Date(Date.UTC(2022, 5, 3)))).toEqual('2022-06-03'); - }); - it('should convert Date with time to YYYY-MM-DD string', () => { - // NOTE: month is zero indexed which is why it increases by one - expect(dateToString(new Date(Date.UTC(2022, 5, 3, 3, 24, 0)))).toEqual('2022-06-03'); - }); - it('should convert Month only to YYYY-MM-DD string', () => { - // NOTE: month is zero indexed which is why it increases by one - expect(dateToString(new Date(Date.UTC(2022, 5)))).toEqual('2022-06-01'); - }); - it('should convert ISO Date to YYYY-MM-DD string', () => { - expect(dateToString(new Date('2022-06-03T03:24:00Z'))).toEqual('2022-06-03'); - }); - it('should convert NgbDateStruct to YYYY-MM-DD string', () => { - // NOTE: month is zero indexed which is why it increases by one - const date = new Date(Date.UTC(2022, 5, 3)); - expect(dateToString(dateToNgbDateStruct(date))).toEqual('2022-06-03'); - }); + describe('dateToString', () => { + it('should convert Date to YYYY-MM-DD string', () => { + // NOTE: month is zero indexed which is why it increases by one + expect(dateToString(new Date(Date.UTC(2022, 5, 3)))).toEqual('2022-06-03'); }); + it('should convert Date with time to YYYY-MM-DD string', () => { + // NOTE: month is zero indexed which is why it increases by one + expect(dateToString(new Date(Date.UTC(2022, 5, 3, 3, 24, 0)))).toEqual('2022-06-03'); + }); + it('should convert Month only to YYYY-MM-DD string', () => { + // NOTE: month is zero indexed which is why it increases by one + expect(dateToString(new Date(Date.UTC(2022, 5)))).toEqual('2022-06-01'); + }); + it('should convert ISO Date to YYYY-MM-DD string', () => { + expect(dateToString(new Date('2022-06-03T03:24:00Z'))).toEqual('2022-06-03'); + }); + it('should convert NgbDateStruct to YYYY-MM-DD string', () => { + // NOTE: month is zero indexed which is why it increases by one + const date = new Date(Date.UTC(2022, 5, 3)); + expect(dateToString(dateToNgbDateStruct(date))).toEqual('2022-06-03'); + }); + }); - describe('isValidDate', () => { - it('should return false for null', () => { - expect(isValidDate(null)).toBe(false); - }); - it('should return false for empty string', () => { - expect(isValidDate('')).toBe(false); - }); - it('should return false for text', () => { - expect(isValidDate('test')).toBe(false); - }); - it('should return true for YYYY', () => { - expect(isValidDate('2022')).toBe(true); - }); - it('should return true for YYYY-MM', () => { - expect(isValidDate('2022-12')).toBe(true); - }); - it('should return true for YYYY-MM-DD', () => { - expect(isValidDate('2022-06-03')).toBe(true); - }); - it('should return true for YYYY-MM-DDTHH:MM:SS', () => { - expect(isValidDate('2022-06-03T10:20:30')).toBe(true); - }); - it('should return true for YYYY-MM-DDTHH:MM:SSZ', () => { - expect(isValidDate('2022-06-03T10:20:30Z')).toBe(true); - }); - it('should return false for a month that does not exist', () => { - expect(isValidDate('2022-13')).toBe(false); - }); - it('should return false for a day that does not exist', () => { - expect(isValidDate('2022-02-60')).toBe(false); - }); - it('should return false for a time that does not exist', () => { - expect(isValidDate('2022-02-60T10:60:20')).toBe(false); - }); + describe('isValidDate', () => { + it('should return false for null', () => { + expect(isValidDate(null)).toBe(false); }); + it('should return false for empty string', () => { + expect(isValidDate('')).toBe(false); + }); + it('should return false for text', () => { + expect(isValidDate('test')).toBe(false); + }); + it('should return true for YYYY', () => { + expect(isValidDate('2022')).toBe(true); + }); + it('should return true for YYYY-MM', () => { + expect(isValidDate('2022-12')).toBe(true); + }); + it('should return true for YYYY-MM-DD', () => { + expect(isValidDate('2022-06-03')).toBe(true); + }); + it('should return true for YYYY-MM-DDTHH:MM:SS', () => { + expect(isValidDate('2022-06-03T10:20:30')).toBe(true); + }); + it('should return true for YYYY-MM-DDTHH:MM:SSZ', () => { + expect(isValidDate('2022-06-03T10:20:30Z')).toBe(true); + }); + it('should return false for a month that does not exist', () => { + expect(isValidDate('2022-13')).toBe(false); + }); + it('should return false for a day that does not exist', () => { + expect(isValidDate('2022-02-60')).toBe(false); + }); + it('should return false for a time that does not exist', () => { + expect(isValidDate('2022-02-60T10:60:20')).toBe(false); + }); + }); - describe('yearFromString', () => { - it('should return year from YYYY string', () => { - expect(yearFromString('2022')).toEqual(2022); - }); - it('should return year from YYYY-MM string', () => { - expect(yearFromString('1970-06')).toEqual(1970); - }); - it('should return year from YYYY-MM-DD string', () => { - expect(yearFromString('1914-10-23')).toEqual(1914); - }); - it('should return year from YYYY-MM-DDTHH:MM:SSZ string', () => { - expect(yearFromString('1914-10-23T10:20:30Z')).toEqual(1914); - }); - it('should return null if invalid date', () => { - expect(yearFromString('test')).toBeNull(); - }); + describe('yearFromString', () => { + it('should return year from YYYY string', () => { + expect(yearFromString('2022')).toEqual(2022); }); + it('should return year from YYYY-MM string', () => { + expect(yearFromString('1970-06')).toEqual(1970); + }); + it('should return year from YYYY-MM-DD string', () => { + expect(yearFromString('1914-10-23')).toEqual(1914); + }); + it('should return year from YYYY-MM-DDTHH:MM:SSZ string', () => { + expect(yearFromString('1914-10-23T10:20:30Z')).toEqual(1914); + }); + it('should return null if invalid date', () => { + expect(yearFromString('test')).toBeNull(); + }); + }); }); diff --git a/src/app/shared/ds-select/ds-select.component.ts b/src/app/shared/ds-select/ds-select.component.ts index 26d1560c01..6224f4c37d 100644 --- a/src/app/shared/ds-select/ds-select.component.ts +++ b/src/app/shared/ds-select/ds-select.component.ts @@ -14,23 +14,23 @@ export class DsSelectComponent { * An optional label for the dropdown selector. */ @Input() - label: string; + label: string; /** * Whether the dropdown selector is disabled. */ @Input() - disabled: boolean; + disabled: boolean; /** * Emits an event when the dropdown selector is opened or closed. */ @Output() - toggled = new EventEmitter(); + toggled = new EventEmitter(); /** * Emits an event when the dropdown selector or closed. */ @Output() - close = new EventEmitter(); + close = new EventEmitter(); } diff --git a/src/app/shared/dso-page/dso-edit-menu.resolver.spec.ts b/src/app/shared/dso-page/dso-edit-menu.resolver.spec.ts index abfe618174..aa8c60301c 100644 --- a/src/app/shared/dso-page/dso-edit-menu.resolver.spec.ts +++ b/src/app/shared/dso-page/dso-edit-menu.resolver.spec.ts @@ -63,12 +63,12 @@ describe('DSOEditMenuResolver', () => { visible: true, model: null }, - { - id: 'dummy-2', - active: false, - visible: true, - model: null - }]; + { + id: 'dummy-2', + active: false, + visible: true, + model: null + }]; const dummySections2 = [{ id: 'dummy-3', @@ -76,18 +76,18 @@ describe('DSOEditMenuResolver', () => { visible: true, model: null }, - { - id: 'dummy-4', - active: false, - visible: true, - model: null - }, - { - id: 'dummy-5', - active: false, - visible: true, - model: null - }]; + { + id: 'dummy-4', + active: false, + visible: true, + model: null + }, + { + id: 'dummy-5', + active: false, + visible: true, + model: null + }]; beforeEach(waitForAsync(() => { menuService = new MenuServiceStub(); diff --git a/src/app/shared/dso-page/dso-page-subscription-button/dso-page-subscription-button.component.spec.ts b/src/app/shared/dso-page/dso-page-subscription-button/dso-page-subscription-button.component.spec.ts index 726854778d..6cf5f23bd2 100644 --- a/src/app/shared/dso-page/dso-page-subscription-button/dso-page-subscription-button.component.spec.ts +++ b/src/app/shared/dso-page/dso-page-subscription-button/dso-page-subscription-button.component.spec.ts @@ -49,7 +49,7 @@ describe('DsoPageSubscriptionButtonComponent', () => { { provide: AuthorizationDataService, useValue: authorizationService }, ] }) - .compileComponents(); + .compileComponents(); }); beforeEach(() => { diff --git a/src/app/shared/dso-selector/dso-selector/authorized-collection-selector/authorized-collection-selector.component.spec.ts b/src/app/shared/dso-selector/dso-selector/authorized-collection-selector/authorized-collection-selector.component.spec.ts index b46df8ff36..9d6ee01f39 100644 --- a/src/app/shared/dso-selector/dso-selector/authorized-collection-selector/authorized-collection-selector.component.spec.ts +++ b/src/app/shared/dso-selector/dso-selector/authorized-collection-selector/authorized-collection-selector.component.spec.ts @@ -52,10 +52,10 @@ describe('AuthorizedCollectionSelectorComponent', () => { describe('search', () => { describe('when has no entity type', () => { it('should call getAuthorizedCollection and return the authorized collection in a SearchResult', (done) => { - component.search('', 1).subscribe((resultRD) => { + component.search('', 1).subscribe((resultRD) => { expect(collectionService.getAuthorizedCollection).toHaveBeenCalled(); - expect(resultRD.payload.page.length).toEqual(1); - expect(resultRD.payload.page[0].indexableObject).toEqual(collection); + expect(resultRD.payload.page.length).toEqual(1); + expect(resultRD.payload.page[0].indexableObject).toEqual(collection); done(); }); }); diff --git a/src/app/shared/dso-selector/dso-selector/dso-selector.component.ts b/src/app/shared/dso-selector/dso-selector/dso-selector.component.ts index decf68354f..c999893760 100644 --- a/src/app/shared/dso-selector/dso-selector/dso-selector.component.ts +++ b/src/app/shared/dso-selector/dso-selector/dso-selector.component.ts @@ -70,7 +70,7 @@ export class DSOSelectorComponent implements OnInit, OnDestroy { */ @Input() types: DSpaceObjectType[]; - /** + /** * The sorting options */ @Input() sort: SortOptions; diff --git a/src/app/shared/dso-selector/modal-wrappers/create-collection-parent-selector/create-collection-parent-selector.component.ts b/src/app/shared/dso-selector/modal-wrappers/create-collection-parent-selector/create-collection-parent-selector.component.ts index e0b7c1675b..ec9428c93d 100644 --- a/src/app/shared/dso-selector/modal-wrappers/create-collection-parent-selector/create-collection-parent-selector.component.ts +++ b/src/app/shared/dso-selector/modal-wrappers/create-collection-parent-selector/create-collection-parent-selector.component.ts @@ -5,8 +5,8 @@ import { DSpaceObject } from '../../../../core/shared/dspace-object.model'; import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap'; import { DSOSelectorModalWrapperComponent, SelectorActionType } from '../dso-selector-modal-wrapper.component'; import { - getCollectionCreateRoute, - COLLECTION_PARENT_PARAMETER + getCollectionCreateRoute, + COLLECTION_PARENT_PARAMETER } from '../../../../collection-page/collection-page-routing-paths'; import { SortDirection, SortOptions } from '../../../../core/cache/models/sort-options.model'; import { environment } from '../../../../../environments/environment'; diff --git a/src/app/shared/dso-selector/modal-wrappers/create-collection-parent-selector/themed-create-collection-parent-selector.component.ts b/src/app/shared/dso-selector/modal-wrappers/create-collection-parent-selector/themed-create-collection-parent-selector.component.ts index d90cd0ac0d..c720ceffed 100644 --- a/src/app/shared/dso-selector/modal-wrappers/create-collection-parent-selector/themed-create-collection-parent-selector.component.ts +++ b/src/app/shared/dso-selector/modal-wrappers/create-collection-parent-selector/themed-create-collection-parent-selector.component.ts @@ -6,23 +6,23 @@ import {ThemedComponent} from 'src/app/shared/theme-support/themed.component'; * Themed wrapper for CreateCollectionParentSelectorComponent */ @Component({ - selector: 'ds-themed-create-collection-parent-selector', - styleUrls: [], - templateUrl: '../../../theme-support/themed.component.html' + selector: 'ds-themed-create-collection-parent-selector', + styleUrls: [], + templateUrl: '../../../theme-support/themed.component.html' }) export class ThemedCreateCollectionParentSelectorComponent - extends ThemedComponent { + extends ThemedComponent { - protected getComponentName(): string { - return 'CreateCollectionParentSelectorComponent'; - } + protected getComponentName(): string { + return 'CreateCollectionParentSelectorComponent'; + } - protected importThemedComponent(themeName: string): Promise { - return import(`../../../../../themes/${themeName}/app/shared/dso-selector/modal-wrappers/create-collection-parent-selector/create-collection-parent-selector.component`); - } + protected importThemedComponent(themeName: string): Promise { + return import(`../../../../../themes/${themeName}/app/shared/dso-selector/modal-wrappers/create-collection-parent-selector/create-collection-parent-selector.component`); + } - protected importUnthemedComponent(): Promise { - return import('./create-collection-parent-selector.component'); - } + protected importUnthemedComponent(): Promise { + return import('./create-collection-parent-selector.component'); + } } diff --git a/src/app/shared/dso-selector/modal-wrappers/create-community-parent-selector/create-community-parent-selector.component.ts b/src/app/shared/dso-selector/modal-wrappers/create-community-parent-selector/create-community-parent-selector.component.ts index 77458d9802..4c80f096cb 100644 --- a/src/app/shared/dso-selector/modal-wrappers/create-community-parent-selector/create-community-parent-selector.component.ts +++ b/src/app/shared/dso-selector/modal-wrappers/create-community-parent-selector/create-community-parent-selector.component.ts @@ -9,8 +9,8 @@ import { SelectorActionType } from '../dso-selector-modal-wrapper.component'; import { - getCommunityCreateRoute, - COMMUNITY_PARENT_PARAMETER + getCommunityCreateRoute, + COMMUNITY_PARENT_PARAMETER } from '../../../../community-page/community-page-routing-paths'; import { SortDirection, SortOptions } from '../../../../core/cache/models/sort-options.model'; import { environment } from '../../../../../environments/environment'; diff --git a/src/app/shared/dso-selector/modal-wrappers/create-community-parent-selector/themed-create-community-parent-selector.component.ts b/src/app/shared/dso-selector/modal-wrappers/create-community-parent-selector/themed-create-community-parent-selector.component.ts index 24bff97254..d4f39ee271 100644 --- a/src/app/shared/dso-selector/modal-wrappers/create-community-parent-selector/themed-create-community-parent-selector.component.ts +++ b/src/app/shared/dso-selector/modal-wrappers/create-community-parent-selector/themed-create-community-parent-selector.component.ts @@ -6,22 +6,22 @@ import {ThemedComponent} from 'src/app/shared/theme-support/themed.component'; * Themed wrapper for CreateCommunityParentSelectorComponent */ @Component({ - selector: 'ds-themed-create-community-parent-selector', - styleUrls: [], - templateUrl: '../../../theme-support/themed.component.html' + selector: 'ds-themed-create-community-parent-selector', + styleUrls: [], + templateUrl: '../../../theme-support/themed.component.html' }) export class ThemedCreateCommunityParentSelectorComponent - extends ThemedComponent { - protected getComponentName(): string { - return 'CreateCommunityParentSelectorComponent'; - } + extends ThemedComponent { + protected getComponentName(): string { + return 'CreateCommunityParentSelectorComponent'; + } - protected importThemedComponent(themeName: string): Promise { - return import(`../../../../../themes/${themeName}/app/shared/dso-selector/modal-wrappers/create-community-parent-selector/create-community-parent-selector.component`); - } + protected importThemedComponent(themeName: string): Promise { + return import(`../../../../../themes/${themeName}/app/shared/dso-selector/modal-wrappers/create-community-parent-selector/create-community-parent-selector.component`); + } - protected importUnthemedComponent(): Promise { - return import('./create-community-parent-selector.component'); - } + protected importUnthemedComponent(): Promise { + return import('./create-community-parent-selector.component'); + } } diff --git a/src/app/shared/dso-selector/modal-wrappers/create-item-parent-selector/themed-create-item-parent-selector.component.ts b/src/app/shared/dso-selector/modal-wrappers/create-item-parent-selector/themed-create-item-parent-selector.component.ts index 49209ea63b..eef60d67d2 100644 --- a/src/app/shared/dso-selector/modal-wrappers/create-item-parent-selector/themed-create-item-parent-selector.component.ts +++ b/src/app/shared/dso-selector/modal-wrappers/create-item-parent-selector/themed-create-item-parent-selector.component.ts @@ -6,26 +6,26 @@ import {ThemedComponent} from 'src/app/shared/theme-support/themed.component'; * Themed wrapper for CreateItemParentSelectorComponent */ @Component({ - selector: 'ds-themed-create-item-parent-selector', - styleUrls: [], - templateUrl: '../../../theme-support/themed.component.html' + selector: 'ds-themed-create-item-parent-selector', + styleUrls: [], + templateUrl: '../../../theme-support/themed.component.html' }) export class ThemedCreateItemParentSelectorComponent - extends ThemedComponent { + extends ThemedComponent { @Input() entityType: string; protected inAndOutputNames: (keyof CreateItemParentSelectorComponent & keyof this)[] = ['entityType']; protected getComponentName(): string { - return 'CreateItemParentSelectorComponent'; + return 'CreateItemParentSelectorComponent'; } protected importThemedComponent(themeName: string): Promise { - return import(`../../../../../themes/${themeName}/app/shared/dso-selector/modal-wrappers/create-item-parent-selector/create-item-parent-selector.component`); + return import(`../../../../../themes/${themeName}/app/shared/dso-selector/modal-wrappers/create-item-parent-selector/create-item-parent-selector.component`); } protected importUnthemedComponent(): Promise { - return import('./create-item-parent-selector.component'); + return import('./create-item-parent-selector.component'); } } diff --git a/src/app/shared/dso-selector/modal-wrappers/edit-collection-selector/themed-edit-collection-selector.component.ts b/src/app/shared/dso-selector/modal-wrappers/edit-collection-selector/themed-edit-collection-selector.component.ts index 999f466e75..a4b58988e7 100644 --- a/src/app/shared/dso-selector/modal-wrappers/edit-collection-selector/themed-edit-collection-selector.component.ts +++ b/src/app/shared/dso-selector/modal-wrappers/edit-collection-selector/themed-edit-collection-selector.component.ts @@ -6,22 +6,22 @@ import {ThemedComponent} from 'src/app/shared/theme-support/themed.component'; * Themed wrapper for EditCollectionSelectorComponent */ @Component({ - selector: 'ds-themed-edit-collection-selector', - styleUrls: [], - templateUrl: '../../../theme-support/themed.component.html' + selector: 'ds-themed-edit-collection-selector', + styleUrls: [], + templateUrl: '../../../theme-support/themed.component.html' }) export class ThemedEditCollectionSelectorComponent - extends ThemedComponent { - protected getComponentName(): string { - return 'EditCollectionSelectorComponent'; - } + extends ThemedComponent { + protected getComponentName(): string { + return 'EditCollectionSelectorComponent'; + } - protected importThemedComponent(themeName: string): Promise { - return import(`../../../../../themes/${themeName}/app/shared/dso-selector/modal-wrappers/edit-collection-selector/edit-collection-selector.component`); - } + protected importThemedComponent(themeName: string): Promise { + return import(`../../../../../themes/${themeName}/app/shared/dso-selector/modal-wrappers/edit-collection-selector/edit-collection-selector.component`); + } - protected importUnthemedComponent(): Promise { - return import('./edit-collection-selector.component'); - } + protected importUnthemedComponent(): Promise { + return import('./edit-collection-selector.component'); + } } diff --git a/src/app/shared/dso-selector/modal-wrappers/edit-community-selector/themed-edit-community-selector.component.ts b/src/app/shared/dso-selector/modal-wrappers/edit-community-selector/themed-edit-community-selector.component.ts index e067803444..b199c314f5 100644 --- a/src/app/shared/dso-selector/modal-wrappers/edit-community-selector/themed-edit-community-selector.component.ts +++ b/src/app/shared/dso-selector/modal-wrappers/edit-community-selector/themed-edit-community-selector.component.ts @@ -6,22 +6,22 @@ import {ThemedComponent} from 'src/app/shared/theme-support/themed.component'; * Themed wrapper for EditCommunitySelectorComponent */ @Component({ - selector: 'ds-themed-edit-community-selector', - styleUrls: [], - templateUrl: '../../../theme-support/themed.component.html' + selector: 'ds-themed-edit-community-selector', + styleUrls: [], + templateUrl: '../../../theme-support/themed.component.html' }) export class ThemedEditCommunitySelectorComponent - extends ThemedComponent { - protected getComponentName(): string { - return 'EditCommunitySelectorComponent'; - } + extends ThemedComponent { + protected getComponentName(): string { + return 'EditCommunitySelectorComponent'; + } - protected importThemedComponent(themeName: string): Promise { - return import(`../../../../../themes/${themeName}/app/shared/dso-selector/modal-wrappers/edit-community-selector/edit-community-selector.component`); - } + protected importThemedComponent(themeName: string): Promise { + return import(`../../../../../themes/${themeName}/app/shared/dso-selector/modal-wrappers/edit-community-selector/edit-community-selector.component`); + } - protected importUnthemedComponent(): Promise { - return import('./edit-community-selector.component'); - } + protected importUnthemedComponent(): Promise { + return import('./edit-community-selector.component'); + } } diff --git a/src/app/shared/dso-selector/modal-wrappers/edit-item-selector/themed-edit-item-selector.component.ts b/src/app/shared/dso-selector/modal-wrappers/edit-item-selector/themed-edit-item-selector.component.ts index 6d3b5691c1..b07130b9d1 100644 --- a/src/app/shared/dso-selector/modal-wrappers/edit-item-selector/themed-edit-item-selector.component.ts +++ b/src/app/shared/dso-selector/modal-wrappers/edit-item-selector/themed-edit-item-selector.component.ts @@ -6,22 +6,22 @@ import {ThemedComponent} from 'src/app/shared/theme-support/themed.component'; * Themed wrapper for EditItemSelectorComponent */ @Component({ - selector: 'ds-themed-edit-item-selector', - styleUrls: [], - templateUrl: '../../../theme-support/themed.component.html' + selector: 'ds-themed-edit-item-selector', + styleUrls: [], + templateUrl: '../../../theme-support/themed.component.html' }) export class ThemedEditItemSelectorComponent - extends ThemedComponent { - protected getComponentName(): string { - return 'EditItemSelectorComponent'; - } + extends ThemedComponent { + protected getComponentName(): string { + return 'EditItemSelectorComponent'; + } - protected importThemedComponent(themeName: string): Promise { - return import(`../../../../../themes/${themeName}/app/shared/dso-selector/modal-wrappers/edit-item-selector/edit-item-selector.component`); - } + protected importThemedComponent(themeName: string): Promise { + return import(`../../../../../themes/${themeName}/app/shared/dso-selector/modal-wrappers/edit-item-selector/edit-item-selector.component`); + } - protected importUnthemedComponent(): Promise { - return import('./edit-item-selector.component'); - } + protected importUnthemedComponent(): Promise { + return import('./edit-item-selector.component'); + } } diff --git a/src/app/shared/dso-selector/modal-wrappers/export-batch-selector/export-batch-selector.component.spec.ts b/src/app/shared/dso-selector/modal-wrappers/export-batch-selector/export-batch-selector.component.spec.ts index 18ec6007ea..44566677d7 100644 --- a/src/app/shared/dso-selector/modal-wrappers/export-batch-selector/export-batch-selector.component.spec.ts +++ b/src/app/shared/dso-selector/modal-wrappers/export-batch-selector/export-batch-selector.component.spec.ts @@ -23,17 +23,17 @@ import { AuthorizationDataService } from '../../../../core/data/feature-authoriz // No way to add entryComponents yet to testbed; alternative implemented; source: https://stackoverflow.com/questions/41689468/how-to-shallow-test-a-component-with-an-entrycomponents @NgModule({ - imports: [NgbModalModule, - TranslateModule.forRoot({ - loader: { - provide: TranslateLoader, - useClass: TranslateLoaderMock - } - }), - ], - exports: [], - declarations: [ConfirmationModalComponent], - providers: [] + imports: [NgbModalModule, + TranslateModule.forRoot({ + loader: { + provide: TranslateLoader, + useClass: TranslateLoaderMock + } + }), + ], + exports: [], + declarations: [ConfirmationModalComponent], + providers: [] }) class ModelTestModule { } @@ -180,7 +180,7 @@ describe('ExportBatchSelectorComponent', () => { Object.assign(new ProcessParameter(), { name: '--id', value: mockCollection.uuid }), Object.assign(new ProcessParameter(), { name: '--type', value: 'COLLECTION' }) ]; - expect(scriptService.invoke).toHaveBeenCalledWith(BATCH_EXPORT_SCRIPT_NAME, parameterValues, []); + expect(scriptService.invoke).toHaveBeenCalledWith(BATCH_EXPORT_SCRIPT_NAME, parameterValues, []); }); it('success notification is shown', () => { expect(scriptRequestSucceeded).toBeTrue(); diff --git a/src/app/shared/dso-selector/modal-wrappers/export-metadata-selector/export-metadata-selector.component.spec.ts b/src/app/shared/dso-selector/modal-wrappers/export-metadata-selector/export-metadata-selector.component.spec.ts index df3e4f095c..f591988fa9 100644 --- a/src/app/shared/dso-selector/modal-wrappers/export-metadata-selector/export-metadata-selector.component.spec.ts +++ b/src/app/shared/dso-selector/modal-wrappers/export-metadata-selector/export-metadata-selector.component.spec.ts @@ -24,17 +24,17 @@ import { AuthorizationDataService } from '../../../../core/data/feature-authoriz // No way to add entryComponents yet to testbed; alternative implemented; source: https://stackoverflow.com/questions/41689468/how-to-shallow-test-a-component-with-an-entrycomponents @NgModule({ - imports: [NgbModalModule, - TranslateModule.forRoot({ - loader: { - provide: TranslateLoader, - useClass: TranslateLoaderMock - } - }), - ], - exports: [], - declarations: [ConfirmationModalComponent], - providers: [] + imports: [NgbModalModule, + TranslateModule.forRoot({ + loader: { + provide: TranslateLoader, + useClass: TranslateLoaderMock + } + }), + ], + exports: [], + declarations: [ConfirmationModalComponent], + providers: [] }) class ModelTestModule { } diff --git a/src/app/shared/dso-selector/modal-wrappers/import-batch-selector/import-batch-selector.component.ts b/src/app/shared/dso-selector/modal-wrappers/import-batch-selector/import-batch-selector.component.ts index 4696e42e2d..4256e423f8 100644 --- a/src/app/shared/dso-selector/modal-wrappers/import-batch-selector/import-batch-selector.component.ts +++ b/src/app/shared/dso-selector/modal-wrappers/import-batch-selector/import-batch-selector.component.ts @@ -23,7 +23,7 @@ export class ImportBatchSelectorComponent extends DSOSelectorModalWrapperCompone * An event fired when the modal is closed */ @Output() - response = new EventEmitter(); + response = new EventEmitter(); constructor(protected activeModal: NgbActiveModal, protected route: ActivatedRoute) { diff --git a/src/app/shared/empty.util.ts b/src/app/shared/empty.util.ts index 355314550a..df87d68877 100644 --- a/src/app/shared/empty.util.ts +++ b/src/app/shared/empty.util.ts @@ -196,9 +196,9 @@ export function isObjectEmpty(obj?: any): boolean { } for (const key in obj) { - if (obj.hasOwnProperty(key) && isNotEmpty(obj[key])) { - return false; - } + if (obj.hasOwnProperty(key) && isNotEmpty(obj[key])) { + return false; + } } return true; } diff --git a/src/app/shared/entity-dropdown/entity-dropdown.component.spec.ts b/src/app/shared/entity-dropdown/entity-dropdown.component.spec.ts index 13e6dbc9c5..4399e34cef 100644 --- a/src/app/shared/entity-dropdown/entity-dropdown.component.spec.ts +++ b/src/app/shared/entity-dropdown/entity-dropdown.component.spec.ts @@ -47,10 +47,10 @@ const entities: ItemType[] = [ const listElementMock: ItemType = Object.assign( new ItemType(), { - id: 'ce64f48e-2c9b-411a-ac36-ee429c0e6a88', - label: 'Entity_1', - uuid: 'UUID-ce64f48e-2c9b-411a-ac36-ee429c0e6a88' -} + id: 'ce64f48e-2c9b-411a-ac36-ee429c0e6a88', + label: 'Entity_1', + uuid: 'UUID-ce64f48e-2c9b-411a-ac36-ee429c0e6a88' + } ); describe('EntityDropdownComponent', () => { diff --git a/src/app/shared/entity-dropdown/entity-dropdown.component.ts b/src/app/shared/entity-dropdown/entity-dropdown.component.ts index e009463dcd..62b1cf4e68 100644 --- a/src/app/shared/entity-dropdown/entity-dropdown.component.ts +++ b/src/app/shared/entity-dropdown/entity-dropdown.component.ts @@ -163,15 +163,15 @@ export class EntityDropdownComponent implements OnInit, OnDestroy { searchListEntity$ = this.entityTypeService.getAllAuthorizedRelationshipTypeImport(findOptions); } this.searchListEntity$ = searchListEntity$.pipe( - getFirstSucceededRemoteWithNotEmptyData(), - switchMap((entityType: RemoteData>) => { - if ( (this.searchListEntity.length + findOptions.elementsPerPage) >= entityType.payload.totalElements ) { - this.hasNextPage = false; - } - return entityType.payload.page; - }), - reduce((acc: any, value: any) => [...acc, value], []), - startWith([]) + getFirstSucceededRemoteWithNotEmptyData(), + switchMap((entityType: RemoteData>) => { + if ( (this.searchListEntity.length + findOptions.elementsPerPage) >= entityType.payload.totalElements ) { + this.hasNextPage = false; + } + return entityType.payload.page; + }), + reduce((acc: any, value: any) => [...acc, value], []), + startWith([]) ); this.subs.push( this.searchListEntity$.subscribe( diff --git a/src/app/shared/eperson-group-list/eperson-group-list.component.ts b/src/app/shared/eperson-group-list/eperson-group-list.component.ts index 7cad7a9783..8d9da221dc 100644 --- a/src/app/shared/eperson-group-list/eperson-group-list.component.ts +++ b/src/app/shared/eperson-group-list/eperson-group-list.component.ts @@ -174,22 +174,22 @@ export class EpersonGroupListComponent implements OnInit, OnDestroy { } this.pageConfigSub = this.paginationService.getCurrentPagination(this.paginationOptions.id, this.paginationOptions) .subscribe((paginationOptions) => { - const options: FindListOptions = Object.assign({}, new FindListOptions(), { + const options: FindListOptions = Object.assign({}, new FindListOptions(), { elementsPerPage: paginationOptions.pageSize, currentPage: paginationOptions.currentPage - }); + }); - const search$: Observable>> = this.isListOfEPerson ? - (this.dataService as EPersonDataService).searchByScope(scope, query, options) : - (this.dataService as GroupDataService).searchGroups(query, options); + const search$: Observable>> = this.isListOfEPerson ? + (this.dataService as EPersonDataService).searchByScope(scope, query, options) : + (this.dataService as GroupDataService).searchGroups(query, options); - this.subs.push(search$.pipe(getFirstCompletedRemoteData()) - .subscribe((list: RemoteData>) => { - if (hasValue(this.list$)) { - this.list$.next(list); - } - }) - ); + this.subs.push(search$.pipe(getFirstCompletedRemoteData()) + .subscribe((list: RemoteData>) => { + if (hasValue(this.list$)) { + this.list$.next(list); + } + }) + ); }); } diff --git a/src/app/shared/form/builder/ds-dynamic-form-ui/ds-dynamic-form-control-container.component.ts b/src/app/shared/form/builder/ds-dynamic-form-ui/ds-dynamic-form-control-container.component.ts index 958644aa0a..69e53b4f98 100644 --- a/src/app/shared/form/builder/ds-dynamic-form-ui/ds-dynamic-form-control-container.component.ts +++ b/src/app/shared/form/builder/ds-dynamic-form-ui/ds-dynamic-form-control-container.component.ts @@ -327,8 +327,8 @@ export class DsDynamicFormControlContainerComponent extends DynamicFormControlCo true, true, ... itemLinksToFollow(this.fetchThumbnail)).pipe( - getAllSucceededRemoteData(), - getRemoteDataPayload()); + getAllSucceededRemoteData(), + getRemoteDataPayload()); this.relationshipValue$ = observableCombineLatest([this.item$.pipe(take(1)), relationship$]).pipe( switchMap(([item, relationship]: [Item, Relationship]) => relationship.leftItem.pipe( diff --git a/src/app/shared/form/builder/ds-dynamic-form-ui/ds-dynamic-type-bind-relation.service.spec.ts b/src/app/shared/form/builder/ds-dynamic-form-ui/ds-dynamic-type-bind-relation.service.spec.ts index 12b2409bf2..a86e3e5ca5 100644 --- a/src/app/shared/form/builder/ds-dynamic-form-ui/ds-dynamic-type-bind-relation.service.spec.ts +++ b/src/app/shared/form/builder/ds-dynamic-form-ui/ds-dynamic-type-bind-relation.service.spec.ts @@ -38,19 +38,19 @@ describe('DSDynamicTypeBindRelationService test suite', () => { beforeEach(inject([DsDynamicTypeBindRelationService, DynamicFormRelationService], (relationService: DsDynamicTypeBindRelationService, - formRelationService: DynamicFormRelationService, + formRelationService: DynamicFormRelationService, ) => { - service = relationService; - dynamicFormRelationService = formRelationService; - })); + service = relationService; + dynamicFormRelationService = formRelationService; + })); describe('Test getTypeBindValue method', () => { it('Should get type bind "boundType" from the given metadata object value', () => { - const mockMetadataValueObject: FormFieldMetadataValueObject = new FormFieldMetadataValueObject( - 'boundType', null, null, 'Bound Type' - ); - const bindType = service.getTypeBindValue(mockMetadataValueObject); - expect(bindType).toBe('boundType'); + const mockMetadataValueObject: FormFieldMetadataValueObject = new FormFieldMetadataValueObject( + 'boundType', null, null, 'Bound Type' + ); + const bindType = service.getTypeBindValue(mockMetadataValueObject); + expect(bindType).toBe('boundType'); }); it('Should get type authority key "bound-auth-key" from the given metadata object value', () => { const mockMetadataValueObject: FormFieldMetadataValueObject = new FormFieldMetadataValueObject( diff --git a/src/app/shared/form/builder/ds-dynamic-form-ui/models/relation-group/dynamic-relation-group.components.ts b/src/app/shared/form/builder/ds-dynamic-form-ui/models/relation-group/dynamic-relation-group.components.ts index 7fdfb61b74..5146dfcbf9 100644 --- a/src/app/shared/form/builder/ds-dynamic-form-ui/models/relation-group/dynamic-relation-group.components.ts +++ b/src/app/shared/form/builder/ds-dynamic-form-ui/models/relation-group/dynamic-relation-group.components.ts @@ -260,10 +260,10 @@ export class DsDynamicRelationGroupComponent extends DynamicFormControlComponent mergeMap((valueListObj: Observable, index: number) => { return valueListObj.pipe( map((valueObj: any) => ({ - index: index, value: valueObj.reduce( + index: index, value: valueObj.reduce( (acc: any, value: any) => Object.assign({}, acc, value) - ) - }) + ) + }) ) ); }), diff --git a/src/app/shared/form/builder/ds-dynamic-form-ui/models/relation-group/dynamic-relation-group.model.ts b/src/app/shared/form/builder/ds-dynamic-form-ui/models/relation-group/dynamic-relation-group.model.ts index 8b5ba1f796..916d047a9c 100644 --- a/src/app/shared/form/builder/ds-dynamic-form-ui/models/relation-group/dynamic-relation-group.model.ts +++ b/src/app/shared/form/builder/ds-dynamic-form-ui/models/relation-group/dynamic-relation-group.model.ts @@ -41,7 +41,7 @@ export class DynamicRelationGroupModel extends DsDynamicInputModel { this.value = value; } -/* get value() { + /* get value() { return (isEmpty(this.value)) ? null : this.value }*/ diff --git a/src/app/shared/form/builder/ds-dynamic-form-ui/models/scrollable-dropdown/dynamic-scrollable-dropdown.component.ts b/src/app/shared/form/builder/ds-dynamic-form-ui/models/scrollable-dropdown/dynamic-scrollable-dropdown.component.ts index a4ca210193..7b822aa75a 100644 --- a/src/app/shared/form/builder/ds-dynamic-form-ui/models/scrollable-dropdown/dynamic-scrollable-dropdown.component.ts +++ b/src/app/shared/form/builder/ds-dynamic-form-ui/models/scrollable-dropdown/dynamic-scrollable-dropdown.component.ts @@ -59,7 +59,7 @@ export class DsDynamicScrollableDropdownComponent extends DsDynamicVocabularyCom catchError(() => observableOf(buildPaginatedList( new PageInfo(), [] - )) + )) )) .subscribe((list: PaginatedList) => { this.optionsList = list.page; @@ -132,7 +132,7 @@ export class DsDynamicScrollableDropdownComponent extends DsDynamicVocabularyCom catchError(() => observableOf(buildPaginatedList( new PageInfo(), [] - )) + )) ), tap(() => this.loading = false)) .subscribe((list: PaginatedList) => { diff --git a/src/app/shared/form/builder/ds-dynamic-form-ui/relation-lookup-modal/dynamic-lookup-relation-modal.component.ts b/src/app/shared/form/builder/ds-dynamic-form-ui/relation-lookup-modal/dynamic-lookup-relation-modal.component.ts index ab58884bfb..90e93fc135 100644 --- a/src/app/shared/form/builder/ds-dynamic-form-ui/relation-lookup-modal/dynamic-lookup-relation-modal.component.ts +++ b/src/app/shared/form/builder/ds-dynamic-form-ui/relation-lookup-modal/dynamic-lookup-relation-modal.component.ts @@ -220,25 +220,25 @@ export class DsDynamicLookupRelationModalComponent implements OnInit, OnDestroy this.zone.runOutsideAngular( () => { const obs: Observable = observableCombineLatest([...selectableObjects.map((sri: SearchResult) => { - this.addNameVariantSubscription(sri); - return this.relationshipService.getNameVariant(this.listId, sri.indexableObject.uuid) - .pipe( - take(1), - map((nameVariant: string) => { - return { - item: sri.indexableObject, - nameVariant - }; - }) - ); - }) + this.addNameVariantSubscription(sri); + return this.relationshipService.getNameVariant(this.listId, sri.indexableObject.uuid) + .pipe( + take(1), + map((nameVariant: string) => { + return { + item: sri.indexableObject, + nameVariant + }; + }) + ); + }) ]); obs .subscribe((arr: any[]) => { return arr.forEach((object: any) => { const addRelationshipAction = new AddRelationshipAction(this.item, object.item, this.relationshipOptions.relationshipType, this.submissionId, object.nameVariant); this.store.dispatch(addRelationshipAction); - } + } ); }); }); diff --git a/src/app/shared/form/builder/ds-dynamic-form-ui/relation-lookup-modal/relationship.effects.ts b/src/app/shared/form/builder/ds-dynamic-form-ui/relation-lookup-modal/relationship.effects.ts index 2b9c1c2973..7074082679 100644 --- a/src/app/shared/form/builder/ds-dynamic-form-ui/relation-lookup-modal/relationship.effects.ts +++ b/src/app/shared/form/builder/ds-dynamic-form-ui/relation-lookup-modal/relationship.effects.ts @@ -61,41 +61,41 @@ export class RelationshipEffects { /** * Effect that makes sure all last fired RelationshipActions' types are stored in the map of this service, with the object uuid as their key */ - mapLastActions$ = createEffect(() => this.actions$ + mapLastActions$ = createEffect(() => this.actions$ .pipe( ofType(RelationshipActionTypes.ADD_RELATIONSHIP, RelationshipActionTypes.REMOVE_RELATIONSHIP), map((action: RelationshipAction) => { - const { item1, item2, submissionId, relationshipType } = action.payload; - const identifier: string = this.createIdentifier(item1, item2, relationshipType); - if (hasNoValue(this.debounceMap[identifier])) { - this.initialActionMap[identifier] = action.type; - this.debounceMap[identifier] = new BehaviorSubject(action.type); - this.debounceMap[identifier].pipe( - this.debounceTime(DEBOUNCE_TIME), - take(1) - ).subscribe( - (type) => { - if (this.initialActionMap[identifier] === type) { - if (type === RelationshipActionTypes.ADD_RELATIONSHIP) { - let nameVariant = (action as AddRelationshipAction).payload.nameVariant; - if (hasValue(this.nameVariantUpdates[identifier])) { - nameVariant = this.nameVariantUpdates[identifier]; - delete this.nameVariantUpdates[identifier]; - } - this.addRelationship(item1, item2, relationshipType, submissionId, nameVariant); - } else { - this.removeRelationship(item1, item2, relationshipType, submissionId); + const { item1, item2, submissionId, relationshipType } = action.payload; + const identifier: string = this.createIdentifier(item1, item2, relationshipType); + if (hasNoValue(this.debounceMap[identifier])) { + this.initialActionMap[identifier] = action.type; + this.debounceMap[identifier] = new BehaviorSubject(action.type); + this.debounceMap[identifier].pipe( + this.debounceTime(DEBOUNCE_TIME), + take(1) + ).subscribe( + (type) => { + if (this.initialActionMap[identifier] === type) { + if (type === RelationshipActionTypes.ADD_RELATIONSHIP) { + let nameVariant = (action as AddRelationshipAction).payload.nameVariant; + if (hasValue(this.nameVariantUpdates[identifier])) { + nameVariant = this.nameVariantUpdates[identifier]; + delete this.nameVariantUpdates[identifier]; } + this.addRelationship(item1, item2, relationshipType, submissionId, nameVariant); + } else { + this.removeRelationship(item1, item2, relationshipType, submissionId); } - delete this.debounceMap[identifier]; - delete this.initialActionMap[identifier]; - } - ); - } else { - this.debounceMap[identifier].next(action.type); - } + delete this.debounceMap[identifier]; + delete this.initialActionMap[identifier]; + + } + ); + } else { + this.debounceMap[identifier].next(action.type); } + } ) ), { dispatch: false }); @@ -104,33 +104,33 @@ export class RelationshipEffects { * If the relationship is currently being added or removed, it will add the name variant to an update map so it will be sent with the next add request instead * Otherwise the update is done immediately */ - updateNameVariantsActions$ = createEffect(() => this.actions$ + updateNameVariantsActions$ = createEffect(() => this.actions$ .pipe( ofType(RelationshipActionTypes.UPDATE_NAME_VARIANT), map((action: UpdateRelationshipNameVariantAction) => { - const { item1, item2, relationshipType, submissionId, nameVariant } = action.payload; - const identifier: string = this.createIdentifier(item1, item2, relationshipType); - const inProgress = hasValue(this.debounceMap[identifier]); - if (inProgress) { - this.nameVariantUpdates[identifier] = nameVariant; - } else { - this.relationshipService.updateNameVariant(item1, item2, relationshipType, nameVariant).pipe( - filter((relationshipRD: RemoteData) => hasValue(relationshipRD.payload)), - take(1) - ).subscribe((c) => { - this.updateAfterPatchSubmissionId = submissionId; - this.relationshipService.refreshRelationshipItemsInCache(item1); - this.relationshipService.refreshRelationshipItemsInCache(item2); - }); - } + const { item1, item2, relationshipType, submissionId, nameVariant } = action.payload; + const identifier: string = this.createIdentifier(item1, item2, relationshipType); + const inProgress = hasValue(this.debounceMap[identifier]); + if (inProgress) { + this.nameVariantUpdates[identifier] = nameVariant; + } else { + this.relationshipService.updateNameVariant(item1, item2, relationshipType, nameVariant).pipe( + filter((relationshipRD: RemoteData) => hasValue(relationshipRD.payload)), + take(1) + ).subscribe((c) => { + this.updateAfterPatchSubmissionId = submissionId; + this.relationshipService.refreshRelationshipItemsInCache(item1); + this.relationshipService.refreshRelationshipItemsInCache(item2); + }); } + } ) ), { dispatch: false }); /** * Save the latest submission ID, to make sure it's updated when the patch is finished */ - updateRelationshipActions$ = createEffect(() => this.actions$ + updateRelationshipActions$ = createEffect(() => this.actions$ .pipe( ofType(RelationshipActionTypes.UPDATE_RELATIONSHIP), map((action: UpdateRelationshipAction) => { @@ -141,7 +141,7 @@ export class RelationshipEffects { /** * Save the submission object with ID updateAfterPatchSubmissionId */ - saveSubmissionSection = createEffect(() => this.actions$ + saveSubmissionSection = createEffect(() => this.actions$ .pipe( ofType(ServerSyncBufferActionTypes.EMPTY, JsonPatchOperationsActionTypes.COMMIT_JSON_PATCH_OPERATIONS), filter(() => hasValue(this.updateAfterPatchSubmissionId)), diff --git a/src/app/shared/form/builder/ds-dynamic-form-ui/relation-lookup-modal/search-tab/dynamic-lookup-relation-search-tab.component.spec.ts b/src/app/shared/form/builder/ds-dynamic-form-ui/relation-lookup-modal/search-tab/dynamic-lookup-relation-search-tab.component.spec.ts index f689743156..2c8c57a739 100644 --- a/src/app/shared/form/builder/ds-dynamic-form-ui/relation-lookup-modal/search-tab/dynamic-lookup-relation-search-tab.component.spec.ts +++ b/src/app/shared/form/builder/ds-dynamic-form-ui/relation-lookup-modal/search-tab/dynamic-lookup-relation-search-tab.component.spec.ts @@ -48,15 +48,15 @@ describe('DsDynamicLookupRelationSearchTabComponent', () => { }); const relationshipType = { - 'type': 'relationshiptype', - 'id': 1, - 'uuid': 'relationshiptype-1', - 'leftwardType': 'isAuthorOfPublication', - 'leftMaxCardinality': null, - 'leftMinCardinality': 0, - 'rightwardType': 'isPublicationOfAuthor', - 'rightMaxCardinality': null, - 'rightMinCardinality': 0, + 'type': 'relationshiptype', + 'id': 1, + 'uuid': 'relationshiptype-1', + 'leftwardType': 'isAuthorOfPublication', + 'leftMaxCardinality': null, + 'leftMinCardinality': 0, + 'rightwardType': 'isPublicationOfAuthor', + 'rightMaxCardinality': null, + 'rightMinCardinality': 0, }; function init() { diff --git a/src/app/shared/form/builder/ds-dynamic-form-ui/relation-lookup-modal/search-tab/dynamic-lookup-relation-search-tab.component.ts b/src/app/shared/form/builder/ds-dynamic-form-ui/relation-lookup-modal/search-tab/dynamic-lookup-relation-search-tab.component.ts index 9452918a97..9922ae21db 100644 --- a/src/app/shared/form/builder/ds-dynamic-form-ui/relation-lookup-modal/search-tab/dynamic-lookup-relation-search-tab.component.ts +++ b/src/app/shared/form/builder/ds-dynamic-form-ui/relation-lookup-modal/search-tab/dynamic-lookup-relation-search-tab.component.ts @@ -224,7 +224,7 @@ export class DsDynamicLookupRelationSearchTabComponent implements OnInit, OnDest mapTo(results) )) ).subscribe((results) => { - this.selectableListService.select(this.listId, results); + this.selectableListService.select(this.listId, results); }); } @@ -239,30 +239,30 @@ export class DsDynamicLookupRelationSearchTabComponent implements OnInit, OnDest relationType = this.relationshipType.leftwardType; } this.relationshipService.searchByItemsAndType( this.relationshipType.id, this.item.uuid, relationType ,idOfItems ).pipe( - getFirstSucceededRemoteData(), - getRemoteDataPayload(), - ).subscribe( (res: PaginatedList) => { + getFirstSucceededRemoteData(), + getRemoteDataPayload(), + ).subscribe( (res: PaginatedList) => { - let selectableObject = res.page.map( (relationship: any) => { + let selectableObject = res.page.map( (relationship: any) => { - let arrUrl = []; - if ( this.isLeft ) { - arrUrl = relationship._links.rightItem.href.split('/'); - } else { - arrUrl = relationship._links.leftItem.href.split('/'); - } - const uuid = arrUrl[ arrUrl.length - 1 ]; - - return this.getRelatedItem(uuid, resultListOfItems); - }); - - selectableObject = selectableObject.filter( (selObject) => { - return !this.getIfInRemove(selObject.indexableObject.uuid); - }); - - if ( selectableObject.length > 0 ) { - this.selectableListService.select(this.listId, selectableObject); + let arrUrl = []; + if ( this.isLeft ) { + arrUrl = relationship._links.rightItem.href.split('/'); + } else { + arrUrl = relationship._links.leftItem.href.split('/'); } + const uuid = arrUrl[ arrUrl.length - 1 ]; + + return this.getRelatedItem(uuid, resultListOfItems); + }); + + selectableObject = selectableObject.filter( (selObject) => { + return !this.getIfInRemove(selObject.indexableObject.uuid); + }); + + if ( selectableObject.length > 0 ) { + this.selectableListService.select(this.listId, selectableObject); + } }); } diff --git a/src/app/shared/form/builder/form-builder.service.ts b/src/app/shared/form/builder/form-builder.service.ts index cf6f38bf7b..2f786b0949 100644 --- a/src/app/shared/form/builder/form-builder.service.ts +++ b/src/app/shared/form/builder/form-builder.service.ts @@ -280,10 +280,10 @@ export class FormBuilderService extends DynamicFormService { } modelFromConfiguration(submissionId: string, json: string | SubmissionFormsModel, scopeUUID: string, sectionData: any = {}, - submissionScope?: string, readOnly = false, typeBindModel = null, - isInnerForm = false): DynamicFormControlModel[] | never { - let rows: DynamicFormControlModel[] = []; - const rawData = typeof json === 'string' ? JSON.parse(json, parseReviver) : json; + submissionScope?: string, readOnly = false, typeBindModel = null, + isInnerForm = false): DynamicFormControlModel[] | never { + let rows: DynamicFormControlModel[] = []; + const rawData = typeof json === 'string' ? JSON.parse(json, parseReviver) : json; if (rawData.rows && !isEmpty(rawData.rows)) { rawData.rows.forEach((currentRow) => { const rowParsed = this.rowParser.parse(submissionId, currentRow, scopeUUID, sectionData, submissionScope, diff --git a/src/app/shared/form/builder/models/form-field-metadata-value.model.ts b/src/app/shared/form/builder/models/form-field-metadata-value.model.ts index 9b18084e40..7738bdb8a2 100644 --- a/src/app/shared/form/builder/models/form-field-metadata-value.model.ts +++ b/src/app/shared/form/builder/models/form-field-metadata-value.model.ts @@ -26,13 +26,13 @@ export class FormFieldMetadataValueObject implements MetadataValueInterface { otherInformation: OtherInformation; constructor(value: any = null, - language: any = null, - authority: string = null, - display: string = null, - place: number = 0, - confidence: number = null, - otherInformation: any = null, - metadata: string = null) { + language: any = null, + authority: string = null, + display: string = null, + place: number = 0, + confidence: number = null, + otherInformation: any = null, + metadata: string = null) { this.value = isNotNull(value) ? ((typeof value === 'string') ? value.trim() : value) : null; this.language = language; this.authority = authority; diff --git a/src/app/shared/form/builder/models/form-field.model.ts b/src/app/shared/form/builder/models/form-field.model.ts index cbaf8193df..5a542ab1d6 100644 --- a/src/app/shared/form/builder/models/form-field.model.ts +++ b/src/app/shared/form/builder/models/form-field.model.ts @@ -39,43 +39,43 @@ export class FormFieldModel { * The hints for this metadata field to display on form */ @autoserialize - hints: string; + hints: string; /** * The label for this metadata field to display on form */ @autoserialize - label: string; + label: string; /** * The languages available for this metadata field to display on form */ @autoserialize - languageCodes: LanguageCode[]; + languageCodes: LanguageCode[]; /** * The error message for this metadata field to display on form in case of field is required */ @autoserialize - mandatoryMessage: string; + mandatoryMessage: string; /** * Representing if this metadata field is mandatory or not */ @autoserialize - mandatory: string; + mandatory: string; /** * Representing if this metadata field is repeatable or not */ @autoserialize - repeatable: boolean; + repeatable: boolean; /** * Containing additional properties for this metadata field */ @autoserialize - input: { + input: { /** * Representing the type for this metadata field */ @@ -91,41 +91,41 @@ export class FormFieldModel { * Representing additional vocabulary configuration for this metadata field */ @autoserialize - selectableMetadata: SelectableMetadata[]; + selectableMetadata: SelectableMetadata[]; /** * Representing additional relationship configuration for this metadata field */ @autoserialize - selectableRelationship: RelationshipOptions; + selectableRelationship: RelationshipOptions; @autoserialize - rows: FormRowModel[]; + rows: FormRowModel[]; /** * Representing the scope for this metadata field */ @autoserialize - scope: string; + scope: string; /** * Containing additional css classes for this metadata field to use on form */ @autoserialize - style: string; + style: string; /** * Containing types to bind for this field */ @autoserialize - typeBind: string[]; + typeBind: string[]; /** * Containing the value for this metadata field */ @autoserialize - value: any; + value: any; @autoserialize - visibility: SectionVisibility; + visibility: SectionVisibility; } diff --git a/src/app/shared/form/builder/parsers/field-parser.ts b/src/app/shared/form/builder/parsers/field-parser.ts index 7ea55d4454..9bf8b46d74 100644 --- a/src/app/shared/form/builder/parsers/field-parser.ts +++ b/src/app/shared/form/builder/parsers/field-parser.ts @@ -57,7 +57,7 @@ export abstract class FieldParser { public abstract modelFactory(fieldValue?: FormFieldMetadataValueObject, label?: boolean): any; public parse() { - if (((this.getInitValueCount() > 1 && !this.configData.repeatable) || (this.configData.repeatable)) + if (((this.getInitValueCount() > 1 && !this.configData.repeatable) || (this.configData.repeatable)) && (this.configData.input.type !== ParserType.List) && (this.configData.input.type !== ParserType.Tag) ) { @@ -334,9 +334,9 @@ export abstract class FieldParser { && isNotEmpty(fieldScope) && isNotEmpty(visibility) && (( - submissionScope === SubmissionScopeType.WorkspaceItem + submissionScope === SubmissionScopeType.WorkspaceItem && visibility.main === VisibilityType.READONLY - ) + ) || (visibility.other === VisibilityType.READONLY && submissionScope === SubmissionScopeType.WorkflowItem diff --git a/src/app/shared/form/builder/parsers/row-parser.ts b/src/app/shared/form/builder/parsers/row-parser.ts index 3f5b4a04c6..9ef7a9fa7c 100644 --- a/src/app/shared/form/builder/parsers/row-parser.ts +++ b/src/app/shared/form/builder/parsers/row-parser.ts @@ -30,12 +30,12 @@ export class RowParser { } public parse(submissionId: string, - rowData, - scopeUUID, - initFormValues: any, - submissionScope, - readOnly: boolean, - typeField: string): DynamicRowGroupModel { + rowData, + scopeUUID, + initFormValues: any, + submissionScope, + readOnly: boolean, + typeField: string): DynamicRowGroupModel { let fieldModel: any = null; let parsedResult = null; const config: DynamicFormGroupModelConfig = { diff --git a/src/app/shared/form/chips/chips.component.ts b/src/app/shared/form/chips/chips.component.ts index 5166657582..d9ed465865 100644 --- a/src/app/shared/form/chips/chips.component.ts +++ b/src/app/shared/form/chips/chips.component.ts @@ -102,7 +102,7 @@ export class ChipsComponent implements OnChanges { .subscribe((label) => { textToDisplay.push(label + ': ' + chipsItem.item[field].otherInformation[otherField]); }); - }); + }); } } else { textToDisplay.push(chipsItem.item[field]); diff --git a/src/app/shared/form/chips/models/chips-item.model.ts b/src/app/shared/form/chips/models/chips-item.model.ts index 277e6477ce..b2c2a299e1 100644 --- a/src/app/shared/form/chips/models/chips-item.model.ts +++ b/src/app/shared/form/chips/models/chips-item.model.ts @@ -23,10 +23,10 @@ export class ChipsItem { private objToDisplay: string; constructor(item: any, - fieldToDisplay: string = 'display', - objToDisplay?: string, - icons?: ChipsItemIcon[], - editMode?: boolean) { + fieldToDisplay: string = 'display', + objToDisplay?: string, + icons?: ChipsItemIcon[], + editMode?: boolean) { this.id = uniqueId(); this._item = item; @@ -53,7 +53,7 @@ export class ChipsItem { } hasIcons(): boolean { - return isNotEmpty(this.icons); + return isNotEmpty(this.icons); } hasVisibleIcons(): boolean { diff --git a/src/app/shared/form/chips/models/chips.model.ts b/src/app/shared/form/chips/models/chips.model.ts index 1148d40e71..a6421b95d5 100644 --- a/src/app/shared/form/chips/models/chips.model.ts +++ b/src/app/shared/form/chips/models/chips.model.ts @@ -18,9 +18,9 @@ export class Chips { private _items: ChipsItem[]; constructor(items: any[] = [], - displayField: string = 'display', - displayObj?: string, - iconsConfig?: MetadataIconConfig[]) { + displayField: string = 'display', + displayObj?: string, + iconsConfig?: MetadataIconConfig[]) { this.displayField = displayField; this.displayObj = displayObj; diff --git a/src/app/shared/form/form.reducer.ts b/src/app/shared/form/form.reducer.ts index c1e9b12efa..cbe9fe7480 100644 --- a/src/app/shared/form/form.reducer.ts +++ b/src/app/shared/form/form.reducer.ts @@ -171,9 +171,9 @@ function changeDataForm(state: FormState, action: FormChangeAction): FormState { if (hasValue(state[action.payload.formId])) { const newState = Object.assign({}, state); newState[action.payload.formId] = Object.assign({}, newState[action.payload.formId], { - data: action.payload.formData, - valid: state[action.payload.formId].valid - } + data: action.payload.formData, + valid: state[action.payload.formId].valid + } ); return newState; } else { @@ -202,9 +202,9 @@ function changeStatusForm(state: FormState, action: FormStatusChangeAction): For } else { const newState = Object.assign({}, state); newState[action.payload.formId] = Object.assign({}, newState[action.payload.formId], { - data: state[action.payload.formId].data, - valid: action.payload.valid - } + data: state[action.payload.formId].data, + valid: action.payload.valid + } ); return newState; } diff --git a/src/app/shared/form/form.service.spec.ts b/src/app/shared/form/form.service.spec.ts index 57880ffc14..ad56c5c535 100644 --- a/src/app/shared/form/form.service.spec.ts +++ b/src/app/shared/form/form.service.spec.ts @@ -99,26 +99,26 @@ describe('FormService test suite', () => { })); beforeEach(inject([Store], (store: Store) => { - builderService = getMockFormBuilderService(); - store - .subscribe((state) => { - state.forms = formState; - }); - const author: AbstractControl = new UntypedFormControl('test'); - const title: AbstractControl = new UntypedFormControl(undefined, Validators.required); - const date: AbstractControl = new UntypedFormControl(undefined); - const description: AbstractControl = new UntypedFormControl(undefined); - - const addressLocation: UntypedFormGroup = new UntypedFormGroup({ - zipCode: new UntypedFormControl(undefined), - state: new UntypedFormControl(undefined), - city: new UntypedFormControl(undefined), + builderService = getMockFormBuilderService(); + store + .subscribe((state) => { + state.forms = formState; }); + const author: AbstractControl = new UntypedFormControl('test'); + const title: AbstractControl = new UntypedFormControl(undefined, Validators.required); + const date: AbstractControl = new UntypedFormControl(undefined); + const description: AbstractControl = new UntypedFormControl(undefined); - formGroup = new UntypedFormGroup({ author, title, date, description, addressLocation }); - controls = { author, title, date, description , addressLocation }; - service = new FormService(builderService, store); - }) + const addressLocation: UntypedFormGroup = new UntypedFormGroup({ + zipCode: new UntypedFormControl(undefined), + state: new UntypedFormControl(undefined), + city: new UntypedFormControl(undefined), + }); + + formGroup = new UntypedFormGroup({ author, title, date, description, addressLocation }); + controls = { author, title, date, description , addressLocation }; + service = new FormService(builderService, store); + }) ) ; diff --git a/src/app/shared/form/number-picker/number-picker.component.ts b/src/app/shared/form/number-picker/number-picker.component.ts index 82240c41d1..e9182263fc 100644 --- a/src/app/shared/form/number-picker/number-picker.component.ts +++ b/src/app/shared/form/number-picker/number-picker.component.ts @@ -54,7 +54,7 @@ export class NumberPickerComponent implements OnInit, ControlValueAccessor { } else if (changes.value && changes.value.currentValue === null) { // When the user delete the inserted value - this.value = null; + this.value = null; } else if (changes.invalid) { this.invalid = changes.invalid.currentValue; } diff --git a/src/app/shared/form/vocabulary-treeview-modal/vocabulary-treeview-modal.component.spec.ts b/src/app/shared/form/vocabulary-treeview-modal/vocabulary-treeview-modal.component.spec.ts index 590c69a159..87a54a3310 100644 --- a/src/app/shared/form/vocabulary-treeview-modal/vocabulary-treeview-modal.component.spec.ts +++ b/src/app/shared/form/vocabulary-treeview-modal/vocabulary-treeview-modal.component.spec.ts @@ -18,7 +18,7 @@ describe('VocabularyTreeviewModalComponent', () => { { provide: NgbActiveModal, useValue: modalStub }, ], }) - .compileComponents(); + .compileComponents(); }); beforeEach(() => { diff --git a/src/app/shared/form/vocabulary-treeview/vocabulary-tree-flattener.ts b/src/app/shared/form/vocabulary-treeview/vocabulary-tree-flattener.ts index 419f48d222..4e1c342521 100644 --- a/src/app/shared/form/vocabulary-treeview/vocabulary-tree-flattener.ts +++ b/src/app/shared/form/vocabulary-treeview/vocabulary-tree-flattener.ts @@ -46,7 +46,7 @@ export class VocabularyTreeFlattener { Observable | T[] | undefined | null) {} _flattenNode(node: T, level: number, - resultNodes: F[], parentMap: boolean[]): F[] { + resultNodes: F[], parentMap: boolean[]): F[] { const flatNode = this.transformFunction(node, level); resultNodes.push(flatNode); @@ -66,7 +66,7 @@ export class VocabularyTreeFlattener { } _flattenChildren(children: T[], level: number, - resultNodes: F[], parentMap: boolean[]): void { + resultNodes: F[], parentMap: boolean[]): void { children.forEach((child, index) => { const childParentMap: boolean[] = parentMap.slice(); childParentMap.push(index !== children.length - 1); diff --git a/src/app/shared/form/vocabulary-treeview/vocabulary-treeview.service.ts b/src/app/shared/form/vocabulary-treeview/vocabulary-treeview.service.ts index f524af4c0e..598c68440c 100644 --- a/src/app/shared/form/vocabulary-treeview/vocabulary-treeview.service.ts +++ b/src/app/shared/form/vocabulary-treeview/vocabulary-treeview.service.ts @@ -116,7 +116,7 @@ export class VocabularyTreeviewService { .subscribe((hierarchy: string[]) => { this.initValueHierarchy = hierarchy; this.retrieveTopNodes(pageInfo, [], selectedItems); - }); + }); } else { this.retrieveTopNodes(pageInfo, [], selectedItems); } diff --git a/src/app/shared/google-recaptcha/google-recaptcha.component.spec.ts b/src/app/shared/google-recaptcha/google-recaptcha.component.spec.ts index 67f66c9757..02181110aa 100644 --- a/src/app/shared/google-recaptcha/google-recaptcha.component.spec.ts +++ b/src/app/shared/google-recaptcha/google-recaptcha.component.spec.ts @@ -24,11 +24,11 @@ describe('GoogleRecaptchaComponent', () => { await TestBed.configureTestingModule({ declarations: [ GoogleRecaptchaComponent ], providers: [ - { provide: ConfigurationDataService, useValue: configurationDataService }, - { provide: NativeWindowService, useFactory: NativeWindowMockFactory }, - ] + { provide: ConfigurationDataService, useValue: configurationDataService }, + { provide: NativeWindowService, useFactory: NativeWindowMockFactory }, + ] }) - .compileComponents(); + .compileComponents(); }); diff --git a/src/app/shared/host-window.service.ts b/src/app/shared/host-window.service.ts index 6d13d921e0..f5bca6aff4 100644 --- a/src/app/shared/host-window.service.ts +++ b/src/app/shared/host-window.service.ts @@ -31,11 +31,11 @@ export class HostWindowService { /* See _exposed_variables.scss */ variableService.getAllVariables() .subscribe((variables) => { - this.breakPoints.XL_MIN = parseInt(variables['--bs-xl-min'], 10); - this.breakPoints.LG_MIN = parseInt(variables['--bs-lg-min'], 10); - this.breakPoints.MD_MIN = parseInt(variables['--bs-md-min'], 10); - this.breakPoints.SM_MIN = parseInt(variables['--bs-sm-min'], 10); - }); + this.breakPoints.XL_MIN = parseInt(variables['--bs-xl-min'], 10); + this.breakPoints.LG_MIN = parseInt(variables['--bs-lg-min'], 10); + this.breakPoints.MD_MIN = parseInt(variables['--bs-md-min'], 10); + this.breakPoints.SM_MIN = parseInt(variables['--bs-sm-min'], 10); + }); } private getWidthObs(): Observable { diff --git a/src/app/shared/idle-modal/idle-modal.component.ts b/src/app/shared/idle-modal/idle-modal.component.ts index 4873137ff1..1948fd5917 100644 --- a/src/app/shared/idle-modal/idle-modal.component.ts +++ b/src/app/shared/idle-modal/idle-modal.component.ts @@ -28,7 +28,7 @@ export class IdleModalComponent implements OnInit { * An event fired when the modal is closed */ @Output() - response = new EventEmitter(); + response = new EventEmitter(); constructor(private activeModal: NgbActiveModal, private authService: AuthService, diff --git a/src/app/shared/log-in/container/log-in-container.component.ts b/src/app/shared/log-in/container/log-in-container.component.ts index f6a08a1e1e..42ad48359a 100644 --- a/src/app/shared/log-in/container/log-in-container.component.ts +++ b/src/app/shared/log-in/container/log-in-container.component.ts @@ -52,7 +52,7 @@ export class LogInContainerComponent implements OnInit { * Find the correct component based on the AuthMethod's type */ getAuthMethodContent(): string { - return rendersAuthMethodType(this.authMethod.authMethodType); + return rendersAuthMethodType(this.authMethod.authMethodType); } } diff --git a/src/app/shared/log-in/methods/password/log-in-password.component.ts b/src/app/shared/log-in/methods/password/log-in-password.component.ts index 22b3b13130..a59766ce19 100644 --- a/src/app/shared/log-in/methods/password/log-in-password.component.ts +++ b/src/app/shared/log-in/methods/password/log-in-password.component.ts @@ -100,10 +100,10 @@ export class LogInPasswordComponent implements OnInit { // set error this.error = this.store.pipe(select( getAuthenticationError), - map((error) => { - this.hasError = (isNotEmpty(error)); - return error; - }) + map((error) => { + this.hasError = (isNotEmpty(error)); + return error; + }) ); // set error diff --git a/src/app/shared/menu/menu-section.decorator.ts b/src/app/shared/menu/menu-section.decorator.ts index 515ee2ff5c..2713ee8787 100644 --- a/src/app/shared/menu/menu-section.decorator.ts +++ b/src/app/shared/menu/menu-section.decorator.ts @@ -19,7 +19,7 @@ export function rendersSectionForMenu(menuID: MenuID, expandable: boolean, theme menuComponentMap.set(menuID, new Map()); } if (!menuComponentMap.get(menuID).get(expandable)) { - menuComponentMap.get(menuID).set(expandable, new Map()); + menuComponentMap.get(menuID).set(expandable, new Map()); } menuComponentMap.get(menuID).get(expandable).set(theme, menuSectionWrapperComponent); }; diff --git a/src/app/shared/menu/menu.service.ts b/src/app/shared/menu/menu.service.ts index fac3b3fba7..dbb5fc95bf 100644 --- a/src/app/shared/menu/menu.service.ts +++ b/src/app/shared/menu/menu.service.ts @@ -82,10 +82,10 @@ export class MenuService { select(menuByIDSelector(menuID)), select(menuSectionStateSelector), map((sections: MenuSections) => { - return Object.values(sections) - .filter((section: MenuSection) => hasNoValue(section.parentID)) - .filter((section: MenuSection) => !mustBeVisible || section.visible); - } + return Object.values(sections) + .filter((section: MenuSection) => hasNoValue(section.parentID)) + .filter((section: MenuSection) => !mustBeVisible || section.visible); + } ) ); } diff --git a/src/app/shared/metadata-field-wrapper/metadata-field-wrapper.component.spec.ts b/src/app/shared/metadata-field-wrapper/metadata-field-wrapper.component.spec.ts index 5ef272db3b..5678d3e65a 100644 --- a/src/app/shared/metadata-field-wrapper/metadata-field-wrapper.component.spec.ts +++ b/src/app/shared/metadata-field-wrapper/metadata-field-wrapper.component.spec.ts @@ -5,8 +5,8 @@ import { waitForAsync, ComponentFixture, TestBed } from '@angular/core/testing'; import { MetadataFieldWrapperComponent } from './metadata-field-wrapper.component'; @Component({ - selector: 'ds-component-without-content', - template: '\n' + + selector: 'ds-component-without-content', + template: '\n' + '' }) class NoContentComponent { @@ -14,8 +14,8 @@ class NoContentComponent { } @Component({ - selector: 'ds-component-with-empty-spans', - template: '\n' + + selector: 'ds-component-with-empty-spans', + template: '\n' + ' \n' + ' \n' + '' @@ -25,8 +25,8 @@ class SpanContentComponent { } @Component({ - selector: 'ds-component-with-text', - template: '\n' + + selector: 'ds-component-with-text', + template: '\n' + ' The quick brown fox jumps over the lazy dog\n' + '' }) diff --git a/src/app/shared/metadata-representation/metadata-representation.decorator.spec.ts b/src/app/shared/metadata-representation/metadata-representation.decorator.spec.ts index 09d4d60532..b18a2f0395 100644 --- a/src/app/shared/metadata-representation/metadata-representation.decorator.spec.ts +++ b/src/app/shared/metadata-representation/metadata-representation.decorator.spec.ts @@ -1,4 +1,4 @@ - /* eslint-disable max-classes-per-file */ +/* eslint-disable max-classes-per-file */ import { DEFAULT_ENTITY_TYPE, DEFAULT_REPRESENTATION_TYPE, diff --git a/src/app/shared/mocks/form-builder-service.mock.ts b/src/app/shared/mocks/form-builder-service.mock.ts index eaaeb60829..2384fe5cac 100644 --- a/src/app/shared/mocks/form-builder-service.mock.ts +++ b/src/app/shared/mocks/form-builder-service.mock.ts @@ -22,23 +22,23 @@ export function getMockFormBuilderService(): FormBuilderService { isConcatGroup: false, hasArrayGroupValue: true, getTypeBindModel: new DsDynamicInputModel({ - name: 'dc.type', - id: 'dc_type', - readOnly: false, - disabled: false, - repeatable: false, - value: { - value: 'boundType', - display: 'Bound Type', - authority: 'bound-auth-key' - }, - submissionId: '1234', - metadataFields: ['dc.type'], - hasSelectableMetadata: false, - typeBindRelations: [ - {match: 'VISIBLE', operator: 'OR', when: [{id: 'dc.type', value: 'boundType'}]} - ] - } + name: 'dc.type', + id: 'dc_type', + readOnly: false, + disabled: false, + repeatable: false, + value: { + value: 'boundType', + display: 'Bound Type', + authority: 'bound-auth-key' + }, + submissionId: '1234', + metadataFields: ['dc.type'], + hasSelectableMetadata: false, + typeBindRelations: [ + {match: 'VISIBLE', operator: 'OR', when: [{id: 'dc.type', value: 'boundType'}]} + ] + } ) }); diff --git a/src/app/shared/mocks/form-models.mock.ts b/src/app/shared/mocks/form-models.mock.ts index 3529f9e81b..8a157c22c2 100644 --- a/src/app/shared/mocks/form-models.mock.ts +++ b/src/app/shared/mocks/form-models.mock.ts @@ -323,23 +323,23 @@ export const inputWithTypeBindConfig = { metadataFields: [], hasSelectableMetadata: false, getTypeBindModel: new DsDynamicInputModel({ - name: 'testWithTypeBind', - id: 'testWithTypeBind', - readOnly: false, - disabled: false, - repeatable: false, - value: { - value: 'testWithTypeBind', - display: 'testWithTypeBind', - authority: 'bound-auth-key' - }, - submissionId: '1234', - metadataFields: [], - hasSelectableMetadata: false, - typeBindRelations: [ - {match: 'VISIBLE', operator: 'OR', when: [{'id': 'dc.type', 'value': 'boundType'}]} - ] - } + name: 'testWithTypeBind', + id: 'testWithTypeBind', + readOnly: false, + disabled: false, + repeatable: false, + value: { + value: 'testWithTypeBind', + display: 'testWithTypeBind', + authority: 'bound-auth-key' + }, + submissionId: '1234', + metadataFields: [], + hasSelectableMetadata: false, + typeBindRelations: [ + {match: 'VISIBLE', operator: 'OR', when: [{'id': 'dc.type', 'value': 'boundType'}]} + ] + } ) }; diff --git a/src/app/shared/mocks/http-xsrf-token-extractor.mock.ts b/src/app/shared/mocks/http-xsrf-token-extractor.mock.ts index 78766a0b31..17dd25685e 100644 --- a/src/app/shared/mocks/http-xsrf-token-extractor.mock.ts +++ b/src/app/shared/mocks/http-xsrf-token-extractor.mock.ts @@ -6,7 +6,7 @@ import { HttpXsrfTokenExtractor } from '@angular/common/http'; * the same fake XSRF token. */ export class HttpXsrfTokenExtractorMock extends HttpXsrfTokenExtractor { - constructor(private token: string | null) { super(); } + constructor(private token: string | null) { super(); } - getToken(): string | null { return this.token; } + getToken(): string | null { return this.token; } } diff --git a/src/app/shared/mocks/item.mock.ts b/src/app/shared/mocks/item.mock.ts index 77685cca9a..a41fb1ba1f 100644 --- a/src/app/shared/mocks/item.mock.ts +++ b/src/app/shared/mocks/item.mock.ts @@ -9,30 +9,30 @@ import { Bundle } from '../../core/shared/bundle.model'; export const MockBitstreamFormat1: BitstreamFormat = Object.assign(new BitstreamFormat(), { shortDescription: 'Microsoft Word XML', - description: 'Microsoft Word XML', - mimetype: 'application/vnd.openxmlformats-officedocument.wordprocessingml.document', - supportLevel: 0, - internal: false, - extensions: null, - _links:{ + description: 'Microsoft Word XML', + mimetype: 'application/vnd.openxmlformats-officedocument.wordprocessingml.document', + supportLevel: 0, + internal: false, + extensions: null, + _links:{ self: { href: 'https://dspace7.4science.it/dspace-spring-rest/api/core/bitstreamformats/10' } - } + } }); export const MockBitstreamFormat2: BitstreamFormat = Object.assign(new BitstreamFormat(), { - shortDescription: 'Adobe PDF', - description: 'Adobe Portable Document Format', - mimetype: 'application/pdf', - supportLevel: 0, - internal: false, - extensions: null, - _links:{ - self: { - href: 'https://dspace7.4science.it/dspace-spring-rest/api/core/bitstreamformats/4' - } + shortDescription: 'Adobe PDF', + description: 'Adobe Portable Document Format', + mimetype: 'application/pdf', + supportLevel: 0, + internal: false, + extensions: null, + _links:{ + self: { + href: 'https://dspace7.4science.it/dspace-spring-rest/api/core/bitstreamformats/4' } + } }); export const MockBitstreamFormat3: BitstreamFormat = Object.assign(new BitstreamFormat(), { @@ -278,19 +278,19 @@ export const ItemMock: Item = Object.assign(new Item(), { ] }, owningCollection: observableOf({ - _links: { - self: { - href: 'https://dspace7.4science.it/dspace-spring-rest/api/core/collections/1c11f3f1-ba1f-4f36-908a-3f1ea9a557eb' - } - }, - requestPending: false, - responsePending: false, - isSuccessful: true, - errorMessage: '', - statusCode: '202', - pageInfo: {}, - payload: [] - } + _links: { + self: { + href: 'https://dspace7.4science.it/dspace-spring-rest/api/core/collections/1c11f3f1-ba1f-4f36-908a-3f1ea9a557eb' + } + }, + requestPending: false, + responsePending: false, + isSuccessful: true, + errorMessage: '', + statusCode: '202', + pageInfo: {}, + payload: [] + } ) }); /* eslint-enable @typescript-eslint/no-shadow */ diff --git a/src/app/shared/mydspace-actions/claimed-task/switcher/claimed-task-actions-decorator.spec.ts b/src/app/shared/mydspace-actions/claimed-task/switcher/claimed-task-actions-decorator.spec.ts index 3630c7ea0c..961035f6fc 100644 --- a/src/app/shared/mydspace-actions/claimed-task/switcher/claimed-task-actions-decorator.spec.ts +++ b/src/app/shared/mydspace-actions/claimed-task/switcher/claimed-task-actions-decorator.spec.ts @@ -1,4 +1,4 @@ - /* eslint-disable max-classes-per-file */ +/* eslint-disable max-classes-per-file */ import { getComponentByWorkflowTaskOption, rendersWorkflowTaskOption } from './claimed-task-actions-decorator'; describe('ClaimedTaskActions decorator function', () => { diff --git a/src/app/shared/mydspace-actions/mydspace-reloadable-actions.ts b/src/app/shared/mydspace-actions/mydspace-reloadable-actions.ts index c126c8c53b..6aaaaae8a6 100644 --- a/src/app/shared/mydspace-actions/mydspace-reloadable-actions.ts +++ b/src/app/shared/mydspace-actions/mydspace-reloadable-actions.ts @@ -138,7 +138,7 @@ export abstract class MyDSpaceReloadableActionsComponent { - return dso ? this.convertReloadedObject(dso) : dso; + return dso ? this.convertReloadedObject(dso) : dso; })); } diff --git a/src/app/shared/mydspace-actions/workspaceitem/workspaceitem-actions.component.spec.ts b/src/app/shared/mydspace-actions/workspaceitem/workspaceitem-actions.component.spec.ts index c76cce3982..ea407e3837 100644 --- a/src/app/shared/mydspace-actions/workspaceitem/workspaceitem-actions.component.spec.ts +++ b/src/app/shared/mydspace-actions/workspaceitem/workspaceitem-actions.component.spec.ts @@ -160,7 +160,7 @@ describe('WorkspaceitemActionsComponent', () => { authorizationService = jasmine.createSpyObj('authorizationService', { isAuthorized: observableOf(true) }); - await TestBed.configureTestingModule({ + await TestBed.configureTestingModule({ imports: [ NgbModule, TranslateModule.forRoot({ diff --git a/src/app/shared/mydspace-actions/workspaceitem/workspaceitem-actions.component.ts b/src/app/shared/mydspace-actions/workspaceitem/workspaceitem-actions.component.ts index 05afacf0da..8f9ece724b 100644 --- a/src/app/shared/mydspace-actions/workspaceitem/workspaceitem-actions.component.ts +++ b/src/app/shared/mydspace-actions/workspaceitem/workspaceitem-actions.component.ts @@ -69,7 +69,7 @@ export class WorkspaceitemActionsComponent extends MyDSpaceActionsComponent | string, - content?: Observable | string, - options?: NotificationOptions, - html?: boolean) { + type: NotificationType, + title?: Observable | string, + content?: Observable | string, + options?: NotificationOptions, + html?: boolean) { this.id = id; this.type = type; diff --git a/src/app/shared/notifications/notifications-board/notifications-board.component.spec.ts b/src/app/shared/notifications/notifications-board/notifications-board.component.spec.ts index 08b9585a8c..6ea0b8586c 100644 --- a/src/app/shared/notifications/notifications-board/notifications-board.component.spec.ts +++ b/src/app/shared/notifications/notifications-board/notifications-board.component.spec.ts @@ -99,10 +99,10 @@ describe('NotificationsBoardComponent', () => { it('should be passed to all notifications', () => { fixture.debugElement.queryAll(By.css('ds-notification')) - .map(node => node.componentInstance) - .forEach(notification => { - expect(notification.isPaused$).toEqual(comp.isPaused$); - }); + .map(node => node.componentInstance) + .forEach(notification => { + expect(notification.isPaused$).toEqual(comp.isPaused$); + }); }); }); diff --git a/src/app/shared/notifications/notifications.effects.ts b/src/app/shared/notifications/notifications.effects.ts index 20f2b618cb..892f154f19 100644 --- a/src/app/shared/notifications/notifications.effects.ts +++ b/src/app/shared/notifications/notifications.effects.ts @@ -10,7 +10,7 @@ export class NotificationsEffects { * Authenticate user. * @method authenticate */ - /* @Effect() + /* @Effect() public timer: Observable = this.actions$ .pipe(ofType(NotificationsActionTypes.NEW_NOTIFICATION_WITH_TIMER), // .debounceTime((action: any) => action.payload.options.timeOut) diff --git a/src/app/shared/notifications/notifications.service.ts b/src/app/shared/notifications/notifications.service.ts index cbdad55203..98c2d67442 100644 --- a/src/app/shared/notifications/notifications.service.ts +++ b/src/app/shared/notifications/notifications.service.ts @@ -26,9 +26,9 @@ export class NotificationsService { } success(title: any = observableOf(''), - content: any = observableOf(''), - options: Partial = {}, - html: boolean = false): INotification { + content: any = observableOf(''), + options: Partial = {}, + html: boolean = false): INotification { const notificationOptions = { ...this.getDefaultOptions(), ...options }; const notification = new Notification(uniqueId(), NotificationType.Success, title, content, notificationOptions, html); this.add(notification); @@ -36,9 +36,9 @@ export class NotificationsService { } error(title: any = observableOf(''), - content: any = observableOf(''), - options: Partial = {}, - html: boolean = false): INotification { + content: any = observableOf(''), + options: Partial = {}, + html: boolean = false): INotification { const notificationOptions = { ...this.getDefaultOptions(), ...options }; const notification = new Notification(uniqueId(), NotificationType.Error, title, content, notificationOptions, html); this.add(notification); @@ -46,9 +46,9 @@ export class NotificationsService { } info(title: any = observableOf(''), - content: any = observableOf(''), - options: Partial = {}, - html: boolean = false): INotification { + content: any = observableOf(''), + options: Partial = {}, + html: boolean = false): INotification { const notificationOptions = { ...this.getDefaultOptions(), ...options }; const notification = new Notification(uniqueId(), NotificationType.Info, title, content, notificationOptions, html); this.add(notification); @@ -56,9 +56,9 @@ export class NotificationsService { } warning(title: any = observableOf(''), - content: any = observableOf(''), - options: NotificationOptions = this.getDefaultOptions(), - html: boolean = false): INotification { + content: any = observableOf(''), + options: NotificationOptions = this.getDefaultOptions(), + html: boolean = false): INotification { const notificationOptions = { ...this.getDefaultOptions(), ...options }; const notification = new Notification(uniqueId(), NotificationType.Warning, title, content, notificationOptions, html); this.add(notification); @@ -66,11 +66,11 @@ export class NotificationsService { } notificationWithAnchor(notificationType: NotificationType, - options: NotificationOptions, - href: string, - hrefTranslateLabel: string, - messageTranslateLabel: string, - interpolateParam: string) { + options: NotificationOptions, + href: string, + hrefTranslateLabel: string, + messageTranslateLabel: string, + interpolateParam: string) { this.translate.get(hrefTranslateLabel) .pipe(first()) .subscribe((hrefMsg) => { diff --git a/src/app/shared/object-collection/object-collection.component.ts b/src/app/shared/object-collection/object-collection.component.ts index d16b57af28..a1bca8f330 100644 --- a/src/app/shared/object-collection/object-collection.component.ts +++ b/src/app/shared/object-collection/object-collection.component.ts @@ -248,14 +248,14 @@ export class ObjectCollectionComponent implements OnInit { * Go to the previous page */ goPrev() { - this.prev.emit(true); + this.prev.emit(true); } - /** + /** * Go to the next page */ goNext() { - this.next.emit(true); + this.next.emit(true); } } diff --git a/src/app/shared/object-collection/shared/badges/access-status-badge/access-status.model.ts b/src/app/shared/object-collection/shared/badges/access-status-badge/access-status.model.ts index 69b5e920d0..2e079f2e46 100644 --- a/src/app/shared/object-collection/shared/badges/access-status-badge/access-status.model.ts +++ b/src/app/shared/object-collection/shared/badges/access-status-badge/access-status.model.ts @@ -15,19 +15,19 @@ export class AccessStatusObject implements CacheableObject { */ @excludeFromEquals @autoserialize - type: ResourceType; + type: ResourceType; /** * The access status value */ @autoserialize - status: string; + status: string; /** * The {@link HALLink}s for this AccessStatusObject */ @deserialize - _links: { + _links: { self: HALLink; }; } diff --git a/src/app/shared/object-collection/shared/badges/badges.component.spec.ts b/src/app/shared/object-collection/shared/badges/badges.component.spec.ts index 9e0c277a08..07f73699cb 100644 --- a/src/app/shared/object-collection/shared/badges/badges.component.spec.ts +++ b/src/app/shared/object-collection/shared/badges/badges.component.spec.ts @@ -15,7 +15,7 @@ describe('BadgesComponent', () => { providers: [{provide: ThemeService, useValue: getMockThemeService()}], schemas: [NO_ERRORS_SCHEMA] }) - .compileComponents(); + .compileComponents(); }); beforeEach(() => { diff --git a/src/app/shared/object-collection/shared/listable-object/listable-object-component-loader.component.ts b/src/app/shared/object-collection/shared/listable-object/listable-object-component-loader.component.ts index 7a3cc42bf5..dd07067d37 100644 --- a/src/app/shared/object-collection/shared/listable-object/listable-object-component-loader.component.ts +++ b/src/app/shared/object-collection/shared/listable-object/listable-object-component-loader.component.ts @@ -194,8 +194,8 @@ export class ListableObjectComponentLoaderComponent implements OnInit, OnChanges * @returns {GenericConstructor} */ getComponent(renderTypes: (string | GenericConstructor)[], - viewMode: ViewMode, - context: Context): GenericConstructor { + viewMode: ViewMode, + context: Context): GenericConstructor { return getListableObjectComponent(renderTypes, viewMode, context, this.themeService.getThemeName()); } diff --git a/src/app/shared/object-collection/shared/listable-object/listable-object.decorator.spec.ts b/src/app/shared/object-collection/shared/listable-object/listable-object.decorator.spec.ts index f7d00510f6..a14f5c826b 100644 --- a/src/app/shared/object-collection/shared/listable-object/listable-object.decorator.spec.ts +++ b/src/app/shared/object-collection/shared/listable-object/listable-object.decorator.spec.ts @@ -1,4 +1,4 @@ - /* eslint-disable max-classes-per-file */ +/* eslint-disable max-classes-per-file */ import { ViewMode } from '../../../../core/shared/view-mode.model'; import { DEFAULT_VIEW_MODE, getListableObjectComponent, listableObjectComponent } from './listable-object.decorator'; import { Context } from '../../../../core/shared/context.model'; diff --git a/src/app/shared/object-collection/shared/mydspace-item-collection/item-collection.component.ts b/src/app/shared/object-collection/shared/mydspace-item-collection/item-collection.component.ts index 87f79d3570..78c2801f98 100644 --- a/src/app/shared/object-collection/shared/mydspace-item-collection/item-collection.component.ts +++ b/src/app/shared/object-collection/shared/mydspace-item-collection/item-collection.component.ts @@ -46,7 +46,7 @@ export class ItemCollectionComponent implements OnInit { this.linkService.resolveLinks(this.object, followLink('workflowitem', { isOptional: true }, - followLink('collection',{}) + followLink('collection',{}) )); this.collection$ = (this.object.workflowitem as Observable>).pipe( getFirstCompletedRemoteData(), diff --git a/src/app/shared/object-collection/shared/selectable-list-item-control/selectable-list-item-control.component.spec.ts b/src/app/shared/object-collection/shared/selectable-list-item-control/selectable-list-item-control.component.spec.ts index c8756567b8..5702d9ea3e 100644 --- a/src/app/shared/object-collection/shared/selectable-list-item-control/selectable-list-item-control.component.spec.ts +++ b/src/app/shared/object-collection/shared/selectable-list-item-control/selectable-list-item-control.component.spec.ts @@ -33,11 +33,11 @@ describe('SelectableListItemControlComponent', () => { index = 0; selection = [otherObject]; selectionService = jasmine.createSpyObj('selectionService', { - selectSingle: jasmine.createSpy('selectSingle'), - deselectSingle: jasmine.createSpy('deselectSingle'), - isObjectSelected: observableOf(true), - getSelectableList: observableOf({ selection }) - } + selectSingle: jasmine.createSpy('selectSingle'), + deselectSingle: jasmine.createSpy('deselectSingle'), + isObjectSelected: observableOf(true), + getSelectableList: observableOf({ selection }) + } ); } diff --git a/src/app/shared/object-collection/shared/selectable-list-item-control/selectable-list-item-control.component.ts b/src/app/shared/object-collection/shared/selectable-list-item-control/selectable-list-item-control.component.ts index ebe49331d5..8760f6cafe 100644 --- a/src/app/shared/object-collection/shared/selectable-list-item-control/selectable-list-item-control.component.ts +++ b/src/app/shared/object-collection/shared/selectable-list-item-control/selectable-list-item-control.component.ts @@ -41,12 +41,12 @@ export class SelectableListItemControlComponent implements OnInit { this.selected$ = this.selectionService.isObjectSelected(this.selectionConfig.listId, this.object); this.selected$ .pipe(skip(1)).subscribe((selected: boolean) => { - if (selected) { - this.selectObject.emit(this.object); - } else { - this.deselectObject.emit(this.object); - } - }); + if (selected) { + this.selectObject.emit(this.object); + } else { + this.deselectObject.emit(this.object); + } + }); } selectCheckbox(value: boolean) { @@ -64,14 +64,14 @@ export class SelectableListItemControlComponent implements OnInit { take(1), map((selected) => selected ? selected.selection : []) ).subscribe((selection) => { - // First deselect any existing selections, this is a radio button - selection.forEach((selectedObject) => { - this.selectionService.deselectSingle(this.selectionConfig.listId, selectedObject); - this.deselectObject.emit(selectedObject); - }); - this.selectionService.selectSingle(this.selectionConfig.listId, this.object); - this.selectObject.emit(this.object); - } + // First deselect any existing selections, this is a radio button + selection.forEach((selectedObject) => { + this.selectionService.deselectSingle(this.selectionConfig.listId, selectedObject); + this.deselectObject.emit(selectedObject); + }); + this.selectionService.selectSingle(this.selectionConfig.listId, this.object); + this.selectObject.emit(this.object); + } ); } } diff --git a/src/app/shared/object-detail/object-detail.component.ts b/src/app/shared/object-detail/object-detail.component.ts index 1a32be74b8..0edda11514 100644 --- a/src/app/shared/object-detail/object-detail.component.ts +++ b/src/app/shared/object-detail/object-detail.component.ts @@ -190,14 +190,14 @@ export class ObjectDetailComponent { * Go to the previous page */ goPrev() { - this.prev.emit(true); + this.prev.emit(true); } - /** + /** * Go to the next page */ goNext() { - this.next.emit(true); + this.next.emit(true); } } diff --git a/src/app/shared/object-grid/object-grid.component.ts b/src/app/shared/object-grid/object-grid.component.ts index 91630ca007..059671a454 100644 --- a/src/app/shared/object-grid/object-grid.component.ts +++ b/src/app/shared/object-grid/object-grid.component.ts @@ -251,14 +251,14 @@ export class ObjectGridComponent implements OnInit { * Go to the previous page */ goPrev() { - this.prev.emit(true); + this.prev.emit(true); } - /** + /** * Go to the next page */ goNext() { - this.next.emit(true); + this.next.emit(true); } } diff --git a/src/app/shared/object-list/bitstream-list-item/bitstream-list-item.component.spec.ts b/src/app/shared/object-list/bitstream-list-item/bitstream-list-item.component.spec.ts index 906add6578..9c83218772 100644 --- a/src/app/shared/object-list/bitstream-list-item/bitstream-list-item.component.spec.ts +++ b/src/app/shared/object-list/bitstream-list-item/bitstream-list-item.component.spec.ts @@ -18,7 +18,7 @@ describe('BitstreamListItemComponent', () => { imports: [ CommonModule, SharedModule, TranslateModule, RouterTestingModule ], providers: [{ provide: DSONameService, useValue: new DSONameServiceMock() }] }) - .compileComponents(); + .compileComponents(); }); beforeEach(() => { diff --git a/src/app/shared/object-list/identifier-data/identifier-data.model.ts b/src/app/shared/object-list/identifier-data/identifier-data.model.ts index e707f396e4..db193c79d1 100644 --- a/src/app/shared/object-list/identifier-data/identifier-data.model.ts +++ b/src/app/shared/object-list/identifier-data/identifier-data.model.ts @@ -15,19 +15,19 @@ export class IdentifierData implements CacheableObject { */ @excludeFromEquals @autoserialize - type: ResourceType; + type: ResourceType; /** * The */ @autoserialize - identifiers: Identifier[]; + identifiers: Identifier[]; /** * The {@link HALLink}s for this IdentifierData */ @deserialize - _links: { + _links: { self: HALLink; }; } diff --git a/src/app/shared/object-list/identifier-data/identifier.model.ts b/src/app/shared/object-list/identifier-data/identifier.model.ts index f528824b36..fedf2990c1 100644 --- a/src/app/shared/object-list/identifier-data/identifier.model.ts +++ b/src/app/shared/object-list/identifier-data/identifier.model.ts @@ -10,21 +10,21 @@ export class Identifier { * The value of the identifier, eg. http://hdl.handle.net/123456789/123 or https://doi.org/test/doi/1234 */ @autoserialize - value: string; + value: string; /** * The type of identiifer, eg. "doi", or "handle", or "other" */ @autoserialize - identifierType: string; + identifierType: string; /** * The status of the identifier. Some schemes, like DOI, will have a different status based on whether it is * queued for remote registration, reservation, or update, or has been registered, simply minted locally, etc. */ @autoserialize - identifierStatus: string; + identifierStatus: string; /** * The type of resource, in this case Identifier */ @autoserialize - type: string; + type: string; } diff --git a/src/app/shared/object-list/object-list.component.ts b/src/app/shared/object-list/object-list.component.ts index 5161b75459..08e5203ec4 100644 --- a/src/app/shared/object-list/object-list.component.ts +++ b/src/app/shared/object-list/object-list.component.ts @@ -217,14 +217,14 @@ export class ObjectListComponent { * Go to the previous page */ goPrev() { - this.prev.emit(true); + this.prev.emit(true); } - /** + /** * Go to the next page */ goNext() { - this.next.emit(true); + this.next.emit(true); } } diff --git a/src/app/shared/object-select/item-select/item-select.component.ts b/src/app/shared/object-select/item-select/item-select.component.ts index dd0266ff83..32b7639972 100644 --- a/src/app/shared/object-select/item-select/item-select.component.ts +++ b/src/app/shared/object-select/item-select/item-select.component.ts @@ -24,7 +24,7 @@ export class ItemSelectComponent extends ObjectSelectComponent { * Whether or not to hide the collection column */ @Input() - hideCollection = false; + hideCollection = false; /** * The routes to the items their pages diff --git a/src/app/shared/object-select/object-select/object-select.component.ts b/src/app/shared/object-select/object-select/object-select.component.ts index 6fb795690d..e4f80f785b 100644 --- a/src/app/shared/object-select/object-select/object-select.component.ts +++ b/src/app/shared/object-select/object-select/object-select.component.ts @@ -23,65 +23,65 @@ export abstract class ObjectSelectComponent implements OnInit, OnDestro * A unique key used for the object select service */ @Input() - key: string; + key: string; /** * The list of DSpaceObjects to display */ @Input() - dsoRD$: Observable>>; + dsoRD$: Observable>>; /** * The pagination options used to display the DSpaceObjects */ @Input() - paginationOptions: PaginationComponentOptions; + paginationOptions: PaginationComponentOptions; /** * The sorting options used to display the DSpaceObjects */ @Input() - sortOptions: SortOptions; + sortOptions: SortOptions; /** * The message key used for the confirm button * @type {string} */ @Input() - confirmButton: string; + confirmButton: string; /** * Authorize check to enable the selection when present. */ @Input() - featureId: FeatureID; + featureId: FeatureID; /** * The message key used for the cancel button * @type {string} */ @Input() - cancelButton: string; + cancelButton: string; /** * An event fired when the cancel button is clicked */ @Output() - cancel = new EventEmitter(); + cancel = new EventEmitter(); /** * EventEmitter to return the selected UUIDs when the confirm button is pressed * @type {EventEmitter} */ @Output() - confirm: EventEmitter = new EventEmitter(); + confirm: EventEmitter = new EventEmitter(); /** * Whether or not to render the confirm button as danger (for example if confirm deletes objects) * Defaults to false */ @Input() - dangerConfirm = false; + dangerConfirm = false; /** * The list of selected UUIDs diff --git a/src/app/shared/page-size-selector/page-size-selector.component.spec.ts b/src/app/shared/page-size-selector/page-size-selector.component.spec.ts index 6b0e9d265b..85e269aec7 100644 --- a/src/app/shared/page-size-selector/page-size-selector.component.spec.ts +++ b/src/app/shared/page-size-selector/page-size-selector.component.spec.ts @@ -73,12 +73,12 @@ describe('PageSizeSelectorComponent', () => { it('it should show the size settings with the respective selectable options', (done) => { comp.paginationOptions$.pipe(first()).subscribe((options: PaginationComponentOptions) => { - const pageSizeSetting = fixture.debugElement.query(By.css('div.page-size-settings')); - expect(pageSizeSetting).not.toBeNull(); - const childElements = pageSizeSetting.queryAll(By.css('option')); - expect(childElements.length).toEqual(options.pageSizeOptions.length); - done(); - } + const pageSizeSetting = fixture.debugElement.query(By.css('div.page-size-settings')); + expect(pageSizeSetting).not.toBeNull(); + const childElements = pageSizeSetting.queryAll(By.css('option')); + expect(childElements.length).toEqual(options.pageSizeOptions.length); + done(); + } ); }); diff --git a/src/app/shared/pagination-drag-and-drop/abstract-paginated-drag-and-drop-list.component.ts b/src/app/shared/pagination-drag-and-drop/abstract-paginated-drag-and-drop-list.component.ts index 8dba47566f..d6c000a31f 100644 --- a/src/app/shared/pagination-drag-and-drop/abstract-paginated-drag-and-drop-list.component.ts +++ b/src/app/shared/pagination-drag-and-drop/abstract-paginated-drag-and-drop-list.component.ts @@ -117,7 +117,7 @@ export abstract class AbstractPaginatedDragAndDropListComponent currentSort.direction) - ); - this.sortField$ = this.paginationService.getCurrentSort(this.id, sortOptions).pipe( - map((currentSort) => currentSort.field) - ); + this.sortDirection$ = this.paginationService.getCurrentSort(this.id, sortOptions).pipe( + map((currentSort) => currentSort.direction) + ); + this.sortField$ = this.paginationService.getCurrentSort(this.id, sortOptions).pipe( + map((currentSort) => currentSort.field) + ); } /** @@ -389,7 +389,7 @@ export class PaginationComponent implements OnDestroy, OnInit { /** * Go to the previous page */ - goPrev() { + goPrev() { this.prev.emit(true); this.updatePagination(-1); } diff --git a/src/app/shared/resource-policies/entry/resource-policy-entry.component.ts b/src/app/shared/resource-policies/entry/resource-policy-entry.component.ts index 904a79cbe6..9ed9c7d8d5 100644 --- a/src/app/shared/resource-policies/entry/resource-policy-entry.component.ts +++ b/src/app/shared/resource-policies/entry/resource-policy-entry.component.ts @@ -34,7 +34,7 @@ export interface ResourcePolicyCheckboxEntry { }) export class ResourcePolicyEntryComponent implements OnInit { @Input() - entry: ResourcePolicyCheckboxEntry; + entry: ResourcePolicyCheckboxEntry; @Output() public toggleCheckbox: EventEmitter = new EventEmitter(); diff --git a/src/app/shared/rss-feed/rss.component.spec.ts b/src/app/shared/rss-feed/rss.component.spec.ts index 61b54a1125..0d0179d804 100644 --- a/src/app/shared/rss-feed/rss.component.spec.ts +++ b/src/app/shared/rss-feed/rss.component.spec.ts @@ -21,89 +21,89 @@ import { RouterMock } from '../mocks/router.mock'; describe('RssComponent', () => { - let comp: RSSComponent; - let fixture: ComponentFixture; - let uuid: string; - let query: string; - let groupDataService: GroupDataService; - let linkHeadService: LinkHeadService; - let configurationDataService: ConfigurationDataService; - let paginationService; + let comp: RSSComponent; + let fixture: ComponentFixture; + let uuid: string; + let query: string; + let groupDataService: GroupDataService; + let linkHeadService: LinkHeadService; + let configurationDataService: ConfigurationDataService; + let paginationService; - beforeEach(waitForAsync(() => { - const mockCollection: Collection = Object.assign(new Collection(), { - id: 'ce41d451-97ed-4a9c-94a1-7de34f16a9f4', - name: 'test-collection', - _links: { - mappedItems: { - href: 'https://rest.api/collections/ce41d451-97ed-4a9c-94a1-7de34f16a9f4/mappedItems' - }, - self: { - href: 'https://rest.api/collections/ce41d451-97ed-4a9c-94a1-7de34f16a9f4' - } - } - }); - configurationDataService = jasmine.createSpyObj('configurationDataService', { - findByPropertyName: createSuccessfulRemoteDataObject$(Object.assign(new ConfigurationProperty(), { - name: 'test', - values: [ - 'org.dspace.ctask.general.ProfileFormats = test' - ] - })) - }); - linkHeadService = jasmine.createSpyObj('linkHeadService', { - addTag: '' - }); - const mockCollectionRD: RemoteData = createSuccessfulRemoteDataObject(mockCollection); - const mockSearchOptions = observableOf(new PaginatedSearchOptions({ - pagination: Object.assign(new PaginationComponentOptions(), { - id: 'search-page-configuration', - pageSize: 10, - currentPage: 1 - }), - })); - groupDataService = jasmine.createSpyObj('groupsDataService', { - findListByHref: createSuccessfulRemoteDataObject$(createPaginatedList([])), - getGroupRegistryRouterLink: '', - getUUIDFromString: '', - }); - paginationService = new PaginationServiceStub(); - const searchConfigService = { - paginatedSearchOptions: mockSearchOptions - }; - TestBed.configureTestingModule({ - providers: [ - { provide: GroupDataService, useValue: groupDataService }, - { provide: LinkHeadService, useValue: linkHeadService }, - { provide: ConfigurationDataService, useValue: configurationDataService }, - { provide: SearchConfigurationService, useValue: new SearchConfigurationServiceStub() }, - { provide: PaginationService, useValue: paginationService }, - { provide: Router, useValue: new RouterMock() } - ], - declarations: [RSSComponent] - }).compileComponents(); - })); - - beforeEach(() => { - uuid = '2cfcf65e-0a51-4bcb-8592-b8db7b064790'; - query = 'test'; - fixture = TestBed.createComponent(RSSComponent); - comp = fixture.componentInstance; + beforeEach(waitForAsync(() => { + const mockCollection: Collection = Object.assign(new Collection(), { + id: 'ce41d451-97ed-4a9c-94a1-7de34f16a9f4', + name: 'test-collection', + _links: { + mappedItems: { + href: 'https://rest.api/collections/ce41d451-97ed-4a9c-94a1-7de34f16a9f4/mappedItems' + }, + self: { + href: 'https://rest.api/collections/ce41d451-97ed-4a9c-94a1-7de34f16a9f4' + } + } }); - - it('should formulate the correct url given params in url', () => { - const route = comp.formulateRoute(uuid, 'opensearch/search', query); - expect(route).toBe('/opensearch/search?format=atom&scope=2cfcf65e-0a51-4bcb-8592-b8db7b064790&query=test'); + configurationDataService = jasmine.createSpyObj('configurationDataService', { + findByPropertyName: createSuccessfulRemoteDataObject$(Object.assign(new ConfigurationProperty(), { + name: 'test', + values: [ + 'org.dspace.ctask.general.ProfileFormats = test' + ] + })) }); - - it('should skip uuid if its null', () => { - const route = comp.formulateRoute(null, 'opensearch/search', query); - expect(route).toBe('/opensearch/search?format=atom&query=test'); + linkHeadService = jasmine.createSpyObj('linkHeadService', { + addTag: '' }); - - it('should default to query * if none provided', () => { - const route = comp.formulateRoute(null, 'opensearch/search', null); - expect(route).toBe('/opensearch/search?format=atom&query=*'); + const mockCollectionRD: RemoteData = createSuccessfulRemoteDataObject(mockCollection); + const mockSearchOptions = observableOf(new PaginatedSearchOptions({ + pagination: Object.assign(new PaginationComponentOptions(), { + id: 'search-page-configuration', + pageSize: 10, + currentPage: 1 + }), + })); + groupDataService = jasmine.createSpyObj('groupsDataService', { + findListByHref: createSuccessfulRemoteDataObject$(createPaginatedList([])), + getGroupRegistryRouterLink: '', + getUUIDFromString: '', }); + paginationService = new PaginationServiceStub(); + const searchConfigService = { + paginatedSearchOptions: mockSearchOptions + }; + TestBed.configureTestingModule({ + providers: [ + { provide: GroupDataService, useValue: groupDataService }, + { provide: LinkHeadService, useValue: linkHeadService }, + { provide: ConfigurationDataService, useValue: configurationDataService }, + { provide: SearchConfigurationService, useValue: new SearchConfigurationServiceStub() }, + { provide: PaginationService, useValue: paginationService }, + { provide: Router, useValue: new RouterMock() } + ], + declarations: [RSSComponent] + }).compileComponents(); + })); + + beforeEach(() => { + uuid = '2cfcf65e-0a51-4bcb-8592-b8db7b064790'; + query = 'test'; + fixture = TestBed.createComponent(RSSComponent); + comp = fixture.componentInstance; + }); + + it('should formulate the correct url given params in url', () => { + const route = comp.formulateRoute(uuid, 'opensearch/search', query); + expect(route).toBe('/opensearch/search?format=atom&scope=2cfcf65e-0a51-4bcb-8592-b8db7b064790&query=test'); + }); + + it('should skip uuid if its null', () => { + const route = comp.formulateRoute(null, 'opensearch/search', query); + expect(route).toBe('/opensearch/search?format=atom&query=test'); + }); + + it('should default to query * if none provided', () => { + const route = comp.formulateRoute(null, 'opensearch/search', null); + expect(route).toBe('/opensearch/search?format=atom&query=*'); + }); }); diff --git a/src/app/shared/sass-helper/css-variable.service.ts b/src/app/shared/sass-helper/css-variable.service.ts index 0190a05036..6392a35816 100644 --- a/src/app/shared/sass-helper/css-variable.service.ts +++ b/src/app/shared/sass-helper/css-variable.service.ts @@ -102,11 +102,11 @@ export class CSSVariableService { [...sheet.cssRules].filter(this.isStyleRule).reduce((propValArr, rule: any) => { const props = [...rule.style] .map((propName) => { - return { - key: propName.trim(), - value: rule.style.getPropertyValue(propName).trim() - } as KeyValuePair; - } + return { + key: propName.trim(), + value: rule.style.getPropertyValue(propName).trim() + } as KeyValuePair; + } ) // Discard any props that don't start with "--". Custom props are required to. .filter(({ key }: KeyValuePair) => key.indexOf('--') === 0); diff --git a/src/app/shared/search-form/search-form.component.ts b/src/app/shared/search-form/search-form.component.ts index 151ded6f9e..f05b990486 100644 --- a/src/app/shared/search-form/search-form.component.ts +++ b/src/app/shared/search-form/search-form.component.ts @@ -37,7 +37,7 @@ export class SearchFormComponent implements OnChanges { * The currently selected scope object's UUID */ @Input() - scope = ''; + scope = ''; selectedScope: BehaviorSubject = new BehaviorSubject(undefined); diff --git a/src/app/shared/search/models/facet-config-response.model.ts b/src/app/shared/search/models/facet-config-response.model.ts index deb86def22..10e0aa035d 100644 --- a/src/app/shared/search/models/facet-config-response.model.ts +++ b/src/app/shared/search/models/facet-config-response.model.ts @@ -18,7 +18,7 @@ export class FacetConfigResponse implements CacheableObject { * hardcoded because rest doesn't a unique one. */ @excludeFromEquals - type = FACET_CONFIG_RESPONSE; + type = FACET_CONFIG_RESPONSE; /** * the filters in this response @@ -29,7 +29,7 @@ export class FacetConfigResponse implements CacheableObject { * The {@link HALLink}s for this SearchFilterConfig */ @deserialize - _links: { + _links: { self: HALLink; }; } diff --git a/src/app/shared/search/models/facet-value.model.ts b/src/app/shared/search/models/facet-value.model.ts index 6c1d353480..e332709c43 100644 --- a/src/app/shared/search/models/facet-value.model.ts +++ b/src/app/shared/search/models/facet-value.model.ts @@ -10,31 +10,31 @@ export class FacetValue implements HALResource { * The display label of the facet value */ @autoserialize - label: string; + label: string; /** * The value of the facet value */ @autoserializeAs(String, 'label') - value: string; + value: string; /** * The number of results this facet value would have if selected */ @autoserialize - count: number; + count: number; /** * The Authority Value for this facet */ @autoserialize - authorityKey?: string; + authorityKey?: string; /** * The {@link HALLink}s for this FacetValue */ @deserialize - _links: { + _links: { self: HALLink search: HALLink }; diff --git a/src/app/shared/search/models/facet-values.model.ts b/src/app/shared/search/models/facet-values.model.ts index 09bef25876..fe9c9b70c7 100644 --- a/src/app/shared/search/models/facet-values.model.ts +++ b/src/app/shared/search/models/facet-values.model.ts @@ -24,23 +24,23 @@ export class FacetValues extends SearchQueryResponse { * The name of the facet the values are for */ @autoserialize - name: string; + name: string; /** * The type of facet the values are for */ @autoserializeAs(String, 'facetType') - filterType: FilterType; + filterType: FilterType; /** * The max number of returned facetValues */ @autoserialize - facetLimit: number; + facetLimit: number; /** * The results for this query */ @autoserializeAs(FacetValue, 'values') - page: FacetValue[]; + page: FacetValue[]; } diff --git a/src/app/shared/search/models/search-filter-config.model.ts b/src/app/shared/search/models/search-filter-config.model.ts index 59512ee29d..aeb4eac594 100644 --- a/src/app/shared/search/models/search-filter-config.model.ts +++ b/src/app/shared/search/models/search-filter-config.model.ts @@ -10,63 +10,63 @@ import { CacheableObject } from '../../../core/cache/cacheable-object.model'; * The configuration for a search filter */ @typedObject - export class SearchFilterConfig implements CacheableObject { - static type = SEARCH_FILTER_CONFIG; +export class SearchFilterConfig implements CacheableObject { + static type = SEARCH_FILTER_CONFIG; /** * The object type, * hardcoded because rest doesn't set one. */ @excludeFromEquals - type = SEARCH_FILTER_CONFIG; + type = SEARCH_FILTER_CONFIG; /** * The name of this filter */ @autoserialize - name: string; + name: string; /** * The FilterType of this filter */ @autoserializeAs(String, 'facetType') - filterType: FilterType; + filterType: FilterType; /** * True if the filter has facets */ @autoserialize - hasFacets: boolean; + hasFacets: boolean; /** * @type {number} The page size used for this facet */ @autoserializeAs(String, 'facetLimit') - pageSize = 5; + pageSize = 5; /** * Defines if the item facet is collapsed by default or not on the search page */ @autoserialize - isOpenByDefault: boolean; + isOpenByDefault: boolean; /** * Minimum value possible for this facet in the repository */ @autoserialize - maxValue: string; + maxValue: string; /** * Maximum value possible for this facet in the repository */ @autoserialize - minValue: string; + minValue: string; /** * The {@link HALLink}s for this SearchFilterConfig */ @deserialize - _links: { + _links: { self: HALLink; }; @@ -77,4 +77,4 @@ import { CacheableObject } from '../../../core/cache/cacheable-object.model'; get paramName(): string { return 'f.' + this.name; } - } +} diff --git a/src/app/shared/search/models/search-objects.model.ts b/src/app/shared/search/models/search-objects.model.ts index 2afbab372b..f99dd5170e 100644 --- a/src/app/shared/search/models/search-objects.model.ts +++ b/src/app/shared/search/models/search-objects.model.ts @@ -27,5 +27,5 @@ export class SearchObjects extends SearchQueryResponse[]; + page: SearchResult[]; } diff --git a/src/app/shared/search/models/search-options.model.ts b/src/app/shared/search/models/search-options.model.ts index 470ef8a06f..4a2fed0a9c 100644 --- a/src/app/shared/search/models/search-options.model.ts +++ b/src/app/shared/search/models/search-options.model.ts @@ -22,12 +22,12 @@ export class SearchOptions { fixedFilter?: string } ) { - this.configuration = options.configuration; - this.scope = options.scope; - this.query = options.query; - this.dsoTypes = options.dsoTypes; - this.filters = options.filters; - this.fixedFilter = options.fixedFilter; + this.configuration = options.configuration; + this.scope = options.scope; + this.query = options.query; + this.dsoTypes = options.dsoTypes; + this.filters = options.filters; + this.fixedFilter = options.fixedFilter; } /** diff --git a/src/app/shared/search/models/search-query-response.model.ts b/src/app/shared/search/models/search-query-response.model.ts index a436a7c045..1a86056d64 100644 --- a/src/app/shared/search/models/search-query-response.model.ts +++ b/src/app/shared/search/models/search-query-response.model.ts @@ -10,44 +10,44 @@ export abstract class SearchQueryResponse extends PaginatedList { * The scope used in the search request represented by the UUID of a DSpaceObject */ @autoserialize - scope: string; + scope: string; /** * The search query used in the search request */ @autoserialize - query: string; + query: string; /** * The currently active filters used in the search request */ @autoserialize - appliedFilters: any[]; // TODO + appliedFilters: any[]; // TODO /** * The sort parameters used in the search request */ @autoserialize - sort: any; // TODO + sort: any; // TODO /** * The sort parameters used in the search request */ @autoserialize - configuration: string; + configuration: string; /** * Pagination configuration for this response */ @autoserialize - pageInfo: PageInfo; + pageInfo: PageInfo; /** * The results for this query */ @autoserialize - page: T[]; + page: T[]; @autoserialize - facets: any; // TODO + facets: any; // TODO } diff --git a/src/app/shared/search/models/search-result.model.ts b/src/app/shared/search/models/search-result.model.ts index 6079c4af63..c7255a2f16 100644 --- a/src/app/shared/search/models/search-result.model.ts +++ b/src/app/shared/search/models/search-result.model.ts @@ -26,13 +26,13 @@ export class SearchResult extends ListableObject impleme */ @excludeFromEquals @autoserialize - hitHighlights: MetadataMap; + hitHighlights: MetadataMap; /** * The {@link HALLink}s for this SearchResult */ @deserialize - _links: { + _links: { self: HALLink; indexableObject: HALLink; }; @@ -41,7 +41,7 @@ export class SearchResult extends ListableObject impleme * The DSpaceObject that was found */ @fieldsForEquals('uuid') - indexableObject: T; + indexableObject: T; /** * Method that returns as which type of object this object should be rendered diff --git a/src/app/shared/search/search-filters/search-filter/search-facet-filter/search-facet-filter.component.ts b/src/app/shared/search/search-filters/search-filter/search-facet-filter/search-facet-filter.component.ts index 2b2eb9b11a..e2d658c949 100644 --- a/src/app/shared/search/search-filters/search-filter/search-facet-filter/search-facet-filter.component.ts +++ b/src/app/shared/search/search-filters/search-filter/search-facet-filter/search-facet-filter.component.ts @@ -293,9 +293,9 @@ export class SearchFacetFilterComponent implements OnInit, OnDestroy { this.isLastPage$.next(hasNoValue(rd?.payload?.next)); }), map((rd: RemoteData) => ({ - values: observableOf(rd), - page: page - }) + values: observableOf(rd), + page: page + }) ) ); }) @@ -324,7 +324,7 @@ export class SearchFacetFilterComponent implements OnInit, OnDestroy { map((selectedValues) => { return selectedValues.map((value: string) => { const fValue = [].concat(...rd.payload.map((page) => page.page)) - .find((facetValue: FacetValue) => this.getFacetValue(facetValue) === value); + .find((facetValue: FacetValue) => this.getFacetValue(facetValue) === value); if (hasValue(fValue)) { return fValue; } diff --git a/src/app/shared/search/search-filters/search-filter/search-filter.component.ts b/src/app/shared/search/search-filters/search-filter/search-filter.component.ts index d1d3bd729d..7caa013d8a 100644 --- a/src/app/shared/search/search-filters/search-filter/search-filter.component.ts +++ b/src/app/shared/search/search-filters/search-filter/search-filter.component.ts @@ -171,12 +171,12 @@ export class SearchFilterComponent implements OnInit { } else { return this.searchConfigService.searchOptions.pipe( switchMap((options) => { - return this.searchService.getFacetValuesFor(this.filter, 1, options).pipe( - filter((RD) => !RD.isLoading), - map((valuesRD) => { - return valuesRD.payload?.totalElements > 0; - }),); - } + return this.searchService.getFacetValuesFor(this.filter, 1, options).pipe( + filter((RD) => !RD.isLoading), + map((valuesRD) => { + return valuesRD.payload?.totalElements > 0; + }),); + } )); } }), diff --git a/src/app/shared/search/search-result-element-decorator.ts b/src/app/shared/search/search-result-element-decorator.ts index 78305b55f1..5241318122 100644 --- a/src/app/shared/search/search-result-element-decorator.ts +++ b/src/app/shared/search/search-result-element-decorator.ts @@ -26,5 +26,5 @@ export function searchResultFor(domainConstructor: GenericConstructor) { - return searchResultMap.get(domainConstructor); + return searchResultMap.get(domainConstructor); } diff --git a/src/app/shared/search/search.component.ts b/src/app/shared/search/search.component.ts index 2ec702bafb..e6d532e2df 100644 --- a/src/app/shared/search/search.component.ts +++ b/src/app/shared/search/search.component.ts @@ -446,7 +446,7 @@ export class SearchComponent implements OnInit { this.useCachedVersionIfAvailable, true, ...followLinks - ).pipe(getFirstCompletedRemoteData()) + ).pipe(getFirstCompletedRemoteData()) .subscribe((results: RemoteData>) => { if (results.hasSucceeded) { if (this.trackStatistics) { diff --git a/src/app/shared/search/search.utils.spec.ts b/src/app/shared/search/search.utils.spec.ts index 70bf9a43a0..5341e5b6f6 100644 --- a/src/app/shared/search/search.utils.spec.ts +++ b/src/app/shared/search/search.utils.spec.ts @@ -26,7 +26,7 @@ describe('Search Utils', () => { facetValueWithSearchHrefAuthority = Object.assign(new FacetValue(), { value: 'Value with search href', authorityKey: 'uuid', - } + } ); facetValueWithoutSearchHref = Object.assign(new FacetValue(), { value: 'Value without search href' diff --git a/src/app/shared/sidebar/page-with-sidebar.component.ts b/src/app/shared/sidebar/page-with-sidebar.component.ts index 63b4a6195c..32d8c6ac1d 100644 --- a/src/app/shared/sidebar/page-with-sidebar.component.ts +++ b/src/app/shared/sidebar/page-with-sidebar.component.ts @@ -30,7 +30,7 @@ export class PageWithSidebarComponent implements OnInit { * The width of the sidebar (bootstrap columns) */ @Input() - sideBarWidth = 3; + sideBarWidth = 3; /** * Observable for whether or not the sidebar is currently collapsed diff --git a/src/app/shared/sidebar/sidebar-effects.service.ts b/src/app/shared/sidebar/sidebar-effects.service.ts index f6f99ca0fc..8cb6bd8a63 100644 --- a/src/app/shared/sidebar/sidebar-effects.service.ts +++ b/src/app/shared/sidebar/sidebar-effects.service.ts @@ -12,7 +12,7 @@ import { URLBaser } from '../../core/url-baser/url-baser'; @Injectable() export class SidebarEffects { private previousPath: string; - routeChange$ = createEffect(() => this.actions$ + routeChange$ = createEffect(() => this.actions$ .pipe( ofType(ROUTER_NAVIGATION), filter((action) => this.previousPath !== this.getBaseUrl(action)), diff --git a/src/app/shared/subscriptions/models/subscription.model.ts b/src/app/shared/subscriptions/models/subscription.model.ts index b460a0418f..d1978cfea5 100644 --- a/src/app/shared/subscriptions/models/subscription.model.ts +++ b/src/app/shared/subscriptions/models/subscription.model.ts @@ -37,7 +37,7 @@ export class Subscription extends DSpaceObject { * The {@link HALLink}s for this Subscription */ @deserialize - _links: { + _links: { self: HALLink; eperson: HALLink; resource: HALLink; @@ -48,14 +48,14 @@ export class Subscription extends DSpaceObject { * Will be undefined unless the logo {@link HALLink} has been resolved. */ @link(EPERSON) - eperson?: Observable>; + eperson?: Observable>; /** * The logo for this Community * Will be undefined unless the logo {@link HALLink} has been resolved. */ @link(DSPACE_OBJECT) - resource?: Observable>; + resource?: Observable>; /** * The embedded ePerson & dSpaceObject for this Subscription */ diff --git a/src/app/shared/subscriptions/subscription-view/subscription-view.component.spec.ts b/src/app/shared/subscriptions/subscription-view/subscription-view.component.spec.ts index aefdb5772b..7a55b061c2 100644 --- a/src/app/shared/subscriptions/subscription-view/subscription-view.component.spec.ts +++ b/src/app/shared/subscriptions/subscription-view/subscription-view.component.spec.ts @@ -75,7 +75,7 @@ describe('SubscriptionViewComponent', () => { ], schemas: [NO_ERRORS_SCHEMA] }) - .compileComponents(); + .compileComponents(); }); beforeEach(() => { diff --git a/src/app/shared/testing/browse-definition-data-service.stub.ts b/src/app/shared/testing/browse-definition-data-service.stub.ts index 8d46fcda00..1ff6e589ed 100644 --- a/src/app/shared/testing/browse-definition-data-service.stub.ts +++ b/src/app/shared/testing/browse-definition-data-service.stub.ts @@ -10,26 +10,26 @@ import { ValueListBrowseDefinition } from '../../core/shared/value-list-browse-d // This data is in post-serialized form (metadata -> metadataKeys) export const mockData: BrowseDefinition[] = [ - Object.assign(new FlatBrowseDefinition(), { - 'id' : 'dateissued', - 'browseType': 'flatBrowse', - 'dataType' : 'date', - 'sortOptions' : EMPTY, - 'order' : 'ASC', - 'type' : 'browse', - 'metadataKeys' : [ 'dc.date.issued' ], - '_links' : EMPTY - }), - Object.assign(new ValueListBrowseDefinition(), { - 'id' : 'author', - 'browseType' : 'valueList', - 'dataType' : 'text', - 'sortOptions' : EMPTY, - 'order' : 'ASC', - 'type' : 'browse', - 'metadataKeys' : [ 'dc.contributor.*', 'dc.creator' ], - '_links' : EMPTY - }) + Object.assign(new FlatBrowseDefinition(), { + 'id' : 'dateissued', + 'browseType': 'flatBrowse', + 'dataType' : 'date', + 'sortOptions' : EMPTY, + 'order' : 'ASC', + 'type' : 'browse', + 'metadataKeys' : [ 'dc.date.issued' ], + '_links' : EMPTY + }), + Object.assign(new ValueListBrowseDefinition(), { + 'id' : 'author', + 'browseType' : 'valueList', + 'dataType' : 'text', + 'sortOptions' : EMPTY, + 'order' : 'ASC', + 'type' : 'browse', + 'metadataKeys' : [ 'dc.contributor.*', 'dc.creator' ], + '_links' : EMPTY + }) ]; export const BrowseDefinitionDataServiceStub: any = { diff --git a/src/app/shared/testing/form-event.stub.ts b/src/app/shared/testing/form-event.stub.ts index 908d0df746..5ee52cd752 100644 --- a/src/app/shared/testing/form-event.stub.ts +++ b/src/app/shared/testing/form-event.stub.ts @@ -2,99 +2,99 @@ import { UntypedFormControl, UntypedFormGroup } from '@angular/forms'; import { DynamicCheckboxModel, DynamicSelectModel } from '@ng-dynamic-forms/core'; export const accessConditionChangeEvent = { - $event: { - bubbles: true, - cancelBubble: false, - cancelable: false, - composed: false, - currentTarget: null, - defaultPrevented: false, - eventPhase: 0, - isTrusted: true, - returnValue: true, - timeStamp: 143042.8999999999, - type: 'change', - }, - context: null, - control: new UntypedFormControl({ - errors: null, - pristine: false, - status: 'VALID', - statusChanges: { _isScalar: false, observers: [], closed: false, isStopped: false, hasError: false }, - touched: true, - value: { year: 2021, month: 12, day: 30 }, - valueChanges: { _isScalar: false, observers: [], closed: false, isStopped: false, hasError: false }, - _updateOn: 'change', - }), - group: new UntypedFormGroup({}), - model: new DynamicSelectModel({ - additional: null, - asyncValidators: null, - controlTooltip: null, - errorMessages: { required: 'submission.sections.upload.form.date-required-until' }, - hidden: false, - hint: null, - id: 'endDate', - label: 'submission.sections.upload.form.until-label', - labelTooltip: null, - name: 'endDate', - placeholder: 'Until', - prefix: null, - relations: [], - required: true, - suffix: null, - tabIndex: null, - updateOn: null, - validators: { required: null }, - }), - type: 'change' + $event: { + bubbles: true, + cancelBubble: false, + cancelable: false, + composed: false, + currentTarget: null, + defaultPrevented: false, + eventPhase: 0, + isTrusted: true, + returnValue: true, + timeStamp: 143042.8999999999, + type: 'change', + }, + context: null, + control: new UntypedFormControl({ + errors: null, + pristine: false, + status: 'VALID', + statusChanges: { _isScalar: false, observers: [], closed: false, isStopped: false, hasError: false }, + touched: true, + value: { year: 2021, month: 12, day: 30 }, + valueChanges: { _isScalar: false, observers: [], closed: false, isStopped: false, hasError: false }, + _updateOn: 'change', + }), + group: new UntypedFormGroup({}), + model: new DynamicSelectModel({ + additional: null, + asyncValidators: null, + controlTooltip: null, + errorMessages: { required: 'submission.sections.upload.form.date-required-until' }, + hidden: false, + hint: null, + id: 'endDate', + label: 'submission.sections.upload.form.until-label', + labelTooltip: null, + name: 'endDate', + placeholder: 'Until', + prefix: null, + relations: [], + required: true, + suffix: null, + tabIndex: null, + updateOn: null, + validators: { required: null }, + }), + type: 'change' }; export const checkboxChangeEvent = { - $event: { - bubbles: true, - cancelBubble: false, - cancelable: false, - composed: false, - currentTarget: null, - defaultPrevented: false, - eventPhase: 0, - isTrusted: true, - returnValue: true, - timeStamp: 143042.8999999999, - type: 'change', - }, - context: null, - control: new UntypedFormControl({ - errors: null, - pristine: false, - status: 'VALID', - statusChanges: { _isScalar: false, observers: [], closed: false, isStopped: false, hasError: false }, - touched: true, - value: { year: 2021, month: 12, day: 30 }, - valueChanges: { _isScalar: false, observers: [], closed: false, isStopped: false, hasError: false }, - _updateOn: 'change', - }), - group: new UntypedFormGroup({}), - model: new DynamicCheckboxModel({ - additional: null, - asyncValidators: null, - controlTooltip: null, - errorMessages: null, - hidden: false, - hint: null, - id: 'discoverable', - indeterminate: false, - label: 'Discoverable', - labelPosition: null, - labelTooltip: null, - name: 'discoverable', - relations: [], - required: false, - tabIndex: null, - updateOn: null, - validators: { required: null }, - }), - type: 'change' + $event: { + bubbles: true, + cancelBubble: false, + cancelable: false, + composed: false, + currentTarget: null, + defaultPrevented: false, + eventPhase: 0, + isTrusted: true, + returnValue: true, + timeStamp: 143042.8999999999, + type: 'change', + }, + context: null, + control: new UntypedFormControl({ + errors: null, + pristine: false, + status: 'VALID', + statusChanges: { _isScalar: false, observers: [], closed: false, isStopped: false, hasError: false }, + touched: true, + value: { year: 2021, month: 12, day: 30 }, + valueChanges: { _isScalar: false, observers: [], closed: false, isStopped: false, hasError: false }, + _updateOn: 'change', + }), + group: new UntypedFormGroup({}), + model: new DynamicCheckboxModel({ + additional: null, + asyncValidators: null, + controlTooltip: null, + errorMessages: null, + hidden: false, + hint: null, + id: 'discoverable', + indeterminate: false, + label: 'Discoverable', + labelPosition: null, + labelTooltip: null, + name: 'discoverable', + relations: [], + required: false, + tabIndex: null, + updateOn: null, + validators: { required: null }, + }), + type: 'change' }; diff --git a/src/app/shared/testing/group-mock.ts b/src/app/shared/testing/group-mock.ts index 0d6f924c01..b010bf349f 100644 --- a/src/app/shared/testing/group-mock.ts +++ b/src/app/shared/testing/group-mock.ts @@ -3,42 +3,42 @@ import { EPersonMock } from './eperson.mock'; import { createSuccessfulRemoteDataObject$ } from '../remote-data.utils'; export const GroupMock2: Group = Object.assign(new Group(), { - handle: null, - subgroups: [], - epersons: [], - permanent: true, - selfRegistered: false, - _links: { - self: { - href: 'https://rest.api/server/api/eperson/groups/testgroupid2', - }, - subgroups: { href: 'https://rest.api/server/api/eperson/groups/testgroupid2/subgroups' }, - object: { href: 'https://rest.api/server/api/eperson/groups/testgroupid2/object' }, - epersons: { href: 'https://rest.api/server/api/eperson/groups/testgroupid2/epersons' } + handle: null, + subgroups: [], + epersons: [], + permanent: true, + selfRegistered: false, + _links: { + self: { + href: 'https://rest.api/server/api/eperson/groups/testgroupid2', }, - _name: 'testgroupname2', - id: 'testgroupid2', - uuid: 'testgroupid2', - type: 'group', - object: createSuccessfulRemoteDataObject$({ name: 'testgroupid2objectName'}) + subgroups: { href: 'https://rest.api/server/api/eperson/groups/testgroupid2/subgroups' }, + object: { href: 'https://rest.api/server/api/eperson/groups/testgroupid2/object' }, + epersons: { href: 'https://rest.api/server/api/eperson/groups/testgroupid2/epersons' } + }, + _name: 'testgroupname2', + id: 'testgroupid2', + uuid: 'testgroupid2', + type: 'group', + object: createSuccessfulRemoteDataObject$({ name: 'testgroupid2objectName'}) }); export const GroupMock: Group = Object.assign(new Group(), { - handle: null, - subgroups: [GroupMock2], - epersons: [EPersonMock], - selfRegistered: false, - permanent: false, - _links: { - self: { - href: 'https://rest.api/server/api/eperson/groups/testgroupid', - }, - subgroups: { href: 'https://rest.api/server/api/eperson/groups/testgroupid/subgroups' }, - object: { href: 'https://rest.api/server/api/eperson/groups/testgroupid2/object' }, - epersons: { href: 'https://rest.api/server/api/eperson/groups/testgroupid/epersons' } + handle: null, + subgroups: [GroupMock2], + epersons: [EPersonMock], + selfRegistered: false, + permanent: false, + _links: { + self: { + href: 'https://rest.api/server/api/eperson/groups/testgroupid', }, - _name: 'testgroupname', - id: 'testgroupid', - uuid: 'testgroupid', - type: 'group', + subgroups: { href: 'https://rest.api/server/api/eperson/groups/testgroupid/subgroups' }, + object: { href: 'https://rest.api/server/api/eperson/groups/testgroupid2/object' }, + epersons: { href: 'https://rest.api/server/api/eperson/groups/testgroupid/epersons' } + }, + _name: 'testgroupname', + id: 'testgroupid', + uuid: 'testgroupid', + type: 'group', }); diff --git a/src/app/shared/testing/related-relationships.mock.ts b/src/app/shared/testing/related-relationships.mock.ts index 7ea90d5935..767d9352f6 100644 --- a/src/app/shared/testing/related-relationships.mock.ts +++ b/src/app/shared/testing/related-relationships.mock.ts @@ -1,72 +1,72 @@ export const relatedRelationships = { - 'type': { - 'value': 'paginated-list' - }, - 'pageInfo': { - 'elementsPerPage': 5, - 'totalElements': 2, - 'totalPages': 1, - 'currentPage': 1 - }, - '_links': { - 'self': { - 'href': 'http://localhost:8080/server/api/core/relationships/search/byItemsAndType?typeId=1&focusItem=b1b2c768-bda1-448a-a073-fc541e8b24d9&relationshipLabel=isPublicationOfAuthor&size=5&relatedItem=72635f7f-37b5-4875-b4f2-5ff45d97a09b&relatedItem=674f695e-8001-4150-8f9c-095c536a6bcb&relatedItem=a64719f8-ba7b-41d1-8eb6-f8feb0c000b7&relatedItem=75c0f7f5-5a69-40e8-aa1f-8f35b1ce5a63&relatedItem=10bc6f8b-0796-486f-94d8-4d2e1814586f' - }, - 'page': [ - { - 'href': 'http://localhost:8080/server/api/core/relationships/1408' - }, - { - 'href': 'http://localhost:8080/server/api/core/relationships/1409' - } - ] + 'type': { + 'value': 'paginated-list' + }, + 'pageInfo': { + 'elementsPerPage': 5, + 'totalElements': 2, + 'totalPages': 1, + 'currentPage': 1 + }, + '_links': { + 'self': { + 'href': 'http://localhost:8080/server/api/core/relationships/search/byItemsAndType?typeId=1&focusItem=b1b2c768-bda1-448a-a073-fc541e8b24d9&relationshipLabel=isPublicationOfAuthor&size=5&relatedItem=72635f7f-37b5-4875-b4f2-5ff45d97a09b&relatedItem=674f695e-8001-4150-8f9c-095c536a6bcb&relatedItem=a64719f8-ba7b-41d1-8eb6-f8feb0c000b7&relatedItem=75c0f7f5-5a69-40e8-aa1f-8f35b1ce5a63&relatedItem=10bc6f8b-0796-486f-94d8-4d2e1814586f' }, 'page': [ - { - 'type': 'relationship', - 'uuid': 'relationship-1408', - 'id': 1408, - 'leftPlace': 0, - 'rightPlace': 0, - 'leftwardValue': null, - 'rightwardValue': null, - '_links': { - 'relationshipType': { - 'href': 'http://localhost:8080/server/api/core/relationshiptypes/1' - }, - 'self': { - 'href': 'http://localhost:8080/server/api/core/relationships/1408' - }, - 'leftItem': { - 'href': 'http://localhost:8080/server/api/core/items/75c0f7f5-5a69-40e8-aa1f-8f35b1ce5a63' - }, - 'rightItem': { - 'href': 'http://localhost:8080/server/api/core/items/b1b2c768-bda1-448a-a073-fc541e8b24d9' - } - } - }, - { - 'type': 'relationship', - 'uuid': 'relationship-1409', - 'id': 1409, - 'leftPlace': 0, - 'rightPlace': 1, - 'leftwardValue': null, - 'rightwardValue': null, - '_links': { - 'relationshipType': { - 'href': 'http://localhost:8080/server/api/core/relationshiptypes/1' - }, - 'self': { - 'href': 'http://localhost:8080/server/api/core/relationships/1409' - }, - 'leftItem': { - 'href': 'http://localhost:8080/server/api/core/items/10bc6f8b-0796-486f-94d8-4d2e1814586f' - }, - 'rightItem': { - 'href': 'http://localhost:8080/server/api/core/items/b1b2c768-bda1-448a-a073-fc541e8b24d9' - } - } - } + { + 'href': 'http://localhost:8080/server/api/core/relationships/1408' + }, + { + 'href': 'http://localhost:8080/server/api/core/relationships/1409' + } ] + }, + 'page': [ + { + 'type': 'relationship', + 'uuid': 'relationship-1408', + 'id': 1408, + 'leftPlace': 0, + 'rightPlace': 0, + 'leftwardValue': null, + 'rightwardValue': null, + '_links': { + 'relationshipType': { + 'href': 'http://localhost:8080/server/api/core/relationshiptypes/1' + }, + 'self': { + 'href': 'http://localhost:8080/server/api/core/relationships/1408' + }, + 'leftItem': { + 'href': 'http://localhost:8080/server/api/core/items/75c0f7f5-5a69-40e8-aa1f-8f35b1ce5a63' + }, + 'rightItem': { + 'href': 'http://localhost:8080/server/api/core/items/b1b2c768-bda1-448a-a073-fc541e8b24d9' + } + } + }, + { + 'type': 'relationship', + 'uuid': 'relationship-1409', + 'id': 1409, + 'leftPlace': 0, + 'rightPlace': 1, + 'leftwardValue': null, + 'rightwardValue': null, + '_links': { + 'relationshipType': { + 'href': 'http://localhost:8080/server/api/core/relationshiptypes/1' + }, + 'self': { + 'href': 'http://localhost:8080/server/api/core/relationships/1409' + }, + 'leftItem': { + 'href': 'http://localhost:8080/server/api/core/items/10bc6f8b-0796-486f-94d8-4d2e1814586f' + }, + 'rightItem': { + 'href': 'http://localhost:8080/server/api/core/items/b1b2c768-bda1-448a-a073-fc541e8b24d9' + } + } + } + ] }; diff --git a/src/app/shared/testing/relationship-types.mock.ts b/src/app/shared/testing/relationship-types.mock.ts index 2c1f210820..2ea53b7a9d 100644 --- a/src/app/shared/testing/relationship-types.mock.ts +++ b/src/app/shared/testing/relationship-types.mock.ts @@ -1,71 +1,71 @@ export const relationshipTypes = [ - { - 'id': 1, - 'leftwardType': 'isAuthorOfPublication', - 'rightwardType': 'isPublicationOfAuthor', - 'copyToLeft': false, - 'copyToRight': false, - 'leftMinCardinality': 0, - 'leftMaxCardinality': null, - 'rightMinCardinality': 0, - 'rightMaxCardinality': null, - 'type': 'relationshiptype', - '_links': { - 'leftType': { - 'href': 'http://localhost:8080/server/api/core/entitytypes/1' - }, - 'rightType': { - 'href': 'http://localhost:8080/server/api/core/entitytypes/2' - }, - 'self': { - 'href': 'http://localhost:8080/server/api/core/relationshiptypes/1' - } - } - }, - { - 'id': 4, - 'leftwardType': 'isProjectOfPerson', - 'rightwardType': 'isPersonOfProject', - 'copyToLeft': false, - 'copyToRight': false, - 'leftMinCardinality': 0, - 'leftMaxCardinality': null, - 'rightMinCardinality': 0, - 'rightMaxCardinality': null, - 'type': 'relationshiptype', - '_links': { - 'leftType': { - 'href': 'http://localhost:8080/server/api/core/entitytypes/2' - }, - 'rightType': { - 'href': 'http://localhost:8080/server/api/core/entitytypes/3' - }, - 'self': { - 'href': 'http://localhost:8080/server/api/core/relationshiptypes/4' - } - } - }, - { - 'id': 5, - 'leftwardType': 'isOrgUnitOfPerson', - 'rightwardType': 'isPersonOfOrgUnit', - 'copyToLeft': false, - 'copyToRight': false, - 'leftMinCardinality': 0, - 'leftMaxCardinality': null, - 'rightMinCardinality': 0, - 'rightMaxCardinality': null, - 'type': 'relationshiptype', - '_links': { - 'leftType': { - 'href': 'http://localhost:8080/server/api/core/entitytypes/2' - }, - 'rightType': { - 'href': 'http://localhost:8080/server/api/core/entitytypes/4' - }, - 'self': { - 'href': 'http://localhost:8080/server/api/core/relationshiptypes/5' - } - } + { + 'id': 1, + 'leftwardType': 'isAuthorOfPublication', + 'rightwardType': 'isPublicationOfAuthor', + 'copyToLeft': false, + 'copyToRight': false, + 'leftMinCardinality': 0, + 'leftMaxCardinality': null, + 'rightMinCardinality': 0, + 'rightMaxCardinality': null, + 'type': 'relationshiptype', + '_links': { + 'leftType': { + 'href': 'http://localhost:8080/server/api/core/entitytypes/1' + }, + 'rightType': { + 'href': 'http://localhost:8080/server/api/core/entitytypes/2' + }, + 'self': { + 'href': 'http://localhost:8080/server/api/core/relationshiptypes/1' + } } + }, + { + 'id': 4, + 'leftwardType': 'isProjectOfPerson', + 'rightwardType': 'isPersonOfProject', + 'copyToLeft': false, + 'copyToRight': false, + 'leftMinCardinality': 0, + 'leftMaxCardinality': null, + 'rightMinCardinality': 0, + 'rightMaxCardinality': null, + 'type': 'relationshiptype', + '_links': { + 'leftType': { + 'href': 'http://localhost:8080/server/api/core/entitytypes/2' + }, + 'rightType': { + 'href': 'http://localhost:8080/server/api/core/entitytypes/3' + }, + 'self': { + 'href': 'http://localhost:8080/server/api/core/relationshiptypes/4' + } + } + }, + { + 'id': 5, + 'leftwardType': 'isOrgUnitOfPerson', + 'rightwardType': 'isPersonOfOrgUnit', + 'copyToLeft': false, + 'copyToRight': false, + 'leftMinCardinality': 0, + 'leftMaxCardinality': null, + 'rightMinCardinality': 0, + 'rightMaxCardinality': null, + 'type': 'relationshiptype', + '_links': { + 'leftType': { + 'href': 'http://localhost:8080/server/api/core/entitytypes/2' + }, + 'rightType': { + 'href': 'http://localhost:8080/server/api/core/entitytypes/4' + }, + 'self': { + 'href': 'http://localhost:8080/server/api/core/relationshiptypes/5' + } + } + } ]; diff --git a/src/app/shared/testing/search-configuration-service.stub.ts b/src/app/shared/testing/search-configuration-service.stub.ts index 78b358f0d4..1cb1d089a8 100644 --- a/src/app/shared/testing/search-configuration-service.stub.ts +++ b/src/app/shared/testing/search-configuration-service.stub.ts @@ -42,6 +42,6 @@ export class SearchConfigurationServiceStub { } initializeSortOptionsFromConfiguration() { - /* empty */ + /* empty */ } } diff --git a/src/app/shared/testing/special-group.mock.ts b/src/app/shared/testing/special-group.mock.ts index f1102e0584..a7028c9ed8 100644 --- a/src/app/shared/testing/special-group.mock.ts +++ b/src/app/shared/testing/special-group.mock.ts @@ -8,44 +8,44 @@ import { createSuccessfulRemoteDataObject, createSuccessfulRemoteDataObject$ } f import { RemoteData } from '../../core/data/remote-data'; export const SpecialGroupMock2: Group = Object.assign(new Group(), { - handle: null, - subgroups: [], - epersons: [], - permanent: true, - selfRegistered: false, - _links: { - self: { - href: 'https://rest.api/server/api/eperson/specialGroups/testgroupid2', - }, - subgroups: { href: 'https://rest.api/server/api/eperson/specialGroups/testgroupid2/subgroups' }, - object: { href: 'https://rest.api/server/api/eperson/specialGroups/testgroupid2/object' }, - epersons: { href: 'https://rest.api/server/api/eperson/specialGroups/testgroupid2/epersons' } + handle: null, + subgroups: [], + epersons: [], + permanent: true, + selfRegistered: false, + _links: { + self: { + href: 'https://rest.api/server/api/eperson/specialGroups/testgroupid2', }, - _name: 'testgroupname2', - id: 'testgroupid2', - uuid: 'testgroupid2', - type: 'specialGroups', - // object: createSuccessfulRemoteDataObject$({ name: 'testspecialGroupsid2objectName'}) + subgroups: { href: 'https://rest.api/server/api/eperson/specialGroups/testgroupid2/subgroups' }, + object: { href: 'https://rest.api/server/api/eperson/specialGroups/testgroupid2/object' }, + epersons: { href: 'https://rest.api/server/api/eperson/specialGroups/testgroupid2/epersons' } + }, + _name: 'testgroupname2', + id: 'testgroupid2', + uuid: 'testgroupid2', + type: 'specialGroups', + // object: createSuccessfulRemoteDataObject$({ name: 'testspecialGroupsid2objectName'}) }); export const SpecialGroupMock: Group = Object.assign(new Group(), { - handle: null, - subgroups: [SpecialGroupMock2], - epersons: [EPersonMock], - selfRegistered: false, - permanent: false, - _links: { - self: { - href: 'https://rest.api/server/api/eperson/specialGroups/testgroupid', - }, - subgroups: { href: 'https://rest.api/server/api/eperson/specialGroups/testgroupid/subgroups' }, - object: { href: 'https://rest.api/server/api/eperson/specialGroups/testgroupid2/object' }, - epersons: { href: 'https://rest.api/server/api/eperson/specialGroups/testgroupid/epersons' } + handle: null, + subgroups: [SpecialGroupMock2], + epersons: [EPersonMock], + selfRegistered: false, + permanent: false, + _links: { + self: { + href: 'https://rest.api/server/api/eperson/specialGroups/testgroupid', }, - _name: 'testgroupname', - id: 'testgroupid', - uuid: 'testgroupid', - type: 'specialGroups', + subgroups: { href: 'https://rest.api/server/api/eperson/specialGroups/testgroupid/subgroups' }, + object: { href: 'https://rest.api/server/api/eperson/specialGroups/testgroupid2/object' }, + epersons: { href: 'https://rest.api/server/api/eperson/specialGroups/testgroupid/epersons' } + }, + _name: 'testgroupname', + id: 'testgroupid', + uuid: 'testgroupid', + type: 'specialGroups', }); export const SpecialGroupDataMock: RemoteData> = createSuccessfulRemoteDataObject(buildPaginatedList(new PageInfo(), [SpecialGroupMock2,SpecialGroupMock])); diff --git a/src/app/shared/testing/test-module.ts b/src/app/shared/testing/test-module.ts index 85fa295dc2..46f829476f 100644 --- a/src/app/shared/testing/test-module.ts +++ b/src/app/shared/testing/test-module.ts @@ -25,10 +25,10 @@ import { BrowserOnlyMockPipe } from './browser-only-mock.pipe'; NgComponentOutletDirectiveStub, BrowserOnlyMockPipe, ], - exports: [ - QueryParamsDirectiveStub, - RouterLinkDirectiveStub - ], + exports: [ + QueryParamsDirectiveStub, + RouterLinkDirectiveStub + ], schemas: [ CUSTOM_ELEMENTS_SCHEMA ] diff --git a/src/app/shared/theme-support/theme.service.ts b/src/app/shared/theme-support/theme.service.ts index 6d2939a5f8..c18ccb7285 100644 --- a/src/app/shared/theme-support/theme.service.ts +++ b/src/app/shared/theme-support/theme.service.ts @@ -219,7 +219,7 @@ export class ThemeService { // create new head tags (not yet added to DOM) const headTagFragment = this.document.createDocumentFragment(); this.createHeadTags(themeName) - .forEach(newHeadTag => headTagFragment.appendChild(newHeadTag)); + .forEach(newHeadTag => headTagFragment.appendChild(newHeadTag)); // add new head tags to DOM head.appendChild(headTagFragment); @@ -278,7 +278,7 @@ export class ThemeService { if (hasValue(headTagConfig.attributes)) { Object.entries(headTagConfig.attributes) - .forEach(([key, value]) => tag.setAttribute(key, value)); + .forEach(([key, value]) => tag.setAttribute(key, value)); } // 'class' attribute should always be 'theme-head-tag' for removal diff --git a/src/app/shared/theme-support/themed.component.ts b/src/app/shared/theme-support/themed.component.ts index 6b0727ccdd..9528c0971b 100644 --- a/src/app/shared/theme-support/themed.component.ts +++ b/src/app/shared/theme-support/themed.component.ts @@ -109,7 +109,7 @@ export abstract class ThemedComponent implements OnInit, OnDestroy, OnChanges } else { // otherwise import and return the default component return fromPromise(this.importUnthemedComponent()).pipe( - tap(() => this.usedTheme = BASE_THEME_NAME), + tap(() => this.usedTheme = BASE_THEME_NAME), map((unthemedFile: any) => { return unthemedFile[this.getComponentName()]; }) diff --git a/src/app/shared/utils/debounce.directive.ts b/src/app/shared/utils/debounce.directive.ts index 4515dff224..6245dbbacf 100644 --- a/src/app/shared/utils/debounce.directive.ts +++ b/src/app/shared/utils/debounce.directive.ts @@ -44,10 +44,10 @@ export class DebounceDirective implements OnInit, OnDestroy { distinctUntilChanged(), takeUntil(this.subject), // todo: check if this is ok ).subscribe((modelValue) => { - if (this.model.dirty) { - this.onDebounce.emit(modelValue); - } - }); + if (this.model.dirty) { + this.onDebounce.emit(modelValue); + } + }); } /** diff --git a/src/app/shared/utils/emphasize.pipe.ts b/src/app/shared/utils/emphasize.pipe.ts index 613074a308..9391e34887 100644 --- a/src/app/shared/utils/emphasize.pipe.ts +++ b/src/app/shared/utils/emphasize.pipe.ts @@ -50,7 +50,7 @@ export class EmphasizePipe implements PipeTransform { * @param str Escape special characters in the string we're looking for * @returns {any} The escaped version of the input string */ - escapeRegExp(str) { + escapeRegExp(str) { return str.replace(this.regex, '\\$&'); } } diff --git a/src/app/shared/utils/file-value-accessor.directive.ts b/src/app/shared/utils/file-value-accessor.directive.ts index 82ce2e6ab0..0491f687b3 100644 --- a/src/app/shared/utils/file-value-accessor.directive.ts +++ b/src/app/shared/utils/file-value-accessor.directive.ts @@ -2,26 +2,26 @@ import {Directive} from '@angular/core'; import {NG_VALUE_ACCESSOR, ControlValueAccessor} from '@angular/forms'; @Directive({ - // eslint-disable-next-line @angular-eslint/directive-selector - selector: 'input[type=file]', - // eslint-disable-next-line @angular-eslint/no-host-metadata-property - host : { - '(change)' : 'onChange($event.target.files)', - '(blur)': 'onTouched()' - }, - providers: [ - { provide: NG_VALUE_ACCESSOR, useExisting: FileValueAccessorDirective, multi: true } - ] + // eslint-disable-next-line @angular-eslint/directive-selector + selector: 'input[type=file]', + // eslint-disable-next-line @angular-eslint/no-host-metadata-property + host : { + '(change)' : 'onChange($event.target.files)', + '(blur)': 'onTouched()' + }, + providers: [ + { provide: NG_VALUE_ACCESSOR, useExisting: FileValueAccessorDirective, multi: true } + ] }) /** * Value accessor directive for inputs of type 'file' */ export class FileValueAccessorDirective implements ControlValueAccessor { - value: any; - onChange = (_) => { /* empty */ }; - onTouched = () => { /* empty */}; + value: any; + onChange = (_) => { /* empty */ }; + onTouched = () => { /* empty */}; - writeValue(value) { /* empty */} - registerOnChange(fn: any) { this.onChange = fn; } - registerOnTouched(fn: any) { this.onTouched = fn; } + writeValue(value) { /* empty */} + registerOnChange(fn: any) { this.onChange = fn; } + registerOnTouched(fn: any) { this.onTouched = fn; } } diff --git a/src/app/shared/utils/in-list-validator.directive.ts b/src/app/shared/utils/in-list-validator.directive.ts index fef0c2f962..655d7b0009 100644 --- a/src/app/shared/utils/in-list-validator.directive.ts +++ b/src/app/shared/utils/in-list-validator.directive.ts @@ -17,7 +17,7 @@ export class InListValidator implements Validator { * The list to look in */ @Input() - dsInListValidator: string[]; + dsInListValidator: string[]; /** * The function that checks if the form control's value is currently valid diff --git a/src/app/shared/utils/require-file.validator.ts b/src/app/shared/utils/require-file.validator.ts index ef41ad4309..372781c4fa 100644 --- a/src/app/shared/utils/require-file.validator.ts +++ b/src/app/shared/utils/require-file.validator.ts @@ -3,20 +3,20 @@ import {NG_VALIDATORS, Validator, UntypedFormControl} from '@angular/forms'; @Directive({ // eslint-disable-next-line @angular-eslint/directive-selector - selector: '[requireFile]', - providers: [ - { provide: NG_VALIDATORS, useExisting: FileValidator, multi: true }, - ] + selector: '[requireFile]', + providers: [ + { provide: NG_VALIDATORS, useExisting: FileValidator, multi: true }, + ] }) /** * Validator directive to validate if a file is selected */ export class FileValidator implements Validator { - static validate(c: UntypedFormControl): {[key: string]: any} { - return c.value == null || c.value.length === 0 ? { required : true } : null; - } + static validate(c: UntypedFormControl): {[key: string]: any} { + return c.value == null || c.value.length === 0 ? { required : true } : null; + } - validate(c: UntypedFormControl): {[key: string]: any} { - return FileValidator.validate(c); - } + validate(c: UntypedFormControl): {[key: string]: any} { + return FileValidator.validate(c); + } } diff --git a/src/app/statistics-page/statistics-table/statistics-table.component.spec.ts b/src/app/statistics-page/statistics-table/statistics-table.component.spec.ts index c7900cd278..9cabf67373 100644 --- a/src/app/statistics-page/statistics-table/statistics-table.component.spec.ts +++ b/src/app/statistics-page/statistics-table/statistics-table.component.spec.ts @@ -27,7 +27,7 @@ describe('StatisticsTableComponent', () => { { provide: DSONameService, useValue: {} }, ], }) - .compileComponents(); + .compileComponents(); })); beforeEach(() => { diff --git a/src/app/statistics-page/statistics-table/statistics-table.component.ts b/src/app/statistics-page/statistics-table/statistics-table.component.ts index 45924caa8d..b4a01f0a2d 100644 --- a/src/app/statistics-page/statistics-table/statistics-table.component.ts +++ b/src/app/statistics-page/statistics-table/statistics-table.component.ts @@ -22,7 +22,7 @@ export class StatisticsTableComponent implements OnInit { * The usage report to display a statistics table for */ @Input() - report: UsageReport; + report: UsageReport; /** * Boolean indicating whether the usage report has data diff --git a/src/app/statistics/statistics-endpoint.model.ts b/src/app/statistics/statistics-endpoint.model.ts index 0a3671432e..89706f2c79 100644 --- a/src/app/statistics/statistics-endpoint.model.ts +++ b/src/app/statistics/statistics-endpoint.model.ts @@ -18,13 +18,13 @@ export class StatisticsEndpoint implements CacheableObject { */ @excludeFromEquals @autoserialize - type: ResourceType; + type: ResourceType; /** * The {@link HALLink}s for the statistics endpoint */ @deserialize - _links: { + _links: { self: HALLink; searchevents: HALLink; viewevents: HALLink; diff --git a/src/app/store.effects.ts b/src/app/store.effects.ts index c7add76add..4229cbd228 100644 --- a/src/app/store.effects.ts +++ b/src/app/store.effects.ts @@ -11,7 +11,7 @@ import { HostWindowResizeAction } from './shared/host-window.actions'; @Injectable() export class StoreEffects { - replay = createEffect(() => this.actions.pipe( + replay = createEffect(() => this.actions.pipe( ofType(StoreActionTypes.REPLAY), map((replayAction: Action) => { // TODO: should be able to replay all actions before the browser attempts to @@ -21,7 +21,7 @@ export class StoreEffects { return observableOf({}); })), { dispatch: false }); - resize = createEffect(() => this.actions.pipe( + resize = createEffect(() => this.actions.pipe( ofType(StoreActionTypes.REPLAY, StoreActionTypes.REHYDRATE), map(() => new HostWindowResizeAction(window.innerWidth, window.innerHeight)) )); diff --git a/src/app/submission/form/collection/submission-form-collection.component.ts b/src/app/submission/form/collection/submission-form-collection.component.ts index 964f86577a..a35f9b5158 100644 --- a/src/app/submission/form/collection/submission-form-collection.component.ts +++ b/src/app/submission/form/collection/submission-form-collection.component.ts @@ -171,20 +171,20 @@ export class SubmissionFormCollectionComponent implements OnChanges, OnInit { this.submissionId, 'sections', 'collection').pipe( - mergeMap((submissionObject: SubmissionObject[]) => { - // retrieve the full submission object with embeds - return this.submissionService.retrieveSubmission(submissionObject[0].id).pipe( - getFirstSucceededRemoteDataPayload() - ); - }) - ).subscribe((submissionObject: SubmissionObject) => { - this.selectedCollectionId = event.collection.id; - this.selectedCollectionName$ = observableOf(event.collection.name); - this.collectionChange.emit(submissionObject); - this.submissionService.changeSubmissionCollection(this.submissionId, event.collection.id); - this.processingChange$.next(false); - this.cdr.detectChanges(); + mergeMap((submissionObject: SubmissionObject[]) => { + // retrieve the full submission object with embeds + return this.submissionService.retrieveSubmission(submissionObject[0].id).pipe( + getFirstSucceededRemoteDataPayload() + ); }) + ).subscribe((submissionObject: SubmissionObject) => { + this.selectedCollectionId = event.collection.id; + this.selectedCollectionName$ = observableOf(event.collection.name); + this.collectionChange.emit(submissionObject); + this.submissionService.changeSubmissionCollection(this.submissionId, event.collection.id); + this.processingChange$.next(false); + this.cdr.detectChanges(); + }) ); } diff --git a/src/app/submission/form/submission-form.component.ts b/src/app/submission/form/submission-form.component.ts index 216aefcfc3..279915d62b 100644 --- a/src/app/submission/form/submission-form.component.ts +++ b/src/app/submission/form/submission-form.component.ts @@ -201,7 +201,7 @@ export class SubmissionFormComponent implements OnChanges, OnDestroy { (section) => isEqual(section.sectionType, SectionsType.Collection) ); - return isNotUndefined(submissionSectionModel.visibility) ? submissionSectionModel.visibility : null; + return isNotUndefined(submissionSectionModel.visibility) ? submissionSectionModel.visibility : null; } /** diff --git a/src/app/submission/form/submission-upload-files/submission-upload-files.component.spec.ts b/src/app/submission/form/submission-upload-files/submission-upload-files.component.spec.ts index fa7ecebbff..866fcc73df 100644 --- a/src/app/submission/form/submission-upload-files/submission-upload-files.component.spec.ts +++ b/src/app/submission/form/submission-upload-files/submission-upload-files.component.spec.ts @@ -165,7 +165,7 @@ describe('SubmissionUploadFilesComponent Component', () => { submissionId, sectionId, mockSectionsData[sectionId], - expectedErrors[sectionId], + expectedErrors[sectionId], expectedErrors[sectionId] ); }); @@ -189,7 +189,7 @@ describe('SubmissionUploadFilesComponent Component', () => { submissionId, sectionId, mockSectionsData[sectionId], - expectedErrors[sectionId], + expectedErrors[sectionId], expectedErrors[sectionId] ); }); diff --git a/src/app/submission/form/submission-upload-files/submission-upload-files.component.ts b/src/app/submission/form/submission-upload-files/submission-upload-files.component.ts index 721a6c108b..356cc83c11 100644 --- a/src/app/submission/form/submission-upload-files/submission-upload-files.component.ts +++ b/src/app/submission/form/submission-upload-files/submission-upload-files.component.ts @@ -132,17 +132,17 @@ export class SubmissionUploadFilesComponent implements OnChanges { const sectionData = normalizeSectionData(sections[sectionId]); const sectionErrors = errorsList[sectionId]; this.sectionService.isSectionType(this.submissionId, sectionId, SectionsType.Upload) - .pipe(take(1)) - .subscribe((isUpload) => { - if (isUpload) { - // Look for errors on upload - if ((isEmpty(sectionErrors))) { - this.notificationsService.success(null, this.translate.get('submission.sections.upload.upload-successful')); - } else { - this.notificationsService.error(null, this.translate.get('submission.sections.upload.upload-failed')); - } + .pipe(take(1)) + .subscribe((isUpload) => { + if (isUpload) { + // Look for errors on upload + if ((isEmpty(sectionErrors))) { + this.notificationsService.success(null, this.translate.get('submission.sections.upload.upload-successful')); + } else { + this.notificationsService.error(null, this.translate.get('submission.sections.upload.upload-failed')); } - }); + } + }); this.sectionService.updateSectionData(this.submissionId, sectionId, sectionData, sectionErrors, sectionErrors); }); } diff --git a/src/app/submission/import-external/submission-import-external.component.ts b/src/app/submission/import-external/submission-import-external.component.ts index 25b1d5d1aa..b314cda962 100644 --- a/src/app/submission/import-external/submission-import-external.component.ts +++ b/src/app/submission/import-external/submission-import-external.component.ts @@ -188,16 +188,16 @@ export class SubmissionImportExternalComponent implements OnInit, OnDestroy { this.retrieveExternalSourcesSub = this.reload$.pipe( filter((sourceQueryObject: ExternalSourceData) => isNotEmpty(sourceQueryObject.sourceId) && isNotEmpty(sourceQueryObject.query)), switchMap((sourceQueryObject: ExternalSourceData) => { - const query = sourceQueryObject.query; - this.routeData = sourceQueryObject; - return this.searchConfigService.paginatedSearchOptions.pipe( - tap(() => this.isLoading$.next(true)), - filter((searchOptions) => searchOptions.query === query), - mergeMap((searchOptions) => this.externalService.getExternalSourceEntries(this.routeData.sourceId, searchOptions).pipe( - getFinishedRemoteData(), - )) - ); - } + const query = sourceQueryObject.query; + this.routeData = sourceQueryObject; + return this.searchConfigService.paginatedSearchOptions.pipe( + tap(() => this.isLoading$.next(true)), + filter((searchOptions) => searchOptions.query === query), + mergeMap((searchOptions) => this.externalService.getExternalSourceEntries(this.routeData.sourceId, searchOptions).pipe( + getFinishedRemoteData(), + )) + ); + } ), ).subscribe((rdData) => { this.entriesRD$.next(rdData); diff --git a/src/app/submission/objects/submission-objects.actions.ts b/src/app/submission/objects/submission-objects.actions.ts index 9182611e47..0a8c090aad 100644 --- a/src/app/submission/objects/submission-objects.actions.ts +++ b/src/app/submission/objects/submission-objects.actions.ts @@ -148,15 +148,15 @@ export class InitSectionAction implements Action { * the section's errors */ constructor(submissionId: string, - sectionId: string, - header: string, - config: string, - mandatory: boolean, - sectionType: SectionsType, - visibility: SectionVisibility, - enabled: boolean, - data: WorkspaceitemSectionDataType, - errors: SubmissionSectionError[]) { + sectionId: string, + header: string, + config: string, + mandatory: boolean, + sectionType: SectionsType, + visibility: SectionVisibility, + enabled: boolean, + data: WorkspaceitemSectionDataType, + errors: SubmissionSectionError[]) { this.payload = { submissionId, sectionId, header, config, mandatory, sectionType, visibility, enabled, data, errors }; } } @@ -177,7 +177,7 @@ export class EnableSectionAction implements Action { * the section's ID to add */ constructor(submissionId: string, - sectionId: string) { + sectionId: string) { this.payload = { submissionId, sectionId }; } } @@ -230,11 +230,11 @@ export class UpdateSectionDataAction implements Action { * the section's metadata */ constructor(submissionId: string, - sectionId: string, - data: WorkspaceitemSectionDataType, - errorsToShow: SubmissionSectionError[], - serverValidationErrors: SubmissionSectionError[], - metadata?: string[]) { + sectionId: string, + data: WorkspaceitemSectionDataType, + errorsToShow: SubmissionSectionError[], + serverValidationErrors: SubmissionSectionError[], + metadata?: string[]) { this.payload = { submissionId, sectionId, data, errorsToShow, serverValidationErrors, metadata }; } } @@ -334,12 +334,12 @@ export class InitSubmissionFormAction implements Action { * the submission's sections errors */ constructor(collectionId: string, - submissionId: string, - selfUrl: string, - submissionDefinition: SubmissionDefinitionsModel, - sections: WorkspaceitemSectionsObject, - item: Item, - errors: SubmissionError) { + submissionId: string, + selfUrl: string, + submissionDefinition: SubmissionDefinitionsModel, + sections: WorkspaceitemSectionsObject, + item: Item, + errors: SubmissionError) { this.payload = { collectionId, submissionId, selfUrl, submissionDefinition, sections, item, errors }; } } diff --git a/src/app/submission/objects/submission-objects.effects.ts b/src/app/submission/objects/submission-objects.effects.ts index 98646009d5..ed9bea49d2 100644 --- a/src/app/submission/objects/submission-objects.effects.ts +++ b/src/app/submission/objects/submission-objects.effects.ts @@ -129,8 +129,8 @@ export class SubmissionObjectEffects { this.submissionService.getSubmissionObjectLinkName(), action.payload.submissionId, 'sections').pipe( - map((response: SubmissionObject[]) => new SaveSubmissionFormSuccessAction(action.payload.submissionId, response, action.payload.isManual, action.payload.isManual)), - catchError(() => observableOf(new SaveSubmissionFormErrorAction(action.payload.submissionId)))); + map((response: SubmissionObject[]) => new SaveSubmissionFormSuccessAction(action.payload.submissionId, response, action.payload.isManual, action.payload.isManual)), + catchError(() => observableOf(new SaveSubmissionFormErrorAction(action.payload.submissionId)))); }))); /** @@ -143,8 +143,8 @@ export class SubmissionObjectEffects { this.submissionService.getSubmissionObjectLinkName(), action.payload.submissionId, 'sections').pipe( - map((response: SubmissionObject[]) => new SaveForLaterSubmissionFormSuccessAction(action.payload.submissionId, response)), - catchError(() => observableOf(new SaveSubmissionFormErrorAction(action.payload.submissionId)))); + map((response: SubmissionObject[]) => new SaveForLaterSubmissionFormSuccessAction(action.payload.submissionId, response)), + catchError(() => observableOf(new SaveSubmissionFormErrorAction(action.payload.submissionId)))); }))); /** @@ -184,8 +184,8 @@ export class SubmissionObjectEffects { action.payload.submissionId, 'sections', action.payload.sectionId).pipe( - map((response: SubmissionObject[]) => new SaveSubmissionSectionFormSuccessAction(action.payload.submissionId, response)), - catchError(() => observableOf(new SaveSubmissionSectionFormErrorAction(action.payload.submissionId)))); + map((response: SubmissionObject[]) => new SaveSubmissionSectionFormSuccessAction(action.payload.submissionId, response)), + catchError(() => observableOf(new SaveSubmissionSectionFormErrorAction(action.payload.submissionId)))); }))); /** diff --git a/src/app/submission/objects/submission-objects.reducer.ts b/src/app/submission/objects/submission-objects.reducer.ts index a05bf05f52..bd8a06493b 100644 --- a/src/app/submission/objects/submission-objects.reducer.ts +++ b/src/app/submission/objects/submission-objects.reducer.ts @@ -391,7 +391,7 @@ function completeInit(state: SubmissionObjectState, action: CompleteInitSubmissi * the new state, with the flag set to true. */ function saveSubmission(state: SubmissionObjectState, - action: SaveSubmissionFormAction + action: SaveSubmissionFormAction | SaveSubmissionSectionFormAction | SaveForLaterSubmissionFormAction | SaveAndDepositSubmissionAction): SubmissionObjectState { @@ -422,7 +422,7 @@ function saveSubmission(state: SubmissionObjectState, * the new state, with the flag set to false. */ function completeSave(state: SubmissionObjectState, - action: SaveSubmissionFormSuccessAction + action: SaveSubmissionFormSuccessAction | SaveForLaterSubmissionFormSuccessAction | SaveSubmissionSectionFormSuccessAction | SaveSubmissionFormErrorAction diff --git a/src/app/submission/sections/cc-license/submission-section-cc-licenses.component.ts b/src/app/submission/sections/cc-license/submission-section-cc-licenses.component.ts index ec28530f89..ed5ff79d28 100644 --- a/src/app/submission/sections/cc-license/submission-section-cc-licenses.component.ts +++ b/src/app/submission/sections/cc-license/submission-section-cc-licenses.component.ts @@ -274,12 +274,12 @@ export class SubmissionSectionCcLicensesComponent extends SectionModelComponent getFirstCompletedRemoteData(), getRemoteDataPayload() ).subscribe((remoteData) => { - if (remoteData === undefined || remoteData.values.length === 0) { - // No value configured, use blank value (International jurisdiction) - this.defaultJurisdiction = ''; - } else { - this.defaultJurisdiction = remoteData.values[0]; - } + if (remoteData === undefined || remoteData.values.length === 0) { + // No value configured, use blank value (International jurisdiction) + this.defaultJurisdiction = ''; + } else { + this.defaultJurisdiction = remoteData.values[0]; + } }) ); } diff --git a/src/app/submission/sections/container/section-container.component.spec.ts b/src/app/submission/sections/container/section-container.component.spec.ts index d3f4a93762..70e8dbb223 100644 --- a/src/app/submission/sections/container/section-container.component.spec.ts +++ b/src/app/submission/sections/container/section-container.component.spec.ts @@ -20,16 +20,16 @@ import { mockSubmissionCollectionId, mockSubmissionId } from '../../../shared/mo const sectionState = { header: 'submit.progressbar.describe.stepone', - config: 'https://rest.api/dspace-spring-rest/api/config/submissionforms/traditionalpageone', - mandatory: true, - sectionType: SectionsType.SubmissionForm, - collapsed: false, - enabled: true, - data: {}, - errorsToShow: [], - serverValidationErrors: [], - isLoading: false, - isValid: false + config: 'https://rest.api/dspace-spring-rest/api/config/submissionforms/traditionalpageone', + mandatory: true, + sectionType: SectionsType.SubmissionForm, + collapsed: false, + enabled: true, + data: {}, + errorsToShow: [], + serverValidationErrors: [], + isLoading: false, + isValid: false } as any; const sectionObject: SectionDataObject = { diff --git a/src/app/submission/sections/form/section-form-operations.service.spec.ts b/src/app/submission/sections/form/section-form-operations.service.spec.ts index 65ddbe0cb0..c6c729fcee 100644 --- a/src/app/submission/sections/form/section-form-operations.service.spec.ts +++ b/src/app/submission/sections/form/section-form-operations.service.spec.ts @@ -37,10 +37,10 @@ describe('SectionFormOperationsService test suite', () => { let serviceAsAny: any; const jsonPatchOpBuilder: any = jasmine.createSpyObj('jsonPatchOpBuilder', { - add: jasmine.createSpy('add'), - replace: jasmine.createSpy('replace'), - remove: jasmine.createSpy('remove'), - }); + add: jasmine.createSpy('add'), + replace: jasmine.createSpy('replace'), + remove: jasmine.createSpy('remove'), + }); const pathCombiner = new JsonPatchOperationPathCombiner('sections', 'test'); const dynamicFormControlChangeEvent: DynamicFormControlEvent = { @@ -381,7 +381,7 @@ describe('SectionFormOperationsService test suite', () => { }); expectedValue = [ Object.assign(new VocabularyEntry(), mockInputWithLanguageAndAuthorityArrayModel.value[0], - { language: mockInputWithLanguageAndAuthorityArrayModel.language } + { language: mockInputWithLanguageAndAuthorityArrayModel.language } ) ]; diff --git a/src/app/submission/sections/form/section-form-operations.service.ts b/src/app/submission/sections/form/section-form-operations.service.ts index 778063dd31..8e60dad454 100644 --- a/src/app/submission/sections/form/section-form-operations.service.ts +++ b/src/app/submission/sections/form/section-form-operations.service.ts @@ -57,9 +57,9 @@ export class SectionFormOperationsService { * representing if field value related to the specified operation has stored value */ public dispatchOperationsFromEvent(pathCombiner: JsonPatchOperationPathCombiner, - event: DynamicFormControlEvent, - previousValue: FormFieldPreviousValueObject, - hasStoredValue: boolean): void { + event: DynamicFormControlEvent, + previousValue: FormFieldPreviousValueObject, + hasStoredValue: boolean): void { switch (event.type) { case 'remove': this.dispatchOperationsFromRemoveEvent(pathCombiner, event, previousValue); @@ -296,8 +296,8 @@ export class SectionFormOperationsService { * the [[FormFieldPreviousValueObject]] for the specified operation */ protected dispatchOperationsFromRemoveEvent(pathCombiner: JsonPatchOperationPathCombiner, - event: DynamicFormControlEvent, - previousValue: FormFieldPreviousValueObject): void { + event: DynamicFormControlEvent, + previousValue: FormFieldPreviousValueObject): void { const path = this.getFieldPathFromEvent(event); const value = this.getFieldValueFromChangeEvent(event); @@ -360,11 +360,11 @@ export class SectionFormOperationsService { * representing if field value related to the specified operation has stored value */ protected dispatchOperationsFromChangeEvent(pathCombiner: JsonPatchOperationPathCombiner, - event: DynamicFormControlEvent, - previousValue: FormFieldPreviousValueObject, - hasStoredValue: boolean): void { + event: DynamicFormControlEvent, + previousValue: FormFieldPreviousValueObject, + hasStoredValue: boolean): void { - if (event.context && event.context instanceof DynamicFormArrayGroupModel) { + if (event.context && event.context instanceof DynamicFormArrayGroupModel) { // Model is a DynamicRowArrayModel this.handleArrayGroupPatch(pathCombiner, event, (event as any).context.context, previousValue); return; @@ -448,9 +448,9 @@ export class SectionFormOperationsService { * the [[FormFieldPreviousValueObject]] for the specified operation */ protected dispatchOperationsFromMap(valueMap: Map, - pathCombiner: JsonPatchOperationPathCombiner, - event: DynamicFormControlEvent, - previousValue: FormFieldPreviousValueObject): void { + pathCombiner: JsonPatchOperationPathCombiner, + event: DynamicFormControlEvent, + previousValue: FormFieldPreviousValueObject): void { const currentValueMap = valueMap; if (event.type === 'remove') { const path = this.getQualdropItemPathFromEvent(event); @@ -493,8 +493,8 @@ export class SectionFormOperationsService { * the [[FormFieldPreviousValueObject]] for the specified operation */ private dispatchOperationsFromMoveEvent(pathCombiner: JsonPatchOperationPathCombiner, - event: DynamicFormControlEvent, - previousValue: FormFieldPreviousValueObject) { + event: DynamicFormControlEvent, + previousValue: FormFieldPreviousValueObject) { return this.handleArrayGroupPatch(pathCombiner, event.$event, (event as any).$event.arrayModel, previousValue); } @@ -512,9 +512,9 @@ export class SectionFormOperationsService { * the [[FormFieldPreviousValueObject]] for the specified operation */ private handleArrayGroupPatch(pathCombiner: JsonPatchOperationPathCombiner, - event, - model: DynamicRowArrayModel, - previousValue: FormFieldPreviousValueObject) { + event, + model: DynamicRowArrayModel, + previousValue: FormFieldPreviousValueObject) { const arrayValue = this.formBuilder.getValueFromModel([model]); const segmentedPath = this.getFieldPathSegmentedFromChangeEvent(event); diff --git a/src/app/submission/sections/form/section-form.component.ts b/src/app/submission/sections/form/section-form.component.ts index 2a07f7e3f1..dcff3e80ef 100644 --- a/src/app/submission/sections/form/section-form.component.ts +++ b/src/app/submission/sections/form/section-form.component.ts @@ -183,7 +183,7 @@ export class SubmissionSectionFormComponent extends SectionModelComponent { this.submissionObjectService.findById(this.submissionId, true, false, followLink('item')).pipe( getFirstSucceededRemoteData(), getRemoteDataPayload()), - this.sectionService.isSectionReadOnly(this.submissionId, this.sectionData.id, this.submissionService.getSubmissionScope()) + this.sectionService.isSectionReadOnly(this.submissionId, this.sectionData.id, this.submissionService.getSubmissionScope()) ])), take(1)) .subscribe(([sectionData, submissionObject, isSectionReadOnly]: [WorkspaceitemSectionFormObject, SubmissionObject, boolean]) => { diff --git a/src/app/submission/sections/identifiers/section-identifiers.component.ts b/src/app/submission/sections/identifiers/section-identifiers.component.ts index 2dc70f668e..f5650ddbde 100644 --- a/src/app/submission/sections/identifiers/section-identifiers.component.ts +++ b/src/app/submission/sections/identifiers/section-identifiers.component.ts @@ -72,7 +72,7 @@ export class SubmissionSectionIdentifiersComponent extends SectionModelComponent } ngOnInit() { - super.ngOnInit(); + super.ngOnInit(); } /** diff --git a/src/app/submission/sections/sections.service.ts b/src/app/submission/sections/sections.service.ts index 0ea6232237..9029e5d387 100644 --- a/src/app/submission/sections/sections.service.ts +++ b/src/app/submission/sections/sections.service.ts @@ -336,7 +336,7 @@ export class SectionsService { return isNotEmpty(sectionObj.visibility) && ((sectionObj.visibility.other === 'READONLY' && submissionScope !== SubmissionScopeType.WorkspaceItem) || (sectionObj.visibility.main === 'READONLY' && submissionScope === SubmissionScopeType.WorkspaceItem) - ); + ); }), distinctUntilChanged()); } diff --git a/src/app/submission/sections/upload/file/edit/section-upload-file-edit.component.ts b/src/app/submission/sections/upload/file/edit/section-upload-file-edit.component.ts index 9ee4a7dda5..38b86dd34a 100644 --- a/src/app/submission/sections/upload/file/edit/section-upload-file-edit.component.ts +++ b/src/app/submission/sections/upload/file/edit/section-upload-file-edit.component.ts @@ -67,7 +67,7 @@ import { DynamicDateControlValue } from '@ng-dynamic-forms/core/lib/model/dynami templateUrl: './section-upload-file-edit.component.html', }) export class SubmissionSectionUploadFileEditComponent - implements OnInit, OnDestroy { +implements OnInit, OnDestroy { /** * The FormComponent reference @@ -440,10 +440,10 @@ export class SubmissionSectionUploadFileEditComponent // datepicker sometimes exceeds it. let startDateDate = new Date(startDate); if (accessConditionOpt.maxStartDate) { - const maxStartDateDate = new Date(accessConditionOpt.maxStartDate); - if (startDateDate > maxStartDateDate) { - startDateDate = maxStartDateDate; - } + const maxStartDateDate = new Date(accessConditionOpt.maxStartDate); + if (startDateDate > maxStartDateDate) { + startDateDate = maxStartDateDate; + } } currentAccessCondition.startDate = dateToISOFormat(startDateDate); } @@ -455,10 +455,10 @@ export class SubmissionSectionUploadFileEditComponent // datepicker sometimes exceeds it. let endDateDate = new Date(endDate); if (accessConditionOpt.maxEndDate) { - const maxEndDateDate = new Date(accessConditionOpt.maxEndDate); - if (endDateDate > maxEndDateDate) { - endDateDate = maxEndDateDate; - } + const maxEndDateDate = new Date(accessConditionOpt.maxEndDate); + if (endDateDate > maxEndDateDate) { + endDateDate = maxEndDateDate; + } } currentAccessCondition.endDate = dateToISOFormat(endDateDate); } diff --git a/src/app/submission/sections/upload/file/section-upload-file.component.ts b/src/app/submission/sections/upload/file/section-upload-file.component.ts index 26fb9445cb..8554c9aa40 100644 --- a/src/app/submission/sections/upload/file/section-upload-file.component.ts +++ b/src/app/submission/sections/upload/file/section-upload-file.component.ts @@ -1,12 +1,12 @@ import { - ChangeDetectorRef, - Component, - Input, - OnChanges, - OnDestroy, - OnInit, - SimpleChanges, - ViewChild + ChangeDetectorRef, + Component, + Input, + OnChanges, + OnDestroy, + OnInit, + SimpleChanges, + ViewChild } from '@angular/core'; import { BehaviorSubject, Subscription } from 'rxjs'; @@ -185,8 +185,8 @@ export class SubmissionSectionUploadFileComponent implements OnChanges, OnInit, .getFileData(this.submissionId, this.sectionId, this.fileId) .pipe(filter((bitstream) => isNotUndefined(bitstream))) .subscribe((bitstream) => { - this.fileData = bitstream; - } + this.fileData = bitstream; + } ) ); } diff --git a/src/app/submission/sections/upload/file/themed-section-upload-file.component.ts b/src/app/submission/sections/upload/file/themed-section-upload-file.component.ts index 9e0a265c3c..c1ea23310d 100644 --- a/src/app/submission/sections/upload/file/themed-section-upload-file.component.ts +++ b/src/app/submission/sections/upload/file/themed-section-upload-file.component.ts @@ -4,12 +4,12 @@ import { ThemedComponent } from 'src/app/shared/theme-support/themed.component'; import { SubmissionSectionUploadFileComponent } from './section-upload-file.component'; @Component({ - selector: 'ds-themed-submission-upload-section-file', - styleUrls: [], - templateUrl: '../../../../shared/theme-support/themed.component.html' + selector: 'ds-themed-submission-upload-section-file', + styleUrls: [], + templateUrl: '../../../../shared/theme-support/themed.component.html' }) export class ThemedSubmissionSectionUploadFileComponent - extends ThemedComponent { + extends ThemedComponent { /** * The list of available access condition @@ -77,7 +77,7 @@ export class ThemedSubmissionSectionUploadFileComponent 'fileName', 'sectionId', 'submissionId' - ]; + ]; protected getComponentName(): string { return 'SubmissionSectionUploadFileComponent'; diff --git a/src/app/submission/sections/upload/section-upload.component.ts b/src/app/submission/sections/upload/section-upload.component.ts index eefed8a36b..5d83b8bcd6 100644 --- a/src/app/submission/sections/upload/section-upload.component.ts +++ b/src/app/submission/sections/upload/section-upload.component.ts @@ -171,7 +171,7 @@ export class SubmissionSectionUploadComponent extends SectionModelComponent { filter((rd: RemoteData) => isNotUndefined((rd.payload))), tap((collectionRemoteData: RemoteData) => this.collectionName = this.dsoNameService.getName(collectionRemoteData.payload)), // TODO review this part when https://github.com/DSpace/dspace-angular/issues/575 is resolved -/* mergeMap((collectionRemoteData: RemoteData) => { + /* mergeMap((collectionRemoteData: RemoteData) => { return this.resourcePolicyService.findByHref( (collectionRemoteData.payload as any)._links.defaultAccessConditions.href ); @@ -202,20 +202,20 @@ export class SubmissionSectionUploadComponent extends SectionModelComponent { }), distinctUntilChanged()) .subscribe(([configMetadataForm, fileList]: [SubmissionFormsModel, any[]]) => { - this.fileList = []; - this.fileIndexes = []; - this.fileNames = []; - this.changeDetectorRef.detectChanges(); - if (isNotUndefined(fileList) && fileList.length > 0) { - fileList.forEach((file) => { - this.fileList.push(file); - this.fileIndexes.push(file.uuid); - this.fileNames.push(this.getFileName(configMetadataForm, file)); - }); - } - - this.changeDetectorRef.detectChanges(); + this.fileList = []; + this.fileIndexes = []; + this.fileNames = []; + this.changeDetectorRef.detectChanges(); + if (isNotUndefined(fileList) && fileList.length > 0) { + fileList.forEach((file) => { + this.fileList.push(file); + this.fileIndexes.push(file.uuid); + this.fileNames.push(this.getFileName(configMetadataForm, file)); + }); } + + this.changeDetectorRef.detectChanges(); + } ) ); } diff --git a/src/app/submission/submission.service.ts b/src/app/submission/submission.service.ts index 9eb8cf110a..cf85fb9358 100644 --- a/src/app/submission/submission.service.ts +++ b/src/app/submission/submission.service.ts @@ -505,7 +505,7 @@ export class SubmissionService { } else { this.router.navigateByUrl(previousUrl); } - }))) + }))) ).subscribe(); } diff --git a/src/app/submission/utils/parseSectionErrorPaths.ts b/src/app/submission/utils/parseSectionErrorPaths.ts index 4c973dedcf..18ac11b9c1 100644 --- a/src/app/submission/utils/parseSectionErrorPaths.ts +++ b/src/app/submission/utils/parseSectionErrorPaths.ts @@ -39,21 +39,21 @@ const parseSectionErrorPaths = (path: string | string[]): SectionErrorPath[] => const paths = typeof path === 'string' ? [path] : path; return paths.map((item) => { - if (item.match(regex) && item.match(regex).length > 2) { - return { - sectionId: item.match(regex)[1], - fieldId: item.match(regex)[2], - fieldIndex: hasValue(item.match(regex)[3]) ? +item.match(regex)[3] : 0, - originalPath: item, - }; - } else { - return { - sectionId: item.match(regexShort)[1], - originalPath: item, - }; - } - + if (item.match(regex) && item.match(regex).length > 2) { + return { + sectionId: item.match(regex)[1], + fieldId: item.match(regex)[2], + fieldIndex: hasValue(item.match(regex)[3]) ? +item.match(regex)[3] : 0, + originalPath: item, + }; + } else { + return { + sectionId: item.match(regexShort)[1], + originalPath: item, + }; } + + } ); }; diff --git a/src/app/subscriptions-page/subscriptions-page-routing.module.ts b/src/app/subscriptions-page/subscriptions-page-routing.module.ts index 149c9a415f..25f1bbc50c 100644 --- a/src/app/subscriptions-page/subscriptions-page-routing.module.ts +++ b/src/app/subscriptions-page/subscriptions-page-routing.module.ts @@ -8,18 +8,18 @@ import { SubscriptionsPageComponent } from './subscriptions-page.component'; imports: [ SubscriptionsPageModule, RouterModule.forChild([ - { - path: '', - data: { - title: 'subscriptions.title', - }, - children: [ - { - path: '', - component: SubscriptionsPageComponent, - }, - ] + { + path: '', + data: { + title: 'subscriptions.title', }, + children: [ + { + path: '', + component: SubscriptionsPageComponent, + }, + ] + }, ]) ] }) diff --git a/src/app/system-wide-alert/alert-form/system-wide-alert-form.component.ts b/src/app/system-wide-alert/alert-form/system-wide-alert-form.component.ts index eaff12c169..307d2b470e 100644 --- a/src/app/system-wide-alert/alert-form/system-wide-alert-form.component.ts +++ b/src/app/system-wide-alert/alert-form/system-wide-alert-form.component.ts @@ -117,11 +117,11 @@ export class SystemWideAlertFormComponent implements OnInit { */ createForm() { this.alertForm = new UntypedFormBuilder().group({ - formMessage: new UntypedFormControl('', { - validators: [Validators.required], - }), - formActive: new UntypedFormControl(false), - } + formMessage: new UntypedFormControl('', { + validators: [Validators.required], + }), + formActive: new UntypedFormControl(false), + } ); this.setDateTime(new Date()); } diff --git a/src/app/system-wide-alert/system-wide-alert.model.ts b/src/app/system-wide-alert/system-wide-alert.model.ts index 158deb2603..f89202c3df 100644 --- a/src/app/system-wide-alert/system-wide-alert.model.ts +++ b/src/app/system-wide-alert/system-wide-alert.model.ts @@ -18,38 +18,38 @@ export class SystemWideAlert implements CacheableObject { */ @excludeFromEquals @autoserialize - type: ResourceType; + type: ResourceType; /** * The identifier for this system-wide alert */ @autoserialize - alertId: string; + alertId: string; /** * The message for this system-wide alert */ @autoserialize - message: string; + message: string; /** * A string representation of the date to which this system-wide alert will count down when active */ @autoserialize - countdownTo: string; + countdownTo: string; /** * Whether the system-wide alert is active */ @autoserialize - active: boolean; + active: boolean; /** * The {@link HALLink}s for this system-wide alert */ @deserialize - _links: { + _links: { self: HALLink, }; } diff --git a/src/app/workflowitems-edit-page/advanced-workflow-action/advanced-workflow-action-select-reviewer/reviewers-list/reviewers-list.component.ts b/src/app/workflowitems-edit-page/advanced-workflow-action/advanced-workflow-action-select-reviewer/reviewers-list/reviewers-list.component.ts index 6984a1d86d..89e0b94a3a 100644 --- a/src/app/workflowitems-edit-page/advanced-workflow-action/advanced-workflow-action-select-reviewer/reviewers-list/reviewers-list.component.ts +++ b/src/app/workflowitems-edit-page/advanced-workflow-action/advanced-workflow-action-select-reviewer/reviewers-list/reviewers-list.component.ts @@ -39,16 +39,16 @@ enum SubKey { export class ReviewersListComponent extends MembersListComponent implements OnInit, OnChanges, OnDestroy { @Input() - groupId: string | null; + groupId: string | null; @Input() - actionConfig: EPersonListActionConfig; + actionConfig: EPersonListActionConfig; @Input() - multipleReviewers: boolean; + multipleReviewers: boolean; @Output() - selectedReviewersUpdated: EventEmitter = new EventEmitter(); + selectedReviewersUpdated: EventEmitter = new EventEmitter(); selectedReviewers: EpersonDtoModel[] = []; diff --git a/src/app/workflowitems-edit-page/workflow-item-action-page.component.spec.ts b/src/app/workflowitems-edit-page/workflow-item-action-page.component.spec.ts index c4dea0f30c..b258c74306 100644 --- a/src/app/workflowitems-edit-page/workflow-item-action-page.component.spec.ts +++ b/src/app/workflowitems-edit-page/workflow-item-action-page.component.spec.ts @@ -106,9 +106,9 @@ describe('WorkflowItemActionPageComponent', () => { }); @Component({ - selector: 'ds-workflow-item-test-action-page', - templateUrl: 'workflow-item-action-page.component.html' - } + selector: 'ds-workflow-item-test-action-page', + templateUrl: 'workflow-item-action-page.component.html' +} ) class TestComponent extends WorkflowItemActionPageComponent { constructor(protected route: ActivatedRoute, diff --git a/src/app/workflowitems-edit-page/workflow-item-action-page.component.ts b/src/app/workflowitems-edit-page/workflow-item-action-page.component.ts index 2ed5639c5a..221d257ba7 100644 --- a/src/app/workflowitems-edit-page/workflow-item-action-page.component.ts +++ b/src/app/workflowitems-edit-page/workflow-item-action-page.component.ts @@ -76,18 +76,18 @@ export abstract class WorkflowItemActionPageComponent implements OnInit { previousPage() { this.routeService.getPreviousUrl().pipe(take(1)) .subscribe((url) => { - let params: Params = {}; - if (isEmpty(url)) { - url = '/mydspace'; - params = this.previousQueryParameters; - } - if (url.split('?').length > 1) { - for (const param of url.split('?')[1].split('&')) { - params[param.split('=')[0]] = decodeURIComponent(param.split('=')[1]); - } - } - void this.router.navigate([url.split('?')[0]], { queryParams: params }); + let params: Params = {}; + if (isEmpty(url)) { + url = '/mydspace'; + params = this.previousQueryParameters; } + if (url.split('?').length > 1) { + for (const param of url.split('?')[1].split('&')) { + params[param.split('=')[0]] = decodeURIComponent(param.split('=')[1]); + } + } + void this.router.navigate([url.split('?')[0]], { queryParams: params }); + } ); } diff --git a/src/app/workspaceitems-edit-page/item-from-workspace.resolver.ts b/src/app/workspaceitems-edit-page/item-from-workspace.resolver.ts index 60e1fe6a87..7097233e46 100644 --- a/src/app/workspaceitems-edit-page/item-from-workspace.resolver.ts +++ b/src/app/workspaceitems-edit-page/item-from-workspace.resolver.ts @@ -11,11 +11,11 @@ import { WorkspaceitemDataService } from '../core/submission/workspaceitem-data. */ @Injectable() export class ItemFromWorkspaceResolver extends SubmissionObjectResolver implements Resolve> { - constructor( + constructor( private workspaceItemService: WorkspaceitemDataService, protected store: Store - ) { - super(workspaceItemService, store); - } + ) { + super(workspaceItemService, store); + } } diff --git a/src/app/workspaceitems-edit-page/workspaceitems-delete-page/workspaceitems-delete-page.component.ts b/src/app/workspaceitems-edit-page/workspaceitems-delete-page/workspaceitems-delete-page.component.ts index 77ed0519d6..55e8fbc19c 100644 --- a/src/app/workspaceitems-edit-page/workspaceitems-delete-page/workspaceitems-delete-page.component.ts +++ b/src/app/workspaceitems-edit-page/workspaceitems-delete-page/workspaceitems-delete-page.component.ts @@ -52,36 +52,36 @@ export class WorkspaceItemsDeletePageComponent implements OnInit { this.previousQueryParameters = (this.location.getState() as { [key: string]: any }).previousQueryParams; } - /** + /** * Navigates to the previous url * If there's not previous url, it continues to the mydspace page instead */ - previousPage() { - this.routeService.getPreviousUrl().pipe(take(1)) - .subscribe((url: string) => { - let params: Params = {}; - if (!url) { - url = '/mydspace'; - params = this.previousQueryParameters; - } - if (url.split('?').length > 1) { - for (const param of url.split('?')[1].split('&')) { - params[param.split('=')[0]] = decodeURIComponent(param.split('=')[1]); - } - } - void this.router.navigate([url.split('?')[0]], { queryParams: params }); + previousPage() { + this.routeService.getPreviousUrl().pipe(take(1)) + .subscribe((url: string) => { + let params: Params = {}; + if (!url) { + url = '/mydspace'; + params = this.previousQueryParameters; + } + if (url.split('?').length > 1) { + for (const param of url.split('?')[1].split('&')) { + params[param.split('=')[0]] = decodeURIComponent(param.split('=')[1]); } - ); - } + } + void this.router.navigate([url.split('?')[0]], { queryParams: params }); + } + ); + } /** * Open the modal to confirm the deletion of the workspaceitem */ public async confirmDelete(content) { - await this.modalService.open(content).result.then( + await this.modalService.open(content).result.then( (result) => { if (result === 'ok') { - this.sendDeleteRequest(); + this.sendDeleteRequest(); } } ); diff --git a/src/config/default-app-config.ts b/src/config/default-app-config.ts index a6e9e092e4..7046b6af45 100644 --- a/src/config/default-app-config.ts +++ b/src/config/default-app-config.ts @@ -425,7 +425,7 @@ export class DefaultAppConfig implements AppConfig { vocabulary: 'srsc', enabled: false } - ]; + ]; // Configuration that determines the metadata sorting of community and collection edition and creation when there are not a search query. comcolSelectionSort: DiscoverySortConfig = { diff --git a/src/config/theme.model.spec.ts b/src/config/theme.model.spec.ts index 79b5a1f32b..02afaf35d3 100644 --- a/src/config/theme.model.spec.ts +++ b/src/config/theme.model.spec.ts @@ -71,7 +71,7 @@ describe('Theme Models', () => { let handleService; beforeEach(() => { handleService = new HandleService(); - }); + }); it('should return true when the DSO\'s handle matches the theme\'s handle', () => { theme = new HandleTheme({ name: 'matching-handle', diff --git a/src/config/theme.model.ts b/src/config/theme.model.ts index 019540f18a..9db107dc52 100644 --- a/src/config/theme.model.ts +++ b/src/config/theme.model.ts @@ -90,7 +90,7 @@ export class HandleTheme extends Theme { constructor(public config: HandleThemeConfig, protected handleService: HandleService - ) { + ) { super(config); this.normalizedHandle = this.handleService.normalizeHandle(this.config.handle); diff --git a/src/modules/app/browser-init.service.ts b/src/modules/app/browser-init.service.ts index 61d57f10f9..fcb1caa61d 100644 --- a/src/modules/app/browser-init.service.ts +++ b/src/modules/app/browser-init.service.ts @@ -150,12 +150,12 @@ export class BrowserInitService extends InitService { private externalAuthCheck() { this.sub = this.authService.isExternalAuthentication().pipe( - filter((externalAuth: boolean) => externalAuth) - ).subscribe(() => { - // Clear the transferState data. - this.rootDataService.invalidateRootCache(); - this.authService.setExternalAuthStatus(false); - } + filter((externalAuth: boolean) => externalAuth) + ).subscribe(() => { + // Clear the transferState data. + this.rootDataService.invalidateRootCache(); + this.authService.setExternalAuthStatus(false); + } ); this.closeAuthCheckSubscription(); @@ -168,8 +168,8 @@ export class BrowserInitService extends InitService { */ private closeAuthCheckSubscription() { firstValueFrom(this.authenticationReady$()).then(() => { - this.sub.unsubscribe(); - }); + this.sub.unsubscribe(); + }); } } diff --git a/src/themes/custom/app/item-page/simple/field-components/file-section/file-section.component.ts b/src/themes/custom/app/item-page/simple/field-components/file-section/file-section.component.ts index 7f36623b3a..14e2fcd2f2 100644 --- a/src/themes/custom/app/item-page/simple/field-components/file-section/file-section.component.ts +++ b/src/themes/custom/app/item-page/simple/field-components/file-section/file-section.component.ts @@ -3,10 +3,10 @@ import { slideSidebarPadding } from '../../../../../../../app/shared/animations/ import { FileSectionComponent as BaseComponent } from '../../../../../../../app/item-page/simple/field-components/file-section/file-section.component'; @Component({ - selector: 'ds-item-page-file-section', - // templateUrl: './file-section.component.html', - templateUrl: '../../../../../../../app/item-page/simple/field-components/file-section/file-section.component.html', - animations: [slideSidebarPadding], + selector: 'ds-item-page-file-section', + // templateUrl: './file-section.component.html', + templateUrl: '../../../../../../../app/item-page/simple/field-components/file-section/file-section.component.html', + animations: [slideSidebarPadding], }) export class FileSectionComponent extends BaseComponent { diff --git a/src/themes/custom/app/request-copy/deny-request-copy/deny-request-copy.component.ts b/src/themes/custom/app/request-copy/deny-request-copy/deny-request-copy.component.ts index 628b2b3f83..0a794fc4d1 100644 --- a/src/themes/custom/app/request-copy/deny-request-copy/deny-request-copy.component.ts +++ b/src/themes/custom/app/request-copy/deny-request-copy/deny-request-copy.component.ts @@ -1,15 +1,15 @@ import { Component } from '@angular/core'; import { - DenyRequestCopyComponent as BaseComponent + DenyRequestCopyComponent as BaseComponent } from 'src/app/request-copy/deny-request-copy/deny-request-copy.component'; @Component({ - selector: 'ds-deny-request-copy', - // styleUrls: ['./deny-request-copy.component.scss'], - styleUrls: [], - // templateUrl: './deny-request-copy.component.html', - templateUrl: './../../../../../app/request-copy/deny-request-copy/deny-request-copy.component.html', + selector: 'ds-deny-request-copy', + // styleUrls: ['./deny-request-copy.component.scss'], + styleUrls: [], + // templateUrl: './deny-request-copy.component.html', + templateUrl: './../../../../../app/request-copy/deny-request-copy/deny-request-copy.component.html', }) export class DenyRequestCopyComponent - extends BaseComponent { + extends BaseComponent { } diff --git a/src/themes/custom/app/request-copy/email-request-copy/email-request-copy.component.ts b/src/themes/custom/app/request-copy/email-request-copy/email-request-copy.component.ts index a0274f6efd..ba466c0cbd 100644 --- a/src/themes/custom/app/request-copy/email-request-copy/email-request-copy.component.ts +++ b/src/themes/custom/app/request-copy/email-request-copy/email-request-copy.component.ts @@ -1,15 +1,15 @@ import { Component } from '@angular/core'; import { - EmailRequestCopyComponent as BaseComponent + EmailRequestCopyComponent as BaseComponent } from 'src/app/request-copy/email-request-copy/email-request-copy.component'; @Component({ - selector: 'ds-email-request-copy', - // styleUrls: ['./email-request-copy.component.scss'], - styleUrls: [], - // templateUrl: './email-request-copy.component.html', - templateUrl: './../../../../../app/request-copy/email-request-copy/email-request-copy.component.html', + selector: 'ds-email-request-copy', + // styleUrls: ['./email-request-copy.component.scss'], + styleUrls: [], + // templateUrl: './email-request-copy.component.html', + templateUrl: './../../../../../app/request-copy/email-request-copy/email-request-copy.component.html', }) export class EmailRequestCopyComponent - extends BaseComponent { + extends BaseComponent { } diff --git a/src/themes/custom/app/request-copy/grant-request-copy/grant-request-copy.component.ts b/src/themes/custom/app/request-copy/grant-request-copy/grant-request-copy.component.ts index 446044942e..2e4932f152 100644 --- a/src/themes/custom/app/request-copy/grant-request-copy/grant-request-copy.component.ts +++ b/src/themes/custom/app/request-copy/grant-request-copy/grant-request-copy.component.ts @@ -1,15 +1,15 @@ import { Component } from '@angular/core'; import { - GrantRequestCopyComponent as BaseComponent + GrantRequestCopyComponent as BaseComponent } from 'src/app/request-copy/grant-request-copy/grant-request-copy.component'; @Component({ - selector: 'ds-grant-request-copy', - // styleUrls: ['./grant-request-copy.component.scss'], - styleUrls: [], - // templateUrl: './grant-request-copy.component.html', - templateUrl: './../../../../../app/request-copy/grant-request-copy/grant-request-copy.component.html', + selector: 'ds-grant-request-copy', + // styleUrls: ['./grant-request-copy.component.scss'], + styleUrls: [], + // templateUrl: './grant-request-copy.component.html', + templateUrl: './../../../../../app/request-copy/grant-request-copy/grant-request-copy.component.html', }) export class GrantRequestCopyComponent - extends BaseComponent { + extends BaseComponent { } diff --git a/src/themes/custom/app/shared/dso-selector/modal-wrappers/create-collection-parent-selector/create-collection-parent-selector.component.ts b/src/themes/custom/app/shared/dso-selector/modal-wrappers/create-collection-parent-selector/create-collection-parent-selector.component.ts index 22d40ff539..6a1d76508c 100644 --- a/src/themes/custom/app/shared/dso-selector/modal-wrappers/create-collection-parent-selector/create-collection-parent-selector.component.ts +++ b/src/themes/custom/app/shared/dso-selector/modal-wrappers/create-collection-parent-selector/create-collection-parent-selector.component.ts @@ -1,6 +1,6 @@ import { Component } from '@angular/core'; import { - CreateCollectionParentSelectorComponent as BaseComponent + CreateCollectionParentSelectorComponent as BaseComponent } from '../../../../../../../app/shared/dso-selector/modal-wrappers/create-collection-parent-selector/create-collection-parent-selector.component'; @Component({ diff --git a/src/themes/custom/app/shared/dso-selector/modal-wrappers/create-community-parent-selector/create-community-parent-selector.component.ts b/src/themes/custom/app/shared/dso-selector/modal-wrappers/create-community-parent-selector/create-community-parent-selector.component.ts index 8b28ee1bb8..935f00fe94 100644 --- a/src/themes/custom/app/shared/dso-selector/modal-wrappers/create-community-parent-selector/create-community-parent-selector.component.ts +++ b/src/themes/custom/app/shared/dso-selector/modal-wrappers/create-community-parent-selector/create-community-parent-selector.component.ts @@ -1,6 +1,6 @@ import { Component } from '@angular/core'; import { - CreateCommunityParentSelectorComponent as BaseComponent + CreateCommunityParentSelectorComponent as BaseComponent } from '../../../../../../../app/shared/dso-selector/modal-wrappers/create-community-parent-selector/create-community-parent-selector.component'; @Component({ diff --git a/src/themes/custom/app/shared/dso-selector/modal-wrappers/create-item-parent-selector/create-item-parent-selector.component.ts b/src/themes/custom/app/shared/dso-selector/modal-wrappers/create-item-parent-selector/create-item-parent-selector.component.ts index f8e3401454..65a3fb734f 100644 --- a/src/themes/custom/app/shared/dso-selector/modal-wrappers/create-item-parent-selector/create-item-parent-selector.component.ts +++ b/src/themes/custom/app/shared/dso-selector/modal-wrappers/create-item-parent-selector/create-item-parent-selector.component.ts @@ -1,13 +1,13 @@ import {Component} from '@angular/core'; import { - CreateItemParentSelectorComponent as BaseComponent + CreateItemParentSelectorComponent as BaseComponent } from '../../../../../../../app/shared/dso-selector/modal-wrappers/create-item-parent-selector/create-item-parent-selector.component'; @Component({ - selector: 'ds-create-item-parent-selector', - // styleUrls: ['./create-item-parent-selector.component.scss'], - // templateUrl: './create-item-parent-selector.component.html', - templateUrl: '../../../../../../../app/shared/dso-selector/modal-wrappers/create-item-parent-selector/create-item-parent-selector.component.html', + selector: 'ds-create-item-parent-selector', + // styleUrls: ['./create-item-parent-selector.component.scss'], + // templateUrl: './create-item-parent-selector.component.html', + templateUrl: '../../../../../../../app/shared/dso-selector/modal-wrappers/create-item-parent-selector/create-item-parent-selector.component.html', }) export class CreateItemParentSelectorComponent extends BaseComponent { } diff --git a/src/themes/custom/app/shared/dso-selector/modal-wrappers/edit-collection-selector/edit-collection-selector.component.ts b/src/themes/custom/app/shared/dso-selector/modal-wrappers/edit-collection-selector/edit-collection-selector.component.ts index 8f4a8dd5cd..f78ba6ab82 100644 --- a/src/themes/custom/app/shared/dso-selector/modal-wrappers/edit-collection-selector/edit-collection-selector.component.ts +++ b/src/themes/custom/app/shared/dso-selector/modal-wrappers/edit-collection-selector/edit-collection-selector.component.ts @@ -1,6 +1,6 @@ import { Component } from '@angular/core'; import { - EditCollectionSelectorComponent as BaseComponent + EditCollectionSelectorComponent as BaseComponent } from '../../../../../../../app/shared/dso-selector/modal-wrappers/edit-collection-selector/edit-collection-selector.component'; @Component({ diff --git a/src/themes/custom/app/shared/dso-selector/modal-wrappers/edit-community-selector/edit-community-selector.component.ts b/src/themes/custom/app/shared/dso-selector/modal-wrappers/edit-community-selector/edit-community-selector.component.ts index 79d52fc350..831eedcbbe 100644 --- a/src/themes/custom/app/shared/dso-selector/modal-wrappers/edit-community-selector/edit-community-selector.component.ts +++ b/src/themes/custom/app/shared/dso-selector/modal-wrappers/edit-community-selector/edit-community-selector.component.ts @@ -1,6 +1,6 @@ import { Component } from '@angular/core'; import { - EditCommunitySelectorComponent as BaseComponent + EditCommunitySelectorComponent as BaseComponent } from '../../../../../../../app/shared/dso-selector/modal-wrappers/edit-community-selector/edit-community-selector.component'; @Component({ diff --git a/src/themes/custom/app/shared/dso-selector/modal-wrappers/edit-item-selector/edit-item-selector.component.ts b/src/themes/custom/app/shared/dso-selector/modal-wrappers/edit-item-selector/edit-item-selector.component.ts index 398dbc933c..3672d964a2 100644 --- a/src/themes/custom/app/shared/dso-selector/modal-wrappers/edit-item-selector/edit-item-selector.component.ts +++ b/src/themes/custom/app/shared/dso-selector/modal-wrappers/edit-item-selector/edit-item-selector.component.ts @@ -1,6 +1,6 @@ import { Component } from '@angular/core'; import { - EditItemSelectorComponent as BaseComponent + EditItemSelectorComponent as BaseComponent } from 'src/app/shared/dso-selector/modal-wrappers/edit-item-selector/edit-item-selector.component'; @Component({ diff --git a/src/themes/custom/app/submission/sections/upload/file/section-upload-file.component.ts b/src/themes/custom/app/submission/sections/upload/file/section-upload-file.component.ts index 369af4e36c..2fa5d91f4c 100644 --- a/src/themes/custom/app/submission/sections/upload/file/section-upload-file.component.ts +++ b/src/themes/custom/app/submission/sections/upload/file/section-upload-file.component.ts @@ -1,6 +1,6 @@ import { Component } from '@angular/core'; import { - SubmissionSectionUploadFileComponent as BaseComponent + SubmissionSectionUploadFileComponent as BaseComponent } from 'src/app/submission/sections/upload/file/section-upload-file.component'; /** @@ -14,5 +14,5 @@ import { templateUrl: '../../../../../../../app/submission/sections/upload/file/section-upload-file.component.html' }) export class SubmissionSectionUploadFileComponent - extends BaseComponent { + extends BaseComponent { } diff --git a/src/themes/custom/eager-theme.module.ts b/src/themes/custom/eager-theme.module.ts index 7d7f5b3d8b..4fc8be2e12 100644 --- a/src/themes/custom/eager-theme.module.ts +++ b/src/themes/custom/eager-theme.module.ts @@ -21,22 +21,22 @@ import { import { UntypedItemComponent } from './app/item-page/simple/item-types/untyped-item/untyped-item.component'; import { ItemSharedModule } from '../../app/item-page/item-shared.module'; import { - CreateCollectionParentSelectorComponent + CreateCollectionParentSelectorComponent } from './app/shared/dso-selector/modal-wrappers/create-collection-parent-selector/create-collection-parent-selector.component'; import { - CreateCommunityParentSelectorComponent + CreateCommunityParentSelectorComponent } from './app/shared/dso-selector/modal-wrappers/create-community-parent-selector/create-community-parent-selector.component'; import { - CreateItemParentSelectorComponent + CreateItemParentSelectorComponent } from './app/shared/dso-selector/modal-wrappers/create-item-parent-selector/create-item-parent-selector.component'; import { - EditCollectionSelectorComponent + EditCollectionSelectorComponent } from './app/shared/dso-selector/modal-wrappers/edit-collection-selector/edit-collection-selector.component'; import { - EditCommunitySelectorComponent + EditCommunitySelectorComponent } from './app/shared/dso-selector/modal-wrappers/edit-community-selector/edit-community-selector.component'; import { - EditItemSelectorComponent + EditItemSelectorComponent } from './app/shared/dso-selector/modal-wrappers/edit-item-selector/edit-item-selector.component'; import { CommunityListElementComponent } from './app/shared/object-list/community-list-element/community-list-element.component'; import { CollectionListElementComponent} from './app/shared/object-list/collection-list-element/collection-list-element.component'; diff --git a/src/themes/custom/lazy-theme.module.ts b/src/themes/custom/lazy-theme.module.ts index edb3f5478c..cb7f5a71bc 100644 --- a/src/themes/custom/lazy-theme.module.ts +++ b/src/themes/custom/lazy-theme.module.ts @@ -141,13 +141,13 @@ import { } from './app/item-page/media-viewer/media-viewer-video/media-viewer-video.component'; import { NgxGalleryModule } from '@kolkov/ngx-gallery'; import { - DenyRequestCopyComponent + DenyRequestCopyComponent } from './app/request-copy/deny-request-copy/deny-request-copy.component'; import { - EmailRequestCopyComponent + EmailRequestCopyComponent } from './app/request-copy/email-request-copy/email-request-copy.component'; import { - GrantRequestCopyComponent + GrantRequestCopyComponent } from './app/request-copy/grant-request-copy/grant-request-copy.component'; import { WorkspaceItemsDeletePageComponent } from './app/workspace-items-delete-page/workspace-items-delete/workspace-items-delete.component'; import { ThumbnailComponent } from './app/thumbnail/thumbnail.component'; @@ -306,7 +306,7 @@ const DECLARATIONS = [ ] }) - /** +/** * This module serves as an index for all the components in this theme. * It should import all other modules, so the compiler knows where to find any components referenced * from a component in this theme