-
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
Changes from 2 commits
9c67f0e
7f75205
da8f382
af90315
2a4ca7a
eed2116
56b7798
b7b34b7
77d9103
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,8 +8,8 @@ export enum OAuth2Locator { | |
export enum OAuth2Content { | ||
success = "https://github-production-user-asset-6210df.s3.amazonaws.com/65061890/243671111-9964efff-3b23-4223-aadd-5f4be441037c.svg", | ||
failed = "https://open.rocket.chat/assets/logo.png", | ||
NOT_CONNECTED_MESSAGE = `👋 You are not connected to **Workspace**!`, | ||
NOT_CONNECTED_MESSAGE_WITH_INFO = `👋 Connect to workspace to access \`pages\` & \`database\``, | ||
NOT_CONNECTED_MESSAGE = `You are not connected to **Workspace**!`, | ||
NOT_CONNECTED_MESSAGE_WITH_INFO = `Connect to workspace to access \`pages\` & \`database\``, | ||
CONNECT_TO_WORKSPACE = "Connect to Workspace", | ||
CREDENTIALS_MISSING_USER = `🚫 Something Went Wrong, Please Contact the Admin!`, | ||
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 🚫 |
||
CREDENTIALS_MISSING_ADMIN = `Please Configure the App and Ensure the \`SiteUrl\` is correct in the Server Settings. | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -113,7 +113,7 @@ export class WebHookEndpoint extends ApiEndpoint { | |
const successTemplate = getAuthPageTemplate( | ||
"Connected to Workspace", | ||
OAuth2Content.success, | ||
`👋 Connected to ${response.workspace_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. Add 👋 as it is AuthPageTemplate as we discussed earlier. 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. oki |
||
`Connected to ${response.workspace_name}❗`, | ||
"YOU CAN NOW CLOSE THIS WINDOW" | ||
); | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -226,7 +226,7 @@ export class ExecuteViewSubmitHandler { | |
} 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, | ||
|
@@ -387,7 +387,7 @@ export class ExecuteViewSubmitHandler { | |
message = `🚫 Something went wrong while creating page in **${workspace_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. Remove 🚫. there are several others in same file remove all of them. 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. I will try to remove it from wherever it is required. I don't know why but my vs code search does not show any data when I search for "🚫" |
||
} 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 | ||
|
@@ -430,7 +430,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, | ||
|
@@ -501,7 +501,7 @@ export class ExecuteViewSubmitHandler { | |
]; | ||
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, | ||
|
@@ -554,7 +554,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 +814,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, | ||
|
@@ -913,7 +913,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, | ||
|
Original file line number | Diff line number | Diff line change | ||
---|---|---|---|---|
|
@@ -120,7 +120,7 @@ export class NotionSDK implements INotionSDK { | |||
|
||||
const result: Array<IPage> = []; | ||||
results.forEach(async (item) => { | ||||
const pageObject = await this.getPageObjectFromResults(item); | ||||
const pageObject = await this.getPageObjectFromResults(item, false); | ||||
if (pageObject) { | ||||
result.push(pageObject); | ||||
} | ||||
|
@@ -132,7 +132,7 @@ export class NotionSDK implements INotionSDK { | |||
} | ||||
} | ||||
|
||||
private async getPageObjectFromResults(item): Promise<IPage | null> { | ||||
private async getPageObjectFromResults(item, emoji): 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): 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. can we make emoji parameter default value as false to avoid passing when we don't need emojis. 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. oki |
||||
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): Promise<IDatabase> { | ||||
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. Same here: Emoji default value as false and make necessary changes whereever you are calling this function. 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. oki |
||||
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: { | ||||
|
@@ -989,7 +990,8 @@ export class NotionSDK implements INotionSDK { | |||
|
||||
const pageInfo = response.data; | ||||
const page = (await this.getPageObjectFromResults( | ||||
pageInfo | ||||
pageInfo, | ||||
false | ||||
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
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. Oki making the changes |
||||
)) as IPage; | ||||
const url: string = pageInfo?.url; | ||||
|
||||
|
@@ -1089,7 +1091,8 @@ export class NotionSDK implements INotionSDK { | |||
results.forEach(async (item) => { | ||||
const objectType: string = item?.[NotionObjectTypes.OBJECT]; | ||||
const databaseObject = await this.getDatabaseObjectFromResults( | ||||
item | ||||
item, | ||||
false | ||||
); | ||||
|
||||
result.push(databaseObject); | ||||
|
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.