mirror of
https://github.com/ToolJet/ToolJet
synced 2026-05-24 09:28:31 +00:00
clean up
This commit is contained in:
parent
2044bf539f
commit
07d6a6cc7b
3 changed files with 24 additions and 37 deletions
|
|
@ -792,29 +792,17 @@ const EditorComponent = (props) => {
|
|||
let dataQueries = JSON.parse(JSON.stringify(useDataQueriesStore.getState().dataQueries));
|
||||
let allEvents = JSON.parse(JSON.stringify(useAppDataStore.getState().events));
|
||||
|
||||
const entityReferencesInComponentDefinitions = findAllEntityReferences(currentComponents, [])
|
||||
?.map((entity) => {
|
||||
if (entity && isValidUUID(entity)) {
|
||||
return entity;
|
||||
}
|
||||
})
|
||||
?.filter((e) => e !== undefined);
|
||||
const entityReferencesInComponentDefinitions = findAllEntityReferences(currentComponents, [])?.filter(
|
||||
(entity) => entity && isValidUUID(entity)
|
||||
);
|
||||
|
||||
const entityReferencesInQueryoOptions = findAllEntityReferences(dataQueries, [])
|
||||
?.map((entity) => {
|
||||
if (entity && isValidUUID(entity)) {
|
||||
return entity;
|
||||
}
|
||||
})
|
||||
?.filter((e) => e !== undefined);
|
||||
const entityReferencesInQueryOptions = findAllEntityReferences(dataQueries, [])?.filter(
|
||||
(entity) => entity && isValidUUID(entity)
|
||||
);
|
||||
|
||||
const entityReferencesInEvents = findAllEntityReferences(allEvents, [])
|
||||
?.map((entity) => {
|
||||
if (entity && isValidUUID(entity)) {
|
||||
return entity;
|
||||
}
|
||||
})
|
||||
?.filter((e) => e !== undefined);
|
||||
const entityReferencesInEvents = findAllEntityReferences(allEvents, [])?.filter(
|
||||
(entity) => entity && isValidUUID(entity)
|
||||
);
|
||||
|
||||
const manager = useResolveStore.getState().referenceMapper;
|
||||
|
||||
|
|
@ -843,14 +831,14 @@ const EditorComponent = (props) => {
|
|||
});
|
||||
}
|
||||
|
||||
if (Array.isArray(entityReferencesInQueryoOptions) && entityReferencesInQueryoOptions?.length > 0) {
|
||||
if (Array.isArray(entityReferencesInQueryOptions) && entityReferencesInQueryOptions?.length > 0) {
|
||||
let newQueryOptions = {};
|
||||
dataQueries?.forEach((query) => {
|
||||
newQueryOptions[query.id] = query.options;
|
||||
``;
|
||||
});
|
||||
|
||||
entityReferencesInQueryoOptions.forEach((entity) => {
|
||||
entityReferencesInQueryOptions.forEach((entity) => {
|
||||
const entityrefExists = manager.has(entity);
|
||||
|
||||
if (entityrefExists) {
|
||||
|
|
|
|||
|
|
@ -1300,14 +1300,16 @@ export function runQuery(
|
|||
},
|
||||
});
|
||||
|
||||
useResolveStore.getState().actions.addAppSuggestions({
|
||||
queries: {
|
||||
[queryName]: {
|
||||
data: finalData,
|
||||
isLoading: false,
|
||||
if (mode === 'edit') {
|
||||
useResolveStore.getState().actions.addAppSuggestions({
|
||||
queries: {
|
||||
[queryName]: {
|
||||
data: finalData,
|
||||
isLoading: false,
|
||||
},
|
||||
},
|
||||
},
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
const basePath = `queries.${queryName}`;
|
||||
|
||||
|
|
|
|||
|
|
@ -111,13 +111,10 @@ export const useAppDataStore = create(
|
|||
}
|
||||
});
|
||||
|
||||
const entityReferencesInEvents = findAllEntityReferences(updatedEvents, [])
|
||||
?.map((entity) => {
|
||||
if (entity && isValidUUID(entity)) {
|
||||
return entity;
|
||||
}
|
||||
})
|
||||
?.filter((e) => e !== undefined);
|
||||
const entityReferencesInEvents = findAllEntityReferences(updatedEvents, [])?.filter(
|
||||
(entity) => entity && isValidUUID(entity)
|
||||
);
|
||||
|
||||
const manager = useResolveStore.getState().referenceMapper;
|
||||
let newEvents = JSON.parse(JSON.stringify(updatedEvents));
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue