From 70c294e8c20b60fd7027c19b58d9fdabb2c62bbe Mon Sep 17 00:00:00 2001 From: Ville Brofeldt <33317356+villebro@users.noreply.github.com> Date: Fri, 31 Jul 2020 19:30:02 +0300 Subject: [PATCH] fix: enforce mandatory chart name on save and edit (#10482) * fix: show empty charts as empty in chart list view * migrate ControlLabel to FormLabel and enforce requred fields * lint * reorder buttons --- .../src/explore/components/PropertiesModal.tsx | 8 ++++---- .../src/explore/components/SaveModal.jsx | 13 +++++++++---- 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/superset-frontend/src/explore/components/PropertiesModal.tsx b/superset-frontend/src/explore/components/PropertiesModal.tsx index f49dab0568d3a..0cb598888516c 100644 --- a/superset-frontend/src/explore/components/PropertiesModal.tsx +++ b/superset-frontend/src/explore/components/PropertiesModal.tsx @@ -262,18 +262,18 @@ function PropertiesModal({ slice, onHide, onSave }: InternalProps) { + - diff --git a/superset-frontend/src/explore/components/SaveModal.jsx b/superset-frontend/src/explore/components/SaveModal.jsx index 4ac1a79ddb3be..45b96ffd5160d 100644 --- a/superset-frontend/src/explore/components/SaveModal.jsx +++ b/superset-frontend/src/explore/components/SaveModal.jsx @@ -25,10 +25,10 @@ import { Button, FormControl, FormGroup, - ControlLabel, Modal, Radio, } from 'react-bootstrap'; +import FormLabel from 'src/components/FormLabel'; import { CreatableSelect } from 'src/components/Select/SupersetStyledSelect'; import { t } from '@superset-ui/translation'; import ReactMarkdown from 'react-markdown'; @@ -176,7 +176,7 @@ class SaveModal extends React.Component {
- {t('Chart name')} + {t('Chart name')} - {t('Add to dashboard')} + {t('Add to dashboard')} {t('Save & go to dashboard')} @@ -235,6 +239,7 @@ class SaveModal extends React.Component { bsSize="sm" bsStyle="primary" onClick={this.saveOrOverwrite.bind(this, false)} + disabled={!this.state.newSliceName} > {t('Save')}