Skip to content

Commit 4b8f3e6

Browse files
chore: removes mocked data for cloud sync
1 parent 9e142fc commit 4b8f3e6

File tree

3 files changed

+2
-124
lines changed

3 files changed

+2
-124
lines changed

apps/meteor/app/cloud/server/functions/syncWorkspace/fetchWorkspaceSyncPayload.ts

+1-29
Original file line numberDiff line numberDiff line change
@@ -42,33 +42,5 @@ export async function fetchWorkspaceSyncPayload({
4242

4343
assertWorkspaceSyncPayload(payload);
4444

45-
const cloudSyncAnnouncement = {
46-
viewId: 'subscription-announcement',
47-
appId: 'cloud-announcements-core',
48-
blocks: [
49-
{
50-
type: 'callout',
51-
title: {
52-
type: 'plain_text',
53-
text: 'Workspace eligible for Starter Plan',
54-
},
55-
text: {
56-
type: 'plain_text',
57-
text: 'Get free access to premium capabilities for up to 50 users',
58-
},
59-
accessory: {
60-
type: 'button',
61-
text: {
62-
type: 'plain_text',
63-
text: 'Switch Plan',
64-
},
65-
actionId: 'callout-action',
66-
appId: 'cloud-announcements-core',
67-
blockId: 'section-button',
68-
},
69-
},
70-
],
71-
};
72-
73-
return { ...payload, cloudSyncAnnouncement };
45+
return payload;
7446
}

apps/meteor/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -335,7 +335,7 @@
335335
"emailreplyparser": "^0.0.5",
336336
"emoji-toolkit": "^7.0.1",
337337
"emojione": "^4.5.0",
338-
"esl": "^11.2.1",
338+
"esl": "file:/Users/lucaspelegrino/Developer/work/rocket.chat/esl",
339339
"eventemitter3": "^5.0.1",
340340
"exif-be-gone": "^1.5.1",
341341
"expiry-map": "^2.0.0",

apps/meteor/server/modules/core-apps/cloudAnnouncements.module.ts

-94
Original file line numberDiff line numberDiff line change
@@ -243,100 +243,6 @@ export class CloudAnnouncementsModule implements IUiKitCoreApp {
243243
...userInteraction,
244244
};
245245

246-
if (
247-
userInteraction.type === 'blockAction' &&
248-
userInteraction.container?.type === 'view' &&
249-
userInteraction.actionId === 'callout-action' &&
250-
userInteraction.container?.id === 'subscription-announcement'
251-
) {
252-
return {
253-
type: 'modal.open',
254-
triggerId: userInteraction.triggerId,
255-
appId: this.appId,
256-
view: {
257-
showIcon: false,
258-
id: userInteraction.container.id,
259-
title: {
260-
type: 'plain_text',
261-
text: 'Hello from Cloud',
262-
},
263-
blocks: [
264-
{
265-
type: 'image',
266-
title: {
267-
type: 'plain_text',
268-
text: 'I Need a Marg',
269-
emoji: true,
270-
},
271-
imageUrl: 'https://picsum.photos/200/300',
272-
altText: 'marg',
273-
},
274-
{
275-
type: 'context',
276-
elements: [
277-
{
278-
type: 'mrkdwn',
279-
text: '*This* is :smile: markdown',
280-
},
281-
],
282-
},
283-
],
284-
appId: this.appId,
285-
// export type ButtonElement = Actionable<{
286-
// type: 'button';
287-
// text: PlainText;
288-
// url?: string;
289-
// value?: string;
290-
// style?: 'primary' | 'secondary' | 'danger' | 'warning' | 'success';
291-
// secondary?: boolean;
292-
// }>;
293-
294-
close: {
295-
appId: this.appId,
296-
blockId: userInteraction.container.id,
297-
type: 'button',
298-
text: {
299-
type: 'plain_text',
300-
text: 'Close',
301-
emoji: true,
302-
},
303-
actionId: 'close-modal',
304-
url: 'https://rocket.chat',
305-
},
306-
submit: {
307-
appId: this.appId,
308-
blockId: userInteraction.container.id,
309-
type: 'button',
310-
text: {
311-
type: 'plain_text',
312-
text: 'Submit',
313-
emoji: true,
314-
},
315-
actionId: 'submit-modal',
316-
url: 'https://rocket.chat',
317-
},
318-
},
319-
};
320-
}
321-
322-
if (
323-
userInteraction.type === 'blockAction' &&
324-
userInteraction.container?.type === 'view' &&
325-
(userInteraction.actionId === 'submit-modal' || userInteraction.actionId === 'close-modal')
326-
) {
327-
if (userInteraction.actionId === 'submit-modal') {
328-
await syncWorkspace();
329-
}
330-
331-
return {
332-
type: 'modal.close',
333-
triggerId: userInteraction.triggerId,
334-
appId: this.appId,
335-
};
336-
}
337-
338-
console.log(userInteraction);
339-
340246
const response = await fetch(`${this.getCloudUrl()}/api/v3/comms/workspace/interaction`, {
341247
method: 'POST',
342248
headers: {

0 commit comments

Comments
 (0)