Skip to content

Commit

Permalink
chore: removes mocked data for cloud sync
Browse files Browse the repository at this point in the history
  • Loading branch information
lucas-a-pelegrino committed Nov 20, 2024
1 parent 9e142fc commit 4b8f3e6
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 124 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
2 changes: 1 addition & 1 deletion apps/meteor/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
94 changes: 0 additions & 94 deletions apps/meteor/server/modules/core-apps/cloudAnnouncements.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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: {
Expand Down

0 comments on commit 4b8f3e6

Please sign in to comment.