Hotfix redux-form getting destroyed (#2908)
This commit is contained in:
parent
3d43d04658
commit
0a6040c1cd
|
|
@ -28,6 +28,8 @@ import Boxed from "components/editorComponents/Onboarding/Boxed";
|
||||||
import { OnboardingStep } from "constants/OnboardingConstants";
|
import { OnboardingStep } from "constants/OnboardingConstants";
|
||||||
import { isHidden } from "components/formControls/utils";
|
import { isHidden } from "components/formControls/utils";
|
||||||
import log from "loglevel";
|
import log from "loglevel";
|
||||||
|
import { Spinner } from "@blueprintjs/core";
|
||||||
|
import CenteredWrapper from "components/designSystems/appsmith/CenteredWrapper";
|
||||||
|
|
||||||
const { cloudHosting } = getAppsmithConfigs();
|
const { cloudHosting } = getAppsmithConfigs();
|
||||||
|
|
||||||
|
|
@ -41,6 +43,7 @@ interface DatasourceDBEditorProps {
|
||||||
isDeleting: boolean;
|
isDeleting: boolean;
|
||||||
datasourceId: string;
|
datasourceId: string;
|
||||||
applicationId: string;
|
applicationId: string;
|
||||||
|
loadingFormConfigs: boolean;
|
||||||
pageId: string;
|
pageId: string;
|
||||||
formData: Datasource;
|
formData: Datasource;
|
||||||
isTesting: boolean;
|
isTesting: boolean;
|
||||||
|
|
@ -58,6 +61,10 @@ interface DatasourceDBEditorState {
|
||||||
type Props = DatasourceDBEditorProps &
|
type Props = DatasourceDBEditorProps &
|
||||||
InjectedFormProps<Datasource, DatasourceDBEditorProps>;
|
InjectedFormProps<Datasource, DatasourceDBEditorProps>;
|
||||||
|
|
||||||
|
export const LoadingContainer = styled(CenteredWrapper)`
|
||||||
|
height: 50%;
|
||||||
|
`;
|
||||||
|
|
||||||
const DBForm = styled.div`
|
const DBForm = styled.div`
|
||||||
padding: 20px;
|
padding: 20px;
|
||||||
margin-left: 10px;
|
margin-left: 10px;
|
||||||
|
|
@ -208,7 +215,14 @@ class DatasourceDBEditor extends React.Component<
|
||||||
};
|
};
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
const { formConfig } = this.props;
|
const { formConfig, loadingFormConfigs } = this.props;
|
||||||
|
if (loadingFormConfigs) {
|
||||||
|
return (
|
||||||
|
<LoadingContainer>
|
||||||
|
<Spinner size={30} />
|
||||||
|
</LoadingContainer>
|
||||||
|
);
|
||||||
|
}
|
||||||
const content = this.renderDataSourceConfigForm(formConfig);
|
const content = this.renderDataSourceConfigForm(formConfig);
|
||||||
return <DBForm>{content}</DBForm>;
|
return <DBForm>{content}</DBForm>;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -19,6 +19,8 @@ import Boxed from "components/editorComponents/Onboarding/Boxed";
|
||||||
import { OnboardingStep } from "constants/OnboardingConstants";
|
import { OnboardingStep } from "constants/OnboardingConstants";
|
||||||
import { isHidden } from "components/formControls/utils";
|
import { isHidden } from "components/formControls/utils";
|
||||||
import log from "loglevel";
|
import log from "loglevel";
|
||||||
|
import { Spinner } from "@blueprintjs/core";
|
||||||
|
import CenteredWrapper from "components/designSystems/appsmith/CenteredWrapper";
|
||||||
|
|
||||||
interface DatasourceDBEditorProps {
|
interface DatasourceDBEditorProps {
|
||||||
onSave: (formValues: Datasource) => void;
|
onSave: (formValues: Datasource) => void;
|
||||||
|
|
@ -29,6 +31,7 @@ interface DatasourceDBEditorProps {
|
||||||
isSaving: boolean;
|
isSaving: boolean;
|
||||||
isDeleting: boolean;
|
isDeleting: boolean;
|
||||||
datasourceId: string;
|
datasourceId: string;
|
||||||
|
loadingFormConfigs: boolean;
|
||||||
applicationId: string;
|
applicationId: string;
|
||||||
pageId: string;
|
pageId: string;
|
||||||
formData: Datasource;
|
formData: Datasource;
|
||||||
|
|
@ -64,6 +67,10 @@ const DBForm = styled.div`
|
||||||
}
|
}
|
||||||
`;
|
`;
|
||||||
|
|
||||||
|
export const LoadingContainer = styled(CenteredWrapper)`
|
||||||
|
height: 50%;
|
||||||
|
`;
|
||||||
|
|
||||||
const PluginImage = styled.img`
|
const PluginImage = styled.img`
|
||||||
height: 40px;
|
height: 40px;
|
||||||
width: auto;
|
width: auto;
|
||||||
|
|
@ -186,7 +193,14 @@ class DatasourceDBEditor extends React.Component<
|
||||||
};
|
};
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
const { formConfig } = this.props;
|
const { loadingFormConfigs, formConfig } = this.props;
|
||||||
|
if (loadingFormConfigs) {
|
||||||
|
return (
|
||||||
|
<LoadingContainer>
|
||||||
|
<Spinner size={30} />
|
||||||
|
</LoadingContainer>
|
||||||
|
);
|
||||||
|
}
|
||||||
const content = this.renderDataSourceConfigForm(formConfig);
|
const content = this.renderDataSourceConfigForm(formConfig);
|
||||||
return <DBForm>{content}</DBForm>;
|
return <DBForm>{content}</DBForm>;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -24,13 +24,6 @@ import { Datasource } from "entities/Datasource";
|
||||||
import { RouteComponentProps } from "react-router";
|
import { RouteComponentProps } from "react-router";
|
||||||
import EntityNotFoundPane from "pages/Editor/EntityNotFoundPane";
|
import EntityNotFoundPane from "pages/Editor/EntityNotFoundPane";
|
||||||
import { PluginType } from "entities/Action";
|
import { PluginType } from "entities/Action";
|
||||||
import { Spinner } from "@blueprintjs/core";
|
|
||||||
import CenteredWrapper from "components/designSystems/appsmith/CenteredWrapper";
|
|
||||||
import styled from "styled-components";
|
|
||||||
|
|
||||||
export const LoadingContainer = styled(CenteredWrapper)`
|
|
||||||
height: 50%;
|
|
||||||
`;
|
|
||||||
|
|
||||||
interface ReduxStateProps {
|
interface ReduxStateProps {
|
||||||
formData: Datasource;
|
formData: Datasource;
|
||||||
|
|
@ -112,13 +105,6 @@ class DataSourceEditor extends React.Component<Props> {
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
if (loadingFormConfigs) {
|
|
||||||
return (
|
|
||||||
<LoadingContainer>
|
|
||||||
<Spinner size={30} />
|
|
||||||
</LoadingContainer>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
const DatasourceForm =
|
const DatasourceForm =
|
||||||
pluginType === PluginType.API
|
pluginType === PluginType.API
|
||||||
? RestAPIDatasourceForm
|
? RestAPIDatasourceForm
|
||||||
|
|
@ -137,6 +123,7 @@ class DataSourceEditor extends React.Component<Props> {
|
||||||
onTest={this.props.testDatasource}
|
onTest={this.props.testDatasource}
|
||||||
selectedPluginPackage={selectedPluginPackage}
|
selectedPluginPackage={selectedPluginPackage}
|
||||||
datasourceId={datasourceId}
|
datasourceId={datasourceId}
|
||||||
|
loadingFormConfigs={loadingFormConfigs}
|
||||||
formData={formData}
|
formData={formData}
|
||||||
formConfig={formConfig}
|
formConfig={formConfig}
|
||||||
handleDelete={deleteDatasource}
|
handleDelete={deleteDatasource}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user