Fix prettier error and EMailField import error in website (#17011)
This commit is contained in:
+13
-6
@@ -1,11 +1,19 @@
|
||||
import type { ChangeEvent } from "react";
|
||||
import type { Settings, Widgets, SelectWidgetProps, SelectWidget } from "react-awesome-query-builder";
|
||||
import type {
|
||||
Settings,
|
||||
Widgets,
|
||||
SelectWidgetProps,
|
||||
SelectWidget as SelectWidgetType,
|
||||
} from "react-awesome-query-builder";
|
||||
|
||||
import { EmailField as EmailWidget } from "@calcom/ui";
|
||||
|
||||
import widgetsComponents from "../widgets";
|
||||
// Figure out why routing-forms/env.d.ts doesn't work
|
||||
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
||||
//@ts-ignore
|
||||
import BasicConfig, { Operators, Types } from "./BasicConfig";
|
||||
import type { Operators, Types } from "./BasicConfig";
|
||||
import BasicConfig from "./BasicConfig";
|
||||
|
||||
const enum ConfigFor {
|
||||
FormFields = "FormFields",
|
||||
@@ -22,7 +30,6 @@ const {
|
||||
Button,
|
||||
ButtonGroup,
|
||||
Provider,
|
||||
EmailWidget,
|
||||
} = widgetsComponents;
|
||||
|
||||
const renderComponent = function <T1>(props: T1 | undefined, Component: React.FC<T1>) {
|
||||
@@ -77,7 +84,7 @@ function getWidgets(_configFor: ConfigFor) {
|
||||
listValues: { title: string; value: string }[];
|
||||
}
|
||||
) => renderComponent(props, MultiSelectWidget),
|
||||
} as SelectWidget,
|
||||
} as SelectWidgetType,
|
||||
select: {
|
||||
...BasicConfig.widgets.select,
|
||||
factory: (
|
||||
@@ -85,7 +92,7 @@ function getWidgets(_configFor: ConfigFor) {
|
||||
listValues: { title: string; value: string }[];
|
||||
}
|
||||
) => renderComponent(props, SelectWidget),
|
||||
} as SelectWidget,
|
||||
} as SelectWidgetType,
|
||||
phone: {
|
||||
...BasicConfig.widgets.text,
|
||||
factory: (props) => {
|
||||
@@ -234,4 +241,4 @@ export const AttributesBaseConfig = {
|
||||
types: getTypes(ConfigFor.Attributes),
|
||||
widgets: getWidgets(ConfigFor.Attributes),
|
||||
settings: getSettings(ConfigFor.Attributes),
|
||||
};
|
||||
};
|
||||
|
||||
@@ -8,7 +8,7 @@ import type {
|
||||
ProviderProps,
|
||||
} from "react-awesome-query-builder";
|
||||
|
||||
import { Button as CalButton, TextField, TextArea, EmailField } from "@calcom/ui";
|
||||
import { Button as CalButton, TextField, TextArea } from "@calcom/ui";
|
||||
import { Icon } from "@calcom/ui";
|
||||
|
||||
const Select = dynamic(
|
||||
@@ -371,7 +371,6 @@ const widgets = {
|
||||
ButtonGroup,
|
||||
Conjs,
|
||||
Provider,
|
||||
EmailWidget: EmailField,
|
||||
};
|
||||
|
||||
export default widgets;
|
||||
|
||||
@@ -6,7 +6,7 @@ import { evaluateRaqbLogic, RaqbLogicResult } from "./evaluateRaqbLogic";
|
||||
vi.mock("../components/react-awesome-query-builder/widgets", () => ({
|
||||
default: {},
|
||||
}));
|
||||
vi.mock("@calcom/ui");
|
||||
vi.mock("@calcom/ui", () => ({}));
|
||||
|
||||
describe("evaluateRaqbLogic", () => {
|
||||
it("should return a match for multiselect_equals", () => {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { BaseWidget, JsonTree } from "react-awesome-query-builder";
|
||||
import type { BaseWidget } from "react-awesome-query-builder";
|
||||
import { describe, it, expect, vi, beforeEach } from "vitest";
|
||||
|
||||
import { AttributeType } from "@calcom/prisma/enums";
|
||||
import type { AttributeType } from "@calcom/prisma/enums";
|
||||
|
||||
import { RoutingFormFieldType } from "../../lib/FieldTypes";
|
||||
import { RaqbLogicResult } from "../../lib/evaluateRaqbLogic";
|
||||
@@ -14,7 +14,7 @@ vi.mock("../../lib/getAttributes");
|
||||
vi.mock("../../components/react-awesome-query-builder/widgets", () => ({
|
||||
default: {},
|
||||
}));
|
||||
vi.mock("@calcom/ui");
|
||||
vi.mock("@calcom/ui", () => ({}));
|
||||
|
||||
function mockAttributesScenario({
|
||||
attributes,
|
||||
|
||||
Reference in New Issue
Block a user