Skip to content

Commit

Permalink
fix: set a default name if saved vis is untitled (#1314)
Browse files Browse the repository at this point in the history
Manual backport of aca9a9c for DHIS2-9360
Saving named visualization again now retains it's name properly. As seen in #1273
  • Loading branch information
martinkrulltott committed Sep 25, 2020
1 parent 750cf2c commit 04e691b
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions packages/app/src/actions/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,11 @@ export const tDoSaveVisualization = (
}

visualization.name =
// name provided in the Save dialog
name ||
// existing name when saving the same modified visualization
visualization.name ||
// new visualization with no name provided in Save dialog
i18n.t('Untitled {{visualizationType}} visualization, {{date}}', {
visualizationType: getChartTypeDisplayName(visualization.type),
date: new Date().toLocaleDateString(undefined, {
Expand Down

0 comments on commit 04e691b

Please sign in to comment.