diff --git a/app/client/src/ce/constants/messages.ts b/app/client/src/ce/constants/messages.ts index bc39e61409..84e55ca4f9 100644 --- a/app/client/src/ce/constants/messages.ts +++ b/app/client/src/ce/constants/messages.ts @@ -962,6 +962,7 @@ export const LOCK_ENTITY_EXPLORER_MESSAGE = () => `固定侧边栏`; export const CLOSE_ENTITY_EXPLORER_MESSAGE = () => `关闭侧边栏`; export const JS_TOGGLE_DISABLED_MESSAGE = "清空字段回退"; export const PROPERTY_PANE_EMPTY_SEARCH_RESULT_MESSAGE = "没有发现任何属性"; +export const HELP_MESSAGE = "帮助"; // API Pane export const API_PANE_NO_BODY = () => "当前请求没有请求体"; diff --git a/app/client/src/constants/PropertyControlConstants.tsx b/app/client/src/constants/PropertyControlConstants.tsx index cdef533f5a..af54564a89 100644 --- a/app/client/src/constants/PropertyControlConstants.tsx +++ b/app/client/src/constants/PropertyControlConstants.tsx @@ -89,6 +89,7 @@ export type PropertyPaneControlConfig = { // TODO(abhinav): To fix this, rename the options property of the controls which use this // Alternatively, create a new structure options?: any; + helpLink?: string; }; type ValidationConfigParams = { diff --git a/app/client/src/pages/Editor/PropertyPane/PropertyControl.tsx b/app/client/src/pages/Editor/PropertyPane/PropertyControl.tsx index 9cf5a613a3..6ff07468ec 100644 --- a/app/client/src/pages/Editor/PropertyPane/PropertyControl.tsx +++ b/app/client/src/pages/Editor/PropertyPane/PropertyControl.tsx @@ -8,6 +8,7 @@ import { ControlWrapper, } from "components/propertyControls/StyledControls"; import { JSToggleButton } from "design-system"; +import { HelpIcons } from "icons/HelpIcons"; import PropertyControlFactory from "utils/PropertyControlFactory"; import PropertyHelpLabel from "pages/Editor/PropertyPane/PropertyHelpLabel"; import { useDispatch, useSelector } from "react-redux"; @@ -50,7 +51,10 @@ import { getSelectedAppTheme } from "selectors/appThemingSelectors"; import { TooltipComponent } from "design-system"; import { ReactComponent as ResetIcon } from "assets/icons/control/undo_2.svg"; import { AppTheme } from "entities/AppTheming"; -import { JS_TOGGLE_DISABLED_MESSAGE } from "@appsmith/constants/messages"; +import { + JS_TOGGLE_DISABLED_MESSAGE, + HELP_MESSAGE, +} from "@appsmith/constants/messages"; import { AppState } from "@appsmith/reducers"; import { getPropertyControlFocusElement, @@ -59,6 +63,10 @@ import { import PropertyPaneHelperText from "./PropertyPaneHelperText"; import { generateKeyAndSetFocusablePropertyPaneField } from "actions/propertyPaneActions"; +import { Colors } from "constants/Colors"; + +const HelpIcon = HelpIcons.HELP_ICON; + type Props = PropertyPaneControlConfig & { panel: IPanelProps; theme: EditorTheme; @@ -520,6 +528,7 @@ const PropertyControl = memo((props: Props) => { propertyName, ); const isConvertible = !!props.isJSConvertible; + const helpLink = props.helpLink; const className = label .split(" ") .join("") @@ -646,6 +655,26 @@ const PropertyControl = memo((props: Props) => { /> )} + {helpLink && ( +
{ + window.open(helpLink, "_blank"); + }} + > + + + +
+ )} {isPropertyDeviatedFromTheme && ( <> x.chartType === "CUSTOM_CHART", + // hidden: (x: any) => x.chartType === "CUSTOM_CHART", dependencies: ["chartType"], }, { @@ -205,7 +205,7 @@ export const contentConfig = [ isBindProperty: true, isTriggerProperty: false, validation: { type: ValidationTypes.TEXT }, - hidden: (x: any) => x.chartType === "CUSTOM_CHART", + // hidden: (x: any) => x.chartType === "CUSTOM_CHART", dependencies: ["chartType"], }, ], @@ -227,8 +227,8 @@ export const contentConfig = [ regex: /\w+/, }, }, - // hidden: (x: any) => x.chartType === "CUSTOM_CHART", - dependencies: ["chartType"], + // hidden: (x: EchartWidgetProps) => x.chartType !== "CUSTOM_CHART", + // dependencies: ["chartType"], }, { helpText: "地图注册 GeoJSON 数据", @@ -247,6 +247,8 @@ export const contentConfig = [ // regex: /(http(s?):)([/|.|\w|\s|-])*\.(?:json)/, }, }, + // hidden: (x: EchartWidgetProps) => x.chartType !== "CUSTOM_CHART", + // dependencies: ["chartType"], }, ], },