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";
|
||||
import CodeMirrorTernService from "utils/autocomplete/CodemirrorTernService";
|
||||
import { getEachEntityInformation } from "ee/utils/autocomplete/EntityDefinitions";
|
||||
import { getCurrentPageId } from "selectors/editorSelectors";
|
||||
|
||||
type ReduxStateProps = ReturnType<typeof mapStateToProps>;
|
||||
type ReduxDispatchProps = ReturnType<typeof mapDispatchToProps>;
|
||||
|
|
@ -1771,26 +1772,33 @@ class CodeEditor extends Component<Props, State> {
|
|||
}
|
||||
}
|
||||
|
||||
const mapStateToProps = (state: AppState, props: EditorProps) => ({
|
||||
dynamicData: getDataTreeForAutocomplete(state),
|
||||
datasources: state.entities.datasources,
|
||||
pluginIdToPlugin: getPluginIdToPlugin(state),
|
||||
recentEntities: getRecentEntityIds(state),
|
||||
lintErrors: getEntityLintErrors(state, props.dataTreePath),
|
||||
editorIsFocused: getIsInputFieldFocused(state, getEditorIdentifier(props)),
|
||||
editorLastCursorPosition: getCodeEditorLastCursorPosition(
|
||||
state,
|
||||
getEditorIdentifier(props),
|
||||
),
|
||||
entitiesForNavigation: getEntitiesForNavigation(
|
||||
state,
|
||||
props.dataTreePath?.split(".")[0],
|
||||
),
|
||||
featureFlags: selectFeatureFlags(state),
|
||||
datasourceTableKeys: getAllDatasourceTableKeys(state, props.dataTreePath),
|
||||
installedLibraries: selectInstalledLibraries(state),
|
||||
focusedProperty: getFocusablePropertyPaneField(state),
|
||||
});
|
||||
const mapStateToProps = (state: AppState, props: EditorProps) => {
|
||||
const currentPageId: string = getCurrentPageId(state);
|
||||
let entitiesForNavigation: EntityNavigationData = {};
|
||||
if (currentPageId) {
|
||||
entitiesForNavigation = getEntitiesForNavigation(
|
||||
state,
|
||||
props.dataTreePath?.split(".")[0],
|
||||
);
|
||||
}
|
||||
return {
|
||||
dynamicData: getDataTreeForAutocomplete(state),
|
||||
datasources: state.entities.datasources,
|
||||
pluginIdToPlugin: getPluginIdToPlugin(state),
|
||||
recentEntities: getRecentEntityIds(state),
|
||||
lintErrors: getEntityLintErrors(state, props.dataTreePath),
|
||||
editorIsFocused: getIsInputFieldFocused(state, getEditorIdentifier(props)),
|
||||
editorLastCursorPosition: getCodeEditorLastCursorPosition(
|
||||
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
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user