Skip to content

Commit

Permalink
Dbz 4146 (debezium#399)
Browse files Browse the repository at this point in the history
* use backend call to get the transform list

* update

* removed mock data

* Adding api error handling

* Review fix
  • Loading branch information
indraraj authored Nov 8, 2021
1 parent e3e8e4c commit a50ff96
Show file tree
Hide file tree
Showing 9 changed files with 176 additions and 355 deletions.
10 changes: 10 additions & 0 deletions ui/packages/services/src/connector/connector.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -189,4 +189,14 @@ export class ConnectorService extends BaseService {
return this.httpPost(endpoint, body);
}

/**
* Get the transform list and their properties for supplied clusterId
*/
public getTransform(clusterId: number): Promise<any[]> {
this.logger?.info("[ConnectorService] Getting the list of transform.");

const endpoint: string = this.endpoint("/:clusterId/transforms.json", { clusterId });
return this.httpGet<Connector[]>(endpoint);
}

}
214 changes: 0 additions & 214 deletions ui/packages/ui/assets/mockResponse/transform.json

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,9 @@ export const TransformCard = React.forwardRef<any, ITransformCardProps>((props,
)}
</SplitItem>
<SplitItem>
<Tooltip content={<div>{t('deleteTransform')}</div>}>
<Button variant="link" icon={<TrashIcon />} onClick={deleteCard} id="tooltip-selector" />
</Tooltip>
</SplitItem>
</Split>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,10 @@ export const TransformConfig = React.forwardRef<any, ITransformConfigProps>((pro
} else if (key.type === 'INT') {
basicValidationSchema[key.name] = Yup.string();
}
if (key.isMandatory) {
basicValidationSchema[key.name] = basicValidationSchema[key.name].required(`${key.displayName} required`);
}
// TODO: isMandatory is missing in backend response
// if (key.isMandatory) {
// basicValidationSchema[key.name] = basicValidationSchema[key.name].required(`${key.title} required`);
// }
});
const validationSchema = Yup.object().shape({ ...basicValidationSchema });

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -719,6 +719,7 @@ export const CreateConnectorComponent: React.FunctionComponent<ICreateConnectorC
updateTransformValues={handleTransformsUpdate}
setIsTransformDirty={setIsTransformDirty}
selectedConnectorType={selectedConnectorType || ''}
clusterId={props.clusterId}
/>
</>
),
Expand Down
Loading

0 comments on commit a50ff96

Please sign in to comment.