mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-07 01:54:15 +00:00
[CST-9636] Fix lint
This commit is contained in:
@@ -69,10 +69,10 @@ describe('BulkAccessBrowseComponent', () => {
|
||||
|
||||
it('should have an initial remote data with a paginated list as value', () => {
|
||||
const list = buildPaginatedList(new PageInfo({
|
||||
"elementsPerPage": 5,
|
||||
"totalElements": 2,
|
||||
"totalPages": 1,
|
||||
"currentPage": 1
|
||||
'elementsPerPage': 5,
|
||||
'totalElements': 2,
|
||||
'totalPages': 1,
|
||||
'currentPage': 1
|
||||
}), [selected1, selected2]) ;
|
||||
const rd = createSuccessfulRemoteDataObject(list);
|
||||
|
||||
|
@@ -69,7 +69,7 @@ export class BulkAccessBrowseComponent implements OnInit, OnDestroy {
|
||||
distinctUntilChanged(),
|
||||
map((list: SelectableListState) => this.generatePaginatedListBySelectedElements(list))
|
||||
).subscribe(this.objectsSelected$)
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
pageNext() {
|
||||
@@ -87,7 +87,7 @@ export class BulkAccessBrowseComponent implements OnInit, OnDestroy {
|
||||
private calculatePageCount(pageSize, totalCount = 0) {
|
||||
// we suppose that if we have 0 items we want 1 empty page
|
||||
return totalCount < pageSize ? 1 : Math.ceil(totalCount / pageSize);
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Generate The RemoteData object containing the list of the selected elements
|
||||
@@ -114,6 +114,6 @@ export class BulkAccessBrowseComponent implements OnInit, OnDestroy {
|
||||
this.subs
|
||||
.filter((sub) => hasValue(sub))
|
||||
.forEach((sub) => sub.unsubscribe());
|
||||
this.selectableListService.deselectAll(this.listId)
|
||||
this.selectableListService.deselectAll(this.listId);
|
||||
}
|
||||
}
|
||||
|
@@ -24,38 +24,38 @@ fdescribe('BulkAccessComponent', () => {
|
||||
const bulkAccessControlServiceMock = jasmine.createSpyObj('bulkAccessControlService', ['createPayloadFile', 'executeScript']);
|
||||
|
||||
const mockFormState = {
|
||||
"bitstream": [],
|
||||
"item": [
|
||||
'bitstream': [],
|
||||
'item': [
|
||||
{
|
||||
"name": "embargo",
|
||||
"startDate": {
|
||||
"year": 2026,
|
||||
"month": 5,
|
||||
"day": 31
|
||||
'name': 'embargo',
|
||||
'startDate': {
|
||||
'year': 2026,
|
||||
'month': 5,
|
||||
'day': 31
|
||||
},
|
||||
"endDate": null
|
||||
'endDate': null
|
||||
}
|
||||
],
|
||||
"state": {
|
||||
"item": {
|
||||
"toggleStatus": true,
|
||||
"accessMode": "replace"
|
||||
'state': {
|
||||
'item': {
|
||||
'toggleStatus': true,
|
||||
'accessMode': 'replace'
|
||||
},
|
||||
"bitstream": {
|
||||
"toggleStatus": false,
|
||||
"accessMode": "",
|
||||
"changesLimit": "",
|
||||
"selectedBitstreams": []
|
||||
'bitstream': {
|
||||
'toggleStatus': false,
|
||||
'accessMode': '',
|
||||
'changesLimit': '',
|
||||
'selectedBitstreams': []
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
const mockFile = {
|
||||
"uuids": [
|
||||
'uuids': [
|
||||
'1234', '5678'
|
||||
],
|
||||
"file": { }
|
||||
}
|
||||
'file': { }
|
||||
};
|
||||
|
||||
const mockSettings: any = jasmine.createSpyObj('AccessControlFormContainerComponent', {
|
||||
getValue: jasmine.createSpy('getValue'),
|
||||
|
@@ -26,7 +26,7 @@ export class BulkAccessComponent implements OnInit {
|
||||
/**
|
||||
* The selection list id
|
||||
*/
|
||||
listId: string = 'bulk-access-list';
|
||||
listId = 'bulk-access-list';
|
||||
|
||||
/**
|
||||
* The list of the objects already selected
|
||||
@@ -58,7 +58,7 @@ export class BulkAccessComponent implements OnInit {
|
||||
distinctUntilChanged(),
|
||||
map((list: SelectableListState) => this.generateIdListBySelectedElements(list))
|
||||
).subscribe(this.objectsSelected$)
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
canExport(): boolean {
|
||||
@@ -70,7 +70,7 @@ export class BulkAccessComponent implements OnInit {
|
||||
* This will also reset the state of the child components (bitstream and item access)
|
||||
*/
|
||||
reset(): void {
|
||||
this.settings.reset()
|
||||
this.settings.reset();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -8,28 +8,28 @@ describe('BulkAccessSettingsComponent', () => {
|
||||
let component: BulkAccessSettingsComponent;
|
||||
let fixture: ComponentFixture<BulkAccessSettingsComponent>;
|
||||
const mockFormState = {
|
||||
"bitstream": [],
|
||||
"item": [
|
||||
'bitstream': [],
|
||||
'item': [
|
||||
{
|
||||
"name": "embargo",
|
||||
"startDate": {
|
||||
"year": 2026,
|
||||
"month": 5,
|
||||
"day": 31
|
||||
'name': 'embargo',
|
||||
'startDate': {
|
||||
'year': 2026,
|
||||
'month': 5,
|
||||
'day': 31
|
||||
},
|
||||
"endDate": null
|
||||
'endDate': null
|
||||
}
|
||||
],
|
||||
"state": {
|
||||
"item": {
|
||||
"toggleStatus": true,
|
||||
"accessMode": "replace"
|
||||
'state': {
|
||||
'item': {
|
||||
'toggleStatus': true,
|
||||
'accessMode': 'replace'
|
||||
},
|
||||
"bitstream": {
|
||||
"toggleStatus": false,
|
||||
"accessMode": "",
|
||||
"changesLimit": "",
|
||||
"selectedBitstreams": []
|
||||
'bitstream': {
|
||||
'toggleStatus': false,
|
||||
'accessMode': '',
|
||||
'changesLimit': '',
|
||||
'selectedBitstreams': []
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -68,7 +68,7 @@ describe('BulkAccessSettingsComponent', () => {
|
||||
|
||||
it('should return the correct form value', () => {
|
||||
const expectedValue = mockFormState;
|
||||
(component.controlForm as any).getFormValue.and.returnValue(mockFormState)
|
||||
(component.controlForm as any).getFormValue.and.returnValue(mockFormState);
|
||||
const actualValue = component.getValue();
|
||||
expect(actualValue).toEqual(expectedValue);
|
||||
});
|
||||
|
@@ -28,7 +28,7 @@ export class BulkAccessSettingsComponent {
|
||||
* This will also reset the state of the child components (bitstream and item access)
|
||||
*/
|
||||
reset() {
|
||||
this.controlForm.reset()
|
||||
this.controlForm.reset();
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -13,7 +13,7 @@ import { TranslateService } from '@ngx-translate/core';
|
||||
import { hasValue } from '../../empty.util';
|
||||
import { getFirstCompletedRemoteData } from '../../../core/shared/operators';
|
||||
|
||||
export const ITEM_ACCESS_CONTROL_SELECT_BITSTREAMS_LIST_ID = 'item-access-control-select-bitstreams'
|
||||
export const ITEM_ACCESS_CONTROL_SELECT_BITSTREAMS_LIST_ID = 'item-access-control-select-bitstreams';
|
||||
|
||||
@Component({
|
||||
selector: 'ds-item-access-control-select-bitstreams-modal',
|
||||
|
@@ -1,13 +1,13 @@
|
||||
import {Component, EventEmitter, Input, Output} from '@angular/core';
|
||||
import { Component, EventEmitter, Input, Output } from '@angular/core';
|
||||
import { ObjectListComponent } from './object-list.component';
|
||||
import { ThemedComponent } from '../theme-support/themed.component';
|
||||
import {PaginationComponentOptions} from '../pagination/pagination-component-options.model';
|
||||
import {SortDirection, SortOptions} from '../../core/cache/models/sort-options.model';
|
||||
import {CollectionElementLinkType} from '../object-collection/collection-element-link.type';
|
||||
import {Context} from '../../core/shared/context.model';
|
||||
import {RemoteData} from '../../core/data/remote-data';
|
||||
import {PaginatedList} from '../../core/data/paginated-list.model';
|
||||
import {ListableObject} from '../object-collection/shared/listable-object.model';
|
||||
import { PaginationComponentOptions } from '../pagination/pagination-component-options.model';
|
||||
import { SortDirection, SortOptions } from '../../core/cache/models/sort-options.model';
|
||||
import { CollectionElementLinkType } from '../object-collection/collection-element-link.type';
|
||||
import { Context } from '../../core/shared/context.model';
|
||||
import { RemoteData } from '../../core/data/remote-data';
|
||||
import { PaginatedList } from '../../core/data/paginated-list.model';
|
||||
import { ListableObject } from '../object-collection/shared/listable-object.model';
|
||||
|
||||
/**
|
||||
* Themed wrapper for ObjectListComponent
|
||||
@@ -53,7 +53,7 @@ export class ThemedObjectListComponent extends ThemedComponent<ObjectListCompone
|
||||
|
||||
@Input() selectionConfig: { repeatable: boolean, listId: string };
|
||||
|
||||
w /**
|
||||
/**
|
||||
* The link type of the listable elements
|
||||
*/
|
||||
@Input() linkType: CollectionElementLinkType;
|
||||
|
@@ -5348,6 +5348,6 @@
|
||||
"access-control-add-more": "Add more",
|
||||
"access-control-select-bitstreams-modal.title": "Select bitstreams",
|
||||
"access-control-select-bitstreams-modal.no-items": "No items to show.",
|
||||
"access-control-select-bitstreams-modal.close": "Close"
|
||||
"access-control-select-bitstreams-modal.close": "Close",
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user