Skip to content

Use custom rendering for input step#866

Merged
timja merged 16 commits intojenkinsci:mainfrom
timja:custom-input-step
Jun 30, 2025
Merged

Use custom rendering for input step#866
timja merged 16 commits intojenkinsci:mainfrom
timja:custom-input-step

Conversation

@timja
Copy link
Member

@timja timja commented Jun 26, 2025

Fixes #568

Only thing thats a bit weird is that after approving it shows the built-in ui but not too bad:

image

Testing done

Manual and automated testing

Parameters (no change):

image

Input (no args):

image

Input (modified labels):

image

Submitter checklist

  • Make sure you are opening from a topic/feature/bugfix branch (right side) and not your main branch!
  • Ensure that the pull request title represents the desired changelog entry
  • Please describe what you did
  • Link to relevant issues in GitHub or Jira
  • Link to relevant pull requests, esp. upstream and downstream changes
  • Ensure you have provided tests that demonstrate the feature works or the issue is fixed

@@ -0,0 +1,3 @@
package io.jenkins.plugins.pipelinegraphview.utils;

public record PipelineInputStep(String message, String cancel, String id, String ok, boolean parameters) {}
Copy link
Member Author

Choose a reason for hiding this comment

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

jackson with our current config can't serialise the parameters object (if not more) so just map what we need

<groupId>io.jenkins.tools.bom</groupId>
<artifactId>bom-${jenkins.baseline}.x</artifactId>
<version>4136.vca_c3202a_7fd1</version>
<version>4948.vcf1d17350668</version>
Copy link
Member Author

Choose a reason for hiding this comment

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

version we had in bom had an old version of pipeline-input-step which didn't allow the custom cancel text

@timja timja added the bug Something isn't working label Jun 28, 2025
@timja timja marked this pull request as ready for review June 28, 2025 21:05
@timja timja requested a review from a team as a code owner June 28, 2025 21:05
@timja timja force-pushed the custom-input-step branch from c28d718 to 5573b02 Compare June 29, 2025 21:23
completePercent: number;
inputStep?: InputStep;
id: string;
type: string;
Copy link
Contributor

Choose a reason for hiding this comment

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

What are the values of type? Could it be set to input instead of a new field?

Copy link
Member Author

Choose a reason for hiding this comment

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

its STEP, it could be but I need a number of fields anyway

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah, I missed deleting this comment after a further look through the rest of the code

headers: (window as any).crumb.wrap({}),
})
.then((res) => {
console.log(res);
Copy link
Contributor

Choose a reason for hiding this comment

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

To remove

Copy link
Member Author

Choose a reason for hiding this comment

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

that better now?

onClick={ok}
className={"jenkins-button jenkins-button--primary"}
>
{inputStep.ok}
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't know much about the plugin but are there alternatives to just abort/proceed? I feel like I remember in a previous project we had a text input at some point

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes those are parameters, the existing behaviour provides a regular link that takes you to the page with parameters. (the one you made prettier recently)

image

Copy link
Member Author

@timja timja Jun 30, 2025

Choose a reason for hiding this comment

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

(we could do the parameters page inline like in blueocean but that's a bigger change and may have the risk of re-renders occurring breaking things when new polls happen)

@janfaracik
Copy link
Member

janfaracik commented Jun 30, 2025

image

Any thoughts on visually grouping the label/controls? Having both be hoverable feels a bit off to me.

@janfaracik
Copy link
Member

image

Updated the confirmation so that its no longer collapsible, happy to add the time/open in new tab links if needed.

@timja timja enabled auto-merge (squash) June 30, 2025 10:30
@timja timja merged commit 1efd7e2 into jenkinsci:main Jun 30, 2025
16 of 17 checks passed
@timja timja deleted the custom-input-step branch June 30, 2025 10:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Proceed and Abort links are broken in pipeline-console

3 participants