Skip to content

Commit

Permalink
remove unused imports & format
Browse files Browse the repository at this point in the history
  • Loading branch information
mirekys committed Nov 10, 2023
1 parent e8d602d commit e96626e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import {
} from "@js/oarepo_ui";
import { i18next } from "@translations/oarepo_ui/i18next";
import { useFormikContext, getIn } from "formik";
import _get from "lodash/get";

export const MultilingualTextInput = ({
fieldPath,
Expand All @@ -36,7 +35,7 @@ export const MultilingualTextInput = ({
subValuesPath: "lang",
});
const value = getIn(values, fieldPath);
const usedLanguages = usedSubValues(value)
const usedLanguages = usedSubValues(value);
const newValue = defaultNewValue(emptyNewInput, usedLanguages);

return (
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import * as React from "react";
import { FormConfigContext } from "./contexts";
import { OARepoDepositApiClient, OARepoDepositSerializer } from "../api";
import { useFormikContext, getIn } from "formik";
import _get from "lodash/get"
import _set from "lodash/set"
import { useFormikContext } from "formik";
import _get from "lodash/get";
import _set from "lodash/set";
import _omit from "lodash/omit";
import _pick from "lodash/pick";
import _isEmpty from "lodash/isEmpty";
Expand Down Expand Up @@ -50,7 +50,7 @@ export const useFormFieldValue = ({ fieldPath, subValuesPath, defaultValue, subV
value && typeof Array.isArray(value)
? value.map((val) => _get(val, "lang")) || []
: [];
const defaultNewValue = (initialVal, usedSubValues = []) => _set({...initialVal}, subValuesPath, !usedSubValues?.includes(defaultValue) || !subValuesUnique ? defaultValue : "")
const defaultNewValue = (initialVal, usedSubValues = []) => _set({ ...initialVal }, subValuesPath, !usedSubValues?.includes(defaultValue) || !subValuesUnique ? defaultValue : "")

return { usedSubValues, defaultNewValue }
}
Expand Down

0 comments on commit e96626e

Please sign in to comment.