From a3702a02695fa6333275490ccad1e00b2ab5efef Mon Sep 17 00:00:00 2001 From: Guilherme Gazzo Date: Wed, 20 Nov 2024 02:13:21 -0300 Subject: [PATCH] Revert "mock" This reverts commit fcdad802b49b3f2ae03c7bcdf85e962261064b2f. --- .../fetchWorkspaceSyncPayload.ts | 30 +----- .../core-apps/cloudAnnouncements.module.ts | 94 ------------------- 2 files changed, 1 insertion(+), 123 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/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: {