diff --git a/webapp/channels/src/components/admin_console/admin_definition.tsx b/webapp/channels/src/components/admin_console/admin_definition.tsx index df0e1021f88..2d5f7e7b492 100644 --- a/webapp/channels/src/components/admin_console/admin_definition.tsx +++ b/webapp/channels/src/components/admin_console/admin_definition.tsx @@ -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)), diff --git a/webapp/channels/src/components/admin_console/custom_profile_attributes/custom_profile_attributes.tsx b/webapp/channels/src/components/admin_console/custom_profile_attributes/custom_profile_attributes.tsx index 32ae1d46061..4b9843f9906 100644 --- a/webapp/channels/src/components/admin_console/custom_profile_attributes/custom_profile_attributes.tsx +++ b/webapp/channels/src/components/admin_console/custom_profile_attributes/custom_profile_attributes.tsx @@ -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): JSX.Element | n
Account Menu > Account Settings > Profile.", "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 user attributes page.", "admin.customProfileAttributes.title": "User attributes sync", diff --git a/webapp/channels/src/utils/admin_console_index.test.tsx b/webapp/channels/src/utils/admin_console_index.test.tsx index 3c83b111f77..f9b5f2e4f53 100644 --- a/webapp/channels/src/utils/admin_console_index.test.tsx +++ b/webapp/channels/src/utils/admin_console_index.test.tsx @@ -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([]); });