mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-10 03:23:07 +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 { Action } from '@ngrx/store';
|
||||||
import { type } from '../ngrx/type';
|
import { type } from '../ngrx/type';
|
||||||
import { KeyValuePair } from '../key-value-pair.model';
|
import { KeyValuePair } from '../key-value-pair.model';
|
||||||
@@ -38,9 +39,6 @@ export class AddAllCSSVariablesAction implements Action {
|
|||||||
|
|
||||||
export class ClearCSSVariablesAction implements Action {
|
export class ClearCSSVariablesAction implements Action {
|
||||||
type = CSSVariableActionTypes.CLEAR;
|
type = CSSVariableActionTypes.CLEAR;
|
||||||
|
|
||||||
constructor() {
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export type CSSVariableAction = AddCSSVariableAction | AddAllCSSVariablesAction | ClearCSSVariablesAction;
|
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 });
|
return Object.assign({}, state, { [variable.name]: variable.value });
|
||||||
} case CSSVariableActionTypes.ADD_ALL: {
|
} case CSSVariableActionTypes.ADD_ALL: {
|
||||||
const variables = action.payload;
|
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: {
|
} case CSSVariableActionTypes.CLEAR: {
|
||||||
return initialState;
|
return initialState;
|
||||||
}
|
}
|
||||||
|
@@ -87,8 +87,7 @@ export class CSSVariableService {
|
|||||||
* @return array<KeyValuePair<string, string>>
|
* @return array<KeyValuePair<string, string>>
|
||||||
* ex; [{key: "--color-accent", value: "#b9f500"}, {key: "--color-text", value: "#252525"}, ...]
|
* 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.
|
// styleSheets is array-like, so we convert it to an array.
|
||||||
// Filter out any stylesheets not on this domain
|
// Filter out any stylesheets not on this domain
|
||||||
return [...document.styleSheets]
|
return [...document.styleSheets]
|
||||||
|
@@ -1,4 +1,5 @@
|
|||||||
import { Observable, of as observableOf } from 'rxjs';
|
import { Observable, of as observableOf } from 'rxjs';
|
||||||
|
import { KeyValuePair } from '../key-value-pair.model';
|
||||||
|
|
||||||
const variables = {
|
const variables = {
|
||||||
'--bs-sm-min': '576px,',
|
'--bs-sm-min': '576px,',
|
||||||
@@ -19,4 +20,16 @@ export class CSSVariableServiceStub {
|
|||||||
addCSSVariable(name: string, value: string): void {
|
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 { Angulartics2DSpace } from '../../app/statistics/angulartics/dspace-provider';
|
||||||
import { MetadataService } from '../../app/core/metadata/metadata.service';
|
import { MetadataService } from '../../app/core/metadata/metadata.service';
|
||||||
import { BreadcrumbsService } from '../../app/breadcrumbs/breadcrumbs.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 { ThemeService } from '../../app/shared/theme-support/theme.service';
|
||||||
import { take } from 'rxjs/operators';
|
import { take } from 'rxjs/operators';
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user