Skip to content

Commit a76b31c

Browse files
Resolve merge conflicts with openapi-diff base branch
Co-authored-by: ulrikandersen <11440456+ulrikandersen@users.noreply.github.com>
1 parent 2724866 commit a76b31c

File tree

15 files changed

+373
-428
lines changed

15 files changed

+373
-428
lines changed

src/common/ui/HighlightText.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
"use client"
2-
import React from "react"
2+
33
import { SxProps, Typography, TypographyVariant } from "@mui/material"
44
import styled from "@emotion/styled"
55

src/common/ui/SpacedList.tsx

Lines changed: 18 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,28 @@
11
import React from "react"
22
import { List, Box, SxProps } from "@mui/material"
33

4-
const SpacedList = ({
5-
itemSpacing,
6-
sx,
7-
children
8-
}: {
4+
interface SpacedListProps {
95
itemSpacing: number
106
sx?: SxProps
117
children?: React.ReactNode
12-
}) => {
8+
}
9+
10+
const SpacedList = ({ itemSpacing, sx, children }: SpacedListProps) => {
11+
const childrenArray = React.Children.toArray(children)
12+
const lastIndex = childrenArray.length - 1
13+
1314
return (
14-
<List disablePadding sx={{ ...sx }}>
15-
{React.Children.map(children, (child, idx) => {
16-
const baseKey = (child as React.ReactElement)?.key ?? "idx";
17-
const key = `${String(baseKey)}-${idx}`;
18-
return (
19-
<Box
20-
key={key}
21-
sx={{
22-
marginBottom:
23-
idx < React.Children.count(children) - 1 ? itemSpacing : 0,
24-
}}
25-
>
26-
{child}
27-
</Box>
28-
);
29-
})}
15+
<List disablePadding sx={sx}>
16+
{childrenArray.map((child, idx) => (
17+
<Box
18+
key={idx}
19+
sx={{
20+
marginBottom: idx < lastIndex ? itemSpacing : 0
21+
}}
22+
>
23+
{child}
24+
</Box>
25+
))}
3026
</List>
3127
)
3228
}

src/features/diff/data/IOasDiffCalculator.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { DiffChange } from "../domain/DiffChange";
1+
import { DiffChange } from "../domain/DiffChange"
22

33
export interface DiffResult {
44
from: string
@@ -14,5 +14,5 @@ export interface IOasDiffCalculator {
1414
path: string,
1515
baseRefOid: string,
1616
toRef: string
17-
): Promise<DiffResult>;
17+
): Promise<DiffResult>
1818
}
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { z } from "zod";
1+
import { z } from "zod"
22

33
export const DiffChangeSchema = z.object({
44
id: z.string(),
@@ -9,6 +9,6 @@ export const DiffChangeSchema = z.object({
99
path: z.string().optional(),
1010
source: z.string().optional(),
1111
section: z.string().optional(),
12-
});
12+
})
1313

14-
export type DiffChange = z.infer<typeof DiffChangeSchema>;
14+
export type DiffChange = z.infer<typeof DiffChangeSchema>

0 commit comments

Comments
 (0)