Skip to content

Commit 14c1fc7

Browse files
authored
Remove required column and use a red * instead (#154)
* Remove required column and use a red * instead * Move the * to the name
1 parent b06ea30 commit 14c1fc7

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

src/components/APIDoc/ParameterView.tsx

+11-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React from "react"
22
import { OpenAPIV3 } from 'openapi-types';
3-
import { Text, TextContent, TextVariants } from '@patternfly/react-core';
3+
import {Flex, FlexItem, Text, TextContent, TextVariants} from '@patternfly/react-core';
44
import { TableComposable, Tbody, Td, Thead, Tr } from "@patternfly/react-table";
55
import { deRef } from "../../utils/Openapi";
66

@@ -21,16 +21,23 @@ export const ParameterView: React.FunctionComponent<ParameterViewProps> = ({titl
2121
<Tr>
2222
<Td>Name</Td>
2323
<Td>Type</Td>
24-
<Td>Required</Td>
2524
<Td>Description</Td>
2625
</Tr>
2726
</Thead>
2827
<Tbody>
2928
{parameters.map(((p, index) => (
3029
<Tr key={index}>
31-
<Td>{p.name}</Td>
30+
<Td>
31+
<Flex>
32+
<FlexItem className="pf-u-mr-xs">
33+
<Text component={TextVariants.p}>{p.name}</Text>
34+
</FlexItem>
35+
<FlexItem>
36+
<Text component={TextVariants.p} className="pf-u-danger-color-100">{p.required && "*"}</Text>
37+
</FlexItem>
38+
</Flex>
39+
</Td>
3240
<Td>{getType(p.schema, document)}</Td>
33-
<Td>{p.required ? 'Yes' : 'No'}</Td>
3441
<Td>{p.description}</Td>
3542
</Tr>
3643
)))}

0 commit comments

Comments
 (0)