Skip to content

Commit 83daf26

Browse files
committed
Always show ConfigurationError
1 parent 745ca5a commit 83daf26

File tree

3 files changed

+14
-6
lines changed

3 files changed

+14
-6
lines changed

packages/connect-react/src/components/Errors.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,13 @@ export type ErrorsProps<T extends ConfigurableProps, U extends ConfigurableProp>
1313
export function Errors<T extends ConfigurableProps, U extends ConfigurableProp>(props: ErrorsProps<T, U>) {
1414
const { field } = props;
1515
const {
16-
errors = {}, prop = {},
16+
errors = {}, prop = {}, enableDebugging,
1717
} = field
1818

19+
if (!enableDebugging) {
20+
return null
21+
}
22+
1923
if (!errors[prop.name]) {
2024
return null
2125
}

packages/connect-react/src/components/Field.tsx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,7 @@ export function Field<T extends ConfigurableProp>(props: FieldProps<T>) {
2121
const {
2222
form, field,
2323
} = props;
24-
const {
25-
prop, enableDebugging,
26-
} = field;
24+
const { prop } = field;
2725
const {
2826
getProps, getComponents,
2927
} = useCustomize();
@@ -65,7 +63,7 @@ export function Field<T extends ConfigurableProp>(props: FieldProps<T>) {
6563
<Label text={labelText} field={field} form={form} />
6664
<Control field={field} form={form} />
6765
<Description markdown={prop.description} field={field} form={form} />
68-
{ enableDebugging && <Errors field={field} form={form} /> }
66+
<Errors field={field} form={form} />
6967
</div>
7068
);
7169
}

packages/connect-react/src/components/InternalComponentForm.tsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@ import type {
1717
ConfigurableProp, ConfigurablePropAlert,
1818
} from "@pipedream/sdk";
1919

20+
const alwaysShowSdkErrors = [
21+
"ConfigurationError",
22+
]
23+
2024
export function InternalComponentForm() {
2125
const formContext = useFormContext();
2226
const {
@@ -32,6 +36,8 @@ export function InternalComponentForm() {
3236
enableDebugging,
3337
} = formContext;
3438

39+
const showSdkErrors = enableDebugging || __sdkErrors.filter((e) => alwaysShowSdkErrors.includes(e.name)).length > 0
40+
3541
const {
3642
hideOptionalProps, onSubmit,
3743
} = formContextProps;
@@ -161,7 +167,7 @@ export function InternalComponentForm() {
161167
</div>
162168
</div>
163169
: null}
164-
{ enableDebugging && sdkErrors?.map((e, idx) => <Alert prop={e} key={idx}/>)}
170+
{ showSdkErrors && sdkErrors?.map((e, idx) => <Alert prop={e} key={idx}/>)}
165171
{onSubmit && <ControlSubmit form={formContext} />}
166172
</form>
167173
</Suspense>

0 commit comments

Comments
 (0)