diff --git a/src/app/shared/sass-helper/css-variable.actions.ts b/src/app/shared/sass-helper/css-variable.actions.ts index 93225f9426..2d58a2978b 100644 --- a/src/app/shared/sass-helper/css-variable.actions.ts +++ b/src/app/shared/sass-helper/css-variable.actions.ts @@ -1,3 +1,4 @@ +/* eslint-disable max-classes-per-file */ import { Action } from '@ngrx/store'; import { type } from '../ngrx/type'; import { KeyValuePair } from '../key-value-pair.model'; @@ -38,9 +39,6 @@ export class AddAllCSSVariablesAction implements Action { export class ClearCSSVariablesAction implements Action { type = CSSVariableActionTypes.CLEAR; - - constructor() { - } } export type CSSVariableAction = AddCSSVariableAction | AddAllCSSVariablesAction | ClearCSSVariablesAction; diff --git a/src/app/shared/sass-helper/css-variable.reducer.ts b/src/app/shared/sass-helper/css-variable.reducer.ts index 405cbf5df4..449a936b4e 100644 --- a/src/app/shared/sass-helper/css-variable.reducer.ts +++ b/src/app/shared/sass-helper/css-variable.reducer.ts @@ -19,7 +19,7 @@ export function cssVariablesReducer(state = initialState, action: CSSVariableAct return Object.assign({}, state, { [variable.name]: variable.value }); } case CSSVariableActionTypes.ADD_ALL: { const variables = action.payload; - return Object.assign({}, state, ...variables.map(({ key, value }: KeyValuePair) => {return {[key]: value}})); + return Object.assign({}, state, ...variables.map(({ key, value }: KeyValuePair) => {return {[key]: value};})); } case CSSVariableActionTypes.CLEAR: { return initialState; } diff --git a/src/app/shared/sass-helper/css-variable.service.ts b/src/app/shared/sass-helper/css-variable.service.ts index 9ba9dfca3c..af40c634fd 100644 --- a/src/app/shared/sass-helper/css-variable.service.ts +++ b/src/app/shared/sass-helper/css-variable.service.ts @@ -87,8 +87,7 @@ export class CSSVariableService { * @return array> * ex; [{key: "--color-accent", value: "#b9f500"}, {key: "--color-text", value: "#252525"}, ...] */ - getCSSVariablesFromStylesheets(document: Document): KeyValuePair[] - { + getCSSVariablesFromStylesheets(document: Document): KeyValuePair[] { // styleSheets is array-like, so we convert it to an array. // Filter out any stylesheets not on this domain return [...document.styleSheets] diff --git a/src/app/shared/testing/css-variable-service.stub.ts b/src/app/shared/testing/css-variable-service.stub.ts index f72e338455..47be5c0ff4 100644 --- a/src/app/shared/testing/css-variable-service.stub.ts +++ b/src/app/shared/testing/css-variable-service.stub.ts @@ -1,4 +1,5 @@ import { Observable, of as observableOf } from 'rxjs'; +import { KeyValuePair } from '../key-value-pair.model'; const variables = { '--bs-sm-min': '576px,', @@ -19,4 +20,16 @@ export class CSSVariableServiceStub { addCSSVariable(name: string, value: string): void { /**/ } + + addCSSVariables(variables: KeyValuePair[]): void { + /**/ + } + + clearCSSVariables(): void { + /**/ + } + + getCSSVariablesFromStylesheets(document: Document): void { + /**/ + } } diff --git a/src/modules/app/server-init.service.ts b/src/modules/app/server-init.service.ts index e93c692cd7..9f6aa65921 100644 --- a/src/modules/app/server-init.service.ts +++ b/src/modules/app/server-init.service.ts @@ -18,7 +18,7 @@ import { LocaleService } from '../../app/core/locale/locale.service'; import { Angulartics2DSpace } from '../../app/statistics/angulartics/dspace-provider'; import { MetadataService } from '../../app/core/metadata/metadata.service'; import { BreadcrumbsService } from '../../app/breadcrumbs/breadcrumbs.service'; -import { CSSVariableService } from '../../app/shared/sass-helper/sass-helper.service'; +import { CSSVariableService } from '../../sass-helper/css-variable.service'; import { ThemeService } from '../../app/shared/theme-support/theme.service'; import { take } from 'rxjs/operators';