@@ -23,18 +23,31 @@ import {
2323 createMessage ,
2424 STATIC_URL_CHANGE_SUCCESS ,
2525 STATIC_URL_DISABLED_SUCCESS ,
26+ STATIC_URL_DOCS_LINK_TEXT ,
2627} from "ee/constants/messages" ;
2728import classNames from "classnames" ;
2829import type { AppIconName } from "@appsmith/ads-old" ;
29- import { Input , Switch , Text , Icon , Flex , Button , toast } from "@appsmith/ads" ;
30+ import {
31+ Input ,
32+ Switch ,
33+ Text ,
34+ Icon ,
35+ Flex ,
36+ Button ,
37+ toast ,
38+ Tooltip ,
39+ } from "@appsmith/ads" ;
3040import { IconSelector } from "@appsmith/ads-old" ;
3141import React , { useCallback , useMemo , useState } from "react" ;
3242import { useEffect } from "react" ;
3343import StaticURLConfirmationModal from "./StaticURLConfirmationModal" ;
3444import { debounce } from "lodash" ;
3545import { useDispatch , useSelector } from "react-redux" ;
46+ import AnalyticsUtil from "ee/utils/AnalyticsUtil" ;
3647
3748const APPLICATION_SLUG_REGEX = / ^ [ a - z 0 - 9 - ] + $ / ;
49+ const STATIC_URL_DOCS_URL =
50+ "https://docs.appsmith.com/build-apps/how-to-guides/configure-static-app-urls" ;
3851
3952import {
4053 getCurrentApplication ,
@@ -98,6 +111,8 @@ function GeneralSettings() {
98111 const appSlugSuggestion = useSelector ( getAppSlugSuggestion ) ;
99112 const isAppSlugSaving = useSelector ( getIsPersistingAppSlug ) ;
100113
114+ const staticUrlTooltipContent = createMessage ( STATIC_URL_DOCS_LINK_TEXT ) ;
115+
101116 const [ applicationName , setApplicationName ] = useState ( application ?. name ) ;
102117 const [ isAppNameValid , setIsAppNameValid ] = useState ( true ) ;
103118 const [ applicationIcon , setApplicationIcon ] = useState (
@@ -194,6 +209,15 @@ function GeneralSettings() {
194209 }
195210 } , [ application ?. staticUrlSettings ?. uniqueSlug , dispatch ] ) ;
196211
212+ const openStaticUrlDocs = useCallback ( ( ) => {
213+ AnalyticsUtil . logEvent ( "STATIC_URL_DOCS_CLICK" , {
214+ source : "general_settings" ,
215+ applicationId,
216+ } ) ;
217+
218+ window . open ( STATIC_URL_DOCS_URL , "_blank" ) ;
219+ } , [ applicationId ] ) ;
220+
197221 const updateAppSettings = useCallback (
198222 debounce ( ( icon ?: AppIconName ) => {
199223 const isAppNameUpdated = applicationName !== application ?. name ;
@@ -277,11 +301,14 @@ function GeneralSettings() {
277301 return `${ application ?. staticUrlSettings ?. uniqueSlug || "" } /${ pageSlug } ` ;
278302 }
279303 } , [
304+ currentAppPage ?. uniqueSlug ,
305+ currentAppPage ?. slug ,
306+ currentAppPage ?. customSlug ,
280307 modalType ,
281308 application ?. staticUrlSettings ?. uniqueSlug ,
282- application ?. slug ,
283309 application ?. staticUrlSettings ?. enabled ,
284- currentAppPage ,
310+ application ?. slug ,
311+ currentBasePageId ,
285312 ] ) ;
286313
287314 const modalNewSlug = useMemo ( ( ) => {
@@ -367,12 +394,7 @@ function GeneralSettings() {
367394 }
368395
369396 return undefined ;
370- } , [
371- isFetchingAppSlugSuggestion ,
372- applicationSlug ,
373- isClientSideSlugValid ,
374- isApplicationSlugValid ,
375- ] ) ;
397+ } , [ isFetchingAppSlugSuggestion , applicationSlug , isClientSideSlugValid ] ) ;
376398
377399 const isApplicationSlugInputValid = useMemo ( ( ) => {
378400 if ( isFetchingAppSlugSuggestion ) return true ;
@@ -455,7 +477,18 @@ function GeneralSettings() {
455477 isSelected = { isStaticUrlToggleEnabled }
456478 onChange = { handleStaticUrlToggle }
457479 >
458- < Text kind = "action-m" > Static URL</ Text >
480+ < Flex alignItems = "center" gap = "spaces-2" >
481+ < Text kind = "action-m" > Static URL</ Text >
482+ < Tooltip content = { staticUrlTooltipContent } >
483+ < Button
484+ isIconButton
485+ kind = "tertiary"
486+ onClick = { openStaticUrlDocs }
487+ size = "sm"
488+ startIcon = "question-line"
489+ />
490+ </ Tooltip >
491+ </ Flex >
459492 </ Switch >
460493 </ div >
461494 ) }
0 commit comments