This commit is contained in:
cursor[bot] 2026-05-23 03:04:24 +02:00 committed by GitHub
commit ed552b2ed2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 24 additions and 6 deletions

View file

@ -32,7 +32,7 @@ import {
import ContentFlaggingSettings, {searchableStrings as dataSpillageSearchableStrings} from 'components/admin_console/content_flagging/content_flagging_settings';
import CustomPluginSettings from 'components/admin_console/custom_plugin_settings';
import CustomProfileAttributes from 'components/admin_console/custom_profile_attributes/custom_profile_attributes';
import CustomProfileAttributes, {searchableStrings as customProfileAttributesSearchableStrings} from 'components/admin_console/custom_profile_attributes/custom_profile_attributes';
import PluginManagement from 'components/admin_console/plugin_management';
import SystemAnalytics from 'components/analytics/system_analytics';
import {searchableStrings as systemAnalyticsSearchableStrings} from 'components/analytics/system_analytics/system_analytics';
@ -4118,6 +4118,7 @@ const AdminDefinition: AdminDefinitionType = {
ldap: {
url: 'authentication/ldap',
title: defineMessage({id: 'admin.sidebar.ldap', defaultMessage: 'AD/LDAP'}),
searchableStrings: customProfileAttributesSearchableStrings,
isHidden: it.any(
it.not(it.licensedForFeature('LDAP')),
it.not(it.userHasReadPermissionOnResource(RESOURCE_KEYS.AUTHENTICATION.LDAP)),
@ -4151,6 +4152,7 @@ const AdminDefinition: AdminDefinitionType = {
saml: {
url: 'authentication/saml',
title: defineMessage({id: 'admin.sidebar.saml', defaultMessage: 'SAML 2.0'}),
searchableStrings: customProfileAttributesSearchableStrings,
isHidden: it.any(
it.not(it.licensedForFeature('SAML')),
it.not(it.userHasReadPermissionOnResource(RESOURCE_KEYS.AUTHENTICATION.SAML)),

View file

@ -7,7 +7,7 @@
import React, {useEffect, useState} from 'react';
import './custom_profile_attributes.scss';
import {FormattedMessage, defineMessage} from 'react-intl';
import {FormattedMessage, defineMessages} from 'react-intl';
import {useSelector} from 'react-redux';
import {Link} from 'react-router-dom';
@ -20,11 +20,25 @@ import {getPluginDisplayName} from 'selectors/plugins';
import SettingsGroup from 'components/admin_console/settings_group';
import TextSetting from 'components/admin_console/text_setting';
import type {SearchableStrings} from 'components/admin_console/types';
import {getUserPropertyFieldLabel} from 'utils/properties';
import type {GlobalState} from 'types/store';
const searchableStringMessages = defineMessages({
title: {
id: 'admin.customProfileAttributes.title',
defaultMessage: 'User attributes sync',
},
legacyTitle: {
id: 'admin.customProfileAttributes.legacyTitle',
defaultMessage: 'Custom profile attributes sync',
},
});
export const searchableStrings: SearchableStrings = Object.values(searchableStringMessages);
type AttributeHelpTextProps = {
attributeKey: string;
attributeName: string;
@ -141,10 +155,7 @@ const CustomProfileAttributes: React.FC<Props> = (props: Props): JSX.Element | n
<div className='custom-profile-attributes'>
<SettingsGroup
id={props.id}
title={defineMessage({
id: 'admin.customProfileAttributes.title',
defaultMessage: 'User attributes sync',
})}
title={searchableStringMessages.title}
container={false}
subtitle={
<FormattedMessage

View file

@ -960,6 +960,7 @@
"admin.customization.uniqueEmojiReactionLimitPerPostPlaceholder": "E.g.: 25",
"admin.customProfileAttribDesc.ldap": "(Optional) The attribute in the AD/LDAP server used to populate the {name} of users in Mattermost. When set, users cannot edit their {name}, since it is synchronized with the LDAP server. When left blank, users can set their {name} in <strong>Account Menu > Account Settings > Profile</strong>.",
"admin.customProfileAttribDesc.saml": "(Optional) The attribute in the SAML Assertion that will be used to populate the {name} of users in Mattermost.",
"admin.customProfileAttributes.legacyTitle": "Custom profile attributes sync",
"admin.customProfileAttributes.managedByPlugin": "This field is managed by the {pluginId} plugin and cannot be edited.",
"admin.customProfileAttributes.subtitle": "You can add or remove user attributes by going to the <link>user attributes page</link>.",
"admin.customProfileAttributes.title": "User attributes sync",

View file

@ -40,6 +40,10 @@ describe('AdminConsoleIndex.generateIndex', () => {
'site_config/customization',
'authentication/password',
]);
expect(idx.search('custom profile attri').sort()).toEqual([
'authentication/ldap',
'authentication/saml',
].sort());
expect(idx.search('caracteres')).toEqual([]);
expect(idx.search('notexistingword')).toEqual([]);
});