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

[POC] [Discussion] Custom actions (extension/plugins) #1739

Closed
wants to merge 4 commits into from

Conversation

gautamsi
Copy link
Member

@gautamsi gautamsi commented Oct 6, 2019

ref: #1452 #310
Tried to work my way to add some extensibility, see this gif and explanation
keystone plugin demo

click gif to open in new window for better viewing

Intention

intention is to enable devs write custom actions which can extend Admin UI with custom Buttons for List and List multi item select management.

working:

  1. You can add List Action to add UI elements after the "Create" button on List page, this can be any Ui element, I just used the way field view loaders are loaded.

the example I used is very crude, actual export features can also be written using this way and the Ui may give download link rather than the item in the console log.

  1. You can add ui elements on the toolbar when you select items in the list. ( again very simple example but this can achieve complex scenarios as well)

possibility

immediate possibility is to

  1. add list item actions similar to allow duplicate item from list and on detail page #1724 Duplicate items from drop down ( this can also be refactored as list item action rather than in build feature)

  2. add Item Action which is on the Item detail/Edit page.

I will work on these two after seeing positive feedback for first two actions working.

Beyond

later this can also extend to import plugins installed dynamically, I was not able to figure out (yet) the webpack stuff with field-view-loader to load from disk without bundling with webpack.

additionally we can also enable composing with other ui elements like

  • custom filtering options which may enable quick filtering with pre-made filters.
  • add ui elements in the create/update item modal which may fetch some information based on input and pre-fill some fields
  • allow devs replace CreateItem modal (and other models) with custom one.

this PR may not make it to the repo "as is" due to changes in the Blog Demo project, I will modify this to run with test projects and create new PR once it is acceptable to core team otherwise it will become part of keystonejs-contrib project for sure

@changeset-bot
Copy link

changeset-bot bot commented Oct 6, 2019

💥 No Changeset

Latest commit: a8ee429

Merging this PR will not cause any packages to be released. If these changes should not cause updates to packages in this repo, this is fine 🙂

If these changes should be published to npm, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@MadeByMike
Copy link
Contributor

This is awesome mate! We need to unify the ideas from here with the comments from: #1665

I'm going to see if I can get the team together to decide how this might all work.

@gautamsi gautamsi mentioned this pull request Oct 7, 2019
@gautamsi
Copy link
Member Author

gautamsi commented Oct 7, 2019

we can also make use of refined naming I suggested at https://github.com/keystonejs/keystone-5/pull/1665#issuecomment-532194427
both can be unified easily, just have to find spots in admin ui to add or replace the ui elements.

@MadeByMike
Copy link
Contributor

Let me get some feedback from everyone this week and then I'll get together with you and we can spec out and build a complete solution for Admin UI hooks.

@VinayaSathyanarayana
Copy link
Contributor

@MadeByMike
Copy link
Contributor

The custom actions stuff in #2101 should definitely be considered.

Copy link
Contributor

@MadeByMike MadeByMike left a comment

Choose a reason for hiding this comment

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

On hold until we can spec out custom actions completely

@gautamsi gautamsi mentioned this pull request Oct 18, 2019
@MadeByMike
Copy link
Contributor

Admin UI hooks have shipped (although we need to add the appropriate hook points) With this we will be able to deliver custom actions.

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.

3 participants