I want to render user-and-group-multi-selector (like the same in branch permissions). So, question in subject.
If not, could you refer me to the way how to render it.
Community moderators have prevented the ability to post new answers.
Hi Dana,
Sorry for the delay. I have to warn you up front that, unless documented, most of our JS libraries are considered private and as such we don't give any guarantee that it won't change at any point. This is puts us in a bind; we either tell you how to use an internal API that we may need to change and then which breaks your plugin, or we don't help you at all. Neither is ideal. :(
That aside, if you're happy to acknowledge these are _private_ APIs, this is how you would add a user-group selector:
var $myInput = $('<input type="text" name="my-input" />'); // normal text input var UserAndGroupMultiSelector = require('feature/user/user-and-group-multi-selector'); var selector = new UserAndGroupMultiSelector($myInput); selector.setSelectedItems({ users : [...], groups : [...] }); selector.getSelectedItems(); // returns { users : [...], groups : [...] }
I hope that helps. My advice might also be to raise a feature request for Stash to provide a public version of this API (which may well look exactly the same) so that you can use it a little more confidentally. Other plugin developers may then decide to vote on the issue as well.
Charles
Thanks a lot! Feature request have been created https://jira.atlassian.com/browse/STASH-3754
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.