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

COM-357: Add support for additional content in DAM grid rows #1697

Closed
wants to merge 1 commit into from

Conversation

johnnyomair
Copy link
Collaborator

We need this for the "External DAM systems" feature to show the import source in the grid.


DAM grid row additional content

We need this for the "External DAM systems" feature to show the import source in the grid.
@johnnyomair johnnyomair self-assigned this Feb 14, 2024
Comment on lines 10 to +11
additionalToolbarItems?: React.ReactNode;
renderAdditionalRowContent?: (row: DamRow) => React.ReactNode;
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I decided to add the render prefix because this is a render prop. However, it's kinda odd that additionalToolbarItems isn't a render prop. What do you think?

Copy link
Member

Choose a reason for hiding this comment

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

yes, they could both use the same technique

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

What do we prefer? We currently have three different techniques in our code base:

yes, they could both use the same technique

I can't really use ReactNode here for both cases because I need to pass row

Copy link
Member

Choose a reason for hiding this comment

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

what is the difference between the first two?

@@ -51,6 +51,7 @@ export { useDamConfig } from "./dam/config/useDamConfig";
export { useCurrentDamFolder } from "./dam/CurrentDamFolderProvider";
export { DamPage } from "./dam/DamPage";
export { useDamFileUpload } from "./dam/DataGrid/fileUpload/useDamFileUpload";
export type { DamRow } from "./dam/DataGrid/FolderDataGrid";
Copy link
Member

Choose a reason for hiding this comment

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

imho that name is too generic (for a public export)

DamRowFragment? DamRowData?

Copy link
Collaborator Author

@johnnyomair johnnyomair Feb 20, 2024

Choose a reason for hiding this comment

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

Maybe DamGridItem or DamGridRow?

Copy link
Member

Choose a reason for hiding this comment

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

it's data structure (that contains just the data) vs. component (that renders it)

usually our exports are components, so I could think DamGridRow is also a component

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I could simply re-export the generated GraphQL type without a renaming, what do you think?

Copy link
Member

Choose a reason for hiding this comment

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

The reason why you add it to the public api is, because it gets passed in renderAdditionalRowContent render prop.

final-form names the arguments passed to a render function eg FieldRenderProps, maybe you could use AdditionalRowContentRenderProps accordingly?

@nsams
Copy link
Member

nsams commented Feb 19, 2024

Did you also consider additional columns?

@johnnyomair
Copy link
Collaborator Author

Did you also consider additional columns?

No I haven't. I believe it will increase complexity even more than the additional content 🤔

@nsams
Copy link
Member

nsams commented Feb 20, 2024

I believe it will increase complexity even more than the additional content

well, the resulting UI should usually not depend on how complex it was to implement :)

@johnnyomair
Copy link
Collaborator Author

well, the resulting UI should usually not depend on how complex it was to implement :)

You're right, I've asked UX about it and will update the PR depending on the outcome.

@johnnyomair
Copy link
Collaborator Author

Superseded by #1756.

@johnnyomair johnnyomair deleted the COM-357-show-dam-import-source-in-row branch February 27, 2024 09:09
johnnyomair added a commit that referenced this pull request Feb 28, 2024
The import source column is only shown if `importSources` is provided
via `DamConfigProvider`. This is done to not show the column if no
external DAMs are supported.

---

<img width="1304" alt="image"
src="https://github.com/vivid-planet/comet/assets/48853629/33e9fb39-49a3-429b-bea5-082c7f9d8bdd">

- [x] Add changeset (if necessary)

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

Successfully merging this pull request may close these issues.

2 participants