mirror of
https://github.com/apache/superset.git
synced 2026-04-19 08:04:53 +00:00
fix (dataset editor): allow Source tab readOnly mode (#11781)
* fix (dataset editor) add read-only mode for Source tab * add feature flag, add unit tests * rebase and fix comment * add message for padlock * move padlock to the bottom of tab
This commit is contained in:
@@ -64,6 +64,7 @@ interface DatabaseSelectorProps {
|
||||
onDbChange?: (db: any) => void;
|
||||
onSchemaChange?: (arg0?: any) => {};
|
||||
onSchemasLoad?: (schemas: Array<object>) => void;
|
||||
readOnly?: boolean;
|
||||
schema?: string;
|
||||
sqlLabMode?: boolean;
|
||||
onChange?: ({
|
||||
@@ -87,6 +88,7 @@ export default function DatabaseSelector({
|
||||
onDbChange,
|
||||
onSchemaChange,
|
||||
onSchemasLoad,
|
||||
readOnly = false,
|
||||
schema,
|
||||
sqlLabMode = false,
|
||||
}: DatabaseSelectorProps) {
|
||||
@@ -237,7 +239,7 @@ export default function DatabaseSelector({
|
||||
mutator={dbMutator}
|
||||
placeholder={t('Select a database')}
|
||||
autoSelect
|
||||
isDisabled={!isDatabaseSelectEnabled}
|
||||
isDisabled={!isDatabaseSelectEnabled || readOnly}
|
||||
/>,
|
||||
null,
|
||||
);
|
||||
@@ -245,7 +247,7 @@ export default function DatabaseSelector({
|
||||
|
||||
function renderSchemaSelect() {
|
||||
const value = schemaOptions.filter(({ value }) => currentSchema === value);
|
||||
const refresh = !formMode && (
|
||||
const refresh = !formMode && !readOnly && (
|
||||
<RefreshLabel
|
||||
onClick={() => changeDataBase({ id: dbId }, true)}
|
||||
tooltipContent={t('Force refresh schema list')}
|
||||
@@ -266,6 +268,7 @@ export default function DatabaseSelector({
|
||||
isLoading={schemaLoading}
|
||||
autosize={false}
|
||||
onChange={item => changeSchema(item)}
|
||||
isDisabled={readOnly}
|
||||
/>,
|
||||
refresh,
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user