forked from RocketChat/Rocket.Chat
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request RocketChat#533 from WideChat/develop_pwa-catchup-6…
…2aa68d [Upstream Catchup] Merge RC:master to develop_pwa
- Loading branch information
Showing
423 changed files
with
12,510 additions
and
4,421 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
FROM registry.access.redhat.com/ubi8/nodejs-12 | ||
|
||
ENV RC_VERSION 3.10.5 | ||
ENV RC_VERSION 3.11.0 | ||
|
||
MAINTAINER [email protected] | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
## `registerFieldTemplate` is deprecated | ||
hmm it's true :(, we don't encourage this type of customization anymore, it ends up opening some security holes, we prefer the use of UIKit. If you feel any difficulty let us know | ||
## `attachment.actions` is deprecated | ||
same reason above | ||
## `attachment PDF preview` is no longer being rendered | ||
it is temporarily disabled, nowadays is huge effort render the previews and requires the download of the entire file on the client. We are working to improve this :) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
import { EmailInbox } from '../../../models/server/raw'; | ||
import { hasPermissionAsync } from '../../../authorization/server/functions/hasPermission'; | ||
import { Users } from '../../../models'; | ||
|
||
export async function findEmailInboxes({ userId, query = {}, pagination: { offset, count, sort } }) { | ||
if (!await hasPermissionAsync(userId, 'manage-email-inbox')) { | ||
throw new Error('error-not-allowed'); | ||
} | ||
const cursor = EmailInbox.find(query, { | ||
sort: sort || { name: 1 }, | ||
skip: offset, | ||
limit: count, | ||
}); | ||
|
||
const total = await cursor.count(); | ||
|
||
const emailInboxes = await cursor.toArray(); | ||
|
||
return { | ||
emailInboxes, | ||
count: emailInboxes.length, | ||
offset, | ||
total, | ||
}; | ||
} | ||
|
||
export async function findOneEmailInbox({ userId, _id }) { | ||
if (!await hasPermissionAsync(userId, 'manage-email-inbox')) { | ||
throw new Error('error-not-allowed'); | ||
} | ||
return EmailInbox.findOneById(_id); | ||
} | ||
|
||
export async function insertOneOrUpdateEmailInbox(userId, emailInboxParams) { | ||
const { _id, active, name, email, description, senderInfo, department, smtp, imap } = emailInboxParams; | ||
|
||
if (!_id) { | ||
emailInboxParams._createdAt = new Date(); | ||
emailInboxParams._updatedAt = new Date(); | ||
emailInboxParams._createdBy = Users.findOne(userId, { fields: { username: 1 } }); | ||
return EmailInbox.insertOne(emailInboxParams); | ||
} | ||
|
||
const emailInbox = await findOneEmailInbox({ userId, id: _id }); | ||
|
||
if (!emailInbox) { | ||
throw new Error('error-invalid-email-inbox'); | ||
} | ||
|
||
const updateEmailInbox = { | ||
$set: { | ||
active, | ||
name, | ||
email, | ||
description, | ||
senderInfo, | ||
smtp, | ||
imap, | ||
_updatedAt: new Date(), | ||
}, | ||
}; | ||
|
||
if (department === 'All') { | ||
updateEmailInbox.$unset = { | ||
department: 1, | ||
}; | ||
} else { | ||
updateEmailInbox.$set.department = department; | ||
} | ||
|
||
return EmailInbox.updateOne({ _id }, updateEmailInbox); | ||
} | ||
|
||
export async function findOneEmailInboxByEmail({ userId, email }) { | ||
if (!await hasPermissionAsync(userId, 'manage-email-inbox')) { | ||
throw new Error('error-not-allowed'); | ||
} | ||
return EmailInbox.findOne({ email }); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
import { Promise } from 'meteor/promise'; | ||
import { Meteor } from 'meteor/meteor'; | ||
import { Match, check } from 'meteor/check'; | ||
|
||
import { API } from '../api'; | ||
import { Banner } from '../../../../server/sdk'; | ||
import { BannerPlatform } from '../../../../definition/IBanner'; | ||
|
||
API.v1.addRoute('banners.getNew', { authRequired: true }, { | ||
get() { | ||
check(this.queryParams, Match.ObjectIncluding({ | ||
platform: String, | ||
bid: Match.Maybe(String), | ||
})); | ||
|
||
const { platform, bid: bannerId } = this.queryParams; | ||
if (!platform) { | ||
throw new Meteor.Error('error-missing-param', 'The required "platform" param is missing.'); | ||
} | ||
|
||
if (!Object.values(BannerPlatform).includes(platform)) { | ||
throw new Meteor.Error('error-unknown-platform', 'Platform is unknown.'); | ||
} | ||
|
||
const banners = Promise.await(Banner.getNewBannersForUser(this.userId, platform, bannerId)); | ||
|
||
return API.v1.success({ banners }); | ||
}, | ||
}); | ||
|
||
API.v1.addRoute('banners.dismiss', { authRequired: true }, { | ||
post() { | ||
check(this.bodyParams, Match.ObjectIncluding({ | ||
bannerId: String, | ||
})); | ||
|
||
const { bannerId } = this.bodyParams; | ||
|
||
if (!bannerId || !bannerId.trim()) { | ||
throw new Meteor.Error('error-missing-param', 'The required "bannerId" param is missing.'); | ||
} | ||
|
||
try { | ||
Promise.await(Banner.dismiss(this.userId, bannerId)); | ||
return API.v1.success(); | ||
} catch (e) { | ||
return API.v1.failure(); | ||
} | ||
}, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.