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

Redesign for constraints page #1725

Merged
merged 2 commits into from
Apr 24, 2024
Merged

Redesign for constraints page #1725

merged 2 commits into from
Apr 24, 2024

Conversation

cdccollins
Copy link
Contributor

Description of change

  • Add/Remove links rather than checkboxes
  • Can't remove constraints identified by system
  • Can search for constraints

Story Link

https://trello.com/c/qkrP4O3J/2796-the-source-of-the-constraints

Screenshots

screencapture-lambeth-bops-localhost-3000-planning-applications-2514-validation-constraints-2024-04-22-14_30_03

@cdccollins cdccollins marked this pull request as draft April 22, 2024 13:32
@cdccollins cdccollins force-pushed the update-constraint-page branch from 94173ca to af01fc7 Compare April 22, 2024 14:12
@cdccollins cdccollins marked this pull request as ready for review April 22, 2024 14:16

.dashed-box {
padding: 30px;
border: 1px dashed #B1B4B6;
Copy link
Contributor

Choose a reason for hiding this comment

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

It might be better to use the govuk-colour function rather than the hex code:

Suggested change
border: 1px dashed #B1B4B6;
border: 1px dashed govuk-colour("mid-grey");

@cdccollins cdccollins force-pushed the update-constraint-page branch from af01fc7 to f7888a6 Compare April 23, 2024 09:26
<% end %>
<% else %>
<tr class="govuk-table__row">
<td class="govuk-table__cell" colspan="4" style="border-bottom: none;">
Copy link
Contributor

Choose a reason for hiding this comment

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

We have a class for that:

Suggested change
<td class="govuk-table__cell" colspan="4" style="border-bottom: none;">
<td class="govuk-table__cell border-bottom-none" colspan="4">


def update
ActiveRecord::Base.transaction do
@planning_application.update!(updated_address_or_boundary_geojson: true)
@planning_application.constraints_checked!
end
Copy link
Member

Choose a reason for hiding this comment

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

This should probably be extracted to a method on the model

def constraints_to_add
@constraints_to_add ||= constraint_ids - existing_constraint_ids
def set_other_constraints
@other_constraints = Constraint.all_constraints(search_param).non_applicable_constraints(@planning_application.planning_application_constraints).sort_by(&:category)
Copy link
Member

Choose a reason for hiding this comment

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

This should be a method on the Constraint model, e.g.

@other_constraints = Constraint.other_constraints(search_param, @planning_application)

resource :constraints, only: %i[show update]
resources :constraints, only: %i[index create destroy] do
patch :update, on: :collection
end
Copy link
Member

Choose a reason for hiding this comment

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

Why the change to resources?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Because I wanted the :id on the create and destroy method?

@cdccollins cdccollins force-pushed the update-constraint-page branch 2 times, most recently from b27d514 to 5185340 Compare April 23, 2024 15:37
@cdccollins cdccollins force-pushed the update-constraint-page branch from 5185340 to 8fbf84f Compare April 24, 2024 08:55
- Add/Remove links rather than checkboxes
- Can't remove constraints identified by system
- Can search for constraints
@cdccollins cdccollins force-pushed the update-constraint-page branch from 8fbf84f to 36159f8 Compare April 24, 2024 12:21
@cdccollins cdccollins merged commit 06e58e7 into main Apr 24, 2024
32 checks passed
@cdccollins cdccollins deleted the update-constraint-page branch April 24, 2024 12:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants