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

Admin Generator (Future): Allow adding custom grid actions #1913

Merged
merged 8 commits into from
Aug 22, 2024

Conversation

jamesricky
Copy link
Contributor


PR Checklist

  • Verify if the change requires a changeset. See CONTRIBUTING.md
  • Link to the respective task if one exists: SVK-211
  • Provide screenshots/screencasts if the change contains visual changes
Custom.Grid.Actions.-.View.Product.Details.mov

@jamesricky jamesricky requested review from nsams and johnnyomair April 3, 2024 08:39
@jamesricky jamesricky self-assigned this Apr 3, 2024
@nsams
Copy link
Member

nsams commented Apr 9, 2024

oh, and have you considered https://mui.com/x/react-data-grid/column-definition/#special-properties type: "actions" insted of our actions component?

@jamesricky
Copy link
Contributor Author

oh, and have you considered https://mui.com/x/react-data-grid/column-definition/#special-properties type: "actions" insted of our actions component?

No, good point.

It seems like it could make sense to use this internally, but then we'd need to allow an array of component-imports as getActions() expects an array of individual action-components.
The current approach (in this PR) only needs a single component-import, as that can be a component with multiple actions.
A setting for the width would also still be needed.

@nsams
Copy link
Member

nsams commented Apr 15, 2024

but then we'd need to allow an array of component-imports as getActions() expects an array of individual action-components.

Yes, why not, it's always a good idea to stay close to MUI api

@jamesricky
Copy link
Contributor Author

but then we'd need to allow an array of component-imports as getActions() expects an array of individual action-components.

Yes, why not, it's always a good idea to stay close to MUI api

If we would simply import and pass in a react component, like the MUI api expects I would agree.
In the generator however we need configuration for every component to import.
Since the configuration is just strings (name, import), the IDE doesn't know to check if the file or the component exists.
I think it would be good to avoid this kind of error-prone/non-autocompleted configuration as much as possible, that's why I'd prefer a single import with one component that has multiple IconButtons.

@jamesricky jamesricky requested a review from nsams May 6, 2024 15:27
@jamesricky jamesricky marked this pull request as draft May 8, 2024 12:19
@jamesricky
Copy link
Contributor Author

Setting this to "Draft" for now, until #2044 is approved.

@jamesricky jamesricky force-pushed the admin-generator-custom-grid-actions branch from 114cabc to 9319d00 Compare May 24, 2024 08:10
@jamesricky jamesricky marked this pull request as ready for review May 24, 2024 12:20
@auto-assign auto-assign bot requested a review from johnnyomair May 24, 2024 12:20
nsams
nsams previously approved these changes May 24, 2024
@jamesricky jamesricky requested a review from nsams May 27, 2024 09:54
nsams
nsams previously approved these changes Jun 4, 2024
@jamesricky jamesricky force-pushed the admin-generator-custom-grid-actions branch from f68b49d to 27a8377 Compare August 5, 2024 14:32
@jamesricky jamesricky requested review from johnnyomair and nsams August 5, 2024 15:48
@jamesricky jamesricky requested a review from johnnyomair August 12, 2024 07:17
johnnyomair
johnnyomair previously approved these changes Aug 13, 2024
Copy link
Collaborator

@johnnyomair johnnyomair left a comment

Choose a reason for hiding this comment

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

LGTM. Please wait for @nsams review though.

@thomasdax98 thomasdax98 removed their request for review August 22, 2024 09:15
@thomasdax98 thomasdax98 merged commit b7646db into main Aug 22, 2024
11 checks passed
@thomasdax98 thomasdax98 deleted the admin-generator-custom-grid-actions branch August 22, 2024 09:16
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.

4 participants