summaryrefslogtreecommitdiffstats
path: root/web/react
diff options
context:
space:
mode:
Diffstat (limited to 'web/react')
-rw-r--r--web/react/components/activity_log_modal.jsx5
-rw-r--r--web/react/components/email_verify.jsx4
-rw-r--r--web/react/components/login.jsx12
-rw-r--r--web/react/components/post_info.jsx14
-rw-r--r--web/react/components/rhs_comment.jsx129
-rw-r--r--web/react/components/user_settings/import_theme_modal.jsx1
-rw-r--r--web/react/utils/constants.jsx16
-rw-r--r--web/react/utils/utils.jsx13
8 files changed, 105 insertions, 89 deletions
diff --git a/web/react/components/activity_log_modal.jsx b/web/react/components/activity_log_modal.jsx
index aee2541b5..ff370c32e 100644
--- a/web/react/components/activity_log_modal.jsx
+++ b/web/react/components/activity_log_modal.jsx
@@ -31,6 +31,11 @@ export default class ActivityLogModal extends React.Component {
}
submitRevoke(altId, e) {
e.preventDefault();
+ var modalContent = $(e.target).closest('.modal-content');
+ modalContent.addClass('animation--highlight');
+ setTimeout(() => {
+ modalContent.removeClass('animation--highlight');
+ }, 1500);
Client.revokeSession(altId,
function handleRevokeSuccess() {
AsyncClient.getSessions();
diff --git a/web/react/components/email_verify.jsx b/web/react/components/email_verify.jsx
index 8d3f15525..391de3326 100644
--- a/web/react/components/email_verify.jsx
+++ b/web/react/components/email_verify.jsx
@@ -38,8 +38,8 @@ export default class EmailVerify extends React.Component {
}
return (
- <div className='col-sm-offset-4 col-sm-4'>
- <div className='panel panel-default'>
+ <div className='col-sm-12'>
+ <div className='panel panel-default verify_panel'>
<div className='panel-heading'>
<h3 className='panel-title'>{title}</h3>
</div>
diff --git a/web/react/components/login.jsx b/web/react/components/login.jsx
index 70f7a5d6e..54df75cbc 100644
--- a/web/react/components/login.jsx
+++ b/web/react/components/login.jsx
@@ -112,6 +112,17 @@ export default class Login extends React.Component {
errorClass = ' has-error';
}
+ const verifiedParam = Utils.getUrlParameter('verified');
+ let verifiedBox = '';
+ if (verifiedParam) {
+ verifiedBox = (
+ <div className='alert alert-success'>
+ <i className='fa fa-check' />
+ {' Email Verified'}
+ </div>
+ );
+ }
+
let emailSignup;
if (global.window.config.EnableSignUpWithEmail === 'true') {
emailSignup = (
@@ -175,6 +186,7 @@ export default class Login extends React.Component {
<h2 className='signup-team__name'>{teamDisplayName}</h2>
<h2 className='signup-team__subdomain'>on {global.window.config.SiteName}</h2>
<form onSubmit={this.handleSubmit}>
+ {verifiedBox}
<div className={'form-group' + errorClass}>
{serverError}
</div>
diff --git a/web/react/components/post_info.jsx b/web/react/components/post_info.jsx
index dba75ac5f..c1e8979a4 100644
--- a/web/react/components/post_info.jsx
+++ b/web/react/components/post_info.jsx
@@ -13,12 +13,6 @@ export default class PostInfo extends React.Component {
super(props);
this.state = {};
}
- shouldShowComment(state, type, isOwner) {
- if (state === Constants.POST_FAILED || state === Constants.POST_LOADING) {
- return false;
- }
- return isOwner || (this.props.allowReply === 'true' && type !== 'Comment');
- }
createDropdown() {
var post = this.props.post;
var isOwner = UserStore.getCurrentId() === post.user_id;
@@ -33,10 +27,6 @@ export default class PostInfo extends React.Component {
type = 'Comment';
}
- if (!this.shouldShowComment(post.state, type, isOwner)) {
- return '';
- }
-
var dropdownContents = [];
var dataComments = 0;
if (type === 'Post') {
@@ -106,6 +96,10 @@ export default class PostInfo extends React.Component {
);
}
+ if (dropdownContents.length === 0) {
+ return '';
+ }
+
return (
<div>
<a
diff --git a/web/react/components/rhs_comment.jsx b/web/react/components/rhs_comment.jsx
index 5b4694eb1..aa355f8cc 100644
--- a/web/react/components/rhs_comment.jsx
+++ b/web/react/components/rhs_comment.jsx
@@ -70,19 +70,84 @@ export default class RhsComment extends React.Component {
componentDidUpdate() {
this.parseEmojis();
}
- render() {
+ createDropdown() {
var post = this.props.post;
- var currentUserCss = '';
- if (UserStore.getCurrentId() === post.user_id) {
- currentUserCss = 'current--user';
+ if (post.state === Constants.POST_FAILED || post.state === Constants.POST_LOADING || post.state === Constants.POST_DELETED) {
+ return '';
}
var isOwner = UserStore.getCurrentId() === post.user_id;
+ var isAdmin = Utils.isAdmin(UserStore.getCurrentUser().roles);
+
+ var dropdownContents = [];
+
+ if (isOwner) {
+ dropdownContents.push(
+ <li role='presentation'>
+ <a
+ href='#'
+ role='menuitem'
+ data-toggle='modal'
+ data-target='#edit_post'
+ data-title='Comment'
+ data-message={post.message}
+ data-postid={post.id}
+ data-channelid={post.channel_id}
+ >
+ Edit
+ </a>
+ </li>
+ );
+ }
- var type = 'Post';
- if (post.root_id.length > 0) {
- type = 'Comment';
+ if (isOwner || isAdmin) {
+ dropdownContents.push(
+ <li role='presentation'>
+ <a
+ href='#'
+ role='menuitem'
+ data-toggle='modal'
+ data-target='#delete_post'
+ data-title='Comment'
+ data-postid={post.id}
+ data-channelid={post.channel_id}
+ data-comments={0}
+ >
+ Delete
+ </a>
+ </li>
+ );
+ }
+
+ if (dropdownContents.length === 0) {
+ return '';
+ }
+
+ return (
+ <div className='dropdown'>
+ <a
+ href='#'
+ className='dropdown-toggle theme'
+ type='button'
+ data-toggle='dropdown'
+ aria-expanded='false'
+ />
+ <ul
+ className='dropdown-menu'
+ role='menu'
+ >
+ {dropdownContents}
+ </ul>
+ </div>
+ );
+ }
+ render() {
+ var post = this.props.post;
+
+ var currentUserCss = '';
+ if (UserStore.getCurrentId() === post.user_id) {
+ currentUserCss = 'current--user';
}
var timestamp = UserStore.getCurrentUser().update_at;
@@ -110,53 +175,7 @@ export default class RhsComment extends React.Component {
);
}
- var ownerOptions;
- if (isOwner && post.state !== Constants.POST_FAILED && post.state !== Constants.POST_LOADING) {
- ownerOptions = (
- <div className='dropdown'>
- <a
- href='#'
- className='dropdown-toggle theme'
- type='button'
- data-toggle='dropdown'
- aria-expanded='false'
- />
- <ul
- className='dropdown-menu'
- role='menu'
- >
- <li role='presentation'>
- <a
- href='#'
- role='menuitem'
- data-toggle='modal'
- data-target='#edit_post'
- data-title={type}
- data-message={post.message}
- data-postid={post.id}
- data-channelid={post.channel_id}
- >
- Edit
- </a>
- </li>
- <li role='presentation'>
- <a
- href='#'
- role='menuitem'
- data-toggle='modal'
- data-target='#delete_post'
- data-title={type}
- data-postid={post.id}
- data-channelid={post.channel_id}
- data-comments={0}
- >
- Delete
- </a>
- </li>
- </ul>
- </div>
- );
- }
+ var dropdown = this.createDropdown();
var fileAttachment;
if (post.filenames && post.filenames.length > 0) {
@@ -190,7 +209,7 @@ export default class RhsComment extends React.Component {
</time>
</li>
<li className='post-header-col post-header__reply'>
- {ownerOptions}
+ {dropdown}
</li>
</ul>
<div className='post-body'>
diff --git a/web/react/components/user_settings/import_theme_modal.jsx b/web/react/components/user_settings/import_theme_modal.jsx
index 4e8ee03fa..3301c6596 100644
--- a/web/react/components/user_settings/import_theme_modal.jsx
+++ b/web/react/components/user_settings/import_theme_modal.jsx
@@ -49,7 +49,6 @@ export default class ImportThemeModal extends React.Component {
theme.sidebarText = colors[5];
theme.sidebarUnreadText = colors[5];
theme.sidebarTextHoverBg = colors[4];
- theme.sidebarTextHoverColor = colors[5];
theme.sidebarTextActiveBg = colors[2];
theme.sidebarTextActiveColor = colors[3];
theme.sidebarHeaderBg = colors[1];
diff --git a/web/react/utils/constants.jsx b/web/react/utils/constants.jsx
index aba63b91c..8fe1a5884 100644
--- a/web/react/utils/constants.jsx
+++ b/web/react/utils/constants.jsx
@@ -122,10 +122,9 @@ module.exports = {
default: {
type: 'Mattermost',
sidebarBg: '#fafafa',
- sidebarText: '#999999',
+ sidebarText: '#333333',
sidebarUnreadText: '#333333',
sidebarTextHoverBg: '#e6f2fa',
- sidebarTextHoverColor: '#999999',
sidebarTextActiveBg: '#e1e1e1',
sidebarTextActiveColor: '#111111',
sidebarHeaderBg: '#2389d7',
@@ -144,10 +143,9 @@ module.exports = {
organization: {
type: 'Organization',
sidebarBg: '#2071a7',
- sidebarText: '#bfcde8',
+ sidebarText: '#fff',
sidebarUnreadText: '#fff',
sidebarTextHoverBg: '#136197',
- sidebarTextHoverColor: '#bfcde8',
sidebarTextActiveBg: '#136197',
sidebarTextActiveColor: '#FFFFFF',
sidebarHeaderBg: '#2f81b7',
@@ -166,10 +164,9 @@ module.exports = {
mattermostDark: {
type: 'Mattermost Dark',
sidebarBg: '#1B2C3E',
- sidebarText: '#bbbbbb',
+ sidebarText: '#fff',
sidebarUnreadText: '#fff',
sidebarTextHoverBg: '#4A5664',
- sidebarTextHoverColor: '#bbbbbb',
sidebarTextActiveBg: '#39769C',
sidebarTextActiveColor: '#FFFFFF',
sidebarHeaderBg: '#1B2C3E',
@@ -188,10 +185,9 @@ module.exports = {
windows10: {
type: 'Windows Dark',
sidebarBg: '#171717',
- sidebarText: '#999',
+ sidebarText: '#fff',
sidebarUnreadText: '#fff',
sidebarTextHoverBg: '#302e30',
- sidebarTextHoverColor: '#999',
sidebarTextActiveBg: '#484748',
sidebarTextActiveColor: '#FFFFFF',
sidebarHeaderBg: '#1f1f1f',
@@ -234,10 +230,6 @@ module.exports = {
uiName: 'Sidebar Text Hover BG'
},
{
- id: 'sidebarTextHoverColor',
- uiName: 'Sidebar Text Hover Color'
- },
- {
id: 'sidebarTextActiveBg',
uiName: 'Sidebar Text Active BG'
},
diff --git a/web/react/utils/utils.jsx b/web/react/utils/utils.jsx
index 3a04f3623..8431e56bc 100644
--- a/web/react/utils/utils.jsx
+++ b/web/react/utils/utils.jsx
@@ -399,9 +399,9 @@ export function applyTheme(theme) {
}
if (theme.sidebarText) {
- changeCss('.sidebar--left .nav-pills__container li>a, .sidebar--right, .settings-modal .nav-pills>li a, .sidebar--menu', 'color:' + theme.sidebarText, 1);
+ changeCss('.sidebar--left .nav-pills__container li>a, .sidebar--right, .settings-modal .nav-pills>li a, .sidebar--menu', 'color:' + changeOpacity(theme.sidebarText, 0.6), 1);
changeCss('@media(max-width: 768px){.settings-modal .settings-table .nav>li>a', 'color:' + theme.sidebarText, 1);
- changeCss('.sidebar--left .nav-pills__container li>h4, .sidebar--left .add-channel-btn', 'color:' + changeOpacity(theme.sidebarText, 0.8), 1);
+ changeCss('.sidebar--left .nav-pills__container li>h4, .sidebar--left .add-channel-btn', 'color:' + changeOpacity(theme.sidebarText, 0.6), 1);
changeCss('.sidebar--left .add-channel-btn:hover, .sidebar--left .add-channel-btn:focus', 'color:' + theme.sidebarText, 1);
changeCss('.sidebar--left, .sidebar--right .sidebar--right__header', 'border-color:' + changeOpacity(theme.sidebarText, 0.2), 1);
changeCss('.sidebar--left .status path', 'fill:' + changeOpacity(theme.sidebarText, 0.5), 1);
@@ -417,11 +417,6 @@ export function applyTheme(theme) {
changeCss('@media(max-width: 768px){.settings-modal .settings-table .nav>li:hover a', 'background:' + theme.sidebarTextHoverBg, 1);
}
- if (theme.sidebarTextHoverColor) {
- changeCss('.sidebar--left .nav-pills__container li>a:hover, .sidebar--left .nav-pills__container li>a:focus, .settings-modal .nav-pills>li:hover a, .settings-modal .nav-pills>li:focus a', 'color:' + theme.sidebarTextHoverColor, 2);
- changeCss('@media(max-width: 768px){.settings-modal .settings-table .nav>li:hover a', 'color:' + theme.sidebarTextHoverColor, 2);
- }
-
if (theme.sidebarTextActiveBg) {
changeCss('.sidebar--left .nav-pills__container li.active a, .sidebar--left .nav-pills__container li.active a:hover, .sidebar--left .nav-pills__container li.active a:focus, .settings-modal .nav-pills>li.active a, .settings-modal .nav-pills>li.active a:hover, .settings-modal .nav-pills>li.active a:active', 'background:' + theme.sidebarTextActiveBg, 1);
}
@@ -495,7 +490,7 @@ export function applyTheme(theme) {
changeCss('.post-image__column a, .post-image__column a:hover, .post-image__column a:focus', 'color:' + theme.centerChannelColor, 1);
changeCss('.search-bar__container .search__form .search-bar, .form-control', 'color:' + theme.centerChannelColor, 2);
changeCss('@media(max-width: 768px){.search-bar__container .search__form .search-bar', 'background:' + changeOpacity(theme.centerChannelColor, 0.2) + '; color: inherit;', 1);
- changeCss('.search-bar__container .search__form, .form-control', 'border-color:' + changeOpacity(theme.centerChannelColor, 0.2), 1);
+ changeCss('.input-group-addon, .search-bar__container .search__form, .form-control', 'border-color:' + changeOpacity(theme.centerChannelColor, 0.2), 1);
changeCss('.form-control:focus', 'border-color:' + changeOpacity(theme.centerChannelColor, 0.3), 1);
changeCss('.channel-intro .channel-intro__content', 'background:' + changeOpacity(theme.centerChannelColor, 0.05), 1);
changeCss('.date-separator .separator__text', 'color:' + theme.centerChannelColor, 2);
@@ -503,7 +498,7 @@ export function applyTheme(theme) {
changeCss('.modal .custom-textarea:focus', 'border-color:' + changeOpacity(theme.centerChannelColor, 0.3), 1);
changeCss('.channel-intro, .settings-modal .settings-table .settings-content .divider-dark, hr, .settings-modal .settings-table .settings-links', 'border-color:' + changeOpacity(theme.centerChannelColor, 0.2), 1);
changeCss('.post.current--user .post-body, .post.post--comment.other--root.current--user .post-comment', 'background:' + changeOpacity(theme.centerChannelColor, 0.07), 1);
- changeCss('.post.current--user .post-body, .post.post--comment.other--root.current--user .post-comment, .post.post--comment.other--root .post-comment, .post.same--root .post-body, .modal .more-channel-table tbody>tr td, .member-div:first-child, .member-div', 'border-color:' + changeOpacity(theme.centerChannelColor, 0.1), 2);
+ changeCss('.post.current--user .post-body, .post.post--comment.other--root.current--user .post-comment, .post.post--comment.other--root .post-comment, .post.same--root .post-body, .modal .more-channel-table tbody>tr td, .member-div:first-child, .member-div, .access-history__table .access__report, .activity-log__table', 'border-color:' + changeOpacity(theme.centerChannelColor, 0.1), 2);
changeCss('@media(max-width: 1440px){.post.same--root', 'border-color:' + changeOpacity(theme.centerChannelColor, 0.07), 2);
changeCss('@media(max-width: 1440px){.post.same--root', 'border-color:' + changeOpacity(theme.centerChannelColor, 0.07), 2);
changeCss('@media(max-width: 1800px){.inner__wrap.move--left .post.post--comment.same--root', 'border-color:' + changeOpacity(theme.centerChannelColor, 0.07), 2);