From 99c41b9e802f267ca96b87e95abb9eff73cc8759 Mon Sep 17 00:00:00 2001 From: Yura Bondarenko Date: Fri, 25 Mar 2022 12:36:14 +0100 Subject: [PATCH] 87968: Minor code changes to pass lint --- scripts/test-rest.ts | 2 +- .../browse-by-metadata-page.component.ts | 6 +++--- .../browse-by-title-page.component.ts | 2 +- .../community-list/themed-community-list.component.ts | 3 ++- src/app/core/auth/auth.service.ts | 8 ++++---- src/app/core/auth/server-auth.service.ts | 2 +- .../filtered-discovery-page-response-parsing.service.ts | 3 ++- .../person-item-metadata-list-element.component.spec.ts | 2 +- .../my-dspace-new-external-dropdown.component.spec.ts | 2 +- .../my-dspace-new-submission-dropdown.component.spec.ts | 2 +- .../my-dspace-new-submission.component.spec.ts | 2 +- src/app/shared/animations/slide.ts | 6 ++---- .../models/lookup/dynamic-lookup.component.ts | 2 +- .../models/onebox/dynamic-onebox.component.ts | 4 ++-- .../models/tag/dynamic-tag.component.ts | 2 +- .../input-suggestions/input-suggestions.component.ts | 4 ++-- src/app/shared/menu/menu.effects.ts | 1 - .../notifications/notification/notification.component.ts | 2 +- src/app/shared/object-select/object-select.reducer.ts | 4 ++-- src/app/shared/testing/auth-service.stub.ts | 4 ++-- src/app/shared/theme-support/themed.component.ts | 2 +- src/app/shared/uploader/uploader.component.spec.ts | 2 +- .../vocabulary-treeview/vocabulary-treeview.component.ts | 2 +- .../submission-upload-files.component.ts | 2 +- src/app/submission/objects/submission-objects.effects.ts | 1 - src/config/config.server.ts | 2 +- src/typings.d.ts | 6 +++--- 27 files changed, 39 insertions(+), 41 deletions(-) diff --git a/scripts/test-rest.ts b/scripts/test-rest.ts index aa3b64f62b6..b2a3ebd1af7 100644 --- a/scripts/test-rest.ts +++ b/scripts/test-rest.ts @@ -3,7 +3,7 @@ import * as https from 'https'; import { AppConfig } from '../src/config/app-config.interface'; import { buildAppConfig } from '../src/config/config.server'; - + const appConfig: AppConfig = buildAppConfig(); /** 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 f789389697e..8f9eaa16bc1 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 @@ -127,10 +127,10 @@ export class BrowseByMetadataPageComponent implements OnInit { return [Object.assign({}, routeParams, queryParams),currentPage,currentSort]; }) ).subscribe(([params, currentPage, currentSort]: [Params, PaginationComponentOptions, SortOptions]) => { - this.browseId = params.id || this.defaultBrowseId; + this.browseId = params.id || this.defaultBrowseId; this.authority = params.authority; - this.value = +params.value || params.value || ''; - this.startsWith = +params.startsWith || params.startsWith; + this.value = +params.value || params.value || ''; + this.startsWith = +params.startsWith || params.startsWith; const searchOptions = browseParamsToOptions(params, currentPage, currentSort, this.browseId); if (isNotEmpty(this.value)) { this.updatePageWithItems(searchOptions, this.value, this.authority); diff --git a/src/app/browse-by/browse-by-title-page/browse-by-title-page.component.ts b/src/app/browse-by/browse-by-title-page/browse-by-title-page.component.ts index b2798b7fa8f..79492a499b3 100644 --- a/src/app/browse-by/browse-by-title-page/browse-by-title-page.component.ts +++ b/src/app/browse-by/browse-by-title-page/browse-by-title-page.component.ts @@ -45,7 +45,7 @@ export class BrowseByTitlePageComponent extends BrowseByMetadataPageComponent { return [Object.assign({}, routeParams, queryParams),currentPage,currentSort]; }) ).subscribe(([params, currentPage, currentSort]: [Params, PaginationComponentOptions, SortOptions]) => { - this.browseId = params.id || this.defaultBrowseId; + this.browseId = params.id || this.defaultBrowseId; this.updatePageWithItems(browseParamsToOptions(params, currentPage, currentSort, this.browseId), undefined, undefined); this.updateParent(params.scope); })); diff --git a/src/app/community-list-page/community-list/themed-community-list.component.ts b/src/app/community-list-page/community-list/themed-community-list.component.ts index adbfed85f3f..4a986e737c1 100644 --- a/src/app/community-list-page/community-list/themed-community-list.component.ts +++ b/src/app/community-list-page/community-list/themed-community-list.component.ts @@ -7,7 +7,8 @@ import { Component } from '@angular/core'; selector: 'ds-themed-community-list', styleUrls: [], templateUrl: '../../shared/theme-support/themed.component.html', -})export class ThemedCommunityListComponent extends ThemedComponent { +}) +export class ThemedCommunityListComponent extends ThemedComponent { protected getComponentName(): string { return 'CommunityListComponent'; } diff --git a/src/app/core/auth/auth.service.ts b/src/app/core/auth/auth.service.ts index 5738948ebd3..f89fa21681c 100644 --- a/src/app/core/auth/auth.service.ts +++ b/src/app/core/auth/auth.service.ts @@ -112,7 +112,7 @@ export class AuthService { if (hasValue(rd.payload) && rd.payload.authenticated) { return rd.payload; } else { - throw(new Error('Invalid email or password')); + throw (new Error('Invalid email or password')); } })); @@ -166,7 +166,7 @@ export class AuthService { if (hasValue(status) && status.authenticated) { return status._links.eperson.href; } else { - throw(new Error('Not authenticated')); + throw (new Error('Not authenticated')); } })); } @@ -249,7 +249,7 @@ export class AuthService { if (hasValue(status) && status.authenticated) { return status.token; } else { - throw(new Error('Not authenticated')); + throw (new Error('Not authenticated')); } })); } @@ -288,7 +288,7 @@ export class AuthService { if (hasValue(status) && !status.authenticated) { return true; } else { - throw(new Error('auth.errors.invalid-user')); + throw (new Error('auth.errors.invalid-user')); } })); } diff --git a/src/app/core/auth/server-auth.service.ts b/src/app/core/auth/server-auth.service.ts index ea5a3b41f2d..fc8ab18bfb6 100644 --- a/src/app/core/auth/server-auth.service.ts +++ b/src/app/core/auth/server-auth.service.ts @@ -36,7 +36,7 @@ export class ServerAuthService extends AuthService { if (hasValue(status) && status.authenticated) { return status._links.eperson.href; } else { - throw(new Error('Not authenticated')); + throw (new Error('Not authenticated')); } })); } diff --git a/src/app/core/data/filtered-discovery-page-response-parsing.service.ts b/src/app/core/data/filtered-discovery-page-response-parsing.service.ts index 7a2ff7962d5..913966ae51a 100644 --- a/src/app/core/data/filtered-discovery-page-response-parsing.service.ts +++ b/src/app/core/data/filtered-discovery-page-response-parsing.service.ts @@ -16,7 +16,8 @@ export class FilteredDiscoveryPageResponseParsingService extends BaseResponsePar toCache = false; constructor( protected objectCache: ObjectCacheService, - ) { super(); + ) { + super(); } /** diff --git a/src/app/entity-groups/research-entities/metadata-representations/person/person-item-metadata-list-element.component.spec.ts b/src/app/entity-groups/research-entities/metadata-representations/person/person-item-metadata-list-element.component.spec.ts index ab801826d60..895cf522230 100644 --- a/src/app/entity-groups/research-entities/metadata-representations/person/person-item-metadata-list-element.component.spec.ts +++ b/src/app/entity-groups/research-entities/metadata-representations/person/person-item-metadata-list-element.component.spec.ts @@ -9,7 +9,7 @@ import { Item } from '../../../../core/shared/item.model'; import { PersonItemMetadataListElementComponent } from './person-item-metadata-list-element.component'; import { MetadataValue } from '../../../../core/shared/metadata.models'; -const jobTitle ='Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua.'; +const jobTitle = 'Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua.'; const firstName = 'Joe'; const lastName = 'Anonymous'; const mockItem = Object.assign(new Item(), { metadata: { 'person.jobTitle': [{ value: jobTitle }], 'person.givenName': [{ value: firstName }], 'person.familyName': [{ value: lastName }] } }); diff --git a/src/app/my-dspace-page/my-dspace-new-submission/my-dspace-new-external-dropdown/my-dspace-new-external-dropdown.component.spec.ts b/src/app/my-dspace-page/my-dspace-new-submission/my-dspace-new-external-dropdown/my-dspace-new-external-dropdown.component.spec.ts index 780d2a2cb17..30d42493a04 100644 --- a/src/app/my-dspace-page/my-dspace-new-submission/my-dspace-new-external-dropdown/my-dspace-new-external-dropdown.component.spec.ts +++ b/src/app/my-dspace-page/my-dspace-new-submission/my-dspace-new-external-dropdown/my-dspace-new-external-dropdown.component.spec.ts @@ -185,5 +185,5 @@ describe('MyDSpaceNewExternalDropdownComponent test', () => { class TestComponent { reload = (event) => { return; - } + }; } diff --git a/src/app/my-dspace-page/my-dspace-new-submission/my-dspace-new-submission-dropdown/my-dspace-new-submission-dropdown.component.spec.ts b/src/app/my-dspace-page/my-dspace-new-submission/my-dspace-new-submission-dropdown/my-dspace-new-submission-dropdown.component.spec.ts index a13acd05012..dcfac94fa05 100644 --- a/src/app/my-dspace-page/my-dspace-new-submission/my-dspace-new-submission-dropdown/my-dspace-new-submission-dropdown.component.spec.ts +++ b/src/app/my-dspace-page/my-dspace-new-submission/my-dspace-new-submission-dropdown/my-dspace-new-submission-dropdown.component.spec.ts @@ -190,5 +190,5 @@ describe('MyDSpaceNewSubmissionDropdownComponent test', () => { class TestComponent { reload = (event) => { return; - } + }; } diff --git a/src/app/my-dspace-page/my-dspace-new-submission/my-dspace-new-submission.component.spec.ts b/src/app/my-dspace-page/my-dspace-new-submission/my-dspace-new-submission.component.spec.ts index fb8ecbf65c2..4ce6d7c81bb 100644 --- a/src/app/my-dspace-page/my-dspace-new-submission/my-dspace-new-submission.component.spec.ts +++ b/src/app/my-dspace-page/my-dspace-new-submission/my-dspace-new-submission.component.spec.ts @@ -124,5 +124,5 @@ class TestComponent { reload = (event) => { return; - } + }; } diff --git a/src/app/shared/animations/slide.ts b/src/app/shared/animations/slide.ts index 7928a25659e..814dc22e86d 100644 --- a/src/app/shared/animations/slide.ts +++ b/src/app/shared/animations/slide.ts @@ -33,8 +33,7 @@ const options = { params: { sidebarWidth: '*' } }; export const slideSidebar = trigger('slideSidebar', [ transition('expanded => collapsed', - group - ( + group( [ query('@*', animateChild()), query('.sidebar-collapsible', expandedStyle, options), @@ -43,8 +42,7 @@ export const slideSidebar = trigger('slideSidebar', [ )), transition('collapsed => expanded', - group - ( + group( [ query('@*', animateChild()), query('.sidebar-collapsible', collapsedStyle), diff --git a/src/app/shared/form/builder/ds-dynamic-form-ui/models/lookup/dynamic-lookup.component.ts b/src/app/shared/form/builder/ds-dynamic-form-ui/models/lookup/dynamic-lookup.component.ts index 204a364ce7b..39937048955 100644 --- a/src/app/shared/form/builder/ds-dynamic-form-ui/models/lookup/dynamic-lookup.component.ts +++ b/src/app/shared/form/builder/ds-dynamic-form-ui/models/lookup/dynamic-lookup.component.ts @@ -59,7 +59,7 @@ export class DsDynamicLookupComponent extends DsDynamicVocabularyComponent imple */ inputFormatter = (x: { display: string }, y: number) => { return y === 1 ? this.firstInputValue : this.secondInputValue; - } + }; /** * Initialize the component, setting up the init form value diff --git a/src/app/shared/form/builder/ds-dynamic-form-ui/models/onebox/dynamic-onebox.component.ts b/src/app/shared/form/builder/ds-dynamic-form-ui/models/onebox/dynamic-onebox.component.ts index 137775b30c5..9d2799177c6 100644 --- a/src/app/shared/form/builder/ds-dynamic-form-ui/models/onebox/dynamic-onebox.component.ts +++ b/src/app/shared/form/builder/ds-dynamic-form-ui/models/onebox/dynamic-onebox.component.ts @@ -80,7 +80,7 @@ export class DsDynamicOneboxComponent extends DsDynamicVocabularyComponent imple */ formatter = (x: { display: string }) => { return (typeof x === 'object') ? x.display : x; - } + }; /** * Converts a stream of text values from the `` element to the stream of the array of items @@ -116,7 +116,7 @@ export class DsDynamicOneboxComponent extends DsDynamicVocabularyComponent imple tap(() => this.changeSearchingStatus(false)), merge(this.hideSearchingWhenUnsubscribed$) ); - } + }; /** * Initialize the component, setting up the init form value diff --git a/src/app/shared/form/builder/ds-dynamic-form-ui/models/tag/dynamic-tag.component.ts b/src/app/shared/form/builder/ds-dynamic-form-ui/models/tag/dynamic-tag.component.ts index 96fe8a762d3..ef5e84e5015 100644 --- a/src/app/shared/form/builder/ds-dynamic-form-ui/models/tag/dynamic-tag.component.ts +++ b/src/app/shared/form/builder/ds-dynamic-form-ui/models/tag/dynamic-tag.component.ts @@ -90,7 +90,7 @@ export class DsDynamicTagComponent extends DsDynamicVocabularyComponent implemen }), map((list: PaginatedList) => list.page), tap(() => this.changeSearchingStatus(false)), - merge(this.hideSearchingWhenUnsubscribed)) + merge(this.hideSearchingWhenUnsubscribed)); /** * Initialize the component, setting up the init form value diff --git a/src/app/shared/input-suggestions/input-suggestions.component.ts b/src/app/shared/input-suggestions/input-suggestions.component.ts index 7b5c9f34f2a..7e05dbcc8c6 100644 --- a/src/app/shared/input-suggestions/input-suggestions.component.ts +++ b/src/app/shared/input-suggestions/input-suggestions.component.ts @@ -111,10 +111,10 @@ export class InputSuggestionsComponent implements ControlValueAccessor, OnChange @Input() disabled = false; propagateChange = (_: any) => { /* Empty implementation */ - } + }; propagateTouch = (_: any) => { /* Empty implementation */ - } + }; /** * When any of the inputs change, check if we should still show the suggestions diff --git a/src/app/shared/menu/menu.effects.ts b/src/app/shared/menu/menu.effects.ts index 8baea9a374a..87b5333679a 100644 --- a/src/app/shared/menu/menu.effects.ts +++ b/src/app/shared/menu/menu.effects.ts @@ -19,7 +19,6 @@ export class MenuEffects { /** * On route change, build menu sections for every menu type depending on the current route data */ - public buildRouteMenuSections$: Observable = createEffect(() => this.actions$ .pipe( ofType(ROUTER_NAVIGATED), diff --git a/src/app/shared/notifications/notification/notification.component.ts b/src/app/shared/notifications/notification/notification.component.ts index 5f000847610..6dbda23e611 100644 --- a/src/app/shared/notifications/notification/notification.component.ts +++ b/src/app/shared/notifications/notification/notification.component.ts @@ -120,7 +120,7 @@ export class NotificationComponent implements OnInit, OnDestroy { } this.zone.run(() => this.cdr.detectChanges()); }); - } + }; public remove() { if (this.animate) { diff --git a/src/app/shared/object-select/object-select.reducer.ts b/src/app/shared/object-select/object-select.reducer.ts index 48a638fec6c..0157ef0be3e 100644 --- a/src/app/shared/object-select/object-select.reducer.ts +++ b/src/app/shared/object-select/object-select.reducer.ts @@ -35,7 +35,7 @@ export function objectSelectionReducer(state = initialState, action: ObjectSelec switch (action.type) { case ObjectSelectionActionTypes.INITIAL_SELECT: { - if (isEmpty(state) || isEmpty(state[action.key]) || isEmpty(state[action.key][action.id])) { + if (isEmpty(state) || isEmpty(state[action.key]) || isEmpty(state[action.key][action.id])) { return Object.assign({}, state, { [action.key]: Object.assign({}, state[action.key], { [action.id]: { @@ -48,7 +48,7 @@ export function objectSelectionReducer(state = initialState, action: ObjectSelec } case ObjectSelectionActionTypes.INITIAL_DESELECT: { - if (isEmpty(state) || isEmpty(state[action.key]) || isEmpty(state[action.key][action.id])) { + if (isEmpty(state) || isEmpty(state[action.key]) || isEmpty(state[action.key][action.id])) { return Object.assign({}, state, { [action.key]: Object.assign({}, state[action.key], { [action.id]: { diff --git a/src/app/shared/testing/auth-service.stub.ts b/src/app/shared/testing/auth-service.stub.ts index 3fa09b2b7e9..b8d822252d7 100644 --- a/src/app/shared/testing/auth-service.stub.ts +++ b/src/app/shared/testing/auth-service.stub.ts @@ -33,7 +33,7 @@ export class AuthServiceStub { return observableOf(authStatus); } else { console.log('error'); - throw(new Error('Message Error test')); + throw (new Error('Message Error test')); } } @@ -41,7 +41,7 @@ export class AuthServiceStub { if (token.accessToken === 'token_test') { return observableOf(EPersonMock._links.self.href); } else { - throw(new Error('Message Error test')); + throw (new Error('Message Error test')); } } diff --git a/src/app/shared/theme-support/themed.component.ts b/src/app/shared/theme-support/themed.component.ts index 7ddd76f1d3d..87f182a5ffb 100644 --- a/src/app/shared/theme-support/themed.component.ts +++ b/src/app/shared/theme-support/themed.component.ts @@ -46,7 +46,7 @@ export abstract class ThemedComponent implements OnInit, OnDestroy, OnChanges // if an input or output has changed if (this.inAndOutputNames.some((name: any) => hasValue(changes[name]))) { this.connectInputsAndOutputs(); - if (this.compRef?.instance && 'ngOnChanges' in this.compRef?.instance) { + if (this.compRef?.instance && 'ngOnChanges' in this.compRef.instance) { (this.compRef.instance as any).ngOnChanges(changes); } } diff --git a/src/app/shared/uploader/uploader.component.spec.ts b/src/app/shared/uploader/uploader.component.spec.ts index 883173f0f4c..84fee2e147f 100644 --- a/src/app/shared/uploader/uploader.component.spec.ts +++ b/src/app/shared/uploader/uploader.component.spec.ts @@ -79,7 +79,7 @@ class TestComponent { /* eslint-disable no-empty,@typescript-eslint/no-empty-function */ public onBeforeUpload = () => { - } + }; onCompleteItem(event) { } diff --git a/src/app/shared/vocabulary-treeview/vocabulary-treeview.component.ts b/src/app/shared/vocabulary-treeview/vocabulary-treeview.component.ts index 41ba7751716..9eb4bb860c6 100644 --- a/src/app/shared/vocabulary-treeview/vocabulary-treeview.component.ts +++ b/src/app/shared/vocabulary-treeview/vocabulary-treeview.component.ts @@ -161,7 +161,7 @@ export class VocabularyTreeviewComponent implements OnDestroy, OnInit { this.treeControl.expand(newNode); } return newNode; - } + }; /** * Get tree level for a given node 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 fa81fe2bbd7..a56b371456f 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 @@ -83,7 +83,7 @@ export class SubmissionUploadFilesComponent implements OnChanges { .subscribe(); this.subs.push(sub); return sub; - } + }; /** * Initialize instance variables diff --git a/src/app/submission/objects/submission-objects.effects.ts b/src/app/submission/objects/submission-objects.effects.ts index 95028c0e494..52e20ee149a 100644 --- a/src/app/submission/objects/submission-objects.effects.ts +++ b/src/app/submission/objects/submission-objects.effects.ts @@ -303,7 +303,6 @@ export class SubmissionObjectEffects { /** * Show a notification on success and redirect to MyDSpace page */ - discardSubmissionSuccess$ = createEffect(() => this.actions$.pipe( ofType(SubmissionObjectActionTypes.DISCARD_SUBMISSION_SUCCESS), tap(() => this.notificationsService.success(null, this.translate.get('submission.sections.general.discard_success_notice'))), diff --git a/src/config/config.server.ts b/src/config/config.server.ts index 11b75a52116..69da1a02b2c 100644 --- a/src/config/config.server.ts +++ b/src/config/config.server.ts @@ -73,7 +73,7 @@ const getLocalConfigPath = (env: Environment) => { break; case 'development': default: - envVariations = ['dev', 'development'] + envVariations = ['dev', 'development']; } // check if any environment variations of app config exist diff --git a/src/typings.d.ts b/src/typings.d.ts index b9d1b9e9dfc..c1c86511f88 100644 --- a/src/typings.d.ts +++ b/src/typings.d.ts @@ -31,14 +31,14 @@ declare module 'modern-lru' { export = x; } -declare var System: SystemJS; +declare let System: SystemJS; interface SystemJS { import: (path?: string) => Promise; } // Extra variables that live on Global that will be replaced by webpack DefinePlugin -declare var ENV: string; -declare var HMR: boolean; +declare let ENV: string; +declare let HMR: boolean; interface GlobalEnvironment { ENV; HMR;