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

Grant access to selected Items in listing pages to plugins #14446

Closed
danwhitacre opened this issue Oct 12, 2017 · 5 comments
Closed

Grant access to selected Items in listing pages to plugins #14446

danwhitacre opened this issue Oct 12, 2017 · 5 comments

Comments

@danwhitacre
Copy link

Describe the feature:
In dashboard_listing.js and visualize_listing.js, the currently selected items are stored locally to the controller. To get the currently selected items from outside the controller (ie if I am trying to extend the controller as part of my plugin) it requires a wrapper function to iterate through all the items and check if each one is currently selected. Would be nice if there was just a function to get the currently selected items.

currently I do this to get all the currently selected items.

this.getSelectedItems = () => {
    return _.filter(this.items, this.isItemChecked);
};

when in the controller it should just be this:

this.getSelectedItems = () => {
  return selectedItems;
}
@danwhitacre
Copy link
Author

I guess in the controller it would look more like this:

this.getSelectedItems = function getSelectedItems() {
  return selectedItems;
};

@stacey-gammon
Copy link
Contributor

We have some big changes coming in this files. Actually, I just submitted a large change so that selectedItems is no longer part of the controller at all, but a part of an internal react listing table component. I plan to do something similar with dashboards.

This will also likely change as we want to introduce some high order react components to extract out the sorting logic.

There is a lot of work going on to explore how to expose a stable plugin API. Check out some of the issues tagged with :platform to see what's going on. Here is one such meta issue about plugins in the new platform system: #12468

@stacey-gammon stacey-gammon changed the title Expose selected items in dashboard/visualize listing controllers Grant access to selected Items in listing pages to plugins Oct 12, 2017
@epixa
Copy link
Contributor

epixa commented Nov 20, 2017

@stacey-gammon Given the changes you describe, is this issue still relevant?

@stacey-gammon
Copy link
Contributor

Not relevant, selectedItems is no longer on the controller in visualize, and dashboard will be following suit shortly. If there is anything else we can do, let us know @danwhitacre. I'll go ahead and close for now.

@danwhitacre
Copy link
Author

@stacey-gammon Nope all is good. I have the workaround I posted above for anybody stuck on older versions.

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

No branches or pull requests

3 participants