mattermost-redux 10.9.0 → 10.11.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (44) hide show
  1. package/lib/action_types/general.d.ts +3 -0
  2. package/lib/action_types/general.js +3 -0
  3. package/lib/action_types/index.d.ts +2 -1
  4. package/lib/action_types/index.js +3 -1
  5. package/lib/action_types/integrations.d.ts +1 -0
  6. package/lib/action_types/integrations.js +1 -0
  7. package/lib/action_types/shared_channels.d.ts +5 -0
  8. package/lib/action_types/shared_channels.js +12 -0
  9. package/lib/actions/admin.d.ts +5 -1
  10. package/lib/actions/admin.js +36 -0
  11. package/lib/actions/general.d.ts +1 -0
  12. package/lib/actions/general.js +22 -0
  13. package/lib/actions/integrations.js +3 -1
  14. package/lib/actions/posts.js +9 -1
  15. package/lib/actions/shared_channels.d.ts +18 -0
  16. package/lib/actions/shared_channels.js +80 -0
  17. package/lib/actions/users.d.ts +4 -1
  18. package/lib/actions/users.js +16 -2
  19. package/lib/constants/preferences.d.ts +1 -0
  20. package/lib/constants/preferences.js +1 -0
  21. package/lib/reducers/entities/general.d.ts +2 -0
  22. package/lib/reducers/entities/general.js +15 -0
  23. package/lib/reducers/entities/index.d.ts +6 -0
  24. package/lib/reducers/entities/index.js +2 -0
  25. package/lib/reducers/entities/integrations.d.ts +1 -0
  26. package/lib/reducers/entities/integrations.js +10 -0
  27. package/lib/reducers/entities/shared_channels.d.ts +9 -0
  28. package/lib/reducers/entities/shared_channels.js +41 -0
  29. package/lib/reducers/index.d.ts +6 -0
  30. package/lib/selectors/entities/access_control.d.ts +2 -0
  31. package/lib/selectors/entities/access_control.js +4 -0
  32. package/lib/selectors/entities/general.d.ts +2 -0
  33. package/lib/selectors/entities/general.js +4 -0
  34. package/lib/selectors/entities/integrations.d.ts +1 -0
  35. package/lib/selectors/entities/integrations.js +4 -0
  36. package/lib/selectors/entities/shared_channels.d.ts +6 -0
  37. package/lib/selectors/entities/shared_channels.js +25 -0
  38. package/lib/selectors/entities/users.d.ts +1 -0
  39. package/lib/selectors/entities/users.js +4 -0
  40. package/lib/store/initial_state.js +1 -0
  41. package/lib/utils/user_utils.js +2 -6
  42. package/package.json +3 -3
  43. package/lib/selectors/entities/hosted_customer.d.ts +0 -4
  44. package/lib/selectors/entities/hosted_customer.js +0 -12
@@ -21,5 +21,8 @@ declare const _default: {
21
21
  FIRST_ADMIN_VISIT_MARKETPLACE_STATUS_RECEIVED: "FIRST_ADMIN_VISIT_MARKETPLACE_STATUS_RECEIVED";
22
22
  FIRST_ADMIN_COMPLETE_SETUP_RECEIVED: "FIRST_ADMIN_COMPLETE_SETUP_RECEIVED";
23
23
  SHOW_LAUNCHING_WORKSPACE: "SHOW_LAUNCHING_WORKSPACE";
24
+ CWS_AVAILABILITY_CHECK_REQUEST: "CWS_AVAILABILITY_CHECK_REQUEST";
25
+ CWS_AVAILABILITY_CHECK_SUCCESS: "CWS_AVAILABILITY_CHECK_SUCCESS";
26
+ CWS_AVAILABILITY_CHECK_FAILURE: "CWS_AVAILABILITY_CHECK_FAILURE";
24
27
  };
25
28
  export default _default;
@@ -29,4 +29,7 @@ exports.default = (0, key_mirror_1.default)({
29
29
  FIRST_ADMIN_VISIT_MARKETPLACE_STATUS_RECEIVED: null,
30
30
  FIRST_ADMIN_COMPLETE_SETUP_RECEIVED: null,
31
31
  SHOW_LAUNCHING_WORKSPACE: null,
32
+ CWS_AVAILABILITY_CHECK_REQUEST: null,
33
+ CWS_AVAILABILITY_CHECK_SUCCESS: null,
34
+ CWS_AVAILABILITY_CHECK_FAILURE: null,
32
35
  });
@@ -24,10 +24,11 @@ import RoleTypes from './roles';
24
24
  import SchemeTypes from './schemes';
25
25
  import ScheduledPostTypes from './scheudled_posts';
26
26
  import SearchTypes from './search';
27
+ import SharedChannelTypes from './shared_channels';
27
28
  import TeamTypes from './teams';
28
29
  import ThreadTypes from './threads';
29
30
  import UserTypes from './users';
30
- export { ErrorTypes, GeneralTypes, UserTypes, TeamTypes, ChannelTypes, PostTypes, FileTypes, PreferenceTypes, IntegrationTypes, EmojiTypes, AdminTypes, JobTypes, LimitsTypes, SearchTypes, RoleTypes, SchemeTypes, GroupTypes, BotTypes, PluginTypes, ChannelCategoryTypes, CloudTypes, AppsTypes, ThreadTypes, HostedCustomerTypes, DraftTypes, PlaybookType, ChannelBookmarkTypes, ScheduledPostTypes, };
31
+ export { ErrorTypes, GeneralTypes, UserTypes, TeamTypes, ChannelTypes, PostTypes, FileTypes, PreferenceTypes, IntegrationTypes, EmojiTypes, AdminTypes, JobTypes, LimitsTypes, SearchTypes, RoleTypes, SchemeTypes, GroupTypes, BotTypes, PluginTypes, ChannelCategoryTypes, CloudTypes, AppsTypes, ThreadTypes, HostedCustomerTypes, DraftTypes, PlaybookType, ChannelBookmarkTypes, ScheduledPostTypes, SharedChannelTypes, };
31
32
  /**
32
33
  * An MMReduxAction is any non-Thunk Redux action accepted by mattermost-redux.
33
34
  */
@@ -5,7 +5,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
5
5
  return (mod && mod.__esModule) ? mod : { "default": mod };
6
6
  };
7
7
  Object.defineProperty(exports, "__esModule", { value: true });
8
- exports.ScheduledPostTypes = exports.ChannelBookmarkTypes = exports.PlaybookType = exports.DraftTypes = exports.HostedCustomerTypes = exports.ThreadTypes = exports.AppsTypes = exports.CloudTypes = exports.ChannelCategoryTypes = exports.PluginTypes = exports.BotTypes = exports.GroupTypes = exports.SchemeTypes = exports.RoleTypes = exports.SearchTypes = exports.LimitsTypes = exports.JobTypes = exports.AdminTypes = exports.EmojiTypes = exports.IntegrationTypes = exports.PreferenceTypes = exports.FileTypes = exports.PostTypes = exports.ChannelTypes = exports.TeamTypes = exports.UserTypes = exports.GeneralTypes = exports.ErrorTypes = void 0;
8
+ exports.SharedChannelTypes = exports.ScheduledPostTypes = exports.ChannelBookmarkTypes = exports.PlaybookType = exports.DraftTypes = exports.HostedCustomerTypes = exports.ThreadTypes = exports.AppsTypes = exports.CloudTypes = exports.ChannelCategoryTypes = exports.PluginTypes = exports.BotTypes = exports.GroupTypes = exports.SchemeTypes = exports.RoleTypes = exports.SearchTypes = exports.LimitsTypes = exports.JobTypes = exports.AdminTypes = exports.EmojiTypes = exports.IntegrationTypes = exports.PreferenceTypes = exports.FileTypes = exports.PostTypes = exports.ChannelTypes = exports.TeamTypes = exports.UserTypes = exports.GeneralTypes = exports.ErrorTypes = void 0;
9
9
  const admin_1 = __importDefault(require("./admin"));
10
10
  exports.AdminTypes = admin_1.default;
11
11
  const apps_1 = __importDefault(require("./apps"));
@@ -56,6 +56,8 @@ const scheudled_posts_1 = __importDefault(require("./scheudled_posts"));
56
56
  exports.ScheduledPostTypes = scheudled_posts_1.default;
57
57
  const search_1 = __importDefault(require("./search"));
58
58
  exports.SearchTypes = search_1.default;
59
+ const shared_channels_1 = __importDefault(require("./shared_channels"));
60
+ exports.SharedChannelTypes = shared_channels_1.default;
59
61
  const teams_1 = __importDefault(require("./teams"));
60
62
  exports.TeamTypes = teams_1.default;
61
63
  const threads_1 = __importDefault(require("./threads"));
@@ -20,6 +20,7 @@ declare const _default: {
20
20
  RECEIVED_OUTGOING_OAUTH_CONNECTION: "RECEIVED_OUTGOING_OAUTH_CONNECTION";
21
21
  DELETED_OUTGOING_OAUTH_CONNECTION: "DELETED_OUTGOING_OAUTH_CONNECTION";
22
22
  RECEIVED_DIALOG_TRIGGER_ID: "RECEIVED_DIALOG_TRIGGER_ID";
23
+ RECEIVED_DIALOG_ARGUMENTS: "RECEIVED_DIALOG_ARGUMENTS";
23
24
  RECEIVED_DIALOG: "RECEIVED_DIALOG";
24
25
  };
25
26
  export default _default;
@@ -28,5 +28,6 @@ exports.default = (0, key_mirror_1.default)({
28
28
  RECEIVED_OUTGOING_OAUTH_CONNECTION: null,
29
29
  DELETED_OUTGOING_OAUTH_CONNECTION: null,
30
30
  RECEIVED_DIALOG_TRIGGER_ID: null,
31
+ RECEIVED_DIALOG_ARGUMENTS: null,
31
32
  RECEIVED_DIALOG: null,
32
33
  });
@@ -0,0 +1,5 @@
1
+ declare const _default: {
2
+ RECEIVED_CHANNEL_REMOTES: "RECEIVED_CHANNEL_REMOTES";
3
+ RECEIVED_REMOTE_CLUSTER_INFO: "RECEIVED_REMOTE_CLUSTER_INFO";
4
+ };
5
+ export default _default;
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
3
+ // See LICENSE.txt for license information.
4
+ var __importDefault = (this && this.__importDefault) || function (mod) {
5
+ return (mod && mod.__esModule) ? mod : { "default": mod };
6
+ };
7
+ Object.defineProperty(exports, "__esModule", { value: true });
8
+ const key_mirror_1 = __importDefault(require("mattermost-redux/utils/key_mirror"));
9
+ exports.default = (0, key_mirror_1.default)({
10
+ RECEIVED_CHANNEL_REMOTES: null,
11
+ RECEIVED_REMOTE_CLUSTER_INFO: null,
12
+ });
@@ -1,7 +1,7 @@
1
1
  import type { LogFilter } from '@mattermost/types/admin';
2
2
  import type { Channel, ChannelSearchOpts } from '@mattermost/types/channels';
3
3
  import type { Compliance } from '@mattermost/types/compliance';
4
- import type { AdminConfig, AllowedIPRange } from '@mattermost/types/config';
4
+ import type { AdminConfig, AllowedIPRange, LdapSettings } from '@mattermost/types/config';
5
5
  import type { CreateDataRetentionCustomPolicy, DataRetentionCustomPolicies, GetDataRetentionCustomPoliciesRequest, PatchDataRetentionCustomPolicy } from '@mattermost/types/data_retention';
6
6
  import type { GroupSearchOpts } from '@mattermost/types/groups';
7
7
  import type { CompleteOnboardingRequest } from '@mattermost/types/setup';
@@ -27,6 +27,10 @@ export declare function uploadBrandImage(imageData: File): ActionFuncAsync<impor
27
27
  export declare function deleteBrandImage(): ActionFuncAsync<import("@mattermost/types/client4").StatusOK, import("@mattermost/types/store").GlobalState, import("redux").AnyAction>;
28
28
  export declare function getClusterStatus(): ActionFuncAsync<import("@mattermost/types/admin").ClusterInfo[], import("@mattermost/types/store").GlobalState, import("redux").AnyAction>;
29
29
  export declare function testLdap(): ActionFuncAsync<import("@mattermost/types/client4").StatusOK, import("@mattermost/types/store").GlobalState, import("redux").AnyAction>;
30
+ export declare function testLdapConnection(settings: LdapSettings): ActionFuncAsync<import("@mattermost/types/client4").StatusOK, import("@mattermost/types/store").GlobalState, import("redux").AnyAction>;
31
+ export declare function testLdapFilters(settings: LdapSettings): ActionFuncAsync<import("@mattermost/types/client4").StatusOK, import("@mattermost/types/store").GlobalState, import("redux").AnyAction>;
32
+ export declare function testLdapAttributes(settings: LdapSettings): ActionFuncAsync<import("@mattermost/types/client4").StatusOK, import("@mattermost/types/store").GlobalState, import("redux").AnyAction>;
33
+ export declare function testLdapGroupAttributes(settings: LdapSettings): ActionFuncAsync<import("@mattermost/types/client4").StatusOK, import("@mattermost/types/store").GlobalState, import("redux").AnyAction>;
30
34
  export declare function syncLdap(): ActionFuncAsync<import("@mattermost/types/client4").StatusOK, import("@mattermost/types/store").GlobalState, import("redux").AnyAction>;
31
35
  export declare function getLdapGroups(page?: number, perPage?: number, opts?: GroupSearchOpts): ActionFuncAsync<{
32
36
  count: number;
@@ -21,6 +21,10 @@ exports.uploadBrandImage = uploadBrandImage;
21
21
  exports.deleteBrandImage = deleteBrandImage;
22
22
  exports.getClusterStatus = getClusterStatus;
23
23
  exports.testLdap = testLdap;
24
+ exports.testLdapConnection = testLdapConnection;
25
+ exports.testLdapFilters = testLdapFilters;
26
+ exports.testLdapAttributes = testLdapAttributes;
27
+ exports.testLdapGroupAttributes = testLdapGroupAttributes;
24
28
  exports.syncLdap = syncLdap;
25
29
  exports.getLdapGroups = getLdapGroups;
26
30
  exports.linkLdapGroup = linkLdapGroup;
@@ -232,6 +236,38 @@ function testLdap() {
232
236
  clientFunc: client_1.Client4.testLdap,
233
237
  });
234
238
  }
239
+ function testLdapConnection(settings) {
240
+ return (0, helpers_1.bindClientFunc)({
241
+ clientFunc: client_1.Client4.testLdapConnection,
242
+ params: [
243
+ settings,
244
+ ],
245
+ });
246
+ }
247
+ function testLdapFilters(settings) {
248
+ return (0, helpers_1.bindClientFunc)({
249
+ clientFunc: client_1.Client4.testLdapFilters,
250
+ params: [
251
+ settings,
252
+ ],
253
+ });
254
+ }
255
+ function testLdapAttributes(settings) {
256
+ return (0, helpers_1.bindClientFunc)({
257
+ clientFunc: client_1.Client4.testLdapAttributes,
258
+ params: [
259
+ settings,
260
+ ],
261
+ });
262
+ }
263
+ function testLdapGroupAttributes(settings) {
264
+ return (0, helpers_1.bindClientFunc)({
265
+ clientFunc: client_1.Client4.testLdapGroupAttributes,
266
+ params: [
267
+ settings,
268
+ ],
269
+ });
270
+ }
235
271
  function syncLdap() {
236
272
  return (0, helpers_1.bindClientFunc)({
237
273
  clientFunc: client_1.Client4.syncLdap,
@@ -12,6 +12,7 @@ export declare function setServerVersion(serverVersion: string): ActionFuncAsync
12
12
  export declare function setUrl(url: string): boolean;
13
13
  export declare function setFirstAdminVisitMarketplaceStatus(): ActionFuncAsync;
14
14
  export declare function getFirstAdminSetupComplete(): ActionFuncAsync<SystemSetting>;
15
+ export declare function checkCWSAvailability(): ActionFuncAsync;
15
16
  declare const _default: {
16
17
  getClientConfig: typeof getClientConfig;
17
18
  getLicenseConfig: typeof getLicenseConfig;
@@ -10,6 +10,7 @@ exports.setServerVersion = setServerVersion;
10
10
  exports.setUrl = setUrl;
11
11
  exports.setFirstAdminVisitMarketplaceStatus = setFirstAdminVisitMarketplaceStatus;
12
12
  exports.getFirstAdminSetupComplete = getFirstAdminSetupComplete;
13
+ exports.checkCWSAvailability = checkCWSAvailability;
13
14
  const redux_batched_actions_1 = require("redux-batched-actions");
14
15
  const client4_1 = require("@mattermost/types/client4");
15
16
  const action_types_1 = require("mattermost-redux/action_types");
@@ -99,6 +100,27 @@ function getFirstAdminSetupComplete() {
99
100
  return { data };
100
101
  };
101
102
  }
103
+ function checkCWSAvailability() {
104
+ return async (dispatch, getState) => {
105
+ const state = getState();
106
+ const config = state.entities.general.config;
107
+ const isEnterpriseReady = config.BuildEnterpriseReady === 'true';
108
+ if (!isEnterpriseReady) {
109
+ dispatch({ type: action_types_1.GeneralTypes.CWS_AVAILABILITY_CHECK_SUCCESS, data: 'not_applicable' });
110
+ return { data: 'not_applicable' };
111
+ }
112
+ dispatch({ type: action_types_1.GeneralTypes.CWS_AVAILABILITY_CHECK_REQUEST });
113
+ try {
114
+ await client_1.Client4.cwsAvailabilityCheck();
115
+ dispatch({ type: action_types_1.GeneralTypes.CWS_AVAILABILITY_CHECK_SUCCESS, data: 'available' });
116
+ return { data: 'available' };
117
+ }
118
+ catch (error) {
119
+ dispatch({ type: action_types_1.GeneralTypes.CWS_AVAILABILITY_CHECK_FAILURE });
120
+ return { data: 'unavailable' };
121
+ }
122
+ };
123
+ }
102
124
  exports.default = {
103
125
  getClientConfig,
104
126
  getLicenseConfig,
@@ -472,8 +472,10 @@ function deleteOutgoingOAuthConnection(id) {
472
472
  function submitInteractiveDialog(submission) {
473
473
  return async (dispatch, getState) => {
474
474
  const state = getState();
475
- submission.channel_id = (0, channels_1.getCurrentChannelId)(state);
475
+ // Use the current channel as fallback
476
+ submission.channel_id ||= (0, channels_1.getCurrentChannelId)(state);
476
477
  submission.team_id = (0, teams_1.getCurrentTeamId)(state);
478
+ submission.user_id = (0, users_1.getCurrentUserId)(state);
477
479
  let data;
478
480
  try {
479
481
  data = await client_1.Client4.submitInteractiveDialog(submission);
@@ -997,7 +997,7 @@ function getNeededAtMentionedUsernamesAndGroups(state, posts) {
997
997
  if (!groupsByName) {
998
998
  groupsByName = (0, groups_2.getAllGroupsByName)(state);
999
999
  }
1000
- const pattern = /\B@(([a-z0-9_.-]*[a-z0-9_])[.-]*)/gi;
1000
+ const pattern = /\B@(([a-z0-9.\-_:]*[a-z0-9_])[.\-:]*)/gi;
1001
1001
  let match;
1002
1002
  while ((match = pattern.exec(text)) !== null) {
1003
1003
  // match[1] is the matched mention including trailing punctuation
@@ -1123,6 +1123,14 @@ function doPostActionWithCookie(postId, actionId, actionCookie, selectedOption =
1123
1123
  type: action_types_1.IntegrationTypes.RECEIVED_DIALOG_TRIGGER_ID,
1124
1124
  data: data.trigger_id,
1125
1125
  });
1126
+ const state = getState();
1127
+ const post = PostSelectors.getPost(state, postId);
1128
+ dispatch({
1129
+ type: action_types_1.IntegrationTypes.RECEIVED_DIALOG_ARGUMENTS,
1130
+ data: {
1131
+ channel_id: post.channel_id,
1132
+ }
1133
+ });
1126
1134
  }
1127
1135
  return { data };
1128
1136
  };
@@ -0,0 +1,18 @@
1
+ import type { RemoteClusterInfo } from '@mattermost/types/shared_channels';
2
+ import type { ActionFuncAsync } from 'mattermost-redux/types/actions';
3
+ export declare function receivedChannelRemotes(channelId: string, remotes: RemoteClusterInfo[]): {
4
+ type: "RECEIVED_CHANNEL_REMOTES";
5
+ data: {
6
+ channelId: string;
7
+ remotes: RemoteClusterInfo[];
8
+ };
9
+ };
10
+ export declare function receivedRemoteClusterInfo(remoteId: string, remoteInfo: RemoteClusterInfo): {
11
+ type: "RECEIVED_REMOTE_CLUSTER_INFO";
12
+ data: {
13
+ remoteId: string;
14
+ remoteInfo: RemoteClusterInfo;
15
+ };
16
+ };
17
+ export declare function fetchChannelRemotes(channelId: string, forceRefresh?: boolean): ActionFuncAsync<RemoteClusterInfo[]>;
18
+ export declare function fetchRemoteClusterInfo(remoteId: string, forceRefresh?: boolean): ActionFuncAsync<RemoteClusterInfo>;
@@ -0,0 +1,80 @@
1
+ "use strict";
2
+ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
3
+ // See LICENSE.txt for license information.
4
+ var __importDefault = (this && this.__importDefault) || function (mod) {
5
+ return (mod && mod.__esModule) ? mod : { "default": mod };
6
+ };
7
+ Object.defineProperty(exports, "__esModule", { value: true });
8
+ exports.receivedChannelRemotes = receivedChannelRemotes;
9
+ exports.receivedRemoteClusterInfo = receivedRemoteClusterInfo;
10
+ exports.fetchChannelRemotes = fetchChannelRemotes;
11
+ exports.fetchRemoteClusterInfo = fetchRemoteClusterInfo;
12
+ const errors_1 = require("mattermost-redux/actions/errors");
13
+ const helpers_1 = require("mattermost-redux/actions/helpers");
14
+ const client_1 = require("mattermost-redux/client");
15
+ const shared_channels_1 = __importDefault(require("../action_types/shared_channels"));
16
+ function receivedChannelRemotes(channelId, remotes) {
17
+ return {
18
+ type: shared_channels_1.default.RECEIVED_CHANNEL_REMOTES,
19
+ data: {
20
+ channelId,
21
+ remotes,
22
+ },
23
+ };
24
+ }
25
+ function receivedRemoteClusterInfo(remoteId, remoteInfo) {
26
+ return {
27
+ type: shared_channels_1.default.RECEIVED_REMOTE_CLUSTER_INFO,
28
+ data: {
29
+ remoteId,
30
+ remoteInfo,
31
+ },
32
+ };
33
+ }
34
+ function fetchChannelRemotes(channelId, forceRefresh = false) {
35
+ return async (dispatch, getState) => {
36
+ // Check if we already have the data in the Redux store
37
+ const state = getState();
38
+ const remotes = state.entities?.sharedChannels?.remotes?.[channelId];
39
+ // If we already have the data and no refresh is requested, use the cached data
40
+ if (!forceRefresh && remotes && remotes.length > 0) {
41
+ return { data: remotes };
42
+ }
43
+ let data;
44
+ try {
45
+ data = await client_1.Client4.getSharedChannelRemoteInfos(channelId);
46
+ }
47
+ catch (error) {
48
+ (0, helpers_1.forceLogoutIfNecessary)(error, dispatch, getState);
49
+ dispatch((0, errors_1.logError)(error));
50
+ return { error };
51
+ }
52
+ if (data) {
53
+ dispatch(receivedChannelRemotes(channelId, data));
54
+ }
55
+ return { data };
56
+ };
57
+ }
58
+ function fetchRemoteClusterInfo(remoteId, forceRefresh = false) {
59
+ return async (dispatch, getState) => {
60
+ // Check if we already have the remote info cached
61
+ const state = getState();
62
+ const cachedRemote = state.entities?.sharedChannels?.remotesByRemoteId?.[remoteId];
63
+ if (!forceRefresh && cachedRemote) {
64
+ return { data: cachedRemote };
65
+ }
66
+ let data;
67
+ try {
68
+ data = await client_1.Client4.getRemoteClusterInfo(remoteId);
69
+ }
70
+ catch (error) {
71
+ (0, helpers_1.forceLogoutIfNecessary)(error, dispatch, getState);
72
+ dispatch((0, errors_1.logError)(error));
73
+ return { error };
74
+ }
75
+ if (data) {
76
+ dispatch(receivedRemoteClusterInfo(remoteId, data));
77
+ }
78
+ return { data };
79
+ };
80
+ }
@@ -28,7 +28,7 @@ export declare function getProfilesInChannel(channelId: string, page: number, pe
28
28
  }): ActionFuncAsync<UserProfile[]>;
29
29
  export declare function batchGetProfilesInChannel(channelId: string): ActionFuncAsync<Array<Channel['id']>>;
30
30
  export declare function getProfilesInGroupChannels(channelsIds: string[]): ActionFuncAsync;
31
- export declare function getProfilesNotInChannel(teamId: string, channelId: string, groupConstrained: boolean, page: number, perPage?: number): ActionFuncAsync<UserProfile[]>;
31
+ export declare function getProfilesNotInChannel(teamId: string, channelId: string, groupConstrained: boolean, page: number, perPage?: number, cursorId?: string): ActionFuncAsync<UserProfile[]>;
32
32
  export declare function getMe(): ActionFuncAsync<UserProfile>;
33
33
  export declare function getCustomProfileAttributeValues(userID: string): ActionFuncAsync<Record<string, string>>;
34
34
  export declare function updateMyTermsOfServiceStatus(termsOfServiceId: string, accepted: boolean): ActionFuncAsync;
@@ -41,6 +41,9 @@ export declare function createTermsOfService(text: string): ActionFuncAsync<impo
41
41
  export declare function getUser(id: string): ActionFuncAsync<UserProfile, import("@mattermost/types/store").GlobalState, AnyAction>;
42
42
  export declare function getUserByUsername(username: string): ActionFuncAsync<UserProfile, import("@mattermost/types/store").GlobalState, AnyAction>;
43
43
  export declare function getUserByEmail(email: string): ActionFuncAsync<UserProfile, import("@mattermost/types/store").GlobalState, AnyAction>;
44
+ export declare function canUserDirectMessage(userId: string, otherUserId: string): ActionFuncAsync<{
45
+ can_dm: boolean;
46
+ }>;
44
47
  export declare function getStatusesByIds(userIds: Array<UserProfile['id']>): ActionFuncAsync<UserStatus[]>;
45
48
  export declare function setStatus(status: UserStatus): ActionFuncAsync<UserStatus>;
46
49
  export declare function setCustomStatus(customStatus: UserCustomStatus): ActionFuncAsync<unknown, import("@mattermost/types/store").GlobalState, AnyAction>;
@@ -33,6 +33,7 @@ exports.createTermsOfService = createTermsOfService;
33
33
  exports.getUser = getUser;
34
34
  exports.getUserByUsername = getUserByUsername;
35
35
  exports.getUserByEmail = getUserByEmail;
36
+ exports.canUserDirectMessage = canUserDirectMessage;
36
37
  exports.getStatusesByIds = getStatusesByIds;
37
38
  exports.setStatus = setStatus;
38
39
  exports.setCustomStatus = setCustomStatus;
@@ -433,11 +434,11 @@ function getProfilesInGroupChannels(channelsIds) {
433
434
  return { data: channelProfiles };
434
435
  };
435
436
  }
436
- function getProfilesNotInChannel(teamId, channelId, groupConstrained, page, perPage = constants_1.General.PROFILE_CHUNK_SIZE) {
437
+ function getProfilesNotInChannel(teamId, channelId, groupConstrained, page, perPage = constants_1.General.PROFILE_CHUNK_SIZE, cursorId = '') {
437
438
  return async (dispatch, getState) => {
438
439
  let profiles;
439
440
  try {
440
- profiles = await client_1.Client4.getProfilesNotInChannel(teamId, channelId, groupConstrained, page, perPage);
441
+ profiles = await client_1.Client4.getProfilesNotInChannel(teamId, channelId, groupConstrained, page, perPage, cursorId);
441
442
  }
442
443
  catch (error) {
443
444
  (0, helpers_1.forceLogoutIfNecessary)(error, dispatch, getState);
@@ -622,6 +623,19 @@ function getUserByEmail(email) {
622
623
  ],
623
624
  });
624
625
  }
626
+ function canUserDirectMessage(userId, otherUserId) {
627
+ return async (dispatch, getState) => {
628
+ try {
629
+ const result = await client_1.Client4.canUserDirectMessage(userId, otherUserId);
630
+ return { data: result };
631
+ }
632
+ catch (error) {
633
+ (0, helpers_1.forceLogoutIfNecessary)(error, dispatch, getState);
634
+ dispatch((0, errors_1.logError)(error));
635
+ return { error };
636
+ }
637
+ };
638
+ }
625
639
  function getStatusesByIds(userIds) {
626
640
  return async (dispatch, getState) => {
627
641
  if (!userIds || userIds.length === 0) {
@@ -40,6 +40,7 @@ declare const Preferences: {
40
40
  SHOW_UNREAD_SECTION: string;
41
41
  CATEGORY_ADVANCED_SETTINGS: string;
42
42
  ADVANCED_FILTER_JOIN_LEAVE: string;
43
+ RENDER_EMOTICONS_AS_EMOJI: string;
43
44
  ADVANCED_CODE_BLOCK_ON_CTRL_ENTER: string;
44
45
  ADVANCED_SEND_ON_CTRL_ENTER: string;
45
46
  ADVANCED_SYNC_DRAFTS: string;
@@ -44,6 +44,7 @@ const Preferences = {
44
44
  SHOW_UNREAD_SECTION: 'show_unread_section',
45
45
  CATEGORY_ADVANCED_SETTINGS: 'advanced_settings',
46
46
  ADVANCED_FILTER_JOIN_LEAVE: 'join_leave',
47
+ RENDER_EMOTICONS_AS_EMOJI: 'render_emoticons_as_emoji',
47
48
  ADVANCED_CODE_BLOCK_ON_CTRL_ENTER: 'code_block_ctrl_enter',
48
49
  ADVANCED_SEND_ON_CTRL_ENTER: 'send_on_ctrl_enter',
49
50
  ADVANCED_SYNC_DRAFTS: 'sync_drafts',
@@ -1,5 +1,6 @@
1
1
  import type { UserPropertyField } from '@mattermost/types/properties';
2
2
  import type { IDMappedObjects } from '@mattermost/types/utilities';
3
+ export type CWSAvailabilityState = 'pending' | 'available' | 'unavailable' | 'not_applicable';
3
4
  declare const _default: import("redux").Reducer<import("redux").CombinedState<{
4
5
  config: any;
5
6
  license: any;
@@ -7,5 +8,6 @@ declare const _default: import("redux").Reducer<import("redux").CombinedState<{
7
8
  serverVersion: any;
8
9
  firstAdminVisitMarketplaceStatus: any;
9
10
  firstAdminCompleteSetup: any;
11
+ cwsAvailability: CWSAvailabilityState;
10
12
  }>, import("redux").AnyAction>;
11
13
  export default _default;
@@ -86,6 +86,20 @@ function firstAdminCompleteSetup(state = false, action) {
86
86
  return state;
87
87
  }
88
88
  }
89
+ function cwsAvailability(state = 'pending', action) {
90
+ switch (action.type) {
91
+ case action_types_1.GeneralTypes.CWS_AVAILABILITY_CHECK_REQUEST:
92
+ return 'pending';
93
+ case action_types_1.GeneralTypes.CWS_AVAILABILITY_CHECK_SUCCESS:
94
+ return action.data;
95
+ case action_types_1.GeneralTypes.CWS_AVAILABILITY_CHECK_FAILURE:
96
+ return 'unavailable';
97
+ case action_types_1.UserTypes.LOGOUT_SUCCESS:
98
+ return 'pending';
99
+ default:
100
+ return state;
101
+ }
102
+ }
89
103
  exports.default = (0, redux_1.combineReducers)({
90
104
  config,
91
105
  license,
@@ -93,4 +107,5 @@ exports.default = (0, redux_1.combineReducers)({
93
107
  serverVersion,
94
108
  firstAdminVisitMarketplaceStatus,
95
109
  firstAdminCompleteSetup,
110
+ cwsAvailability,
96
111
  });
@@ -6,6 +6,7 @@ declare const _default: import("redux").Reducer<import("redux").CombinedState<{
6
6
  serverVersion: any;
7
7
  firstAdminVisitMarketplaceStatus: any;
8
8
  firstAdminCompleteSetup: any;
9
+ cwsAvailability: import("./general").CWSAvailabilityState;
9
10
  }>;
10
11
  users: import("redux").CombinedState<{
11
12
  currentUserId: any;
@@ -82,6 +83,7 @@ declare const _default: import("redux").Reducer<import("redux").CombinedState<{
82
83
  appsBotIDs: any;
83
84
  outgoingOAuthConnections: import("@mattermost/types/utilities").IDMappedObjects<import("@mattermost/types/integrations").OutgoingOAuthConnection>;
84
85
  systemCommands: import("@mattermost/types/utilities").IDMappedObjects<import("@mattermost/types/integrations").Command>;
86
+ dialogArguments: any;
85
87
  dialogTriggerId: any;
86
88
  dialog: any;
87
89
  }>;
@@ -241,5 +243,9 @@ declare const _default: import("redux").Reducer<import("redux").CombinedState<{
241
243
  [teamId: string]: string[];
242
244
  };
243
245
  }>;
246
+ sharedChannels: import("redux").CombinedState<{
247
+ remotes: Record<string, import("@mattermost/types/shared_channels").RemoteClusterInfo[]>;
248
+ remotesByRemoteId: Record<string, import("@mattermost/types/shared_channels").RemoteClusterInfo>;
249
+ }>;
244
250
  }>, import("redux").AnyAction>;
245
251
  export default _default;
@@ -27,6 +27,7 @@ const roles_1 = __importDefault(require("./roles"));
27
27
  const scheduled_posts_1 = __importDefault(require("./scheduled_posts"));
28
28
  const schemes_1 = __importDefault(require("./schemes"));
29
29
  const search_1 = __importDefault(require("./search"));
30
+ const shared_channels_1 = __importDefault(require("./shared_channels"));
30
31
  const teams_1 = __importDefault(require("./teams"));
31
32
  const threads_1 = __importDefault(require("./threads"));
32
33
  const typing_1 = __importDefault(require("./typing"));
@@ -59,4 +60,5 @@ exports.default = (0, redux_1.combineReducers)({
59
60
  hostedCustomer: hosted_customer_1.default,
60
61
  channelBookmarks: channel_bookmarks_1.default,
61
62
  scheduledPosts: scheduled_posts_1.default,
63
+ sharedChannels: shared_channels_1.default,
62
64
  });
@@ -10,6 +10,7 @@ declare const _default: import("redux").Reducer<import("redux").CombinedState<{
10
10
  appsBotIDs: any;
11
11
  outgoingOAuthConnections: IDMappedObjects<OutgoingOAuthConnection>;
12
12
  systemCommands: IDMappedObjects<Command>;
13
+ dialogArguments: any;
13
14
  dialogTriggerId: any;
14
15
  dialog: any;
15
16
  }>, import("redux").AnyAction>;
@@ -262,6 +262,14 @@ function appsBotIDs(state = [], action) {
262
262
  return state;
263
263
  }
264
264
  }
265
+ function dialogArguments(state = null, action) {
266
+ switch (action.type) {
267
+ case action_types_1.IntegrationTypes.RECEIVED_DIALOG_ARGUMENTS:
268
+ return action.data;
269
+ default:
270
+ return state;
271
+ }
272
+ }
265
273
  function dialogTriggerId(state = '', action) {
266
274
  switch (action.type) {
267
275
  case action_types_1.IntegrationTypes.RECEIVED_DIALOG_TRIGGER_ID:
@@ -297,6 +305,8 @@ exports.default = (0, redux_1.combineReducers)({
297
305
  outgoingOAuthConnections,
298
306
  // object to represent built-in slash commands
299
307
  systemCommands,
308
+ // object containing arguments for interactive dialog
309
+ dialogArguments,
300
310
  // trigger ID for interactive dialogs
301
311
  dialogTriggerId,
302
312
  // data for an interactive dialog to display
@@ -0,0 +1,9 @@
1
+ import type { AnyAction } from 'redux';
2
+ import type { RemoteClusterInfo } from '@mattermost/types/shared_channels';
3
+ export declare function remotes(state: Record<string, RemoteClusterInfo[]> | undefined, action: AnyAction): Record<string, RemoteClusterInfo[]>;
4
+ export declare function remotesByRemoteId(state: Record<string, RemoteClusterInfo> | undefined, action: AnyAction): Record<string, RemoteClusterInfo>;
5
+ declare const _default: import("redux").Reducer<import("redux").CombinedState<{
6
+ remotes: Record<string, RemoteClusterInfo[]>;
7
+ remotesByRemoteId: Record<string, RemoteClusterInfo>;
8
+ }>, AnyAction>;
9
+ export default _default;
@@ -0,0 +1,41 @@
1
+ "use strict";
2
+ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
3
+ // See LICENSE.txt for license information.
4
+ var __importDefault = (this && this.__importDefault) || function (mod) {
5
+ return (mod && mod.__esModule) ? mod : { "default": mod };
6
+ };
7
+ Object.defineProperty(exports, "__esModule", { value: true });
8
+ exports.remotes = remotes;
9
+ exports.remotesByRemoteId = remotesByRemoteId;
10
+ const redux_1 = require("redux");
11
+ const shared_channels_1 = __importDefault(require("../../action_types/shared_channels"));
12
+ function remotes(state = {}, action) {
13
+ switch (action.type) {
14
+ case shared_channels_1.default.RECEIVED_CHANNEL_REMOTES: {
15
+ const { channelId, remotes } = action.data;
16
+ return {
17
+ ...state,
18
+ [channelId]: remotes,
19
+ };
20
+ }
21
+ default:
22
+ return state;
23
+ }
24
+ }
25
+ function remotesByRemoteId(state = {}, action) {
26
+ switch (action.type) {
27
+ case shared_channels_1.default.RECEIVED_REMOTE_CLUSTER_INFO: {
28
+ const { remoteId, remoteInfo } = action.data;
29
+ return {
30
+ ...state,
31
+ [remoteId]: remoteInfo,
32
+ };
33
+ }
34
+ default:
35
+ return state;
36
+ }
37
+ }
38
+ exports.default = (0, redux_1.combineReducers)({
39
+ remotes,
40
+ remotesByRemoteId,
41
+ });
@@ -8,6 +8,7 @@ declare const _default: {
8
8
  serverVersion: any;
9
9
  firstAdminVisitMarketplaceStatus: any;
10
10
  firstAdminCompleteSetup: any;
11
+ cwsAvailability: import("./entities/general").CWSAvailabilityState;
11
12
  }>;
12
13
  users: import("redux").CombinedState<{
13
14
  currentUserId: any;
@@ -84,6 +85,7 @@ declare const _default: {
84
85
  appsBotIDs: any;
85
86
  outgoingOAuthConnections: import("@mattermost/types/utilities").IDMappedObjects<import("@mattermost/types/integrations").OutgoingOAuthConnection>;
86
87
  systemCommands: import("@mattermost/types/utilities").IDMappedObjects<import("@mattermost/types/integrations").Command>;
88
+ dialogArguments: any;
87
89
  dialogTriggerId: any;
88
90
  dialog: any;
89
91
  }>;
@@ -243,6 +245,10 @@ declare const _default: {
243
245
  [teamId: string]: string[];
244
246
  };
245
247
  }>;
248
+ sharedChannels: import("redux").CombinedState<{
249
+ remotes: Record<string, import("@mattermost/types/shared_channels").RemoteClusterInfo[]>;
250
+ remotesByRemoteId: Record<string, import("@mattermost/types/shared_channels").RemoteClusterInfo>;
251
+ }>;
246
252
  }>, import("redux").AnyAction>;
247
253
  errors: (state: Array<{
248
254
  error: any;
@@ -1,5 +1,7 @@
1
1
  import type { Channel, ChannelWithTeamData, ChannelSearchOpts } from '@mattermost/types/channels';
2
+ import type { AccessControlSettings } from '@mattermost/types/config';
2
3
  import type { GlobalState } from '@mattermost/types/store';
4
+ export declare function getAccessControlSettings(state: GlobalState): AccessControlSettings;
3
5
  export declare function getAccessControlPolicy(state: GlobalState, id: string): import("@mattermost/types/access_control").AccessControlPolicy;
4
6
  export declare const getChannelIdsForAccessControlPolicy: (state: GlobalState, parentId: string) => string[];
5
7
  export declare function makeGetChannelsInAccessControlPolicy(): (b: GlobalState, a: {
@@ -3,12 +3,16 @@
3
3
  // See LICENSE.txt for license information.
4
4
  Object.defineProperty(exports, "__esModule", { value: true });
5
5
  exports.getChannelIdsForAccessControlPolicy = void 0;
6
+ exports.getAccessControlSettings = getAccessControlSettings;
6
7
  exports.getAccessControlPolicy = getAccessControlPolicy;
7
8
  exports.makeGetChannelsInAccessControlPolicy = makeGetChannelsInAccessControlPolicy;
8
9
  exports.searchChannelsInheritsPolicy = searchChannelsInheritsPolicy;
9
10
  const channel_utils_1 = require("mattermost-redux/utils/channel_utils");
10
11
  const channels_1 = require("./channels");
11
12
  const create_selector_1 = require("../create_selector");
13
+ function getAccessControlSettings(state) {
14
+ return state.entities.admin.config.AccessControlSettings;
15
+ }
12
16
  function getAccessControlPolicy(state, id) {
13
17
  return state.entities.admin.accessControlPolicies[id];
14
18
  }
@@ -1,6 +1,7 @@
1
1
  import type { ClientConfig, FeatureFlags, ClientLicense } from '@mattermost/types/config';
2
2
  import type { UserPropertyField } from '@mattermost/types/properties';
3
3
  import type { GlobalState } from '@mattermost/types/store';
4
+ import type { CWSAvailabilityState } from '../../reducers/entities/general';
4
5
  export declare function getConfig(state: GlobalState): Partial<ClientConfig>;
5
6
  /**
6
7
  * Safely get value of a specific or known FeatureFlag
@@ -31,3 +32,4 @@ export declare function developerModeEnabled(state: GlobalState): boolean;
31
32
  export declare function testingEnabled(state: GlobalState): boolean;
32
33
  export declare const getCustomProfileAttributes: (state: GlobalState) => UserPropertyField[];
33
34
  export declare function getIsCrossTeamSearchEnabled(state: GlobalState): boolean;
35
+ export declare function getCWSAvailability(state: GlobalState): CWSAvailabilityState;
@@ -13,6 +13,7 @@ exports.isPerformanceDebuggingEnabled = isPerformanceDebuggingEnabled;
13
13
  exports.developerModeEnabled = developerModeEnabled;
14
14
  exports.testingEnabled = testingEnabled;
15
15
  exports.getIsCrossTeamSearchEnabled = getIsCrossTeamSearchEnabled;
16
+ exports.getCWSAvailability = getCWSAvailability;
16
17
  const constants_1 = require("mattermost-redux/constants");
17
18
  const create_selector_1 = require("mattermost-redux/selectors/create_selector");
18
19
  const helpers_1 = require("mattermost-redux/utils/helpers");
@@ -103,3 +104,6 @@ exports.getCustomProfileAttributes = (0, create_selector_1.createSelector)('getC
103
104
  function getIsCrossTeamSearchEnabled(state) {
104
105
  return state.entities.general.config.EnableCrossTeamSearch === 'true';
105
106
  }
107
+ function getCWSAvailability(state) {
108
+ return state.entities.general.cwsAvailability;
109
+ }
@@ -7,6 +7,7 @@ export declare function getOutgoingHooks(state: GlobalState): IDMappedObjects<Ou
7
7
  export declare function getCommands(state: GlobalState): IDMappedObjects<Command>;
8
8
  export declare function getOAuthApps(state: GlobalState): IDMappedObjects<import("@mattermost/types/integrations").OAuthApp>;
9
9
  export declare function getOutgoingOAuthConnections(state: GlobalState): IDMappedObjects<import("@mattermost/types/integrations").OutgoingOAuthConnection>;
10
+ export declare function getDialogArguments(state: GlobalState): import("@mattermost/types/integrations").DialogArgs | undefined;
10
11
  export declare const getFilteredIncomingHooks: (state: GlobalState) => IncomingWebhook[];
11
12
  export declare const getAppsOAuthAppIDs: (state: GlobalState) => string[];
12
13
  export declare const getAppsBotIDs: (state: GlobalState) => string[];
@@ -9,6 +9,7 @@ exports.getOutgoingHooks = getOutgoingHooks;
9
9
  exports.getCommands = getCommands;
10
10
  exports.getOAuthApps = getOAuthApps;
11
11
  exports.getOutgoingOAuthConnections = getOutgoingOAuthConnections;
12
+ exports.getDialogArguments = getDialogArguments;
12
13
  exports.getSystemCommands = getSystemCommands;
13
14
  const create_selector_1 = require("mattermost-redux/selectors/create_selector");
14
15
  const teams_1 = require("mattermost-redux/selectors/entities/teams");
@@ -31,6 +32,9 @@ function getOAuthApps(state) {
31
32
  function getOutgoingOAuthConnections(state) {
32
33
  return state.entities.integrations.outgoingOAuthConnections;
33
34
  }
35
+ function getDialogArguments(state) {
36
+ return state.entities.integrations.dialogArguments;
37
+ }
34
38
  exports.getFilteredIncomingHooks = (0, create_selector_1.createSelector)('getFilteredIncomingHooks', teams_1.getCurrentTeamId, getIncomingHooks, (teamId, hooks) => {
35
39
  return Object.keys(hooks).
36
40
  map((key) => hooks[key]).
@@ -0,0 +1,6 @@
1
+ import type { RemoteClusterInfo } from '@mattermost/types/shared_channels';
2
+ import type { GlobalState } from '@mattermost/types/store';
3
+ export declare function getRemoteNamesForChannel(state: GlobalState, channelId: string): string[];
4
+ export declare function getRemotesForChannel(state: GlobalState, channelId: string): RemoteClusterInfo[];
5
+ export declare function getRemoteClusterInfo(state: GlobalState, remoteId: string): RemoteClusterInfo | null;
6
+ export declare function getRemoteDisplayName(state: GlobalState, remoteId: string): string | null;
@@ -0,0 +1,25 @@
1
+ "use strict";
2
+ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
3
+ // See LICENSE.txt for license information.
4
+ Object.defineProperty(exports, "__esModule", { value: true });
5
+ exports.getRemoteNamesForChannel = getRemoteNamesForChannel;
6
+ exports.getRemotesForChannel = getRemotesForChannel;
7
+ exports.getRemoteClusterInfo = getRemoteClusterInfo;
8
+ exports.getRemoteDisplayName = getRemoteDisplayName;
9
+ function getRemoteNamesForChannel(state, channelId) {
10
+ const remotes = state.entities?.sharedChannels?.remotes?.[channelId];
11
+ if (remotes && remotes.length > 0) {
12
+ return remotes.map((remote) => remote.display_name);
13
+ }
14
+ return [];
15
+ }
16
+ function getRemotesForChannel(state, channelId) {
17
+ return state.entities?.sharedChannels?.remotes?.[channelId] || [];
18
+ }
19
+ function getRemoteClusterInfo(state, remoteId) {
20
+ return state.entities?.sharedChannels?.remotesByRemoteId?.[remoteId] || null;
21
+ }
22
+ function getRemoteDisplayName(state, remoteId) {
23
+ const remote = getRemoteClusterInfo(state, remoteId);
24
+ return remote?.display_name || null;
25
+ }
@@ -30,6 +30,7 @@ export declare function getUserStatuses(state: GlobalState): RelationOneToOne<Us
30
30
  export declare function getUserSessions(state: GlobalState): any[];
31
31
  export declare function getUserAudits(state: GlobalState): any[];
32
32
  export declare function getUser(state: GlobalState, id: UserProfile['id']): UserProfile;
33
+ export declare function getUsersByIDs(state: GlobalState, ids: Array<UserProfile['id']>): UserProfile[];
33
34
  export declare const getUsersByUsername: (a: GlobalState) => Record<string, UserProfile>;
34
35
  export declare function getUserByUsername(state: GlobalState, username: UserProfile['username']): UserProfile;
35
36
  export declare const getUsersByEmail: (a: GlobalState) => Record<string, UserProfile>;
@@ -14,6 +14,7 @@ exports.getUserStatuses = getUserStatuses;
14
14
  exports.getUserSessions = getUserSessions;
15
15
  exports.getUserAudits = getUserAudits;
16
16
  exports.getUser = getUser;
17
+ exports.getUsersByIDs = getUsersByIDs;
17
18
  exports.getUserByUsername = getUserByUsername;
18
19
  exports.getUserByEmail = getUserByEmail;
19
20
  exports.filterProfiles = filterProfiles;
@@ -87,6 +88,9 @@ function getUserAudits(state) {
87
88
  function getUser(state, id) {
88
89
  return state.entities.users.profiles[id];
89
90
  }
91
+ function getUsersByIDs(state, ids) {
92
+ return ids.map((userId) => getUser(state, userId));
93
+ }
90
94
  exports.getUsersByUsername = (0, create_selector_1.createSelector)('getUsersByUsername', exports.getUsers, (users) => {
91
95
  const usersByUsername = {};
92
96
  for (const id in users) {
@@ -12,6 +12,7 @@ const state = {
12
12
  firstAdminVisitMarketplaceStatus: false,
13
13
  firstAdminCompleteSetup: false,
14
14
  customProfileAttributes: {},
15
+ cwsAvailability: 'pending',
15
16
  },
16
17
  users: {
17
18
  currentUserId: '',
@@ -47,7 +47,7 @@ function displayUsername(user, teammateNameDisplay, useFallbackUsername = true)
47
47
  name = getFullName(user);
48
48
  }
49
49
  else {
50
- name = user.username;
50
+ name = (user.remote_id && user.props?.RemoteUsername) ? user.props.RemoteUsername : user.username;
51
51
  }
52
52
  if (!name || name.trim().length === 0) {
53
53
  name = user.username;
@@ -155,12 +155,8 @@ function nameSuggestionsForUser(user) {
155
155
  profileSuggestions.push((user.nickname || '').toLowerCase());
156
156
  const positionSuggestions = getSuggestionsSplitBy((user.position || '').toLowerCase(), ' ');
157
157
  profileSuggestions.push(...positionSuggestions);
158
- const email = (user.email || '').toLowerCase();
158
+ const email = (user.email || '').toLowerCase().split('@')[0];
159
159
  profileSuggestions.push(email);
160
- const split = email.split('@');
161
- if (split.length > 1) {
162
- profileSuggestions.push(split[1]);
163
- }
164
160
  return profileSuggestions;
165
161
  }
166
162
  function filterProfilesStartingWithTerm(users, term) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mattermost-redux",
3
- "version": "10.9.0",
3
+ "version": "10.11.0",
4
4
  "description": "Common code (API client, Redux stores, logic, utility functions) for building a Mattermost client",
5
5
  "keywords": [
6
6
  "mattermost"
@@ -39,8 +39,8 @@
39
39
  "directory": "webapp/platform/mattermost-redux"
40
40
  },
41
41
  "dependencies": {
42
- "@mattermost/client": "10.9.0",
43
- "@mattermost/types": "10.9.0",
42
+ "@mattermost/client": "10.11.0",
43
+ "@mattermost/types": "10.11.0",
44
44
  "@redux-devtools/extension": "^3.2.3",
45
45
  "lodash": "^4.17.21",
46
46
  "moment-timezone": "^0.5.38",
@@ -1,4 +0,0 @@
1
- import type { Product } from '@mattermost/types/cloud';
2
- import type { GlobalState } from '@mattermost/types/store';
3
- export declare function getSelfHostedProducts(state: GlobalState): Record<string, Product>;
4
- export declare function getSelfHostedProductsLoaded(state: GlobalState): boolean;
@@ -1,12 +0,0 @@
1
- "use strict";
2
- // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
3
- // See LICENSE.txt for license information.
4
- Object.defineProperty(exports, "__esModule", { value: true });
5
- exports.getSelfHostedProducts = getSelfHostedProducts;
6
- exports.getSelfHostedProductsLoaded = getSelfHostedProductsLoaded;
7
- function getSelfHostedProducts(state) {
8
- return state.entities.hostedCustomer.products.products;
9
- }
10
- function getSelfHostedProductsLoaded(state) {
11
- return state.entities.hostedCustomer.products.productsLoaded;
12
- }