Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit8b98e8d

Browse files
committed
added analytics
1 parent80945c7 commit8b98e8d

File tree

3 files changed

+64
-6
lines changed

3 files changed

+64
-6
lines changed

‎app/client/src/ce/utils/analyticsUtilTypes.ts‎

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -357,7 +357,8 @@ export type EventName =
357357
|"REQUEST_INTEGRATION_CTA"
358358
|"REQUEST_INTEGRATION_SUBMITTED"
359359
|"TABLE_WIDGET_V2_HTML_CELL_USAGE"
360-
|PREMIUM_DATASOURCES_EVENTS;
360+
|PREMIUM_DATASOURCES_EVENTS
361+
|STATIC_URL_EVENTS;
361362

362363
typeHOMEPAGE_CREATE_APP_FROM_TEMPLATE_EVENTS=
363364
|"TEMPLATE_DROPDOWN_CLICK"
@@ -480,3 +481,13 @@ export type PREMIUM_DATASOURCES_EVENTS =
480481
|"PREMIUM_MODAL_NOT_RELEVANT_SUBMIT"
481482
|"SOON_INTEGRATION_CTA"
482483
|"SOON_NOTIFY_REQUEST";
484+
485+
exporttypeSTATIC_URL_EVENTS=
486+
|"STATIC_URL_TOGGLE_CLICK"
487+
|"STATIC_URL_APPLY_CLICK"
488+
|"STATIC_URL_CANCEL_CLICK"
489+
|"STATIC_URL_ENABLED"
490+
|"STATIC_URL_CHANGED"
491+
|"STATIC_URL_DISABLED"
492+
|"STATIC_URL_DOCS_CLICK"
493+
|"STATIC_URL_PAGE_SLUG_CHANGED";

‎app/client/src/pages/AppIDE/components/AppSettings/components/GeneralSettings.tsx‎

Lines changed: 45 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ import { useEffect } from "react";
4343
importStaticURLConfirmationModalfrom"./StaticURLConfirmationModal";
4444
import{debounce}from"lodash";
4545
import{useDispatch,useSelector}from"react-redux";
46+
importAnalyticsUtilfrom"ee/utils/AnalyticsUtil";
4647

4748
constAPPLICATION_SLUG_REGEX=/^[a-z0-9-]+$/;
4849
constSTATIC_URL_DOCS_URL=
@@ -159,9 +160,15 @@ function GeneralSettings() {
159160
);
160161

161162
constopenStaticUrlConfirmationModal=useCallback(()=>{
163+
AnalyticsUtil.logEvent("STATIC_URL_APPLY_CLICK",{
164+
applicationId,
165+
oldSlug:application?.staticUrlSettings?.uniqueSlug,
166+
newSlug:applicationSlug,
167+
});
168+
162169
setModalType("change");
163170
setIsStaticUrlConfirmationModalOpen(true);
164-
},[]);
171+
},[applicationId,application,applicationSlug]);
165172

166173
constcloseStaticUrlConfirmationModal=useCallback(()=>{
167174
setIsStaticUrlConfirmationModalOpen(false);
@@ -178,6 +185,11 @@ function GeneralSettings() {
178185
toast.show(createMessage(STATIC_URL_CHANGE_SUCCESS),{
179186
kind:"success",
180187
});
188+
189+
AnalyticsUtil.logEvent("STATIC_URL_CHANGED",{
190+
applicationId,
191+
newSlug:applicationSlug,
192+
});
181193
};
182194

183195
if(
@@ -198,9 +210,15 @@ function GeneralSettings() {
198210
application?.staticUrlSettings?.uniqueSlug,
199211
dispatch,
200212
application?.staticUrlSettings?.enabled,
213+
applicationId,
201214
]);
202215

203216
constcancelSlugChange=useCallback(()=>{
217+
AnalyticsUtil.logEvent("STATIC_URL_CANCEL_CLICK",{
218+
applicationId,
219+
discardedSlug:applicationSlug,
220+
});
221+
204222
setApplicationSlug(application?.staticUrlSettings?.uniqueSlug||"");
205223
setIsClientSideSlugValid(true);
206224
dispatch(resetAppSlugValidation());
@@ -209,11 +227,21 @@ function GeneralSettings() {
209227
if(!application?.staticUrlSettings?.uniqueSlug){
210228
setIsStaticUrlToggleEnabled(false);
211229
}
212-
},[application?.staticUrlSettings?.uniqueSlug,dispatch]);
230+
},[
231+
application?.staticUrlSettings?.uniqueSlug,
232+
dispatch,
233+
applicationId,
234+
applicationSlug,
235+
]);
213236

214237
constopenStaticUrlDocs=useCallback(()=>{
238+
AnalyticsUtil.logEvent("STATIC_URL_DOCS_CLICK",{
239+
source:"general_settings",
240+
applicationId,
241+
});
242+
215243
window.open(STATIC_URL_DOCS_URL,"_blank");
216-
},[]);
244+
},[applicationId]);
217245

218246
constupdateAppSettings=useCallback(
219247
debounce((icon?:AppIconName)=>{
@@ -336,6 +364,12 @@ function GeneralSettings() {
336364

337365
consthandleStaticUrlToggle=useCallback(
338366
(isEnabled:boolean)=>{
367+
AnalyticsUtil.logEvent("STATIC_URL_TOGGLE_CLICK",{
368+
action:isEnabled ?"enable" :"disable",
369+
applicationId,
370+
isCurrentlyEnabled:application?.staticUrlSettings?.enabled,
371+
});
372+
339373
if(!isEnabled&&isStaticUrlToggleEnabled){
340374
if(application?.staticUrlSettings?.enabled){
341375
// Show confirmation modal when disabling
@@ -371,10 +405,16 @@ function GeneralSettings() {
371405
toast.show(createMessage(STATIC_URL_DISABLED_SUCCESS),{
372406
kind:"success",
373407
});
408+
409+
// Log analytics on successful disable
410+
AnalyticsUtil.logEvent("STATIC_URL_DISABLED",{
411+
applicationId,
412+
previousSlug:application?.staticUrlSettings?.uniqueSlug,
413+
});
374414
};
375415

376416
dispatch(disableStaticUrl(onSuccess));
377-
},[dispatch]);
417+
},[dispatch,applicationId,application]);
378418

379419
constapplicationSlugErrorMessage=useMemo(()=>{
380420
if(isFetchingAppSlugSuggestion)returnundefined;
@@ -468,7 +508,7 @@ function GeneralSettings() {
468508
/>
469509
</IconSelectorWrapper>
470510

471-
{isStaticUrlFeatureEnabled&&(
511+
{true&&(
472512
<divclassName="flex content-center justify-between pt-2">
473513
<Switch
474514
className="mb-0"

‎app/client/src/pages/AppIDE/components/AppSettings/components/PageSettings.tsx‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ import { isNameValid, toValidPageName } from "utils/helpers";
5454
import{useFeatureFlag}from"utils/hooks/useFeatureFlag";
5555
import{FEATURE_FLAG}from"ee/entities/FeatureFlag";
5656
import{getHasManagePagePermission}from"ee/utils/BusinessFeatures/permissionPageHelpers";
57+
importAnalyticsUtilfrom"ee/utils/AnalyticsUtil";
5758

5859
// Patterns for pageSlug and customSlug from routes: (.*\-) followed by ID
5960
constPAGE_SLUG_WITH_MONGO_ID=/^.*\-[0-9a-f]{24}$/;
@@ -302,6 +303,12 @@ function PageSettings(props: { page: Page }) {
302303
if(!isPageSlugValid)return;
303304

304305
dispatch(persistPageSlug(page.pageId,staticPageSlug||""));
306+
307+
AnalyticsUtil.logEvent("STATIC_URL_PAGE_SLUG_CHANGED",{
308+
pageId:page.pageId,
309+
oldSlug:page.uniqueSlug,
310+
newSlug:staticPageSlug,
311+
});
305312
},[
306313
page.pageId,
307314
page.uniqueSlug,

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp