Skip to content

Commit

Permalink
Merge branch 'develop' of github.com:RocketChat/Rocket.Chat into adm/…
Browse files Browse the repository at this point in the history
…users_and_rooms

* 'develop' of github.com:RocketChat/Rocket.Chat:
  [NEW] Allow to send Agent custom fields through the Omnichannel CRM integration (#16286)
  [FIX] Spotify embed and collapsed (#17356)
  Improve: Better Push Notification code (#17338)
  LingoHub Update 🚀 (#17365)
  [FIX] Allow Screensharing in BBB Iframe (#17290)
  [NEW] Make the header for rooms clickable (#16762)
  Import data pagination (#17355)
  Allow to set a comment when forwarding omnichannel rooms. (#17353)
  [FIX] Web Client memory leak caused by the Emoji library (#17320)
  [FIX] Omnichannel room info panel opening whenever a message is sent (#17348)
  [FIX] New user added by admin doesn't receive random password email (#17249)
  • Loading branch information
ggazzo committed Apr 20, 2020
2 parents 28cbe4e + 83240bc commit 4ab3608
Show file tree
Hide file tree
Showing 45 changed files with 1,758 additions and 403 deletions.
2 changes: 0 additions & 2 deletions .meteor/packages
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ nooitaf:colors
ostrio:cookies
pauli:accounts-linkedin
raix:handlebar-helpers
rocketchat:push
raix:ui-dropped-event

rocketchat:tap-i18n
Expand All @@ -87,7 +86,6 @@ matb33:collection-hooks
meteorhacks:inject-initial
oauth@1.2.8
oauth2@1.2.1
raix:eventemitter
routepolicy@1.1.0
sha@1.0.9
templating
Expand Down
2 changes: 0 additions & 2 deletions .meteor/versions
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,6 @@ pauli:accounts-linkedin@5.0.0
pauli:linkedin-oauth@5.0.0
promise@0.11.2
raix:eventemitter@0.1.3
raix:eventstate@0.0.4
raix:handlebar-helpers@0.2.5
raix:ui-dropped-event@0.0.7
random@1.1.0
Expand All @@ -127,7 +126,6 @@ rocketchat:i18n@0.0.1
rocketchat:livechat@0.0.1
rocketchat:mongo-config@0.0.1
rocketchat:oauth2-server@2.1.0
rocketchat:push@3.3.1
rocketchat:streamer@1.1.0
rocketchat:tap-i18n@1.9.1
rocketchat:version@1.0.0
Expand Down
4 changes: 2 additions & 2 deletions app/api/server/v1/push.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Meteor } from 'meteor/meteor';
import { Random } from 'meteor/random';
import { Push } from 'meteor/rocketchat:push';

import { appTokensCollection } from '../../../push/server';
import { API } from '../api';

API.v1.addRoute('push.token', { authRequired: true }, {
Expand Down Expand Up @@ -47,7 +47,7 @@ API.v1.addRoute('push.token', { authRequired: true }, {
throw new Meteor.Error('error-token-param-not-valid', 'The required "token" body param is missing or invalid.');
}

const affectedRecords = Push.appCollection.remove({
const affectedRecords = appTokensCollection.remove({
$or: [{
'token.apn': token,
}, {
Expand Down
2 changes: 1 addition & 1 deletion app/authorization/server/functions/hasPermission.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { Permissions, Users, Subscriptions } from '../../../models/server/raw';
const rolesHasPermission = mem(async (permission, roles) => {
const result = await Permissions.findOne({ _id: permission, roles: { $in: roles } });
return !!result;
});
}, process.env.TEST_MODE === 'true' ? { maxAge: 0 } : undefined);

const getRoles = mem(async (uid, scope) => {
const { roles: userRoles = [] } = await Users.findOne({ _id: uid });
Expand Down
9 changes: 5 additions & 4 deletions app/emoji-emojione/lib/rocketchat.js
Original file line number Diff line number Diff line change
Expand Up @@ -167,8 +167,9 @@ emojione.emojioneList[':asterisk_symbol:'] = {

// fix for :+1: - had to replace all function that does its conversion: https://github.com/joypixels/emojione/blob/4.5.0/lib/js/emojione.js#L249
(function(ns) {
ns.shortnameConversionMap = mem(ns.shortnameConversionMap);
ns.unicodeCharRegex = mem(ns.unicodeCharRegex);
ns.shortnameConversionMap = mem(ns.shortnameConversionMap, { maxAge: 1000 });

ns.unicodeCharRegex = mem(ns.unicodeCharRegex, { maxAge: 1000 });

const convertShortName = mem(function(shortname) {
// the fix is basically adding this .replace(/[+]/g, '\\$&')
Expand Down Expand Up @@ -202,7 +203,7 @@ emojione.emojioneList[':asterisk_symbol:'] = {
return `<span class="emojione emojione-${ category } _${ fname }" ${ title }>${ alt }</span>`;
}
return `<img class="emojione" alt="${ alt }" ${ title } src="${ ePath }${ fname }${ ns.fileExtension }"/>`;
});
}, { maxAge: 1000 });

const convertUnicode = mem(function(entire, m1, m2, m3) {
const mappedUnicode = ns.mapUnicodeToShort();
Expand All @@ -228,7 +229,7 @@ emojione.emojioneList[':asterisk_symbol:'] = {
return `${ m2 }<span class="emojione emojione-${ category } _${ unicode }" ${ title }>${ alt }</span>`;
}
return `${ m2 }<img class="emojione" alt="${ alt }" ${ title } src="${ ePath }${ unicode }${ ns.fileExtension }"/>`;
});
}, { maxAge: 1000 });

ns.shortnameToImage = function(str) {
// replace regular shortnames first
Expand Down
19 changes: 11 additions & 8 deletions app/importer/client/components/ImportHistoryPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { useEndpoint } from '../../../../client/contexts/ServerContext';
import { ProgressStep } from '../../lib/ImporterProgressStep';
import ImportOperationSummary from './ImportOperationSummary';
import { useSafely } from '../../../../client/hooks/useSafely';
import { useMediaQuery } from '../../../ui/client/views/app/components/hooks';

function ImportHistoryPage() {
const t = useTranslation();
Expand Down Expand Up @@ -76,6 +77,8 @@ function ImportHistoryPage() {
}
};

const small = useMediaQuery('(max-width: 768px)');

return <Page>
<Page.Header title={t('Import')}>
<ButtonGroup>
Expand All @@ -90,26 +93,26 @@ function ImportHistoryPage() {
<Table.Row>
<Table.Cell is='th' rowSpan={2} width='x140'>{t('Import_Type')}</Table.Cell>
<Table.Cell is='th' rowSpan={2}>{t('Last_Updated')}</Table.Cell>
<Table.Cell is='th' rowSpan={2}>{t('Last_Status')}</Table.Cell>
<Table.Cell is='th' rowSpan={2}>{t('File')}</Table.Cell>
<Table.Cell is='th' align='center' colSpan={4} width='x320'>{t('Counters')}</Table.Cell>
{!small && <><Table.Cell is='th' rowSpan={2}>{t('Last_Status')}</Table.Cell>
<Table.Cell is='th' rowSpan={2}>{t('File')}</Table.Cell>
<Table.Cell is='th' align='center' colSpan={4} width='x320'>{t('Counters')}</Table.Cell></>}
</Table.Row>
<Table.Row>
{!small && <Table.Row>
<Table.Cell is='th' align='center'>{t('Users')}</Table.Cell>
<Table.Cell is='th' align='center'>{t('Channels')}</Table.Cell>
<Table.Cell is='th' align='center'>{t('Messages')}</Table.Cell>
<Table.Cell is='th' align='center'>{t('Total')}</Table.Cell>
</Table.Row>
</Table.Row>}
</Table.Head>
<Table.Body>
{isLoading
? Array.from({ length: 20 }, (_, i) => <ImportOperationSummary.Skeleton key={i} />)
? Array.from({ length: 20 }, (_, i) => <ImportOperationSummary.Skeleton small={small} key={i} />)
: <>
{currentOperation?.valid && <ImportOperationSummary {...currentOperation} />}
{currentOperation?.valid && <ImportOperationSummary {...currentOperation} small={small}/>}
{latestOperations
?.filter(({ _id }) => currentOperation?._id !== _id || !currentOperation?.valid)
// Forcing valid=false as the current API only accept preparation/progress over currentOperation
?.map((operation) => <ImportOperationSummary key={operation._id} {...operation} valid={false} />)}
?.map((operation) => <ImportOperationSummary key={operation._id} {...operation} valid={false} small={small} />)}
</>}
</Table.Body>
</Table>
Expand Down
29 changes: 16 additions & 13 deletions app/importer/client/components/ImportOperationSummary.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ function ImportOperationSummary({
status,
file,
user,
small,
count: {
users = 0,
channels = 0,
Expand Down Expand Up @@ -85,25 +86,27 @@ function ImportOperationSummary({
return <Table.Row {...props}>
<Table.Cell>{type}</Table.Cell>
<Table.Cell>{formatDateAndTime(_updatedAt)}</Table.Cell>
<Table.Cell>{status && t(status.replace('importer_', 'importer_status_'))}</Table.Cell>
<Table.Cell>{fileName}</Table.Cell>
<Table.Cell align='center'>{users}</Table.Cell>
<Table.Cell align='center'>{channels}</Table.Cell>
<Table.Cell align='center'>{messages}</Table.Cell>
<Table.Cell align='center'>{total}</Table.Cell>
{!small && <><Table.Cell>{status && t(status.replace('importer_', 'importer_status_'))}</Table.Cell>
<Table.Cell>{fileName}</Table.Cell>
<Table.Cell align='center'>{users}</Table.Cell>
<Table.Cell align='center'>{channels}</Table.Cell>
<Table.Cell align='center'>{messages}</Table.Cell>
<Table.Cell align='center'>{total}</Table.Cell>
</>}
</Table.Row>;
}

function ImportOperationSummarySkeleton() {
function ImportOperationSummarySkeleton({ small }) {
return <Table.Row>
<Table.Cell><Skeleton /></Table.Cell>
<Table.Cell><Skeleton /></Table.Cell>
<Table.Cell><Skeleton /></Table.Cell>
<Table.Cell><Skeleton /></Table.Cell>
<Table.Cell><Skeleton /></Table.Cell>
<Table.Cell><Skeleton /></Table.Cell>
<Table.Cell><Skeleton /></Table.Cell>
<Table.Cell><Skeleton /></Table.Cell>
{!small && <><Table.Cell><Skeleton /></Table.Cell>
<Table.Cell><Skeleton /></Table.Cell>
<Table.Cell><Skeleton /></Table.Cell>
<Table.Cell><Skeleton /></Table.Cell>
<Table.Cell><Skeleton /></Table.Cell>
<Table.Cell><Skeleton /></Table.Cell>
</>}
</Table.Row>;
}

Expand Down
Loading

0 comments on commit 4ab3608

Please sign in to comment.