Skip to content

Commit

Permalink
87968: Minor code changes to pass lint
Browse files Browse the repository at this point in the history
  • Loading branch information
ybnd committed Apr 8, 2022
1 parent bb51609 commit 99c41b9
Show file tree
Hide file tree
Showing 27 changed files with 39 additions and 41 deletions.
2 changes: 1 addition & 1 deletion scripts/test-rest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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();

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<CommunityListComponent> {
})
export class ThemedCommunityListComponent extends ThemedComponent<CommunityListComponent> {
protected getComponentName(): string {
return 'CommunityListComponent';
}
Expand Down
8 changes: 4 additions & 4 deletions src/app/core/auth/auth.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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'));
}
}));

Expand Down Expand Up @@ -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'));
}
}));
}
Expand Down Expand Up @@ -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'));
}
}));
}
Expand Down Expand Up @@ -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'));
}
}));
}
Expand Down
2 changes: 1 addition & 1 deletion src/app/core/auth/server-auth.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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'));
}
}));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ export class FilteredDiscoveryPageResponseParsingService extends BaseResponsePar
toCache = false;
constructor(
protected objectCache: ObjectCacheService,
) { super();
) {
super();
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 }] } });
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -185,5 +185,5 @@ describe('MyDSpaceNewExternalDropdownComponent test', () => {
class TestComponent {
reload = (event) => {
return;
}
};
}
Original file line number Diff line number Diff line change
Expand Up @@ -190,5 +190,5 @@ describe('MyDSpaceNewSubmissionDropdownComponent test', () => {
class TestComponent {
reload = (event) => {
return;
}
};
}
Original file line number Diff line number Diff line change
Expand Up @@ -124,5 +124,5 @@ class TestComponent {

reload = (event) => {
return;
}
};
}
6 changes: 2 additions & 4 deletions src/app/shared/animations/slide.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand All @@ -43,8 +42,7 @@ export const slideSidebar = trigger('slideSidebar', [
)),

transition('collapsed => expanded',
group
(
group(
[
query('@*', animateChild()),
query('.sidebar-collapsible', collapsedStyle),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 `<input>` element to the stream of the array of items
Expand Down Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ export class DsDynamicTagComponent extends DsDynamicVocabularyComponent implemen
}),
map((list: PaginatedList<VocabularyEntry>) => list.page),
tap(() => this.changeSearchingStatus(false)),
merge(this.hideSearchingWhenUnsubscribed))
merge(this.hideSearchingWhenUnsubscribed));

/**
* Initialize the component, setting up the init form value
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion src/app/shared/menu/menu.effects.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<Action> = createEffect(() => this.actions$
.pipe(
ofType(ROUTER_NAVIGATED),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ export class NotificationComponent implements OnInit, OnDestroy {
}
this.zone.run(() => this.cdr.detectChanges());
});
}
};

public remove() {
if (this.animate) {
Expand Down
4 changes: 2 additions & 2 deletions src/app/shared/object-select/object-select.reducer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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]: {
Expand All @@ -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]: {
Expand Down
4 changes: 2 additions & 2 deletions src/app/shared/testing/auth-service.stub.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,15 @@ export class AuthServiceStub {
return observableOf(authStatus);
} else {
console.log('error');
throw(new Error('Message Error test'));
throw (new Error('Message Error test'));
}
}

public authenticatedUser(token: AuthTokenInfo): Observable<string> {
if (token.accessToken === 'token_test') {
return observableOf(EPersonMock._links.self.href);
} else {
throw(new Error('Message Error test'));
throw (new Error('Message Error test'));
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/app/shared/theme-support/themed.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ export abstract class ThemedComponent<T> 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);
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/app/shared/uploader/uploader.component.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ class TestComponent {

/* eslint-disable no-empty,@typescript-eslint/no-empty-function */
public onBeforeUpload = () => {
}
};

onCompleteItem(event) {
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ export class VocabularyTreeviewComponent implements OnDestroy, OnInit {
this.treeControl.expand(newNode);
}
return newNode;
}
};

/**
* Get tree level for a given node
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ export class SubmissionUploadFilesComponent implements OnChanges {
.subscribe();
this.subs.push(sub);
return sub;
}
};

/**
* Initialize instance variables
Expand Down
1 change: 0 additions & 1 deletion src/app/submission/objects/submission-objects.effects.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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'))),
Expand Down
2 changes: 1 addition & 1 deletion src/config/config.server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions src/typings.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,14 @@ declare module 'modern-lru' {
export = x;
}

declare var System: SystemJS;
declare let System: SystemJS;

interface SystemJS {
import: (path?: string) => Promise<any>;
}
// 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;
Expand Down

0 comments on commit 99c41b9

Please sign in to comment.