-
Notifications
You must be signed in to change notification settings - Fork 19
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
APPEALS-63207 Add a Task Action to move appeals from one attorney to another for decision drafting #23591
base: feature/APPEALS-60032
Are you sure you want to change the base?
Conversation
|
||
def legacy_atty_to_atty_special_case_movement(user) | ||
FeatureToggle.enabled?(:legacy_case_movement_atty_to_atty_for_decisiondraft, user: user) && | ||
appeal.tasks.open.where(type: AttorneyLegacyTask.name) && appeal.is_a?(LegacyAppeal) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There won't be an AttorneyLegacyTask
for the legacy appeals. The LegacyTask
class and its children are not persisted in the DB, they are dynamically generated when loading the appeal in a queue or on a case details page.
@@ -13,6 +13,11 @@ def available_actions(current_user, role) | |||
Constants.TASK_ACTIONS.SUBMIT_OMO_REQUEST_FOR_REVIEW.to_h, | |||
Constants.TASK_ACTIONS.ADD_ADMIN_ACTION.to_h] | |||
|
|||
if SpecialCaseMovementTeam.singleton.user_has_access?(current_user) && |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that we should use .can_act_on_behalf_of_judges?
from the User model here instead of user_has_access?
. They are functionally similar, but can_act_on_behalf_of_judges?
is a more semantic/clear way of writing it to explain why the user has access to that action.
end | ||
|
||
def show_assign_to_attorney_option?(current_user, assigned_to) | ||
(current_user == assigned_to || current_user&.can_act_on_behalf_of_judges?) && |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The attorney (assigned_to
) shouldn't be able to see this action
return [] if role != "attorney" || current_user != assigned_to | ||
if (role != "attorney" || current_user != assigned_to) && | ||
(FeatureToggle.enabled?(:legacy_case_movement_atty_to_atty_for_decisiondraft) && | ||
!current_user&.can_act_on_behalf_of_judges?) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The conditional is allowing the SCM user to see the attorneys actions, which we don't want since they would technically then be able to execute the "decision ready for review" action
Resolves APPEALS-63207
Description
Please explain the changes you made here.
Acceptance Criteria
Testing Plan
Frontend
User Facing Changes
Storybook Story
For Frontend (Presentation) Components
MyComponent.stories.js
alongsideMyComponent.jsx
)Backend
Database Changes
Only for Schema Changes
created_at
,updated_at
) for new tablesCaseflow::Migration
, especially when adding indexes (useadd_safe_index
) (see Writing DB migrations)migrate:rollback
works as desired (change
supported functions)make check-fks
; add any missing foreign keys or add toconfig/initializers/immigrant.rb
(see Record associations and Foreign Keys)belongs_to
for associations to enable the schema diagrams to be automatically updatedIntegrations: Adding endpoints for external APIs
Best practices
Code Documentation Updates
Tests
Test Coverage
Did you include any test coverage for your code? Check below:
Code Climate
Your code does not add any new code climate offenses? If so why?
Monitoring, Logging, Auditing, Error, and Exception Handling Checklist
Monitoring
Logging
Auditing
Error Handling
Exception Handling