Commit 2c727bb
Add dedicated Manage Jenkins page with fine-grained permissions and modernized UI (#1035)
* Move resource management to dedicated Manage Jenkins subpage and modernize UI
Fixes #1021, fixes #964, fixes #1018
- Convert LockableResourcesRootAction from RootAction to ManagementLink
under Manage Jenkins > Configuration category
- Use settings-subpage layout with Jenkins-native app-bar and tabs
- Remove data-tables-api dependency; use native jenkins-table sortable
- Add client-side pagination with localStorage persistence
- Add resource CRUD (create, edit, delete) via JSON API endpoints
- Add filter/search: structured filter for resources tab (name, label,
status), text search for labels and queue tabs
- Add resource property management (key-value pairs) in add/edit dialogs
- Simplify Global Config page to only retain the two behavior toggles
(allowEmptyOrNullValues, allowEphemeralResources) with a notice
linking to the new management page
- Replace Bootstrap tab markup with capsule-style tab bar matching
Jenkins Dashboard design
- Use event delegation for all button handlers
- Add ManagementLinkTest and ResourceManagementTest (28 tests)
* update docs
* ran spotless
* fix: add write permission for issues in auto-label PR workflow
* fix: change pull_request to pull_request_target for auto-label workflow
* revert auto label changes
* Rerun CI
* Updates:
1. Add back the sidebar entry using `LockableResourcesSidebarLink.java`
2. Add the search along with advanced filters with reload on persist
* feat: implement horizontal scrolling for tables and adjust pagination controls
* refactor: update resources table layout for better overflow handling
* refactor: align action buttons to the start in resources table
* Pulling the changes from #1033, aligning them with new UI, and many more enhancements that I am lazy to type it out
* feat: implement server-side pagination for queue items and enhance UI components
* enable scrollable on queues table again
* Minor UI fixes which will make it look and feel better and responsive
* fix: ensure case-insensitive filtering uses Locale.ENGLISH for consistency
* fix: improve row selection logic in pagination to enhance filtering accuracy
* feat: enhance resource management tests with queue page functionality and server-side filters
* fix: update reservedBy display to link to user profile in resource table
* remove queued resource handling from UI and calculations for clarity
* Add overview queue metrics, clickable filter navigation, and fix note form
- Add queue card metrics: longest waiting build with duration, most contended resource with build count
- Make overview pills clickable: legend pills filter by status, label pills filter by label, resource name links filter by name
- Add clearResourceFilters() helper to reset all filters before applying a new one from overview navigation
- Fix pre-existing bug: note preview never worked because evalInnerHtmlScripts was missing (scripts in AJAX response weren't executed, so Behaviour rules for preview never registered)
- Fix note form save redirecting to overview tab: intercept form submit via AJAX and reload with tab hash preserved
- Fix note preview/hide-preview links navigating away from page
- Wire evalInnerHtmlScripts for note form so preview works in AJAX-loaded content
- Normalize pill hover behavior (consistent translateY lift)
- Add /jsbundles/ to .gitignore
* Rerun CI
* Add fine-grained permission model and fixed the dual-layout support
Add CONFIGURE permission to the existing Lockable Resources permission
group for resource CRUD operations. Previously create/edit/delete
required Jenkins.ADMINISTER directly.
Permission defaults (impliedBy):
- View: Jenkins.READ (any authenticated user can see resource status)
- All others: Jenkins.ADMINISTER (preserves existing behavior)
Admins can now delegate individual permissions to roles without
granting full admin access.
Changes:
- Convert LockableResourcesRootAction from ManagementLink to RootAction
for direct access at /lockable-resources/ without requiring
Jenkins.MANAGE
- Add LockableResourcesManagementLink so the plugin remains listed in
Manage Jenkins sidebar under Configuration
- Render with settings-subpage layout (Manage Jenkins sidebar) when
accessed via /manage/lockable-resources/, plain layout otherwise
- Add CONFIGURE permission gating create/edit/delete resource endpoints
(previously Jenkins.ADMINISTER)
- Gate edit and delete buttons in resource table on CONFIGURE permission
- Extract shared page content to _content.jelly fragment with
localization property files for all supported locales
- Remove redundant LockableResourcesSidebarLink
- Add tests for VIEW permission access, Jenkins.READ implied access,
and denial without READ
* fix: enhance access control test to handle login redirects
* update docs
* fix: apply spotless formatting to ManagementLink and ResourceManagementTest
---------
Co-authored-by: Aditya Jalkhare <Aditya.Jalkhare@cognyte.com>
Co-authored-by: Martin Pokorny <89339813+mPokornyETM@users.noreply.github.com>1 parent e764e2d commit 2c727bb
37 files changed
Lines changed: 4282 additions & 613 deletions
File tree
- src
- main
- java/org/jenkins/plugins/lockableresources/actions
- resources/org/jenkins/plugins/lockableresources
- LockableResourcesManager
- LockableResource
- actions
- LockableResourcesRootAction
- tableLabels
- tableQueue
- tableResources
- LockedResourcesBuildAction
- webapp
- css
- js
- test/java/org/jenkins/plugins/lockableresources
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| 6 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
35 | | - | |
36 | | - | |
37 | | - | |
| 35 | + | |
| 36 | + | |
38 | 37 | | |
39 | 38 | | |
40 | 39 | | |
| |||
47 | 46 | | |
48 | 47 | | |
49 | 48 | | |
50 | | - | |
| 49 | + | |
51 | 50 | | |
52 | 51 | | |
53 | 52 | | |
| |||
397 | 396 | | |
398 | 397 | | |
399 | 398 | | |
400 | | - | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
401 | 406 | | |
402 | 407 | | |
403 | 408 | | |
404 | | - | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
405 | 412 | | |
406 | 413 | | |
407 | 414 | | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
408 | 418 | | |
409 | 419 | | |
410 | 420 | | |
| |||
421 | 431 | | |
422 | 432 | | |
423 | 433 | | |
424 | | - | |
| 434 | + | |
425 | 435 | | |
426 | 436 | | |
427 | 437 | | |
| |||
433 | 443 | | |
434 | 444 | | |
435 | 445 | | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
436 | 461 | | |
437 | 462 | | |
438 | 463 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
83 | 83 | | |
84 | 84 | | |
85 | 85 | | |
86 | | - | |
87 | | - | |
88 | | - | |
89 | | - | |
90 | 86 | | |
91 | 87 | | |
92 | 88 | | |
| |||
Lines changed: 65 additions & 0 deletions
| 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 | + | |
0 commit comments