* Changes to add js plugin * routes+reducer+create template * added debugger to js editor page * entity explorer changes * create js function * added copy, move and delete action * added js plugin * added existing js functions to data tree * removed actionconfig for js collection * new js function added to data tree and entity as well * parsing flow added * changes to data tree * parse and update js functions * small changes for def creator for js action * create delete modified * small changes for update * update flow change * entity properties added * removed linting errors * small changes in entity explorer * changes for update * move, copy implementation * conflict resolved * changes for dependecy map creation * Only make the variables the binding paths * Basic eval sync working * Minor fixes * removed unwanted code * entity props and autocomplete * saving in progress show * redirection fix after delete js action * removed unnecessary line * Fixing merge conflict * added sample body * removed dummy data and added plugin Type * few PR comments fixed * automplete fix * few more PR comments fix * PR commnets fix * move and copy api change * js colleciton name refactor & 'move to page' changes & search * view changes * autocomplete added for js collections * removing till async is implemented * small changes * separate js pane response view * Executing functions * js collection to js objects * entity explorer issue and resolve action on page switch * removed unused line * small color fix * js file icon added * added js action to property pane * Property pane changes for actions * property pane changes for js functions * showing syntax error for now * actions sorted in response tab * added js objects to slash and recent entitties * enabling this to be used inside of function * eval fix * feature flag changes for entity explorer and property pane * debugger changes * copy bug fix * small changes for eval * debugger bug fix * chnaged any to specific types * error in console fix * icons update * fixed test case * test case fix * non empty check for functions * evaluate test case fix * added new icons * text change * updated time for debounce for trial * after release mereg * changed icon * after merge * PR comments simple * fixed PR comments - redux form, settings remove * js object interface changes * name refactor * export default change * delete resolve actions chnage * after merge * adding execute fn as 3rd option and removed create new js function * issue 7054 fixed - app crash * execute function on response tab changes * refactor function name part 1 * refactor of js function name * try catch added refactor * test fix * not used line removed * test cases locator fixed Co-authored-by: Nidhi <nidhi.nair93@gmail.com> Co-authored-by: hetunandu <hetu@appsmith.com>
88 lines
2.3 KiB
TypeScript
88 lines
2.3 KiB
TypeScript
import { createSelector } from "reselect";
|
|
import {
|
|
getActionsForCurrentPage,
|
|
getAppData,
|
|
getPluginDependencyConfig,
|
|
getPluginEditorConfigs,
|
|
getJSCollectionsForCurrentPage,
|
|
} from "./entitiesSelector";
|
|
import { ActionDataState } from "reducers/entityReducers/actionsReducer";
|
|
import { DataTree, DataTreeFactory } from "entities/DataTree/dataTreeFactory";
|
|
import { getWidgets, getWidgetsMeta } from "sagas/selectors";
|
|
import "url-search-params-polyfill";
|
|
import { getPageList } from "./appViewSelectors";
|
|
import { AppState } from "reducers";
|
|
|
|
export const getUnevaluatedDataTree = createSelector(
|
|
getActionsForCurrentPage,
|
|
getJSCollectionsForCurrentPage,
|
|
getWidgets,
|
|
getWidgetsMeta,
|
|
getPageList,
|
|
getAppData,
|
|
getPluginEditorConfigs,
|
|
getPluginDependencyConfig,
|
|
(
|
|
actions,
|
|
jsActions,
|
|
widgets,
|
|
widgetsMeta,
|
|
pageListPayload,
|
|
appData,
|
|
editorConfigs,
|
|
pluginDependencyConfig,
|
|
) => {
|
|
const pageList = pageListPayload || [];
|
|
return DataTreeFactory.create({
|
|
actions,
|
|
jsActions,
|
|
widgets,
|
|
widgetsMeta,
|
|
pageList,
|
|
appData,
|
|
editorConfigs,
|
|
pluginDependencyConfig,
|
|
});
|
|
},
|
|
);
|
|
|
|
export const getEvaluationInverseDependencyMap = (state: AppState) =>
|
|
state.evaluations.dependencies.inverseDependencyMap;
|
|
|
|
export const getLoadingEntities = (state: AppState) =>
|
|
state.evaluations.loadingEntities;
|
|
|
|
/**
|
|
* returns evaluation tree object
|
|
*
|
|
* @param state
|
|
*/
|
|
export const getDataTree = (state: AppState): DataTree =>
|
|
state.evaluations.tree;
|
|
|
|
// For autocomplete. Use actions cached responses if
|
|
// there isn't a response already
|
|
export const getDataTreeForAutocomplete = createSelector(
|
|
getDataTree,
|
|
getActionsForCurrentPage,
|
|
getJSCollectionsForCurrentPage,
|
|
(tree: DataTree, actions: ActionDataState) => {
|
|
//js actions needs to be added
|
|
const cachedResponses: Record<string, any> = {};
|
|
if (actions && actions.length) {
|
|
actions.forEach((action) => {
|
|
if (!(action.config.name in tree) && action.config.cacheResponse) {
|
|
try {
|
|
cachedResponses[action.config.name] = JSON.parse(
|
|
action.config.cacheResponse,
|
|
);
|
|
} catch (e) {
|
|
cachedResponses[action.config.name] = action.config.cacheResponse;
|
|
}
|
|
}
|
|
});
|
|
}
|
|
return tree;
|
|
},
|
|
);
|