raycast / extensions

Everything you need to extend Raycast.
https://developers.raycast.com
MIT License
5.3k stars 2.98k forks source link

Notion - Customize form for CreateDatabaseForm deeplink command #11160

Closed dariuszpaluch closed 6 months ago

dariuszpaluch commented 7 months ago

Extension

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

Description

Problems

Feature

Create deeplink for CreatePageForm command, but with adjustments like:

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:

Anything else?

src/forms/CreatePageForm.tsx

raycastbot commented 7 months ago

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.
erics118 commented 7 months ago

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

dariuszpaluch commented 7 months ago

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

erics118 commented 7 months ago

Yep, see #9212

dariuszpaluch commented 7 months ago

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

dariuszpaluch commented 6 months ago

@erics118 My pr has been merged