-
Notifications
You must be signed in to change notification settings - Fork 9
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
Introducing support functionality to grant an editable extension to any non editable section #8722
Conversation
A support user will be able to click a button to ‘make the application editable’. On a new page, they will then be able to set a non editable section temporarily editable and the code will automatically calculate the date until the candidate will be able to edit. This will set the editable_until value. We’ll also request the Zendesk link of the originating request. Once set, the support user will return to the candidate’s application view and will be able to see the ‘editable until’ value rendered. when editable_until > current date, the candidate can edit all sections selected via support.
The GCSEs controller some actions has the params subject and others don't so I need to rely one of this two to make the check for the section
we have a spec/lib/namespace_spec that checks namespaces intrusions
app/components/support_interface/application_summary_component.rb
Outdated
Show resolved
Hide resolved
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.
One issue would also be not letting the candidates delete references because it's not possible after submission. Maybe hide the Delete
link?
app/controllers/support_interface/application_forms/editable_until_controller.rb
Outdated
Show resolved
Hide resolved
We need to clean the specs for old continuous apps!
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.
Thanks @tomas-stefano I played around and nothing broke for me.
I noted 1 validation point - I can select 'Update' without selecting any of the check boxes.
And on @vassyz comments, yes agreed - I have provided solutions in this same doc (scroll down)
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.
In the interest of time I'm happy to approve but I've added some thoughts I think we should consider.
def maths_gcse?(_policy) | ||
subject = params[:subject] | ||
|
||
subject && subject == 'maths' |
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.
Crazy suggestion:
subject&.== 'maths'
Section.new( | ||
:science_gcse, | ||
controller: 'CandidateInterface::Gcse', | ||
editable_condition: ->(section, policy) { section.science_gcse?(policy) }, |
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 made the suggestion to pass a block here but the way it's been implemented means it is unnecessary.
The point was to avoid defining *_gcse?
methods on the Section
class because that method only applies to a GCSE section with subject *. If another GCSE was added (unlikely of course) then a new method would need to be added.
I expected the whole condition (the contents of the *_gcse?
method) to be passed directly to the block.
Section.new(
:english_gcse,
controller: 'CandidateInterface::Gcse',
editable_condition: lambda { |policy|
params = policy.params
subject = params[:subject]
(subject && subject == 'english') || policy.controller_path.include?('candidate_interface/gcse/english')
},
),
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.
Also, how do you feel about editable_if:
instead of editable_condition:
Approved – I've already added a card to feature flag this, and I'll add further cards for us to address all the valid points raised on this piece of functionality! |
Context
A support user will be able to click a button to ‘make the application editable’. On a new page, they will then be able to set a non editable section temporarily editable and the code will automatically calculate the date until the candidate will be able to edit.
This will set the editable_until value.
We’ll also request the Zendesk link of the originating request. Once set, the support user will return to the candidate’s application view and will be able to see the ‘editable until’ value rendered. when editable_until > current date, the candidate can edit all sections selected via support.
Changes proposed in this pull request
Then the sections are editable for 5 business days
Guidance to review
Link to Trello card
https://trello.com/c/CCPhwAUW/870-ca-introduce-5-day-editable-window