diff --git a/src/containers/Purchases/Bills/BillForm/BillFormHeaderFields.tsx b/src/containers/Purchases/Bills/BillForm/BillFormHeaderFields.tsx index 4234067cd..7e051cb8b 100644 --- a/src/containers/Purchases/Bills/BillForm/BillFormHeaderFields.tsx +++ b/src/containers/Purchases/Bills/BillForm/BillFormHeaderFields.tsx @@ -5,7 +5,7 @@ import classNames from 'classnames'; import { FormGroup, InputGroup, Classes, Position } from '@blueprintjs/core'; import { FastField, ErrorMessage } from 'formik'; import { DateInput } from '@blueprintjs/datetime'; -import { FormattedMessage as T } from '@/components'; +import { FeatureCan, FormattedMessage as T } from '@/components'; import { CLASSES } from '@/constants/classes'; import { @@ -31,6 +31,7 @@ import { handleDateChange, inputIntent, } from '@/utils'; +import { Features } from '@/constants'; /** * Fill form header. @@ -170,19 +171,21 @@ function BillFormHeader() { {/*------------ Project name -----------*/} - } - inline={true} - className={classNames('form-group--select-list', Classes.FILL)} - > - + - + label={} + inline={true} + className={classNames('form-group--select-list', Classes.FILL)} + > + + + ); } diff --git a/src/containers/Sales/Estimates/EstimateForm/EstimateFormHeaderFields.tsx b/src/containers/Sales/Estimates/EstimateForm/EstimateFormHeaderFields.tsx index f07ece73f..823b3ba14 100644 --- a/src/containers/Sales/Estimates/EstimateForm/EstimateFormHeaderFields.tsx +++ b/src/containers/Sales/Estimates/EstimateForm/EstimateFormHeaderFields.tsx @@ -10,7 +10,7 @@ import { ControlGroup, } from '@blueprintjs/core'; import { DateInput } from '@blueprintjs/datetime'; -import { FFormGroup, FormattedMessage as T } from '@/components'; +import { FeatureCan, FFormGroup, FormattedMessage as T } from '@/components'; import { FastField, Field, ErrorMessage } from 'formik'; import { @@ -22,6 +22,7 @@ import { } from '@/utils'; import { customersFieldShouldUpdate } from './utils'; import { CLASSES } from '@/constants/classes'; +import { Features } from '@/constants'; import { CustomerSelectField, FieldRequiredHint, @@ -58,7 +59,6 @@ function EstimateFormHeader({ const handleEstimateNumberBtnClick = () => { openDialog('estimate-number-form', {}); }; - const handleEstimateNoBlur = (form, field) => (event) => { const newValue = event.target.value; @@ -71,7 +71,6 @@ function EstimateFormHeader({ }); } }; - // Syncs estimate number settings with the form. useObserveEstimateNoSettings(estimateNumberPrefix, estimateNextNumber); @@ -228,19 +227,21 @@ function EstimateFormHeader({ {/*------------ Project name -----------*/} - } - inline={true} - className={classNames('form-group--select-list', Classes.FILL)} - > - + - + label={} + inline={true} + className={classNames('form-group--select-list', Classes.FILL)} + > + + + ); } diff --git a/src/containers/Sales/Invoices/InvoiceForm/InvoiceFormHeaderFields.tsx b/src/containers/Sales/Invoices/InvoiceForm/InvoiceFormHeaderFields.tsx index f3c722dff..efcaf08a2 100644 --- a/src/containers/Sales/Invoices/InvoiceForm/InvoiceFormHeaderFields.tsx +++ b/src/containers/Sales/Invoices/InvoiceForm/InvoiceFormHeaderFields.tsx @@ -22,6 +22,7 @@ import { FieldRequiredHint, Icon, InputPrependButton, + FeatureCan, } from '@/components'; import { momentFormatter, compose, tansformDateValue } from '@/utils'; import { CLASSES } from '@/constants/classes'; @@ -40,6 +41,7 @@ import { ProjectsSelect, ProjectBillableEntriesLink, } from '@/containers/Projects/components'; +import { Features } from '@/constants'; import withSettings from '@/containers/Settings/withSettings'; import withDialogActions from '@/containers/Dialog/withDialogActions'; @@ -238,24 +240,26 @@ function InvoiceFormHeaderFields({ {/*------------ Project name -----------*/} - } - inline={true} - className={classNames('form-group--select-list', Classes.FILL)} - > - + - {values?.project_id && ( - - - - )} - + label={} + inline={true} + className={classNames('form-group--select-list', Classes.FILL)} + > + + {values?.project_id && ( + + + + )} + + ); } diff --git a/src/containers/Sales/PaymentReceives/PaymentReceiveForm/PaymentReceiveHeaderFields.tsx b/src/containers/Sales/PaymentReceives/PaymentReceiveForm/PaymentReceiveHeaderFields.tsx index c777f6854..85e9205ff 100644 --- a/src/containers/Sales/PaymentReceives/PaymentReceiveForm/PaymentReceiveHeaderFields.tsx +++ b/src/containers/Sales/PaymentReceives/PaymentReceiveForm/PaymentReceiveHeaderFields.tsx @@ -11,7 +11,8 @@ import { Button, } from '@blueprintjs/core'; import { DateInput } from '@blueprintjs/datetime'; -import { FormattedMessage as T } from '@/components'; +import { toSafeInteger } from 'lodash'; +import { FeatureCan, FormattedMessage as T } from '@/components'; import { FastField, Field, useFormikContext, ErrorMessage } from 'formik'; import { useAutofocus } from '@/hooks'; @@ -56,8 +57,7 @@ import { customersFieldShouldUpdate, accountsFieldShouldUpdate, } from './utils'; - -import { toSafeInteger } from 'lodash'; +import { Features } from '@/constants'; /** * Payment receive header fields. @@ -341,19 +341,21 @@ function PaymentReceiveHeaderFields({ {/*------------ Project name -----------*/} - } - inline={true} - className={classNames('form-group--select-list', Classes.FILL)} - > - + - + label={} + inline={true} + className={classNames('form-group--select-list', Classes.FILL)} + > + + + ); } diff --git a/src/containers/Sales/Receipts/ReceiptForm/ReceiptFormHeaderFields.tsx b/src/containers/Sales/Receipts/ReceiptForm/ReceiptFormHeaderFields.tsx index ce0247fd2..76435a890 100644 --- a/src/containers/Sales/Receipts/ReceiptForm/ReceiptFormHeaderFields.tsx +++ b/src/containers/Sales/Receipts/ReceiptForm/ReceiptFormHeaderFields.tsx @@ -22,6 +22,7 @@ import { InputPrependButton, CustomerDrawerLink, FormattedMessage as T, + FeatureCan, } from '@/components'; import withSettings from '@/containers/Settings/withSettings'; import withDialogActions from '@/containers/Dialog/withDialogActions'; @@ -44,6 +45,7 @@ import { ReceiptExchangeRateInputField, ReceiptProjectSelectButton, } from './components'; +import { Features } from '@/constants'; /** * Receipt form header fields. @@ -238,19 +240,21 @@ function ReceiptFormHeader({ {/*------------ Project name -----------*/} - } - inline={true} - className={classNames('form-group--select-list', Classes.FILL)} - > - + - + label={} + inline={true} + className={classNames('form-group--select-list', Classes.FILL)} + > + + + ); }