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