neo4j-labs / neodash

NeoDash - a Dashboard Builder for Neo4j
https://neo4j.com/labs/neodash/
Apache License 2.0
408 stars 135 forks source link

Improved handling of draft dashboards in the sidebar, allowing to distinguish between save/overwrite #734

Closed nielsdejong closed 8 months ago

nielsdejong commented 9 months ago

In the previous version of the sidebar, the currently edited dashboard (the 'draft') was always located at index = -1 of the list (i.e. the very first element to be displayed before all currently saved dashboards).

This PR changes this. Now, the sidebar lets people edit existing dashboards (remembering their current index), and provide the draft interface for the currently selected dashboard, without using the explicit "index = -1" entry.

The explicit entry does still exist though, as when a person has created a dashboard that is not yet saved to the database, there is no matching element in the list. Here, we do use the "-1" entry.

ivy113 commented 8 months ago

I think the uuid also needs to be changed if there is a new dashboard name. Otherwise I have encountered an issue with 2.4.1 where the draft will overwrite the existing saved dashboard. The way I found around this was to export the prev version json, clone the prev dashboard node and manually modify the uuid, then save current draft so that the current version I am working on does not overwrite the previous version.

codecov[bot] commented 8 months ago

Codecov Report

Attention: 398 lines in your changes are missing coverage. Please review.

Comparison is base (20e4e0a) 39.07% compared to head (f4f8181) 38.83%. Report is 71 commits behind head on develop.

:exclamation: Current head f4f8181 differs from pull request most recent head 03d196c. Consider uploading reports for the commit 03d196c to get more accurate results

Files Patch % Lines
src/dashboard/DashboardThunks.ts 3.57% 81 Missing :warning:
src/dashboard/sidebar/DashboardSidebar.tsx 14.28% 41 Missing and 1 partial :warning:
...charts/chart/graph3d/GraphChartVisualization3D.tsx 2.63% 37 Missing :warning:
src/chart/graph/GraphChartVisualizationBase.tsx 34.61% 34 Missing :warning:
src/application/logging/LoggingThunk.ts 2.94% 33 Missing :warning:
...rc/extensions/actions/ActionsRuleCreationModal.tsx 0.00% 30 Missing :warning:
src/chart/bar/util.ts 0.00% 26 Missing :warning:
src/chart/bar/BarChart.tsx 75.55% 22 Missing :warning:
src/dashboard/header/DashboardHeaderPageTitle.tsx 19.04% 17 Missing :warning:
src/dashboard/header/DashboardTitle.tsx 31.81% 14 Missing and 1 partial :warning:
... and 21 more
Additional details and impacted files ```diff @@ Coverage Diff @@ ## develop #734 +/- ## =========================================== - Coverage 39.07% 38.83% -0.25% =========================================== Files 208 211 +3 Lines 8721 8820 +99 Branches 2598 2623 +25 =========================================== + Hits 3408 3425 +17 - Misses 5252 5334 +82 Partials 61 61 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

sonarcloud[bot] commented 8 months ago

Quality Gate Failed Quality Gate failed

Failed conditions

C Reliability Rating on New Code (required ≥ A)

See analysis details on SonarCloud

idea Catch issues before they fail your Quality Gate with our IDE extension SonarLint SonarLint