Skip to content

Commit

Permalink
Merge branch 'develop' of github.com:RocketChat/Rocket.Chat into develop
Browse files Browse the repository at this point in the history
* 'develop' of github.com:RocketChat/Rocket.Chat:
  Regression: Fix directory table loading (RocketChat#11223)
  [FIX] "blank messages" on iOS < 11 (RocketChat#11221)
  Fix latest and release-candidate docker images building (RocketChat#11215)
  Update base.css (RocketChat#11199)
  test if we have usernames on rooms (RocketChat#11216)
  Fix mentions (RocketChat#11211)
  • Loading branch information
ph1p committed Jun 25, 2018
2 parents 83b6ea2 + 7e92919 commit a06f07f
Show file tree
Hide file tree
Showing 9 changed files with 50 additions and 27 deletions.
13 changes: 9 additions & 4 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -284,12 +284,17 @@ jobs:
if [[ $CIRCLE_TAG ]]; then
docker login -u $DOCKER_USER -p $DOCKER_PASS
docker build -t rocketchat/rocket.chat:latest .
docker push rocketchat/rocket.chat:latest
docker tag rocketchat/rocket.chat:latest rocketchat/rocket.chat:$CIRCLE_TAG
docker build -t rocketchat/rocket.chat:$CIRCLE_TAG .
docker push rocketchat/rocket.chat:$CIRCLE_TAG
if [[ $CIRCLE_TAG =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
docker tag rocketchat/rocket.chat:$CIRCLE_TAG rocketchat/rocket.chat:latest
docker push rocketchat/rocket.chat:latest
else
docker tag rocketchat/rocket.chat:$CIRCLE_TAG rocketchat/rocket.chat:release-candidate
docker push rocketchat/rocket.chat:release-candidate
fi
exit 0
fi;
Expand Down
2 changes: 1 addition & 1 deletion packages/rocketchat-mentions/Mentions.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export default class {
return `${ prefix }<a class="mention-link mention-link-me mention-link-all">@${ username }</a>`;
}

const mentionObj = message.mentions.find(m => m.username === username);
const mentionObj = message.mentions && message.mentions.find(m => m.username === username);
if (message.temp == null && mentionObj == null) {
return match;
}
Expand Down
10 changes: 9 additions & 1 deletion packages/rocketchat-theme/client/imports/components/table.css
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
}

& tbody {
& tr {
& tr:not(.table-loading) {
cursor: pointer;

&:hover {
Expand Down Expand Up @@ -203,3 +203,11 @@
text-overflow: ellipsis;
text-transform: capitalize;
}

.table-loading {
height: 10px;
}

.table-loading-td {
position: relative;
}
2 changes: 1 addition & 1 deletion packages/rocketchat-theme/client/imports/general/base.css
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ button {
position: relative;

max-height: 100%;
height: 1px;
height: 100%;

&.animated-hidden {
visibility: hidden;
Expand Down
7 changes: 4 additions & 3 deletions packages/rocketchat-theme/client/imports/general/base_old.css
Original file line number Diff line number Diff line change
Expand Up @@ -2893,8 +2893,9 @@
}
}

.rc-old .message {
.message {
position: relative;
z-index: 1;

min-height: 40px;
padding: 8px 50px 4px 70px;
Expand Down Expand Up @@ -5678,7 +5679,7 @@ body:not(.is-cordova) {
}
}

.room-leader a.chat-now {
.room-leader .chat-now {
position: absolute;
top: 15px;
right: 25px;
Expand All @@ -5705,7 +5706,7 @@ body:not(.is-cordova) {

.room-leader {
position: absolute;
z-index: 1;
z-index: 10;
right: 0;
left: 0;

Expand Down
2 changes: 1 addition & 1 deletion packages/rocketchat-ui/client/components/table.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Template.table.onDestroyed(function() {
});

Template.table.events({
'click tbody tr'(e, t) { t.data.onItemClick && t.data.onItemClick(this); },
'click tbody tr:not(.table-loading)'(e, t) { t.data.onItemClick && t.data.onItemClick(this); },
'scroll .table-scroll': _.debounce((e, t) => t.data.onScroll && t.data.onScroll(e.currentTarget), 300),
'click .js-sort'(e, t) { t.data.onSort(e.currentTarget.dataset.sort); }
});
9 changes: 7 additions & 2 deletions packages/rocketchat-ui/client/views/app/directory.html
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,11 @@
<td>{{topic}}</td>
</tr>
{{/each}}
{{#if isLoading}}
<tr class="table-loading">
<td class="table-loading-td" colspan="{{#if showLastMessage}}5{{else}}4{{/if}}">{{> loading}}</td>
</tr>
{{/if}}
</tbody>
{{/table}}
{{/if}}
Expand Down Expand Up @@ -92,8 +97,8 @@
</tr>
{{/each}}
{{#if isLoading}}
<tr>
<td colspan="3" style="position: relative;">{{> loading}}</td>
<tr class="table-loading">
<td class="table-loading-td" colspan="3">{{> loading}}</td>
</tr>
{{/if}}
</tbody>
Expand Down
2 changes: 1 addition & 1 deletion packages/rocketchat-ui/client/views/app/directory.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ function directorySearch(config, cb) {
if (config.type === 'channels') {
return {
name: result.name,
users: result.usernames.length,
users: (result.usernames ? result.usernames.length : result.usersCount) || 0,
createdAt: timeAgo(result.ts),
lastMessage: result.lastMessage && timeAgo(result.lastMessage.ts),
description: result.description,
Expand Down
30 changes: 17 additions & 13 deletions server/methods/browseChannels.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,19 +56,23 @@ Meteor.methods({
return;
}
return {
results: RocketChat.models.Rooms.findByNameAndType(regex, 'c', {
...options,
sort,
fields: {
description: 1,
topic: 1,
name: 1,
lastMessage: 1,
ts: 1,
archived: 1,
usernames: 1
}
}).fetch(),
results: RocketChat.models.Rooms.findByNameAndType(
regex,
'c',
{
...options,
sort,
fields: {
description: 1,
topic: 1,
name: 1,
lastMessage: 1,
ts: 1,
archived: 1,
usernames: 1,
usersCount: 1
}
}).fetch(),
total: RocketChat.models.Rooms.findByNameAndType(regex, 'c').count()
};
}
Expand Down

0 comments on commit a06f07f

Please sign in to comment.