keremoge commented on code in PR #9386:
URL: https://github.com/apache/devlake/pull/9386#discussion_r4550404150
##########
config-ui/src/plugins/register/azure/config.tsx:
##########
@@ -88,11 +88,28 @@ export const AzureGoConfig: IPluginConfig = {
initialValues: {},
fields: [
'name',
- ({ values, setValues }: any) => (
- <BaseURL key="base-url" value={values.endpoint} onChange={(val) =>
setValues({ endpoint: val })} />
+ ({
+ initialValues,
+ values,
+ setValues,
+ setErrors,
+ }: {
+ initialValues: { endpoint?: string };
+ values: { endpoint?: string };
+ setValues: (values: { endpoint: string }) => void;
+ setErrors: (errors: { endpoint: string }) => void;
+ }) => (
+ <BaseURL
+ key="base-url"
+ initialValue={initialValues.endpoint ?? ''}
+ value={values.endpoint}
+ onChange={(val) => setValues({ endpoint: val })}
+ setError={(error) => setErrors({ endpoint: error })}
Review Comment:
No production change is needed here: the shared connection form already
provides a merging error setter, not the raw React state setter. Endpoint
validation therefore preserves other fields’ errors. Added a regression test
confirming this behavior; all five connection-field tests pass.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]