feature/IO-1113-Online-Dark-Mode - Finish
This commit is contained in:
@@ -86,7 +86,7 @@ function AppContainer({ currentUser, setDarkMode }) {
|
||||
theme={theme}
|
||||
form={{
|
||||
validateMessages: {
|
||||
required: t("general.validation.required", { label: "${label}" })
|
||||
required: t("general.validation.required", { label: "{{label}}" })
|
||||
}
|
||||
}}
|
||||
>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { useApolloClient, useMutation } from "@apollo/client";
|
||||
import { useMutation } from "@apollo/client";
|
||||
import { Form, Modal } from "antd";
|
||||
import { useEffect } from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
@@ -42,9 +42,7 @@ export function NoteUpsertModalContainer({ currentUser, noteUpsertModal, toggleM
|
||||
const { refetch } = actions;
|
||||
|
||||
const [form] = Form.useForm();
|
||||
|
||||
const { client } = useApolloClient();
|
||||
|
||||
|
||||
useEffect(() => {
|
||||
//Required to prevent infinite looping.
|
||||
if (existingNote && open) {
|
||||
|
||||
@@ -85,7 +85,7 @@ export const StyleHorizontal = styled.div`
|
||||
|
||||
.react-trello-card {
|
||||
height: auto;
|
||||
margin: 2px;
|
||||
margin: 2px 0 2px;
|
||||
}
|
||||
|
||||
.size-memory-wrapper {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { useEffect } from "react";
|
||||
import { useCallback, useEffect } from "react";
|
||||
import { HasFeatureAccess } from "./../feature-wrapper/feature-wrapper.component";
|
||||
|
||||
/**
|
||||
@@ -24,7 +24,7 @@ export const useFormDataPreservation = (form, bodyshop, featureConfig) => {
|
||||
parent[lastKey] = value;
|
||||
};
|
||||
|
||||
const preserveHiddenFormData = () => {
|
||||
const preserveHiddenFormData = useCallback(() => {
|
||||
const preservationData = {};
|
||||
let hasDataToPreserve = false;
|
||||
|
||||
@@ -51,7 +51,7 @@ export const useFormDataPreservation = (form, bodyshop, featureConfig) => {
|
||||
if (hasDataToPreserve) {
|
||||
form.setFieldsValue(preservationData);
|
||||
}
|
||||
};
|
||||
}, [form, featureConfig, bodyshop]);
|
||||
|
||||
const getCompleteFormValues = () => {
|
||||
const currentFormValues = form.getFieldsValue();
|
||||
@@ -88,7 +88,7 @@ export const useFormDataPreservation = (form, bodyshop, featureConfig) => {
|
||||
|
||||
useEffect(() => {
|
||||
preserveHiddenFormData();
|
||||
}, [bodyshop]);
|
||||
}, [bodyshop, preserveHiddenFormData]);
|
||||
|
||||
return { preserveHiddenFormData, getCompleteFormValues, createSubmissionHandler };
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user