RocketChat / Apps.Notion

Integrating Notion with Rocket.Chat
https://github.com/Nabhag8848/Google-Summer-Of-Code
10 stars 16 forks source link

[Feat] Update Record in Notion Database #69

Open Nabhag8848 opened 4 months ago

Nabhag8848 commented 4 months ago

What do we need?

Acceptance Criteria

Relevant ScreenShots

Update Modal

Further Comments

Nabhag8848 commented 4 months ago

@Spiral-Memory Created this issue, and lemme know what are some issues we will we facing and edge cases i may have missed.

Spiral-Memory commented 4 months ago

Sure, @Nabhag8848 , I've reviewed the issue, and it seems interesting yet tricky to implement. I'll begin working on it soon and will keep you updated. Currently, I am building some prototypes to showcase for GSoC, and then I have to write proposals, so I might feel a bit slow. I will do my best to manage both. As you suggested, I will raise a PR and make incremental additions to it.

Spiral-Memory commented 4 months ago
  • we want to implement a button on the message that has been send on creation - update record particularly a message box action button which exist on every message. This button should only exist on that creation message.

Would it be an appropriate approach? I mean, suppose an organization created multiple records or performed other actions and every action will trigger notion to send some notification. Now, that particular message will be on top, and one has to scroll up and find that message to update it. What if the messages are pruned? A better approach, I think, would be to have some ID for each record, and one has to provide the ID for that command or consider some other approach. What do you think?

Spiral-Memory commented 4 months ago

Apart from that, I understand the rest of the requirements, and I am fine with them.

Nabhag8848 commented 4 months ago
  • we want to implement a button on the message that has been send on creation - update record particularly a message box action button which exist on every message. This button should only exist on that creation message.

Would it be an appropriate approach? I mean, suppose an organization created multiple records or performed other actions and every action will trigger notion to send some notification. Now, that particular message will be on top, and one has to scroll up and find that message to update it. What if the messages are pruned? A better approach, I think, would be to have some ID for each record, and one has to provide the ID for that command or consider some other approach. What do you think?

@Spiral-Memory

ps: this will make this feature more complex

Spiral-Memory commented 4 months ago

Hey @Nabhag8848 , I have one doubt. Suppose I made a modal where we have the option to choose a database to update. Now, consider that the user chose that database. Next, we have to show another dropdown to choose from all the records. Once that is chosen, we will fetch all the values in that record and then provide an option to update it. Is that the correct flow, right?

I have added the code to choose till database, will start working on fetching records and populating the dropdown dynamically soon.

Spiral-Memory commented 4 months ago
  • we want to implement a button on the message that has been send on creation - update record particularly a message box action button which exist on every message. This button should only exist on that creation message.

Would it be an appropriate approach? I mean, suppose an organization created multiple records or performed other actions and every action will trigger notion to send some notification. Now, that particular message will be on top, and one has to scroll up and find that message to update it. What if the messages are pruned? A better approach, I think, would be to have some ID for each record, and one has to provide the ID for that command or consider some other approach. What do you think?

@Spiral-Memory

  • I do had this in mind, great to see you catched but wanted to make it little easy for first version, and iterate over the solution which we would have but lemme share that too.
  • For Solving the issue for the creation message may get old and may have lost already in rooms or the message has been pruned.
  • I have Two Solution ideas:

1

  • we can create /notion update command where we have dropdown to select the DB and once DB is selected, we need to lock the Modal to not have the DB Dropdown (similar to when DB is selected in Create Record) and we dynamically generate Dropdown to select the Record which needs to updated, each dropdown option would name as there primary property - Title ( the first property which is usually unique is also the page or record name). Selecting That Would now Get the Modal With Elements with default Value.

2

  • When a link for Database Record Has been shared, we can preview them with the fields - similar to ClickUp app video i shared, they are doing this - But this is little odd solution, its cool but we need to go to notion to get that link which is not so cool.
  • How should we approach ?

ps: this will make this feature more complex

I think, I will prefer to go with approach 1 or maybe later to make it more accessible we can implement approach 2 sparingly

Nabhag8848 commented 4 months ago
  • we want to implement a button on the message that has been send on creation - update record particularly a message box action button which exist on every message. This button should only exist on that creation message.

Would it be an appropriate approach? I mean, suppose an organization created multiple records or performed other actions and every action will trigger notion to send some notification. Now, that particular message will be on top, and one has to scroll up and find that message to update it. What if the messages are pruned? A better approach, I think, would be to have some ID for each record, and one has to provide the ID for that command or consider some other approach. What do you think?

@Spiral-Memory

  • I do had this in mind, great to see you catched but wanted to make it little easy for first version, and iterate over the solution which we would have but lemme share that too.
  • For Solving the issue for the creation message may get old and may have lost already in rooms or the message has been pruned.
  • I have Two Solution ideas:

1

  • we can create /notion update command where we have dropdown to select the DB and once DB is selected, we need to lock the Modal to not have the DB Dropdown (similar to when DB is selected in Create Record) and we dynamically generate Dropdown to select the Record which needs to updated, each dropdown option would name as there primary property - Title ( the first property which is usually unique is also the page or record name). Selecting That Would now Get the Modal With Elements with default Value.

2

  • When a link for Database Record Has been shared, we can preview them with the fields - similar to ClickUp app video i shared, they are doing this - But this is little odd solution, its cool but we need to go to notion to get that link which is not so cool.
  • How should we approach ?

ps: this will make this feature more complex

I think, I will prefer to go with approach 1 or maybe later to make it more accessible we can implement approach 2 sparingly

@Spiral-Memory can we have a first version without this complexity ? Just don't handle any of 2. Just have a message box action and open the modal having that record info directly with elements - No db and record selection.

Spiral-Memory commented 4 months ago
  • we want to implement a button on the message that has been send on creation - update record particularly a message box action button which exist on every message. This button should only exist on that creation message.

Would it be an appropriate approach? I mean, suppose an organization created multiple records or performed other actions and every action will trigger notion to send some notification. Now, that particular message will be on top, and one has to scroll up and find that message to update it. What if the messages are pruned? A better approach, I think, would be to have some ID for each record, and one has to provide the ID for that command or consider some other approach. What do you think?

@Spiral-Memory

  • I do had this in mind, great to see you catched but wanted to make it little easy for first version, and iterate over the solution which we would have but lemme share that too.
  • For Solving the issue for the creation message may get old and may have lost already in rooms or the message has been pruned.
  • I have Two Solution ideas:

1

  • we can create /notion update command where we have dropdown to select the DB and once DB is selected, we need to lock the Modal to not have the DB Dropdown (similar to when DB is selected in Create Record) and we dynamically generate Dropdown to select the Record which needs to updated, each dropdown option would name as there primary property - Title ( the first property which is usually unique is also the page or record name). Selecting That Would now Get the Modal With Elements with default Value.

2

  • When a link for Database Record Has been shared, we can preview them with the fields - similar to ClickUp app video i shared, they are doing this - But this is little odd solution, its cool but we need to go to notion to get that link which is not so cool.
  • How should we approach ?

ps: this will make this feature more complex

I think, I will prefer to go with approach 1 or maybe later to make it more accessible we can implement approach 2 sparingly

@Spiral-Memory can we have a first version without this complexity ? Just don't handle any of 2. Just have a message box action and open the modal having that record info directly with elements - No db and record selection.

  • We will Iterate Over after it, Lets divide into small chunks.

Actually @Nabhag8848 I have already made it till this point of selecting DB then updating that modal for record, it wasn't very complex.. Since we have time, I will go slowly and commit in the draft. Later we can do iterations to rather focus on improving it.

N no worries, I'm working in small chunks only ๐Ÿ˜ƒ..

Nabhag8848 commented 4 months ago
  • we want to implement a button on the message that has been send on creation - update record particularly a message box action button which exist on every message. This button should only exist on that creation message.

Would it be an appropriate approach? I mean, suppose an organization created multiple records or performed other actions and every action will trigger notion to send some notification. Now, that particular message will be on top, and one has to scroll up and find that message to update it. What if the messages are pruned? A better approach, I think, would be to have some ID for each record, and one has to provide the ID for that command or consider some other approach. What do you think?

@Spiral-Memory

  • I do had this in mind, great to see you catched but wanted to make it little easy for first version, and iterate over the solution which we would have but lemme share that too.
  • For Solving the issue for the creation message may get old and may have lost already in rooms or the message has been pruned.
  • I have Two Solution ideas:

1

  • we can create /notion update command where we have dropdown to select the DB and once DB is selected, we need to lock the Modal to not have the DB Dropdown (similar to when DB is selected in Create Record) and we dynamically generate Dropdown to select the Record which needs to updated, each dropdown option would name as there primary property - Title ( the first property which is usually unique is also the page or record name). Selecting That Would now Get the Modal With Elements with default Value.

2

  • When a link for Database Record Has been shared, we can preview them with the fields - similar to ClickUp app video i shared, they are doing this - But this is little odd solution, its cool but we need to go to notion to get that link which is not so cool.
  • How should we approach ?

ps: this will make this feature more complex

I think, I will prefer to go with approach 1 or maybe later to make it more accessible we can implement approach 2 sparingly

@Spiral-Memory can we have a first version without this complexity ? Just don't handle any of 2. Just have a message box action and open the modal having that record info directly with elements - No db and record selection.

  • We will Iterate Over after it, Lets divide into small chunks.

Actually @Nabhag8848 I have already made it till this point of selecting DB then updating that modal for record, it wasn't very complex.. Since we have time, I will go slowly and commit in the draft. Later we can do iterations to rather focus on improving it.

N no worries, I'm working in small chunks only ๐Ÿ˜ƒ..

Spiral-Memory commented 4 months ago

Yes for sure ! ๐Ÿ˜ƒ

Spiral-Memory commented 3 months ago

Started working on this again ...