Skip to content

Fix prettier issues #569

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

Merged
merged 1 commit into from
Jan 14, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,22 +1,24 @@
import React from "react";

export interface StageNodeLinkProps {
agent: string;
agent: string;
}

function getAgentUrl(name: string) {
// Wrap built-in in brackets
const id = name == "built-in" ? "(built-in)" : name;
const rootPath = document.head.dataset.rooturl
return `${rootPath}/computer/${id}/`;
// Wrap built-in in brackets
const id = name == "built-in" ? "(built-in)" : name;
const rootPath = document.head.dataset.rooturl;
return `${rootPath}/computer/${id}/`;
}

const StageNodeLink = ({agent}: StageNodeLinkProps) => {
const agentName = agent == "built-in" ? "Jenkins" : agent;
const href = getAgentUrl(agent);
return <>
Running on <a href={href}>{agentName}</a>
const StageNodeLink = ({ agent }: StageNodeLinkProps) => {
const agentName = agent == "built-in" ? "Jenkins" : agent;
const href = getAgentUrl(agent);
return (
<>
Running on <a href={href}>{agentName}</a>
</>
);
};

export default StageNodeLink;
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,7 @@ const StageSummary = (props: StageSummaryProps) => (
className="detail-icon"
key={`stage-detail-agent-icon-${props.stage.id}`}
/>
<span
key={`stage-detail-agent-text-${props.stage.id}`}
>
<span key={`stage-detail-agent-text-${props.stage.id}`}>
<StageNodeLink agent={props.stage.agent} />
</span>
</div>
Expand Down
Loading