Commit 8c0905a
authored
Implement baseline phase 1: Change URLs, adjusting styles, pre for new criteria set (#2518)
This PR implements baseline plan phase 1. It transitions the application from using numeric criteria levels (0, 1, 2) to human-readable named levels (passing, silver, gold) in URLs, preparing the codebase for future baseline levels. The changes maintain backward compatibility through redirects while establishing a cleaner, more maintainable URL structure. It adds a new "section" tab to projects and fixes the stylesheets to prep for baseline.
Key Changes:
* URL Structure: Routes now use /projects/:id/:level with named levels (passing/silver/gold) instead of numeric IDs
* Routing Layer: Adds redirect rules for deprecated numeric/synonym forms with appropriate 301/302 status codes
* Level Conversion: Introduces LevelConversion concern and helper methods to translate between URL-friendly names and internal numeric representations
* Test Updates: Comprehensive test coverage for new routing patterns, redirects, and level normalization
* Adds new "permissions" section so baseline users won't need to walk through "passing" questions to change permissions.
* Project page shows new "Section" tab to make it easier to see and switch sections
* Stylesheets reorganized and changed to support new information in navbar
Specifics:
* Change external URLs to prep for baseline
* Small improvements for new routing
* 100% test coverage for routing changes
* IDA wasn't involved in this file
* AGENTS.md: Minimize new code
* First try at DRY in routes
* DRY out code for redirecting from router
* Remove unused parameter
* Implement new _form_permissions form
* Redirect missing criteria_level for projects
* Simplify routing code
* Cleanup: Consistently append criteria level in URL
* Improve permissions page handling
* Fix broken test
* Add tests
* Simplify level normalization and its tests
* Add test to reach 100% statement coverage
* Rename is_disabled to view_only
Many UI components look different when they allow editing vs.
when they *disable* editing. So we've been using "is_disabled"
to indicate the mode that only permits viewing (not editing).
However, in higher-level constructs this is confusing
(what is being disabled?).
This changes the name of the boolean to "view_only".
It still has the same sense ("true" means "only viewing no editing),
but giving its name a higher-level meaning makes it easier to follow.
* Add section selector at top
Add selector - this makes the various sections MUCH more
discoverable and easy to use. It does use up precious
space on mobile, but I think it's worth it.
The term "section" is vague, but I couldn't find a better term.
* Simplify end of "show project" form
Historically we had some links at the bottom that didn't look
pretty, but they're no longer needed. Clean this up
so that the end of the project form is nicer-looking and simpler.
* Organize stylesheet files
These stylesheet files have become a mess over time and
it's now hard to fix style problems.
Solution: Reorganize style files so they "make sense"
and follow more recent conventions. Then we can fix the
bug involving the navigation bar (now that we've added
"Section" we can have way-too-long navigation bars, and
we need to deal with it).
* Improve navbar hamburger processing
* Fix header so it works "enough"
* Fix navbar by removing extraneous boxes
Signed-off-by: David A. Wheeler <[email protected]>
* Regenerate db/schema.rb
ActiveRecord wants to regenerate this file, so let's allow it.
* Eliminate double-line navbar in wide widths
* Add edge margins for navbar logo and hamburger
* Force progress bar to be vertically aligned
* Cleanup progress bar stylesheet settings
* Reduce navbar padding to keep on 1 line
* Add RHS margin in navbar
* Improve navbar stacking in medium width screens
* Put progressbar in top line only and always
* Fix subtle problems from incorrect CSS load order
The GitHub button was mysteriously not working well
(when hovering the text and image disappeared).
Eventually I found that the problem was a bad
CSS load order. Loading the CSS in the correct order
solved it cleanly.
* Fix preload stylesheet type so it loads
* Fix regex for SPDX License Expression
Parentheses must be escaped in these regexes, even inside brackets.
* Fix JavaScript: line width, omit some in dev mode
* Fix test, preload stylesheet should be "sheet"
* Fix CSV test (make it more flexible)
The order of the CSV headers has changed (now it's alphabetical).
Let's modify the test so that it's not so sensitive,
we just want to ensure that many expected values are in it.
* Fix progress bar and a test
* Clarify comment in SCSS
* Improve rakefile
Add an asset precompilation task, and modify the whitespace
checker to ignore generated assets (we don't control much of those).
* Remove unnecessary navbar !important markings
The !important marking is sometimes necessary, but best avoided
if possible. These weren't necessary; remove them.
* Remove unnecessary !important in navbar
* Clean up navbar (remove more !important)
* Remove more unnecessary !important
* Document navbar layout strategy in comments
The navbar layout approach is unusual. Clearly document
it in the comments (including why we do it this way).
* Highlight current section in list of sections
The server-side code already indicated the "active" section,
but previously there was no style that made it visible.
This adds styling so the current (active) section is highlighted,
in this case by a colored checkmark. Exactly the same text is
transparently before the other sections to ensure that the text
alignment is perfect.
* Minor cleanup in CSS load order
* Reorg: application.scss should only import
Move the specific CSS commands into _base.scss.
* Rename SCSS partial filenames per convention
SCSS partials are supposed to have filenames beginning
with "_", but we didn't do that consistently.
Rename to make them consistent.
The "application.scss" becomes "application.css" which
imports everything else. This single CSS is cached on the
user's browser, so once a user loads it, they won't need
to load it again. We don't use the other files as anything
other than partials, so rendering them so they can be
used independently is a waste of time.
* Move key shared CSS variables in separate file
We have a few width values that are shared across files.
Put them in a single "_variables.scss" file, so their
values are shared and in exactly one place.
* Identify criteria CSS as a partial
Follow the filename convention for SCSS partials.
* Minor cleanup of .scss files
---------
Signed-off-by: David A. Wheeler <[email protected]>1 parent 53aafc0 commit 8c0905a
File tree
61 files changed
+2380
-1377
lines changed- app
- assets
- javascripts
- stylesheets
- controllers
- helpers
- models
- concerns
- views
- criteria
- layouts
- projects
- config
- initializers
- locales
- db
- lib
- tasks
- test
- controllers
- integration
- models
- concerns
- system
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
61 files changed
+2380
-1377
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
313 | 313 | | |
314 | 314 | | |
315 | 315 | | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
316 | 325 | | |
317 | 326 | | |
318 | 327 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
58 | 58 | | |
59 | 59 | | |
60 | 60 | | |
61 | | - | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
62 | 64 | | |
63 | 65 | | |
64 | 66 | | |
| |||
665 | 667 | | |
666 | 668 | | |
667 | 669 | | |
668 | | - | |
669 | | - | |
670 | | - | |
| 670 | + | |
| 671 | + | |
| 672 | + | |
| 673 | + | |
| 674 | + | |
| 675 | + | |
| 676 | + | |
| 677 | + | |
| 678 | + | |
| 679 | + | |
| 680 | + | |
671 | 681 | | |
672 | 682 | | |
673 | 683 | | |
| |||
705 | 715 | | |
706 | 716 | | |
707 | 717 | | |
708 | | - | |
| 718 | + | |
| 719 | + | |
| 720 | + | |
| 721 | + | |
| 722 | + | |
| 723 | + | |
| 724 | + | |
| 725 | + | |
| 726 | + | |
| 727 | + | |
| 728 | + | |
| 729 | + | |
709 | 730 | | |
710 | 731 | | |
711 | 732 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
File renamed without changes.
Lines changed: 3 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
| 3 | + | |
| 4 | + | |
3 | 5 | | |
4 | 6 | | |
5 | 7 | | |
| |||
33 | 35 | | |
34 | 36 | | |
35 | 37 | | |
36 | | - | |
| 38 | + | |
37 | 39 | | |
38 | 40 | | |
39 | 41 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
0 commit comments