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

[#7784] Update request URLs use url_title #7984

Merged
merged 12 commits into from
Jan 8, 2024

Conversation

alexander-griffen
Copy link
Contributor

@alexander-griffen alexander-griffen commented Oct 27, 2023

Relevant issue(s)

Fixes #7784

What does this do?

This changes instances of id in URLs to url_title

Why was this needed?

This was needed to reduce possible URL permutations, to make admin tasks easier.

Notes to reviewer

Commits b56786b...6b07a03 are refactoring to allow the change to be made in the other commits.

@alexander-griffen alexander-griffen force-pushed the 7784-url-request-id-permutations branch from afe49e5 to e8e4929 Compare November 3, 2023 10:48
@alexander-griffen alexander-griffen force-pushed the 7784-url-request-id-permutations branch from 3d5b5ae to 49f3d4c Compare November 20, 2023 13:30
@alexander-griffen alexander-griffen force-pushed the 7784-url-request-id-permutations branch from 6749e51 to 914ef41 Compare November 27, 2023 15:50
@alexander-griffen alexander-griffen marked this pull request as ready for review November 27, 2023 16:14
@alexander-griffen alexander-griffen self-assigned this Nov 27, 2023
@gbp gbp force-pushed the 7784-url-request-id-permutations branch from 914ef41 to b79ed05 Compare November 27, 2023 17:06
@gbp gbp force-pushed the 7784-url-request-id-permutations branch from b79ed05 to 2e32f1e Compare December 7, 2023 12:15
@gbp gbp changed the title WIP: URL paths stopping using request IDs [#7784] Update request URLs use url_title Dec 7, 2023
@gbp gbp force-pushed the 7784-url-request-id-permutations branch 3 times, most recently from 8890dc3 to f8ba21a Compare December 7, 2023 15:16
@alexander-griffen alexander-griffen force-pushed the 7784-url-request-id-permutations branch from 767b4db to f8ba21a Compare December 18, 2023 16:06
gbp and others added 12 commits January 8, 2024 12:39
Switch to using request URL title paths to save extra redirects.
Remove the need to specify `url_title` in the params hash. Rails will
already correctly generate the correct route without this.

Removing means more consistency, shorter line lengths, and will be more
flexible if the route ever changes.
Remove the need to specify `request_id` in the params hash. Rails will
already correctly generate the correct route without this.

Removing means more consistency, shorter line lengths, and will be more
flexible when the route changes to use request URL title.
Remove the need to specify `id` in the params hash. Rails will already
correctly generate the correct route without this.

Removing means more consistency, shorter line lengths, and will be more
flexible when the route changes to use request URL title.
Remove the need to specify `request_id` in the params hash. Rails will
already correctly generate the correct route without this.

Removing means more consistency, shorter line lengths, and will be more
flexible when the route changes to use request URL title.
Now we can a redirects routing file with similar redirects we can move
the before action callback which redirects request numerical IDs to the
more friendly URL titles.
Fix pre-existing linting issues with code lines which will be changing.

Fixes:
- line length
- indentation
- leading periods
Replace request IDs in URLs with titles
Replace request IDs in URLs with titles

This does remove a few tests that were looking specifically at
IDs, or 'ugly' IDs)
Replace request IDs in URLs with titles
@gbp gbp force-pushed the 7784-url-request-id-permutations branch from 6405f7a to dcca4ed Compare January 8, 2024 12:40
Copy link
Member

@gbp gbp left a comment

Choose a reason for hiding this comment

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

I have tested this thoroughly both locally and on staging.

@gbp gbp merged commit de98570 into develop Jan 8, 2024
7 checks passed
gbp added a commit to mysociety/whatdotheyknow-theme that referenced this pull request Jan 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Make all request URLs use url_title instead of id as the identifier
2 participants