update dashboard edit modal (#11258)

This commit is contained in:
Lily Kuang 2020-10-13 20:50:02 -07:00 committed by GitHub
parent 2c649ac20f
commit cd7392e618
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -23,7 +23,7 @@ import Button from 'src/components/Button';
import Dialog from 'react-bootstrap-dialog'; import Dialog from 'react-bootstrap-dialog';
import { AsyncSelect } from 'src/components/Select'; import { AsyncSelect } from 'src/components/Select';
import rison from 'rison'; import rison from 'rison';
import { t, SupersetClient } from '@superset-ui/core'; import { styled, t, SupersetClient } from '@superset-ui/core';
import FormLabel from 'src/components/FormLabel'; import FormLabel from 'src/components/FormLabel';
import { JsonEditor } from 'src/components/AsyncAceEditor'; import { JsonEditor } from 'src/components/AsyncAceEditor';
@ -33,6 +33,11 @@ import getClientErrorObject from '../../utils/getClientErrorObject';
import withToasts from '../../messageToasts/enhancers/withToasts'; import withToasts from '../../messageToasts/enhancers/withToasts';
import '../stylesheets/buttons.less'; import '../stylesheets/buttons.less';
const StyledJsonEditor = styled(JsonEditor)`
border-radius: ${({ theme }) => theme.borderRadius}px;
border: 1px solid ${({ theme }) => theme.colors.secondary.light2};
`;
const propTypes = { const propTypes = {
dashboardId: PropTypes.number.isRequired, dashboardId: PropTypes.number.isRequired,
show: PropTypes.bool, show: PropTypes.bool,
@ -306,7 +311,7 @@ class PropertiesModal extends React.PureComponent {
<FormLabel htmlFor="json_metadata"> <FormLabel htmlFor="json_metadata">
{t('JSON Metadata')} {t('JSON Metadata')}
</FormLabel> </FormLabel>
<JsonEditor <StyledJsonEditor
showLoadingForImport showLoadingForImport
name="json_metadata" name="json_metadata"
defaultValue={this.defaultMetadataValue} defaultValue={this.defaultMetadataValue}
@ -328,6 +333,9 @@ class PropertiesModal extends React.PureComponent {
</Modal.Body> </Modal.Body>
<Modal.Footer> <Modal.Footer>
<span className="float-right"> <span className="float-right">
<Button type="button" buttonSize="sm" onClick={onHide} cta>
{t('Cancel')}
</Button>
<Button <Button
type="submit" type="submit"
buttonSize="sm" buttonSize="sm"
@ -338,9 +346,6 @@ class PropertiesModal extends React.PureComponent {
> >
{saveLabel} {saveLabel}
</Button> </Button>
<Button type="button" buttonSize="sm" onClick={onHide} cta>
{t('Cancel')}
</Button>
<Dialog <Dialog
ref={ref => { ref={ref => {
this.dialog = ref; this.dialog = ref;