87968: Minor code changes to pass lint

This commit is contained in:
Yura Bondarenko
2022-03-25 12:36:14 +01:00
parent bb51609af9
commit 99c41b9e80
27 changed files with 39 additions and 41 deletions

View File

@@ -127,10 +127,10 @@ export class BrowseByMetadataPageComponent implements OnInit {
return [Object.assign({}, routeParams, queryParams),currentPage,currentSort]; return [Object.assign({}, routeParams, queryParams),currentPage,currentSort];
}) })
).subscribe(([params, currentPage, currentSort]: [Params, PaginationComponentOptions, SortOptions]) => { ).subscribe(([params, currentPage, currentSort]: [Params, PaginationComponentOptions, SortOptions]) => {
this.browseId = params.id || this.defaultBrowseId; this.browseId = params.id || this.defaultBrowseId;
this.authority = params.authority; this.authority = params.authority;
this.value = +params.value || params.value || ''; this.value = +params.value || params.value || '';
this.startsWith = +params.startsWith || params.startsWith; this.startsWith = +params.startsWith || params.startsWith;
const searchOptions = browseParamsToOptions(params, currentPage, currentSort, this.browseId); const searchOptions = browseParamsToOptions(params, currentPage, currentSort, this.browseId);
if (isNotEmpty(this.value)) { if (isNotEmpty(this.value)) {
this.updatePageWithItems(searchOptions, this.value, this.authority); this.updatePageWithItems(searchOptions, this.value, this.authority);

View File

@@ -45,7 +45,7 @@ export class BrowseByTitlePageComponent extends BrowseByMetadataPageComponent {
return [Object.assign({}, routeParams, queryParams),currentPage,currentSort]; return [Object.assign({}, routeParams, queryParams),currentPage,currentSort];
}) })
).subscribe(([params, currentPage, currentSort]: [Params, PaginationComponentOptions, SortOptions]) => { ).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.updatePageWithItems(browseParamsToOptions(params, currentPage, currentSort, this.browseId), undefined, undefined);
this.updateParent(params.scope); this.updateParent(params.scope);
})); }));

View File

@@ -7,7 +7,8 @@ import { Component } from '@angular/core';
selector: 'ds-themed-community-list', selector: 'ds-themed-community-list',
styleUrls: [], styleUrls: [],
templateUrl: '../../shared/theme-support/themed.component.html', templateUrl: '../../shared/theme-support/themed.component.html',
})export class ThemedCommunityListComponent extends ThemedComponent<CommunityListComponent> { })
export class ThemedCommunityListComponent extends ThemedComponent<CommunityListComponent> {
protected getComponentName(): string { protected getComponentName(): string {
return 'CommunityListComponent'; return 'CommunityListComponent';
} }

View File

@@ -112,7 +112,7 @@ export class AuthService {
if (hasValue(rd.payload) && rd.payload.authenticated) { if (hasValue(rd.payload) && rd.payload.authenticated) {
return rd.payload; return rd.payload;
} else { } 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) { if (hasValue(status) && status.authenticated) {
return status._links.eperson.href; return status._links.eperson.href;
} else { } else {
throw(new Error('Not authenticated')); throw (new Error('Not authenticated'));
} }
})); }));
} }
@@ -249,7 +249,7 @@ export class AuthService {
if (hasValue(status) && status.authenticated) { if (hasValue(status) && status.authenticated) {
return status.token; return status.token;
} else { } else {
throw(new Error('Not authenticated')); throw (new Error('Not authenticated'));
} }
})); }));
} }
@@ -288,7 +288,7 @@ export class AuthService {
if (hasValue(status) && !status.authenticated) { if (hasValue(status) && !status.authenticated) {
return true; return true;
} else { } else {
throw(new Error('auth.errors.invalid-user')); throw (new Error('auth.errors.invalid-user'));
} }
})); }));
} }

View File

@@ -36,7 +36,7 @@ export class ServerAuthService extends AuthService {
if (hasValue(status) && status.authenticated) { if (hasValue(status) && status.authenticated) {
return status._links.eperson.href; return status._links.eperson.href;
} else { } else {
throw(new Error('Not authenticated')); throw (new Error('Not authenticated'));
} }
})); }));
} }

View File

@@ -16,7 +16,8 @@ export class FilteredDiscoveryPageResponseParsingService extends BaseResponsePar
toCache = false; toCache = false;
constructor( constructor(
protected objectCache: ObjectCacheService, protected objectCache: ObjectCacheService,
) { super(); ) {
super();
} }
/** /**

View File

@@ -9,7 +9,7 @@ import { Item } from '../../../../core/shared/item.model';
import { PersonItemMetadataListElementComponent } from './person-item-metadata-list-element.component'; import { PersonItemMetadataListElementComponent } from './person-item-metadata-list-element.component';
import { MetadataValue } from '../../../../core/shared/metadata.models'; 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 firstName = 'Joe';
const lastName = 'Anonymous'; const lastName = 'Anonymous';
const mockItem = Object.assign(new Item(), { metadata: { 'person.jobTitle': [{ value: jobTitle }], 'person.givenName': [{ value: firstName }], 'person.familyName': [{ value: lastName }] } }); const mockItem = Object.assign(new Item(), { metadata: { 'person.jobTitle': [{ value: jobTitle }], 'person.givenName': [{ value: firstName }], 'person.familyName': [{ value: lastName }] } });

View File

@@ -185,5 +185,5 @@ describe('MyDSpaceNewExternalDropdownComponent test', () => {
class TestComponent { class TestComponent {
reload = (event) => { reload = (event) => {
return; return;
} };
} }

View File

@@ -190,5 +190,5 @@ describe('MyDSpaceNewSubmissionDropdownComponent test', () => {
class TestComponent { class TestComponent {
reload = (event) => { reload = (event) => {
return; return;
} };
} }

View File

@@ -124,5 +124,5 @@ class TestComponent {
reload = (event) => { reload = (event) => {
return; return;
} };
} }

View File

@@ -33,8 +33,7 @@ const options = { params: { sidebarWidth: '*' } };
export const slideSidebar = trigger('slideSidebar', [ export const slideSidebar = trigger('slideSidebar', [
transition('expanded => collapsed', transition('expanded => collapsed',
group group(
(
[ [
query('@*', animateChild()), query('@*', animateChild()),
query('.sidebar-collapsible', expandedStyle, options), query('.sidebar-collapsible', expandedStyle, options),
@@ -43,8 +42,7 @@ export const slideSidebar = trigger('slideSidebar', [
)), )),
transition('collapsed => expanded', transition('collapsed => expanded',
group group(
(
[ [
query('@*', animateChild()), query('@*', animateChild()),
query('.sidebar-collapsible', collapsedStyle), query('.sidebar-collapsible', collapsedStyle),

View File

@@ -59,7 +59,7 @@ export class DsDynamicLookupComponent extends DsDynamicVocabularyComponent imple
*/ */
inputFormatter = (x: { display: string }, y: number) => { inputFormatter = (x: { display: string }, y: number) => {
return y === 1 ? this.firstInputValue : this.secondInputValue; return y === 1 ? this.firstInputValue : this.secondInputValue;
} };
/** /**
* Initialize the component, setting up the init form value * Initialize the component, setting up the init form value

View File

@@ -80,7 +80,7 @@ export class DsDynamicOneboxComponent extends DsDynamicVocabularyComponent imple
*/ */
formatter = (x: { display: string }) => { formatter = (x: { display: string }) => {
return (typeof x === 'object') ? x.display : x; return (typeof x === 'object') ? x.display : x;
} };
/** /**
* Converts a stream of text values from the `<input>` element to the stream of the array of items * Converts a stream of text values from the `<input>` element to the stream of the array of items
@@ -116,7 +116,7 @@ export class DsDynamicOneboxComponent extends DsDynamicVocabularyComponent imple
tap(() => this.changeSearchingStatus(false)), tap(() => this.changeSearchingStatus(false)),
merge(this.hideSearchingWhenUnsubscribed$) merge(this.hideSearchingWhenUnsubscribed$)
); );
} };
/** /**
* Initialize the component, setting up the init form value * Initialize the component, setting up the init form value

View File

@@ -90,7 +90,7 @@ export class DsDynamicTagComponent extends DsDynamicVocabularyComponent implemen
}), }),
map((list: PaginatedList<VocabularyEntry>) => list.page), map((list: PaginatedList<VocabularyEntry>) => list.page),
tap(() => this.changeSearchingStatus(false)), tap(() => this.changeSearchingStatus(false)),
merge(this.hideSearchingWhenUnsubscribed)) merge(this.hideSearchingWhenUnsubscribed));
/** /**
* Initialize the component, setting up the init form value * Initialize the component, setting up the init form value

View File

@@ -111,10 +111,10 @@ export class InputSuggestionsComponent implements ControlValueAccessor, OnChange
@Input() disabled = false; @Input() disabled = false;
propagateChange = (_: any) => { propagateChange = (_: any) => {
/* Empty implementation */ /* Empty implementation */
} };
propagateTouch = (_: any) => { propagateTouch = (_: any) => {
/* Empty implementation */ /* Empty implementation */
} };
/** /**
* When any of the inputs change, check if we should still show the suggestions * When any of the inputs change, check if we should still show the suggestions

View File

@@ -19,7 +19,6 @@ export class MenuEffects {
/** /**
* On route change, build menu sections for every menu type depending on the current route data * On route change, build menu sections for every menu type depending on the current route data
*/ */
public buildRouteMenuSections$: Observable<Action> = createEffect(() => this.actions$ public buildRouteMenuSections$: Observable<Action> = createEffect(() => this.actions$
.pipe( .pipe(
ofType(ROUTER_NAVIGATED), ofType(ROUTER_NAVIGATED),

View File

@@ -120,7 +120,7 @@ export class NotificationComponent implements OnInit, OnDestroy {
} }
this.zone.run(() => this.cdr.detectChanges()); this.zone.run(() => this.cdr.detectChanges());
}); });
} };
public remove() { public remove() {
if (this.animate) { if (this.animate) {

View File

@@ -35,7 +35,7 @@ export function objectSelectionReducer(state = initialState, action: ObjectSelec
switch (action.type) { switch (action.type) {
case ObjectSelectionActionTypes.INITIAL_SELECT: { 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, { return Object.assign({}, state, {
[action.key]: Object.assign({}, state[action.key], { [action.key]: Object.assign({}, state[action.key], {
[action.id]: { [action.id]: {
@@ -48,7 +48,7 @@ export function objectSelectionReducer(state = initialState, action: ObjectSelec
} }
case ObjectSelectionActionTypes.INITIAL_DESELECT: { 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, { return Object.assign({}, state, {
[action.key]: Object.assign({}, state[action.key], { [action.key]: Object.assign({}, state[action.key], {
[action.id]: { [action.id]: {

View File

@@ -33,7 +33,7 @@ export class AuthServiceStub {
return observableOf(authStatus); return observableOf(authStatus);
} else { } else {
console.log('error'); 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') { if (token.accessToken === 'token_test') {
return observableOf(EPersonMock._links.self.href); return observableOf(EPersonMock._links.self.href);
} else { } else {
throw(new Error('Message Error test')); throw (new Error('Message Error test'));
} }
} }

View File

@@ -46,7 +46,7 @@ export abstract class ThemedComponent<T> implements OnInit, OnDestroy, OnChanges
// if an input or output has changed // if an input or output has changed
if (this.inAndOutputNames.some((name: any) => hasValue(changes[name]))) { if (this.inAndOutputNames.some((name: any) => hasValue(changes[name]))) {
this.connectInputsAndOutputs(); 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); (this.compRef.instance as any).ngOnChanges(changes);
} }
} }

View File

@@ -79,7 +79,7 @@ class TestComponent {
/* eslint-disable no-empty,@typescript-eslint/no-empty-function */ /* eslint-disable no-empty,@typescript-eslint/no-empty-function */
public onBeforeUpload = () => { public onBeforeUpload = () => {
} };
onCompleteItem(event) { onCompleteItem(event) {
} }

View File

@@ -161,7 +161,7 @@ export class VocabularyTreeviewComponent implements OnDestroy, OnInit {
this.treeControl.expand(newNode); this.treeControl.expand(newNode);
} }
return newNode; return newNode;
} };
/** /**
* Get tree level for a given node * Get tree level for a given node

View File

@@ -83,7 +83,7 @@ export class SubmissionUploadFilesComponent implements OnChanges {
.subscribe(); .subscribe();
this.subs.push(sub); this.subs.push(sub);
return sub; return sub;
} };
/** /**
* Initialize instance variables * Initialize instance variables

View File

@@ -303,7 +303,6 @@ export class SubmissionObjectEffects {
/** /**
* Show a notification on success and redirect to MyDSpace page * Show a notification on success and redirect to MyDSpace page
*/ */
discardSubmissionSuccess$ = createEffect(() => this.actions$.pipe( discardSubmissionSuccess$ = createEffect(() => this.actions$.pipe(
ofType(SubmissionObjectActionTypes.DISCARD_SUBMISSION_SUCCESS), ofType(SubmissionObjectActionTypes.DISCARD_SUBMISSION_SUCCESS),
tap(() => this.notificationsService.success(null, this.translate.get('submission.sections.general.discard_success_notice'))), tap(() => this.notificationsService.success(null, this.translate.get('submission.sections.general.discard_success_notice'))),

View File

@@ -73,7 +73,7 @@ const getLocalConfigPath = (env: Environment) => {
break; break;
case 'development': case 'development':
default: default:
envVariations = ['dev', 'development'] envVariations = ['dev', 'development'];
} }
// check if any environment variations of app config exist // check if any environment variations of app config exist

6
src/typings.d.ts vendored
View File

@@ -31,14 +31,14 @@ declare module 'modern-lru' {
export = x; export = x;
} }
declare var System: SystemJS; declare let System: SystemJS;
interface SystemJS { interface SystemJS {
import: (path?: string) => Promise<any>; import: (path?: string) => Promise<any>;
} }
// Extra variables that live on Global that will be replaced by webpack DefinePlugin // Extra variables that live on Global that will be replaced by webpack DefinePlugin
declare var ENV: string; declare let ENV: string;
declare var HMR: boolean; declare let HMR: boolean;
interface GlobalEnvironment { interface GlobalEnvironment {
ENV; ENV;
HMR; HMR;