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

[PART 1] Make cached appeal attribute table joins a scope on tasks #14263

Merged
merged 8 commits into from
May 18, 2020

Conversation

hschallhorn
Copy link
Contributor

@hschallhorn hschallhorn commented May 13, 2020

THIS PR

Resolves #13914

PART 1 of the stack
PART 2 #14264
PART 3 #14265

Description

Moves joins(CachedAppeal.left_join_from_tasks_clause) into a scope on tasks

Acceptance Criteria

  • Tests pass (no changes)

FULL STACK

Description

Rather than displaying an appeal's problematic assigned_to_location, show the actual task assignee in task tables.

Acceptance Criteria

  • Task tables display the name of the org or the name of the user that is assigned the task
  • Organization queues
    • Can sort by assignee name
    • Can filter by assignee name
    • Show the correct assignee filter options

Testing Plan

Tasks assigned to users

  1. Sign in as BVALSPORER
  2. Navigate to the VLJ support queue http://localhost:3000/organizations/vlj-support
  3. Confirm that assignee css_ids appear in the queue table
  4. Confirm filter options look correct
  5. Confirm filtering works
  6. Confirm sorting works

Tasks assigned to organizations

  1. Sign in as Jolly Postman
  2. Navigate to any ama case (I searched for vet 321321321) and add 4 tasks (FOIA, AOD, change of addrress, and Congressional Interest)
  3. Update all these tasks to be on hold
uuid = ""
appeal = Appeal.find_by_uuid(uuid)
MailTask.where(appeal: appeal).each(&:on_hold!)
appeal.reload.treee
                                              ┌──────────────────────────────────────────────────────────────────────────────┐
Appeal 138 (direct_review) ──────────────────  ID    STATUS   ASGN_BY        ASGN_TO            UPDATED_AT              
└── RootTask                                   352   on_hold                 Bva                2020-05-07 16:00:44 UTC 
    ├── DistributionTask                       353   on_hold                 Bva                2020-05-13 00:46:14 UTC 
       ├── CongressionalInterestMailTask      2623  on_hold                 MailTeam           2020-05-13 00:46:14 UTC 
          └── CongressionalInterestMailTask  2624  on_hold  JOLLY_POSTMAN  LitigationSupport  2020-05-13 00:47:38 UTC 
       └── FoiaRequestMailTask                2625  on_hold                 MailTeam           2020-05-13 00:46:22 UTC 
           └── FoiaRequestMailTask            2626  on_hold  JOLLY_POSTMAN  PrivacyTeam        2020-05-13 00:47:38 UTC 
    ├── AodMotionMailTask                      2627  on_hold                 MailTeam           2020-05-13 00:46:35 UTC 
       └── AodMotionMailTask                  2628  on_hold  JOLLY_POSTMAN  AodTeam            2020-05-13 00:47:38 UTC 
    └── AddressChangeMailTask                  2629  on_hold                 MailTeam           2020-05-13 00:47:00 UTC 
        └── AddressChangeMailTask              2630  on_hold  JOLLY_POSTMAN  Colocated          2020-05-13 00:47:00 UTC 
            └── AddressChangeMailTask          2631  on_hold  JOLLY_POSTMAN  BVALSPORER         2020-05-13 00:47:38 UTC 
                                              └──────────────────────────────────────────────────────────────────────────────┘
  1. Go to the mail queue's on hold tab http://localhost:3000/organizations/mail?tab=on_hold
  2. Confirm that assignee org names appear in the queue table
  3. Confirm filter options look correct
  4. Confirm filtering works
  5. Confirm sorting works

User Facing Changes

  • Queues show the actual assignees of each task (no one assignee for all tasks for one case)
BEFORE AFTER
Screen Shot 2020-05-12 at 8 53 39 PM Screen Shot 2020-05-12 at 8 52 41 PM
  • Queues show the css_id of the user assignee, rather than a mix of user id or css_id?
BEFORE AFTER
Screen Shot 2020-05-12 at 8 55 59 PM Screen Shot 2020-05-15 at 1 25 39 PM
  • Queues do not show "Case Storage" unless they are actually assigned to BVA
BEFORE AFTER
Screen Shot 2020-05-12 at 9 00 31 PM Screen Shot 2020-05-15 at 5 02 39 PM

@hschallhorn hschallhorn self-assigned this May 13, 2020
@hschallhorn hschallhorn changed the title Make cached appeal attribute table joins a scope on tasks [PART 1] Make cached appeal attribute table joins a scope on tasks May 13, 2020
@codeclimate
Copy link

codeclimate bot commented May 13, 2020

Code Climate has analyzed commit e181835 and detected 0 issues on this pull request.

View more on Code Climate.

Copy link
Contributor

@lomky lomky left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Optional spec to add coverage for a previously untested method this PR touches, & an out of scope add-if-you-found it comment. Overall LGTM! nice refactor 🎇 :shipit:

Running bundle exec rails security locally, I see nothing different on this PR versus master branch. Unclear what's yelling there.

app/models/queue_column.rb Outdated Show resolved Hide resolved
app/models/task_filter.rb Outdated Show resolved Hide resolved
@hschallhorn hschallhorn added the blocked This is blocked label May 15, 2020
* Show task assignee name in queue tables

* SQL resuffling

* Use css_id over full_name

* [PART 3] Remove assignee_label from cached appeals (#14265)

* Remove assignee_label from cached appeals

* ETL migrations before running make docs!
@va-bot
Copy link
Collaborator

va-bot commented May 18, 2020

2 Warnings
⚠️ This PR changes the schema. Please use the PR template checklist.
⚠️ This PR makes DB changes that might affect the local seeds. Please make sure rake db:seed still runs without issues.

Generated by 🚫 Danger

@hschallhorn hschallhorn removed the blocked This is blocked label May 18, 2020
@hschallhorn hschallhorn added the Ready-to-Merge This PR is ready to be merged and will be picked up by va-bot to automatically merge to master label May 18, 2020
@va-bot va-bot merged commit 30e2ac3 into master May 18, 2020
@va-bot va-bot deleted the hschallhorn/13914-use-assignee-name-in-queue-part-1 branch May 18, 2020 19:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Ready-to-Merge This PR is ready to be merged and will be picked up by va-bot to automatically merge to master
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Do not use assigned_to_location to sort and filter by assignee in org queues
3 participants