Skip to content

Commit 40fefd4

Browse files
authored
Merge branch 'develop' into integrations
2 parents 7c84b9b + b534b72 commit 40fefd4

File tree

31 files changed

+289
-209
lines changed

31 files changed

+289
-209
lines changed

app/apps/client/admin/apps.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ Template.apps.events({
226226
} = instance.state.get('apps').find(({ id }) => id === currentTarget.dataset.id);
227227
FlowRouter.go('app-manage', { appId }, { version });
228228
},
229-
async 'click .js-install, click .js-update'(event, instance) {
229+
async 'click .js-update'(event, instance) {
230230
event.preventDefault();
231231
event.stopPropagation();
232232

@@ -240,7 +240,7 @@ Template.apps.events({
240240
instance.startAppWorking(app.id);
241241

242242
try {
243-
const { status } = await Apps.installApp(app.id, app.marketplaceVersion);
243+
const { status } = await Apps.updateApp(app.id, app.marketplaceVersion);
244244
warnStatusChange(app.name, status);
245245
} catch (error) {
246246
handleAPIError(error);

app/apps/client/admin/marketplace.js

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,7 @@ Template.marketplace.events({
273273
} = instance.state.get('apps').find(({ id }) => id === currentTarget.dataset.id);
274274
FlowRouter.go('marketplace-app', { appId }, { version: version || marketplaceVersion });
275275
},
276-
async 'click .js-install, click .js-update'(event, instance) {
276+
async 'click .js-install'(event, instance) {
277277
event.preventDefault();
278278
event.stopPropagation();
279279

@@ -284,6 +284,7 @@ Template.marketplace.events({
284284
}
285285

286286
const { currentTarget: button } = event;
287+
287288
const app = instance.state.get('apps').find(({ id }) => id === button.dataset.id);
288289

289290
instance.startAppWorking(app.id);
@@ -297,6 +298,31 @@ Template.marketplace.events({
297298
instance.stopAppWorking(app.id);
298299
}
299300
},
301+
async 'click .js-update'(event, instance) {
302+
event.preventDefault();
303+
event.stopPropagation();
304+
305+
const isLoggedInCloud = await checkCloudLogin();
306+
instance.state.set('isLoggedInCloud', isLoggedInCloud);
307+
if (!isLoggedInCloud) {
308+
return;
309+
}
310+
311+
const { currentTarget: button } = event;
312+
313+
const app = instance.state.get('apps').find(({ id }) => id === button.dataset.id);
314+
315+
instance.startAppWorking(app.id);
316+
317+
try {
318+
const { status } = await Apps.updateApp(app.id, app.marketplaceVersion);
319+
warnStatusChange(app.name, status);
320+
} catch (error) {
321+
handleAPIError(error);
322+
} finally {
323+
instance.stopAppWorking(app.id);
324+
}
325+
},
300326
async 'click .js-purchase'(event, instance) {
301327
event.preventDefault();
302328
event.stopPropagation();

app/authorization/server/startup.js

Lines changed: 95 additions & 91 deletions
Original file line numberDiff line numberDiff line change
@@ -12,97 +12,97 @@ Meteor.startup(function() {
1212
// then we can define edit-<type>-message instead of edit-message
1313
// 2. admin, moderator, and user roles should not be deleted as they are referened in the code.
1414
const permissions = [
15-
{ _id: 'access-permissions', roles: ['admin'] },
16-
{ _id: 'access-setting-permissions', roles: ['admin'] },
17-
{ _id: 'add-oauth-service', roles: ['admin'] },
18-
{ _id: 'add-user-to-joined-room', roles: ['admin', 'owner', 'moderator'] },
19-
{ _id: 'add-user-to-any-c-room', roles: ['admin'] },
20-
{ _id: 'add-user-to-any-p-room', roles: [] },
21-
{ _id: 'api-bypass-rate-limit', roles: ['admin', 'bot', 'app'] },
22-
{ _id: 'archive-room', roles: ['admin', 'owner'] },
23-
{ _id: 'assign-admin-role', roles: ['admin'] },
24-
{ _id: 'assign-roles', roles: ['admin'] },
25-
{ _id: 'ban-user', roles: ['admin', 'owner', 'moderator'] },
26-
{ _id: 'bulk-register-user', roles: ['admin'] },
27-
{ _id: 'create-c', roles: ['admin', 'user', 'bot', 'app'] },
28-
{ _id: 'create-d', roles: ['admin', 'user', 'bot', 'app'] },
29-
{ _id: 'create-p', roles: ['admin', 'user', 'bot', 'app'] },
30-
{ _id: 'create-personal-access-tokens', roles: ['admin', 'user'] },
31-
{ _id: 'create-user', roles: ['admin'] },
32-
{ _id: 'clean-channel-history', roles: ['admin'] },
33-
{ _id: 'delete-c', roles: ['admin', 'owner'] },
34-
{ _id: 'delete-d', roles: ['admin'] },
35-
{ _id: 'delete-message', roles: ['admin', 'owner', 'moderator'] },
36-
{ _id: 'delete-own-message', roles: ['admin', 'user'] },
37-
{ _id: 'delete-p', roles: ['admin', 'owner'] },
38-
{ _id: 'delete-user', roles: ['admin'] },
39-
{ _id: 'edit-message', roles: ['admin', 'owner', 'moderator'] },
40-
{ _id: 'edit-other-user-active-status', roles: ['admin'] },
41-
{ _id: 'edit-other-user-info', roles: ['admin'] },
42-
{ _id: 'edit-other-user-password', roles: ['admin'] },
43-
{ _id: 'edit-other-user-avatar', roles: ['admin'] },
44-
{ _id: 'edit-privileged-setting', roles: ['admin'] },
45-
{ _id: 'edit-room', roles: ['admin', 'owner', 'moderator'] },
46-
{ _id: 'edit-room-retention-policy', roles: ['admin'] },
47-
{ _id: 'force-delete-message', roles: ['admin', 'owner'] },
48-
{ _id: 'join-without-join-code', roles: ['admin', 'bot', 'app'] },
49-
{ _id: 'leave-c', roles: ['admin', 'user', 'bot', 'anonymous', 'app'] },
50-
{ _id: 'leave-p', roles: ['admin', 'user', 'bot', 'anonymous', 'app'] },
51-
{ _id: 'manage-assets', roles: ['admin'] },
52-
{ _id: 'manage-emoji', roles: ['admin'] },
53-
{ _id: 'manage-user-status', roles: ['admin'] },
54-
{ _id: 'manage-outgoing-integrations', roles: ['admin'] },
55-
{ _id: 'manage-incoming-integrations', roles: ['admin'] },
56-
{ _id: 'manage-own-outgoing-integrations', roles: ['admin'] },
57-
{ _id: 'manage-own-incoming-integrations', roles: ['admin'] },
58-
{ _id: 'manage-oauth-apps', roles: ['admin'] },
59-
{ _id: 'manage-selected-settings', roles: ['admin'] },
60-
{ _id: 'mention-all', roles: ['admin', 'owner', 'moderator', 'user'] },
61-
{ _id: 'mention-here', roles: ['admin', 'owner', 'moderator', 'user'] },
62-
{ _id: 'mute-user', roles: ['admin', 'owner', 'moderator'] },
63-
{ _id: 'remove-user', roles: ['admin', 'owner', 'moderator'] },
64-
{ _id: 'run-import', roles: ['admin'] },
65-
{ _id: 'run-migration', roles: ['admin'] },
66-
{ _id: 'set-moderator', roles: ['admin', 'owner'] },
67-
{ _id: 'set-owner', roles: ['admin', 'owner'] },
68-
{ _id: 'send-many-messages', roles: ['admin', 'bot', 'app'] },
69-
{ _id: 'set-leader', roles: ['admin', 'owner'] },
70-
{ _id: 'unarchive-room', roles: ['admin'] },
71-
{ _id: 'view-c-room', roles: ['admin', 'user', 'bot', 'app', 'anonymous'] },
72-
{ _id: 'user-generate-access-token', roles: ['admin'] },
73-
{ _id: 'view-d-room', roles: ['admin', 'user', 'bot', 'app', 'guest'] },
74-
{ _id: 'view-full-other-user-info', roles: ['admin'] },
75-
{ _id: 'view-history', roles: ['admin', 'user', 'anonymous'] },
76-
{ _id: 'view-joined-room', roles: ['guest', 'bot', 'app', 'anonymous'] },
77-
{ _id: 'view-join-code', roles: ['admin'] },
78-
{ _id: 'view-logs', roles: ['admin'] },
79-
{ _id: 'view-other-user-channels', roles: ['admin'] },
80-
{ _id: 'view-p-room', roles: ['admin', 'user', 'anonymous', 'guest'] },
81-
{ _id: 'view-privileged-setting', roles: ['admin'] },
82-
{ _id: 'view-room-administration', roles: ['admin'] },
83-
{ _id: 'view-statistics', roles: ['admin'] },
84-
{ _id: 'view-user-administration', roles: ['admin'] },
85-
{ _id: 'preview-c-room', roles: ['admin', 'user', 'anonymous'] },
86-
{ _id: 'view-outside-room', roles: ['admin', 'owner', 'moderator', 'user'] },
87-
{ _id: 'view-broadcast-member-list', roles: ['admin', 'owner', 'moderator'] },
88-
{ _id: 'call-management', roles: ['admin', 'owner', 'moderator'] },
89-
{ _id: 'create-invite-links', roles: ['admin', 'owner', 'moderator'] },
90-
{ _id: 'view-l-room', roles: ['livechat-agent', 'livechat-manager', 'admin'] },
91-
{ _id: 'view-livechat-manager', roles: ['livechat-manager', 'admin'] },
92-
{ _id: 'view-livechat-rooms', roles: ['livechat-manager', 'admin'] },
93-
{ _id: 'close-livechat-room', roles: ['livechat-agent', 'livechat-manager', 'admin'] },
94-
{ _id: 'close-others-livechat-room', roles: ['livechat-manager', 'admin'] },
95-
{ _id: 'save-others-livechat-room-info', roles: ['livechat-manager'] },
96-
{ _id: 'remove-closed-livechat-rooms', roles: ['livechat-manager', 'admin'] },
97-
{ _id: 'view-livechat-analytics', roles: ['livechat-manager', 'admin'] },
98-
{ _id: 'view-livechat-queue', roles: ['livechat-manager', 'admin'] },
99-
{ _id: 'transfer-livechat-guest', roles: ['livechat-manager', 'admin'] },
100-
{ _id: 'manage-livechat-managers', roles: ['livechat-manager', 'admin'] },
101-
{ _id: 'manage-livechat-agents', roles: ['livechat-manager', 'admin'] },
102-
{ _id: 'manage-livechat-departments', roles: ['livechat-manager', 'admin'] },
103-
{ _id: 'view-livechat-departments', roles: ['livechat-manager', 'admin'] },
104-
{ _id: 'add-livechat-department-agents', roles: ['livechat-manager', 'admin'] },
105-
{ _id: 'view-livechat-current-chats', roles: ['livechat-manager', 'admin'] },
15+
{ _id: 'access-permissions', roles: ['admin'] },
16+
{ _id: 'access-setting-permissions', roles: ['admin'] },
17+
{ _id: 'add-oauth-service', roles: ['admin'] },
18+
{ _id: 'add-user-to-joined-room', roles: ['admin', 'owner', 'moderator'] },
19+
{ _id: 'add-user-to-any-c-room', roles: ['admin'] },
20+
{ _id: 'add-user-to-any-p-room', roles: [] },
21+
{ _id: 'api-bypass-rate-limit', roles: ['admin', 'bot', 'app'] },
22+
{ _id: 'archive-room', roles: ['admin', 'owner'] },
23+
{ _id: 'assign-admin-role', roles: ['admin'] },
24+
{ _id: 'assign-roles', roles: ['admin'] },
25+
{ _id: 'ban-user', roles: ['admin', 'owner', 'moderator'] },
26+
{ _id: 'bulk-register-user', roles: ['admin'] },
27+
{ _id: 'create-c', roles: ['admin', 'user', 'bot', 'app'] },
28+
{ _id: 'create-d', roles: ['admin', 'user', 'bot', 'app'] },
29+
{ _id: 'create-p', roles: ['admin', 'user', 'bot', 'app'] },
30+
{ _id: 'create-personal-access-tokens', roles: ['admin', 'user'] },
31+
{ _id: 'create-user', roles: ['admin'] },
32+
{ _id: 'clean-channel-history', roles: ['admin'] },
33+
{ _id: 'delete-c', roles: ['admin', 'owner'] },
34+
{ _id: 'delete-d', roles: ['admin'] },
35+
{ _id: 'delete-message', roles: ['admin', 'owner', 'moderator'] },
36+
{ _id: 'delete-own-message', roles: ['admin', 'user'] },
37+
{ _id: 'delete-p', roles: ['admin', 'owner'] },
38+
{ _id: 'delete-user', roles: ['admin'] },
39+
{ _id: 'edit-message', roles: ['admin', 'owner', 'moderator'] },
40+
{ _id: 'edit-other-user-active-status', roles: ['admin'] },
41+
{ _id: 'edit-other-user-info', roles: ['admin'] },
42+
{ _id: 'edit-other-user-password', roles: ['admin'] },
43+
{ _id: 'edit-other-user-avatar', roles: ['admin'] },
44+
{ _id: 'edit-privileged-setting', roles: ['admin'] },
45+
{ _id: 'edit-room', roles: ['admin', 'owner', 'moderator'] },
46+
{ _id: 'edit-room-retention-policy', roles: ['admin'] },
47+
{ _id: 'force-delete-message', roles: ['admin', 'owner'] },
48+
{ _id: 'join-without-join-code', roles: ['admin', 'bot', 'app'] },
49+
{ _id: 'leave-c', roles: ['admin', 'user', 'bot', 'anonymous', 'app'] },
50+
{ _id: 'leave-p', roles: ['admin', 'user', 'bot', 'anonymous', 'app'] },
51+
{ _id: 'manage-assets', roles: ['admin'] },
52+
{ _id: 'manage-emoji', roles: ['admin'] },
53+
{ _id: 'manage-user-status', roles: ['admin'] },
54+
{ _id: 'manage-outgoing-integrations', roles: ['admin'] },
55+
{ _id: 'manage-incoming-integrations', roles: ['admin'] },
56+
{ _id: 'manage-own-outgoing-integrations', roles: ['admin'] },
57+
{ _id: 'manage-own-incoming-integrations', roles: ['admin'] },
58+
{ _id: 'manage-oauth-apps', roles: ['admin'] },
59+
{ _id: 'manage-selected-settings', roles: ['admin'] },
60+
{ _id: 'mention-all', roles: ['admin', 'owner', 'moderator', 'user'] },
61+
{ _id: 'mention-here', roles: ['admin', 'owner', 'moderator', 'user'] },
62+
{ _id: 'mute-user', roles: ['admin', 'owner', 'moderator'] },
63+
{ _id: 'remove-user', roles: ['admin', 'owner', 'moderator'] },
64+
{ _id: 'run-import', roles: ['admin'] },
65+
{ _id: 'run-migration', roles: ['admin'] },
66+
{ _id: 'set-moderator', roles: ['admin', 'owner'] },
67+
{ _id: 'set-owner', roles: ['admin', 'owner'] },
68+
{ _id: 'send-many-messages', roles: ['admin', 'bot', 'app'] },
69+
{ _id: 'set-leader', roles: ['admin', 'owner'] },
70+
{ _id: 'unarchive-room', roles: ['admin'] },
71+
{ _id: 'view-c-room', roles: ['admin', 'user', 'bot', 'app', 'anonymous'] },
72+
{ _id: 'user-generate-access-token', roles: ['admin'] },
73+
{ _id: 'view-d-room', roles: ['admin', 'user', 'bot', 'app', 'guest'] },
74+
{ _id: 'view-full-other-user-info', roles: ['admin'] },
75+
{ _id: 'view-history', roles: ['admin', 'user', 'anonymous'] },
76+
{ _id: 'view-joined-room', roles: ['guest', 'bot', 'app', 'anonymous'] },
77+
{ _id: 'view-join-code', roles: ['admin'] },
78+
{ _id: 'view-logs', roles: ['admin'] },
79+
{ _id: 'view-other-user-channels', roles: ['admin'] },
80+
{ _id: 'view-p-room', roles: ['admin', 'user', 'anonymous', 'guest'] },
81+
{ _id: 'view-privileged-setting', roles: ['admin'] },
82+
{ _id: 'view-room-administration', roles: ['admin'] },
83+
{ _id: 'view-statistics', roles: ['admin'] },
84+
{ _id: 'view-user-administration', roles: ['admin'] },
85+
{ _id: 'preview-c-room', roles: ['admin', 'user', 'anonymous'] },
86+
{ _id: 'view-outside-room', roles: ['admin', 'owner', 'moderator', 'user'] },
87+
{ _id: 'view-broadcast-member-list', roles: ['admin', 'owner', 'moderator'] },
88+
{ _id: 'call-management', roles: ['admin', 'owner', 'moderator'] },
89+
{ _id: 'create-invite-links', roles: ['admin', 'owner', 'moderator'] },
90+
{ _id: 'view-l-room', roles: ['livechat-agent', 'livechat-manager', 'admin'] },
91+
{ _id: 'view-livechat-manager', roles: ['livechat-manager', 'admin'] },
92+
{ _id: 'view-livechat-rooms', roles: ['livechat-manager', 'admin'] },
93+
{ _id: 'close-livechat-room', roles: ['livechat-agent', 'livechat-manager', 'admin'] },
94+
{ _id: 'close-others-livechat-room', roles: ['livechat-manager', 'admin'] },
95+
{ _id: 'save-others-livechat-room-info', roles: ['livechat-manager'] },
96+
{ _id: 'remove-closed-livechat-rooms', roles: ['livechat-manager', 'admin'] },
97+
{ _id: 'view-livechat-analytics', roles: ['livechat-manager', 'admin'] },
98+
{ _id: 'view-livechat-queue', roles: ['livechat-manager', 'admin'] },
99+
{ _id: 'transfer-livechat-guest', roles: ['livechat-manager', 'admin'] },
100+
{ _id: 'manage-livechat-managers', roles: ['livechat-manager', 'admin'] },
101+
{ _id: 'manage-livechat-agents', roles: ['livechat-manager', 'admin'] },
102+
{ _id: 'manage-livechat-departments', roles: ['livechat-manager', 'admin'] },
103+
{ _id: 'view-livechat-departments', roles: ['livechat-manager', 'admin'] },
104+
{ _id: 'add-livechat-department-agents', roles: ['livechat-manager', 'admin'] },
105+
{ _id: 'view-livechat-current-chats', roles: ['livechat-manager', 'admin'] },
106106
{ _id: 'view-livechat-real-time-monitoring', roles: ['livechat-manager', 'admin'] },
107107
{ _id: 'view-livechat-triggers', roles: ['livechat-manager', 'admin'] },
108108
{ _id: 'view-livechat-customfields', roles: ['livechat-manager', 'admin'] },
@@ -111,6 +111,10 @@ Meteor.startup(function() {
111111
{ _id: 'view-livechat-webhooks', roles: ['livechat-manager', 'admin'] },
112112
{ _id: 'view-livechat-facebook', roles: ['livechat-manager', 'admin'] },
113113
{ _id: 'view-livechat-officeHours', roles: ['livechat-manager', 'admin'] },
114+
{ _id: 'view-livechat-room-closed-same-department', roles: ['livechat-manager', 'admin'] },
115+
{ _id: 'view-livechat-room-closed-by-another-agent', roles: ['livechat-manager', 'admin'] },
116+
{ _id: 'view-livechat-room-customfields', roles: ['livechat-manager', 'livechat-agent', 'admin'] },
117+
{ _id: 'edit-livechat-room-customfields', roles: ['livechat-manager', 'livechat-agent', 'admin'] },
114118
];
115119

116120
for (const permission of permissions) {

app/channel-settings-mail-messages/client/views/mailMessagesInstructions.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -240,9 +240,9 @@ Template.mailMessagesInstructions.onCreated(function() {
240240
this.selectedUsers = new ReactiveVar([]);
241241
this.userFilter = new ReactiveVar('');
242242

243-
const filter = { exceptions: [Meteor.user().username].concat(this.selectedUsers.get().map((u) => u.username)) };
243+
const filter = { exceptions: this.selectedUsers.get().map((u) => u.username) };
244244
Deps.autorun(() => {
245-
filter.exceptions = [Meteor.user().username].concat(this.selectedUsers.get().map((u) => u.username));
245+
filter.exceptions = this.selectedUsers.get().map((u) => u.username);
246246
});
247247

248248
this.ac = new AutoComplete(

app/channel-settings/client/views/channelSettings.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,7 @@
226226
{{/if}}
227227
{{/with}}
228228
{{#with settings.joinCode}}
229+
{{#if canView}}
229230
<div class="rc-user-info__row rc-user-info__row--separator">
230231
<div class="rc-input">
231232
<label class="rc-input__label">
@@ -236,6 +237,7 @@
236237
</label>
237238
</div>
238239
</div>
240+
{{/if}}
239241
{{/with}}
240242

241243
{{#if hasRetentionPermission}}

0 commit comments

Comments
 (0)