fix: not able to save datasource + module option shown in create app dropdown (#9308)

This commit is contained in:
Kiran Ashok 2024-04-05 17:53:05 +05:30 committed by GitHub
parent 3590171356
commit 2a8d672ee0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 6 additions and 10 deletions

View file

@ -21,14 +21,17 @@ import { withTranslation, useTranslation } from 'react-i18next';
import { camelizeKeys, decamelizeKeys } from 'humps';
import { ButtonSolid } from '@/_ui/AppButton/AppButton';
import SolidIcon from '@/_ui/Icon/SolidIcons';
import { useAppVersionStore } from '@/_stores/appVersionStore';
import { ConfirmDialog } from '@/_components';
import { deepEqual } from '../../_helpers/utils';
import { shallow } from 'zustand/shallow';
import { useDataSourcesStore } from '../../_stores/dataSourcesStore';
import { withRouter } from '@/_hoc/withRouter';
import { useSuperStore } from '@/_stores/superStore';
import { ModuleContext } from '@/_contexts/ModuleContext';
class DataSourceManagerComponent extends React.Component {
static contextType = ModuleContext;
constructor(props) {
super(props);
@ -38,7 +41,6 @@ class DataSourceManagerComponent extends React.Component {
let options = {};
let dataSourceMeta = {};
let datasourceName = '';
if (props.selectedDataSource) {
selectedDataSource = props.selectedDataSource;
options = selectedDataSource.options;
@ -197,7 +199,8 @@ class DataSourceManagerComponent extends React.Component {
const name = selectedDataSource.name;
const kind = selectedDataSource.kind;
const pluginId = selectedDataSourcePluginId;
const appVersionId = useAppVersionStore?.getState()?.editingVersion?.id;
const appVersionId = useSuperStore.getState().modules[this.context].useAppVersionStore?.getState()
?.editingVersion?.id;
const currentEnvironment = this.props.currentEnvironment?.id;
const scope = this.state?.scope || selectedDataSource?.scope;

View file

@ -800,13 +800,6 @@ class HomePageComponent extends React.Component {
data-cy="import-option-input"
/>
</label>
<Dropdown.Item
className="homepage-dropdown-style tj-text tj-text-xsm"
onClick={() => this.setState({ showCreateModuleModal: true })}
data-cy="create-module-button"
>
{this.props.t('homePage.header.createModule', 'Create module')}
</Dropdown.Item>
</Dropdown.Menu>
</Dropdown>
</div>