Skip to content

Commit c662236

Browse files
fix(dashboard): improve JSON metadata editor usability and enable resizable modal
1 parent a2e4119 commit c662236

File tree

3 files changed

+24
-14
lines changed

3 files changed

+24
-14
lines changed

superset-frontend/src/components/Modal/StandardModal.tsx

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@ interface StandardModalProps {
4141
maskClosable?: boolean;
4242
wrapProps?: object;
4343
contentLoading?: boolean;
44+
resizable?: boolean;
45+
draggable?: boolean;
4446
}
4547

4648
// Standard modal widths
@@ -50,10 +52,9 @@ export const MODAL_LARGE_WIDTH = 900;
5052

5153
const StyledModal = styled(Modal)`
5254
.ant-modal-body {
53-
max-height: 60vh;
55+
max-height: 80vh;
5456
height: auto;
5557
overflow-y: auto;
56-
padding: 0;
5758
}
5859
5960
.ant-modal-header {
@@ -116,6 +117,8 @@ export function StandardModal({
116117
maskClosable = false,
117118
wrapProps,
118119
contentLoading = false,
120+
resizable = false,
121+
draggable = false,
119122
}: StandardModalProps) {
120123
const primaryButtonName = saveText || (isEditMode ? t('Save') : t('Add'));
121124

@@ -141,6 +144,8 @@ export function StandardModal({
141144
title
142145
)
143146
}
147+
resizable={resizable}
148+
draggable={draggable}
144149
>
145150
{contentLoading ? (
146151
<Flex justify="center" align="center" style={{ minHeight: 200 }}>

superset-frontend/src/dashboard/components/PropertiesModal/index.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -626,6 +626,9 @@ const PropertiesModal = ({
626626
form.submit();
627627
}
628628
}}
629+
resizable
630+
draggable
631+
width={900}
629632
title={t('Dashboard properties')}
630633
isEditMode
631634
saveDisabled={dashboardInfo?.isManagedExternally || hasErrors}

superset-frontend/src/dashboard/components/PropertiesModal/sections/AdvancedSection.tsx

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -75,18 +75,20 @@ const AdvancedSection = ({
7575
}
7676
bottomSpacing={false}
7777
>
78-
<StyledEditorHost
79-
id="dashboard-json-metadata"
80-
data-test="dashboard-metadata-editor"
81-
value={jsonMetadata}
82-
onChange={onJsonMetadataChange}
83-
language="json"
84-
tabSize={2}
85-
wordWrap
86-
width="100%"
87-
height="200px"
88-
annotations={toEditorAnnotations(jsonAnnotations)}
89-
/>
78+
<div style={{ minHeight: 300, height: '60vh' }}>
79+
<StyledEditorHost
80+
id="dashboard-json-metadata"
81+
data-test="dashboard-metadata-editor"
82+
value={jsonMetadata}
83+
onChange={onJsonMetadataChange}
84+
language="json"
85+
tabSize={2}
86+
wordWrap
87+
width="100%"
88+
height="100%"
89+
annotations={toEditorAnnotations(jsonAnnotations)}
90+
/>
91+
</div>
9092
</ModalFormField>
9193
);
9294

0 commit comments

Comments
 (0)