diff --git a/webapp/channels/src/components/admin_console/access_control/editors/cel_editor/editor.tsx b/webapp/channels/src/components/admin_console/access_control/editors/cel_editor/editor.tsx index 19514d1d5b8..07cd3b85136 100644 --- a/webapp/channels/src/components/admin_console/access_control/editors/cel_editor/editor.tsx +++ b/webapp/channels/src/components/admin_console/access_control/editors/cel_editor/editor.tsx @@ -3,7 +3,7 @@ import * as monaco from 'monaco-editor'; import React, {useCallback, useEffect, useRef, useState, useMemo} from 'react'; -import {FormattedMessage} from 'react-intl'; +import {FormattedMessage, useIntl} from 'react-intl'; import type {AccessControlTestResult} from '@mattermost/types/access_control'; @@ -93,6 +93,7 @@ function CELEditor({ disabled = false, userAttributes, }: CELEditorProps): JSX.Element { + const intl = useIntl(); const [editorState, setEditorState] = useState({ expression: value, isValidating: false, @@ -376,7 +377,15 @@ function CELEditor({
== `. Use `&&` / `||` (and/or) for multiple conditions. Group conditions with `()`.'} + message={intl.formatMessage({ + id: 'admin.access_control.cel.help_text', + defaultMessage: 'Write rules like `user.attributes.{lessThan}attribute{greaterThan} == {lessSign}value{greaterSign}`. Use `&&` / `||` (and/or) for multiple conditions. Group conditions with `()`.', + }, { + lessThan: '<', + greaterThan: '>', + lessSign: '<', + greaterSign: '>', + })} onLearnMoreClick={() => setShowHelpModal(true)} />
diff --git a/webapp/channels/src/i18n/en.json b/webapp/channels/src/i18n/en.json index d70b64079c4..b5bdeed2c48 100644 --- a/webapp/channels/src/i18n/en.json +++ b/webapp/channels/src/i18n/en.json @@ -261,6 +261,7 @@ "admin.access_control.cel_help_modal.important_notes_title": "Important Notes", "admin.access_control.cel_help_modal.subheader": "With CEL you can define conditions to filter user attributes and control resource access.", "admin.access_control.cel_help_modal.title": "Common Expression Language (CEL)", + "admin.access_control.cel.help_text": "Write rules like `user.attributes.{lessThan}attribute{greaterThan} == {lessSign}value{greaterSign}`. Use `&&` / `||` (and/or) for multiple conditions. Group conditions with `()`.", "admin.access_control.cel.incomplete_expression": "Incomplete expression, awaiting input...", "admin.access_control.cel.line_and_column_number": "L{lineNumber}:{columnNumber}", "admin.access_control.cel.type_expression": "Type an expression...",