fix: issue with opening custom widget source editor (#35463)
This commit is contained in:
parent
43518e6d58
commit
9b59d4da17
|
|
@ -162,6 +162,7 @@ import {
|
||||||
} from "actions/activeFieldActions";
|
} from "actions/activeFieldActions";
|
||||||
import CodeMirrorTernService from "utils/autocomplete/CodemirrorTernService";
|
import CodeMirrorTernService from "utils/autocomplete/CodemirrorTernService";
|
||||||
import { getEachEntityInformation } from "ee/utils/autocomplete/EntityDefinitions";
|
import { getEachEntityInformation } from "ee/utils/autocomplete/EntityDefinitions";
|
||||||
|
import { getCurrentPageId } from "selectors/editorSelectors";
|
||||||
|
|
||||||
type ReduxStateProps = ReturnType<typeof mapStateToProps>;
|
type ReduxStateProps = ReturnType<typeof mapStateToProps>;
|
||||||
type ReduxDispatchProps = ReturnType<typeof mapDispatchToProps>;
|
type ReduxDispatchProps = ReturnType<typeof mapDispatchToProps>;
|
||||||
|
|
@ -1771,26 +1772,33 @@ class CodeEditor extends Component<Props, State> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const mapStateToProps = (state: AppState, props: EditorProps) => ({
|
const mapStateToProps = (state: AppState, props: EditorProps) => {
|
||||||
dynamicData: getDataTreeForAutocomplete(state),
|
const currentPageId: string = getCurrentPageId(state);
|
||||||
datasources: state.entities.datasources,
|
let entitiesForNavigation: EntityNavigationData = {};
|
||||||
pluginIdToPlugin: getPluginIdToPlugin(state),
|
if (currentPageId) {
|
||||||
recentEntities: getRecentEntityIds(state),
|
entitiesForNavigation = getEntitiesForNavigation(
|
||||||
lintErrors: getEntityLintErrors(state, props.dataTreePath),
|
state,
|
||||||
editorIsFocused: getIsInputFieldFocused(state, getEditorIdentifier(props)),
|
props.dataTreePath?.split(".")[0],
|
||||||
editorLastCursorPosition: getCodeEditorLastCursorPosition(
|
);
|
||||||
state,
|
}
|
||||||
getEditorIdentifier(props),
|
return {
|
||||||
),
|
dynamicData: getDataTreeForAutocomplete(state),
|
||||||
entitiesForNavigation: getEntitiesForNavigation(
|
datasources: state.entities.datasources,
|
||||||
state,
|
pluginIdToPlugin: getPluginIdToPlugin(state),
|
||||||
props.dataTreePath?.split(".")[0],
|
recentEntities: getRecentEntityIds(state),
|
||||||
),
|
lintErrors: getEntityLintErrors(state, props.dataTreePath),
|
||||||
featureFlags: selectFeatureFlags(state),
|
editorIsFocused: getIsInputFieldFocused(state, getEditorIdentifier(props)),
|
||||||
datasourceTableKeys: getAllDatasourceTableKeys(state, props.dataTreePath),
|
editorLastCursorPosition: getCodeEditorLastCursorPosition(
|
||||||
installedLibraries: selectInstalledLibraries(state),
|
state,
|
||||||
focusedProperty: getFocusablePropertyPaneField(state),
|
getEditorIdentifier(props),
|
||||||
});
|
),
|
||||||
|
entitiesForNavigation,
|
||||||
|
featureFlags: selectFeatureFlags(state),
|
||||||
|
datasourceTableKeys: getAllDatasourceTableKeys(state, props.dataTreePath),
|
||||||
|
installedLibraries: selectInstalledLibraries(state),
|
||||||
|
focusedProperty: getFocusablePropertyPaneField(state),
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
// TODO: Fix this the next time the file is edited
|
// TODO: Fix this the next time the file is edited
|
||||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user