summaryrefslogtreecommitdiffstats
path: root/webapp/utils
diff options
context:
space:
mode:
authorGeorge Goldberg <george@gberg.me>2017-03-17 16:29:26 +0000
committerGeorge Goldberg <george@gberg.me>2017-03-17 16:29:26 +0000
commit7f266c19511171f509ae8a60170de10c8d10b41e (patch)
tree04cd68ac4722313abec3ea47cc7cda229e463b1d /webapp/utils
parentbfae88e60c7a623afae82e06ce1421ca778c06e7 (diff)
parent8568afe5b4fb4d26b14fbc0d21f088eaa490b314 (diff)
downloadchat-7f266c19511171f509ae8a60170de10c8d10b41e.tar.gz
chat-7f266c19511171f509ae8a60170de10c8d10b41e.tar.bz2
chat-7f266c19511171f509ae8a60170de10c8d10b41e.zip
Merge branch 'release-3.7' into master.
Diffstat (limited to 'webapp/utils')
-rw-r--r--webapp/utils/async_client.jsx41
-rw-r--r--webapp/utils/constants.jsx4
-rw-r--r--webapp/utils/post_utils.jsx4
-rw-r--r--webapp/utils/utils.jsx14
4 files changed, 36 insertions, 27 deletions
diff --git a/webapp/utils/async_client.jsx b/webapp/utils/async_client.jsx
index 2ecb0f07d..1fc19b5f2 100644
--- a/webapp/utils/async_client.jsx
+++ b/webapp/utils/async_client.jsx
@@ -64,26 +64,31 @@ export function checkVersion() {
}
export function getChannels() {
- if (isCallInProgress('getChannels')) {
- return null;
- }
+ return new Promise((resolve, reject) => {
+ if (isCallInProgress('getChannels')) {
+ resolve();
+ return;
+ }
- callTracker.getChannels = utils.getTimestamp();
+ callTracker.getChannels = utils.getTimestamp();
- return Client.getChannels(
- (data) => {
- callTracker.getChannels = 0;
+ Client.getChannels(
+ (data) => {
+ callTracker.getChannels = 0;
- AppDispatcher.handleServerAction({
- type: ActionTypes.RECEIVED_CHANNELS,
- channels: data
- });
- },
- (err) => {
- callTracker.getChannels = 0;
- dispatchError(err, 'getChannels');
- }
- );
+ AppDispatcher.handleServerAction({
+ type: ActionTypes.RECEIVED_CHANNELS,
+ channels: data
+ });
+ resolve();
+ },
+ (err) => {
+ callTracker.getChannels = 0;
+ dispatchError(err, 'getChannels');
+ reject();
+ }
+ );
+ });
}
export function getChannel(id) {
@@ -130,7 +135,7 @@ export function getMyChannelMembers() {
resolve();
},
(err) => {
- callTracker.getChannelsUnread = 0;
+ callTracker.getMyChannelMembers = 0;
dispatchError(err, 'getMyChannelMembers');
reject(new Error('Unable to getMyChannelMembers'));
}
diff --git a/webapp/utils/constants.jsx b/webapp/utils/constants.jsx
index 3a16992ca..d8fc169a3 100644
--- a/webapp/utils/constants.jsx
+++ b/webapp/utils/constants.jsx
@@ -443,7 +443,7 @@ export const Constants = {
linkColor: '#2f81b7',
buttonBg: '#1dacfc',
buttonColor: '#FFFFFF',
- mentionHighlightBg: '#fff2bb',
+ mentionHighlightBg: '#f3e197',
mentionHighlightLink: '#2f81b7',
codeTheme: 'github',
image: defaultThemeImage
@@ -468,7 +468,7 @@ export const Constants = {
linkColor: '#2389d7',
buttonBg: '#23A2FF',
buttonColor: '#FFFFFF',
- mentionHighlightBg: '#fff2bb',
+ mentionHighlightBg: '#f3e197',
mentionHighlightLink: '#2f81b7',
codeTheme: 'github',
image: mattermostThemeImage
diff --git a/webapp/utils/post_utils.jsx b/webapp/utils/post_utils.jsx
index 0b908c55b..1f2021e4a 100644
--- a/webapp/utils/post_utils.jsx
+++ b/webapp/utils/post_utils.jsx
@@ -12,6 +12,10 @@ export function isSystemMessage(post) {
return post.type && (post.type.lastIndexOf(Constants.SYSTEM_MESSAGE_PREFIX) === 0);
}
+export function isFromWebhook(post) {
+ return post.props && post.props.from_webhook === 'true';
+}
+
export function isPostOwner(post) {
return UserStore.getCurrentId() === post.user_id;
}
diff --git a/webapp/utils/utils.jsx b/webapp/utils/utils.jsx
index b4afc65b3..b3370e88c 100644
--- a/webapp/utils/utils.jsx
+++ b/webapp/utils/utils.jsx
@@ -538,14 +538,14 @@ export function applyTheme(theme) {
if (theme.mentionBj) {
changeCss('.sidebar--left .nav-pills__unread-indicator, .app__body .new-messages__button div', 'background:' + theme.mentionBj);
- changeCss('.sidebar--left .badge', 'background:' + theme.mentionBj + '!important;');
- changeCss('.multi-teams .team-sidebar .team-wrapper .team-container .team-btn .badge', 'background:' + theme.mentionBj + '!important;');
+ changeCss('.sidebar--left .badge', 'background:' + theme.mentionBj);
+ changeCss('.multi-teams .team-sidebar .team-wrapper .team-container .team-btn .badge', 'background:' + theme.mentionBj);
}
if (theme.mentionColor) {
- changeCss('.sidebar--left .nav-pills__unread-indicator, .app__body .new-messages__button div', 'color:' + theme.mentionColor);
- changeCss('.sidebar--left .badge', 'color:' + theme.mentionColor + '!important;');
- changeCss('.multi-teams .team-sidebar .team-wrapper .team-container .team-btn .badge', 'color:' + theme.mentionColor + '!important;');
+ changeCss('.app__body .sidebar--left .nav-pills__unread-indicator, .app__body .new-messages__button div', 'color:' + theme.mentionColor);
+ changeCss('.app__body .sidebar--left .badge', 'color:' + theme.mentionColor);
+ changeCss('.app__body .multi-teams .team-sidebar .team-wrapper .team-container .team-btn .badge', 'color:' + theme.mentionColor);
}
if (theme.centerChannelBg) {
@@ -623,7 +623,7 @@ export function applyTheme(theme) {
changeCss('@media(min-width: 768px){.app__body .post:hover, .app__body .more-modal__list .more-modal__row:hover, .app__body .modal .settings-modal .settings-table .settings-content .section-min:hover', 'background:' + changeOpacity(theme.centerChannelColor, 0.08));
changeCss('.app__body .more-modal__row.more-modal__row--selected, .app__body .date-separator.hovered--before:after, .app__body .date-separator.hovered--after:before, .app__body .new-separator.hovered--after:before, .app__body .new-separator.hovered--before:after', 'background:' + changeOpacity(theme.centerChannelColor, 0.07));
changeCss('@media(min-width: 768px){.app__body .suggestion-list__content .command:hover, .app__body .mentions__name:hover, .app__body .dropdown-menu>li>a:focus, .app__body .dropdown-menu>li>a:hover', 'background:' + changeOpacity(theme.centerChannelColor, 0.15));
- changeCss('.app__body .suggestion--selected, .app__body .bot-indicator', 'background:' + changeOpacity(theme.centerChannelColor, 0.15), 1);
+ changeCss('.app__body .suggestion--selected, .app__body .emoticon-suggestion:hover, .app__body .bot-indicator', 'background:' + changeOpacity(theme.centerChannelColor, 0.15), 1);
changeCss('code, .app__body .form-control[disabled], .app__body .form-control[readonly], .app__body fieldset[disabled] .form-control', 'background:' + changeOpacity(theme.centerChannelColor, 0.1));
changeCss('@media(min-width: 960px){.app__body .post.current--user:hover .post__body ', 'background: none;');
changeCss('.app__body .sidebar--right', 'color:' + theme.centerChannelColor);
@@ -670,7 +670,7 @@ export function applyTheme(theme) {
if (theme.mentionHighlightBg) {
changeCss('.app__body .mention--highlight, .app__body .search-highlight', 'background:' + theme.mentionHighlightBg);
- changeCss('.mention-comment', 'border-color:' + theme.mentionHighlightBg + ' !important');
+ changeCss('.app__body .post.post--comment .post__body.mention-comment', 'border-color:' + theme.mentionHighlightBg);
changeCss('.app__body .post.post--highlight', 'background:' + changeOpacity(theme.mentionHighlightBg, 0.5));
}