question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add option to generate custom actions in Admin UI

See original GitHub issue

It would be handy to add some custom actions to Admin UI. Such actions that do not require any input and they just return a message and information whether the operation was succesful or not.

For example, for posts there could be a button Archive. This would be in the Admin UI in the view that shows the selected post.

A draft:

var Post = new keystone.List('Post', {
    autokey: { path: 'slug', from: 'title', unique: true },
    map: { name: 'title' },
    defaultSort: '-createdAt',
    actions: {
       'Archive': archive
    }
});

var archive = function(next) {
    this.state = 'archived';
    this.save(function(err) {
        if (!err) {
            next(err, 'Post is archived');
        } else {
            next(err, 'Archiving failed');
        }
    });
}

Of course this example is not very useful, but I think that useful use cases exist.

Issue Analytics

  • State:closed
  • Created 9 years ago
  • Reactions:1
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
daheicommented, May 22, 2015

+1

Yes, this would be great! I have also several use-cases where I could need such a custom button/action in the Admin UI.

0reactions
mxstbrcommented, Apr 29, 2016

This is definitely a feature that is on the roadmap, but when we include it we want to make the entire admin interface extensible at once, instead of just having a few more buttons. We have big plans for this, but aren’t ready to fully commit just yet due to #2566 amongst other things.

I’ll close this issue for now and move it to ProductPains, let us know if you want this by upvoting it there: https://productpains.com/post/keystonejs/cannot-find-ways-to-add-a-custom-button-or-links-in-admin-ui

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to Add Custom Action Buttons to Django Admin
Django admin interface with custom action buttons. Our custom actions are the nice looking deposit and withdraw buttons next to each account ...
Read more >
Custom Admin Actions - Mastering Django Admin Book!
Django provides list_editable option to make selected fields editable in ... Let us write write a custom admin action to mark selected books...
Read more >
Admin actions - Django documentation
In these cases, Django's admin lets you write and register “actions” – functions that get called with a list of objects selected on...
Read more >
Adding custom action to UserModel's Admin page
Is there any possibility to create custom action in admin page for django UserModel? I want automatize adding user to group (like adding...
Read more >
Custom Actions Overview - Frame.io Docs
Custom actions are a way for you to build integrations directly into Frame.io as programmable UI components. · Setup your Custom Action ·...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found