mattermost-redux 10.11.0 → 10.12.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.
package/lib/actions/users.js
CHANGED
|
@@ -134,9 +134,6 @@ function loadMe() {
|
|
|
134
134
|
dispatch((0, teams_1.getMyTeams)()),
|
|
135
135
|
dispatch((0, teams_1.getMyTeamMembers)()),
|
|
136
136
|
]);
|
|
137
|
-
if ((0, general_2.getFeatureFlagValue)(getState(), 'CustomProfileAttributes') === 'true') {
|
|
138
|
-
dispatch((0, general_1.getCustomProfileAttributeFields)());
|
|
139
|
-
}
|
|
140
137
|
const isCollapsedThreads = (0, preferences_2.isCollapsedThreadsEnabled)(getState());
|
|
141
138
|
await dispatch((0, teams_1.getMyTeamUnreads)(isCollapsedThreads));
|
|
142
139
|
await dispatch((0, limits_1.getServerLimits)());
|
|
@@ -355,8 +355,11 @@ exports.getUnreadStatus = (0, create_selector_1.createSelector)('getUnreadStatus
|
|
|
355
355
|
if (!channelExists) {
|
|
356
356
|
return counts;
|
|
357
357
|
}
|
|
358
|
+
if ((0, channel_utils_1.isChannelMuted)(membership)) {
|
|
359
|
+
return counts;
|
|
360
|
+
}
|
|
358
361
|
const mentions = collapsedThreads ? membership.mention_count_root : membership.mention_count;
|
|
359
|
-
if (mentions
|
|
362
|
+
if (mentions) {
|
|
360
363
|
counts.mentions += mentions;
|
|
361
364
|
}
|
|
362
365
|
const unreadCount = (0, channel_utils_1.calculateUnreadCount)(messageCounts[channelId], myMembers[channelId], collapsedThreads);
|
|
@@ -18,7 +18,7 @@ export declare function profileListToMap(profileList: UserProfile[]): IDMappedOb
|
|
|
18
18
|
export declare function removeUserFromList(userId: UserProfile['id'], list: UserProfile[]): UserProfile[];
|
|
19
19
|
export declare function getSuggestionsSplitBy(term: string, splitStr: string): string[];
|
|
20
20
|
export declare function getSuggestionsSplitByMultiple(term: string, splitStrs: string[]): string[];
|
|
21
|
-
export declare function nameSuggestionsForUser(user: UserProfile): string[];
|
|
21
|
+
export declare function nameSuggestionsForUser(user: UserProfile, includeFullEmail?: boolean): string[];
|
|
22
22
|
export declare function filterProfilesStartingWithTerm(users: UserProfile[], term: string): UserProfile[];
|
|
23
23
|
export declare function filterProfilesMatchingWithTerm(users: UserProfile[], term: string): UserProfile[];
|
|
24
24
|
export declare function sortByUsername(a: UserProfile, b: UserProfile): number;
|
package/lib/utils/user_utils.js
CHANGED
|
@@ -144,7 +144,7 @@ function getSuggestionsSplitByMultiple(term, splitStrs) {
|
|
|
144
144
|
}, new Set());
|
|
145
145
|
return [...suggestions];
|
|
146
146
|
}
|
|
147
|
-
function nameSuggestionsForUser(user) {
|
|
147
|
+
function nameSuggestionsForUser(user, includeFullEmail = false) {
|
|
148
148
|
const profileSuggestions = [];
|
|
149
149
|
const usernameSuggestions = getSuggestionsSplitByMultiple((user.username || '').toLowerCase(), constants_1.General.AUTOCOMPLETE_SPLIT_CHARACTERS);
|
|
150
150
|
profileSuggestions.push(...usernameSuggestions);
|
|
@@ -155,8 +155,13 @@ 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()
|
|
159
|
-
|
|
158
|
+
const email = (user.email || '').toLowerCase();
|
|
159
|
+
const emailPrefix = email.split('@')[0];
|
|
160
|
+
profileSuggestions.push(emailPrefix);
|
|
161
|
+
// Only include full email if explicitly requested (when search contains @)
|
|
162
|
+
if (includeFullEmail && email.includes('@')) {
|
|
163
|
+
profileSuggestions.push(email);
|
|
164
|
+
}
|
|
160
165
|
return profileSuggestions;
|
|
161
166
|
}
|
|
162
167
|
function filterProfilesStartingWithTerm(users, term) {
|
|
@@ -165,11 +170,13 @@ function filterProfilesStartingWithTerm(users, term) {
|
|
|
165
170
|
if (trimmedTerm.startsWith('@')) {
|
|
166
171
|
trimmedTerm = trimmedTerm.substr(1);
|
|
167
172
|
}
|
|
173
|
+
// Include full email in suggestions if the search term contains @
|
|
174
|
+
const includeFullEmail = lowercasedTerm.includes('@');
|
|
168
175
|
return users.filter((user) => {
|
|
169
176
|
if (!user) {
|
|
170
177
|
return false;
|
|
171
178
|
}
|
|
172
|
-
const profileSuggestions = nameSuggestionsForUser(user);
|
|
179
|
+
const profileSuggestions = nameSuggestionsForUser(user, includeFullEmail);
|
|
173
180
|
return profileSuggestions.filter((suggestion) => suggestion !== '').some((suggestion) => suggestion.startsWith(trimmedTerm));
|
|
174
181
|
});
|
|
175
182
|
}
|
|
@@ -179,11 +186,13 @@ function filterProfilesMatchingWithTerm(users, term) {
|
|
|
179
186
|
if (trimmedTerm.startsWith('@')) {
|
|
180
187
|
trimmedTerm = trimmedTerm.substr(1);
|
|
181
188
|
}
|
|
189
|
+
// Include full email in suggestions if the search term contains @
|
|
190
|
+
const includeFullEmail = lowercasedTerm.includes('@');
|
|
182
191
|
return users.filter((user) => {
|
|
183
192
|
if (!user) {
|
|
184
193
|
return false;
|
|
185
194
|
}
|
|
186
|
-
const profileSuggestions = nameSuggestionsForUser(user);
|
|
195
|
+
const profileSuggestions = nameSuggestionsForUser(user, includeFullEmail);
|
|
187
196
|
return profileSuggestions.filter((suggestion) => suggestion !== '').some((suggestion) => suggestion.includes(trimmedTerm));
|
|
188
197
|
});
|
|
189
198
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mattermost-redux",
|
|
3
|
-
"version": "10.
|
|
3
|
+
"version": "10.12.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.
|
|
43
|
-
"@mattermost/types": "10.
|
|
42
|
+
"@mattermost/client": "10.12.0",
|
|
43
|
+
"@mattermost/types": "10.12.0",
|
|
44
44
|
"@redux-devtools/extension": "^3.2.3",
|
|
45
45
|
"lodash": "^4.17.21",
|
|
46
46
|
"moment-timezone": "^0.5.38",
|