mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-09 11:03:05 +00:00
94233: Fixed tests
This commit is contained in:
@@ -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;
|
||||
|
@@ -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<string, string>) => {return {[key]: value}}));
|
||||
return Object.assign({}, state, ...variables.map(({ key, value }: KeyValuePair<string, string>) => {return {[key]: value};}));
|
||||
} case CSSVariableActionTypes.CLEAR: {
|
||||
return initialState;
|
||||
}
|
||||
|
@@ -87,8 +87,7 @@ export class CSSVariableService {
|
||||
* @return array<KeyValuePair<string, string>>
|
||||
* ex; [{key: "--color-accent", value: "#b9f500"}, {key: "--color-text", value: "#252525"}, ...]
|
||||
*/
|
||||
getCSSVariablesFromStylesheets(document: Document): KeyValuePair<string, string>[]
|
||||
{
|
||||
getCSSVariablesFromStylesheets(document: Document): KeyValuePair<string, string>[] {
|
||||
// styleSheets is array-like, so we convert it to an array.
|
||||
// Filter out any stylesheets not on this domain
|
||||
return [...document.styleSheets]
|
||||
|
@@ -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<string, string>[]): void {
|
||||
/**/
|
||||
}
|
||||
|
||||
clearCSSVariables(): void {
|
||||
/**/
|
||||
}
|
||||
|
||||
getCSSVariablesFromStylesheets(document: Document): void {
|
||||
/**/
|
||||
}
|
||||
}
|
||||
|
@@ -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';
|
||||
|
||||
|
Reference in New Issue
Block a user