The angular grid toolbar action component should have a disable option

Bug #1808268 reported by Jane Sandberg
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Evergreen
Fix Released
Undecided
Unassigned
3.2
Fix Released
Undecided
Unassigned

Bug Description

Currently, the AngularJS grid has a cool option to disable an action based on the results of a function (https://github.com/evergreen-library-system/Evergreen/blob/master/Open-ILS/web/js/ui/default/staff/services/grid.js#L1429)

The Angular grid doesn't have this option yet. I'm happy to work on adding this, if there are no objections.

Changed in evergreen:
assignee: nobody → Jane Sandberg (sandbej)
Revision history for this message
Jane Sandberg (sandbergja) wrote :

I created a branch for this called user/sandbergja/lp1808268_add_disable_option_to_eg2_grid_toolbar_action

Here's a link: http://git.evergreen-ils.org/?p=working/Evergreen.git;a=shortlog;h=refs/heads/user/sandbergja/lp1808268_add_disable_option_to_eg2_grid_toolbar_action

It includes an action in the sandbox that is conditionally enabled/disabled, so that you can see this in action.

Here are the testing instructions from the commit:
1) Apply this commit and recompile eg2.
2) Open the eg2 sandbox (https://yourdomain/eg2/staff/sandbox)
3) Ensure that the action called "Action that needs a single row"
is only enabled when one row of the grid is selected.
4) Create more <eg-grid-toolbar-actions> on grids in eg2. Make sure
that they all enable/disable those actions per the output of the
functions you reference in the [disabled] attribute.

Changed in evergreen:
assignee: Jane Sandberg (sandbej) → nobody
tags: added: pullrequest
Bill Erickson (berick)
Changed in evergreen:
assignee: nobody → Bill Erickson (berick)
status: New → Confirmed
Revision history for this message
Bill Erickson (berick) wrote :

Thanks, Jane!

I pushed a sign-off branch that includes a minor tweak commit:

http://git.evergreen-ils.org/?p=working/Evergreen.git;a=shortlog;h=refs/heads/user/berick/lp1808268-eg2-grid-disable-toolbar-action

The extra commit renames the "disabled" attribute to "disableOnRows" to avoid any confusion that might arise from "disabled" typically being a boolean variable instead of a function returning bool.

Changed in evergreen:
assignee: Bill Erickson (berick) → nobody
milestone: none → 3.2.3
Revision history for this message
Jane Sandberg (sandbergja) wrote :

That's a good change, Bill. Thanks.

I've signed off on your rename commit, so everything in this branch should be signed off: user/sandbergja/lp1808268-eg2-grid-disable-toolbar-action-signedoff

tags: added: signedoff
Changed in evergreen:
milestone: 3.2.3 → 3.3-beta1
Bill Erickson (berick)
Changed in evergreen:
assignee: nobody → Bill Erickson (berick)
Revision history for this message
Bill Erickson (berick) wrote :

Re-tested and merged to master/3.3 and 3.2. Thanks, Jane.

Revision history for this message
Bill Erickson (berick) wrote :

However... I just found a bug. Pushing a fix momentarily.

Revision history for this message
Bill Erickson (berick) wrote :

Pushed a follow up patch to improve the logic which tests for the presence of a disable function. I deployed without sign-off since Angular grids ins master/3.2 were unusable without the patch.

Includes an ng-lint fix I also missed.

Changed in evergreen:
status: Confirmed → Fix Committed
assignee: Bill Erickson (berick) → nobody
Changed in evergreen:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.