Skip to content

Commit 9a83342

Browse files
authored
🪟 🐛 Fix broken UI build on master (#19078)
* update ServiceForm => ConnectorForm test file * fixed broken import after merge * last fixes regarding "ServiceForm => ConnectorForm" renaming
1 parent 3365660 commit 9a83342

File tree

4 files changed

+16
-16
lines changed

4 files changed

+16
-16
lines changed

airbyte-webapp/src/packages/cloud/components/experiments/SignupSourceDropdown/SignupSourceDropdown.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@ import { Text } from "components/ui/Text";
2020

2121
import { ReleaseStage } from "core/request/AirbyteClient";
2222
import { useModalService } from "hooks/services/Modal";
23+
import styles from "views/Connector/ConnectorForm/components/Controls/ConnectorServiceTypeControl/ConnectorServiceTypeControl.module.scss";
24+
import { useAnalyticsTrackFunctions } from "views/Connector/ConnectorForm/components/Controls/ConnectorServiceTypeControl/useAnalyticsTrackFunctions";
25+
import { WarningMessage } from "views/Connector/ConnectorForm/components/WarningMessage";
2326
import RequestConnectorModal from "views/Connector/RequestConnectorModal";
24-
import styles from "views/Connector/ServiceForm/components/Controls/ConnectorServiceTypeControl/ConnectorServiceTypeControl.module.scss";
25-
import { useAnalyticsTrackFunctions } from "views/Connector/ServiceForm/components/Controls/ConnectorServiceTypeControl/useAnalyticsTrackFunctions";
26-
import { WarningMessage } from "views/Connector/ServiceForm/components/WarningMessage";
2727

2828
import { useGetSourceDefinitions } from "./useGetSourceDefinitions";
2929
import { getSortedDropdownData } from "./utils";

airbyte-webapp/src/views/Connector/ConnectorForm/ConnectorForm.test.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -377,7 +377,7 @@ describe("Service Form", () => {
377377
});
378378

379379
describe("conditionally render form submit button", () => {
380-
const renderServiceForm = (props: ConnectorFormProps) =>
380+
const renderConnectorForm = (props: ConnectorFormProps) =>
381381
render(<ConnectorForm {...props} formValues={{ name: "test-name" }} />);
382382
// eslint-disable-next-line @typescript-eslint/no-empty-function
383383
const onSubmitClb = () => {};
@@ -388,7 +388,7 @@ describe("Service Form", () => {
388388
};
389389

390390
it("should render <CreateControls /> if connector is selected", async () => {
391-
const { getByText } = await renderServiceForm({
391+
const { getByText } = await renderConnectorForm({
392392
selectedConnectorDefinitionSpecification:
393393
// @ts-expect-error Partial objects for testing
394394
connectorDefSpec as DestinationDefinitionSpecificationRead,
@@ -399,7 +399,7 @@ describe("Service Form", () => {
399399
});
400400

401401
it("should not render <CreateControls /> if connector is not selected", async () => {
402-
const { container } = await renderServiceForm({
402+
const { container } = await renderConnectorForm({
403403
selectedConnectorDefinitionSpecification: undefined,
404404
formType: "destination",
405405
onSubmit: onSubmitClb,
@@ -411,7 +411,7 @@ describe("Service Form", () => {
411411
});
412412

413413
it("should render <EditControls /> if connector is selected", async () => {
414-
const { getByText } = await renderServiceForm({
414+
const { getByText } = await renderConnectorForm({
415415
selectedConnectorDefinitionSpecification:
416416
// @ts-expect-error Partial objects for testing
417417
connectorDefSpec as DestinationDefinitionSpecificationRead,
@@ -424,7 +424,7 @@ describe("Service Form", () => {
424424
});
425425

426426
it("should render <EditControls /> if connector is not selected", async () => {
427-
const { container } = await renderServiceForm({
427+
const { container } = await renderConnectorForm({
428428
selectedConnectorDefinitionSpecification: undefined,
429429
formType: "destination",
430430
onSubmit: onSubmitClb,

airbyte-webapp/src/views/Connector/ConnectorForm/FormRoot.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ export const FormRoot: React.FC<FormRootProps> = ({
3838
selectedConnector,
3939
}) => {
4040
const { dirty, isSubmitting, isValid } = useFormikContext<ConnectorFormValues>();
41-
const { resetServiceForm, isLoadingSchema, selectedService, isEditMode, formType } = useConnectorForm();
41+
const { resetConnectorForm, isLoadingSchema, selectedService, isEditMode, formType } = useConnectorForm();
4242

4343
return (
4444
<Form>
@@ -63,7 +63,7 @@ export const FormRoot: React.FC<FormRootProps> = ({
6363
isValid={isValid}
6464
dirty={dirty}
6565
onCancelClick={() => {
66-
resetServiceForm();
66+
resetConnectorForm();
6767
}}
6868
successMessage={successMessage}
6969
/>

airbyte-webapp/src/views/Connector/ConnectorForm/connectorFormContext.tsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ interface ConnectorFormContext {
1515
unfinishedFlows: Record<string, { startValue: string; id: number | string }>;
1616
addUnfinishedFlow: (key: string, info?: Record<string, unknown>) => void;
1717
removeUnfinishedFlow: (key: string) => void;
18-
resetServiceForm: () => void;
18+
resetConnectorForm: () => void;
1919
selectedService?: ConnectorDefinition;
2020
selectedConnector?: ConnectorDefinitionSpecification;
2121
isLoadingSchema?: boolean;
@@ -26,11 +26,11 @@ interface ConnectorFormContext {
2626
const connectorFormContext = React.createContext<ConnectorFormContext | null>(null);
2727

2828
export const useConnectorForm = (): ConnectorFormContext => {
29-
const serviceFormHelpers = useContext(connectorFormContext);
30-
if (!serviceFormHelpers) {
31-
throw new Error("useServiceForm should be used within ServiceFormContextProvider");
29+
const connectorFormHelpers = useContext(connectorFormContext);
30+
if (!connectorFormHelpers) {
31+
throw new Error("useConnectorForm should be used within ConnectorFormContextProvider");
3232
}
33-
return serviceFormHelpers;
33+
return connectorFormHelpers;
3434
};
3535

3636
interface ConnectorFormContextProviderProps {
@@ -84,7 +84,7 @@ export const ConnectorFormContextProvider: React.FC<React.PropsWithChildren<Conn
8484
"_common.unfinishedFlows",
8585
Object.fromEntries(Object.entries(unfinishedFlows).filter(([key]) => key !== path))
8686
),
87-
resetServiceForm: () => {
87+
resetConnectorForm: () => {
8888
resetForm();
8989
resetUiWidgetsInfo();
9090
},

0 commit comments

Comments
 (0)