Skip to content

Commit b9ee03c

Browse files
committed
Remove obsolete yup validations for dbt Cloud jobs
Since the values are now supplied by dbt Cloud via API, the user no longer has to manually input anything; and this sudden lack of user input rather obviates the need to validate user input.
1 parent 72b601d commit b9ee03c

File tree

1 file changed

+4
-25
lines changed

1 file changed

+4
-25
lines changed

airbyte-webapp/src/pages/ConnectionPage/pages/ConnectionItemPage/ConnectionTransformationTab/DbtCloudTransformationsCard.tsx

Lines changed: 4 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import { Form, Formik, FieldArray, FormikHelpers } from "formik";
55
import { ReactNode } from "react";
66
import { FormattedMessage, useIntl } from "react-intl";
77
import { Link } from "react-router-dom";
8-
import * as yup from "yup";
98

109
import { FormChangeTracker } from "components/common/FormChangeTracker";
1110
import { Button } from "components/ui/Button";
@@ -33,15 +32,6 @@ interface DbtJobListValues {
3332
jobs: DbtCloudJob[];
3433
}
3534

36-
const dbtCloudJobListSchema = yup.object({
37-
jobs: yup.array().of(
38-
yup.object({
39-
account: yup.number().required().positive().integer(),
40-
job: yup.number().required().positive().integer(),
41-
})
42-
),
43-
});
44-
4535
export const DbtCloudTransformationsCard = ({ connection }: { connection: WebBackendConnectionRead }) => {
4636
// Possible render paths:
4737
// 1) IF the workspace has no dbt cloud account linked
@@ -107,8 +97,7 @@ const DbtJobsForm: React.FC<DbtJobsFormProps> = ({ saveJobs, dbtCloudJobs }) =>
10797
<Formik
10898
onSubmit={onSubmit}
10999
initialValues={{ jobs }}
110-
validationSchema={dbtCloudJobListSchema}
111-
render={({ values, isValid, dirty }) => {
100+
render={({ values, dirty }) => {
112101
return (
113102
<Form className={styles.jobListForm}>
114103
<FormChangeTracker changed={dirty} />
@@ -137,7 +126,7 @@ const DbtJobsForm: React.FC<DbtJobsFormProps> = ({ saveJobs, dbtCloudJobs }) =>
137126
</span>
138127
}
139128
>
140-
<DbtJobsList jobs={values.jobs} remove={remove} isValid={isValid} dirty={dirty} />
129+
<DbtJobsList jobs={values.jobs} remove={remove} dirty={dirty} />
141130
</Card>
142131
);
143132
}}
@@ -149,17 +138,7 @@ const DbtJobsForm: React.FC<DbtJobsFormProps> = ({ saveJobs, dbtCloudJobs }) =>
149138
);
150139
};
151140

152-
const DbtJobsList = ({
153-
jobs,
154-
remove,
155-
isValid,
156-
dirty,
157-
}: {
158-
jobs: DbtCloudJob[];
159-
remove: (i: number) => void;
160-
isValid: boolean;
161-
dirty: boolean;
162-
}) => (
141+
const DbtJobsList = ({ jobs, remove, dirty }: { jobs: DbtCloudJob[]; remove: (i: number) => void; dirty: boolean }) => (
163142
<div className={classNames(styles.jobListContainer)}>
164143
{jobs.length ? (
165144
<>
@@ -180,7 +159,7 @@ const DbtJobsList = ({
180159
<Button className={styles.jobListButton} type="reset" variant="secondary">
181160
Cancel
182161
</Button>
183-
<Button className={styles.jobListButton} type="submit" variant="primary" disabled={!dirty || !isValid}>
162+
<Button className={styles.jobListButton} type="submit" variant="primary" disabled={!dirty}>
184163
Save changes
185164
</Button>
186165
</div>

0 commit comments

Comments
 (0)