mirror of
https://github.com/ToolJet/ToolJet
synced 2026-05-24 09:28:31 +00:00
fixes: column data generated from restapi does not render correct columns in viewer (#7695)
This commit is contained in:
parent
ec00a7c48d
commit
4e9762f170
2 changed files with 19 additions and 1 deletions
|
|
@ -55,7 +55,7 @@ import { useDataQueries, useDataQueriesStore } from '@/_stores/dataQueriesStore'
|
|||
import { useAppVersionStore, useAppVersionActions, useAppVersionState } from '@/_stores/appVersionStore';
|
||||
import { useQueryPanelStore } from '@/_stores/queryPanelStore';
|
||||
import { useCurrentStateStore, useCurrentState } from '@/_stores/currentStateStore';
|
||||
import { computeAppDiff, computeComponentPropertyDiff, resetAllStores } from '@/_stores/utils';
|
||||
import { computeAppDiff, computeComponentPropertyDiff, isParamFromTableColumn, resetAllStores } from '@/_stores/utils';
|
||||
import { setCookie } from '@/_helpers/cookie';
|
||||
import { shallow } from 'zustand/shallow';
|
||||
import { useEditorActions, useEditorState, useEditorStore } from '@/_stores/editorStore';
|
||||
|
|
@ -801,6 +801,16 @@ const EditorComponent = (props) => {
|
|||
|
||||
updateAppDefinitionDiff(diffPatches);
|
||||
|
||||
const isParamDiffFromTableColumn = opts?.containerChanges
|
||||
? isParamFromTableColumn(diffPatches, updatedAppDefinition)
|
||||
: false;
|
||||
|
||||
if (isParamDiffFromTableColumn) {
|
||||
opts.componentDefinitionChanged = true;
|
||||
opts.isParamFromTableColumn = true;
|
||||
delete opts.containerChanges;
|
||||
}
|
||||
|
||||
updateState({
|
||||
appDiffOptions: opts,
|
||||
});
|
||||
|
|
|
|||
|
|
@ -95,6 +95,14 @@ function updateValueInJson(json, path, value) {
|
|||
return json;
|
||||
}
|
||||
|
||||
export function isParamFromTableColumn(appDiff, definition) {
|
||||
const path = generatePath(appDiff, 'columns') || generatePath(appDiff, 'actions');
|
||||
|
||||
const value2 = getValueFromJson(definition, path);
|
||||
|
||||
return value2 !== undefined;
|
||||
}
|
||||
|
||||
export const computeComponentPropertyDiff = (appDiff, definition, opts) => {
|
||||
if (!opts?.isParamFromTableColumn) {
|
||||
return appDiff;
|
||||
|
|
|
|||
Loading…
Reference in a new issue