[MM-64422] Update icons for CEL Table Editor (#31213)

This commit is contained in:
Ibrahim Serdar Acikgoz 2025-05-30 22:39:24 +02:00 committed by GitHub
parent 2bba6ff4a7
commit 35e06a2ee8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 52 additions and 77 deletions

View file

@ -7,7 +7,7 @@ import React, {useMemo, useState} from 'react';
import type {MessageDescriptor} from 'react-intl';
import {defineMessage, FormattedMessage, useIntl} from 'react-intl';
import {CheckIcon} from '@mattermost/compass-icons/components';
import {CheckIcon, ElementOfIcon, EqualIcon, FunctionIcon, NotEqualVariantIcon} from '@mattermost/compass-icons/components';
import type IconProps from '@mattermost/compass-icons/components/props';
import type {IDMappedObjects} from '@mattermost/types/utilities';
@ -15,63 +15,6 @@ import * as Menu from 'components/menu';
import './selector_menus.scss';
const AlphaEIcon: React.FC<IconProps> = ({size, color, ...rest}: IconProps): JSX.Element => (
<svg
xmlns='http://www.w3.org/2000/svg'
version='1.1'
width={size || '1em'}
height={size || '1em'}
fill={color || 'currentColor'}
viewBox='0 0 24 24'
transform='rotate(90)'
{...rest}
>
<path d='M9,17A2,2 0 0,1 7,15V7H9V15H11V8H13V15H15V7H17V15A2,2 0 0,1 15,17H9Z'/>
</svg>
);
const EqualIcon: React.FC<IconProps> = ({size, color, ...rest}: IconProps): JSX.Element => (
<svg
xmlns='http://www.w3.org/2000/svg'
version='1.1'
width={size || '1em'}
height={size || '1em'}
fill={color || 'currentColor'}
viewBox='0 0 24 24'
{...rest}
>
<path d='M19,10H5V8H19V10M19,16H5V14H19V16Z'/>
</svg>
);
const FunctionIcon: React.FC<IconProps> = ({size, color, ...rest}: IconProps): JSX.Element => (
<svg
xmlns='http://www.w3.org/2000/svg'
version='1.1'
width={size || '1em'}
height={size || '1em'}
fill={color || 'currentColor'}
viewBox='0 0 24 24'
{...rest}
>
<path d='M15.6,5.29C14.5,5.19 13.53,6 13.43,7.11L13.18,10H16V12H13L12.56,17.07C12.37,19.27 10.43,20.9 8.23,20.7C6.92,20.59 5.82,19.86 5.17,18.83L6.67,17.33C6.91,18.07 7.57,18.64 8.4,18.71C9.5,18.81 10.47,18 10.57,16.89L11,12H8V10H11.17L11.44,6.93C11.63,4.73 13.57,3.1 15.77,3.3C17.08,3.41 18.18,4.14 18.83,5.17L17.33,6.67C17.09,5.93 16.43,5.36 15.6,5.29Z'/>
</svg>
);
const NotEqualIcon: React.FC<IconProps> = ({size, color, ...rest}: IconProps): JSX.Element => (
<svg
xmlns='http://www.w3.org/2000/svg'
version='1.1'
width={size || '1em'}
height={size || '1em'}
fill={color || 'currentColor'}
viewBox='0 0 24 24'
{...rest}
>
<path d='M21,10H9V8H21V10M21,16H9V14H21V16M4,5H6V16H4V5M6,18V20H4V18H6Z'/>
</svg>
);
interface OperatorSelectorProps {
currentOperator: string;
disabled: boolean;
@ -194,7 +137,7 @@ const OPERATOR_DESCRIPTORS: IDMappedObjects<OperatorDescriptor> = {
is_not: {
id: 'is_not',
operatorValue: 'is not',
icon: NotEqualIcon,
icon: NotEqualVariantIcon,
label: defineMessage({
id: 'admin.access_control.table_editor.operator.is_not',
defaultMessage: 'is not',
@ -203,7 +146,7 @@ const OPERATOR_DESCRIPTORS: IDMappedObjects<OperatorDescriptor> = {
in: {
id: 'in',
operatorValue: 'in',
icon: AlphaEIcon,
icon: ElementOfIcon,
label: defineMessage({
id: 'admin.access_control.table_editor.operator.in',
defaultMessage: 'in',

View file

@ -78,8 +78,18 @@ exports[`components/admin_console/access_control/policy_details/PolicyDetails sh
}
isDisabled={false}
onClick={[Function]}
subtitle="Select user attributes and values as rules to restrict channel membership."
title="Attribute based access rules"
subtitle={
<Memo(MemoizedFormattedMessage)
defaultMessage="Select user attributes and values as rules to restrict channel membership."
id="admin.access_control.policy.edit_policy.access_rules.subtitle"
/>
}
title={
<Memo(MemoizedFormattedMessage)
defaultMessage="Attribute-based access rules"
id="admin.access_control.policy.edit_policy.access_rules.title"
/>
}
/>
</CardHeader>
<CardBody>
@ -106,7 +116,7 @@ exports[`components/admin_console/access_control/policy_details/PolicyDetails sh
onClick={[Function]}
subtitle={
<Memo(MemoizedFormattedMessage)
defaultMessage="Add channels that this property based access policy will apply to."
defaultMessage="Add channels that this attribute-based access policy will apply to."
id="admin.access_control.policy.edit_policy.channel_selector.subtitle"
/>
}
@ -265,8 +275,18 @@ exports[`components/admin_console/access_control/policy_details/PolicyDetails sh
}
isDisabled={false}
onClick={[Function]}
subtitle="Select user attributes and values as rules to restrict channel membership."
title="Attribute based access rules"
subtitle={
<Memo(MemoizedFormattedMessage)
defaultMessage="Select user attributes and values as rules to restrict channel membership."
id="admin.access_control.policy.edit_policy.access_rules.subtitle"
/>
}
title={
<Memo(MemoizedFormattedMessage)
defaultMessage="Attribute-based access rules"
id="admin.access_control.policy.edit_policy.access_rules.title"
/>
}
/>
</CardHeader>
<CardBody>
@ -293,7 +313,7 @@ exports[`components/admin_console/access_control/policy_details/PolicyDetails sh
onClick={[Function]}
subtitle={
<Memo(MemoizedFormattedMessage)
defaultMessage="Add channels that this property based access policy will apply to."
defaultMessage="Add channels that this attribute-based access policy will apply to."
id="admin.access_control.policy.edit_policy.channel_selector.subtitle"
/>
}

View file

@ -355,8 +355,18 @@ function PolicyDetails({
>
<Card.Header>
<TitleAndButtonCardHeader
title={'Attribute based access rules'}
subtitle={'Select user attributes and values as rules to restrict channel membership.'}
title={
<FormattedMessage
id='admin.access_control.policy.edit_policy.access_rules.title'
defaultMessage='Attribute-based access rules'
/>
}
subtitle={
<FormattedMessage
id='admin.access_control.policy.edit_policy.access_rules.subtitle'
defaultMessage='Select user attributes and values as rules to restrict channel membership.'
/>
}
buttonText={
editorMode === 'table' ? (
<FormattedMessage
@ -425,7 +435,7 @@ function PolicyDetails({
subtitle={
<FormattedMessage
id='admin.access_control.policy.edit_policy.channel_selector.subtitle'
defaultMessage='Add channels that this property based access policy will apply to.'
defaultMessage='Add channels that this attribute-based access policy will apply to.'
/>
}
buttonText={

View file

@ -277,11 +277,13 @@
"admin.access_control.policies.resources.none": "None",
"admin.access_control.policies.title": "Access Control Policies",
"admin.access_control.policy.channels_affected": "Are you sure you want to save and apply the access control policy?",
"admin.access_control.policy.edit_policy.access_rules.subtitle": "Select user attributes and values as rules to restrict channel membership.",
"admin.access_control.policy.edit_policy.access_rules.title": "Attribute-based access rules",
"admin.access_control.policy.edit_policy.autoSyncMembership": "Auto-add members based on access rules:",
"admin.access_control.policy.edit_policy.autoSyncMembership.description": "Users who match the attribute values configured below will be automatically added as new members. Regardless of this setting, users who later no longer match the configured attribute values will be removed from the channel after the next sync.",
"admin.access_control.policy.edit_policy.channel_selector.addChannels": "Add channels",
"admin.access_control.policy.edit_policy.channel_selector.remove": "Remove",
"admin.access_control.policy.edit_policy.channel_selector.subtitle": "Add channels that this attribute based access policy will apply to.",
"admin.access_control.policy.edit_policy.channel_selector.subtitle": "Add channels that this attribute-based access policy will apply to.",
"admin.access_control.policy.edit_policy.channel_selector.title": "Assigned channels",
"admin.access_control.policy.edit_policy.delete_confirmation.confirm_button": "Delete Policy",
"admin.access_control.policy.edit_policy.delete_confirmation.message": "Are you sure you want to delete this policy? This action cannot be undone.",

View file

@ -15,7 +15,7 @@
"platform/types"
],
"dependencies": {
"@mattermost/compass-icons": "0.1.48",
"@mattermost/compass-icons": "0.1.49",
"react-intl": "6.6.2",
"typescript": "5.6.3"
},
@ -5224,9 +5224,9 @@
"link": true
},
"node_modules/@mattermost/compass-icons": {
"version": "0.1.48",
"resolved": "https://registry.npmjs.org/@mattermost/compass-icons/-/compass-icons-0.1.48.tgz",
"integrity": "sha512-z36LlyZryL+Ssc1pbCGE1bidRmdcYlHGkVtcFP9qpd7+Jpk/sRiv0OjCMzcBHDnCiVT8jIfSmtNrTd+TJdVnmQ=="
"version": "0.1.49",
"resolved": "https://registry.npmjs.org/@mattermost/compass-icons/-/compass-icons-0.1.49.tgz",
"integrity": "sha512-iv7L6O/ipn4q4TuSXlgD4UXS3hRfmY/YYTEjFDJZ1BmPiP0Ztilc1hqW4g0OgScQik4ihc+M/oE0mwH0DTXJ5Q=="
},
"node_modules/@mattermost/components": {
"resolved": "platform/components",
@ -29516,7 +29516,7 @@
},
"peerDependencies": {
"@babel/runtime-corejs3": "^7.17.8",
"@mattermost/compass-icons": "0.1.48",
"@mattermost/compass-icons": "0.1.49",
"@mui/base": "5.0.0-alpha.127",
"@mui/material": "5.11.16",
"@mui/styled-engine-sc": "5.11.11",

View file

@ -20,7 +20,7 @@
"gen-lang-imports": "node scripts/gen_lang_imports.mjs"
},
"dependencies": {
"@mattermost/compass-icons": "0.1.48",
"@mattermost/compass-icons": "0.1.49",
"react-intl": "6.6.2",
"typescript": "5.6.3"
},

View file

@ -35,7 +35,7 @@
},
"peerDependencies": {
"@babel/runtime-corejs3": "^7.17.8",
"@mattermost/compass-icons": "0.1.48",
"@mattermost/compass-icons": "0.1.49",
"@mui/base": "5.0.0-alpha.127",
"@mui/material": "5.11.16",
"@mui/styled-engine-sc": "5.11.11",