-
Notifications
You must be signed in to change notification settings - Fork 25
Description
What do we need?
Note that actual Implementation may have changes to proposed
-
The
/notion createcommand will allow users to create a new record or page in their Notion workspace directly from the Rocket.Chat. This command simplifies the workflow for users who want to quickly create a new record or page without having to switch between different applications. -
When a user runs the
/notion createcommand from the Rocket.Chat message input field will open a modal having elements about what workspace the user is connected to, and the dropdown to search the page or database. A Title input field is the title of the database record or the title of the page. -
Now users will able to search for pages or databases from keywords and according to whether the selected search is page or database modal may be updated. let's talk about when the user selects the page by searching the page name once selected there will be no changes to the modal and the user can provide the title name and create the subpage inside the page.
-
Now in the case when the user will search for a database and selects database then the modal will be updated with the button Add Property which will be used to add the other fields in the database one by one.
-
Now, when the user selects the database it will have different types of notion property, mentioning some of them, which includes Date, Email, People, Phone Number, Select, Title, URL, MultiSelect and more of them can be handled by our uikit elements such as IInputElement, IStaticSelectElement, IMultiStaticElement, DatePicker, etc.
-
Now, When the user wants to add the property it will pressing the button Add Property will show the dropdown having the property name having the label name as Property. Now, for example, when the user selects the property of type Date, we will accordingly update the later element. The following is a glimpse of the same.
-
If the property within the database is left to add, the user every time will have two options.
- Add more Property
- Create a Record with the rest of them as empty fields.
-
If all the property has been added then the only option user will have is to Create a Record in this case we will update the modal to remove the Add Property Button having the state of the modal maintained.
-
The Implementation of the selecting page or db is mentioned in the later section to avoid the redundancy of text within each feature. We will be using a POST /search endpoint for the search of pages or databases. Now the payload contains a property to know whether it's a database or page based on it will update the modal to Add or Remove AddProperty button which can be achieved by updateSurfaceView by creating the replica of the modal with the same state and just adding or removing the button.
-
To get the property (columns) of the database we will be using Retrieve a database endpoint and now each time when the property has been added we will be removing that property from the dropdown by updating the modal. Also based on the type of property we will be creating the element which I mentioned above. Once the user press Create button we will show the message in the channel about the record that has been created with more info about the workspace and mention the name of who created that record.
-
For creating the page or record within the database we will be using Create a Page Endpoint. Furthermore, we will have a feature to remove already added properties within the modal by providing the button Remove below within each added property.
Acceptance Criteria
PR-1 #20
- Register
/notion createcommand - Create SearchPagesAndDatabases and CreatePage Method in NotionSDK
- Create Reusable method for SearchPageAndDatabaseComponent and getSelectDatabaseLayout
- Have Two Options in OverFlow Menu CreateDatabase and Change Database(Only when Database is selected)
- Handle creation of SubPage in specific page, and Update the Modal when there is selection Of Database.
Relevant ScreenShots
Further Comments
Metadata
Metadata
Assignees
Labels
Type
Projects
Status


