Skip to content

Commit f9c64f9

Browse files
authored
Fix Prettier violations (#522)
1 parent 50bca8f commit f9c64f9

32 files changed

+130
-119
lines changed

src/main/frontend/common/RestClient.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,11 +74,11 @@ export async function getRunSteps(): Promise<StepInfo[] | null> {
7474

7575
export async function getConsoleTextOffset(
7676
stepId: string,
77-
startByte: number
77+
startByte: number,
7878
): Promise<ConsoleLogData | null> {
7979
try {
8080
let response = await fetch(
81-
`consoleOutput?nodeId=${stepId}&startByte=${startByte}`
81+
`consoleOutput?nodeId=${stepId}&startByte=${startByte}`,
8282
);
8383
if (!response.ok) throw response.statusText;
8484
let json = await response.json();

src/main/frontend/multi-pipeline-graph-view/multi-pipeline-graph/main/support/startPollingRunsStatus.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { RunInfo } from "../MultiPipelineGraphModel";
77
export default function startPollingRunsStatus(
88
onFetchSuccess: (data: Array<RunInfo>) => void,
99
onFetchError: (err: Error) => void,
10-
interval = 10000
10+
interval = 10000,
1111
) {
1212
let path = "runs";
1313

src/main/frontend/multi-pipeline-graph-view/multi-pipeline-graph/styles/variables.scss

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ $status-failure: #d54c53;
77
$status-paused: #24b0d5;
88
$status-unknown: #d54cc4;
99

10-
$graph-connector-grey: color-mix(in srgb, var(--text-color-secondary), var(--background));
10+
$graph-connector-grey: color-mix(
11+
in srgb,
12+
var(--text-color-secondary),
13+
var(--background)
14+
);
1115
$progress-bg: #a7c7f2;
1216
$progress-bar-color: #1d7dcf;

src/main/frontend/pipeline-console-view/app.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { FunctionComponent } from "react";
55
import { CircularProgress } from "@mui/material";
66

77
const PipelineConsole = lazy(
8-
() => import("./pipeline-console/main/PipelineConsole")
8+
() => import("./pipeline-console/main/PipelineConsole"),
99
);
1010

1111
const App: FunctionComponent = () => {

src/main/frontend/pipeline-console-view/pipeline-console/main/Ansi.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ export function tokenizeANSIString(input?: string): string[] | Result[] {
156156

157157
// TODO fix type checking
158158
const parsedEscapeCode: any = parseEscapeCode(
159-
input.substring(loopCounter, escapeCodeIndex + 1)
159+
input.substring(loopCounter, escapeCodeIndex + 1),
160160
);
161161
result.push(parsedEscapeCode);
162162

@@ -181,7 +181,7 @@ export function tokenizeANSIString(input?: string): string[] | Result[] {
181181
*/
182182
export function makeReactChildren(
183183
tokenizedInput: string[] | Result[],
184-
key: string
184+
key: string,
185185
) {
186186
const result = [];
187187
let currentState: Result = {
@@ -198,7 +198,7 @@ export function makeReactChildren(
198198
<div
199199
dangerouslySetInnerHTML={{ __html: codeOrString }}
200200
key={`${key}-${i}`}
201-
/>
201+
/>,
202202
);
203203
} else {
204204
const classNames = [];
@@ -211,7 +211,7 @@ export function makeReactChildren(
211211
}
212212

213213
result.push(
214-
<span className={classNames.join(" ")}>{codeOrString}</span>
214+
<span className={classNames.join(" ")}>{codeOrString}</span>,
215215
);
216216
}
217217
} else if (codeOrString.isSelectGraphicRendition) {

src/main/frontend/pipeline-console-view/pipeline-console/main/ConsoleLine.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ export const ConsoleLine = (props: ConsoleLineProps) => {
4242
<div className="console-text">
4343
{makeReactChildren(
4444
tokenizeANSIString(props.content),
45-
`${props.stepId}-${props.lineNumber}`
45+
`${props.stepId}-${props.lineNumber}`,
4646
)}
4747
</div>
4848
</div>

src/main/frontend/pipeline-console-view/pipeline-console/main/ConsoleLogCard.spec.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/** * @jest-environment jsdom */
22

3-
import '@testing-library/jest-dom';
3+
import "@testing-library/jest-dom";
44
import React from "react";
55
import { ConsoleLogCard } from "./ConsoleLogCard";
66
import type { ConsoleLogCardProps } from "./ConsoleLogCard";
@@ -59,7 +59,7 @@ describe("ConsoleLogCard", () => {
5959

6060
it("renders step console when expanded", async () => {
6161
const { getByText, findByText } = render(
62-
<ConsoleLogCard {...DefaultTestProps} />
62+
<ConsoleLogCard {...DefaultTestProps} />,
6363
);
6464
expect(getByText(/This is a step/));
6565
expect(findByText(/Hello, world!/));
@@ -69,15 +69,15 @@ describe("ConsoleLogCard", () => {
6969
console.log = jest.fn();
7070
render(<ConsoleLogCard {...DefaultTestProps} isExpanded={true} />);
7171
expect(console.log).toHaveBeenCalledWith(
72-
"handleMoreConsoleClick triggered"
72+
"handleMoreConsoleClick triggered",
7373
);
7474
});
7575

7676
it("does not call handleMoreConsoleClick on load was card isExpanded set", async () => {
7777
console.log = jest.fn();
7878
render(<ConsoleLogCard {...DefaultTestProps} />);
7979
expect(console.log).not.toHaveBeenCalledWith(
80-
"handleMoreConsoleClick triggered"
80+
"handleMoreConsoleClick triggered",
8181
);
8282
});
8383
});

src/main/frontend/pipeline-console-view/pipeline-console/main/ConsoleLogCard.tsx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ export class ConsoleLogCard extends React.Component<
8585
// If we start expanded then request logs.
8686
this.props.handleMoreConsoleClick(
8787
this.props.step.id,
88-
this.props.stepBuffer.startByte
88+
this.props.stepBuffer.startByte,
8989
);
9090
}
9191
}
@@ -97,7 +97,7 @@ export class ConsoleLogCard extends React.Component<
9797
<Grid item xs={6} sm className="show-more-console">
9898
<Typography align="right" className="step-header">
9999
{`Missing ${this.prettySizeString(
100-
this.props.stepBuffer.startByte
100+
this.props.stepBuffer.startByte,
101101
)} of logs.`}
102102
</Typography>
103103
</Grid>
@@ -109,14 +109,14 @@ export class ConsoleLogCard extends React.Component<
109109
let startByte =
110110
this.props.stepBuffer.startByte - LOG_FETCH_SIZE;
111111
console.debug(
112-
`startByte '${this.props.stepBuffer.startByte}' -> '${startByte}'`
112+
`startByte '${this.props.stepBuffer.startByte}' -> '${startByte}'`,
113113
);
114114
if (startByte < 0) {
115115
startByte = 0;
116116
}
117117
this.props.handleMoreConsoleClick(
118118
this.props.step.id,
119-
startByte
119+
startByte,
120120
);
121121
}}
122122
>
@@ -167,7 +167,7 @@ export class ConsoleLogCard extends React.Component<
167167
const statusIcon = getStepStatus(
168168
this.props.step.state,
169169
this.props.step.completePercent,
170-
10
170+
10,
171171
);
172172

173173
return (
@@ -209,7 +209,7 @@ export class ConsoleLogCard extends React.Component<
209209
</Typography>
210210
{this.getStepHeaderTitle(
211211
this.props.step.title,
212-
this.props.step.id
212+
this.props.step.id,
213213
)}
214214
</Grid>
215215
<Grid
@@ -227,7 +227,7 @@ export class ConsoleLogCard extends React.Component<
227227
>
228228
{this.props.step.totalDurationMillis.substring(
229229
this.props.step.totalDurationMillis.indexOf(" ") + 1,
230-
this.props.step.totalDurationMillis.length
230+
this.props.step.totalDurationMillis.length,
231231
)}
232232
</Typography>
233233
</Grid>

src/main/frontend/pipeline-console-view/pipeline-console/main/ConsoleLogModal.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ export default function ConsoleLogModal(props: ConsoleLogModelProps) {
3838
const statusIcon = getStepStatus(
3939
props.step.state,
4040
props.step.completePercent,
41-
10
41+
10,
4242
);
4343
const stepDisplayName = props.step.name;
4444
const stepTitle = props.step.title ? " - " + props.step.title : "";

src/main/frontend/pipeline-console-view/pipeline-console/main/ConsoleLogStream.spec.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/** * @jest-environment jsdom */
22

3-
import '@testing-library/jest-dom';
3+
import "@testing-library/jest-dom";
44
import React, { ReactElement } from "react";
55
import ConsoleLogStream, { ConsoleLogStreamProps } from "./ConsoleLogStream";
66
import { Result, StepInfo, StepLogBufferInfo } from "./PipelineConsoleModel";

src/main/frontend/pipeline-console-view/pipeline-console/main/ConsoleLogStream.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ export default function ConsoleLogStream(props: ConsoleLogStreamProps) {
128128
appendInterval.current = setInterval(() => {
129129
props.handleMoreConsoleClick(
130130
props.step.id,
131-
props.logBuffer.startByte
131+
props.logBuffer.startByte,
132132
);
133133
}, 1000);
134134
console.debug(`Received more text '${bottom} - ${stickToBottom}'`);

src/main/frontend/pipeline-console-view/pipeline-console/main/DataTreeView.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import StepStatus from "../../../step-status/StepStatus";
88

99
const getTreeItemsFromStage = (
1010
stageItems: StageInfo[],
11-
selectedStage: string
11+
selectedStage: string,
1212
) => {
1313
return stageItems.map((stageItemData) => {
1414
let children: JSX.Element[] = [];

src/main/frontend/pipeline-console-view/pipeline-console/main/PipelineConsole.spec.tsx

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/** * @jest-environment jsdom */
22

3-
import '@testing-library/jest-dom';
3+
import "@testing-library/jest-dom";
44
import React from "react";
55
import {
66
default as PipelineConsole,
@@ -82,21 +82,21 @@ jest.mock("./StageView", () => {
8282
describe("getDefaultSelectedStep", () => {
8383
it("selects last successful step", async () => {
8484
const selectedStep = getDefaultSelectedStep(
85-
allSuccessfulStepList
85+
allSuccessfulStepList,
8686
) as StepInfo;
8787
expect(selectedStep.id).toEqual("21");
8888
});
8989

9090
it("selects first errored step", async () => {
9191
const selectedStep = getDefaultSelectedStep(
92-
multipleErrorsStepList
92+
multipleErrorsStepList,
9393
) as StepInfo;
9494
expect(selectedStep.id).toEqual("11");
9595
});
9696

9797
it("selects errored step over unstable", async () => {
9898
const selectedStep = getDefaultSelectedStep(
99-
unstableThenFailureStepList
99+
unstableThenFailureStepList,
100100
) as StepInfo;
101101
expect(selectedStep.id).toEqual("12");
102102
});
@@ -108,7 +108,7 @@ describe("getDefaultSelectedStep", () => {
108108

109109
it("selects first running step", async () => {
110110
const selectedStep = getDefaultSelectedStep(
111-
multipleRunningSteps
111+
multipleRunningSteps,
112112
) as StepInfo;
113113
expect(selectedStep.id).toEqual("10");
114114
});
@@ -185,7 +185,7 @@ describe("PipelineConsole", () => {
185185
selected: "3",
186186
stages: defaultStagesList,
187187
},
188-
{}
188+
{},
189189
);
190190
});
191191

@@ -204,7 +204,7 @@ describe("PipelineConsole", () => {
204204
stepBuffers: expect.any(Map),
205205
steps: findStageSteps(allSuccessfulStepList, 3),
206206
},
207-
{}
207+
{},
208208
);
209209
});
210210

@@ -224,7 +224,7 @@ describe("PipelineConsole", () => {
224224
stepBuffers: expect.any(Map),
225225
steps: findStageSteps(allSuccessfulStepList, 1),
226226
},
227-
{}
227+
{},
228228
);
229229
});
230230

@@ -244,7 +244,7 @@ describe("PipelineConsole", () => {
244244
stepBuffers: expect.any(Map),
245245
steps: findStageSteps(allSuccessfulStepList, 3),
246246
},
247-
{}
247+
{},
248248
);
249249
});
250250

@@ -264,7 +264,7 @@ describe("PipelineConsole", () => {
264264
stepBuffers: expect.any(Map),
265265
steps: findStageSteps(allSuccessfulStepList, 0),
266266
},
267-
{}
267+
{},
268268
);
269269
});
270270
});

0 commit comments

Comments
 (0)