Skip to content

Commit 4b71ada

Browse files
feat(themes): Adding SupersetText support to Themes Modal (#35248)
1 parent 5fbda3a commit 4b71ada

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

superset-frontend/src/features/themes/ThemeModal.tsx

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ import { FunctionComponent, useState, useEffect, ChangeEvent } from 'react';
2121
import { css, styled, t, useTheme } from '@superset-ui/core';
2222
import { useSingleViewResource } from 'src/views/CRUD/hooks';
2323
import { useThemeContext } from 'src/theme/ThemeProvider';
24+
import SupersetText from 'src/utils/textUtils';
2425

2526
import { Icons } from '@superset-ui/core/components/Icons';
2627
import withToasts from 'src/components/MessageToasts/withToasts';
@@ -106,6 +107,14 @@ const ThemeModal: FunctionComponent<ThemeModalProps> = ({
106107

107108
const canDevelopThemes = canDevelop;
108109

110+
// SupersetText URL configurations
111+
const themeEditorUrl =
112+
SupersetText?.THEME_MODAL?.THEME_EDITOR_URL ||
113+
'https://ant.design/theme-editor';
114+
const documentationUrl =
115+
SupersetText?.THEME_MODAL?.DOCUMENTATION_URL ||
116+
'https://superset.apache.org/docs/configuration/theming/';
117+
109118
// JSON validation annotations using reusable hook
110119
const jsonAnnotations = useJsonValidation(currentTheme?.json_data, {
111120
enabled: !isReadOnly,
@@ -350,15 +359,15 @@ const ThemeModal: FunctionComponent<ThemeModalProps> = ({
350359
<span>
351360
{t('Design with')}{' '}
352361
<a
353-
href="https://ant.design/theme-editor"
362+
href={themeEditorUrl}
354363
target="_blank"
355364
rel="noopener noreferrer"
356365
>
357366
{t('Ant Design Theme Editor')}
358367
</a>
359368
{t(', then paste the JSON below. See our')}{' '}
360369
<a
361-
href="https://superset.apache.org/docs/configuration/theming/"
370+
href={documentationUrl}
362371
target="_blank"
363372
rel="noopener noreferrer"
364373
>

0 commit comments

Comments
 (0)