-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[ Bug ] Removed emojis from the app #40
Merged
Merged
Changes from 8 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
9c67f0e
feat:removed emojis from the app
brf153 7f75205
feat:added conditional rendering of emojis for page and database
brf153 da8f382
fix:removed the 🚫 emoji along with page and database emoji from IPage…
brf153 af90315
fix:set default value of emoji to false
brf153 2a4ca7a
code cleaned
brf153 eed2116
fix:added emojis to the readme
brf153 56b7798
feat:removed emojis from getSelectDatabaseLayout
brf153 b7b34b7
enhance: added required changes
brf153 77d9103
fix:made the required changes
brf153 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change | ||
---|---|---|---|---|
|
@@ -218,15 +218,15 @@ export class ExecuteViewSubmitHandler { | |||
|
||||
if (response instanceof Error) { | ||||
this.app.getLogger().error(response); | ||||
message = `🚫 Something went wrong while creating Database in **${workspace_name}**.`; | ||||
message = `Something went wrong while creating Database in **${workspace_name}**.`; | ||||
|
||||
await sendNotification(this.read, this.modify, user, room, { | ||||
message: message, | ||||
}); | ||||
} else { | ||||
const name: string = response.name; | ||||
const link: string = response.link; | ||||
message = `✨ Your Database [**${name}**](${link}) is created successfully in **${workspace_name}**.`; | ||||
message = `Your Database [**${name}**](${link}) is created successfully in **${workspace_name}**.`; | ||||
|
||||
await sendNotificationWithAttachments( | ||||
this.read, | ||||
|
@@ -341,6 +341,7 @@ export class ExecuteViewSubmitHandler { | |||
const parentType: string = parent.type; | ||||
|
||||
if (parentType.includes(NotionObjectTypes.PAGE_ID)) { | ||||
|
||||
return this.handleCreationOfPage( | ||||
tokenInfo, | ||||
room, | ||||
|
@@ -349,7 +350,7 @@ export class ExecuteViewSubmitHandler { | |||
Objects as IPage | ||||
); | ||||
} | ||||
|
||||
return this.handleCreationOfRecord( | ||||
tokenInfo, | ||||
room, | ||||
|
@@ -384,10 +385,10 @@ export class ExecuteViewSubmitHandler { | |||
|
||||
if (createdPage instanceof Error) { | ||||
this.app.getLogger().error(createdPage.message); | ||||
message = `🚫 Something went wrong while creating page in **${workspace_name}**.`; | ||||
message = `Something went wrong while creating page in **${workspace_name}**.`; | ||||
} else { | ||||
const { name, link, title, pageId } = createdPage; | ||||
message = `✨ Your Page [**${title}**](${link}) is created successfully as a subpage in **${name}**.`; | ||||
message = `Your Page [**${title}**](${link}) is created successfully as a subpage in **${name}**.`; | ||||
|
||||
const preserveMessage = await modalInteraction.getInputElementState( | ||||
ActionButton.SEND_TO_NEW_PAGE_MESSAGE_ACTION | ||||
|
@@ -410,7 +411,7 @@ export class ExecuteViewSubmitHandler { | |||
|
||||
if (appendBlock instanceof Error) { | ||||
this.app.getLogger().error(appendBlock.message); | ||||
message = `🚫 Something went wrong while appending message in **${workspace_name}**.`; | ||||
message = `Something went wrong while appending message in **${workspace_name}**.`; | ||||
await sendNotification(this.read, this.modify, user, room, { | ||||
message, | ||||
}); | ||||
|
@@ -430,7 +431,7 @@ export class ExecuteViewSubmitHandler { | |||
)) as ICredential; | ||||
|
||||
const messageLink = `${siteUrl}/${urlPath}/${displayName}?msg=${id}`; | ||||
const preserveText = `📝 Created New Page [**${title}**](${link}) and Preserved Following [Message](${messageLink}) `; | ||||
const preserveText = `Created New Page [**${title}**](${link}) and Preserved Following [Message](${messageLink}) `; | ||||
|
||||
await sendMessage( | ||||
this.read, | ||||
|
@@ -487,21 +488,22 @@ export class ExecuteViewSubmitHandler { | |||
|
||||
if (createdRecord instanceof Error) { | ||||
this.app.getLogger().error(createdRecord.message); | ||||
message = `🚫 Something went wrong while creating record in **${workspace_name}**.`; | ||||
message = `Something went wrong while creating record in **${workspace_name}**.`; | ||||
await sendNotification(this.read, this.modify, user, room, { | ||||
message, | ||||
}); | ||||
} else { | ||||
const { info } = database; | ||||
const databasename = info.name; | ||||
const databasename = info.name.replace("📚 ", ""); | ||||
console.log("databaseName ", databasename) | ||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. remove console.log
Suggested change
|
||||
const databaselink = info.link; | ||||
const title: string = | ||||
state?.[NotionPageOrRecord.TITLE_BLOCK]?.[ | ||||
NotionPageOrRecord.TITLE_ACTION | ||||
]; | ||||
const { fields, url, pageId } = createdRecord; | ||||
|
||||
message = `✨ Created [**${title}**](${url}) in [**${databasename}**](${databaselink})`; | ||||
message = `Created [**${title}**](${url}) in [**${databasename}**](${databaselink})`; | ||||
|
||||
const messageId = await sendMessageWithAttachments( | ||||
this.read, | ||||
|
@@ -533,7 +535,7 @@ export class ExecuteViewSubmitHandler { | |||
|
||||
if (appendBlock instanceof Error) { | ||||
this.app.getLogger().error(appendBlock.message); | ||||
message = `🚫 Something went wrong while appending message in **${workspace_name}**.`; | ||||
message = `Something went wrong while appending message in **${workspace_name}**.`; | ||||
await sendNotification(this.read, this.modify, user, room, { | ||||
message, | ||||
}); | ||||
|
@@ -554,7 +556,7 @@ export class ExecuteViewSubmitHandler { | |||
)) as ICredential; | ||||
|
||||
const messageLink = `${siteUrl}/${urlPath}/${displayName}?msg=${id}`; | ||||
const preserveText = `📝 Created [**${title}**](${url}) Page and Preserved Following [Message](${messageLink}) `; | ||||
const preserveText = `Created [**${title}**](${url}) Page and Preserved Following [Message](${messageLink}) `; | ||||
|
||||
await sendMessage( | ||||
this.read, | ||||
|
@@ -814,7 +816,7 @@ export class ExecuteViewSubmitHandler { | |||
|
||||
const { name, parent, url } = pageInfo; | ||||
|
||||
const message = `✨ Sharing [**${name}**](${url}) from **${workspace_name}**`; | ||||
const message = `Sharing [**${name}**](${url}) from **${workspace_name}**`; | ||||
|
||||
await sendMessage(this.read, this.modify, user, room, { | ||||
message, | ||||
|
@@ -878,7 +880,7 @@ export class ExecuteViewSubmitHandler { | |||
|
||||
if (appendBlock instanceof Error) { | ||||
this.app.getLogger().error(appendBlock.message); | ||||
const message = `🚫 Something went wrong while appending message in **${workspace_name}**.`; | ||||
const message = `Something went wrong while appending message in **${workspace_name}**.`; | ||||
await sendNotification(this.read, this.modify, user, room, { | ||||
message, | ||||
}); | ||||
|
@@ -913,7 +915,7 @@ export class ExecuteViewSubmitHandler { | |||
)) as ICredential; | ||||
|
||||
const messageLink = `${siteUrl}/${urlPath}/${displayName}?msg=${id}`; | ||||
const preserveText = `📝 Preserved Following [Message](${messageLink}) in [**${name}**](${url}) `; | ||||
const preserveText = `Preserved Following [Message](${messageLink}) in [**${name}**](${url}) `; | ||||
|
||||
await sendMessage( | ||||
this.read, | ||||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -132,7 +132,7 @@ export class NotionSDK implements INotionSDK { | |||||
} | ||||||
} | ||||||
|
||||||
private async getPageObjectFromResults(item): Promise<IPage | null> { | ||||||
private async getPageObjectFromResults(item, emoji:boolean = false): Promise<IPage | null> { | ||||||
const typesWithTitleProperty = [ | ||||||
NotionObjectTypes.WORKSPACE.toString(), | ||||||
NotionObjectTypes.PAGE_ID.toString(), | ||||||
|
@@ -145,7 +145,7 @@ export class NotionSDK implements INotionSDK { | |||||
const pageName: string = | ||||||
properties.title.title[0]?.text?.content || | ||||||
NotionObjectTypes.UNTITLED; | ||||||
return this.returnPage(pageName, pageId); | ||||||
return this.returnPage(pageName, pageId, emoji); | ||||||
} | ||||||
|
||||||
// title property either be at first or last position | ||||||
|
@@ -161,7 +161,7 @@ export class NotionSDK implements INotionSDK { | |||||
const name: string = | ||||||
properties[firstColumn].title[0]?.text?.content || | ||||||
NotionObjectTypes.UNTITLED; | ||||||
return this.returnPage(name, pageId); | ||||||
return this.returnPage(name, pageId, emoji); | ||||||
} | ||||||
|
||||||
//title at last position and has subpage | ||||||
|
@@ -172,15 +172,15 @@ export class NotionSDK implements INotionSDK { | |||||
const name: string = | ||||||
properties[lastColumn].title[0]?.text?.content || | ||||||
NotionObjectTypes.UNTITLED; | ||||||
return this.returnPage(name, pageId); | ||||||
return this.returnPage(name, pageId, emoji); | ||||||
} | ||||||
|
||||||
return null; | ||||||
} | ||||||
|
||||||
private returnPage(name: string, page_id: string): IPage { | ||||||
private returnPage(name: string, page_id: string, emoji: boolean=false): IPage { | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
return { | ||||||
name: `📄 ${name}`, | ||||||
name: `${emoji ? "📄" : ""} ${name}`, | ||||||
parent: { | ||||||
type: NotionObjectTypes.PAGE_ID, | ||||||
page_id, | ||||||
|
@@ -520,15 +520,16 @@ export class NotionSDK implements INotionSDK { | |||||
const objectType: string = item?.[NotionObjectTypes.OBJECT]; | ||||||
if (objectType.includes(NotionObjectTypes.PAGE)) { | ||||||
const pageObject = await this.getPageObjectFromResults( | ||||||
item | ||||||
item, | ||||||
true | ||||||
); | ||||||
|
||||||
if (pageObject) { | ||||||
result.push(pageObject); | ||||||
} | ||||||
} else { | ||||||
const databaseObject = | ||||||
await this.getDatabaseObjectFromResults(item); | ||||||
await this.getDatabaseObjectFromResults(item, true); | ||||||
|
||||||
result.push(databaseObject); | ||||||
} | ||||||
|
@@ -540,7 +541,7 @@ export class NotionSDK implements INotionSDK { | |||||
} | ||||||
} | ||||||
|
||||||
private async getDatabaseObjectFromResults(item): Promise<IDatabase> { | ||||||
private async getDatabaseObjectFromResults(item, emoji:boolean = false): Promise<IDatabase> { | ||||||
const databaseNameTitleObject = item?.[NotionObjectTypes.TITLE]; | ||||||
const name: string = databaseNameTitleObject.length | ||||||
? databaseNameTitleObject[0]?.plain_text | ||||||
|
@@ -549,7 +550,7 @@ export class NotionSDK implements INotionSDK { | |||||
|
||||||
return { | ||||||
info: { | ||||||
name: `📚 ${name}`, | ||||||
name: `${emoji ? "📚":""} ${name}`, | ||||||
link: item?.url, | ||||||
}, | ||||||
parent: { | ||||||
|
@@ -565,8 +566,9 @@ export class NotionSDK implements INotionSDK { | |||||
prop: IPageProperties | ||||||
): Promise<(INotionPage & { pageId: string }) | Error> { | ||||||
try { | ||||||
const { name, parent } = page; | ||||||
const { parent } = page; | ||||||
const { title } = prop; | ||||||
const name = page.name.replace("📄", ""); | ||||||
|
||||||
const data = { | ||||||
parent, | ||||||
|
@@ -597,7 +599,7 @@ export class NotionSDK implements INotionSDK { | |||||
|
||||||
let result: INotionPage = { | ||||||
link: response?.data?.url, | ||||||
name, | ||||||
name: name, | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
title, | ||||||
}; | ||||||
|
||||||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should I add the emojis in the documentation?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yep, revert changes of docs.