diff --git a/frontend/apps/web/app/(mgmt)/[account]/jobs/[id]/source/components/DataGenConnectionCard.tsx b/frontend/apps/web/app/(mgmt)/[account]/jobs/[id]/source/components/DataGenConnectionCard.tsx
index 5da58a8417..ece66a947a 100644
--- a/frontend/apps/web/app/(mgmt)/[account]/jobs/[id]/source/components/DataGenConnectionCard.tsx
+++ b/frontend/apps/web/app/(mgmt)/[account]/jobs/[id]/source/components/DataGenConnectionCard.tsx
@@ -70,6 +70,7 @@ import {
import SchemaPageSkeleton from './SchemaPageSkeleton';
import { useOnApplyDefaultClick } from './useOnApplyDefaultClick';
import { useOnImportMappings } from './useOnImportMappings';
+import { useOnTransformerBulkUpdateClick } from './useOnTransformerBulkUpdateClick';
import {
getFilteredTransformersForBulkSet,
getOnSelectedTableToggle,
@@ -290,24 +291,34 @@ export default function DataGenConnectionCard({ jobId }: Props): ReactElement {
getMappings() {
return form.getValues('mappings');
},
- setTransformer: onTransformerUpdate,
+ setMappings(mappings) {
+ form.setValue('mappings', mappings, {
+ shouldDirty: true,
+ shouldTouch: true,
+ shouldValidate: false,
+ });
+ },
constraintHandler: schemaConstraintHandler,
triggerUpdate() {
form.trigger('mappings');
},
});
- function onTransformerBulkUpdate(
- indices: number[],
- config: JobMappingTransformerForm
- ): void {
- indices.forEach((idx) => {
- onTransformerUpdate(idx, config);
- });
- setTimeout(() => {
+ const { onClick: onTransformerBulkUpdate } = useOnTransformerBulkUpdateClick({
+ getMappings() {
+ return form.getValues('mappings');
+ },
+ setMappings(mappings) {
+ form.setValue('mappings', mappings, {
+ shouldDirty: true,
+ shouldTouch: true,
+ shouldValidate: false,
+ });
+ },
+ triggerUpdate() {
form.trigger('mappings');
- }, 0);
- }
+ },
+ });
if (isJobLoading || isSchemaDataMapLoading || isGetTransformersLoading) {
return