You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@superset.apache.org by be...@apache.org on 2026/04/23 17:37:56 UTC
(superset) 33/33: Small fixes
This is an automated email from the ASF dual-hosted git repository.
betodealmeida pushed a commit to branch backup/semantic-layer-dynamic-columns-before-rebase-20260423-133321
in repository https://gitbox.apache.org/repos/asf/superset.git
commit 6b0a71a163ddd718acc7c1c4653084f76c01f43a
Author: Beto Dealmeida <ro...@dealmeida.net>
AuthorDate: Thu Apr 23 10:58:00 2026 -0400
Small fixes
---
.../features/semanticLayers/SemanticLayerModal.tsx | 29 ++++++++++++++--------
.../features/semanticLayers/jsonFormsHelpers.tsx | 28 +++++++++++++--------
2 files changed, 36 insertions(+), 21 deletions(-)
diff --git a/superset-frontend/src/features/semanticLayers/SemanticLayerModal.tsx b/superset-frontend/src/features/semanticLayers/SemanticLayerModal.tsx
index 932f915f3c5..d54a1887cc2 100644
--- a/superset-frontend/src/features/semanticLayers/SemanticLayerModal.tsx
+++ b/superset-frontend/src/features/semanticLayers/SemanticLayerModal.tsx
@@ -385,16 +385,25 @@ export default function SemanticLayerModal({
/>
</ModalFormField>
{configSchema && (
- <JsonForms
- schema={configSchema}
- uischema={uiSchema}
- data={formData}
- renderers={renderers}
- cells={cellRegistryEntries}
- config={{ refreshingSchema, formData }}
- validationMode={validationMode}
- onChange={handleFormChange}
- />
+ // Wrap in a form with autocomplete="off" so browsers do not
+ // autofill credential fields (service token, account, etc.).
+ // eslint-disable-next-line jsx-a11y/no-redundant-roles
+ <form
+ role="presentation"
+ autoComplete="off"
+ onSubmit={e => e.preventDefault()}
+ >
+ <JsonForms
+ schema={configSchema}
+ uischema={uiSchema}
+ data={formData}
+ renderers={renderers}
+ cells={cellRegistryEntries}
+ config={{ refreshingSchema, formData }}
+ validationMode={validationMode}
+ onChange={handleFormChange}
+ />
+ </form>
)}
</ModalContent>
)}
diff --git a/superset-frontend/src/features/semanticLayers/jsonFormsHelpers.tsx b/superset-frontend/src/features/semanticLayers/jsonFormsHelpers.tsx
index 7738bdf604f..85c7b891dbc 100644
--- a/superset-frontend/src/features/semanticLayers/jsonFormsHelpers.tsx
+++ b/superset-frontend/src/features/semanticLayers/jsonFormsHelpers.tsx
@@ -46,7 +46,18 @@ export const SCHEMA_REFRESH_DEBOUNCE_MS = 500;
function PasswordControl(props: ControlProps) {
const uischema = {
...props.uischema,
- options: { ...props.uischema.options, type: 'password' },
+ options: {
+ ...props.uischema.options,
+ type: 'password',
+ inputProps: {
+ ...((props.uischema.options?.inputProps as Record<string, unknown>) ??
+ {}),
+ // Prevent browsers from autofilling stored login passwords into
+ // service-token fields. 'new-password' is respected even when
+ // 'off' is ignored (Chrome ≥ 34).
+ autoComplete: 'new-password',
+ },
+ },
};
return TextControl({ ...props, uischema });
}
@@ -150,9 +161,7 @@ export function areDependenciesSatisfied(
// Fall back to the schema default when the field hasn't been touched yet.
const defaultValue = schema?.properties?.[dep]?.default;
return (
- defaultValue !== null &&
- defaultValue !== undefined &&
- defaultValue !== ''
+ defaultValue !== null && defaultValue !== undefined && defaultValue !== ''
);
});
}
@@ -221,10 +230,8 @@ function EnumNamesControl(props: ControlProps) {
label: enumNames[index] ?? String(value),
}));
- const tooltip =
- (props.uischema?.options as Record<string, unknown>)?.tooltip as
- | string
- | undefined;
+ const tooltip = (props.uischema?.options as Record<string, unknown>)
+ ?.tooltip as string | undefined;
return (
<Form.Item label={props.label} tooltip={tooltip}>
@@ -237,9 +244,8 @@ function EnumNamesControl(props: ControlProps) {
allowClear
loading={!!refreshingSchema}
placeholder={
- (props.uischema?.options as Record<string, unknown>)?.placeholderText as
- | string
- | undefined
+ (props.uischema?.options as Record<string, unknown>)
+ ?.placeholderText as string | undefined
}
/>
</Form.Item>