fix: Replace "klona/full" -> "klona" in JSONForm to avoid cloning of non-enumerable properties (#13193)
- non-enumerable like `writable`, `configurable`, `enumerable` were getting cloned with `klona/full` and it wasn't needed.
This commit is contained in:
parent
7be912e857
commit
07757c7e7b
|
|
@ -1,6 +1,7 @@
|
|||
import React from "react";
|
||||
import { isEmpty, isString, maxBy, set, sortBy } from "lodash";
|
||||
import log from "loglevel";
|
||||
import { klona } from "klona";
|
||||
import { isEmpty, isString, maxBy, set, sortBy } from "lodash";
|
||||
|
||||
import BaseControl, { ControlProps } from "./BaseControl";
|
||||
import EmptyDataState from "components/utils/EmptyDataState";
|
||||
|
|
@ -19,8 +20,6 @@ import { StyledPropertyPaneButton } from "./StyledControls";
|
|||
import { getNextEntityName } from "utils/AppsmithUtils";
|
||||
import { InputText } from "./InputTextControl";
|
||||
|
||||
import { klona } from "klona/full";
|
||||
|
||||
type DroppableItem = BaseItemProps & {
|
||||
index: number;
|
||||
isCustomField: boolean;
|
||||
|
|
|
|||
|
|
@ -2,13 +2,12 @@ import equal from "fast-deep-equal/es6";
|
|||
import React, { useEffect, useRef } from "react";
|
||||
import styled from "styled-components";
|
||||
import { ControllerProps, useFormContext } from "react-hook-form";
|
||||
import { klona } from "klona";
|
||||
|
||||
import FieldLabel, { FieldLabelProps } from "./FieldLabel";
|
||||
import useUpdateAccessor from "../fields/useObserveAccessor";
|
||||
import { FIELD_MARGIN_BOTTOM } from "./styleConstants";
|
||||
|
||||
import { klona } from "klona/full";
|
||||
|
||||
type FieldProps<TValue> = React.PropsWithChildren<
|
||||
{
|
||||
accessor: string;
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ import styled from "styled-components";
|
|||
import { debounce, isEmpty } from "lodash";
|
||||
import { FormProvider, useForm } from "react-hook-form";
|
||||
import { Text } from "@blueprintjs/core";
|
||||
import { klona } from "klona";
|
||||
|
||||
import useFixedFooter from "./useFixedFooter";
|
||||
import {
|
||||
|
|
@ -16,8 +17,6 @@ import { ROOT_SCHEMA_KEY, Schema } from "../constants";
|
|||
import { convertSchemaItemToFormData, schemaItemDefaultValue } from "../helper";
|
||||
import { TEXT_SIZES } from "constants/WidgetConstants";
|
||||
|
||||
import { klona } from "klona/full";
|
||||
|
||||
export type FormProps<TValues = any> = PropsWithChildren<{
|
||||
backgroundColor?: string;
|
||||
disabledWhenInvalid?: boolean;
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@ import styled from "styled-components";
|
|||
import { ControllerRenderProps, useFormContext } from "react-hook-form";
|
||||
import { get, set } from "lodash";
|
||||
import { Icon } from "@blueprintjs/core";
|
||||
import { klona } from "klona";
|
||||
|
||||
import Accordion from "../component/Accordion";
|
||||
import FieldLabel from "../component/FieldLabel";
|
||||
|
|
@ -30,8 +31,6 @@ import { FIELD_MARGIN_BOTTOM } from "../component/styleConstants";
|
|||
import { generateReactKey } from "utils/generators";
|
||||
import { schemaItemDefaultValue } from "../helper";
|
||||
|
||||
import { klona } from "klona/full";
|
||||
|
||||
type ArrayComponentProps = FieldComponentBaseProps & {
|
||||
backgroundColor?: string;
|
||||
cellBackgroundColor?: string;
|
||||
|
|
|
|||
|
|
@ -2,12 +2,11 @@ import * as Sentry from "@sentry/react";
|
|||
import { set } from "lodash";
|
||||
import { ControllerProps, useFormContext } from "react-hook-form";
|
||||
import { useContext, useEffect } from "react";
|
||||
import { klona } from "klona";
|
||||
|
||||
import FormContext from "../FormContext";
|
||||
import { FieldType } from "../constants";
|
||||
|
||||
import { klona } from "klona/full";
|
||||
|
||||
export type UseRegisterFieldValidityProps = {
|
||||
isValid: boolean;
|
||||
fieldName: ControllerProps["name"];
|
||||
|
|
|
|||
|
|
@ -1,11 +1,10 @@
|
|||
import { debounce, set } from "lodash";
|
||||
import { useMemo, useContext, useCallback } from "react";
|
||||
import { klona } from "klona";
|
||||
|
||||
import { DebouncedExecuteActionPayload } from "widgets/MetaHOC";
|
||||
import FormContext from "../FormContext";
|
||||
|
||||
import { klona } from "klona/full";
|
||||
|
||||
export type UseUpdateInternalMetaStateProps = {
|
||||
propertyName?: string;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
import { get, set } from "lodash";
|
||||
import { klona } from "klona";
|
||||
|
||||
import SchemaParser, {
|
||||
applyPositions,
|
||||
|
|
@ -22,8 +23,6 @@ import {
|
|||
SchemaItem,
|
||||
} from "./constants";
|
||||
|
||||
import { klona } from "klona/full";
|
||||
|
||||
const widgetName = "JSONForm1";
|
||||
|
||||
describe("#parse", () => {
|
||||
|
|
|
|||
|
|
@ -7,6 +7,8 @@ import {
|
|||
sortBy,
|
||||
startCase,
|
||||
} from "lodash";
|
||||
import { klona } from "klona";
|
||||
|
||||
import { sanitizeKey } from "widgets/WidgetUtils";
|
||||
import {
|
||||
ARRAY_ITEM_KEY,
|
||||
|
|
@ -23,8 +25,6 @@ import {
|
|||
SchemaItem,
|
||||
} from "./constants";
|
||||
|
||||
import { klona } from "klona/full";
|
||||
|
||||
type Obj = Record<string, any>;
|
||||
type JSON = Obj | Obj[];
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
import { get, set } from "lodash";
|
||||
import { klona } from "klona";
|
||||
|
||||
import schemaTestData from "widgets/JSONFormWidget/schemaTestData";
|
||||
import {
|
||||
|
|
@ -16,8 +17,6 @@ import {
|
|||
updateChildrenDisabledStateHook,
|
||||
} from "./helper";
|
||||
|
||||
import { klona } from "klona/full";
|
||||
|
||||
const widgetName = "JSONForm1";
|
||||
|
||||
describe(".fieldTypeUpdateHook", () => {
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user