Skip to content

Commit

Permalink
Merge pull request #4 from RocketChat/develop
Browse files Browse the repository at this point in the history
Merge commits
  • Loading branch information
gsunit authored Apr 2, 2019
2 parents 3beaa65 + 6403849 commit 9217ebf
Show file tree
Hide file tree
Showing 72 changed files with 930 additions and 419 deletions.
56 changes: 50 additions & 6 deletions app/apps/assets/stylesheets/apps.css
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
.rc-apps-marketplace {
display: flex;

overflow: auto;
flex-direction: column;

height: 100vh;

padding: 1.25rem 2rem;

font-size: 14px;

Expand Down Expand Up @@ -217,14 +223,52 @@
transform: rotate(180deg);
}

&.page-settings {
.section {
padding: 0 !important;
&.page-settings .content .rocket-form .section {
padding: 0 2.5em;

border-bottom: none;

&:hover {
background-color: var(--rc-color-primary-lightest);
}
}

.rc-table-content {
display: flex;
overflow-x: auto;
flex-direction: column;
flex: 1 1 100%;

height: 100vh;

border-bottom: none !important;
& .js-sort {
cursor: pointer;

&:hover {
background-color: var(--rc-color-primary-lightest);
&.is-sorting .table-fake-th .rc-icon {
opacity: 1;
}
}

& .table-fake-th {
&:hover .rc-icon {
opacity: 1;
}

& .rc-icon {
transition: opacity 0.3s;

opacity: 0;

font-size: 1rem;
}
}
}

@media (width <= 700px) {
.rc-table-content {
& th:not(:first-child),
& td:not(:first-child) {
display: none;
}
}
}
Expand Down
10 changes: 5 additions & 5 deletions app/apps/client/admin/appManage.js
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,7 @@ Template.appManage.events({
setActivate(false, e, t);
},

'click .js-uninstall': async(e, t) => {
'click .js-uninstall': async (e, t) => {
t.ready.set(false);
try {
await APIClient.delete(`apps/${ t.id.get() }`);
Expand All @@ -372,7 +372,7 @@ Template.appManage.events({
}
},

'click .js-install': async(e, t) => {
'click .js-install': async (e, t) => {
installAppFromEvent(e, t);
},

Expand All @@ -381,7 +381,7 @@ Template.appManage.events({

APIClient.get(`apps?buildBuyUrl=true&appId=${ rl.id }`)
.then((data) => {
data.successCallback = async() => {
data.successCallback = async () => {
installAppFromEvent(e, t);
};

Expand All @@ -404,11 +404,11 @@ Template.appManage.events({
FlowRouter.go(`/admin/apps/${ t.id.get() }/logs`, {}, { version: FlowRouter.getQueryParam('version') });
},

'click .js-cancel-editing': async(e, t) => {
'click .js-cancel-editing': async (e, t) => {
t.onSettingUpdated({ appId: t.id.get() });
},

'click .js-save': async(e, t) => {
'click .js-save': async (e, t) => {
if (t.loading.get()) {
return;
}
Expand Down
32 changes: 23 additions & 9 deletions app/apps/client/admin/apps.html
Original file line number Diff line number Diff line change
@@ -1,20 +1,34 @@
<template name="apps">
<section class="rc-directory rc-apps-marketplace">
<section class="rc-apps-marketplace">
{{#header sectionName="Apps" hideHelp=true fixedHeight=true fullpage=true}}
{{#if appsDevelopmentMode}}
<button class="rc-button rc-button--small rc-button--primary rc-button--outline rc-directory-plus" data-button="install">{{> icon icon="upload" block="rc-icon--default-size"}} {{_ "Upload app"}}</button>
<button class="rc-button rc-button--small rc-button--primary rc-button--outline" data-button="install">
{{> icon icon="upload" block="rc-icon--default-size"}} {{_ "Upload app"}}
</button>
{{/if}}
{{/header}}
<div class="rc-table-content">
{{>tabs tabs=tabsData}}
<div class="rc-input rc-input--small rc-directory-search">
<label class="rc-input__label">
<div class="rc-input__wrapper">
{{> icon icon="magnifier" block="rc-input__icon" }}
<input type="text" class="rc-input__element rc-input__element--small js-search" name="message-search" id="message-search" placeholder={{#if $eq searchType 'channels'}}{{_ "Search_Channels"}}{{/if}}{{#if $eq searchType 'users'}}{{_ "Search_Users"}}{{/if}} autocomplete="off">

<form class="js-search-form" role="form">
<div class="rc-input">
<div class="rc-input__icon">
{{#if isLoading}}
{{> loading }}
{{else}}
{{> icon block="rc-input__icon-svg" icon="magnifier" }}
{{/if}}
</div>
</label>
</div>
<input
type="text"
class="rc-input__element js-search"
name="message-search"
id="message-search"
placeholder="{{_ "Search_Apps"}}"
autocomplete="off">
</div>
</form>

{{#requiresPermission 'manage-apps'}}
{{#table fixed='true' onScroll=onTableScroll onResize=onTableResize onSort=onTableSort}}
<thead>
Expand Down
11 changes: 6 additions & 5 deletions app/apps/client/admin/apps.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ const tagAlreadyInstalledApps = (installedApps, apps) => {
return tagged;
};

const getApps = async(instance) => {
const getApps = async (instance) => {
instance.isLoading.set(true);

const data = await APIClient.get('apps?marketplace=true');
Expand All @@ -49,7 +49,7 @@ const getApps = async(instance) => {
}
};

const getInstalledApps = async(instance) => {
const getInstalledApps = async (instance) => {
const data = await APIClient.get('apps');
const apps = data.apps.map((app) => ({ latest: app }));
instance.installedApps.set(apps);
Expand Down Expand Up @@ -279,7 +279,7 @@ Template.apps.events({
marketplace: true,
version: this.latest.version,
})
.then(async() => {
.then(async () => {
await Promise.all([
getInstalledApps(template),
getApps(template),
Expand Down Expand Up @@ -312,7 +312,7 @@ Template.apps.events({
marketplace: true,
version: this.latest.version,
})
.then(async() => {
.then(async () => {
await Promise.all([
getInstalledApps(template),
getApps(template),
Expand All @@ -332,7 +332,8 @@ Template.apps.events({
'keyup .js-search'(e, t) {
t.searchText.set(e.currentTarget.value);
},
'submit .js-search'(e) {
'submit .js-search-form'(e) {
e.preventDefault();
e.stopPropagation();
},
});
2 changes: 1 addition & 1 deletion app/apps/server/bridges/bridges.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export class RealAppBridges extends AppBridges {
this._apiBridge = new AppApisBridge(orch);
this._detBridge = new AppDetailChangesBridge(orch);
this._envBridge = new AppEnvironmentalVariableBridge(orch);
this._httpBridge = new AppHttpBridge();
this._httpBridge = new AppHttpBridge(orch);
this._lisnBridge = new AppListenerBridge(orch);
this._msgBridge = new AppMessageBridge(orch);
this._persistBridge = new AppPersistenceBridge(orch);
Expand Down
8 changes: 8 additions & 0 deletions app/apps/server/bridges/http.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,15 @@
import { HTTP } from 'meteor/http';

export class AppHttpBridge {
constructor(orch) {
this.orch = orch;
}

async call(info) {
if (typeof info.request.timeout !== 'number' || info.request.timeout > 500) {
info.request.timeout = 500;
}

if (!info.request.content && typeof info.request.data === 'object') {
info.request.content = JSON.stringify(info.request.data);
}
Expand Down
2 changes: 1 addition & 1 deletion app/channel-settings/client/views/channelSettings.js
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ Template.channelSettingsEditing.events({
},
async 'click .js-save'(e, t) {
const { settings } = t;
Object.keys(settings).forEach(async(name) => {
Object.keys(settings).forEach(async (name) => {
const setting = settings[name];
const value = setting.value.get();
if (setting.default.get() !== value) {
Expand Down
4 changes: 2 additions & 2 deletions app/e2e/client/rocketchat.e2e.js
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ class E2E {
}

setupListeners() {
Notifications.onUser('e2ekeyRequest', async(roomId, keyId) => {
Notifications.onUser('e2ekeyRequest', async (roomId, keyId) => {
const e2eRoom = await this.getInstanceByRoomId(roomId);
if (!e2eRoom) {
return;
Expand Down Expand Up @@ -438,7 +438,7 @@ class E2E {
return;
}

return await Messages.find({ t: 'e2e', e2e: 'pending' }).forEach(async(item) => {
return await Messages.find({ t: 'e2e', e2e: 'pending' }).forEach(async (item) => {
await this.decryptMessage(item);
});
}
Expand Down
2 changes: 1 addition & 1 deletion app/e2e/client/rocketchat.e2e.room.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export class E2ERoom {
this._ready.set(true);
this.establishing.set(false);

Notifications.onRoom(this.roomId, 'e2ekeyRequest', async(keyId) => {
Notifications.onRoom(this.roomId, 'e2ekeyRequest', async (keyId) => {
this.provideKeyToUser(keyId);
});
});
Expand Down
2 changes: 1 addition & 1 deletion app/emoji-custom/client/lib/emojiCustom.js
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ emoji.packages.emojiCustom = {
};

Meteor.startup(() =>
CachedCollectionManager.onLogin(async() => {
CachedCollectionManager.onLogin(async () => {
const emojis = await call('listEmojiCustom');

emoji.packages.emojiCustom.emojisByCategory = { rocket: [] };
Expand Down
2 changes: 1 addition & 1 deletion app/graphql/server/mocks/accounts/graphql-api.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
// maybe Promise is not wrapped with Fiber
// See: https://github.com/meteor/meteor/blob/a362e20a37547362b581fed52f7171d022e83b62/packages/promise/server.js
// Opened issue: https://github.com/js-accounts/graphql/issues/16
export const authenticated = (Accounts, func) => (async(root, args, context, info) => {
export const authenticated = (Accounts, func) => (async (root, args, context, info) => {
const { authToken } = context;

if (!authToken || authToken === '' || authToken === null) {
Expand Down
2 changes: 1 addition & 1 deletion app/graphql/server/resolvers/accounts/oauthProviders.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ function isJSON(obj) {

const resolver = {
Query: {
oauthProviders: async() => {
oauthProviders: async () => {
// depends on rocketchat:grant package
try {
const result = HTTP.get(Meteor.absoluteUrl('_oauth_apps/providers')).content;
Expand Down
4 changes: 2 additions & 2 deletions app/graphql/server/resolvers/users/User-type.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const resolver = {
User: {
id: property('_id'),
status: ({ status }) => status.toUpperCase(),
avatar: async({ _id }) => {
avatar: async ({ _id }) => {
// XXX js-accounts/graphql#16
const avatar = await Avatars.model.rawCollection().findOne({
userId: _id,
Expand All @@ -18,7 +18,7 @@ const resolver = {
return avatar.url;
}
},
channels: Meteor.bindEnvironment(async({ _id }) => await Rooms.findBySubscriptionUserId(_id).fetch()),
channels: Meteor.bindEnvironment(async ({ _id }) => await Rooms.findBySubscriptionUserId(_id).fetch()),
directMessages: ({ username }) => Rooms.findDirectRoomContainingUsername(username).fetch(),
},
};
Expand Down
10 changes: 5 additions & 5 deletions app/importer-hipchat-enterprise/server/importer.js
Original file line number Diff line number Diff line change
Expand Up @@ -466,7 +466,7 @@ export class HipChatEnterpriseImporter extends Base {
// This object will keep track of messages that have already been prepared so it doesn't try to do it twice
this.preparedMessages = {};

const promise = new Promise(async(resolve, reject) => {
const promise = new Promise(async (resolve, reject) => {
try {
await this._prepareFolderEntry(fullFolderPath, '.');
this._finishPreparationProcess(resolve, reject);
Expand Down Expand Up @@ -552,7 +552,7 @@ export class HipChatEnterpriseImporter extends Base {
},
}, {
$group: { _id: '$channels.id' },
}]).forEach(async(channel) => {
}]).forEach(async (channel) => {
const userIds = (await this.collection.model.rawCollection().aggregate([{
$match: {
$or: [
Expand Down Expand Up @@ -614,7 +614,7 @@ export class HipChatEnterpriseImporter extends Base {
pos += chunk.length;
}));

stream.on('end', Meteor.bindEnvironment(async() => {
stream.on('end', Meteor.bindEnvironment(async () => {
this.logger.info(`Processing the file: ${ header.name }`);
await this.prepareFile(info, data, header.name);
data = undefined;
Expand Down Expand Up @@ -879,7 +879,7 @@ export class HipChatEnterpriseImporter extends Base {
this._applyUserSelections(importSelection);

const startedByUserId = Meteor.userId();
Meteor.defer(async() => {
Meteor.defer(async () => {
try {
await super.updateProgress(ProgressStep.IMPORTING_USERS);
await this._importUsers(startedByUserId);
Expand Down Expand Up @@ -1106,7 +1106,7 @@ export class HipChatEnterpriseImporter extends Base {
'count.completed': this.progress.count.completed,
});

await Meteor.runAsUser(startedByUserId, async() => {
await Meteor.runAsUser(startedByUserId, async () => {
let msgCount = 0;
try {
for (const msg of list.messages) {
Expand Down
4 changes: 2 additions & 2 deletions app/lib/server/lib/sendNotificationsOnMessage.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { sendSinglePush, shouldNotifyMobile } from '../functions/notifications/m
import { notifyDesktopUser, shouldNotifyDesktop } from '../functions/notifications/desktop';
import { notifyAudioUser, shouldNotifyAudio } from '../functions/notifications/audio';

const sendNotification = async({
const sendNotification = async ({
subscription,
sender,
hasMentionToAll,
Expand Down Expand Up @@ -280,7 +280,7 @@ async function sendAllNotifications(message, room) {
});

Promise.all(mentions
.map(async(userId) => {
.map(async (userId) => {
await callJoinRoom(userId, room._id);

return userId;
Expand Down
10 changes: 6 additions & 4 deletions app/livechat/client/views/app/livechatCurrentChats.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
import _ from 'underscore';
import moment from 'moment';

import { Meteor } from 'meteor/meteor';
import { Mongo } from 'meteor/mongo';
import { ReactiveVar } from 'meteor/reactive-var';
import { FlowRouter } from 'meteor/kadira:flow-router';
import { Template } from 'meteor/templating';
import { modal } from '/app/ui-utils';
import { t, handleError } from '/app/utils';
import _ from 'underscore';
import moment from 'moment';

import { modal } from '../../../../ui-utils/client';
import { t, handleError } from '../../../../utils/client';

const LivechatRoom = new Mongo.Collection('livechatRoom');

Expand Down
Loading

0 comments on commit 9217ebf

Please sign in to comment.