Skip to content

Commit 82b153a

Browse files
authored
Merge pull request #579 from neo4j-labs/task/fixLumaTitles
Visual Glitches hotfix 2.3.3
2 parents 91cc16d + 04597c2 commit 82b153a

File tree

17 files changed

+107
-47
lines changed

17 files changed

+107
-47
lines changed

.github/workflows/develop-deployment.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ on:
66

77
jobs:
88
build-test:
9+
if: github.event.pull_request.draft == false
910
runs-on: neodash-runners
1011
strategy:
1112
matrix:

.github/workflows/develop-test.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ on:
66

77
jobs:
88
build-test:
9+
if: github.event.pull_request.draft == false
910
runs-on: neodash-runners
1011
strategy:
1112
matrix:

.github/workflows/master-deployment.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ jobs:
7979
context: .
8080
file: ./Dockerfile
8181
push: true
82-
tags: ${{ secrets.DOCKER_HUB_LABS_USERNAME }}/neodash:latest,${{ secrets.DOCKER_HUB_LABS_USERNAME }}/neodash:2.3.3
82+
tags: ${{ secrets.DOCKER_HUB_LABS_USERNAME }}/neodash:latest,${{ secrets.DOCKER_HUB_LABS_USERNAME }}/neodash:2.3.4F
8383
build-docker-legacy:
8484
needs: build-test
8585
runs-on: neodash-runners
@@ -103,7 +103,7 @@ jobs:
103103
context: .
104104
file: ./Dockerfile
105105
push: true
106-
tags: ${{ secrets.DOCKER_HUB_USERNAME }}/neodash:latest,${{ secrets.DOCKER_HUB_USERNAME }}/neodash:2.3.3
106+
tags: ${{ secrets.DOCKER_HUB_USERNAME }}/neodash:latest,${{ secrets.DOCKER_HUB_USERNAME }}/neodash:2.3.4
107107
deploy-gallery:
108108
runs-on: neodash-runners
109109
strategy:

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,4 +43,4 @@ USER nginx
4343
EXPOSE $NGINX_PORT
4444

4545
HEALTHCHECK cmd curl --fail "http://localhost:$NGINX_PORT" || exit 1
46-
LABEL version="2.3.3"
46+
LABEL version="2.3.4"

changelog.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
## NeoDash 2.3.3
1+
## NeoDash 2.3.3 & 2.3.4
22
This is a bugfix / stability release directly following 2.3.2.
33

44
Improvements:
@@ -7,6 +7,7 @@ Improvements:
77
- Improved contrast for light and dark theme. ([@nielsdejong](https://github.com/nielsdejong), [#545](https://github.com/neo4j-labs/neodash/pull/566))
88
- Fixed issue where dashboards were locked in read-only mode, after toggling in the dashboard settings. ([@nielsdejong](https://github.com/nielsdejong), [#545](https://github.com/neo4j-labs/neodash/pull/566))
99
- Fixed issue where editing the name of a non-selected page changed the wrong page data. ([@BennuFire](https://github.com/BennuFire), [#545](https://github.com/neo4j-labs/neodash/pull/571))
10+
- Fixed issue where color picker was only working on popup selections. ([@BennuFire](https://github.com/BennuFire), [#579](https://github.com/neo4j-labs/neodash/pull/579))
1011
- Add user agent to driver session for better logging of NeoDash queries. ([@nielsdejong](https://github.com/nielsdejong), [#545](https://github.com/neo4j-labs/neodash/pull/574))
1112

1213

release-notes.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
## NeoDash 2.3.3
1+
## NeoDash 2.3.3 & 2.3.4
22
This is a bugfix / stability release directly following 2.3.2.
33

44
Improvements:
@@ -7,4 +7,5 @@ Improvements:
77
- Improved contrast for light and dark theme. ([@nielsdejong](https://github.com/nielsdejong), [#545](https://github.com/neo4j-labs/neodash/pull/566))
88
- Fixed issue where dashboards were locked in read-only mode, after toggling in the dashboard settings. ([@nielsdejong](https://github.com/nielsdejong), [#545](https://github.com/neo4j-labs/neodash/pull/566))
99
- Fixed issue where editing the name of a non-selected page changed the wrong page data. ([@BennuFire](https://github.com/BennuFire), [#545](https://github.com/neo4j-labs/neodash/pull/571))
10+
- Fixed issue where color picker was only working on popup selections. ([@BennuFire](https://github.com/BennuFire), [#579](https://github.com/neo4j-labs/neodash/pull/579))
1011
- Add user agent to driver session for better logging of NeoDash queries. ([@nielsdejong](https://github.com/nielsdejong), [#545](https://github.com/neo4j-labs/neodash/pull/574))

src/card/view/CardView.tsx

Lines changed: 16 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,11 @@ import NeoCardViewHeader from './CardViewHeader';
44
import NeoCardViewFooter from './CardViewFooter';
55
import { CardContent } from '@mui/material';
66
import NeoCodeEditorComponent from '../../component/editor/CodeEditorComponent';
7-
87
import { CARD_FOOTER_HEIGHT, CARD_HEADER_HEIGHT } from '../../config/CardConfig';
98
import { getReportTypes } from '../../extensions/ExtensionUtils';
109
import NeoCodeViewerComponent from '../../component/editor/CodeViewerComponent';
1110
import { NeoReportWrapper } from '../../report/ReportWrapper';
1211
import { identifyStyleRuleParameters } from '../../extensions/styling/StyleRuleEvaluator';
13-
import { ThemeProvider } from '@mui/material/styles';
14-
import { lightTheme, darkHeaderTheme, luma } from '../../component/theme/Themes';
1512
import { IconButton } from '@neo4j-ndl/react';
1613
import { PlayCircleIconSolid } from '@neo4j-ndl/react/icons';
1714
import { extensionEnabled } from '../../utils/ReportUtils';
@@ -79,30 +76,22 @@ const NeoCardView = ({
7976

8077
// @ts-ignore
8178
const reportHeader = (
82-
<ThemeProvider
83-
theme={
84-
settings.backgroundColor && luma(settings.backgroundColor) < (dashboardSettings.darkLuma || 40)
85-
? darkHeaderTheme
86-
: lightTheme
87-
}
88-
>
89-
<NeoCardViewHeader
90-
title={title}
91-
editable={editable}
92-
description={settings.description}
93-
fullscreenEnabled={settings.fullscreenEnabled}
94-
downloadImageEnabled={settings.downloadImageEnabled}
95-
refreshButtonEnabled={settings.refreshButtonEnabled}
96-
onTitleUpdate={onTitleUpdate}
97-
onToggleCardSettings={onToggleCardSettings}
98-
onManualRefreshCard={() => setLastRunTimestamp(Date.now())}
99-
settings={settings}
100-
onDownloadImage={onDownloadImage}
101-
onToggleCardExpand={onToggleCardExpand}
102-
expanded={expanded}
103-
parameters={getLocalParameters(title)}
104-
></NeoCardViewHeader>
105-
</ThemeProvider>
79+
<NeoCardViewHeader
80+
title={title}
81+
editable={editable}
82+
description={settings.description}
83+
fullscreenEnabled={settings.fullscreenEnabled}
84+
downloadImageEnabled={settings.downloadImageEnabled}
85+
refreshButtonEnabled={settings.refreshButtonEnabled}
86+
onTitleUpdate={onTitleUpdate}
87+
onToggleCardSettings={onToggleCardSettings}
88+
onManualRefreshCard={() => setLastRunTimestamp(Date.now())}
89+
settings={settings}
90+
onDownloadImage={onDownloadImage}
91+
onToggleCardExpand={onToggleCardExpand}
92+
expanded={expanded}
93+
parameters={getLocalParameters(title)}
94+
></NeoCardViewHeader>
10695
);
10796

10897
// @ts-ignore

src/chart/Chart.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ export interface ChartProps {
1919
updateReportSetting?: (name, value) => void; // Callback to update a setting for this report.
2020
fields: (fields) => string[]; // List of fields (return values) available for the report.
2121
setFields?: (fields) => void; // Update the list of fields for this report.
22+
theme?: string; // Dashboard theme value.
2223
}
2324

2425
/**

src/chart/Utils.ts

Lines changed: 46 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1+
import { tokens } from '@neo4j-ndl/base';
12
import { QueryResult, Record as Neo4jRecord } from 'neo4j-driver';
2-
33
export function recordToNative(input: any): any {
44
if (!input && input !== false) {
55
return null;
@@ -118,11 +118,11 @@ export enum EntityType {
118118
}
119119

120120
export const themeNivo = {
121-
textColor: 'rgb(var(--palette-neutral-text-weak))',
122-
text: { fill: 'rgb(var(--palette-neutral-text-weak))' },
121+
textColor: 'rgb(var(--palette-neutral-text-default))',
122+
text: { fill: 'rgb(var(--palette-neutral-text-default))' },
123123
axis: {
124-
ticks: { text: { fill: 'rgb(var(--palette-neutral-text-weak))' } },
125-
legend: { text: { fill: 'rgb(var(--palette-neutral-text-weak))' } },
124+
ticks: { text: { fill: 'rgb(var(--palette-light-neutral-text-default))' } },
125+
legend: { text: { fill: 'rgb(var(--palette-neutral-text-default))' } },
126126
},
127127
legends: {
128128
text: { fill: 'rgb(var(--palette-neutral-text-weak))' },
@@ -139,4 +139,45 @@ export const themeNivo = {
139139
annotations: {
140140
text: { fill: 'rgb(var(--palette-neutral-text-default))' },
141141
},
142+
tooltip: {
143+
container: {
144+
fill: 'rgb(var(--palette-neutral-text-default))',
145+
background: 'rgb(var(--palette-neutral-bg-strong))',
146+
},
147+
},
148+
};
149+
150+
export const themeNivoCanvas = (theme) => {
151+
let baseDefault =
152+
theme === 'light' ? tokens.palette.light.neutral.text.default : tokens.palette.dark.neutral.text.default;
153+
let baseWeak = theme === 'light' ? tokens.palette.light.neutral.text.weak : tokens.palette.dark.neutral.text.weak;
154+
return {
155+
// textColor: 'rgb(var(--palette-neutral-text-default))',
156+
text: { fill: baseDefault },
157+
axis: {
158+
ticks: { text: { fill: baseDefault } },
159+
legend: { text: { fill: baseDefault } },
160+
},
161+
legends: {
162+
text: { fill: baseWeak },
163+
title: { text: { fill: baseWeak } },
164+
ticks: { text: { fill: baseWeak } },
165+
hidden: { text: { fill: baseWeak } },
166+
},
167+
markers: {
168+
text: { fill: baseDefault },
169+
},
170+
labels: {
171+
text: { fill: baseDefault },
172+
},
173+
annotations: {
174+
text: { fill: baseDefault },
175+
},
176+
tooltip: {
177+
container: {
178+
fill: 'rgb(var(--palette-neutral-text-default))',
179+
background: 'rgb(var(--palette-neutral-bg-strong))',
180+
},
181+
},
182+
};
142183
};

src/chart/bar/BarChart.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { getD3ColorsByScheme } from '../../config/ColorConfig';
55
import { evaluateRulesOnDict, useStyleRules } from '../../extensions/styling/StyleRuleEvaluator';
66
import { ChartProps } from '../Chart';
77
import { convertRecordObjectToString, recordToNative } from '../ChartUtils';
8-
import { themeNivo } from '../Utils';
8+
import { themeNivo, themeNivoCanvas } from '../Utils';
99
import { extensionEnabled } from '../../utils/ReportUtils';
1010

1111
/**
@@ -208,10 +208,11 @@ const NeoBarChart = (props: ChartProps) => {
208208
};
209209

210210
const extraProperties = positionLabel == 'off' ? {} : { barComponent: BarComponent };
211-
const BarChartComponent = data.length > 30 ? ResponsiveBarCanvas : ResponsiveBar;
211+
const canvas = data.length > 30;
212+
const BarChartComponent = canvas ? ResponsiveBarCanvas : ResponsiveBar;
212213
const chart = (
213214
<BarChartComponent
214-
theme={themeNivo}
215+
theme={canvas ? themeNivoCanvas(props.theme) : themeNivo}
215216
data={data}
216217
key={`${selection.index}___${selection.value}`}
217218
layout={layout}

0 commit comments

Comments
 (0)