[CST-9636] Fix lint

This commit is contained in:
Giuseppe Digilio
2023-05-12 09:25:47 +02:00
parent 6808eec3a4
commit 377e27b305
9 changed files with 60 additions and 60 deletions

View File

@@ -69,10 +69,10 @@ describe('BulkAccessBrowseComponent', () => {
it('should have an initial remote data with a paginated list as value', () => { it('should have an initial remote data with a paginated list as value', () => {
const list = buildPaginatedList(new PageInfo({ const list = buildPaginatedList(new PageInfo({
"elementsPerPage": 5, 'elementsPerPage': 5,
"totalElements": 2, 'totalElements': 2,
"totalPages": 1, 'totalPages': 1,
"currentPage": 1 'currentPage': 1
}), [selected1, selected2]) ; }), [selected1, selected2]) ;
const rd = createSuccessfulRemoteDataObject(list); const rd = createSuccessfulRemoteDataObject(list);

View File

@@ -69,7 +69,7 @@ export class BulkAccessBrowseComponent implements OnInit, OnDestroy {
distinctUntilChanged(), distinctUntilChanged(),
map((list: SelectableListState) => this.generatePaginatedListBySelectedElements(list)) map((list: SelectableListState) => this.generatePaginatedListBySelectedElements(list))
).subscribe(this.objectsSelected$) ).subscribe(this.objectsSelected$)
) );
} }
pageNext() { pageNext() {
@@ -87,7 +87,7 @@ export class BulkAccessBrowseComponent implements OnInit, OnDestroy {
private calculatePageCount(pageSize, totalCount = 0) { private calculatePageCount(pageSize, totalCount = 0) {
// we suppose that if we have 0 items we want 1 empty page // we suppose that if we have 0 items we want 1 empty page
return totalCount < pageSize ? 1 : Math.ceil(totalCount / pageSize); return totalCount < pageSize ? 1 : Math.ceil(totalCount / pageSize);
}; }
/** /**
* Generate The RemoteData object containing the list of the selected elements * Generate The RemoteData object containing the list of the selected elements
@@ -114,6 +114,6 @@ export class BulkAccessBrowseComponent implements OnInit, OnDestroy {
this.subs this.subs
.filter((sub) => hasValue(sub)) .filter((sub) => hasValue(sub))
.forEach((sub) => sub.unsubscribe()); .forEach((sub) => sub.unsubscribe());
this.selectableListService.deselectAll(this.listId) this.selectableListService.deselectAll(this.listId);
} }
} }

View File

@@ -24,38 +24,38 @@ fdescribe('BulkAccessComponent', () => {
const bulkAccessControlServiceMock = jasmine.createSpyObj('bulkAccessControlService', ['createPayloadFile', 'executeScript']); const bulkAccessControlServiceMock = jasmine.createSpyObj('bulkAccessControlService', ['createPayloadFile', 'executeScript']);
const mockFormState = { const mockFormState = {
"bitstream": [], 'bitstream': [],
"item": [ 'item': [
{ {
"name": "embargo", 'name': 'embargo',
"startDate": { 'startDate': {
"year": 2026, 'year': 2026,
"month": 5, 'month': 5,
"day": 31 'day': 31
}, },
"endDate": null 'endDate': null
} }
], ],
"state": { 'state': {
"item": { 'item': {
"toggleStatus": true, 'toggleStatus': true,
"accessMode": "replace" 'accessMode': 'replace'
}, },
"bitstream": { 'bitstream': {
"toggleStatus": false, 'toggleStatus': false,
"accessMode": "", 'accessMode': '',
"changesLimit": "", 'changesLimit': '',
"selectedBitstreams": [] 'selectedBitstreams': []
} }
} }
}; };
const mockFile = { const mockFile = {
"uuids": [ 'uuids': [
'1234', '5678' '1234', '5678'
], ],
"file": { } 'file': { }
} };
const mockSettings: any = jasmine.createSpyObj('AccessControlFormContainerComponent', { const mockSettings: any = jasmine.createSpyObj('AccessControlFormContainerComponent', {
getValue: jasmine.createSpy('getValue'), getValue: jasmine.createSpy('getValue'),

View File

@@ -26,7 +26,7 @@ export class BulkAccessComponent implements OnInit {
/** /**
* The selection list id * The selection list id
*/ */
listId: string = 'bulk-access-list'; listId = 'bulk-access-list';
/** /**
* The list of the objects already selected * The list of the objects already selected
@@ -58,7 +58,7 @@ export class BulkAccessComponent implements OnInit {
distinctUntilChanged(), distinctUntilChanged(),
map((list: SelectableListState) => this.generateIdListBySelectedElements(list)) map((list: SelectableListState) => this.generateIdListBySelectedElements(list))
).subscribe(this.objectsSelected$) ).subscribe(this.objectsSelected$)
) );
} }
canExport(): boolean { 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) * This will also reset the state of the child components (bitstream and item access)
*/ */
reset(): void { reset(): void {
this.settings.reset() this.settings.reset();
} }
/** /**

View File

@@ -8,28 +8,28 @@ describe('BulkAccessSettingsComponent', () => {
let component: BulkAccessSettingsComponent; let component: BulkAccessSettingsComponent;
let fixture: ComponentFixture<BulkAccessSettingsComponent>; let fixture: ComponentFixture<BulkAccessSettingsComponent>;
const mockFormState = { const mockFormState = {
"bitstream": [], 'bitstream': [],
"item": [ 'item': [
{ {
"name": "embargo", 'name': 'embargo',
"startDate": { 'startDate': {
"year": 2026, 'year': 2026,
"month": 5, 'month': 5,
"day": 31 'day': 31
}, },
"endDate": null 'endDate': null
} }
], ],
"state": { 'state': {
"item": { 'item': {
"toggleStatus": true, 'toggleStatus': true,
"accessMode": "replace" 'accessMode': 'replace'
}, },
"bitstream": { 'bitstream': {
"toggleStatus": false, 'toggleStatus': false,
"accessMode": "", 'accessMode': '',
"changesLimit": "", 'changesLimit': '',
"selectedBitstreams": [] 'selectedBitstreams': []
} }
} }
}; };
@@ -68,7 +68,7 @@ describe('BulkAccessSettingsComponent', () => {
it('should return the correct form value', () => { it('should return the correct form value', () => {
const expectedValue = mockFormState; const expectedValue = mockFormState;
(component.controlForm as any).getFormValue.and.returnValue(mockFormState) (component.controlForm as any).getFormValue.and.returnValue(mockFormState);
const actualValue = component.getValue(); const actualValue = component.getValue();
expect(actualValue).toEqual(expectedValue); expect(actualValue).toEqual(expectedValue);
}); });

View File

@@ -28,7 +28,7 @@ export class BulkAccessSettingsComponent {
* This will also reset the state of the child components (bitstream and item access) * This will also reset the state of the child components (bitstream and item access)
*/ */
reset() { reset() {
this.controlForm.reset() this.controlForm.reset();
} }
} }

View File

@@ -13,7 +13,7 @@ import { TranslateService } from '@ngx-translate/core';
import { hasValue } from '../../empty.util'; import { hasValue } from '../../empty.util';
import { getFirstCompletedRemoteData } from '../../../core/shared/operators'; 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({ @Component({
selector: 'ds-item-access-control-select-bitstreams-modal', selector: 'ds-item-access-control-select-bitstreams-modal',

View File

@@ -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 { ObjectListComponent } from './object-list.component';
import { ThemedComponent } from '../theme-support/themed.component'; import { ThemedComponent } from '../theme-support/themed.component';
import {PaginationComponentOptions} from '../pagination/pagination-component-options.model'; import { PaginationComponentOptions } from '../pagination/pagination-component-options.model';
import {SortDirection, SortOptions} from '../../core/cache/models/sort-options.model'; import { SortDirection, SortOptions } from '../../core/cache/models/sort-options.model';
import {CollectionElementLinkType} from '../object-collection/collection-element-link.type'; import { CollectionElementLinkType } from '../object-collection/collection-element-link.type';
import {Context} from '../../core/shared/context.model'; import { Context } from '../../core/shared/context.model';
import {RemoteData} from '../../core/data/remote-data'; import { RemoteData } from '../../core/data/remote-data';
import {PaginatedList} from '../../core/data/paginated-list.model'; import { PaginatedList } from '../../core/data/paginated-list.model';
import {ListableObject} from '../object-collection/shared/listable-object.model'; import { ListableObject } from '../object-collection/shared/listable-object.model';
/** /**
* Themed wrapper for ObjectListComponent * Themed wrapper for ObjectListComponent
@@ -53,7 +53,7 @@ export class ThemedObjectListComponent extends ThemedComponent<ObjectListCompone
@Input() selectionConfig: { repeatable: boolean, listId: string }; @Input() selectionConfig: { repeatable: boolean, listId: string };
w /** /**
* The link type of the listable elements * The link type of the listable elements
*/ */
@Input() linkType: CollectionElementLinkType; @Input() linkType: CollectionElementLinkType;

View File

@@ -5348,6 +5348,6 @@
"access-control-add-more": "Add more", "access-control-add-more": "Add more",
"access-control-select-bitstreams-modal.title": "Select bitstreams", "access-control-select-bitstreams-modal.title": "Select bitstreams",
"access-control-select-bitstreams-modal.no-items": "No items to show.", "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",
} }