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

Introducing support functionality to grant an editable extension to any non editable section #8722

Merged
merged 14 commits into from
Oct 27, 2023

Conversation

tomas-stefano
Copy link
Collaborator

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

screencapture-localhost-3000-support-applications-719-editable-until-2023-10-25-11_28_10

Then the sections are editable for 5 business days

Guidance to review

  1. Does it work for all sections (checked and unchecked) via support?

Link to Trello card

https://trello.com/c/CCPhwAUW/870-ca-introduce-5-day-editable-window

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.
@tomas-stefano tomas-stefano added deploy_v2 Deploy the review app to AKS Continuous applications Work relating to continuous applications labels Oct 25, 2023
@github-actions github-actions bot temporarily deployed to review_aks-8722 October 25, 2023 14:48 Destroyed
@github-actions github-actions bot temporarily deployed to review_aks-8722 October 25, 2023 15:11 Destroyed
@tomas-stefano tomas-stefano temporarily deployed to review_aks October 25, 2023 15:11 — with GitHub Actions Inactive
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
@github-actions github-actions bot temporarily deployed to review_aks-8722 October 25, 2023 15:33 Destroyed
@tomas-stefano tomas-stefano temporarily deployed to review_aks October 25, 2023 15:34 — with GitHub Actions Inactive
we have a spec/lib/namespace_spec that checks namespaces intrusions
@tomas-stefano tomas-stefano requested review from a team October 25, 2023 15:44
@github-actions github-actions bot temporarily deployed to review_aks-8722 October 25, 2023 15:53 Destroyed
@tomas-stefano tomas-stefano temporarily deployed to review_aks October 25, 2023 15:53 — with GitHub Actions Inactive
@github-actions github-actions bot temporarily deployed to review_aks-8722 October 25, 2023 16:20 Destroyed
@tomas-stefano tomas-stefano temporarily deployed to review_aks October 25, 2023 16:20 — with GitHub Actions Inactive
Copy link
Contributor

@zarembas zarembas left a 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?

@github-actions github-actions bot temporarily deployed to review_aks-8722 October 26, 2023 03:40 Destroyed
@tomas-stefano tomas-stefano temporarily deployed to review_aks October 26, 2023 03:40 — with GitHub Actions Inactive
config/routes/support.rb Outdated Show resolved Hide resolved
@github-actions github-actions bot temporarily deployed to review_aks-8722 October 26, 2023 15:15 Destroyed
We need to clean the specs for old continuous apps!
@github-actions github-actions bot temporarily deployed to review_aks-8722 October 26, 2023 15:44 Destroyed
@github-actions github-actions bot temporarily deployed to review_aks-8722 October 26, 2023 16:11 Destroyed
@tomas-stefano tomas-stefano temporarily deployed to review_aks October 26, 2023 16:11 — with GitHub Actions Inactive
Copy link
Contributor

@MaeveRoseveare MaeveRoseveare left a 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)

config/locales/sections.yml Outdated Show resolved Hide resolved
@github-actions github-actions bot temporarily deployed to review_aks-8722 October 27, 2023 08:56 Destroyed
@github-actions github-actions bot temporarily deployed to review_aks-8722 October 27, 2023 09:22 Destroyed
@tomas-stefano tomas-stefano temporarily deployed to review_aks October 27, 2023 09:22 — with GitHub Actions Inactive
Copy link
Collaborator

@inulty-dfe inulty-dfe left a 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.

app/forms/support_interface/editable_until_form.rb Outdated Show resolved Hide resolved
def maths_gcse?(_policy)
subject = params[:subject]

subject && subject == 'maths'
Copy link
Collaborator

Choose a reason for hiding this comment

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

Crazy suggestion:

subject&.== 'maths'

app/forms/support_interface/editable_until_form.rb Outdated Show resolved Hide resolved
Section.new(
:science_gcse,
controller: 'CandidateInterface::Gcse',
editable_condition: ->(section, policy) { section.science_gcse?(policy) },
Copy link
Collaborator

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')
        },
      ),

Copy link
Collaborator

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:

@MaeveRoseveare MaeveRoseveare self-requested a review October 27, 2023 10:30
@JR-G
Copy link
Contributor

JR-G commented Oct 27, 2023

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!

@github-actions github-actions bot temporarily deployed to review_aks-8722 October 27, 2023 10:41 Destroyed
@tomas-stefano tomas-stefano temporarily deployed to review_aks October 27, 2023 10:41 — with GitHub Actions Inactive
@tomas-stefano tomas-stefano merged commit af9c1ac into main Oct 27, 2023
60 checks passed
@tomas-stefano tomas-stefano deleted the add-editable_until-implementation branch October 27, 2023 11:00
@tomas-stefano tomas-stefano temporarily deployed to review_aks October 27, 2023 11:00 — with GitHub Actions Inactive
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Continuous applications Work relating to continuous applications deploy_v2 Deploy the review app to AKS
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants