Skip to content

Commit 9312d03

Browse files
committed
added change workspace overflow button in create db modal
1 parent 970b248 commit 9312d03

3 files changed

Lines changed: 16 additions & 2 deletions

File tree

enum/modals/NotionDatabase.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,4 +49,6 @@ export enum DatabaseModal {
4949
PROPERTY_TYPE_TITLE = "title",
5050
OVERFLOW_MENU_ACTION = "create-notion-database-overflow-menu-action-id",
5151
OVERFLOW_MENU_TEXT = "Create Database",
52+
OVERFLOW_CHANGE_WORKSPACE_ACTION = "change-notion-workspace-overflow-menu-action-id",
53+
OVERFLOW_CHANGE_WORKSPACE_TEXT = "Change Workspace"
5254
}

src/handlers/ExecuteBlockActionHandler.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -804,6 +804,7 @@ export class ExecuteBlockActionHandler {
804804
// Check if the value is pageId. if not then it is not a refresh comment action
805805
const OverFlowActions = [
806806
DatabaseModal.OVERFLOW_MENU_ACTION.toString(),
807+
DatabaseModal.OVERFLOW_CHANGE_WORKSPACE_ACTION.toString(),
807808
NotionPageOrRecord.CHANGE_DATABASE_ACTION.toString(),
808809
NotionPageOrRecord.OVERFLOW_MENU_ACTION.toString()
809810
];
@@ -836,6 +837,11 @@ export class ExecuteBlockActionHandler {
836837
break;
837838
}
838839

840+
case DatabaseModal.OVERFLOW_CHANGE_WORKSPACE_ACTION:{
841+
await handler.changeNotionWorkspace();
842+
break;
843+
}
844+
839845
case NotionPageOrRecord.OVERFLOW_MENU_ACTION:{
840846
await handler.createNotionPageOrRecord();
841847
break;

src/modals/createDatabaseModal.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,14 @@ export async function createDatabaseModal(
5151
const { elementBuilder, blockBuilder } = app.getUtils();
5252
const divider = blockBuilder.createDividerBlock();
5353
const connectBlock = getConnectPreview(app.getID(), tokenInfo);
54-
const overFlowMenuText = [NotionPageOrRecord.OVERFLOW_MENU_TEXT.toString()];
55-
const overFlowMenuValue = [NotionPageOrRecord.OVERFLOW_MENU_ACTION.toString()];
54+
const overFlowMenuText = [
55+
NotionPageOrRecord.OVERFLOW_MENU_TEXT.toString(),
56+
DatabaseModal.OVERFLOW_CHANGE_WORKSPACE_TEXT.toString(),
57+
];
58+
const overFlowMenuValue = [
59+
NotionPageOrRecord.OVERFLOW_MENU_ACTION.toString(),
60+
DatabaseModal.OVERFLOW_CHANGE_WORKSPACE_ACTION.toString(),
61+
];
5662

5763
const searchForPageComponent = await searchPageComponent(
5864
app,

0 commit comments

Comments
 (0)