@@ -11,7 +11,7 @@ import {
11
11
showCustomerServicePanel ,
12
12
showHelpDropdown ,
13
13
} from "@lowcoder-ee/pages/common/customerService" ;
14
- import React , { useCallback , useEffect , useState } from "react" ;
14
+ import React , { useCallback , useEffect , useMemo , useState } from "react" ;
15
15
import { useDispatch , useSelector } from "react-redux" ;
16
16
import { createApplication } from "redux/reduxActions/applicationActions" ;
17
17
import history from "util/history" ;
@@ -28,6 +28,7 @@ import { QuestionIcon, UpgradeIcon } from "lowcoder-design";
28
28
import { trans } from "i18n" ;
29
29
import { localEnv } from "util/envUtils" ;
30
30
import { isPublicApplication } from "@lowcoder-ee/redux/selectors/applicationSelector" ;
31
+ import { getBrandingSetting } from "@lowcoder-ee/redux/selectors/enterpriseSelectors" ;
31
32
32
33
const StyledMenu = styled ( DropdownMenu ) < { $edit : boolean | string } > `
33
34
${ ( props ) =>
@@ -191,6 +192,22 @@ function HelpDropdownComp(props: HelpDropdownProps) {
191
192
const [ toolTipContent , setToolTipContent ] = useState < React . ReactNode > ( null ) ;
192
193
const [ showDropdown , setShowDropdown ] = useState ( false ) ;
193
194
const isPublicApp = useSelector ( isPublicApplication ) ;
195
+ const brandingSettings = useSelector ( getBrandingSetting ) ;
196
+
197
+ const showDocLink = useMemo ( ( ) => {
198
+ if ( ! Boolean ( brandingSettings ) ) return Boolean ( docHomeUrl ) ;
199
+ return brandingSettings ?. config_set ?. showDocumentation ;
200
+ } , [ brandingSettings ?. config_set ?. showDocumentation ] ) ;
201
+
202
+ const showSubmitIssueLink = useMemo ( ( ) => {
203
+ if ( ! Boolean ( brandingSettings ) ) return Boolean ( issueUrl ) ;
204
+ return brandingSettings ?. config_set ?. submitIssue ;
205
+ } , [ brandingSettings ?. config_set ?. submitIssue ] ) ;
206
+
207
+ const showWhatsNewLink = useMemo ( ( ) => {
208
+ if ( ! Boolean ( brandingSettings ) ) return Boolean ( changeLogDocUrl ) ;
209
+ return brandingSettings ?. config_set ?. whatsNew ;
210
+ } , [ brandingSettings ?. config_set ?. whatsNew ] ) ;
194
211
195
212
const closeTooltip = ( ) => {
196
213
// turn of tooltip
@@ -255,6 +272,9 @@ function HelpDropdownComp(props: HelpDropdownProps) {
255
272
) ;
256
273
return ;
257
274
case "docs" :
275
+ if ( brandingSettings ?. config_set ?. documentationLink ) {
276
+ return window . open ( brandingSettings ?. config_set ?. documentationLink ) ;
277
+ }
258
278
window . open ( docHomeUrl ) ;
259
279
return ;
260
280
case "issue" :
@@ -267,6 +287,9 @@ function HelpDropdownComp(props: HelpDropdownProps) {
267
287
props . setShowShortcutList ?.( true ) ;
268
288
return ;
269
289
case "changeLog" :
290
+ if ( brandingSettings ?. config_set ?. whatsNewLink ) {
291
+ return window . open ( brandingSettings ?. config_set ?. whatsNewLink ) ;
292
+ }
270
293
window . open ( changeLogDocUrl ) ;
271
294
return ;
272
295
}
@@ -302,16 +325,16 @@ function HelpDropdownComp(props: HelpDropdownProps) {
302
325
) ,
303
326
}
304
327
: null ,
305
- {
328
+ showDocLink ? {
306
329
key : "docs" ,
307
330
label : (
308
331
< ItemWrapper >
309
332
< DocIcon />
310
333
< span > { trans ( "help.docs" ) } </ span >
311
334
</ ItemWrapper >
312
335
) ,
313
- } ,
314
- issueUrl
336
+ } : null ,
337
+ showSubmitIssueLink
315
338
? {
316
339
key : "issue" ,
317
340
label : (
@@ -353,7 +376,7 @@ function HelpDropdownComp(props: HelpDropdownProps) {
353
376
) ,
354
377
}
355
378
: null ,
356
- changeLogDocUrl
379
+ showWhatsNewLink
357
380
? {
358
381
key : "changeLog" ,
359
382
label : (
0 commit comments