Mm 52259 system message ignore colorize (#23630)
* MM-52259 - fix system message using not themed color * fix unit tests and code clean up
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
c06c47f22e
Коммит
e60e2dc040
@@ -147,7 +147,7 @@ exports[`components/UserProfile should match snapshot, with colorization 1`] = `
|
|||||||
className="user-popover style--none"
|
className="user-popover style--none"
|
||||||
style={
|
style={
|
||||||
Object {
|
Object {
|
||||||
"color": "#000000",
|
"color": "#bbd279",
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import React from 'react';
|
|||||||
import {shallow} from 'enzyme';
|
import {shallow} from 'enzyme';
|
||||||
|
|
||||||
import {UserProfile as UserProfileType} from '@mattermost/types/users';
|
import {UserProfile as UserProfileType} from '@mattermost/types/users';
|
||||||
|
import {Preferences} from 'mattermost-redux/constants';
|
||||||
|
|
||||||
import UserProfile from './user_profile';
|
import UserProfile from './user_profile';
|
||||||
|
|
||||||
@@ -14,6 +15,7 @@ describe('components/UserProfile', () => {
|
|||||||
isBusy: false,
|
isBusy: false,
|
||||||
user: {username: 'username'} as UserProfileType,
|
user: {username: 'username'} as UserProfileType,
|
||||||
userId: 'user_id',
|
userId: 'user_id',
|
||||||
|
theme: Preferences.THEMES.onyx,
|
||||||
};
|
};
|
||||||
|
|
||||||
test('should match snapshot', () => {
|
test('should match snapshot', () => {
|
||||||
|
|||||||
@@ -90,7 +90,7 @@ export default class UserProfile extends PureComponent<UserProfileProps> {
|
|||||||
|
|
||||||
const ariaName: string = typeof name === 'string' ? name.toLowerCase() : '';
|
const ariaName: string = typeof name === 'string' ? name.toLowerCase() : '';
|
||||||
|
|
||||||
let userColor = '#000000';
|
let userColor = theme?.centerChannelColor;
|
||||||
if (user && theme) {
|
if (user && theme) {
|
||||||
userColor = generateColor(user.username, theme.centerChannelBg);
|
userColor = generateColor(user.username, theme.centerChannelBg);
|
||||||
}
|
}
|
||||||
@@ -130,7 +130,7 @@ export default class UserProfile extends PureComponent<UserProfileProps> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<React.Fragment>
|
<>
|
||||||
<OverlayTrigger
|
<OverlayTrigger
|
||||||
ref={this.setOverlaynRef}
|
ref={this.setOverlaynRef}
|
||||||
trigger={['click']}
|
trigger={['click']}
|
||||||
@@ -163,7 +163,7 @@ export default class UserProfile extends PureComponent<UserProfileProps> {
|
|||||||
{sharedIcon}
|
{sharedIcon}
|
||||||
{(user && user.is_bot) && <BotTag/>}
|
{(user && user.is_bot) && <BotTag/>}
|
||||||
{(user && isGuest(user.roles)) && <GuestTag/>}
|
{(user && isGuest(user.roles)) && <GuestTag/>}
|
||||||
</React.Fragment>
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user