From a54fca73c9778d29d7f6a5845e332db9a5d9d9b9 Mon Sep 17 00:00:00 2001 From: Tim Jacomb Date: Mon, 18 May 2026 22:08:55 +0100 Subject: [PATCH 1/2] Refine macros page --- pom.xml | 6 +- .../RoleStrategyConfig/list-macros.jelly | 125 ++++++------------ src/main/webapp/css/role-strategy.css | 94 ++++++++++++- 3 files changed, 133 insertions(+), 92 deletions(-) diff --git a/pom.xml b/pom.xml index 7a42ecc7..11e1be19 100644 --- a/pom.xml +++ b/pom.xml @@ -32,8 +32,8 @@ 999999-SNAPSHOT - 2.479 - ${jenkins.baseline}.3 + 2.555 + ${jenkins.baseline}.1 jenkinsci/${project.artifactId}-plugin 13.0.0 640 @@ -45,7 +45,7 @@ io.jenkins.tools.bom bom-${jenkins.baseline}.x - 5054.v620b_5d2b_d5e6 + 6453.v115ff6f496dd pom import diff --git a/src/main/resources/com/michelin/cio/hudson/plugins/rolestrategy/RoleStrategyConfig/list-macros.jelly b/src/main/resources/com/michelin/cio/hudson/plugins/rolestrategy/RoleStrategyConfig/list-macros.jelly index 53b51e24..a7754b59 100644 --- a/src/main/resources/com/michelin/cio/hudson/plugins/rolestrategy/RoleStrategyConfig/list-macros.jelly +++ b/src/main/resources/com/michelin/cio/hudson/plugins/rolestrategy/RoleStrategyConfig/list-macros.jelly @@ -22,87 +22,48 @@ - THE SOFTWARE. --> - + + + + +

+ Macros extend access rights analysis and can be used in the pattern field. +

+

+ Format: + @macroName[:id][(param1, param2)] + — e.g. @BuildableJob, @BuildableJob:1, + @Folder(folderName) +

+
+
+ + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- ${%Name} - - ${%Applicable Role Types} - - ${%Description} -
GLOBALITEMAGENT
${macroExt.getName()}${macroExt.IsApplicable(it.globalRoleType)}${macroExt.IsApplicable(it.projectRoleType)}${macroExt.IsApplicable(it.slaveRoleType)}
-
-
- - - - - - - - -

- ${%Role-Strategy Macros Info} -

-

Macros allow to extend the analysis of user access rights (see @RoleMacroExtension). - If a user's sid meets criteria in Roles and Assignments, then analysis will be propagated to the extension, - which makes decisions according to instance and parameters. -

-

${%Macro usage}

-
- Macro format: @macroName[:id][(parameter1, parameter2, ...)]> -
    -
  • macroName - name of the macro (see available macros in the table below)
  • -
  • id - identifier of the macro. Technical parameter, which allows to use the same macro for multiple patterns
  • -
  • parameter - additional parameters. At the current state, they don't support variables or TokenMacros
  • -
- -

Macro string examples:

-
    -
  • @BuildableJob - Primitive macro invocation. Such invocation can be used only once in each roles category.
  • -
  • @BuildableJob:1 - Macro with id
  • -
  • @ParameterizedMacro(param1) - Invokes macro with one parameter
  • -
  • @ParameterizedMacro:2(param1,param2) - Invokes macro with two parameters. Id prevents naming conflicts
  • -
-
-

${%Available Macros}

-

The listed macros can be used in the "Role" field of the "Manage Roles" page.

- -
-
+ + +
+ +
+
+ @${macroExt.getName()} + + Global + + + Item + + + Agent + + + + +
+
+
+
+ +
diff --git a/src/main/webapp/css/role-strategy.css b/src/main/webapp/css/role-strategy.css index 20d64607..676add6b 100644 --- a/src/main/webapp/css/role-strategy.css +++ b/src/main/webapp/css/role-strategy.css @@ -23,6 +23,86 @@ * THE SOFTWARE. */ +/* ============================================ + Cards + ============================================ */ + +.rsp-cards { + display: flex; + flex-direction: column; +} + +.rsp-card { + border: var(--jenkins-border); + border-radius: var(--form-input-border-radius); + background: var(--card-background); + overflow: hidden; +} + +/* Connected borders: adjacent cards share an edge, flat between them. */ +.rsp-card + .rsp-card { + border-top-left-radius: 0; + border-top-right-radius: 0; + border-top: none; +} + +.rsp-card:has(+ .rsp-card) { + border-bottom-left-radius: 0; + border-bottom-right-radius: 0; +} + +/* ============================================ + Card Header + ============================================ */ + +.rsp-card__header { + display: flex; + flex-wrap: nowrap; + align-items: center; + gap: 0.75rem; + padding: 0.5rem 0.5rem 0.5rem 0.75rem; + min-width: 0; + transition: background var(--standard-transition); +} + +.rsp-card__header:hover { + background: var(--item-background--hover); +} + +.rsp-card__header:active { + background: var(--item-background--active); +} + +.rsp-card__name { + font-weight: var(--font-bold-weight); + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; + flex-shrink: 1; + min-width: 0; + color: var(--text-color); +} + +.rsp-card__template-badge { + font-size: 0.75rem; + padding: 0.125rem 0.375rem; + border-radius: 0.25rem; + background: var(--item-background--hover); + color: var(--text-color-secondary); + white-space: nowrap; + flex-shrink: 0; +} + +.rsp-card__summary { + flex: 1; + min-width: 0; + overflow: hidden; + text-overflow: ellipsis; + color: var(--text-color-secondary); + font-size: 0.875rem; +} + +/* Legacy styles */ .role-strategy-table { border-spacing: 2px; } @@ -131,8 +211,8 @@ label.attach-previous { } .jenkins-checkbox { - vertical-align: middle; - margin: 3px 0px; + vertical-align: middle; + margin: 3px 0px; } @keyframes highlightentry { @@ -147,12 +227,12 @@ label.attach-previous { } .jenkins-alert { - margin-top: 10px; + margin-top: 10px; } .rsp-entry-not-found { - text-decoration: line-through; - color: grey; + text-decoration: line-through; + color: grey; } .rsp-table__icon-alert { @@ -185,7 +265,7 @@ button.migrate { } .patternAnchor:hover { - text-decoration: var(--link-text-decoration--hover); + text-decoration: var(--link-text-decoration--hover); } .row-filter, .user-filter, .role-filter { @@ -202,4 +282,4 @@ button.migrate { .rsp-navigation__entries .jenkins-select { max-width: 5rem; -} \ No newline at end of file +} From 82120605dab8c97f205a32ac49bceb610a143d62 Mon Sep 17 00:00:00 2001 From: Tim Jacomb Date: Tue, 19 May 2026 07:15:41 +0100 Subject: [PATCH 2/2] Address review comments --- .../plugins/rolestrategy/RoleStrategyConfig/list-macros.jelly | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/resources/com/michelin/cio/hudson/plugins/rolestrategy/RoleStrategyConfig/list-macros.jelly b/src/main/resources/com/michelin/cio/hudson/plugins/rolestrategy/RoleStrategyConfig/list-macros.jelly index a7754b59..09cac5e2 100644 --- a/src/main/resources/com/michelin/cio/hudson/plugins/rolestrategy/RoleStrategyConfig/list-macros.jelly +++ b/src/main/resources/com/michelin/cio/hudson/plugins/rolestrategy/RoleStrategyConfig/list-macros.jelly @@ -27,7 +27,7 @@

- Macros extend access rights analysis and can be used in the pattern field. + Macros extend access rights analysis and are used in the role field.

Format: