diff options
Diffstat (limited to 'web/react/utils')
-rw-r--r-- | web/react/utils/client.jsx | 12 | ||||
-rw-r--r-- | web/react/utils/constants.jsx | 32 | ||||
-rw-r--r-- | web/react/utils/utils.jsx | 17 |
3 files changed, 35 insertions, 26 deletions
diff --git a/web/react/utils/client.jsx b/web/react/utils/client.jsx index d9f486009..6dccfcdeb 100644 --- a/web/react/utils/client.jsx +++ b/web/react/utils/client.jsx @@ -2,6 +2,7 @@ var BrowserStore = require('../stores/browser_store.jsx'); var TeamStore = require('../stores/team_store.jsx'); +var ErrorStore = require('../stores/error_store.jsx'); export function track(category, action, label, prop, val) { global.window.analytics.track(action, {category: category, label: label, property: prop, value: val}); @@ -27,7 +28,16 @@ function handleError(methodName, xhr, status, err) { msg = 'error in ' + methodName + ' status=' + status + ' statusCode=' + xhr.status + ' err=' + err; if (xhr.status === 0) { - e = {message: 'There appears to be a problem with your internet connection', connErrorCount: 1}; + let errorCount = 1; + const oldError = ErrorStore.getLastError(); + let connectError = 'There appears to be a problem with your internet connection'; + + if (oldError && oldError.connErrorCount) { + errorCount += oldError.connErrorCount; + connectError = 'We cannot reach the Mattermost service. The service may be down or misconfigured. Please contact an administrator to make sure the WebSocket port is configured properly.'; + } + + e = {message: connectError, connErrorCount: errorCount}; } else { e = {message: 'We received an unexpected status code from the server (' + xhr.status + ')'}; } diff --git a/web/react/utils/constants.jsx b/web/react/utils/constants.jsx index aba63b91c..8fd0ab79b 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', @@ -139,15 +138,15 @@ module.exports = { linkColor: '#2389d7', buttonBg: '#2389d7', buttonColor: '#FFFFFF', - mentionHighlightBg: '#fff2bb' + mentionHighlightBg: '#fff2bb', + mentionHighlightLink: '#2f81b7' }, organization: { type: 'Organization', sidebarBg: '#2071a7', - sidebarText: '#bfcde8', + sidebarText: '#fff', sidebarUnreadText: '#fff', sidebarTextHoverBg: '#136197', - sidebarTextHoverColor: '#bfcde8', sidebarTextActiveBg: '#136197', sidebarTextActiveColor: '#FFFFFF', sidebarHeaderBg: '#2f81b7', @@ -161,15 +160,15 @@ module.exports = { linkColor: '#2f81b7', buttonBg: '#1dacfc', buttonColor: '#FFFFFF', - mentionHighlightBg: '#fff2bb' + mentionHighlightBg: '#fff2bb', + mentionHighlightLink: '#2f81b7' }, mattermostDark: { type: 'Mattermost Dark', sidebarBg: '#1B2C3E', - sidebarText: '#bbbbbb', + sidebarText: '#fff', sidebarUnreadText: '#fff', sidebarTextHoverBg: '#4A5664', - sidebarTextHoverColor: '#bbbbbb', sidebarTextActiveBg: '#39769C', sidebarTextActiveColor: '#FFFFFF', sidebarHeaderBg: '#1B2C3E', @@ -183,15 +182,15 @@ module.exports = { linkColor: '#A4FFEB', buttonBg: '#4CBBA4', buttonColor: '#FFFFFF', - mentionHighlightBg: '#338886' + mentionHighlightBg: '#984063', + mentionHighlightLink: '#A4FFEB' }, windows10: { type: 'Windows Dark', sidebarBg: '#171717', - sidebarText: '#999', + sidebarText: '#fff', sidebarUnreadText: '#fff', sidebarTextHoverBg: '#302e30', - sidebarTextHoverColor: '#999', sidebarTextActiveBg: '#484748', sidebarTextActiveColor: '#FFFFFF', sidebarHeaderBg: '#1f1f1f', @@ -205,7 +204,8 @@ module.exports = { linkColor: '#0177e7', buttonBg: '#0177e7', buttonColor: '#FFFFFF', - mentionHighlightBg: '#276198' + mentionHighlightBg: '#784098', + mentionHighlightLink: '#A4FFEB' } }, THEME_ELEMENTS: [ @@ -234,10 +234,6 @@ module.exports = { uiName: 'Sidebar Text Hover BG' }, { - id: 'sidebarTextHoverColor', - uiName: 'Sidebar Text Hover Color' - }, - { id: 'sidebarTextActiveBg', uiName: 'Sidebar Text Active BG' }, @@ -284,6 +280,10 @@ module.exports = { { id: 'mentionHighlightBg', uiName: 'Mention Highlight BG' + }, + { + id: 'mentionHighlightLink', + uiName: 'Mention Highlight Link' } ] }; diff --git a/web/react/utils/utils.jsx b/web/react/utils/utils.jsx index 3a04f3623..f79f3492f 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); @@ -536,6 +531,10 @@ export function applyTheme(theme) { if (theme.mentionHighlightBg) { changeCss('.mention-highlight, .search-highlight', 'background:' + theme.mentionHighlightBg, 1); } + + if (theme.mentionHighlightLink) { + changeCss('.mention-highlight .mention-link', 'color:' + theme.mentionHighlightLink, 1); + } } export function changeCss(className, classValue, classRepeat) { // we need invisible container to store additional css definitions |