From 69aa3d58b1ee869713065cea5e8d5535803d4d83 Mon Sep 17 00:00:00 2001 From: Lucas Pelegrino Date: Tue, 19 Nov 2024 21:07:02 -0300 Subject: [PATCH] chore: removes mocked data for cloud sync --- .../fetchWorkspaceSyncPayload.ts | 30 +----- apps/meteor/package.json | 2 +- .../core-apps/cloudAnnouncements.module.ts | 94 ------------------- 3 files changed, 2 insertions(+), 124 deletions(-) diff --git a/apps/meteor/app/cloud/server/functions/syncWorkspace/fetchWorkspaceSyncPayload.ts b/apps/meteor/app/cloud/server/functions/syncWorkspace/fetchWorkspaceSyncPayload.ts index c8763a2491f1c..170ad41ee1a11 100644 --- a/apps/meteor/app/cloud/server/functions/syncWorkspace/fetchWorkspaceSyncPayload.ts +++ b/apps/meteor/app/cloud/server/functions/syncWorkspace/fetchWorkspaceSyncPayload.ts @@ -42,33 +42,5 @@ export async function fetchWorkspaceSyncPayload({ assertWorkspaceSyncPayload(payload); - const cloudSyncAnnouncement = { - viewId: 'subscription-announcement', - appId: 'cloud-announcements-core', - blocks: [ - { - type: 'callout', - title: { - type: 'plain_text', - text: 'Workspace eligible for Starter Plan', - }, - text: { - type: 'plain_text', - text: 'Get free access to premium capabilities for up to 50 users', - }, - accessory: { - type: 'button', - text: { - type: 'plain_text', - text: 'Switch Plan', - }, - actionId: 'callout-action', - appId: 'cloud-announcements-core', - blockId: 'section-button', - }, - }, - ], - }; - - return { ...payload, cloudSyncAnnouncement }; + return payload; } diff --git a/apps/meteor/package.json b/apps/meteor/package.json index 123cf22764732..e736eb8583310 100644 --- a/apps/meteor/package.json +++ b/apps/meteor/package.json @@ -335,7 +335,7 @@ "emailreplyparser": "^0.0.5", "emoji-toolkit": "^7.0.1", "emojione": "^4.5.0", - "esl": "^11.2.1", + "esl": "file:/Users/lucaspelegrino/Developer/work/rocket.chat/esl", "eventemitter3": "^5.0.1", "exif-be-gone": "^1.5.1", "expiry-map": "^2.0.0", diff --git a/apps/meteor/server/modules/core-apps/cloudAnnouncements.module.ts b/apps/meteor/server/modules/core-apps/cloudAnnouncements.module.ts index 096b79ed7f790..68599162cdef5 100644 --- a/apps/meteor/server/modules/core-apps/cloudAnnouncements.module.ts +++ b/apps/meteor/server/modules/core-apps/cloudAnnouncements.module.ts @@ -243,100 +243,6 @@ export class CloudAnnouncementsModule implements IUiKitCoreApp { ...userInteraction, }; - if ( - userInteraction.type === 'blockAction' && - userInteraction.container?.type === 'view' && - userInteraction.actionId === 'callout-action' && - userInteraction.container?.id === 'subscription-announcement' - ) { - return { - type: 'modal.open', - triggerId: userInteraction.triggerId, - appId: this.appId, - view: { - showIcon: false, - id: userInteraction.container.id, - title: { - type: 'plain_text', - text: 'Hello from Cloud', - }, - blocks: [ - { - type: 'image', - title: { - type: 'plain_text', - text: 'I Need a Marg', - emoji: true, - }, - imageUrl: 'https://picsum.photos/200/300', - altText: 'marg', - }, - { - type: 'context', - elements: [ - { - type: 'mrkdwn', - text: '*This* is :smile: markdown', - }, - ], - }, - ], - appId: this.appId, - // export type ButtonElement = Actionable<{ - // type: 'button'; - // text: PlainText; - // url?: string; - // value?: string; - // style?: 'primary' | 'secondary' | 'danger' | 'warning' | 'success'; - // secondary?: boolean; - // }>; - - close: { - appId: this.appId, - blockId: userInteraction.container.id, - type: 'button', - text: { - type: 'plain_text', - text: 'Close', - emoji: true, - }, - actionId: 'close-modal', - url: 'https://rocket.chat', - }, - submit: { - appId: this.appId, - blockId: userInteraction.container.id, - type: 'button', - text: { - type: 'plain_text', - text: 'Submit', - emoji: true, - }, - actionId: 'submit-modal', - url: 'https://rocket.chat', - }, - }, - }; - } - - if ( - userInteraction.type === 'blockAction' && - userInteraction.container?.type === 'view' && - (userInteraction.actionId === 'submit-modal' || userInteraction.actionId === 'close-modal') - ) { - if (userInteraction.actionId === 'submit-modal') { - await syncWorkspace(); - } - - return { - type: 'modal.close', - triggerId: userInteraction.triggerId, - appId: this.appId, - }; - } - - console.log(userInteraction); - const response = await fetch(`${this.getCloudUrl()}/api/v3/comms/workspace/interaction`, { method: 'POST', headers: {