Skip to content

Commit bfaf3c7

Browse files
fix(dashboard): make JSON metadata editor resizable
1 parent cbb2b2f commit bfaf3c7

File tree

3 files changed

+8
-3
lines changed

3 files changed

+8
-3
lines changed

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

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,16 +41,17 @@ interface StandardModalProps {
4141
maskClosable?: boolean;
4242
wrapProps?: object;
4343
contentLoading?: boolean;
44+
resizable?: boolean;
4445
}
4546

4647
// Standard modal widths
4748
export const MODAL_STANDARD_WIDTH = 500;
4849
export const MODAL_MEDIUM_WIDTH = 600;
4950
export const MODAL_LARGE_WIDTH = 900;
5051

51-
const StyledModal = styled(Modal)`
52+
const StyledModal = styled(Modal)<{ $resizable?: boolean }>`
5253
.ant-modal-body {
53-
max-height: 60vh;
54+
max-height: ${({ $resizable }) => ($resizable ? 'none' : '60vh')};
5455
height: auto;
5556
overflow-y: auto;
5657
padding: 0;
@@ -116,6 +117,7 @@ export function StandardModal({
116117
maskClosable = false,
117118
wrapProps,
118119
contentLoading = false,
120+
resizable = false,
119121
}: StandardModalProps) {
120122
const primaryButtonName = saveText || (isEditMode ? t('Save') : t('Add'));
121123

@@ -130,6 +132,8 @@ export function StandardModal({
130132
show={show}
131133
width={`${width}px`}
132134
wrapProps={wrapProps}
135+
$resizable={resizable}
136+
resizable={resizable}
133137
title={
134138
icon ? (
135139
<ModalTitleWithIcon

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -628,6 +628,7 @@ const PropertiesModal = ({
628628
}}
629629
title={t('Dashboard properties')}
630630
isEditMode
631+
resizable
631632
saveDisabled={dashboardInfo?.isManagedExternally || hasErrors}
632633
saveLoading={isApplying}
633634
contentLoading={isLoading}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ const AdvancedSection = ({
8484
tabSize={2}
8585
wordWrap
8686
width="100%"
87-
height="200px"
87+
height="60vh"
8888
annotations={toEditorAnnotations(jsonAnnotations)}
8989
/>
9090
</ModalFormField>

0 commit comments

Comments
 (0)