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

Allow plugins to override tables #1093

Merged
merged 4 commits into from
May 25, 2023
Merged

Allow plugins to override tables #1093

merged 4 commits into from
May 25, 2023

Conversation

joaquimrocha
Copy link
Collaborator

This PR adds the changes and an example plugin on modifying existing tables throughout Headlamp.
The way this is done is by having ResourceTables identified with a new ID (or automatically done when they receive the resourceClass argument) and then plugins can declare their processors and use this ID within the processors' function to decide whether to modify the columns that the table receives.

fixes #1044

@lijianzhi01
Copy link
Collaborator

Hey Joaquim, this PR works well in all our cases. Thanks.

Copy link
Contributor

@illume illume left a comment

Choose a reason for hiding this comment

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

Very good. I think the API is nice.

I left some notes for your consideration.

Would you mind rebasing on main? (there's quite a few changes merged since this was done)

frontend/src/plugin/registry.tsx Show resolved Hide resolved
frontend/src/redux/actions/actions.tsx Show resolved Hide resolved
frontend/src/redux/reducers/ui.tsx Outdated Show resolved Hide resolved
frontend/src/redux/reducers/ui.tsx Show resolved Hide resolved
plugins/examples/tables/src/index.tsx Outdated Show resolved Hide resolved
plugins/examples/tables/package.json Outdated Show resolved Hide resolved
plugins/examples/tables/src/index.tsx Show resolved Hide resolved
plugins/examples/tables/src/index.tsx Outdated Show resolved Hide resolved
plugins/examples/tables/README.md Show resolved Hide resolved
@joaquimrocha joaquimrocha force-pushed the plugins-override-tables branch 2 times, most recently from 4ad647b to 29f13dc Compare May 12, 2023 10:37
Copy link
Contributor

@illume illume left a comment

Choose a reason for hiding this comment

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

Thanks for those updates.

I resolved a bunch of convos, and left a few more notes for your consideration.

It's maybe worth a rebase against main.

frontend/src/redux/actions/actions.tsx Show resolved Hide resolved
plugins/examples/tables/src/index.tsx Show resolved Hide resolved
frontend/src/redux/reducers/ui.tsx Show resolved Hide resolved
Copy link
Contributor

@illume illume left a comment

Choose a reason for hiding this comment

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

The part after the headlamp- prefix needs to be described. Added some suggested docs in one convo.

Copy link
Contributor

@illume illume left a comment

Choose a reason for hiding this comment

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

🎉 thanks!

All the convos are resolved. Just waiting for tests.

@joaquimrocha joaquimrocha merged commit a820068 into main May 25, 2023
5 checks passed
@joaquimrocha joaquimrocha deleted the plugins-override-tables branch May 25, 2023 16:49
@lijianzhi01
Copy link
Collaborator

Love this PR. It means lot to customization.

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.

Allow to modify resource table list
3 participants