• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

DLR-SC / ESID / 16418227297

21 Jul 2025 01:21PM UTC coverage: 6.386% (-47.7%) from 54.09%
16418227297

Pull #414

github

fifth-island
feat: Implement PDF viewer for search results
Pull Request #414: feat: Implement basic article search feature

411 of 532 branches covered (77.26%)

Branch coverage included in aggregate %.

213 of 61424 new or added lines in 13 files covered. (0.35%)

136 existing lines in 7 files now uncovered.

4041 of 69186 relevant lines covered (5.84%)

0.54 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

87.5
/src/store/UserPreferenceSlice.ts
1
// SPDX-FileCopyrightText: 2024 German Aerospace Center (DLR)
2
// SPDX-License-Identifier: Apache-2.0
3

4
import {createSlice, PayloadAction} from '@reduxjs/toolkit';
1✔
5
import {HeatmapLegend} from 'types/heatmapLegend';
6

7
export interface UserPreference {
8
  selectedHeatmap: HeatmapLegend;
9
  selectedTab?: string;
10
  isInitialVisit: boolean;
11
  scenarioColors: Record<string, string[]>;
12
}
13

14
const initialState: UserPreference = {
1✔
15
  // Heatmaps are initialized in the HeatLegendEdit Component
16
  selectedHeatmap: {
1✔
17
    name: 'Default',
1✔
18
    isNormalized: true,
1✔
19
    steps: [
1✔
20
      {color: 'rgb(255,255,255)', value: 0},
1✔
21
      {color: 'rgb(255,255,255)', value: 1},
1✔
22
    ],
1✔
23
  },
1✔
24
  selectedTab: '1',
1✔
25
  isInitialVisit: true,
1✔
26
  scenarioColors: {},
1✔
27
};
1✔
28

29
/**
30
 * This slice manages all state that has to do with user preferences.
31
 */
32
export const UserPreferenceSlice = createSlice({
1✔
33
  name: 'UserPreference',
1✔
34
  initialState,
1✔
35
  reducers: {
1✔
36
    /** Set currently selected HeatmapLegend. */
37
    selectHeatmapLegend(state, action: PayloadAction<{legend: HeatmapLegend}>) {
1✔
38
      state.selectedHeatmap = action.payload.legend;
1✔
39
    },
1✔
40
    selectTab(state, action: PayloadAction<string>) {
1✔
41
      state.selectedTab = action.payload;
1✔
42
    },
1✔
43
    /** Set users initial visit to the application */
44
    setInitialVisit(state, action: PayloadAction<boolean>) {
1✔
45
      state.isInitialVisit = action.payload;
2✔
46
    },
2✔
47
    /** Set colors for a specific scenario */
48
    setScenarioColors(state, action: PayloadAction<{scenarioId: string; colors: string[]}>) {
1✔
UNCOV
49
      if (!state.scenarioColors) {
×
UNCOV
50
        state.scenarioColors = {};
×
UNCOV
51
      }
×
UNCOV
52
      state.scenarioColors[action.payload.scenarioId] = action.payload.colors;
×
53
    },
×
54
  },
1✔
55
});
1✔
56

57
export const {selectHeatmapLegend, selectTab, setInitialVisit, setScenarioColors} = UserPreferenceSlice.actions;
1✔
58
export default UserPreferenceSlice.reducer;
1✔
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc