extensions icon indicating copy to clipboard operation
extensions copied to clipboard

Notion - Customize form for CreateDatabaseForm deeplink command

Open dariuszpaluch opened this issue 2 years ago • 6 comments

Extension

https://www.raycast.com/notion/notion

Description

Problems

  • Notion API has a lot of limitations like database properties order, so we couldn't set specific order of properties in Notion and see the same in CreatePageForm form.
  • Users are using Raycast instead of Notion, to save something quickly. For that I propose make notion form clean and simple with hide optional fields (optional properties for database), hide fields with default values in quicklinks, change order of fields.

Feature

Create deeplink for CreatePageForm command, but with adjustments like:

  • change order of fields
  • show/hide fields (then we an hide fields with default values in deeplink)

I saw these code in CreatePageForm.tsx

  {databaseView && setDatabaseView ? (
    <ActionPanel.Section title="View options">
      <ActionSetVisibleProperties
        databaseProperties={databaseProperties?.filter((dp) => dp.id !== "title") || []}
        selectedPropertiesIds={databaseView?.create_properties || databaseProperties.map((x) => x.id)}
        onSelect={(propertyId) => {
          setDatabaseView({
            ...databaseView,
            create_properties: databaseView.create_properties
              ? [...databaseView.create_properties, propertyId]
              : [propertyId],
          });
        }}
        onUnselect={(propertyId) => {
          setDatabaseView({
            ...databaseView,
            create_properties: databaseView.create_properties?.filter((pid) => pid !== propertyId),
          });
        }}
      />
    </ActionPanel.Section>
  ) : null}

but I couldn't find where databaseView will be initialize first time. I think every time will be null or maybe I miss something? I propose to fix this "View options" select and add something similar for change order of fields in the form.

Who will benefit from this feature?

Users who use notion databases like:

  • shopping list
  • tasks
  • reminders ...

Anything else?

src/forms/CreatePageForm.tsx

dariuszpaluch avatar Mar 07 '24 16:03 dariuszpaluch

Thank you for opening this issue!

🔔 @HenriChabrand @mathieudutour @metakirby5 @thomaslombart @erics118 @bkeys818 @AlexIsMaking @Yakitrak @tleo19 you might want to have a look.

💡 Author and Contributors commands

The author and contributors of notion/notion can trigger bot actions by commenting:

  • @raycastbot close this issue Closes the issue.
  • @raycastbot rename this issue to "Awesome new title" Renames the issue.
  • @raycastbot reopen this issue Reopen the issue.

raycastbot avatar Mar 07 '24 16:03 raycastbot

I had a PR for this, but I never got around finishing it.

erics118 avatar Mar 07 '24 16:03 erics118

@erics118 I'd love to see it and maybe try to help

dariuszpaluch avatar Mar 07 '24 18:03 dariuszpaluch

Yep, see #9212

erics118 avatar Mar 07 '24 19:03 erics118

@erics118 I have a slightly different idea. I created PR here https://github.com/raycast/extensions/pull/11178

dariuszpaluch avatar Mar 08 '24 17:03 dariuszpaluch

@erics118 My pr has been merged

dariuszpaluch avatar Mar 22 '24 19:03 dariuszpaluch