* fixed redirection on connect data click. and updated analytics * Added generic analytics for all datasource cards
This commit is contained in:
parent
fbf6d9ad2d
commit
e08b748b02
|
|
@ -8,6 +8,7 @@ import { addMockDatasourceToOrg } from "actions/datasourceActions";
|
||||||
import { getCurrentOrgId } from "selectors/organizationSelectors";
|
import { getCurrentOrgId } from "selectors/organizationSelectors";
|
||||||
import { getQueryParams } from "../../../utils/AppsmithUtils";
|
import { getQueryParams } from "../../../utils/AppsmithUtils";
|
||||||
import { AppState } from "../../../reducers";
|
import { AppState } from "../../../reducers";
|
||||||
|
import AnalyticsUtil from "../../../utils/AnalyticsUtil";
|
||||||
|
|
||||||
const MockDataSourceWrapper = styled.div`
|
const MockDataSourceWrapper = styled.div`
|
||||||
overflow: auto;
|
overflow: auto;
|
||||||
|
|
@ -105,6 +106,10 @@ function MockDatasourceCard(props: MockDatasourceCardProps) {
|
||||||
}
|
}
|
||||||
|
|
||||||
const addMockDataSource = () => {
|
const addMockDataSource = () => {
|
||||||
|
AnalyticsUtil.logEvent("CREATE_DATA_SOURCE_CLICK", {
|
||||||
|
mockDatasourceName: datasource.name,
|
||||||
|
plugin: currentPlugin,
|
||||||
|
});
|
||||||
const queryParams = getQueryParams();
|
const queryParams = getQueryParams();
|
||||||
dispatch(
|
dispatch(
|
||||||
addMockDatasourceToOrg(
|
addMockDatasourceToOrg(
|
||||||
|
|
|
||||||
|
|
@ -173,6 +173,9 @@ function NewApiScreen(props: Props) {
|
||||||
AnalyticsUtil.logEvent("CREATE_DATA_SOURCE_AUTH_API_CLICK", {
|
AnalyticsUtil.logEvent("CREATE_DATA_SOURCE_AUTH_API_CLICK", {
|
||||||
pluginId: authApiPlugin.id,
|
pluginId: authApiPlugin.id,
|
||||||
});
|
});
|
||||||
|
AnalyticsUtil.logEvent("CREATE_DATA_SOURCE_CLICK", {
|
||||||
|
plugin: authApiPlugin,
|
||||||
|
});
|
||||||
props.createDatasourceFromForm({
|
props.createDatasourceFromForm({
|
||||||
pluginId: authApiPlugin.id,
|
pluginId: authApiPlugin.id,
|
||||||
});
|
});
|
||||||
|
|
@ -180,6 +183,9 @@ function NewApiScreen(props: Props) {
|
||||||
}, [authApiPlugin, props.createDatasourceFromForm]);
|
}, [authApiPlugin, props.createDatasourceFromForm]);
|
||||||
|
|
||||||
const handleCreateNew = () => {
|
const handleCreateNew = () => {
|
||||||
|
AnalyticsUtil.logEvent("CREATE_DATA_SOURCE_CLICK", {
|
||||||
|
source: "CREATE_NEW_API",
|
||||||
|
});
|
||||||
if (pageId) {
|
if (pageId) {
|
||||||
createNewApiAction(pageId, "API_PANE");
|
createNewApiAction(pageId, "API_PANE");
|
||||||
}
|
}
|
||||||
|
|
@ -211,6 +217,9 @@ function NewApiScreen(props: Props) {
|
||||||
AnalyticsUtil.logEvent("IMPORT_API_CLICK", {
|
AnalyticsUtil.logEvent("IMPORT_API_CLICK", {
|
||||||
importSource: CURL,
|
importSource: CURL,
|
||||||
});
|
});
|
||||||
|
AnalyticsUtil.logEvent("CREATE_DATA_SOURCE_CLICK", {
|
||||||
|
source: CURL,
|
||||||
|
});
|
||||||
|
|
||||||
delete queryParams.isGeneratePageMode;
|
delete queryParams.isGeneratePageMode;
|
||||||
const curlImportURL =
|
const curlImportURL =
|
||||||
|
|
@ -289,11 +298,14 @@ function NewApiScreen(props: Props) {
|
||||||
<ApiCard
|
<ApiCard
|
||||||
className={`t--createBlankApi-${p.packageName}`}
|
className={`t--createBlankApi-${p.packageName}`}
|
||||||
key={p.id}
|
key={p.id}
|
||||||
onClick={() =>
|
onClick={() => {
|
||||||
|
AnalyticsUtil.logEvent("CREATE_DATA_SOURCE_CLICK", {
|
||||||
|
plugin: p,
|
||||||
|
});
|
||||||
handleOnClick(API_ACTION.CREATE_DATASOURCE_FORM, {
|
handleOnClick(API_ACTION.CREATE_DATASOURCE_FORM, {
|
||||||
pluginId: p.id,
|
pluginId: p.id,
|
||||||
})
|
});
|
||||||
}
|
}}
|
||||||
>
|
>
|
||||||
<CardContentWrapper>
|
<CardContentWrapper>
|
||||||
<div className="content-icon-wrapper">
|
<div className="content-icon-wrapper">
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,7 @@ import {
|
||||||
} from "actions/globalSearchActions";
|
} from "actions/globalSearchActions";
|
||||||
import AnalyticsUtil from "utils/AnalyticsUtil";
|
import AnalyticsUtil from "utils/AnalyticsUtil";
|
||||||
import { getTypographyByKey } from "constants/DefaultTheme";
|
import { getTypographyByKey } from "constants/DefaultTheme";
|
||||||
import { WidgetTypes } from "constants/WidgetConstants";
|
import { WidgetType, WidgetTypes } from "constants/WidgetConstants";
|
||||||
|
|
||||||
const StyledDiv = styled.div`
|
const StyledDiv = styled.div`
|
||||||
color: ${(props) => props.theme.colors.propertyPane.ctaTextColor};
|
color: ${(props) => props.theme.colors.propertyPane.ctaTextColor};
|
||||||
|
|
@ -63,7 +63,13 @@ export const excludeList = [
|
||||||
export const actionsExist = (state: AppState): boolean =>
|
export const actionsExist = (state: AppState): boolean =>
|
||||||
!!state.entities.actions.length;
|
!!state.entities.actions.length;
|
||||||
|
|
||||||
function ConnectDataCTA() {
|
type ConnectDataCTAProps = {
|
||||||
|
widgetTitle: string;
|
||||||
|
widgetId?: string;
|
||||||
|
widgetType?: WidgetType;
|
||||||
|
};
|
||||||
|
|
||||||
|
function ConnectDataCTA(props: ConnectDataCTAProps) {
|
||||||
const applicationId = useSelector(getCurrentApplicationId);
|
const applicationId = useSelector(getCurrentApplicationId);
|
||||||
const pageId = useSelector(getCurrentPageId);
|
const pageId = useSelector(getCurrentPageId);
|
||||||
const dispatch = useDispatch();
|
const dispatch = useDispatch();
|
||||||
|
|
@ -77,15 +83,20 @@ function ConnectDataCTA() {
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
const onClick = () => {
|
const onClick = () => {
|
||||||
|
const { widgetId, widgetTitle, widgetType } = props;
|
||||||
history.push(
|
history.push(
|
||||||
INTEGRATION_EDITOR_URL(
|
INTEGRATION_EDITOR_URL(
|
||||||
applicationId,
|
applicationId,
|
||||||
pageId,
|
pageId,
|
||||||
INTEGRATION_TABS.NEW,
|
INTEGRATION_TABS.NEW,
|
||||||
INTEGRATION_EDITOR_MODES.MOCK,
|
INTEGRATION_EDITOR_MODES.AUTO,
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
AnalyticsUtil.logEvent("CONNECT_DATA_CLICK");
|
AnalyticsUtil.logEvent("CONNECT_DATA_CLICK", {
|
||||||
|
widgetTitle,
|
||||||
|
widgetId,
|
||||||
|
widgetType,
|
||||||
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|
|
||||||
|
|
@ -184,7 +184,13 @@ function PropertyPaneView(
|
||||||
widgetType={widgetProperties?.type}
|
widgetType={widgetProperties?.type}
|
||||||
/>
|
/>
|
||||||
<PropertyPaneBodyWrapper>
|
<PropertyPaneBodyWrapper>
|
||||||
{!doActionsExist && !hideConnectDataCTA && <ConnectDataCTA />}
|
{!doActionsExist && !hideConnectDataCTA && (
|
||||||
|
<ConnectDataCTA
|
||||||
|
widgetId={widgetProperties.widgetId}
|
||||||
|
widgetTitle={widgetProperties.widgetName}
|
||||||
|
widgetType={widgetProperties?.type}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
<PropertyControlsWrapper>
|
<PropertyControlsWrapper>
|
||||||
<PropertyControlsGenerator
|
<PropertyControlsGenerator
|
||||||
id={widgetProperties.widgetId}
|
id={widgetProperties.widgetId}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user