feat: style vendor form and list.

feat: items state selectors.
This commit is contained in:
Ahmed Bouhuolia
2020-11-21 19:58:02 +02:00
parent b9e61461ae
commit 9eebaf5a6e
19 changed files with 332 additions and 202 deletions

View File

@@ -23,7 +23,11 @@ import withSettings from 'containers/Settings/withSettings';
import { compose, transformToForm } from 'utils';
import { transitionItemTypeKeyToLabel } from './utils';
import { EditItemFormSchema, CreateItemFormSchema } from './ItemForm.schema';
import {
EditItemFormSchema,
CreateItemFormSchema,
transformItemFormData,
} from './ItemForm.schema';
const defaultInitialValues = {
active: true,
@@ -99,7 +103,10 @@ function ItemForm({
* values such as `notes` come back from the API as null, so remove those
* as well.
*/
...transformToForm(itemDetail, defaultInitialValues),
...transformToForm(
transformItemFormData(itemDetail, defaultInitialValues),
defaultInitialValues,
),
}),
[
itemDetail,