Tim - spent 3 hours on QA (ignored the test failures in Jenkins and patched my local). Here's my results. I think only a few of the
{BUG}s are important enough to bother with - but don't know effort for fixes.
=============
Approval Workflow
===============
Admin - c, s, a
Manager - a : bobc
Staff - c, s : Tim
Volunteer - c : Jamie
Scheduler - s : alan
QA Results
==========
User permissions: create mailings (only)
New mailing - UI has Content and Options
{BUG?} - UI works as expected BUT all roles seem to require “skip IDS check” permission in order to save a mailing. Otherwise I see:
====
Sorry an error has occurred => “There is a validation error with your HTML input. Your activity is a bit suspicious … “
====
Permissions: create AND schedule mailings
Continue to Schedule a created mailing.
- UI is fine to do Schedule action{BUG?} - After scheduling, user sees Approve/Reject action in selector which they probably shouldn’t see. Clicking this link gives the expected result: “Access denied”.
Permissions: schedule mailings (only)
Continue to Schedule a created mailing.
- UI is fine to do Schedule action
{BUG?} - After scheduling, user sees Approve/Reject action in selector which they probably shouldn’t see. Clicking this link gives the expected result: “Access denied”.
Permissions: approve mailings (only)
Go to Scheduled Mailings and click Approve / Reject action link
- UI loads expected Approve / Reject form. Approving gives expected results.{BUG}
- Preview Mailing pane on Approve / Reject screen is empty (no content). This is probably a significant issue since the approver needs to see what they are approving. (User with create, schedule, approve does see content there, so permissions issue on preview pane content).
{BUG} Click “continue” to view an Unscheduled mailing
- UI loads Previous (active) / Next (inactive) but no other content. Clicking Previous doesn’t do anything.
- Save Draft button action creates another mailing
{BUG}
Click ‘New Mailing’ from menu or Find Mailings
- UI loads Previous (active) / Next (inactive) but no other content. Clicking Previous doesn’t do anything.
- Save Draft button action creates another mailing
Permissions: create, schedule and approve
- New mailing flow works as expected
NOTES:
1.
{BUG?}
The Send Test Mailing to a Group seems problematic if exposed to a user w/o APPROVE permission - since they could pick a normal mailing list and just send it out. Need to see how that’s handled in older UI.
2. Reject action seems to clear Scheduled date and puts the mailing ‘back’ to where it can be worked on and scheduled again. This seems like appropriate behavior.
Initially, I added a CiviMail layout which adapts based on the workflow and permissions. The UI elements in "edit-workflow.html" were basically:
A. Wizard
1. Content (show if permission 'create mailings')
2. Options (show if permission 'create mailings')
3. Schedule (show if permission 'schedule mailings')
4. Approve (show if permission 'approve mailings')
I ran into trouble when thinking about how to wire up actions after the "Schedule" and "Approve" steps given different combinations of permissions, and I think this is because the above approach actually improves flexibility – i.e. a user with suitable permissions could go to the 'Approve' step, then go back to 'Content' to make a change, and then return to 'Approve'. In <=v4.5, this wasn't allowed.
I believe this wasn't allowed because the workflow stuff was stitched into CiviMail after-the-fact, tried to work-around some other weird artifacts in the BAO, and ultimately produced a kind'a weird data-model.
Trying to change that might be annoying, so... I figured... maybe I can just enforce the same constraints (i.e. after submission but before approval, disallow editing). This was fairly simply change to edit-workflow.html:
A. Wizard (show if mailing is unsubmitted)
1. Content (show if permission 'create mailings')
2. Options (show if permission 'create mailings')
3. Schedule (show if permission 'schedule mailings')
B. Accordion "Approve" (show if mailing is submitted && permission 'approve mailings')
This approach leads to some bugs (arguably in API+Angular side, but it's hard to say).
Now I'm going back and forth - it feels like any path requires more hours of work, and there are a couple paths that feel divergent:
PATH A: Cleanup. CRUD API.
PATH B: Enshrine the workflow.
Anyway, probably best to sleep on this and take another look with fresher eyes.