From a2674638d92443c9d9acc95cb4e3a8715913327f Mon Sep 17 00:00:00 2001 From: Zishan Ahmad Date: Fri, 2 Feb 2024 13:00:46 +0530 Subject: [PATCH 1/3] fixed some terminology to avoid confusion --- enum/messages.ts | 2 +- enum/modals/NotionPageOrRecord.ts | 6 +++--- enum/modals/common/SearchPageAndDatabaseComponent.ts | 2 +- src/handlers/ExecuteBlockActionHandler.ts | 4 ++-- src/handlers/ExecuteViewSubmitHandler.ts | 2 +- src/modals/createPageOrRecordModal.ts | 4 ++-- 6 files changed, 10 insertions(+), 10 deletions(-) diff --git a/enum/messages.ts b/enum/messages.ts index 1ee2afd..d25bbe6 100644 --- a/enum/messages.ts +++ b/enum/messages.ts @@ -2,7 +2,7 @@ export enum Messages { HELPER_COMMANDS = `• use \`/notion connect\` to connect your workspace • use \`/notion disconnect\` to disconnect workspace • use \`/notion comment\` to comment on notion page - • use \`/notion create\` to create page or record + • use \`/notion create\` to create subpage or record • use \`/notion create db\` to create database • use \`/notion workspace\` to change workspace • use \`/notion share\` to share pages diff --git a/enum/modals/NotionPageOrRecord.ts b/enum/modals/NotionPageOrRecord.ts index 1fb3dab..6e6b907 100644 --- a/enum/modals/NotionPageOrRecord.ts +++ b/enum/modals/NotionPageOrRecord.ts @@ -7,12 +7,12 @@ export enum NotionPageOrRecord { CLOSE = "Close", CLOSE_ACTION = "close-page-or-record-action-id", CLOSE_BLOCK = "close-page-or-record-block-id", - TITLE_PLACEHOLDER = "Enter Title of Page or Record", + TITLE_PLACEHOLDER = "Enter Title of Page", TITLE_LABEL = "Title *", TITLE_BLOCK = "title-page-or-record-block-id", TITLE_ACTION = "title-page-or-record-action-id", - CHANGE_DATABASE_TEXT = "Change Database", - CHANGE_DATABASE_ACTION = "create-page-or-record-change-database-action-id", + CHANGE_SELECTION_TEXT = "Change Selection", + CHANGE_SELECTION_ACTION = "create-page-or-record-change-selection-action-id", PROPERTY_SELECTED_BLOCK_ELEMENT = "property-selected-element-create-page-or-record-block-id", OVERFLOW_CHANGE_TO_PAGE_ACTION = "create-notion-page-overflow-menu-action-id", OVERFLOW_CHANGE_TO_PAGE_TEXT = "Create Page or Record", diff --git a/enum/modals/common/SearchPageAndDatabaseComponent.ts b/enum/modals/common/SearchPageAndDatabaseComponent.ts index 08aeeac..a371867 100644 --- a/enum/modals/common/SearchPageAndDatabaseComponent.ts +++ b/enum/modals/common/SearchPageAndDatabaseComponent.ts @@ -2,5 +2,5 @@ export enum SearchPageAndDatabase { PLACEHOLDER = "Select a Page or Database", BLOCK_ID = "search-page-and-database-component-block-id", ACTION_ID = "search-page-and-database-component-action-id", - LABEL = "Page or Database Name *", + LABEL = "Parent Page or Database Name *", } diff --git a/src/handlers/ExecuteBlockActionHandler.ts b/src/handlers/ExecuteBlockActionHandler.ts index 01bfec3..93d673a 100644 --- a/src/handlers/ExecuteBlockActionHandler.ts +++ b/src/handlers/ExecuteBlockActionHandler.ts @@ -805,7 +805,7 @@ export class ExecuteBlockActionHandler { const OverFlowActions = [ DatabaseModal.OVERFLOW_CHANGE_WORKSPACE_ACTION.toString(), DatabaseModal.OVERFLOW_MENU_ACTION_CREATE_DB.toString(), - NotionPageOrRecord.CHANGE_DATABASE_ACTION.toString(), + NotionPageOrRecord.CHANGE_SELECTION_ACTION.toString(), NotionPageOrRecord.OVERFLOW_CHANGE_TO_PAGE_ACTION.toString(), ]; @@ -847,7 +847,7 @@ export class ExecuteBlockActionHandler { break; } - case NotionPageOrRecord.CHANGE_DATABASE_ACTION: { + case NotionPageOrRecord.CHANGE_SELECTION_ACTION: { await handler.createNotionPageOrRecord(true); break; } diff --git a/src/handlers/ExecuteViewSubmitHandler.ts b/src/handlers/ExecuteViewSubmitHandler.ts index 05a9d5f..bd28b85 100644 --- a/src/handlers/ExecuteViewSubmitHandler.ts +++ b/src/handlers/ExecuteViewSubmitHandler.ts @@ -502,7 +502,7 @@ export class ExecuteViewSubmitHandler { ]; const { fields, url, pageId } = createdRecord; - message = `Created [**${title}**](${url}) in [**${databasename}**](${databaselink})`; + message = `Created a new record with title [**${title}**](${url}) in the database [**${databasename}**](${databaselink})`; const messageId = await sendMessageWithAttachments( this.read, diff --git a/src/modals/createPageOrRecordModal.ts b/src/modals/createPageOrRecordModal.ts index 2007d02..9ea2a8e 100644 --- a/src/modals/createPageOrRecordModal.ts +++ b/src/modals/createPageOrRecordModal.ts @@ -75,10 +75,10 @@ export async function createPageOrRecordModal( if (parent) { overFlowMenuText.unshift( - NotionPageOrRecord.CHANGE_DATABASE_TEXT.toString() + NotionPageOrRecord.CHANGE_SELECTION_TEXT.toString() ); overFlowMenuValue.unshift( - NotionPageOrRecord.CHANGE_DATABASE_ACTION.toString() + NotionPageOrRecord.CHANGE_SELECTION_ACTION.toString() ); } From 25109b15424b8552a921f6dffb47f0c90c8d6ea1 Mon Sep 17 00:00:00 2001 From: Zishan Ahmad Date: Fri, 2 Feb 2024 14:37:23 +0530 Subject: [PATCH 2/3] added help message to for notion view command --- enum/messages.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/enum/messages.ts b/enum/messages.ts index d25bbe6..dba610a 100644 --- a/enum/messages.ts +++ b/enum/messages.ts @@ -5,7 +5,8 @@ export enum Messages { • use \`/notion create\` to create subpage or record • use \`/notion create db\` to create database • use \`/notion workspace\` to change workspace - • use \`/notion share\` to share pages + • use \`/notion share\` to share pages + • use \`/notion view\` to view database content `, HELPER_TEXT = `Need some help with \`/notion\`?`, From 1acd7c508ee178210698e3bdf1e54b91fc68a257 Mon Sep 17 00:00:00 2001 From: Zishan Ahmad Date: Thu, 29 Feb 2024 19:57:36 +0530 Subject: [PATCH 3/3] changed subpage text back to page removed Parent Page text --- enum/messages.ts | 2 +- enum/modals/common/SearchPageAndDatabaseComponent.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/enum/messages.ts b/enum/messages.ts index dba610a..2338e31 100644 --- a/enum/messages.ts +++ b/enum/messages.ts @@ -2,7 +2,7 @@ export enum Messages { HELPER_COMMANDS = `• use \`/notion connect\` to connect your workspace • use \`/notion disconnect\` to disconnect workspace • use \`/notion comment\` to comment on notion page - • use \`/notion create\` to create subpage or record + • use \`/notion create\` to create page or record • use \`/notion create db\` to create database • use \`/notion workspace\` to change workspace • use \`/notion share\` to share pages diff --git a/enum/modals/common/SearchPageAndDatabaseComponent.ts b/enum/modals/common/SearchPageAndDatabaseComponent.ts index a371867..08aeeac 100644 --- a/enum/modals/common/SearchPageAndDatabaseComponent.ts +++ b/enum/modals/common/SearchPageAndDatabaseComponent.ts @@ -2,5 +2,5 @@ export enum SearchPageAndDatabase { PLACEHOLDER = "Select a Page or Database", BLOCK_ID = "search-page-and-database-component-block-id", ACTION_ID = "search-page-and-database-component-action-id", - LABEL = "Parent Page or Database Name *", + LABEL = "Page or Database Name *", }