Skip to content

Commit

Permalink
Merge branch 'new/teams' of github.com:RocketChat/Rocket.Chat into ne…
Browse files Browse the repository at this point in the history
…w/channel-to-team

* 'new/teams' of github.com:RocketChat/Rocket.Chat: (174 commits)
  [NEW] teams.leave "rooms" argument (#21262)
  Add teams section and team icon logic
  expose teams fields to local collection
  [FIX] rooms.adminRooms to properly return teams regardless of the other filters (#21257)
  [FIX] subscriptions/get team data (#21254)
  [NEW] teams.addRooms endpoint (#21251)
  Include fname on the results of 'rooms.autocomplete.channelAndPrivate' (#21250)
  Merge teams frontend changes to the backend branch (#21190)
  [NEW] users.listTeams endpoint (#21225)
  Include teams on admin.listRooms (#21224)
  [NEW] Add number of rooms in each team to the teams.list endpoint (#21223)
  [FIX] Wrong license seats number administration info panel (#21222)
  Changed the order of some operations
  Fix lint issues
  [NEW][APPS] Map description as a room value in Apps (#20811)
  Add teamId and teamMain properties to subscriptions/get
  [IMPROVE] Improve Apps permission modal (#21193)
  More lint fixes
  Fixing issues from gh conflicts
  Fix lint issues
  ...
  • Loading branch information
gabriellsh committed Mar 23, 2021
2 parents 61bb487 + 494b8f1 commit 8549f48
Show file tree
Hide file tree
Showing 149 changed files with 6,238 additions and 526 deletions.
2 changes: 1 addition & 1 deletion .docker-mongo/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM node:12.18.4-buster-slim
FROM node:12.21.0-buster-slim

LABEL maintainer="[email protected]"

Expand Down
2 changes: 1 addition & 1 deletion .docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM node:12.18.4-buster-slim
FROM node:12.21.0-buster-slim

LABEL maintainer="[email protected]"

Expand Down
15 changes: 8 additions & 7 deletions .github/workflows/build_and_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@ jobs:
echo "github.event_name: ${{ github.event_name }}"
cat $GITHUB_EVENT_PATH
- name: Use Node.js 12.18.4
- name: Use Node.js 12.21.0
uses: actions/setup-node@v2
with:
node-version: "12.18.4"
node-version: "12.21.0"

- uses: actions/checkout@v2

Expand Down Expand Up @@ -190,7 +190,7 @@ jobs:

strategy:
matrix:
node-version: ["12.18.4"]
node-version: ["12.21.0"]
mongodb-version: ["3.4", "3.6", "4.0"]

steps:
Expand Down Expand Up @@ -312,10 +312,10 @@ jobs:
path: ~/.meteor
key: ${{ runner.OS }}-meteor-${{ hashFiles('.meteor/release') }}-${{ hashFiles('.github/workflows/build_and_test.yml') }}

- name: Use Node.js 12.18.4
- name: Use Node.js 12.21.0
uses: actions/setup-node@v2
with:
node-version: "12.18.4"
node-version: "12.21.0"

- name: Install Meteor
run: |
Expand Down Expand Up @@ -394,6 +394,7 @@ jobs:
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_DEFAULT_REGION: 'us-east-1'
GPG_PASSWORD: ${{ secrets.GPG_PASSWORD }}
REDHAT_REGISTRY_PID: ${{ secrets.REDHAT_REGISTRY_PID }}
REDHAT_REGISTRY_KEY: ${{ secrets.REDHAT_REGISTRY_KEY }}
Expand Down Expand Up @@ -541,10 +542,10 @@ jobs:
steps:
- uses: actions/checkout@v2

- name: Use Node.js 12.18.4
- name: Use Node.js 12.21.0
uses: actions/setup-node@v2
with:
node-version: "12.18.4"
node-version: "12.21.0"

- name: Login to DockerHub
uses: docker/login-action@v1
Expand Down
28 changes: 13 additions & 15 deletions .meteor/packages
Original file line number Diff line number Diff line change
Expand Up @@ -9,29 +9,28 @@ [email protected]
[email protected]
[email protected]
[email protected]
accounts-password@1.6.2
accounts-password@1.7.0
[email protected]
blaze-html-templates
[email protected]
[email protected]
[email protected]
dynamic-import@0.5.2
ecmascript@0.14.3
typescript@3.7.6
dynamic-import@0.6.0
ecmascript@0.15.0
typescript@4.1.2
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected].0
[email protected].1
[email protected]
[email protected]
[email protected]
[email protected]
[email protected].0
[email protected].1
[email protected]
[email protected]
[email protected]
Expand All @@ -47,7 +46,6 @@ rocketchat:version
konecty:multiple-instances-status
konecty:user-presence

deepwell:bootstrap-datepicker2
dispatch:run-as-user
jalik:[email protected]
jalik:[email protected]
Expand All @@ -70,22 +68,22 @@ littledata:synced-cron

edgee:slingshot
jalik:[email protected]
accounts-base@1.7.0
accounts-base@1.8.0
[email protected]
autoupdate@1.6.0
babel-compiler@7.5.3
autoupdate@1.7.0
babel-compiler@7.6.0
[email protected]
htmljs
less
matb33:collection-hooks
meteorhacks:inject-initial
[email protected].0
[email protected].2
[email protected]
[email protected]
[email protected]
templating
webapp@1.9.1
webapp-hashing@1.0.9
webapp@1.10.0
webapp-hashing@1.1.0
rocketchat:oauth2-server
rocketchat:i18n
rocketchat:postcss
Expand Down
2 changes: 1 addition & 1 deletion .meteor/release
Original file line number Diff line number Diff line change
@@ -1 +1 @@
METEOR@1.11.1
METEOR@2.1
44 changes: 22 additions & 22 deletions .meteor/versions
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
accounts-base@1.7.0
accounts-base@1.8.0
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
accounts-password@1.6.2
accounts-password@1.7.0
[email protected]
aldeed:[email protected]
[email protected]
autoupdate@1.6.0
babel-compiler@7.5.3
autoupdate@1.7.0
babel-compiler@7.6.0
[email protected]
[email protected]
[email protected]
Expand All @@ -25,24 +25,23 @@ [email protected]
[email protected]
dandv:[email protected]
[email protected]
ddp-client@2.3.3
ddp-client@2.4.0
[email protected]
[email protected]
[email protected]
deepwell:[email protected]
[email protected]
[email protected]
dispatch:[email protected]
dynamic-import@0.5.2
ecmascript@0.14.3
dynamic-import@0.6.0
ecmascript@0.15.0
[email protected]
[email protected]
[email protected]
edgee:[email protected]
[email protected]
[email protected]
[email protected]
[email protected].0
[email protected].4
[email protected]
[email protected]
[email protected]
Expand All @@ -52,7 +51,7 @@ [email protected]
[email protected]
[email protected]
[email protected]
[email protected].2
[email protected].3
[email protected]
[email protected]
jalik:[email protected]
Expand All @@ -71,25 +70,25 @@ [email protected]
littledata:[email protected]
[email protected]
[email protected]
logging@1.1.20
logging@1.2.0
matb33:[email protected]
mdg:[email protected]
[email protected]
[email protected]
[email protected].1
[email protected].3
meteorhacks:[email protected]
meteorspark:[email protected]
[email protected]
[email protected]
[email protected].0
[email protected].1
mizzao:[email protected]
[email protected]
[email protected]
[email protected]
modules@0.15.0
modules@0.16.0
[email protected]
[email protected].0
[email protected].1
[email protected].1
[email protected].2
[email protected]
[email protected]
mrt:[email protected]
Expand All @@ -98,12 +97,12 @@ nimble:[email protected]
nooitaf:[email protected]_1
[email protected]
[email protected]
[email protected].0
[email protected].2
[email protected]
[email protected]
[email protected]
[email protected]
ostrio:cookies@2.6.0
ostrio:cookies@2.7.0
pauli:[email protected]
pauli:[email protected]
[email protected]
Expand All @@ -112,9 +111,10 @@ raix:[email protected]
raix:[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected].0
[email protected].1
[email protected]
rocketchat:[email protected]
rocketchat:[email protected]
Expand All @@ -141,9 +141,9 @@ [email protected]
[email protected]
[email protected]
[email protected]
typescript@3.7.6
typescript@4.1.2
[email protected]
[email protected]
[email protected]
webapp@1.9.1
webapp-hashing@1.0.9
webapp@1.10.0
webapp-hashing@1.1.0
2 changes: 1 addition & 1 deletion .snapcraft/resources/preparenode
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash

node_version="v12.18.4"
node_version="v12.21.0"

unamem="$(uname -m)"
if [[ $unamem == *aarch64* ]]; then
Expand Down
1 change: 1 addition & 0 deletions app/api/server/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,5 +40,6 @@ import './v1/custom-user-status';
import './v1/instances';
import './v1/banners';
import './v1/email-inbox';
import './v1/teams';

export { API, APIClass, defaultRateLimiterOptions } from './api';
21 changes: 16 additions & 5 deletions app/api/server/lib/rooms.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { hasPermissionAsync } from '../../../authorization/server/functions/hasPermission';
import { Rooms } from '../../../models/server/raw';
import { Subscriptions } from '../../../models';

export async function findAdminRooms({ uid, filter, types = [], pagination: { offset, count, sort } }) {
if (!await hasPermissionAsync(uid, 'view-room-administration')) {
Expand All @@ -24,24 +25,30 @@ export async function findAdminRooms({ uid, filter, types = [], pagination: { of
msgs: 1,
archived: 1,
tokenpass: 1,
teamId: 1,
teamMain: 1,
};

const name = filter && filter.trim();
const discussion = types && types.includes('discussions');
const showTypes = Array.isArray(types) ? types.filter((type) => type !== 'discussions') : [];
const includeTeams = types && types.includes('teams');
const typesToRemove = ['discussions', 'teams'];
const showTypes = Array.isArray(types) ? types.filter((type) => !typesToRemove.includes(type)) : [];
const options = {
fields,
sort: sort || { default: -1, name: 1 },
skip: offset,
limit: count,
};

let cursor = Rooms.findByNameContaining(name, discussion, options);
let cursor;

if (name && showTypes.length) {
cursor = Rooms.findByNameContainingAndTypes(name, showTypes, discussion, options);
cursor = Rooms.findByNameContainingAndTypes(name, showTypes, discussion, includeTeams, options);
} else if (showTypes.length) {
cursor = Rooms.findByTypes(showTypes, discussion, options);
cursor = Rooms.findByTypes(showTypes, discussion, includeTeams, options);
} else {
cursor = Rooms.findByNameContaining(name, discussion, includeTeams, options);
}

const total = await cursor.count();
Expand Down Expand Up @@ -93,6 +100,7 @@ export async function findChannelAndPrivateAutocomplete({ uid, selector }) {
const options = {
fields: {
_id: 1,
fname: 1,
name: 1,
t: 1,
avatarETag: 1,
Expand All @@ -102,8 +110,11 @@ export async function findChannelAndPrivateAutocomplete({ uid, selector }) {
name: 1,
},
};
const userRooms = Subscriptions.cachedFindByUserId(uid, { fields: { rid: 1 } })
.fetch()
.map((item) => item.rid);

const rooms = await Rooms.findChannelAndPrivateByNameStarting(selector.name, options).toArray();
const rooms = await Rooms.findChannelAndPrivateByNameStarting(selector.name, userRooms, options).toArray();

return {
items: rooms,
Expand Down
Loading

0 comments on commit 8549f48

Please sign in to comment.