mirror of
https://github.com/mattermost/mattermost.git
synced 2026-09-24 16:05:00 +08:00
MM-66410 - standardize abac suggestions (#34446)
* MM-66410 - standardize abac suggestions * make text translatable * fix linter issues --------- Co-authored-by: Mattermost Build <build@mattermost.com>
This commit is contained in:
co-authored by
Mattermost Build
parent
5d3a04760b
commit
31ebadd0b7
+11
-2
@@ -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({
|
||||
<div className='help-text-container'>
|
||||
<div>
|
||||
<HelpText
|
||||
message={'Write rules like `user.<attribute> == <value>`. 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)}
|
||||
/>
|
||||
</div>
|
||||
|
||||
@@ -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...",
|
||||
|
||||
Reference in New Issue
Block a user