Skip to content
This repository was archived by the owner on Jun 13, 2024. It is now read-only.

Commit 582b356

Browse files
authored
fix: propagate props to field property (#243)
1 parent ddb58ae commit 582b356

4 files changed

Lines changed: 15 additions & 7 deletions

File tree

src/components/atoms/form/MatrixProperty.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,9 +78,10 @@ export const MatrixProperty = ({
7878
}
7979
render={(arrayHelper) => (
8080
<FieldlessListProperty
81+
{...props}
8182
description={props.description}
8283
label={label}
83-
titleFont='font-medium text-sm'
84+
titleFont="font-medium text-sm"
8485
name={
8586
namePrefix
8687
? `${namePrefix}.matrix.parameters.${name}`
@@ -97,6 +98,7 @@ export const MatrixProperty = ({
9798
/>
9899
) : (
99100
<FieldlessInspectorProperty
101+
{...props}
100102
label={label}
101103
labelClassName="h-8"
102104
description={props.description}

src/components/containers/CollapsibleList.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ const CollapsibleList = ({ titleFont, ...props }: CollapsibleListProps) => {
3535
props.onChange && props.onChange(newExpanded);
3636
}}
3737
type="button"
38+
style={{ width: 22, height: 22 }}
3839
className={`flex hover:bg-circle-gray-250 border-white border rounded px-1`}
3940
>
4041
<ExpandIcon className="w-3 h-5 mx-auto" expanded={expanded} />

src/components/containers/ParamListContainer.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { parameters } from '@circleci/circleci-config-sdk';
22
import { AnyParameterLiteral } from '@circleci/circleci-config-sdk/dist/src/lib/Components/Parameters/types/CustomParameterLiterals.types';
3+
import { Fragment } from 'react';
34
import InspectorProperty from '../atoms/form/InspectorProperty';
45
import { MatrixProperty } from '../atoms/form/MatrixProperty';
56

@@ -68,13 +69,13 @@ const ParamListContainer = ({
6869
return (
6970
<>
7071
{paramList.parameters.map((parameter, index) => {
72+
console.log(subtypes[parameter.type](parameter));
7173
return (
72-
<>
74+
<Fragment key={index}>
7375
{matrix ? (
7476
<MatrixProperty
7577
{...props}
7678
label={parameter.name}
77-
key={index}
7879
values={values}
7980
namePrefix={parent}
8081
description={parameter.description}
@@ -87,12 +88,11 @@ const ParamListContainer = ({
8788
label={parameter.name}
8889
description={parameter.description}
8990
values={values}
90-
key={index}
9191
name={parent ? `${parent}.${parameter.name}` : parameter.name}
9292
{...subtypes[parameter.type](parameter)}
9393
/>
9494
)}
95-
</>
95+
</Fragment>
9696
);
9797
})}
9898
</>

src/components/menus/definitions/OrbDefinitionsMenu.tsx

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,11 +93,16 @@ const OrbDefinitionContainer = (props: {
9393
title={props.dataMapping.name.plural || ''}
9494
>
9595
<>
96-
<div className="p-2">
96+
<div className="p-2 mb-2">
9797
<ComponentInfo type={props.dataMapping} />
9898
</div>
9999
{Object.entries(props.data).map(([name, ref]) => (
100-
<Definition key={name} type={props.dataMapping} data={ref} index={-1} />
100+
<Definition
101+
key={name}
102+
type={props.dataMapping}
103+
data={ref}
104+
index={-1}
105+
/>
101106
))}
102107
</>
103108
</CollapsibleList>

0 commit comments

Comments
 (0)