diff --git a/enum/modals/NotionDatabase.ts b/enum/modals/NotionDatabase.ts index 0d777a8..6aa7ced 100644 --- a/enum/modals/NotionDatabase.ts +++ b/enum/modals/NotionDatabase.ts @@ -47,8 +47,8 @@ export enum DatabaseModal { REMOVE_OPTION_BLOCK = "remove-option-notion-database-block-id", SELECT_PROPERTY_OPTION_NAME = "select-property-option-name-action", PROPERTY_TYPE_TITLE = "title", - OVERFLOW_MENU_ACTION = "create-notion-database-overflow-menu-action-id", - OVERFLOW_MENU_TEXT = "Create Database", + OVERFLOW_MENU_TEXT_CREATE_DB = "Create Database", + OVERFLOW_MENU_ACTION_CREATE_DB = "create-notion-database-overflow-menu-action-id", OVERFLOW_CHANGE_WORKSPACE_ACTION = "change-notion-workspace-overflow-menu-action-id", - OVERFLOW_CHANGE_WORKSPACE_TEXT = "Change Workspace" + OVERFLOW_CHANGE_WORKSPACE_TEXT = "Change Workspace", } diff --git a/src/handlers/ExecuteBlockActionHandler.ts b/src/handlers/ExecuteBlockActionHandler.ts index b271677..c1f70a8 100644 --- a/src/handlers/ExecuteBlockActionHandler.ts +++ b/src/handlers/ExecuteBlockActionHandler.ts @@ -803,10 +803,10 @@ export class ExecuteBlockActionHandler { // Check if the value is pageId. if not then it is not a refresh comment action const OverFlowActions = [ - DatabaseModal.OVERFLOW_MENU_ACTION.toString(), DatabaseModal.OVERFLOW_CHANGE_WORKSPACE_ACTION.toString(), + DatabaseModal.OVERFLOW_MENU_ACTION_CREATE_DB.toString(), NotionPageOrRecord.CHANGE_DATABASE_ACTION.toString(), - NotionPageOrRecord.OVERFLOW_CHANGE_TO_PAGE_ACTION.toString() + NotionPageOrRecord.OVERFLOW_CHANGE_TO_PAGE_ACTION.toString(), ]; if (!OverFlowActions.includes(value)) { @@ -832,17 +832,17 @@ export class ExecuteBlockActionHandler { }); switch (value) { - case DatabaseModal.OVERFLOW_MENU_ACTION: { + case DatabaseModal.OVERFLOW_MENU_ACTION_CREATE_DB: { await handler.createNotionDatabase(); break; } - case DatabaseModal.OVERFLOW_CHANGE_WORKSPACE_ACTION:{ + case DatabaseModal.OVERFLOW_CHANGE_WORKSPACE_ACTION: { await handler.changeNotionWorkspace(); break; } - case NotionPageOrRecord.OVERFLOW_CHANGE_TO_PAGE_ACTION:{ + case NotionPageOrRecord.OVERFLOW_CHANGE_TO_PAGE_ACTION: { await handler.createNotionPageOrRecord(); break; } diff --git a/src/modals/createPageOrRecordModal.ts b/src/modals/createPageOrRecordModal.ts index d6cd623..13bff53 100644 --- a/src/modals/createPageOrRecordModal.ts +++ b/src/modals/createPageOrRecordModal.ts @@ -48,8 +48,14 @@ export async function createPageOrRecordModal( const divider = blockBuilder.createDividerBlock(); const blocks: Block[] = []; const appId = app.getID(); - const overFlowMenuText = [DatabaseModal.OVERFLOW_MENU_TEXT.toString()]; - const overFlowMenuValue = [DatabaseModal.OVERFLOW_MENU_ACTION.toString()]; + const overFlowMenuText = [ + DatabaseModal.OVERFLOW_MENU_TEXT_CREATE_DB.toString(), + DatabaseModal.OVERFLOW_CHANGE_WORKSPACE_TEXT.toString(), + ]; + const overFlowMenuValue = [ + DatabaseModal.OVERFLOW_MENU_ACTION_CREATE_DB.toString(), + DatabaseModal.OVERFLOW_CHANGE_WORKSPACE_ACTION.toString(), + ]; let properties: object | undefined; let addedProperty: { data: Array } | undefined; let allUsers: object | undefined; @@ -67,10 +73,10 @@ export async function createPageOrRecordModal( } if (parent) { - overFlowMenuText.push( + overFlowMenuText.unshift( NotionPageOrRecord.CHANGE_DATABASE_TEXT.toString() ); - overFlowMenuValue.push( + overFlowMenuValue.unshift( NotionPageOrRecord.CHANGE_DATABASE_ACTION.toString() ); }