chore: update analytic events to capture SSH tunnel configuration for MySQL (#27810)
This commit is contained in:
parent
38b66b4505
commit
61edd66187
|
|
@ -16,7 +16,7 @@ import {
|
||||||
initialize,
|
initialize,
|
||||||
isValid,
|
isValid,
|
||||||
} from "redux-form";
|
} from "redux-form";
|
||||||
import { merge, isEmpty, get, set, partition, omit } from "lodash";
|
import { get, isEmpty, merge, omit, partition, set } from "lodash";
|
||||||
import equal from "fast-deep-equal/es6";
|
import equal from "fast-deep-equal/es6";
|
||||||
import type {
|
import type {
|
||||||
ReduxAction,
|
ReduxAction,
|
||||||
|
|
@ -34,36 +34,34 @@ import {
|
||||||
} from "selectors/editorSelectors";
|
} from "selectors/editorSelectors";
|
||||||
import {
|
import {
|
||||||
getDatasource,
|
getDatasource,
|
||||||
getDatasourceDraft,
|
|
||||||
getPluginForm,
|
|
||||||
getGenerateCRUDEnabledPluginMap,
|
|
||||||
getPluginPackageFromDatasourceId,
|
|
||||||
getDatasources,
|
|
||||||
getDatasourceActionRouteInfo,
|
getDatasourceActionRouteInfo,
|
||||||
getPlugin,
|
getDatasourceDraft,
|
||||||
getEditorConfig,
|
getDatasources,
|
||||||
getPluginByPackageName,
|
|
||||||
getDatasourcesUsedInApplicationByActions,
|
getDatasourcesUsedInApplicationByActions,
|
||||||
|
getEditorConfig,
|
||||||
getEntityExplorerDatasources,
|
getEntityExplorerDatasources,
|
||||||
|
getGenerateCRUDEnabledPluginMap,
|
||||||
|
getPlugin,
|
||||||
|
getPluginByPackageName,
|
||||||
|
getPluginForm,
|
||||||
|
getPluginPackageFromDatasourceId,
|
||||||
} from "@appsmith/selectors/entitiesSelector";
|
} from "@appsmith/selectors/entitiesSelector";
|
||||||
|
import type {
|
||||||
|
executeDatasourceQueryReduxAction,
|
||||||
|
UpdateDatasourceSuccessAction,
|
||||||
|
} from "actions/datasourceActions";
|
||||||
import {
|
import {
|
||||||
addMockDatasourceToWorkspace,
|
addMockDatasourceToWorkspace,
|
||||||
setDatasourceViewModeFlag,
|
|
||||||
} from "actions/datasourceActions";
|
|
||||||
import type {
|
|
||||||
UpdateDatasourceSuccessAction,
|
|
||||||
executeDatasourceQueryReduxAction,
|
|
||||||
} from "actions/datasourceActions";
|
|
||||||
import { updateDatasourceAuthState } from "actions/datasourceActions";
|
|
||||||
import {
|
|
||||||
changeDatasource,
|
changeDatasource,
|
||||||
fetchDatasourceStructure,
|
|
||||||
setDatasourceViewMode,
|
|
||||||
updateDatasourceSuccess,
|
|
||||||
createTempDatasourceFromForm,
|
|
||||||
removeTempDatasource,
|
|
||||||
createDatasourceSuccess,
|
createDatasourceSuccess,
|
||||||
|
createTempDatasourceFromForm,
|
||||||
|
fetchDatasourceStructure,
|
||||||
|
removeTempDatasource,
|
||||||
resetDefaultKeyValPairFlag,
|
resetDefaultKeyValPairFlag,
|
||||||
|
setDatasourceViewMode,
|
||||||
|
setDatasourceViewModeFlag,
|
||||||
|
updateDatasourceAuthState,
|
||||||
|
updateDatasourceSuccess,
|
||||||
} from "actions/datasourceActions";
|
} from "actions/datasourceActions";
|
||||||
import type { ApiResponse } from "api/ApiResponses";
|
import type { ApiResponse } from "api/ApiResponses";
|
||||||
import type { CreateDatasourceConfig } from "api/DatasourcesApi";
|
import type { CreateDatasourceConfig } from "api/DatasourcesApi";
|
||||||
|
|
@ -74,8 +72,11 @@ import type {
|
||||||
MockDatasource,
|
MockDatasource,
|
||||||
TokenResponse,
|
TokenResponse,
|
||||||
} from "entities/Datasource";
|
} from "entities/Datasource";
|
||||||
import { AuthenticationStatus, ToastMessageType } from "entities/Datasource";
|
import {
|
||||||
import { FilePickerActionStatus } from "entities/Datasource";
|
AuthenticationStatus,
|
||||||
|
FilePickerActionStatus,
|
||||||
|
ToastMessageType,
|
||||||
|
} from "entities/Datasource";
|
||||||
import {
|
import {
|
||||||
INTEGRATION_EDITOR_MODES,
|
INTEGRATION_EDITOR_MODES,
|
||||||
INTEGRATION_TABS,
|
INTEGRATION_TABS,
|
||||||
|
|
@ -116,7 +117,7 @@ import localStorage from "utils/localStorage";
|
||||||
import log from "loglevel";
|
import log from "loglevel";
|
||||||
import { APPSMITH_TOKEN_STORAGE_KEY } from "pages/Editor/SaaSEditor/constants";
|
import { APPSMITH_TOKEN_STORAGE_KEY } from "pages/Editor/SaaSEditor/constants";
|
||||||
import { checkAndGetPluginFormConfigsSaga } from "sagas/PluginSagas";
|
import { checkAndGetPluginFormConfigsSaga } from "sagas/PluginSagas";
|
||||||
import { PluginType, PluginPackageName } from "entities/Action";
|
import { PluginPackageName, PluginType } from "entities/Action";
|
||||||
import LOG_TYPE from "entities/AppsmithConsole/logtype";
|
import LOG_TYPE from "entities/AppsmithConsole/logtype";
|
||||||
import { isDynamicValue } from "utils/DynamicBindingUtils";
|
import { isDynamicValue } from "utils/DynamicBindingUtils";
|
||||||
import { getQueryParams } from "utils/URLUtils";
|
import { getQueryParams } from "utils/URLUtils";
|
||||||
|
|
@ -426,6 +427,23 @@ export function* deleteDatasourceSaga(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const getConnectionMethod = (
|
||||||
|
datasourceStoragePayload: DatasourceStorage,
|
||||||
|
pluginPackageName: string,
|
||||||
|
) => {
|
||||||
|
const properties = get(
|
||||||
|
datasourceStoragePayload,
|
||||||
|
"datasourceConfiguration.properties",
|
||||||
|
);
|
||||||
|
|
||||||
|
switch (pluginPackageName) {
|
||||||
|
case PluginPackageName.MY_SQL:
|
||||||
|
return properties?.[1]?.value;
|
||||||
|
default:
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
function* updateDatasourceSaga(
|
function* updateDatasourceSaga(
|
||||||
actionPayload: ReduxActionWithCallbacks<
|
actionPayload: ReduxActionWithCallbacks<
|
||||||
Datasource & { isInsideReconnectModal: boolean; currEditingEnvId?: string },
|
Datasource & { isInsideReconnectModal: boolean; currEditingEnvId?: string },
|
||||||
|
|
@ -518,6 +536,10 @@ function* updateDatasourceSaga(
|
||||||
pluginPackageName: plugin?.packageName || "",
|
pluginPackageName: plugin?.packageName || "",
|
||||||
isFormValid: isFormValid,
|
isFormValid: isFormValid,
|
||||||
editedFields: formDiffPaths,
|
editedFields: formDiffPaths,
|
||||||
|
connectionMethod: getConnectionMethod(
|
||||||
|
datasourceStoragePayload,
|
||||||
|
pluginPackageName,
|
||||||
|
),
|
||||||
});
|
});
|
||||||
toast.show(createMessage(DATASOURCE_UPDATE, responseData.name), {
|
toast.show(createMessage(DATASOURCE_UPDATE, responseData.name), {
|
||||||
kind: "success",
|
kind: "success",
|
||||||
|
|
@ -1040,6 +1062,10 @@ function* createDatasourceFromFormSaga(
|
||||||
pluginPackageName: plugin?.packageName || "",
|
pluginPackageName: plugin?.packageName || "",
|
||||||
isFormValid: isFormValid,
|
isFormValid: isFormValid,
|
||||||
editedFields: formDiffPaths,
|
editedFields: formDiffPaths,
|
||||||
|
connectionMethod: getConnectionMethod(
|
||||||
|
datasourceStoragePayload,
|
||||||
|
plugin?.packageName,
|
||||||
|
),
|
||||||
});
|
});
|
||||||
yield put({
|
yield put({
|
||||||
type: ReduxActionTypes.UPDATE_DATASOURCE_REFS,
|
type: ReduxActionTypes.UPDATE_DATASOURCE_REFS,
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user