Merge branch 'master' of github.com:appsmithorg/appsmith
This commit is contained in:
commit
2be2d441c6
|
|
@ -287,6 +287,7 @@ export const ReduxActionTypes: { [key: string]: string } = {
|
||||||
WIDGET_ADD_CHILDREN: "WIDGET_ADD_CHILDREN",
|
WIDGET_ADD_CHILDREN: "WIDGET_ADD_CHILDREN",
|
||||||
SET_EVALUATED_TREE: "SET_EVALUATED_TREE",
|
SET_EVALUATED_TREE: "SET_EVALUATED_TREE",
|
||||||
BATCH_UPDATES_SUCCESS: "BATCH_UPDATES_SUCCESS",
|
BATCH_UPDATES_SUCCESS: "BATCH_UPDATES_SUCCESS",
|
||||||
|
START_EVALUATION: "START_EVALUATION",
|
||||||
};
|
};
|
||||||
|
|
||||||
export type ReduxActionType = typeof ReduxActionTypes[keyof typeof ReduxActionTypes];
|
export type ReduxActionType = typeof ReduxActionTypes[keyof typeof ReduxActionTypes];
|
||||||
|
|
|
||||||
|
|
@ -45,6 +45,7 @@ function* initializeEditorSaga(
|
||||||
initializeEditorAction: ReduxAction<InitializeEditorPayload>,
|
initializeEditorAction: ReduxAction<InitializeEditorPayload>,
|
||||||
) {
|
) {
|
||||||
const { applicationId, pageId } = initializeEditorAction.payload;
|
const { applicationId, pageId } = initializeEditorAction.payload;
|
||||||
|
yield put({ type: ReduxActionTypes.START_EVALUATION });
|
||||||
// Step 1: Start getting all the data needed by the
|
// Step 1: Start getting all the data needed by the
|
||||||
yield all([
|
yield all([
|
||||||
put(fetchPageList(applicationId)),
|
put(fetchPageList(applicationId)),
|
||||||
|
|
@ -151,6 +152,7 @@ export function* initializeAppViewerSaga(
|
||||||
action: ReduxAction<{ applicationId: string }>,
|
action: ReduxAction<{ applicationId: string }>,
|
||||||
) {
|
) {
|
||||||
const { applicationId } = action.payload;
|
const { applicationId } = action.payload;
|
||||||
|
yield put({ type: ReduxActionTypes.START_EVALUATION });
|
||||||
yield all([
|
yield all([
|
||||||
put(fetchActionsForView(applicationId)),
|
put(fetchActionsForView(applicationId)),
|
||||||
put(fetchPageList(applicationId)),
|
put(fetchPageList(applicationId)),
|
||||||
|
|
|
||||||
|
|
@ -80,10 +80,10 @@ function* evaluateTreeSaga() {
|
||||||
|
|
||||||
export function* evaluateSingleValue(binding: string) {
|
export function* evaluateSingleValue(binding: string) {
|
||||||
if (evaluationWorker) {
|
if (evaluationWorker) {
|
||||||
const evalTree = yield select(getDataTree);
|
const unEvalTree = yield select(getUnevaluatedDataTree);
|
||||||
evaluationWorker.postMessage({
|
evaluationWorker.postMessage({
|
||||||
action: EVAL_WORKER_ACTIONS.EVAL_SINGLE,
|
action: EVAL_WORKER_ACTIONS.EVAL_SINGLE,
|
||||||
dataTree: evalTree,
|
dataTree: unEvalTree,
|
||||||
binding,
|
binding,
|
||||||
});
|
});
|
||||||
const workerResponse = yield take(workerChannel);
|
const workerResponse = yield take(workerChannel);
|
||||||
|
|
@ -215,13 +215,6 @@ function* evaluationChangeListenerSaga() {
|
||||||
|
|
||||||
export default function* evaluationSagaListeners() {
|
export default function* evaluationSagaListeners() {
|
||||||
yield all([
|
yield all([
|
||||||
takeLatest(
|
takeLatest(ReduxActionTypes.START_EVALUATION, evaluationChangeListenerSaga),
|
||||||
ReduxActionTypes.INITIALIZE_EDITOR_SUCCESS,
|
|
||||||
evaluationChangeListenerSaga,
|
|
||||||
),
|
|
||||||
takeLatest(
|
|
||||||
ReduxActionTypes.INITIALIZE_PAGE_VIEWER_SUCCESS,
|
|
||||||
evaluationChangeListenerSaga,
|
|
||||||
),
|
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -63,7 +63,8 @@ ctx.addEventListener("message", e => {
|
||||||
}
|
}
|
||||||
case EVAL_WORKER_ACTIONS.EVAL_SINGLE: {
|
case EVAL_WORKER_ACTIONS.EVAL_SINGLE: {
|
||||||
const { binding, dataTree } = rest;
|
const { binding, dataTree } = rest;
|
||||||
const withFunctions = addFunctions(dataTree);
|
const evalTree = getEvaluatedDataTree(dataTree);
|
||||||
|
const withFunctions = addFunctions(evalTree);
|
||||||
const value = getDynamicValue(binding, withFunctions, false);
|
const value = getDynamicValue(binding, withFunctions, false);
|
||||||
ctx.postMessage({ value, errors: ERRORS });
|
ctx.postMessage({ value, errors: ERRORS });
|
||||||
ERRORS = [];
|
ERRORS = [];
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user