Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions enum/modals/NotionDatabase.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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",
}
10 changes: 5 additions & 5 deletions src/handlers/ExecuteBlockActionHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
Expand All @@ -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;
}
Expand Down
14 changes: 10 additions & 4 deletions src/modals/createPageOrRecordModal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<object> } | undefined;
let allUsers: object | undefined;
Expand All @@ -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()
);
}
Expand Down