2020-12-30 07:31:20 +00:00
|
|
|
import { GenericApiResponse } from "api/ApiResponses";
|
2021-01-12 04:17:28 +00:00
|
|
|
import DatasourcesApi from "api/DatasourcesApi";
|
|
|
|
|
import { Datasource } from "entities/Datasource";
|
2020-12-30 07:31:20 +00:00
|
|
|
import { Plugin } from "api/PluginApi";
|
|
|
|
|
import {
|
|
|
|
|
ReduxActionErrorTypes,
|
|
|
|
|
ReduxActionTypes,
|
|
|
|
|
} from "constants/ReduxActionConstants";
|
|
|
|
|
import { AppState } from "reducers";
|
|
|
|
|
import {
|
|
|
|
|
all,
|
2021-02-11 06:36:07 +00:00
|
|
|
call,
|
2020-12-30 07:31:20 +00:00
|
|
|
cancel,
|
|
|
|
|
delay,
|
2021-02-11 06:36:07 +00:00
|
|
|
fork,
|
2020-12-30 07:31:20 +00:00
|
|
|
put,
|
|
|
|
|
select,
|
|
|
|
|
take,
|
2021-02-11 06:36:07 +00:00
|
|
|
takeLatest,
|
2020-12-30 07:31:20 +00:00
|
|
|
} from "redux-saga/effects";
|
|
|
|
|
import {
|
|
|
|
|
getCanvasWidgets,
|
|
|
|
|
getDatasources,
|
|
|
|
|
getPlugins,
|
|
|
|
|
} from "selectors/entitiesSelector";
|
|
|
|
|
import { getDataTree } from "selectors/dataTreeSelectors";
|
|
|
|
|
import { getCurrentOrgId } from "selectors/organizationSelectors";
|
2021-02-11 06:36:07 +00:00
|
|
|
import {
|
|
|
|
|
getOnboardingState,
|
|
|
|
|
setOnboardingState,
|
|
|
|
|
setOnboardingWelcomeState,
|
|
|
|
|
} from "utils/storage";
|
2020-12-30 07:31:20 +00:00
|
|
|
import { validateResponse } from "./ErrorSagas";
|
2021-02-11 06:36:07 +00:00
|
|
|
import { getSelectedWidget, getWidgets } from "./selectors";
|
2020-12-30 07:31:20 +00:00
|
|
|
import {
|
2021-02-11 06:36:07 +00:00
|
|
|
endOnboarding,
|
2020-12-30 07:31:20 +00:00
|
|
|
setCurrentStep,
|
2021-02-11 06:36:07 +00:00
|
|
|
setCurrentSubstep,
|
|
|
|
|
setHelperConfig,
|
2020-12-30 07:31:20 +00:00
|
|
|
setOnboardingState as setOnboardingReduxState,
|
|
|
|
|
showIndicator,
|
2021-02-11 06:36:07 +00:00
|
|
|
showOnboardingHelper,
|
2020-12-30 07:31:20 +00:00
|
|
|
} from "actions/onboardingActions";
|
|
|
|
|
import {
|
|
|
|
|
changeDatasource,
|
|
|
|
|
expandDatasourceEntity,
|
|
|
|
|
} from "actions/datasourceActions";
|
2021-02-11 06:36:07 +00:00
|
|
|
import {
|
|
|
|
|
playOnboardingAnimation,
|
|
|
|
|
playOnboardingStepCompletionAnimation,
|
|
|
|
|
} from "utils/helpers";
|
2020-12-30 07:31:20 +00:00
|
|
|
import {
|
|
|
|
|
OnboardingConfig,
|
2021-02-11 06:36:07 +00:00
|
|
|
OnboardingHelperConfig,
|
2020-12-30 07:31:20 +00:00
|
|
|
OnboardingStep,
|
|
|
|
|
} from "constants/OnboardingConstants";
|
|
|
|
|
import AnalyticsUtil from "../utils/AnalyticsUtil";
|
|
|
|
|
import { get } from "lodash";
|
2021-02-11 06:36:07 +00:00
|
|
|
import { AppIconCollection } from "components/ads/AppIcon";
|
|
|
|
|
import { getUserApplicationsOrgs } from "selectors/applicationSelectors";
|
2021-02-11 12:54:00 +00:00
|
|
|
import { getAppCardColorPalette } from "selectors/themeSelectors";
|
2021-02-11 06:36:07 +00:00
|
|
|
import {
|
|
|
|
|
getRandomPaletteColor,
|
|
|
|
|
getNextEntityName,
|
|
|
|
|
getQueryParams,
|
|
|
|
|
} from "utils/AppsmithUtils";
|
|
|
|
|
import { getCurrentUser } from "selectors/usersSelectors";
|
|
|
|
|
import {
|
|
|
|
|
getCurrentApplicationId,
|
|
|
|
|
getCurrentPageId,
|
2021-03-25 07:53:56 +00:00
|
|
|
getIsEditorInitialized,
|
2021-02-11 06:36:07 +00:00
|
|
|
} from "selectors/editorSelectors";
|
|
|
|
|
import { createActionRequest, runActionInit } from "actions/actionActions";
|
|
|
|
|
import {
|
|
|
|
|
APPLICATIONS_URL,
|
|
|
|
|
BUILDER_PAGE_URL,
|
2021-07-07 03:46:16 +00:00
|
|
|
INTEGRATION_EDITOR_URL,
|
|
|
|
|
INTEGRATION_TABS,
|
2021-02-11 06:36:07 +00:00
|
|
|
} from "constants/routes";
|
|
|
|
|
import { QueryAction } from "entities/Action";
|
|
|
|
|
import history from "utils/history";
|
|
|
|
|
import { getQueryIdFromURL } from "pages/Editor/Explorer/helpers";
|
|
|
|
|
// import { calculateNewWidgetPosition } from "./WidgetOperationSagas";
|
|
|
|
|
import { RenderModes, WidgetTypes } from "constants/WidgetConstants";
|
|
|
|
|
import { generateReactKey } from "utils/generators";
|
|
|
|
|
import { forceOpenPropertyPane } from "actions/widgetActions";
|
2021-06-17 13:26:54 +00:00
|
|
|
import { navigateToCanvas } from "pages/Editor/Explorer/Widgets/utils";
|
2021-02-11 06:36:07 +00:00
|
|
|
import {
|
2021-03-09 05:30:57 +00:00
|
|
|
batchUpdateWidgetProperty,
|
2021-02-11 06:36:07 +00:00
|
|
|
updateWidgetPropertyRequest,
|
2021-06-21 11:09:51 +00:00
|
|
|
} from "actions/controlActions";
|
2021-02-11 06:36:07 +00:00
|
|
|
import OnSubmitGif from "assets/gifs/onsubmit.gif";
|
2021-04-06 10:17:25 +00:00
|
|
|
import { checkAndGetPluginFormConfigsSaga } from "sagas/PluginSagas";
|
2021-05-18 18:29:39 +00:00
|
|
|
import { GRID_DENSITY_MIGRATION_V1 } from "mockResponses/WidgetConfigResponse";
|
2021-06-21 11:09:51 +00:00
|
|
|
import {
|
|
|
|
|
EVAL_ERROR_PATH,
|
|
|
|
|
EvaluationError,
|
|
|
|
|
PropertyEvaluationErrorType,
|
|
|
|
|
} from "utils/DynamicBindingUtils";
|
2020-12-30 07:31:20 +00:00
|
|
|
|
|
|
|
|
export const getCurrentStep = (state: AppState) =>
|
|
|
|
|
state.ui.onBoarding.currentStep;
|
2021-02-11 06:36:07 +00:00
|
|
|
export const getCurrentSubStep = (state: AppState) =>
|
|
|
|
|
state.ui.onBoarding.currentSubstep;
|
2020-12-30 07:31:20 +00:00
|
|
|
export const inOnboarding = (state: AppState) =>
|
|
|
|
|
state.ui.onBoarding.inOnboarding;
|
|
|
|
|
export const isAddWidgetComplete = (state: AppState) =>
|
|
|
|
|
state.ui.onBoarding.addedWidget;
|
|
|
|
|
export const showCompletionDialog = (state: AppState) => {
|
|
|
|
|
const isInOnboarding = inOnboarding(state);
|
|
|
|
|
const currentStep = getCurrentStep(state);
|
|
|
|
|
|
|
|
|
|
return isInOnboarding && currentStep === OnboardingStep.DEPLOY;
|
|
|
|
|
};
|
|
|
|
|
export const getInitialTableData = (state: AppState) => {
|
|
|
|
|
const widgetConfig = state.entities.widgetConfig;
|
|
|
|
|
|
|
|
|
|
return widgetConfig.config.TABLE_WIDGET.tableData;
|
|
|
|
|
};
|
2021-02-11 06:36:07 +00:00
|
|
|
export const getHelperConfig = (step: OnboardingStep) => {
|
|
|
|
|
return OnboardingConfig[step].helper as OnboardingHelperConfig;
|
|
|
|
|
};
|
|
|
|
|
export const checkCurrentStep = (
|
|
|
|
|
state: AppState,
|
|
|
|
|
step: OnboardingStep,
|
|
|
|
|
comparison: "EQAULS" | "LESSER" = "EQAULS",
|
|
|
|
|
) => {
|
|
|
|
|
const isInOnboarding = inOnboarding(state);
|
|
|
|
|
const currentStep = getCurrentStep(state);
|
|
|
|
|
|
|
|
|
|
switch (comparison) {
|
|
|
|
|
case "LESSER":
|
|
|
|
|
return isInOnboarding && currentStep < step;
|
|
|
|
|
default:
|
|
|
|
|
return isInOnboarding && currentStep === step;
|
|
|
|
|
}
|
|
|
|
|
};
|
2020-12-30 07:31:20 +00:00
|
|
|
|
|
|
|
|
function* listenForWidgetAdditions() {
|
|
|
|
|
while (true) {
|
|
|
|
|
yield take();
|
|
|
|
|
|
|
|
|
|
const selectedWidget = yield select(getSelectedWidget);
|
|
|
|
|
const canvasWidgets = yield select(getCanvasWidgets);
|
|
|
|
|
const initialTableData = yield select(getInitialTableData);
|
|
|
|
|
|
|
|
|
|
// Updating the tableData property to []
|
|
|
|
|
if (
|
|
|
|
|
selectedWidget &&
|
|
|
|
|
selectedWidget.type === "TABLE_WIDGET" &&
|
|
|
|
|
canvasWidgets[selectedWidget.widgetId]
|
|
|
|
|
) {
|
2021-02-11 06:36:07 +00:00
|
|
|
if (
|
|
|
|
|
selectedWidget.widgetName === "Standup_Table" ||
|
|
|
|
|
selectedWidget.tableData === initialTableData
|
|
|
|
|
) {
|
2021-01-25 08:57:26 +00:00
|
|
|
yield put(
|
2021-03-09 05:30:57 +00:00
|
|
|
batchUpdateWidgetProperty(selectedWidget.widgetId, {
|
|
|
|
|
modify: {
|
2021-03-25 07:53:56 +00:00
|
|
|
widgetName: "Standup_Table",
|
2021-03-09 05:30:57 +00:00
|
|
|
tableData: [],
|
|
|
|
|
columnSizeMap: {
|
|
|
|
|
avatar: 20,
|
|
|
|
|
name: 30,
|
|
|
|
|
},
|
|
|
|
|
migrated: false,
|
|
|
|
|
...getStandupTableDimensions(),
|
2021-02-11 06:36:07 +00:00
|
|
|
},
|
|
|
|
|
}),
|
2021-01-25 08:57:26 +00:00
|
|
|
);
|
2020-12-30 07:31:20 +00:00
|
|
|
}
|
|
|
|
|
|
2021-02-11 06:36:07 +00:00
|
|
|
AnalyticsUtil.logEvent("ONBOARDING_ADD_WIDGET_TABLE");
|
|
|
|
|
yield put(setCurrentStep(OnboardingStep.SUCCESSFUL_BINDING));
|
2020-12-30 07:31:20 +00:00
|
|
|
yield put({
|
|
|
|
|
type: ReduxActionTypes.ADD_WIDGET_COMPLETE,
|
|
|
|
|
});
|
2021-02-11 06:36:07 +00:00
|
|
|
yield put(
|
|
|
|
|
setHelperConfig(getHelperConfig(OnboardingStep.SUCCESSFUL_BINDING)),
|
|
|
|
|
);
|
2020-12-30 07:31:20 +00:00
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2021-02-11 06:36:07 +00:00
|
|
|
function* listenForAddInputWidget() {
|
|
|
|
|
while (true) {
|
|
|
|
|
yield take();
|
|
|
|
|
const canvasWidgets = yield select(getCanvasWidgets);
|
|
|
|
|
const currentPageId = yield select(getCurrentPageId);
|
|
|
|
|
const applicationId = yield select(getCurrentApplicationId);
|
|
|
|
|
const widgets = yield select(getWidgets);
|
|
|
|
|
|
|
|
|
|
const inputWidget: any = Object.values(widgets).find(
|
|
|
|
|
(widget: any) => widget.type === "INPUT_WIDGET",
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
if (
|
|
|
|
|
inputWidget &&
|
|
|
|
|
inputWidget.type === "INPUT_WIDGET" &&
|
|
|
|
|
canvasWidgets[inputWidget.widgetId]
|
|
|
|
|
) {
|
|
|
|
|
if (
|
|
|
|
|
!window.location.pathname.includes(
|
|
|
|
|
BUILDER_PAGE_URL(applicationId, currentPageId),
|
|
|
|
|
)
|
|
|
|
|
) {
|
|
|
|
|
yield cancel();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
AnalyticsUtil.logEvent("ONBOARDING_ADD_WIDGET_INPUT");
|
|
|
|
|
|
|
|
|
|
if (inputWidget.widgetName !== "Standup_Input") {
|
|
|
|
|
yield put(
|
|
|
|
|
updateWidgetPropertyRequest(
|
|
|
|
|
inputWidget.widgetId,
|
|
|
|
|
"widgetName",
|
|
|
|
|
"Standup_Input",
|
|
|
|
|
RenderModes.CANVAS,
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
yield put(
|
2021-03-09 05:30:57 +00:00
|
|
|
batchUpdateWidgetProperty(inputWidget.widgetId, {
|
|
|
|
|
modify: {
|
|
|
|
|
...getStandupInputDimensions(),
|
|
|
|
|
...getStandupInputProps(),
|
|
|
|
|
},
|
2021-02-11 06:36:07 +00:00
|
|
|
}),
|
|
|
|
|
);
|
|
|
|
|
yield put(setCurrentSubstep(2));
|
|
|
|
|
|
|
|
|
|
yield put(showIndicator(OnboardingStep.ADD_INPUT_WIDGET));
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-10 04:14:43 +00:00
|
|
|
const helperConfig: OnboardingHelperConfig = yield select(
|
2021-02-11 06:36:07 +00:00
|
|
|
(state) => state.ui.onBoarding.helperStepConfig,
|
|
|
|
|
);
|
|
|
|
|
const onSubmitGifUrl = OnSubmitGif;
|
|
|
|
|
|
2021-03-10 04:14:43 +00:00
|
|
|
if (helperConfig.image?.src !== onSubmitGifUrl) {
|
2021-02-11 06:36:07 +00:00
|
|
|
yield put(
|
|
|
|
|
setHelperConfig({
|
|
|
|
|
...helperConfig,
|
|
|
|
|
image: {
|
|
|
|
|
src: onSubmitGifUrl,
|
|
|
|
|
},
|
|
|
|
|
}),
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
yield take(ReduxActionTypes.CREATE_ACTION_SUCCESS);
|
|
|
|
|
const dataTree = yield select(getDataTree);
|
|
|
|
|
|
|
|
|
|
const updatedInputWidget = dataTree["Standup_Input"];
|
|
|
|
|
|
2021-02-24 06:00:22 +00:00
|
|
|
if (updatedInputWidget) {
|
|
|
|
|
const dynamicTriggerPathList =
|
|
|
|
|
updatedInputWidget.dynamicTriggerPathList;
|
|
|
|
|
const hasOnSubmitHandler =
|
|
|
|
|
dynamicTriggerPathList &&
|
|
|
|
|
dynamicTriggerPathList.length &&
|
|
|
|
|
dynamicTriggerPathList.some(
|
|
|
|
|
(trigger: any) => trigger.key === "onSubmit",
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
if (hasOnSubmitHandler) {
|
|
|
|
|
yield put(
|
|
|
|
|
updateWidgetPropertyRequest(
|
|
|
|
|
inputWidget.widgetId,
|
|
|
|
|
"onSubmit",
|
|
|
|
|
"{{add_standup_updates.run(() => fetch_standup_updates.run(), () => {})}}",
|
|
|
|
|
RenderModes.CANVAS,
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
AnalyticsUtil.logEvent("ONBOARDING_ONSUBMIT_SUCCESS");
|
2021-02-11 06:36:07 +00:00
|
|
|
|
2021-02-24 06:00:22 +00:00
|
|
|
yield put(setCurrentStep(OnboardingStep.DEPLOY));
|
|
|
|
|
yield put(setHelperConfig(getHelperConfig(OnboardingStep.DEPLOY)));
|
2021-02-11 06:36:07 +00:00
|
|
|
|
2021-02-24 06:00:22 +00:00
|
|
|
return;
|
|
|
|
|
}
|
2021-02-11 06:36:07 +00:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2021-01-25 08:57:26 +00:00
|
|
|
function* listenForSuccessfulBinding() {
|
2020-12-30 07:31:20 +00:00
|
|
|
while (true) {
|
|
|
|
|
yield take();
|
|
|
|
|
|
2021-01-25 08:57:26 +00:00
|
|
|
let bindSuccessful = true;
|
2021-03-25 07:53:56 +00:00
|
|
|
const selectedWidget = yield call(getStandupTableWidget);
|
2020-12-30 07:31:20 +00:00
|
|
|
if (selectedWidget && selectedWidget.type === "TABLE_WIDGET") {
|
|
|
|
|
const dataTree = yield select(getDataTree);
|
|
|
|
|
|
|
|
|
|
if (dataTree[selectedWidget.widgetName]) {
|
|
|
|
|
const dynamicBindingPathList =
|
|
|
|
|
dataTree[selectedWidget.widgetName].dynamicBindingPathList;
|
2021-01-15 09:19:15 +00:00
|
|
|
const tableHasData = dataTree[selectedWidget.widgetName].tableData;
|
2021-01-06 04:08:18 +00:00
|
|
|
const hasBinding =
|
2021-02-11 06:36:07 +00:00
|
|
|
dynamicBindingPathList &&
|
|
|
|
|
!!dynamicBindingPathList.length &&
|
|
|
|
|
dynamicBindingPathList.some(
|
|
|
|
|
(item: { key: string }) => item.key === "tableData",
|
|
|
|
|
);
|
2021-06-21 11:09:51 +00:00
|
|
|
const errors = get(
|
|
|
|
|
selectedWidget,
|
|
|
|
|
`${EVAL_ERROR_PATH}.tableData`,
|
|
|
|
|
[],
|
|
|
|
|
).filter(
|
|
|
|
|
(error: EvaluationError) =>
|
|
|
|
|
error.errorType !== PropertyEvaluationErrorType.LINT,
|
|
|
|
|
);
|
2020-12-30 07:31:20 +00:00
|
|
|
|
2021-01-25 08:57:26 +00:00
|
|
|
bindSuccessful =
|
2021-06-21 11:09:51 +00:00
|
|
|
bindSuccessful &&
|
|
|
|
|
hasBinding &&
|
|
|
|
|
Array.isArray(tableHasData) &&
|
|
|
|
|
tableHasData.length &&
|
|
|
|
|
errors.length === 0;
|
2020-12-30 07:31:20 +00:00
|
|
|
|
2021-01-25 08:57:26 +00:00
|
|
|
if (bindSuccessful) {
|
2021-02-11 06:36:07 +00:00
|
|
|
yield put(
|
2021-03-09 05:30:57 +00:00
|
|
|
batchUpdateWidgetProperty(selectedWidget.widgetId, {
|
|
|
|
|
modify: {
|
|
|
|
|
columnTypeMap: {
|
|
|
|
|
avatar: {
|
|
|
|
|
type: "image",
|
|
|
|
|
format: "",
|
|
|
|
|
},
|
2021-02-11 06:36:07 +00:00
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
}),
|
|
|
|
|
);
|
2021-01-08 06:06:09 +00:00
|
|
|
AnalyticsUtil.logEvent("ONBOARDING_SUCCESSFUL_BINDING");
|
2021-02-11 06:36:07 +00:00
|
|
|
yield put(setCurrentStep(OnboardingStep.ADD_INPUT_WIDGET));
|
2020-12-30 07:31:20 +00:00
|
|
|
|
|
|
|
|
yield delay(1000);
|
|
|
|
|
|
2021-02-11 06:36:07 +00:00
|
|
|
yield put(
|
|
|
|
|
setHelperConfig(getHelperConfig(OnboardingStep.ADD_INPUT_WIDGET)),
|
|
|
|
|
);
|
2020-12-30 07:31:20 +00:00
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function* createOnboardingDatasource() {
|
2021-02-11 06:36:07 +00:00
|
|
|
AnalyticsUtil.logEvent("ONBOARDING_INTRODUCTION");
|
2021-01-08 06:06:09 +00:00
|
|
|
|
2020-12-30 07:31:20 +00:00
|
|
|
try {
|
2021-03-25 07:53:56 +00:00
|
|
|
const isEditorInitialized = yield select(getIsEditorInitialized);
|
|
|
|
|
if (!isEditorInitialized)
|
|
|
|
|
yield take(ReduxActionTypes.INITIALIZE_EDITOR_SUCCESS);
|
2021-02-11 06:36:07 +00:00
|
|
|
|
2020-12-30 07:31:20 +00:00
|
|
|
const organizationId = yield select(getCurrentOrgId);
|
|
|
|
|
const plugins = yield select(getPlugins);
|
|
|
|
|
const postgresPlugin = plugins.find(
|
|
|
|
|
(plugin: Plugin) => plugin.name === "PostgreSQL",
|
|
|
|
|
);
|
|
|
|
|
const datasources: Datasource[] = yield select(getDatasources);
|
|
|
|
|
let onboardingDatasource = datasources.find((datasource) => {
|
2021-02-11 06:36:07 +00:00
|
|
|
const name = get(datasource, "name");
|
2020-12-30 07:31:20 +00:00
|
|
|
|
2021-02-11 06:36:07 +00:00
|
|
|
return name === "Super Updates DB";
|
2020-12-30 07:31:20 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
|
|
if (!onboardingDatasource) {
|
|
|
|
|
const datasourceConfig: any = {
|
|
|
|
|
pluginId: postgresPlugin.id,
|
2021-02-11 06:36:07 +00:00
|
|
|
name: "Super Updates DB",
|
2020-12-30 07:31:20 +00:00
|
|
|
organizationId,
|
|
|
|
|
datasourceConfiguration: {
|
|
|
|
|
connection: {
|
|
|
|
|
mode: "READ_WRITE",
|
2021-03-25 07:53:56 +00:00
|
|
|
ssl: { authType: "DEFAULT" },
|
2020-12-30 07:31:20 +00:00
|
|
|
},
|
|
|
|
|
endpoints: [
|
|
|
|
|
{
|
|
|
|
|
host: "fake-api.cvuydmurdlas.us-east-1.rds.amazonaws.com",
|
|
|
|
|
port: 5432,
|
|
|
|
|
},
|
|
|
|
|
],
|
|
|
|
|
authentication: {
|
|
|
|
|
databaseName: "fakeapi",
|
|
|
|
|
username: "fakeapi",
|
|
|
|
|
password: "LimitedAccess123#",
|
|
|
|
|
},
|
2021-03-25 07:53:56 +00:00
|
|
|
sshProxyEnabled: false,
|
2020-12-30 07:31:20 +00:00
|
|
|
},
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
const datasourceResponse: GenericApiResponse<Datasource> = yield DatasourcesApi.createDatasource(
|
|
|
|
|
datasourceConfig,
|
|
|
|
|
);
|
|
|
|
|
yield validateResponse(datasourceResponse);
|
2021-04-06 10:17:25 +00:00
|
|
|
yield checkAndGetPluginFormConfigsSaga(postgresPlugin.id);
|
2020-12-30 07:31:20 +00:00
|
|
|
yield put({
|
|
|
|
|
type: ReduxActionTypes.CREATE_DATASOURCE_SUCCESS,
|
|
|
|
|
payload: datasourceResponse.data,
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
onboardingDatasource = datasourceResponse.data;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
yield put(expandDatasourceEntity(onboardingDatasource.id));
|
|
|
|
|
|
|
|
|
|
yield put({
|
|
|
|
|
type: ReduxActionTypes.CREATE_ONBOARDING_DBQUERY_SUCCESS,
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
// Navigate to that datasource page
|
|
|
|
|
yield put(changeDatasource(onboardingDatasource));
|
2021-02-11 06:36:07 +00:00
|
|
|
|
|
|
|
|
yield take(ReduxActionTypes.SHOW_ONBOARDING_LOADER);
|
|
|
|
|
yield put(
|
|
|
|
|
setHelperConfig(getHelperConfig(OnboardingStep.EXAMPLE_DATABASE)),
|
|
|
|
|
);
|
|
|
|
|
yield put(showOnboardingHelper(true));
|
2020-12-30 07:31:20 +00:00
|
|
|
} catch (error) {
|
|
|
|
|
yield put({
|
|
|
|
|
type: ReduxActionErrorTypes.CREATE_ONBOARDING_DBQUERY_ERROR,
|
|
|
|
|
payload: { error },
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function* listenForCreateAction() {
|
2021-02-11 06:36:07 +00:00
|
|
|
const helperConfig = getHelperConfig(OnboardingStep.EXAMPLE_DATABASE);
|
|
|
|
|
yield put(showIndicator(OnboardingStep.EXAMPLE_DATABASE));
|
|
|
|
|
|
2020-12-30 07:31:20 +00:00
|
|
|
yield take([ReduxActionTypes.CREATE_ACTION_SUCCESS]);
|
2021-01-08 06:06:09 +00:00
|
|
|
AnalyticsUtil.logEvent("ONBOARDING_ADD_QUERY");
|
2021-02-11 06:36:07 +00:00
|
|
|
yield put(
|
|
|
|
|
setHelperConfig({
|
|
|
|
|
...helperConfig,
|
|
|
|
|
image: {
|
|
|
|
|
src:
|
|
|
|
|
"https://res.cloudinary.com/drako999/image/upload/v1611839705/Appsmith/Onboarding/run.gif",
|
|
|
|
|
},
|
|
|
|
|
}),
|
|
|
|
|
);
|
|
|
|
|
yield put(setCurrentSubstep(2));
|
2020-12-30 07:31:20 +00:00
|
|
|
|
|
|
|
|
yield take([
|
|
|
|
|
ReduxActionTypes.UPDATE_ACTION_INIT,
|
|
|
|
|
ReduxActionTypes.QUERY_PANE_CHANGE,
|
|
|
|
|
ReduxActionTypes.RUN_ACTION_INIT,
|
|
|
|
|
]);
|
|
|
|
|
|
|
|
|
|
yield take([ReduxActionTypes.RUN_ACTION_SUCCESS]);
|
2021-01-08 06:06:09 +00:00
|
|
|
AnalyticsUtil.logEvent("ONBOARDING_RUN_QUERY");
|
2021-02-11 06:36:07 +00:00
|
|
|
yield put(setHelperConfig(getHelperConfig(OnboardingStep.RUN_QUERY_SUCCESS)));
|
|
|
|
|
yield put(showIndicator(OnboardingStep.RUN_QUERY_SUCCESS));
|
2021-01-08 06:06:09 +00:00
|
|
|
|
2020-12-30 07:31:20 +00:00
|
|
|
yield put(setCurrentStep(OnboardingStep.RUN_QUERY_SUCCESS));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function* listenForDeploySaga() {
|
|
|
|
|
while (true) {
|
|
|
|
|
yield take();
|
2021-02-11 06:36:07 +00:00
|
|
|
yield put(showIndicator(OnboardingStep.DEPLOY));
|
2020-12-30 07:31:20 +00:00
|
|
|
|
|
|
|
|
yield take(ReduxActionTypes.PUBLISH_APPLICATION_SUCCESS);
|
2021-01-08 06:06:09 +00:00
|
|
|
AnalyticsUtil.logEvent("ONBOARDING_DEPLOY");
|
2021-01-06 04:08:18 +00:00
|
|
|
|
2021-02-11 06:36:07 +00:00
|
|
|
yield call(setOnboardingWelcomeState, false);
|
2021-01-06 04:08:18 +00:00
|
|
|
yield put(setCurrentStep(OnboardingStep.FINISH));
|
2020-12-30 07:31:20 +00:00
|
|
|
yield put(setOnboardingReduxState(false));
|
|
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function* initiateOnboarding() {
|
|
|
|
|
const currentOnboardingState = yield getOnboardingState();
|
2021-02-11 06:36:07 +00:00
|
|
|
|
2020-12-30 07:31:20 +00:00
|
|
|
if (currentOnboardingState) {
|
|
|
|
|
yield put(setOnboardingReduxState(true));
|
2021-02-11 06:36:07 +00:00
|
|
|
|
|
|
|
|
yield put(setCurrentStep(OnboardingStep.WELCOME));
|
|
|
|
|
yield put(setCurrentStep(OnboardingStep.EXAMPLE_DATABASE));
|
2020-12-30 07:31:20 +00:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function* proceedOnboardingSaga() {
|
|
|
|
|
const isInOnboarding = yield select(inOnboarding);
|
|
|
|
|
|
|
|
|
|
if (isInOnboarding) {
|
|
|
|
|
yield put({
|
|
|
|
|
type: ReduxActionTypes.INCREMENT_STEP,
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
yield setupOnboardingStep();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function* setupOnboardingStep() {
|
|
|
|
|
const currentStep: OnboardingStep = yield select(getCurrentStep);
|
|
|
|
|
const currentConfig = OnboardingConfig[currentStep];
|
|
|
|
|
let actions = currentConfig.setup();
|
|
|
|
|
|
|
|
|
|
if (actions.length) {
|
|
|
|
|
actions = actions.map((action) => put(action));
|
|
|
|
|
yield all(actions);
|
|
|
|
|
}
|
2021-02-11 06:36:07 +00:00
|
|
|
|
|
|
|
|
yield delay(500);
|
|
|
|
|
playOnboardingStepCompletionAnimation();
|
2020-12-30 07:31:20 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function* skipOnboardingSaga() {
|
2021-02-11 06:36:07 +00:00
|
|
|
const set = yield call(setOnboardingState, false);
|
|
|
|
|
const resetWelcomeState = yield call(setOnboardingWelcomeState, false);
|
2020-12-30 07:31:20 +00:00
|
|
|
|
2021-02-11 06:36:07 +00:00
|
|
|
if (set && resetWelcomeState) {
|
2020-12-30 07:31:20 +00:00
|
|
|
yield put(setOnboardingReduxState(false));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2021-02-11 06:36:07 +00:00
|
|
|
function* returnHomeSaga() {
|
|
|
|
|
history.push(APPLICATIONS_URL);
|
|
|
|
|
yield put(endOnboarding());
|
|
|
|
|
|
|
|
|
|
AnalyticsUtil.logEvent("ONBOARDING_GO_HOME");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function* showEndOnboardingHelperSaga() {
|
|
|
|
|
const params = getQueryParams();
|
|
|
|
|
const inOnboarding = yield call(getOnboardingState);
|
|
|
|
|
|
|
|
|
|
if (params.onboardingComplete && inOnboarding) {
|
|
|
|
|
yield put(
|
|
|
|
|
setHelperConfig(
|
|
|
|
|
getHelperConfig(OnboardingStep.FINISH) as OnboardingHelperConfig,
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
AnalyticsUtil.logEvent("ONBOARDING_COMPLETE");
|
|
|
|
|
yield put(setCurrentSubstep(5));
|
|
|
|
|
|
|
|
|
|
yield delay(1000);
|
|
|
|
|
yield call(playOnboardingAnimation);
|
|
|
|
|
yield put(showOnboardingHelper(true));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Cheat actions
|
|
|
|
|
function* createApplication() {
|
2021-02-11 12:54:00 +00:00
|
|
|
const colorPalette = yield select(getAppCardColorPalette);
|
|
|
|
|
const color = getRandomPaletteColor(colorPalette);
|
2021-02-11 06:36:07 +00:00
|
|
|
const icon =
|
|
|
|
|
AppIconCollection[Math.floor(Math.random() * AppIconCollection.length)];
|
|
|
|
|
|
|
|
|
|
const currentUser = yield select(getCurrentUser);
|
|
|
|
|
const userOrgs = yield select(getUserApplicationsOrgs);
|
|
|
|
|
const currentOrganizationId = currentUser.currentOrganizationId;
|
|
|
|
|
let organization;
|
|
|
|
|
|
2021-03-01 09:51:23 +00:00
|
|
|
if (!currentOrganizationId) {
|
2021-02-11 06:36:07 +00:00
|
|
|
organization = userOrgs[0];
|
|
|
|
|
} else {
|
|
|
|
|
const filteredOrganizations = userOrgs.filter(
|
|
|
|
|
(org: any) => org.organization.id === currentOrganizationId,
|
|
|
|
|
);
|
|
|
|
|
organization = filteredOrganizations[0];
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-01 09:51:23 +00:00
|
|
|
// Organization could be undefined for unknown reason
|
|
|
|
|
if (organization) {
|
|
|
|
|
const applicationList = organization.applications;
|
2021-02-11 06:36:07 +00:00
|
|
|
|
2021-03-01 09:51:23 +00:00
|
|
|
const applicationName = getNextEntityName(
|
|
|
|
|
"Super Standup ",
|
|
|
|
|
applicationList.map((el: any) => el.name),
|
|
|
|
|
true,
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
yield put({
|
|
|
|
|
type: ReduxActionTypes.CREATE_APPLICATION_INIT,
|
|
|
|
|
payload: {
|
|
|
|
|
applicationName,
|
|
|
|
|
orgId: organization.organization.id,
|
|
|
|
|
icon,
|
|
|
|
|
color,
|
|
|
|
|
},
|
|
|
|
|
});
|
2021-02-11 06:36:07 +00:00
|
|
|
|
2021-03-01 09:51:23 +00:00
|
|
|
yield take(ReduxActionTypes.CREATE_APPLICATION_SUCCESS);
|
|
|
|
|
yield call(initiateOnboarding);
|
|
|
|
|
}
|
2021-02-11 06:36:07 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function* createQuery() {
|
|
|
|
|
const currentPageId = yield select(getCurrentPageId);
|
|
|
|
|
const applicationId = yield select(getCurrentApplicationId);
|
2021-06-24 09:12:12 +00:00
|
|
|
const currentSubstep = yield select(getCurrentSubStep);
|
2021-02-11 06:36:07 +00:00
|
|
|
const datasources: Datasource[] = yield select(getDatasources);
|
|
|
|
|
const onboardingDatasource = datasources.find((datasource) => {
|
|
|
|
|
const name = get(datasource, "name");
|
|
|
|
|
|
|
|
|
|
return name === "Super Updates DB";
|
|
|
|
|
});
|
|
|
|
|
|
2021-06-24 09:12:12 +00:00
|
|
|
// If the user is on substep 2 of the CREATE_QUERY step
|
|
|
|
|
// just run the query.
|
|
|
|
|
if (currentSubstep == 2) {
|
|
|
|
|
yield put({
|
|
|
|
|
type: "ONBOARDING_RUN_QUERY",
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
AnalyticsUtil.logEvent("ONBOARDING_CHEAT", {
|
|
|
|
|
step: 1,
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
2021-02-11 06:36:07 +00:00
|
|
|
if (onboardingDatasource) {
|
|
|
|
|
const payload = {
|
|
|
|
|
name: "fetch_standup_updates",
|
|
|
|
|
pageId: currentPageId,
|
|
|
|
|
pluginId: onboardingDatasource?.pluginId,
|
|
|
|
|
datasource: {
|
|
|
|
|
id: onboardingDatasource?.id,
|
|
|
|
|
},
|
|
|
|
|
actionConfiguration: {
|
|
|
|
|
body:
|
|
|
|
|
"Select avatar, name, notes from standup_updates order by id desc",
|
2021-03-25 07:53:56 +00:00
|
|
|
timeoutInMillisecond: 30000,
|
2021-02-11 06:36:07 +00:00
|
|
|
},
|
|
|
|
|
} as Partial<QueryAction>;
|
|
|
|
|
|
|
|
|
|
yield put(createActionRequest(payload));
|
|
|
|
|
history.push(
|
2021-07-07 03:46:16 +00:00
|
|
|
INTEGRATION_EDITOR_URL(
|
2021-02-11 06:36:07 +00:00
|
|
|
applicationId,
|
|
|
|
|
currentPageId,
|
2021-07-07 03:46:16 +00:00
|
|
|
INTEGRATION_TABS.ACTIVE,
|
2021-02-11 06:36:07 +00:00
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
yield take(ReduxActionTypes.CREATE_ACTION_SUCCESS);
|
|
|
|
|
yield put({
|
|
|
|
|
type: "ONBOARDING_RUN_QUERY",
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
AnalyticsUtil.logEvent("ONBOARDING_CHEAT", {
|
|
|
|
|
step: 1,
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function* executeQuery() {
|
|
|
|
|
const queryId = getQueryIdFromURL();
|
|
|
|
|
|
|
|
|
|
if (queryId) {
|
|
|
|
|
yield put(runActionInit(queryId));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function* addWidget(widgetConfig: any) {
|
|
|
|
|
try {
|
|
|
|
|
const newWidget = {
|
|
|
|
|
newWidgetId: generateReactKey(),
|
|
|
|
|
widgetId: "0",
|
|
|
|
|
parentId: "0",
|
|
|
|
|
renderMode: RenderModes.CANVAS,
|
|
|
|
|
isLoading: false,
|
|
|
|
|
...widgetConfig,
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
yield put({
|
|
|
|
|
type: ReduxActionTypes.WIDGET_ADD_CHILD,
|
|
|
|
|
payload: newWidget,
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
const applicationId = yield select(getCurrentApplicationId);
|
|
|
|
|
const pageId = yield select(getCurrentPageId);
|
|
|
|
|
|
|
|
|
|
navigateToCanvas(
|
|
|
|
|
{
|
|
|
|
|
applicationId,
|
|
|
|
|
pageId,
|
|
|
|
|
},
|
|
|
|
|
window.location.pathname,
|
|
|
|
|
pageId,
|
|
|
|
|
newWidget.newWidgetId,
|
|
|
|
|
);
|
|
|
|
|
yield put({
|
2021-06-17 13:26:54 +00:00
|
|
|
type: ReduxActionTypes.SELECT_WIDGET_INIT,
|
2021-02-11 06:36:07 +00:00
|
|
|
payload: { widgetId: newWidget.newWidgetId },
|
|
|
|
|
});
|
|
|
|
|
yield put(forceOpenPropertyPane(newWidget.newWidgetId));
|
|
|
|
|
} catch (error) {}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const getStandupTableDimensions = () => {
|
2021-05-18 18:29:39 +00:00
|
|
|
const columns = 16 * GRID_DENSITY_MIGRATION_V1;
|
|
|
|
|
const rows = 15 * GRID_DENSITY_MIGRATION_V1;
|
|
|
|
|
const topRow = 2 * GRID_DENSITY_MIGRATION_V1;
|
2021-02-11 06:36:07 +00:00
|
|
|
const bottomRow = rows + topRow;
|
|
|
|
|
return {
|
|
|
|
|
parentRowSpace: 40,
|
|
|
|
|
parentColumnSpace: 1,
|
2021-05-18 18:29:39 +00:00
|
|
|
topRow,
|
2021-02-11 06:36:07 +00:00
|
|
|
bottomRow,
|
|
|
|
|
leftColumn: 0,
|
|
|
|
|
rightColumn: columns,
|
|
|
|
|
columns: columns,
|
|
|
|
|
rows: rows,
|
|
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
const getStandupInputDimensions = () => {
|
2021-05-18 18:29:39 +00:00
|
|
|
const columns = 6 * GRID_DENSITY_MIGRATION_V1;
|
|
|
|
|
const rows = 1 * GRID_DENSITY_MIGRATION_V1;
|
|
|
|
|
const leftColumn = 5 * GRID_DENSITY_MIGRATION_V1;
|
2021-02-11 06:36:07 +00:00
|
|
|
const rightColumn = leftColumn + columns;
|
|
|
|
|
return {
|
2021-05-18 18:29:39 +00:00
|
|
|
topRow: 1 * GRID_DENSITY_MIGRATION_V1,
|
|
|
|
|
bottomRow: 2 * GRID_DENSITY_MIGRATION_V1,
|
2021-02-11 06:36:07 +00:00
|
|
|
leftColumn,
|
|
|
|
|
rightColumn,
|
|
|
|
|
rows,
|
|
|
|
|
columns,
|
|
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
const getStandupInputProps = () => ({
|
|
|
|
|
placeholderText: "Type your update and hit enter!",
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
function* addTableWidget() {
|
|
|
|
|
yield call(addWidget, {
|
|
|
|
|
type: WidgetTypes.TABLE_WIDGET,
|
|
|
|
|
widgetName: "Standup_Table",
|
|
|
|
|
...getStandupTableDimensions(),
|
|
|
|
|
props: {
|
|
|
|
|
tableData: [],
|
|
|
|
|
},
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
AnalyticsUtil.logEvent("ONBOARDING_ADD_WIDGET_CLICK");
|
|
|
|
|
AnalyticsUtil.logEvent("ONBOARDING_CHEAT", {
|
|
|
|
|
step: 2,
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function* addInputWidget() {
|
|
|
|
|
yield call(addWidget, {
|
|
|
|
|
type: WidgetTypes.INPUT_WIDGET,
|
|
|
|
|
widgetName: "Standup_Input",
|
|
|
|
|
...getStandupInputDimensions(),
|
|
|
|
|
props: getStandupInputProps(),
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
yield call(addOnSubmitHandler);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function* addOnSubmitHandler() {
|
|
|
|
|
// Creating a query first
|
|
|
|
|
const currentPageId = yield select(getCurrentPageId);
|
|
|
|
|
const datasources: Datasource[] = yield select(getDatasources);
|
|
|
|
|
const onboardingDatasource = datasources.find((datasource) => {
|
|
|
|
|
const name = get(datasource, "name");
|
|
|
|
|
|
|
|
|
|
return name === "Super Updates DB";
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
if (onboardingDatasource) {
|
|
|
|
|
const payload = {
|
|
|
|
|
name: "add_standup_updates",
|
|
|
|
|
pageId: currentPageId,
|
|
|
|
|
pluginId: onboardingDatasource?.pluginId,
|
|
|
|
|
datasource: {
|
|
|
|
|
id: onboardingDatasource?.id,
|
|
|
|
|
},
|
|
|
|
|
actionConfiguration: {
|
|
|
|
|
body: `Insert into standup_updates("name", "notes") values ('{{appsmith.user.email}}', '{{ Standup_Input.text }}')`,
|
|
|
|
|
},
|
|
|
|
|
} as Partial<QueryAction>;
|
|
|
|
|
|
|
|
|
|
yield put(createActionRequest(payload));
|
|
|
|
|
|
|
|
|
|
yield take(ReduxActionTypes.CREATE_ACTION_SUCCESS);
|
|
|
|
|
|
|
|
|
|
const widgets = yield select(getWidgets);
|
|
|
|
|
const inputWidget: any = Object.values(widgets).find(
|
|
|
|
|
(widget: any) => widget.type === "INPUT_WIDGET",
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
if (inputWidget) {
|
|
|
|
|
yield delay(1000);
|
|
|
|
|
|
|
|
|
|
const applicationId = yield select(getCurrentApplicationId);
|
|
|
|
|
const pageId = yield select(getCurrentPageId);
|
|
|
|
|
|
|
|
|
|
navigateToCanvas(
|
|
|
|
|
{
|
|
|
|
|
applicationId,
|
|
|
|
|
pageId,
|
|
|
|
|
},
|
|
|
|
|
window.location.pathname,
|
|
|
|
|
pageId,
|
|
|
|
|
inputWidget.widgetId,
|
|
|
|
|
);
|
|
|
|
|
yield put({
|
2021-06-17 13:26:54 +00:00
|
|
|
type: ReduxActionTypes.SELECT_WIDGET_INIT,
|
2021-02-11 06:36:07 +00:00
|
|
|
payload: { widgetId: inputWidget.widgetId },
|
|
|
|
|
});
|
|
|
|
|
yield put(forceOpenPropertyPane(inputWidget.widgetId));
|
|
|
|
|
|
|
|
|
|
yield put(
|
|
|
|
|
updateWidgetPropertyRequest(
|
|
|
|
|
inputWidget.widgetId,
|
|
|
|
|
"onSubmit",
|
|
|
|
|
"{{add_standup_updates.run(() => fetch_standup_updates.run(), () => {})}}",
|
|
|
|
|
RenderModes.CANVAS,
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
AnalyticsUtil.logEvent("ONBOARDING_ONSUBMIT_SUCCESS");
|
|
|
|
|
|
|
|
|
|
yield put(setCurrentStep(OnboardingStep.DEPLOY));
|
|
|
|
|
yield put(setHelperConfig(getHelperConfig(OnboardingStep.DEPLOY)));
|
|
|
|
|
|
|
|
|
|
AnalyticsUtil.logEvent("ONBOARDING_CHEAT", {
|
|
|
|
|
step: 4,
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-25 07:53:56 +00:00
|
|
|
function* getStandupTableWidget() {
|
|
|
|
|
const canvasWidgets: Record<string, any> = yield select(getCanvasWidgets);
|
|
|
|
|
const result =
|
|
|
|
|
Object.entries(canvasWidgets).find((widgetEntry) => {
|
|
|
|
|
const [, widget] = widgetEntry;
|
|
|
|
|
return widget.widgetName === "Standup_Table";
|
|
|
|
|
}) || [];
|
|
|
|
|
const standupTable = result[1];
|
|
|
|
|
return standupTable;
|
|
|
|
|
}
|
2021-02-11 06:36:07 +00:00
|
|
|
|
2021-03-25 07:53:56 +00:00
|
|
|
function* addBinding() {
|
|
|
|
|
const standupTable = yield call(getStandupTableWidget);
|
|
|
|
|
if (standupTable) {
|
2021-02-11 06:36:07 +00:00
|
|
|
yield put(
|
|
|
|
|
updateWidgetPropertyRequest(
|
2021-03-25 07:53:56 +00:00
|
|
|
standupTable.widgetId,
|
2021-02-11 06:36:07 +00:00
|
|
|
"tableData",
|
|
|
|
|
"{{fetch_standup_updates.data}}",
|
|
|
|
|
RenderModes.CANVAS,
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
AnalyticsUtil.logEvent("ONBOARDING_CHEAT", {
|
|
|
|
|
step: 3,
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function* deploy() {
|
|
|
|
|
const applicationId = yield select(getCurrentApplicationId);
|
|
|
|
|
yield put({
|
|
|
|
|
type: ReduxActionTypes.PUBLISH_APPLICATION_INIT,
|
|
|
|
|
payload: {
|
|
|
|
|
applicationId,
|
|
|
|
|
},
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
AnalyticsUtil.logEvent("ONBOARDING_CHEAT", {
|
|
|
|
|
step: 5,
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
2020-12-30 07:31:20 +00:00
|
|
|
export default function* onboardingSagas() {
|
2021-02-11 06:36:07 +00:00
|
|
|
while (true) {
|
|
|
|
|
const task = yield fork(onboardingActionSagas);
|
|
|
|
|
|
|
|
|
|
yield take(ReduxActionTypes.END_ONBOARDING);
|
|
|
|
|
yield cancel(task);
|
|
|
|
|
yield call(skipOnboardingSaga);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function* onboardingActionSagas() {
|
2020-12-30 07:31:20 +00:00
|
|
|
yield all([
|
2021-02-11 06:36:07 +00:00
|
|
|
takeLatest(
|
2020-12-30 07:31:20 +00:00
|
|
|
ReduxActionTypes.CREATE_ONBOARDING_DBQUERY_INIT,
|
|
|
|
|
createOnboardingDatasource,
|
|
|
|
|
),
|
2021-02-11 06:36:07 +00:00
|
|
|
takeLatest(ReduxActionTypes.NEXT_ONBOARDING_STEP, proceedOnboardingSaga),
|
|
|
|
|
takeLatest(
|
|
|
|
|
ReduxActionTypes.LISTEN_FOR_CREATE_ACTION,
|
|
|
|
|
listenForCreateAction,
|
|
|
|
|
),
|
|
|
|
|
takeLatest(
|
|
|
|
|
ReduxActionTypes.LISTEN_FOR_ADD_WIDGET,
|
|
|
|
|
listenForWidgetAdditions,
|
|
|
|
|
),
|
|
|
|
|
takeLatest(
|
|
|
|
|
ReduxActionTypes.LISTEN_ADD_INPUT_WIDGET,
|
|
|
|
|
listenForAddInputWidget,
|
|
|
|
|
),
|
|
|
|
|
takeLatest(
|
2020-12-30 07:31:20 +00:00
|
|
|
ReduxActionTypes.LISTEN_FOR_TABLE_WIDGET_BINDING,
|
2021-01-25 08:57:26 +00:00
|
|
|
listenForSuccessfulBinding,
|
2020-12-30 07:31:20 +00:00
|
|
|
),
|
2021-02-11 06:36:07 +00:00
|
|
|
takeLatest(ReduxActionTypes.SET_CURRENT_STEP, setupOnboardingStep),
|
|
|
|
|
takeLatest(ReduxActionTypes.LISTEN_FOR_DEPLOY, listenForDeploySaga),
|
|
|
|
|
takeLatest(ReduxActionTypes.ONBOARDING_RETURN_HOME, returnHomeSaga),
|
|
|
|
|
takeLatest(
|
|
|
|
|
ReduxActionTypes.SHOW_END_ONBOARDING_HELPER,
|
|
|
|
|
showEndOnboardingHelperSaga,
|
|
|
|
|
),
|
|
|
|
|
// Cheat actions
|
|
|
|
|
takeLatest(ReduxActionTypes.ONBOARDING_CREATE_QUERY, createQuery),
|
|
|
|
|
takeLatest(ReduxActionTypes.ONBOARDING_RUN_QUERY, executeQuery),
|
|
|
|
|
takeLatest(ReduxActionTypes.ONBOARDING_ADD_TABLE_WIDGET, addTableWidget),
|
|
|
|
|
takeLatest(ReduxActionTypes.ONBOARDING_ADD_INPUT_WIDGET, addInputWidget),
|
|
|
|
|
takeLatest(
|
|
|
|
|
ReduxActionTypes.ONBOARDING_ADD_ONSUBMIT_BINDING,
|
|
|
|
|
addOnSubmitHandler,
|
|
|
|
|
),
|
|
|
|
|
takeLatest(ReduxActionTypes.ONBOARDING_ADD_TABLEDATA_BINDING, addBinding),
|
|
|
|
|
takeLatest(ReduxActionTypes.ONBOARDING_DEPLOY, deploy),
|
|
|
|
|
takeLatest(
|
|
|
|
|
ReduxActionTypes.ONBOARDING_CREATE_APPLICATION,
|
|
|
|
|
createApplication,
|
|
|
|
|
),
|
2020-12-30 07:31:20 +00:00
|
|
|
]);
|
|
|
|
|
}
|