diff --git a/client/src/containers/Dialogs/ItemCategoryDialog/ItemCategoryForm.js b/client/src/containers/Dialogs/ItemCategoryDialog/ItemCategoryForm.js index a55fbf414..774a27e30 100644 --- a/client/src/containers/Dialogs/ItemCategoryDialog/ItemCategoryForm.js +++ b/client/src/containers/Dialogs/ItemCategoryDialog/ItemCategoryForm.js @@ -30,34 +30,6 @@ export default function ItemCategoryForm({ }) { const categoryNameFieldRef = useAutofocus(); - // Filters Item Categories list. - const filterItemCategories = useCallback( - (query, category, _index, exactMatch) => { - const normalizedTitle = category.name.toLowerCase(); - const normalizedQuery = query.toLowerCase(); - - if (exactMatch) { - return normalizedTitle === normalizedQuery; - } else { - return normalizedTitle.indexOf(normalizedQuery) >= 0; - } - }, - [], - ); - - const parentCategoryItem = useCallback( - (category, { handleClick, modifiers, query }) => { - return ( - - ); - }, - [], - ); - return (
@@ -81,38 +53,6 @@ export default function ItemCategoryForm({ )} - {/* ----------- Parent Category ----------- */} - - {({ form, field: { value }, meta: { error, touched } }) => ( - } - labelInfo={Hint} - className={classNames( - 'form-group--select-list', - 'form-group--parent-category', - Classes.FILL, - )} - inline={true} - helperText={} - intent={inputIntent({ error, touched })} - > - } - itemRenderer={parentCategoryItem} - itemPredicate={filterItemCategories} - popoverProps={{ minimal: true }} - onItemSelect={(parentCategory) => { - form.setFieldValue('parent_category_id', parentCategory.id); - }} - selectedItem={value} - selectedItemProp={'id'} - defaultText={} - labelProp={'name'} - /> - - )} - {/* ----------- Description ----------- */} diff --git a/client/src/containers/Dialogs/ItemCategoryDialog/ItemCategoryFormDialogContent.js b/client/src/containers/Dialogs/ItemCategoryDialog/ItemCategoryFormDialogContent.js index 11dadd132..f5f5134c9 100644 --- a/client/src/containers/Dialogs/ItemCategoryDialog/ItemCategoryFormDialogContent.js +++ b/client/src/containers/Dialogs/ItemCategoryDialog/ItemCategoryFormDialogContent.js @@ -23,7 +23,6 @@ import { compose, transformToForm } from 'utils'; const defaultInitialValues = { name: '', description: '', - parent_category_id: '', cost_account_id: '', sell_account_id: '', inventory_account_id: '', diff --git a/client/src/containers/Dialogs/ItemCategoryDialog/itemCategoryForm.schema.js b/client/src/containers/Dialogs/ItemCategoryDialog/itemCategoryForm.schema.js index 57bf072a2..0e347a73f 100644 --- a/client/src/containers/Dialogs/ItemCategoryDialog/itemCategoryForm.schema.js +++ b/client/src/containers/Dialogs/ItemCategoryDialog/itemCategoryForm.schema.js @@ -7,7 +7,6 @@ const Schema = Yup.object().shape({ .required() .max(DATATYPES_LENGTH.STRING) .label(formatMessage({ id: 'category_name_' })), - parent_category_id: Yup.number().nullable(), cost_account_id: Yup.number().nullable(), sell_account_id: Yup.number().nullable(), inventory_account_id: Yup.number().nullable(),