mirror of
https://github.com/apache/superset.git
synced 2026-04-20 16:44:46 +00:00
chore: make TS enums strictly PascalCase (#26875)
This commit is contained in:
@@ -61,7 +61,7 @@ import { isEmpty, pick } from 'lodash';
|
||||
import {
|
||||
DatabaseObject,
|
||||
DatabaseForm,
|
||||
CONFIGURATION_METHOD,
|
||||
ConfigurationMethod,
|
||||
CatalogObject,
|
||||
Engines,
|
||||
ExtraJson,
|
||||
@@ -145,27 +145,27 @@ interface DatabaseModalProps {
|
||||
}
|
||||
|
||||
export enum ActionType {
|
||||
addTableCatalogSheet,
|
||||
configMethodChange,
|
||||
dbSelected,
|
||||
editorChange,
|
||||
extraEditorChange,
|
||||
extraInputChange,
|
||||
fetched,
|
||||
inputChange,
|
||||
parametersChange,
|
||||
queryChange,
|
||||
removeTableCatalogSheet,
|
||||
reset,
|
||||
textChange,
|
||||
parametersSSHTunnelChange,
|
||||
setSSHTunnelLoginMethod,
|
||||
removeSSHTunnelConfig,
|
||||
AddTableCatalogSheet,
|
||||
ConfigMethodChange,
|
||||
DbSelected,
|
||||
EditorChange,
|
||||
ExtraEditorChange,
|
||||
ExtraInputChange,
|
||||
Fetched,
|
||||
InputChange,
|
||||
ParametersChange,
|
||||
QueryChange,
|
||||
RemoveTableCatalogSheet,
|
||||
Reset,
|
||||
TextChange,
|
||||
ParametersSSHTunnelChange,
|
||||
SetSSHTunnelLoginMethod,
|
||||
RemoveSSHTunnelConfig,
|
||||
}
|
||||
|
||||
export enum AuthType {
|
||||
password,
|
||||
privateKey,
|
||||
Password,
|
||||
PrivateKey,
|
||||
}
|
||||
|
||||
interface DBReducerPayloadType {
|
||||
@@ -180,26 +180,26 @@ interface DBReducerPayloadType {
|
||||
export type DBReducerActionType =
|
||||
| {
|
||||
type:
|
||||
| ActionType.extraEditorChange
|
||||
| ActionType.extraInputChange
|
||||
| ActionType.textChange
|
||||
| ActionType.queryChange
|
||||
| ActionType.inputChange
|
||||
| ActionType.editorChange
|
||||
| ActionType.parametersChange
|
||||
| ActionType.parametersSSHTunnelChange;
|
||||
| ActionType.ExtraEditorChange
|
||||
| ActionType.ExtraInputChange
|
||||
| ActionType.TextChange
|
||||
| ActionType.QueryChange
|
||||
| ActionType.InputChange
|
||||
| ActionType.EditorChange
|
||||
| ActionType.ParametersChange
|
||||
| ActionType.ParametersSSHTunnelChange;
|
||||
payload: DBReducerPayloadType;
|
||||
}
|
||||
| {
|
||||
type: ActionType.fetched;
|
||||
type: ActionType.Fetched;
|
||||
payload: Partial<DatabaseObject>;
|
||||
}
|
||||
| {
|
||||
type: ActionType.dbSelected;
|
||||
type: ActionType.DbSelected;
|
||||
payload: {
|
||||
database_name?: string;
|
||||
engine?: string;
|
||||
configuration_method: CONFIGURATION_METHOD;
|
||||
configuration_method: ConfigurationMethod;
|
||||
engine_information?: {};
|
||||
driver?: string;
|
||||
sqlalchemy_uri_placeholder?: string;
|
||||
@@ -207,26 +207,26 @@ export type DBReducerActionType =
|
||||
}
|
||||
| {
|
||||
type:
|
||||
| ActionType.reset
|
||||
| ActionType.addTableCatalogSheet
|
||||
| ActionType.removeSSHTunnelConfig;
|
||||
| ActionType.Reset
|
||||
| ActionType.AddTableCatalogSheet
|
||||
| ActionType.RemoveSSHTunnelConfig;
|
||||
}
|
||||
| {
|
||||
type: ActionType.removeTableCatalogSheet;
|
||||
type: ActionType.RemoveTableCatalogSheet;
|
||||
payload: {
|
||||
indexToDelete: number;
|
||||
};
|
||||
}
|
||||
| {
|
||||
type: ActionType.configMethodChange;
|
||||
type: ActionType.ConfigMethodChange;
|
||||
payload: {
|
||||
database_name?: string;
|
||||
engine?: string;
|
||||
configuration_method: CONFIGURATION_METHOD;
|
||||
configuration_method: ConfigurationMethod;
|
||||
};
|
||||
}
|
||||
| {
|
||||
type: ActionType.setSSHTunnelLoginMethod;
|
||||
type: ActionType.SetSSHTunnelLoginMethod;
|
||||
payload: {
|
||||
login_method: AuthType;
|
||||
};
|
||||
@@ -251,7 +251,7 @@ export function dbReducer(
|
||||
const extraJson: ExtraJson = JSON.parse(trimmedState.extra || '{}');
|
||||
|
||||
switch (action.type) {
|
||||
case ActionType.extraEditorChange:
|
||||
case ActionType.ExtraEditorChange:
|
||||
// "extra" payload in state is a string
|
||||
try {
|
||||
// we don't want to stringify encoded strings twice
|
||||
@@ -266,7 +266,7 @@ export function dbReducer(
|
||||
[action.payload.name]: actionPayloadJson,
|
||||
}),
|
||||
};
|
||||
case ActionType.extraInputChange:
|
||||
case ActionType.ExtraInputChange:
|
||||
// "extra" payload in state is a string
|
||||
if (
|
||||
action.payload.name === 'schema_cache_timeout' ||
|
||||
@@ -329,7 +329,7 @@ export function dbReducer(
|
||||
: action.payload.value,
|
||||
}),
|
||||
};
|
||||
case ActionType.inputChange:
|
||||
case ActionType.InputChange:
|
||||
if (action.payload.type === 'checkbox') {
|
||||
return {
|
||||
...trimmedState,
|
||||
@@ -340,7 +340,7 @@ export function dbReducer(
|
||||
...trimmedState,
|
||||
[action.payload.name]: action.payload.value,
|
||||
};
|
||||
case ActionType.parametersChange:
|
||||
case ActionType.ParametersChange:
|
||||
// catalog params will always have a catalog state for
|
||||
// dbs that use a catalog, i.e., gsheets, even if the
|
||||
// fields are empty strings
|
||||
@@ -382,7 +382,7 @@ export function dbReducer(
|
||||
},
|
||||
};
|
||||
|
||||
case ActionType.parametersSSHTunnelChange:
|
||||
case ActionType.ParametersSSHTunnelChange:
|
||||
return {
|
||||
...trimmedState,
|
||||
ssh_tunnel: {
|
||||
@@ -390,7 +390,7 @@ export function dbReducer(
|
||||
[action.payload.name]: action.payload.value,
|
||||
},
|
||||
};
|
||||
case ActionType.setSSHTunnelLoginMethod: {
|
||||
case ActionType.SetSSHTunnelLoginMethod: {
|
||||
let ssh_tunnel = {};
|
||||
if (trimmedState?.ssh_tunnel) {
|
||||
// remove any attributes that are considered sensitive
|
||||
@@ -401,7 +401,7 @@ export function dbReducer(
|
||||
'username',
|
||||
]);
|
||||
}
|
||||
if (action.payload.login_method === AuthType.privateKey) {
|
||||
if (action.payload.login_method === AuthType.PrivateKey) {
|
||||
return {
|
||||
...trimmedState,
|
||||
ssh_tunnel: {
|
||||
@@ -412,7 +412,7 @@ export function dbReducer(
|
||||
},
|
||||
};
|
||||
}
|
||||
if (action.payload.login_method === AuthType.password) {
|
||||
if (action.payload.login_method === AuthType.Password) {
|
||||
return {
|
||||
...trimmedState,
|
||||
ssh_tunnel: {
|
||||
@@ -425,12 +425,12 @@ export function dbReducer(
|
||||
...trimmedState,
|
||||
};
|
||||
}
|
||||
case ActionType.removeSSHTunnelConfig:
|
||||
case ActionType.RemoveSSHTunnelConfig:
|
||||
return {
|
||||
...trimmedState,
|
||||
ssh_tunnel: undefined,
|
||||
};
|
||||
case ActionType.addTableCatalogSheet:
|
||||
case ActionType.AddTableCatalogSheet:
|
||||
if (trimmedState.catalog !== undefined) {
|
||||
return {
|
||||
...trimmedState,
|
||||
@@ -441,17 +441,17 @@ export function dbReducer(
|
||||
...trimmedState,
|
||||
catalog: [{ name: '', value: '' }],
|
||||
};
|
||||
case ActionType.removeTableCatalogSheet:
|
||||
case ActionType.RemoveTableCatalogSheet:
|
||||
trimmedState.catalog?.splice(action.payload.indexToDelete, 1);
|
||||
return {
|
||||
...trimmedState,
|
||||
};
|
||||
case ActionType.editorChange:
|
||||
case ActionType.EditorChange:
|
||||
return {
|
||||
...trimmedState,
|
||||
[action.payload.name]: action.payload.json,
|
||||
};
|
||||
case ActionType.queryChange:
|
||||
case ActionType.QueryChange:
|
||||
return {
|
||||
...trimmedState,
|
||||
parameters: {
|
||||
@@ -460,12 +460,12 @@ export function dbReducer(
|
||||
},
|
||||
query_input: action.payload.value,
|
||||
};
|
||||
case ActionType.textChange:
|
||||
case ActionType.TextChange:
|
||||
return {
|
||||
...trimmedState,
|
||||
[action.payload.name]: action.payload.value,
|
||||
};
|
||||
case ActionType.fetched:
|
||||
case ActionType.Fetched:
|
||||
// convert query to a string and store in query_input
|
||||
query = action.payload?.parameters?.query || {};
|
||||
query_input = Object.entries(query)
|
||||
@@ -474,8 +474,7 @@ export function dbReducer(
|
||||
|
||||
if (
|
||||
action.payload.masked_encrypted_extra &&
|
||||
action.payload.configuration_method ===
|
||||
CONFIGURATION_METHOD.DYNAMIC_FORM
|
||||
action.payload.configuration_method === ConfigurationMethod.DynamicForm
|
||||
) {
|
||||
// "extra" payload from the api is a string
|
||||
const extraJsonPayload: ExtraJson = {
|
||||
@@ -510,19 +509,19 @@ export function dbReducer(
|
||||
query_input,
|
||||
};
|
||||
|
||||
case ActionType.dbSelected:
|
||||
case ActionType.DbSelected:
|
||||
// set initial state for blank form
|
||||
return {
|
||||
...action.payload,
|
||||
extra: DEFAULT_EXTRA,
|
||||
expose_in_sqllab: true,
|
||||
};
|
||||
case ActionType.configMethodChange:
|
||||
case ActionType.ConfigMethodChange:
|
||||
return {
|
||||
...action.payload,
|
||||
};
|
||||
|
||||
case ActionType.reset:
|
||||
case ActionType.Reset:
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
@@ -626,12 +625,11 @@ const DatabaseModal: FunctionComponent<DatabaseModalProps> = ({
|
||||
) as DatabaseObject
|
||||
)?.engine_information?.disable_ssh_tunneling;
|
||||
const isSSHTunneling =
|
||||
isFeatureEnabled(FeatureFlag.SSH_TUNNELING) &&
|
||||
!disableSSHTunnelingForEngine;
|
||||
isFeatureEnabled(FeatureFlag.SshTunneling) && !disableSSHTunnelingForEngine;
|
||||
const hasAlert =
|
||||
connectionAlert || !!(db?.engine && engineSpecificAlertMapping[db.engine]);
|
||||
const useSqlAlchemyForm =
|
||||
db?.configuration_method === CONFIGURATION_METHOD.SQLALCHEMY_URI;
|
||||
db?.configuration_method === ConfigurationMethod.SqlalchemyUri;
|
||||
const useTabLayout = isEditMode || useSqlAlchemyForm;
|
||||
const isDynamic = (engine: string | undefined) =>
|
||||
availableDbs?.databases?.find(
|
||||
@@ -690,7 +688,7 @@ const DatabaseModal: FunctionComponent<DatabaseModalProps> = ({
|
||||
};
|
||||
|
||||
const onClose = () => {
|
||||
setDB({ type: ActionType.reset });
|
||||
setDB({ type: ActionType.Reset });
|
||||
setHasConnectedDb(false);
|
||||
setValidationErrors(null); // reset validation errors on close
|
||||
clearError();
|
||||
@@ -752,7 +750,7 @@ const DatabaseModal: FunctionComponent<DatabaseModalProps> = ({
|
||||
// Clone DB object
|
||||
const dbToUpdate = { ...(db || {}) };
|
||||
|
||||
if (dbToUpdate.configuration_method === CONFIGURATION_METHOD.DYNAMIC_FORM) {
|
||||
if (dbToUpdate.configuration_method === ConfigurationMethod.DynamicForm) {
|
||||
// Validate DB before saving
|
||||
if (dbToUpdate?.parameters?.catalog) {
|
||||
// need to stringify gsheets catalog to allow it to be serialized
|
||||
@@ -836,7 +834,7 @@ const DatabaseModal: FunctionComponent<DatabaseModalProps> = ({
|
||||
const result = await updateResource(
|
||||
db.id as number,
|
||||
dbToUpdate as DatabaseObject,
|
||||
dbToUpdate.configuration_method === CONFIGURATION_METHOD.DYNAMIC_FORM, // onShow toast on SQLA Forms
|
||||
dbToUpdate.configuration_method === ConfigurationMethod.DynamicForm, // onShow toast on SQLA Forms
|
||||
);
|
||||
if (result) {
|
||||
if (onDatabaseAdd) onDatabaseAdd();
|
||||
@@ -861,7 +859,7 @@ const DatabaseModal: FunctionComponent<DatabaseModalProps> = ({
|
||||
// Create
|
||||
const dbId = await createResource(
|
||||
dbToUpdate as DatabaseObject,
|
||||
dbToUpdate.configuration_method === CONFIGURATION_METHOD.DYNAMIC_FORM, // onShow toast on SQLA Forms
|
||||
dbToUpdate.configuration_method === ConfigurationMethod.DynamicForm, // onShow toast on SQLA Forms
|
||||
);
|
||||
if (dbId) {
|
||||
setHasConnectedDb(true);
|
||||
@@ -934,10 +932,10 @@ const DatabaseModal: FunctionComponent<DatabaseModalProps> = ({
|
||||
if (database_name === 'Other') {
|
||||
// Allow users to connect to DB via legacy SQLA form
|
||||
setDB({
|
||||
type: ActionType.dbSelected,
|
||||
type: ActionType.DbSelected,
|
||||
payload: {
|
||||
database_name,
|
||||
configuration_method: CONFIGURATION_METHOD.SQLALCHEMY_URI,
|
||||
configuration_method: ConfigurationMethod.SqlalchemyUri,
|
||||
engine: undefined,
|
||||
engine_information: {
|
||||
supports_file_upload: true,
|
||||
@@ -957,13 +955,13 @@ const DatabaseModal: FunctionComponent<DatabaseModalProps> = ({
|
||||
} = selectedDbModel;
|
||||
const isDynamic = parameters !== undefined;
|
||||
setDB({
|
||||
type: ActionType.dbSelected,
|
||||
type: ActionType.DbSelected,
|
||||
payload: {
|
||||
database_name,
|
||||
engine,
|
||||
configuration_method: isDynamic
|
||||
? CONFIGURATION_METHOD.DYNAMIC_FORM
|
||||
: CONFIGURATION_METHOD.SQLALCHEMY_URI,
|
||||
? ConfigurationMethod.DynamicForm
|
||||
: ConfigurationMethod.SqlalchemyUri,
|
||||
engine_information,
|
||||
driver: default_driver,
|
||||
sqlalchemy_uri_placeholder,
|
||||
@@ -972,7 +970,7 @@ const DatabaseModal: FunctionComponent<DatabaseModalProps> = ({
|
||||
|
||||
if (engine === Engines.GSheet) {
|
||||
// only create a catalog if the DB is Google Sheets
|
||||
setDB({ type: ActionType.addTableCatalogSheet });
|
||||
setDB({ type: ActionType.AddTableCatalogSheet });
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -1086,7 +1084,7 @@ const DatabaseModal: FunctionComponent<DatabaseModalProps> = ({
|
||||
setSSHTunnelPrivateKeys({});
|
||||
setSSHTunnelPrivateKeyPasswords({});
|
||||
}
|
||||
setDB({ type: ActionType.reset });
|
||||
setDB({ type: ActionType.Reset });
|
||||
setFileList([]);
|
||||
};
|
||||
|
||||
@@ -1238,7 +1236,7 @@ const DatabaseModal: FunctionComponent<DatabaseModalProps> = ({
|
||||
useEffect(() => {
|
||||
if (dbFetched) {
|
||||
setDB({
|
||||
type: ActionType.fetched,
|
||||
type: ActionType.Fetched,
|
||||
payload: dbFetched,
|
||||
});
|
||||
// keep a copy of the name separate for display purposes
|
||||
@@ -1545,7 +1543,7 @@ const DatabaseModal: FunctionComponent<DatabaseModalProps> = ({
|
||||
const fetchAndSetDB = () => {
|
||||
setLoading(true);
|
||||
fetchResource(dbFetched?.id as number).then(r => {
|
||||
setItem(LocalStorageKeys.db, r);
|
||||
setItem(LocalStorageKeys.Database, r);
|
||||
});
|
||||
};
|
||||
|
||||
@@ -1557,7 +1555,7 @@ const DatabaseModal: FunctionComponent<DatabaseModalProps> = ({
|
||||
}: {
|
||||
target: HTMLInputElement | HTMLTextAreaElement;
|
||||
}) =>
|
||||
onChange(ActionType.parametersSSHTunnelChange, {
|
||||
onChange(ActionType.ParametersSSHTunnelChange, {
|
||||
type: target.type,
|
||||
name: target.name,
|
||||
value: target.value,
|
||||
@@ -1565,7 +1563,7 @@ const DatabaseModal: FunctionComponent<DatabaseModalProps> = ({
|
||||
}
|
||||
setSSHTunnelLoginMethod={(method: AuthType) =>
|
||||
setDB({
|
||||
type: ActionType.setSSHTunnelLoginMethod,
|
||||
type: ActionType.SetSSHTunnelLoginMethod,
|
||||
payload: { login_method: method },
|
||||
})
|
||||
}
|
||||
@@ -1605,28 +1603,28 @@ const DatabaseModal: FunctionComponent<DatabaseModalProps> = ({
|
||||
sslForced={false}
|
||||
dbModel={dbModel}
|
||||
onAddTableCatalog={() => {
|
||||
setDB({ type: ActionType.addTableCatalogSheet });
|
||||
setDB({ type: ActionType.AddTableCatalogSheet });
|
||||
}}
|
||||
onQueryChange={({ target }: { target: HTMLInputElement }) =>
|
||||
onChange(ActionType.queryChange, {
|
||||
onChange(ActionType.QueryChange, {
|
||||
name: target.name,
|
||||
value: target.value,
|
||||
})
|
||||
}
|
||||
onExtraInputChange={({ target }: { target: HTMLInputElement }) =>
|
||||
onChange(ActionType.extraInputChange, {
|
||||
onChange(ActionType.ExtraInputChange, {
|
||||
name: target.name,
|
||||
value: target.value,
|
||||
})
|
||||
}
|
||||
onRemoveTableCatalog={(idx: number) => {
|
||||
setDB({
|
||||
type: ActionType.removeTableCatalogSheet,
|
||||
type: ActionType.RemoveTableCatalogSheet,
|
||||
payload: { indexToDelete: idx },
|
||||
});
|
||||
}}
|
||||
onParametersChange={({ target }: { target: HTMLInputElement }) =>
|
||||
onChange(ActionType.parametersChange, {
|
||||
onChange(ActionType.ParametersChange, {
|
||||
type: target.type,
|
||||
name: target.name,
|
||||
checked: target.checked,
|
||||
@@ -1634,7 +1632,7 @@ const DatabaseModal: FunctionComponent<DatabaseModalProps> = ({
|
||||
})
|
||||
}
|
||||
onChange={({ target }: { target: HTMLInputElement }) =>
|
||||
onChange(ActionType.textChange, {
|
||||
onChange(ActionType.TextChange, {
|
||||
name: target.name,
|
||||
value: target.value,
|
||||
})
|
||||
@@ -1657,7 +1655,7 @@ const DatabaseModal: FunctionComponent<DatabaseModalProps> = ({
|
||||
extraExtension={dbConfigExtraExtension}
|
||||
db={db as DatabaseObject}
|
||||
onInputChange={({ target }: { target: HTMLInputElement }) =>
|
||||
onChange(ActionType.inputChange, {
|
||||
onChange(ActionType.InputChange, {
|
||||
type: target.type,
|
||||
name: target.name,
|
||||
checked: target.checked,
|
||||
@@ -1665,16 +1663,16 @@ const DatabaseModal: FunctionComponent<DatabaseModalProps> = ({
|
||||
})
|
||||
}
|
||||
onTextChange={({ target }: { target: HTMLTextAreaElement }) =>
|
||||
onChange(ActionType.textChange, {
|
||||
onChange(ActionType.TextChange, {
|
||||
name: target.name,
|
||||
value: target.value,
|
||||
})
|
||||
}
|
||||
onEditorChange={(payload: { name: string; json: any }) =>
|
||||
onChange(ActionType.editorChange, payload)
|
||||
onChange(ActionType.EditorChange, payload)
|
||||
}
|
||||
onExtraInputChange={({ target }: { target: HTMLInputElement }) => {
|
||||
onChange(ActionType.extraInputChange, {
|
||||
onChange(ActionType.ExtraInputChange, {
|
||||
type: target.type,
|
||||
name: target.name,
|
||||
checked: target.checked,
|
||||
@@ -1682,7 +1680,7 @@ const DatabaseModal: FunctionComponent<DatabaseModalProps> = ({
|
||||
});
|
||||
}}
|
||||
onExtraEditorChange={(payload: { name: string; json: any }) =>
|
||||
onChange(ActionType.extraEditorChange, payload)
|
||||
onChange(ActionType.ExtraEditorChange, payload)
|
||||
}
|
||||
/>
|
||||
);
|
||||
@@ -1782,7 +1780,7 @@ const DatabaseModal: FunctionComponent<DatabaseModalProps> = ({
|
||||
<SqlAlchemyForm
|
||||
db={db as DatabaseObject}
|
||||
onInputChange={({ target }: { target: HTMLInputElement }) =>
|
||||
onChange(ActionType.inputChange, {
|
||||
onChange(ActionType.InputChange, {
|
||||
type: target.type,
|
||||
name: target.name,
|
||||
checked: target.checked,
|
||||
@@ -1810,11 +1808,10 @@ const DatabaseModal: FunctionComponent<DatabaseModalProps> = ({
|
||||
buttonStyle="link"
|
||||
onClick={() =>
|
||||
setDB({
|
||||
type: ActionType.configMethodChange,
|
||||
type: ActionType.ConfigMethodChange,
|
||||
payload: {
|
||||
database_name: db?.database_name,
|
||||
configuration_method:
|
||||
CONFIGURATION_METHOD.DYNAMIC_FORM,
|
||||
configuration_method: ConfigurationMethod.DynamicForm,
|
||||
engine: db?.engine,
|
||||
},
|
||||
})
|
||||
@@ -1869,7 +1866,7 @@ const DatabaseModal: FunctionComponent<DatabaseModalProps> = ({
|
||||
extraExtension={dbConfigExtraExtension}
|
||||
db={db as DatabaseObject}
|
||||
onInputChange={({ target }: { target: HTMLInputElement }) =>
|
||||
onChange(ActionType.inputChange, {
|
||||
onChange(ActionType.InputChange, {
|
||||
type: target.type,
|
||||
name: target.name,
|
||||
checked: target.checked,
|
||||
@@ -1877,16 +1874,16 @@ const DatabaseModal: FunctionComponent<DatabaseModalProps> = ({
|
||||
})
|
||||
}
|
||||
onTextChange={({ target }: { target: HTMLTextAreaElement }) =>
|
||||
onChange(ActionType.textChange, {
|
||||
onChange(ActionType.TextChange, {
|
||||
name: target.name,
|
||||
value: target.value,
|
||||
})
|
||||
}
|
||||
onEditorChange={(payload: { name: string; json: any }) =>
|
||||
onChange(ActionType.editorChange, payload)
|
||||
onChange(ActionType.EditorChange, payload)
|
||||
}
|
||||
onExtraInputChange={({ target }: { target: HTMLInputElement }) => {
|
||||
onChange(ActionType.extraInputChange, {
|
||||
onChange(ActionType.ExtraInputChange, {
|
||||
type: target.type,
|
||||
name: target.name,
|
||||
checked: target.checked,
|
||||
@@ -1894,7 +1891,7 @@ const DatabaseModal: FunctionComponent<DatabaseModalProps> = ({
|
||||
});
|
||||
}}
|
||||
onExtraEditorChange={(payload: { name: string; json: any }) => {
|
||||
onChange(ActionType.extraEditorChange, payload);
|
||||
onChange(ActionType.ExtraEditorChange, payload);
|
||||
}}
|
||||
/>
|
||||
</Tabs.TabPane>
|
||||
@@ -1993,11 +1990,11 @@ const DatabaseModal: FunctionComponent<DatabaseModalProps> = ({
|
||||
buttonStyle="link"
|
||||
onClick={() =>
|
||||
setDB({
|
||||
type: ActionType.configMethodChange,
|
||||
type: ActionType.ConfigMethodChange,
|
||||
payload: {
|
||||
engine: db.engine,
|
||||
configuration_method:
|
||||
CONFIGURATION_METHOD.SQLALCHEMY_URI,
|
||||
ConfigurationMethod.SqlalchemyUri,
|
||||
database_name: db.database_name,
|
||||
},
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user