From 35e06a2ee85d145e33c6d36e58a618be1bab8087 Mon Sep 17 00:00:00 2001 From: Ibrahim Serdar Acikgoz Date: Fri, 30 May 2025 22:39:24 +0200 Subject: [PATCH] [MM-64422] Update icons for CEL Table Editor (#31213) --- .../table_editor/operator_selector_menu.tsx | 63 +------------------ .../policy_details.test.tsx.snap | 32 ++++++++-- .../policy_details/policy_details.tsx | 16 ++++- webapp/channels/src/i18n/en.json | 4 +- webapp/package-lock.json | 10 +-- webapp/package.json | 2 +- webapp/platform/components/package.json | 2 +- 7 files changed, 52 insertions(+), 77 deletions(-) diff --git a/webapp/channels/src/components/admin_console/access_control/editors/table_editor/operator_selector_menu.tsx b/webapp/channels/src/components/admin_console/access_control/editors/table_editor/operator_selector_menu.tsx index 8c58386efb..5707730202 100644 --- a/webapp/channels/src/components/admin_console/access_control/editors/table_editor/operator_selector_menu.tsx +++ b/webapp/channels/src/components/admin_console/access_control/editors/table_editor/operator_selector_menu.tsx @@ -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 = ({size, color, ...rest}: IconProps): JSX.Element => ( - - - -); - -const EqualIcon: React.FC = ({size, color, ...rest}: IconProps): JSX.Element => ( - - - -); - -const FunctionIcon: React.FC = ({size, color, ...rest}: IconProps): JSX.Element => ( - - - -); - -const NotEqualIcon: React.FC = ({size, color, ...rest}: IconProps): JSX.Element => ( - - - -); - interface OperatorSelectorProps { currentOperator: string; disabled: boolean; @@ -194,7 +137,7 @@ const OPERATOR_DESCRIPTORS: IDMappedObjects = { 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 = { in: { id: 'in', operatorValue: 'in', - icon: AlphaEIcon, + icon: ElementOfIcon, label: defineMessage({ id: 'admin.access_control.table_editor.operator.in', defaultMessage: 'in', diff --git a/webapp/channels/src/components/admin_console/access_control/policy_details/__snapshots__/policy_details.test.tsx.snap b/webapp/channels/src/components/admin_console/access_control/policy_details/__snapshots__/policy_details.test.tsx.snap index c6171d4ad5..c8f8f66af5 100644 --- a/webapp/channels/src/components/admin_console/access_control/policy_details/__snapshots__/policy_details.test.tsx.snap +++ b/webapp/channels/src/components/admin_console/access_control/policy_details/__snapshots__/policy_details.test.tsx.snap @@ -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={ + + } + title={ + + } /> @@ -106,7 +116,7 @@ exports[`components/admin_console/access_control/policy_details/PolicyDetails sh onClick={[Function]} 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={ + + } + title={ + + } /> @@ -293,7 +313,7 @@ exports[`components/admin_console/access_control/policy_details/PolicyDetails sh onClick={[Function]} subtitle={ } diff --git a/webapp/channels/src/components/admin_console/access_control/policy_details/policy_details.tsx b/webapp/channels/src/components/admin_console/access_control/policy_details/policy_details.tsx index 08fc8c25e2..a0d4f11d59 100644 --- a/webapp/channels/src/components/admin_console/access_control/policy_details/policy_details.tsx +++ b/webapp/channels/src/components/admin_console/access_control/policy_details/policy_details.tsx @@ -355,8 +355,18 @@ function PolicyDetails({ > + } + subtitle={ + + } buttonText={ editorMode === 'table' ? ( } buttonText={ diff --git a/webapp/channels/src/i18n/en.json b/webapp/channels/src/i18n/en.json index 2d72a0bf8c..6b4f530c72 100644 --- a/webapp/channels/src/i18n/en.json +++ b/webapp/channels/src/i18n/en.json @@ -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.", diff --git a/webapp/package-lock.json b/webapp/package-lock.json index e25c017c12..f7ec8ecaec 100644 --- a/webapp/package-lock.json +++ b/webapp/package-lock.json @@ -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", diff --git a/webapp/package.json b/webapp/package.json index c1a9ba0159..637267f946 100644 --- a/webapp/package.json +++ b/webapp/package.json @@ -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" }, diff --git a/webapp/platform/components/package.json b/webapp/platform/components/package.json index f6ff12fd7e..1d924251bd 100644 --- a/webapp/platform/components/package.json +++ b/webapp/platform/components/package.json @@ -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",