Skip to content
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 9 commits into from
Jan 31, 2024
Merged

Conversation

brf153
Copy link
Contributor

@brf153 brf153 commented Jan 19, 2024

Issue(s)

closes #37

Acceptance Criteria fulfillment

  • Reported the emojis in the issue section
  • Removed the emojis from the code

Proposed changes (including videos or screenshots)

WhatsApp.Video.2024-01-19.at.19.14.29.mp4

Further comments

@Nabhag8848 I could not get the code for the "more" dropdown menu.
Screenshot from 2024-01-19 19-02-16

@Nabhag8848
Copy link
Collaborator

Nabhag8848 commented Jan 19, 2024

Find it here
https://github.com/RocketChat/Apps.Notion/blob/main/i18n%2Fen.json

@brf153
learn about how apps uses i18n translation.

Can you open up the Modal
/notion create db
and see the dropdown if there are no emojis fix that cause we need there to differentiate between page and db.

@brf153
Copy link
Contributor Author

brf153 commented Jan 19, 2024

@Nabhag8848 I have removed the emojis from the i18n files. Still the emoji is there in the menu dropdown

@Nabhag8848
Copy link
Collaborator

@Nabhag8848 I have removed the emojis from the i18n files. Still the emoji is there in the menu dropdown

Refresh Rocketchat it will not show up anymore.

@brf153
Copy link
Contributor Author

brf153 commented Jan 19, 2024

Screenshot from 2024-01-19 19-37-09
Screenshot from 2024-01-19 19-37-02

@brf153
Copy link
Contributor Author

brf153 commented Jan 19, 2024

@Nabhag8848 I have removed the emojis from the i18n files. Still the emoji is there in the menu dropdown

Refresh Rocketchat it will not show up anymore.

Yeah my bad it is not showing after refreshing the page.
Screenshot from 2024-01-19 19-38-06

@brf153
Copy link
Contributor Author

brf153 commented Jan 19, 2024

I think I have removed all the emojis

@Nabhag8848
Copy link
Collaborator

Find it here
https://github.com/RocketChat/Apps.Notion/blob/main/i18n%2Fen.json

@brf153
learn about how apps uses i18n translation.

Can you open up the Modal
/notion create db
and see the dropdown if there are no emojis fix that cause we need there to differentiate between page and db.

edited this check: i meant
/notion create

@brf153
Copy link
Contributor Author

brf153 commented Jan 19, 2024

Screenshot from 2024-01-19 19-39-55
Screenshot from 2024-01-19 19-39-50

@brf153
Copy link
Contributor Author

brf153 commented Jan 19, 2024

see the dropdown if there are no emojis fix that cause we need there to differentiate between page and db. I did not get this line.

@Nabhag8848
Copy link
Collaborator

Nabhag8848 commented Jan 19, 2024

see the dropdown if there are no emojis fix that cause we need there to differentiate between page and db. I did not get this line.

Feature 5 under Demo:

https://github.com/Nabhag8848/Google-Summer-of-Code

See those two videos on that same modal when we select Page, Modal doesn't change to include other components as when we select page it is meant to create subpage within notion but in case when we select db ( option with pile of books 📚 it will update the modal to include other components as it this time it is meant to create record or row in a notion table.

if there are no emojis how we can differentiate if its a table or page? thats the issue.

@brf153
Copy link
Contributor Author

brf153 commented Jan 19, 2024

Oki so, should I add the page emoji in front of pages and books emoji in front of database?

@Nabhag8848
Copy link
Collaborator

Oki so, should I add the page emoji in front of pages and books emoji in front of database?

#37 (comment)

@brf153
Copy link
Contributor Author

brf153 commented Jan 19, 2024

@Nabhag8848 I have added emoji:boolean in the function which will check whether the emoji needs to be rendered or not
Screenshot from 2024-01-19 20-10-27
Screenshot from 2024-01-19 20-10-09

@brf153
Copy link
Contributor Author

brf153 commented Jan 21, 2024

@Nabhag8848 is something left to be done?

@Nabhag8848
Copy link
Collaborator

@Nabhag8848 is something left to be done?

Will review and test on my end and will let you know.

@brf153
Copy link
Contributor Author

brf153 commented Jan 21, 2024

Oki

@Nabhag8848
Copy link
Collaborator

Nabhag8848 commented Jan 23, 2024

@brf153
Some breaking changes:

  • When Selecting Database in /notion create We are showing Emojis in layout: remove that.
Fix2
  • Missed out 🚫 under /enum/OAuth2.ts and /src/handlers/ExecuteViewSubmitHandler.ts, just search "🚫" under IDE, Note: we don't need to remove it from webhook.ts folder as it is for AuthTemplate.

@brf153
Copy link
Contributor Author

brf153 commented Jan 23, 2024

@Nabhag8848 I will fix this right now

Copy link
Collaborator

@Nabhag8848 Nabhag8848 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Made Some Changes Comments.

README.md Outdated
Copy link
Collaborator

@Nabhag8848 Nabhag8848 Jan 23, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • oops, i believe you removed from documentation which is not needed.

Copy link
Contributor Author

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?

Copy link
Collaborator

@Nabhag8848 Nabhag8848 Jan 23, 2024

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.

enum/OAuth2.ts Outdated
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!`,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove 🚫

@@ -113,7 +113,7 @@ export class WebHookEndpoint extends ApiEndpoint {
const successTemplate = getAuthPageTemplate(
"Connected to Workspace",
OAuth2Content.success,
`👋 Connected to ${response.workspace_name}❗`,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add 👋 as it is AuthPageTemplate as we discussed earlier.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oki

@@ -387,7 +387,7 @@ export class ExecuteViewSubmitHandler {
message = `🚫 Something went wrong while creating page in **${workspace_name}**.`;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove 🚫. there are several others in same file remove all of them.

Copy link
Contributor Author

Choose a reason for hiding this comment

The 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 "🚫"

}

return null;
}

private returnPage(name: string, page_id: string): IPage {
private returnPage(name: string, page_id: string, emoji: boolean): IPage {
Copy link
Collaborator

Choose a reason for hiding this comment

The 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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oki

@@ -540,7 +541,7 @@ export class NotionSDK implements INotionSDK {
}
}

private async getDatabaseObjectFromResults(item): Promise<IDatabase> {
private async getDatabaseObjectFromResults(item, emoji:boolean): Promise<IDatabase> {
Copy link
Collaborator

Choose a reason for hiding this comment

The 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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oki

… and IDatabase in createPage and createRecord

Signed-off-by: brf153 <[email protected]>
Signed-off-by: brf153 <[email protected]>
@brf153
Copy link
Contributor Author

brf153 commented Jan 23, 2024

@Nabhag8848 I have made the changes

@brf153
Copy link
Contributor Author

brf153 commented Jan 23, 2024

@Nabhag8848

WhatsApp.Video.2024-01-23.at.13.32.46.mp4

@brf153 brf153 requested a review from Nabhag8848 January 23, 2024 08:35
@brf153
Copy link
Contributor Author

brf153 commented Jan 23, 2024

Screenshot from 2024-01-23 14-12-14
in this pic, I am also removing the emoji
Screenshot from 2024-01-23 14-12-55

@brf153
Copy link
Contributor Author

brf153 commented Jan 23, 2024

I have made the changes
Screenshot from 2024-01-23 14-36-23

Comment on lines 467 to 473
const newDatabase = {
...database,
info: {
name: database.info.name.replace("📚 ",""),
link: database.info.link,
},
}
Copy link
Collaborator

@Nabhag8848 Nabhag8848 Jan 25, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe, you overriding this due to when sending message to channel it was showing 📚. can't directly we can have const databasename = info.name.replace("📚",""); in line 504. mention below. so we don't need to have this newDatabase object

Suggested change
const newDatabase = {
...database,
info: {
name: database.info.name.replace("📚 ",""),
link: database.info.link,
},
}

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, that is better. I am making the changes.

await sendNotification(this.read, this.modify, user, room, {
message,
});
} else {
const { info } = database;
const { info } = newDatabase;
const databasename = info.name;
Copy link
Collaborator

@Nabhag8848 Nabhag8848 Jan 25, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here, as i mentioned above.

Suggested change
const databasename = info.name;
const databasename = info.name.replace("📚 ","");

@@ -15,6 +15,7 @@ export function getSelectDatabaseLayout(

const database_name = properties.name;
const database_url = properties.link;
const databaseNameWithoutEmoji = database_name.replace("📚 ", "")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can directly replace emoji in database_name variable to avoid creating new variable.

line 16: const database_name = properties.name.replace("📚 ", "");
Suggested change
const databaseNameWithoutEmoji = database_name.replace("📚 ", "")

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My bad

@@ -989,7 +991,8 @@ export class NotionSDK implements INotionSDK {

const pageInfo = response.data;
const page = (await this.getPageObjectFromResults(
pageInfo
pageInfo,
false
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Previously we made a emoji param default value false so that we don't need to pass it when its false, remove from every calls where it is false. there are at several other places.
Suggested change
false

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oki making the changes

@@ -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> {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As you are making changes in this file with suggestions, make a indentation with other methods too which has default value of emoji.

Suggested change
private async getPageObjectFromResults(item, emoji:boolean=false): Promise<IPage | null> {
private async getPageObjectFromResults(item, emoji:boolean = false): Promise<IPage | null> {

Comment on lines 569 to 571
const { name, parent } = page;
const { title } = prop;
const nameWithoutEmoji = name.replace("📄", "");
Copy link
Collaborator

@Nabhag8848 Nabhag8848 Jan 25, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we can avoid long variable name here, make neccessary changes which would affect this below.

Suggested change
const { name, parent } = page;
const { title } = prop;
const nameWithoutEmoji = name.replace("📄", "");
const { parent } = page;
const { title } = prop;
const name = page.name.replace("📄", "");

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oki

Copy link
Collaborator

@Nabhag8848 Nabhag8848 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@brf153 Good work! Few More Changes, Hope those comments help you in future PRs.

@brf153
Copy link
Contributor Author

brf153 commented Jan 25, 2024

@Nabhag8848 Thank you for your detailed feedback and comments! I appreciate the guidance, and I'll make sure to incorporate these changes in my future PRs. Also, I have made the required changes.

@brf153 brf153 requested a review from Nabhag8848 January 25, 2024 08:01
Copy link
Collaborator

@Nabhag8848 Nabhag8848 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @brf153 remove console.log, and follow along other comments.

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)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove console.log

Suggested change
console.log("databaseName ", databasename)

}

return null;
}

private returnPage(name: string, page_id: string): IPage {
private returnPage(name: string, page_id: string, emoji: boolean=false): IPage {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
private returnPage(name: string, page_id: string, emoji: boolean=false): IPage {
private returnPage(name: string, page_id: string, emoji: boolean = false): IPage {

@@ -597,7 +599,7 @@ export class NotionSDK implements INotionSDK {

let result: INotionPage = {
link: response?.data?.url,
name,
name: name,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
name: name,
name,

@brf153
Copy link
Contributor Author

brf153 commented Jan 27, 2024

@Nabhag8848 made the changes

@brf153 brf153 requested a review from Nabhag8848 January 27, 2024 07:31
Copy link
Collaborator

@Nabhag8848 Nabhag8848 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM @brf153 !! 🚀

@Nabhag8848 Nabhag8848 changed the title [ Feat ]: Removed emojis from the app [ Bug ] Removed emojis from the app Jan 31, 2024
@Nabhag8848 Nabhag8848 merged commit 3c32921 into RocketChat:main Jan 31, 2024
1 check passed
@Spiral-Memory
Copy link
Contributor

Spiral-Memory commented Feb 2, 2024

Hey @brf153 , I am not sure what is causing it, but after this merge has been completed, I am noticing a thin line over the dropdown that is flickering while typing something. I'm not sure what is causing this issue. I saw your code, and I wasn't able to figure out what is causing the issue, so I am just letting you know that this is happening. If you can figure out what might be causing it, you can fix it. I tried reverting your changes and then that thin line disappeared, so i feel some changes might be causing this.

Note: I am experiencing the issue only in Microsoft Edge browser in Ubuntu 22.0, I tried using other browsers, and it was working fine. However after reverting the commit, in Edge also, there is no such line.

Screenshot from 2024-02-02 13-34-46

@brf153
Copy link
Contributor Author

brf153 commented Feb 2, 2024

@Spiral-Memory I don't have it bro
Screenshot from 2024-02-02 14-27-27

@Spiral-Memory
Copy link
Contributor

Can you check it in dark mode in the Microsoft edge browser ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

[Bug] Remove Emojis From Markdown Text including message option
3 participants