mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-20 14:50:32 +00:00
fix: darkmode ui bugs
This commit is contained in:
@@ -0,0 +1,37 @@
|
|||||||
|
import { Controller, Get, Param } from '@nestjs/common';
|
||||||
|
import { WarehousesApplication } from './WarehousesApplication.service';
|
||||||
|
import {
|
||||||
|
ApiOperation,
|
||||||
|
ApiParam,
|
||||||
|
ApiResponse,
|
||||||
|
ApiTags,
|
||||||
|
} from '@nestjs/swagger';
|
||||||
|
import { ApiCommonHeaders } from '@/common/decorators/ApiCommonHeaders';
|
||||||
|
|
||||||
|
@Controller('items')
|
||||||
|
@ApiTags('Warehouses')
|
||||||
|
@ApiCommonHeaders()
|
||||||
|
export class WarehouseItemsController {
|
||||||
|
constructor(private warehousesApplication: WarehousesApplication) { }
|
||||||
|
|
||||||
|
@Get(':id/warehouses')
|
||||||
|
@ApiOperation({
|
||||||
|
summary: 'Retrieves the item associated warehouses.',
|
||||||
|
})
|
||||||
|
@ApiResponse({
|
||||||
|
status: 200,
|
||||||
|
description:
|
||||||
|
'The item associated warehouses have been successfully retrieved.',
|
||||||
|
})
|
||||||
|
@ApiResponse({ status: 404, description: 'The item not found.' })
|
||||||
|
@ApiParam({
|
||||||
|
name: 'id',
|
||||||
|
required: true,
|
||||||
|
type: Number,
|
||||||
|
description: 'The item id',
|
||||||
|
})
|
||||||
|
getItemWarehouses(@Param('id') itemId: string) {
|
||||||
|
return this.warehousesApplication.getItemWarehouses(Number(itemId));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@@ -85,10 +85,4 @@ export class WarehousesController {
|
|||||||
markWarehousePrimary(@Param('id') warehouseId: string) {
|
markWarehousePrimary(@Param('id') warehouseId: string) {
|
||||||
return this.warehousesApplication.markWarehousePrimary(Number(warehouseId));
|
return this.warehousesApplication.markWarehousePrimary(Number(warehouseId));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Get('items/:itemId')
|
|
||||||
@ApiOperation({ summary: 'Get item warehouses' })
|
|
||||||
getItemWarehouses(@Param('itemId') itemId: string) {
|
|
||||||
return this.warehousesApplication.getItemWarehouses(Number(itemId));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ import { CreateWarehouse } from './commands/CreateWarehouse.service';
|
|||||||
import { EditWarehouse } from './commands/EditWarehouse.service';
|
import { EditWarehouse } from './commands/EditWarehouse.service';
|
||||||
import { DeleteWarehouseService } from './commands/DeleteWarehouse.service';
|
import { DeleteWarehouseService } from './commands/DeleteWarehouse.service';
|
||||||
import { WarehousesController } from './Warehouses.controller';
|
import { WarehousesController } from './Warehouses.controller';
|
||||||
|
import { WarehouseItemsController } from './WarehouseItems.controller';
|
||||||
import { GetWarehouse } from './queries/GetWarehouse';
|
import { GetWarehouse } from './queries/GetWarehouse';
|
||||||
import { WarehouseMarkPrimary } from './commands/WarehouseMarkPrimary.service';
|
import { WarehouseMarkPrimary } from './commands/WarehouseMarkPrimary.service';
|
||||||
import { GetWarehouses } from './queries/GetWarehouses';
|
import { GetWarehouses } from './queries/GetWarehouses';
|
||||||
@@ -47,7 +48,7 @@ const models = [RegisterTenancyModel(Warehouse)];
|
|||||||
|
|
||||||
@Module({
|
@Module({
|
||||||
imports: [TenancyDatabaseModule, ...models],
|
imports: [TenancyDatabaseModule, ...models],
|
||||||
controllers: [WarehousesController],
|
controllers: [WarehousesController, WarehouseItemsController],
|
||||||
providers: [
|
providers: [
|
||||||
CreateWarehouse,
|
CreateWarehouse,
|
||||||
EditWarehouse,
|
EditWarehouse,
|
||||||
@@ -90,6 +91,6 @@ const models = [RegisterTenancyModel(Warehouse)];
|
|||||||
InventoryTransactionsWarehouses,
|
InventoryTransactionsWarehouses,
|
||||||
ValidateWarehouseExistance
|
ValidateWarehouseExistance
|
||||||
],
|
],
|
||||||
exports: [WarehousesSettings, WarehouseTransactionDTOTransform, ...models],
|
exports: [WarehousesSettings, WarehouseTransactionDTOTransform, WarehousesApplication, ...models],
|
||||||
})
|
})
|
||||||
export class WarehousesModule {}
|
export class WarehousesModule {}
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ import ReferenceNumberForm from '@/containers/JournalNumber/ReferenceNumberForm'
|
|||||||
import { withDialogActions } from '@/containers/Dialog/withDialogActions';
|
import { withDialogActions } from '@/containers/Dialog/withDialogActions';
|
||||||
import { withSettingsActions } from '@/containers/Settings/withSettingsActions';
|
import { withSettingsActions } from '@/containers/Settings/withSettingsActions';
|
||||||
import { withSettings } from '@/containers/Settings/withSettings';
|
import { withSettings } from '@/containers/Settings/withSettings';
|
||||||
import { withBillActions } from '@/containers/Purchases/Bills/BillsLanding/withBillsActions';
|
import { withBillsActions } from '@/containers/Purchases/Bills/BillsLanding/withBillsActions';
|
||||||
|
|
||||||
import { compose, optionsMapToArray } from '@/utils';
|
import { compose, optionsMapToArray } from '@/utils';
|
||||||
|
|
||||||
@@ -28,7 +28,7 @@ function BillNumberDialogContent({
|
|||||||
// #withDialogActions
|
// #withDialogActions
|
||||||
closeDialog,
|
closeDialog,
|
||||||
|
|
||||||
// #withBillActions
|
// #withBillsActions
|
||||||
setBillNumberChanged,
|
setBillNumberChanged,
|
||||||
}) {
|
}) {
|
||||||
const fetchSettings = useQuery(['settings'], () => requestFetchOptions({}));
|
const fetchSettings = useQuery(['settings'], () => requestFetchOptions({}));
|
||||||
@@ -76,5 +76,5 @@ export default compose(
|
|||||||
nextNumber: billsettings?.next_number,
|
nextNumber: billsettings?.next_number,
|
||||||
numberPrefix: billsettings?.number_prefix,
|
numberPrefix: billsettings?.number_prefix,
|
||||||
})),
|
})),
|
||||||
withBillActions,
|
withBillsActions,
|
||||||
)(BillNumberDialogContent);
|
)(BillNumberDialogContent);
|
||||||
|
|||||||
@@ -63,7 +63,6 @@ function ContactDuplicateForm({
|
|||||||
name={'contact_type'}
|
name={'contact_type'}
|
||||||
label={<T id={'contact_type'} />}
|
label={<T id={'contact_type'} />}
|
||||||
labelInfo={<FieldRequiredHint />}
|
labelInfo={<FieldRequiredHint />}
|
||||||
className={'form-group--select-list'}
|
|
||||||
>
|
>
|
||||||
<FSelect
|
<FSelect
|
||||||
name={'contact_type'}
|
name={'contact_type'}
|
||||||
|
|||||||
@@ -1,9 +1,17 @@
|
|||||||
// @ts-nocheck
|
// @ts-nocheck
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { Field, ErrorMessage, FastField } from 'formik';
|
import { Field, ErrorMessage, FastField, useFormikContext } from 'formik';
|
||||||
import { FormGroup, InputGroup } from '@blueprintjs/core';
|
import { FormGroup, InputGroup } from '@blueprintjs/core';
|
||||||
import { inputIntent, toSafeNumber } from '@/utils';
|
import { inputIntent, toSafeNumber } from '@/utils';
|
||||||
import { Row, Col, MoneyInputGroup, FormattedMessage as T } from '@/components';
|
import {
|
||||||
|
Row,
|
||||||
|
Col,
|
||||||
|
MoneyInputGroup,
|
||||||
|
FormattedMessage as T,
|
||||||
|
FMoneyInputGroup,
|
||||||
|
FFormGroup,
|
||||||
|
FInputGroup,
|
||||||
|
} from '@/components';
|
||||||
import { useAutofocus } from '@/hooks';
|
import { useAutofocus } from '@/hooks';
|
||||||
import { decrementQuantity } from './utils';
|
import { decrementQuantity } from './utils';
|
||||||
|
|
||||||
@@ -12,27 +20,19 @@ import { decrementQuantity } from './utils';
|
|||||||
*/
|
*/
|
||||||
function DecrementAdjustmentFields() {
|
function DecrementAdjustmentFields() {
|
||||||
const decrementFieldRef = useAutofocus();
|
const decrementFieldRef = useAutofocus();
|
||||||
|
const { values, setFieldValue } = useFormikContext();
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Row className={'row--decrement-fields'}>
|
<Row className={'row--decrement-fields'}>
|
||||||
{/*------------ Quantity on hand -----------*/}
|
{/*------------ Quantity on hand -----------*/}
|
||||||
<Col className={'col--quantity-on-hand'}>
|
<Col className={'col--quantity-on-hand'}>
|
||||||
<FastField name={'quantity_on_hand'}>
|
<FFormGroup name={'quantity_on_hand'} label={<T id={'qty_on_hand'} />}>
|
||||||
{({ field, meta: { error, touched } }) => (
|
<FInputGroup
|
||||||
<FormGroup
|
name={'quantity_on_hand'}
|
||||||
label={<T id={'qty_on_hand'} />}
|
disabled={true}
|
||||||
intent={inputIntent({ error, touched })}
|
medium={'true'}
|
||||||
helperText={<ErrorMessage name="quantity_on_hand" />}
|
/>
|
||||||
>
|
</FFormGroup>
|
||||||
<InputGroup
|
|
||||||
disabled={true}
|
|
||||||
medium={'true'}
|
|
||||||
intent={inputIntent({ error, touched })}
|
|
||||||
{...field}
|
|
||||||
/>
|
|
||||||
</FormGroup>
|
|
||||||
)}
|
|
||||||
</FastField>
|
|
||||||
</Col>
|
</Col>
|
||||||
|
|
||||||
<Col className={'col--sign'}>
|
<Col className={'col--sign'}>
|
||||||
@@ -41,40 +41,23 @@ function DecrementAdjustmentFields() {
|
|||||||
|
|
||||||
{/*------------ Decrement -----------*/}
|
{/*------------ Decrement -----------*/}
|
||||||
<Col className={'col--decrement'}>
|
<Col className={'col--decrement'}>
|
||||||
<Field name={'quantity'}>
|
<FFormGroup name={'quantity'} label={<T id={'decrement'} />} fill>
|
||||||
{({
|
<FMoneyInputGroup
|
||||||
form: { values, setFieldValue },
|
name={'quantity'}
|
||||||
field,
|
allowDecimals={false}
|
||||||
meta: { error, touched },
|
allowNegativeValue={true}
|
||||||
}) => (
|
inputRef={(ref) => (decrementFieldRef.current = ref)}
|
||||||
<FormGroup
|
onBlurValue={(value) => {
|
||||||
label={<T id={'decrement'} />}
|
setFieldValue(
|
||||||
intent={inputIntent({ error, touched })}
|
'new_quantity',
|
||||||
helperText={<ErrorMessage name="quantity" />}
|
decrementQuantity(
|
||||||
fill={true}
|
toSafeNumber(value),
|
||||||
>
|
toSafeNumber(values.quantity_on_hand),
|
||||||
<MoneyInputGroup
|
),
|
||||||
value={field.value}
|
);
|
||||||
allowDecimals={false}
|
}}
|
||||||
allowNegativeValue={true}
|
/>
|
||||||
inputRef={(ref) => (decrementFieldRef.current = ref)}
|
</FFormGroup>
|
||||||
onChange={(value) => {
|
|
||||||
setFieldValue('quantity', value);
|
|
||||||
}}
|
|
||||||
onBlurValue={(value) => {
|
|
||||||
setFieldValue(
|
|
||||||
'new_quantity',
|
|
||||||
decrementQuantity(
|
|
||||||
toSafeNumber(value),
|
|
||||||
toSafeNumber(values.quantity_on_hand),
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}}
|
|
||||||
intent={inputIntent({ error, touched })}
|
|
||||||
/>
|
|
||||||
</FormGroup>
|
|
||||||
)}
|
|
||||||
</Field>
|
|
||||||
</Col>
|
</Col>
|
||||||
|
|
||||||
<Col className={'col--sign'}>
|
<Col className={'col--sign'}>
|
||||||
@@ -82,38 +65,27 @@ function DecrementAdjustmentFields() {
|
|||||||
</Col>
|
</Col>
|
||||||
{/*------------ New quantity -----------*/}
|
{/*------------ New quantity -----------*/}
|
||||||
<Col className={'col--quantity'}>
|
<Col className={'col--quantity'}>
|
||||||
<Field name={'new_quantity'}>
|
<FFormGroup
|
||||||
{({
|
name={'new_quantity'}
|
||||||
form: { values, setFieldValue },
|
label={<T id={'new_quantity'} />}
|
||||||
field,
|
fill
|
||||||
meta: { error, touched },
|
fastField
|
||||||
}) => (
|
>
|
||||||
<FormGroup
|
<FMoneyInputGroup
|
||||||
label={<T id={'new_quantity'} />}
|
name={'new_quantity'}
|
||||||
intent={inputIntent({ error, touched })}
|
allowDecimals={false}
|
||||||
helperText={<ErrorMessage name="new_quantity" />}
|
allowNegativeValue={true}
|
||||||
>
|
onBlurValue={(value) => {
|
||||||
<MoneyInputGroup
|
setFieldValue(
|
||||||
value={field.value}
|
'quantity',
|
||||||
allowDecimals={false}
|
decrementQuantity(
|
||||||
allowNegativeValue={true}
|
toSafeNumber(value),
|
||||||
onChange={(value) => {
|
toSafeNumber(values.quantity_on_hand),
|
||||||
setFieldValue('new_quantity', value);
|
),
|
||||||
}}
|
);
|
||||||
onBlurValue={(value) => {
|
}}
|
||||||
setFieldValue(
|
/>
|
||||||
'quantity',
|
</FFormGroup>
|
||||||
decrementQuantity(
|
|
||||||
toSafeNumber(value),
|
|
||||||
toSafeNumber(values.quantity_on_hand),
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}}
|
|
||||||
intent={inputIntent({ error, touched })}
|
|
||||||
/>
|
|
||||||
</FormGroup>
|
|
||||||
)}
|
|
||||||
</Field>
|
|
||||||
</Col>
|
</Col>
|
||||||
</Row>
|
</Row>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
// @ts-nocheck
|
// @ts-nocheck
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
|
|
||||||
import '@/style/pages/Items/ItemAdjustmentDialog.scss';
|
import '@/style/pages/Items/ItemAdjustmentDialog.scss';
|
||||||
|
|
||||||
import { InventoryAdjustmentFormProvider } from './InventoryAdjustmentFormProvider';
|
import { InventoryAdjustmentFormProvider } from './InventoryAdjustmentFormProvider';
|
||||||
import InventoryAdjustmentForm from './InventoryAdjustmentForm';
|
import InventoryAdjustmentForm from './InventoryAdjustmentForm';
|
||||||
|
|
||||||
|
|||||||
@@ -160,7 +160,7 @@ export default function InventoryAdjustmentFormDialogFields() {
|
|||||||
name={'adjustment_account_id'}
|
name={'adjustment_account_id'}
|
||||||
label={<T id={'adjustment_account'} />}
|
label={<T id={'adjustment_account'} />}
|
||||||
labelInfo={<FieldRequiredHint />}
|
labelInfo={<FieldRequiredHint />}
|
||||||
className={'form-group--adjustment-account'}
|
fill
|
||||||
>
|
>
|
||||||
<FAccountsSuggestField
|
<FAccountsSuggestField
|
||||||
name={'adjustment_account_id'}
|
name={'adjustment_account_id'}
|
||||||
@@ -168,6 +168,8 @@ export default function InventoryAdjustmentFormDialogFields() {
|
|||||||
inputProps={{
|
inputProps={{
|
||||||
placeholder: intl.get('select_adjustment_account'),
|
placeholder: intl.get('select_adjustment_account'),
|
||||||
}}
|
}}
|
||||||
|
fill
|
||||||
|
fastField
|
||||||
/>
|
/>
|
||||||
</FFormGroup>
|
</FFormGroup>
|
||||||
|
|
||||||
@@ -185,16 +187,21 @@ export default function InventoryAdjustmentFormDialogFields() {
|
|||||||
name={'reason'}
|
name={'reason'}
|
||||||
label={<T id={'adjustment_reasons'} />}
|
label={<T id={'adjustment_reasons'} />}
|
||||||
labelInfo={<FieldRequiredHint />}
|
labelInfo={<FieldRequiredHint />}
|
||||||
|
fill
|
||||||
fastField
|
fastField
|
||||||
>
|
>
|
||||||
<FTextArea name={'reason'} growVertically large fastField />
|
<FTextArea name={'reason'} growVertically large fastField fill />
|
||||||
</FFormGroup>
|
</FFormGroup>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
export const FeatureRowDivider = styled.div`
|
export const FeatureRowDivider = styled.div`
|
||||||
|
--x-color-background: #e9e9e9;
|
||||||
|
.bp4-dark & {
|
||||||
|
--x-color-background: rgba(255, 255, 255, 0.1);
|
||||||
|
}
|
||||||
height: 2px;
|
height: 2px;
|
||||||
background: #e9e9e9;
|
background: var(--x-color-background);
|
||||||
margin-bottom: 15px;
|
margin-bottom: 15px;
|
||||||
`;
|
`;
|
||||||
|
|||||||
@@ -9,13 +9,13 @@ import { ItemsCategoriesProvider } from './ItemsCategoriesProvider';
|
|||||||
|
|
||||||
import ItemCategoriesTable from './ItemCategoriesTable';
|
import ItemCategoriesTable from './ItemCategoriesTable';
|
||||||
import ItemsCategoryActionsBar from './ItemsCategoryActionsBar';
|
import ItemsCategoryActionsBar from './ItemsCategoryActionsBar';
|
||||||
import { withItemsCategories } from './withItemCategories';
|
import { withItemCategories } from './withItemCategories';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Item categories list.
|
* Item categories list.
|
||||||
*/
|
*/
|
||||||
function ItemCategoryList({
|
function ItemCategoryList({
|
||||||
// #withItemsCategories
|
// #withItemCategories
|
||||||
itemsCategoriesTableState
|
itemsCategoriesTableState
|
||||||
}) {
|
}) {
|
||||||
return (
|
return (
|
||||||
@@ -32,7 +32,7 @@ function ItemCategoryList({
|
|||||||
}
|
}
|
||||||
|
|
||||||
export default R.compose(
|
export default R.compose(
|
||||||
withItemsCategories(({ itemsCategoriesTableState }) => ({
|
withItemCategories(({ itemsCategoriesTableState }) => ({
|
||||||
itemsCategoriesTableState,
|
itemsCategoriesTableState,
|
||||||
})),
|
})),
|
||||||
)(ItemCategoryList);
|
)(ItemCategoryList);
|
||||||
|
|||||||
@@ -63,7 +63,12 @@ export function PaymentMethodSelectField({
|
|||||||
}
|
}
|
||||||
|
|
||||||
const PaymentMethodSelectRoot = styled(Group)`
|
const PaymentMethodSelectRoot = styled(Group)`
|
||||||
border: 1px solid #d3d8de;
|
--x-color-border: #d3d8de;
|
||||||
|
|
||||||
|
.bp4-dark & {
|
||||||
|
--x-color-border: rgba(255, 255, 255, 0.2);
|
||||||
|
}
|
||||||
|
border: 1px solid var(--x-color-border);
|
||||||
border-radius: 3px;
|
border-radius: 3px;
|
||||||
padding: 8px;
|
padding: 8px;
|
||||||
gap: 0;
|
gap: 0;
|
||||||
@@ -72,13 +77,23 @@ const PaymentMethodSelectRoot = styled(Group)`
|
|||||||
`;
|
`;
|
||||||
|
|
||||||
const PaymentMethodCheckbox = styled(Checkbox)`
|
const PaymentMethodCheckbox = styled(Checkbox)`
|
||||||
|
--x-color-border: #c5cbd3;
|
||||||
|
|
||||||
|
.bp4-dark & {
|
||||||
|
--x-color-border: rgba(255, 255, 255, 0.2);
|
||||||
|
}
|
||||||
margin: 0;
|
margin: 0;
|
||||||
|
|
||||||
&.bp4-control .bp4-control-indicator {
|
&.bp4-control .bp4-control-indicator {
|
||||||
box-shadow: 0 0 0 1px #c5cbd3;
|
box-shadow: 0 0 0 1px var(--x-color-border);
|
||||||
}
|
}
|
||||||
`;
|
`;
|
||||||
|
|
||||||
const PaymentMethodText = styled(Text)`
|
const PaymentMethodText = styled(Text)`
|
||||||
color: #404854;
|
--x-color-text: #404854;
|
||||||
|
|
||||||
|
.bp4-dark & {
|
||||||
|
--x-color-text: var(--color-light-gray4);
|
||||||
|
}
|
||||||
|
color: var(--x-color-text);
|
||||||
`;
|
`;
|
||||||
|
|||||||
@@ -48,5 +48,5 @@ const PaymentMethodsTitle = styled('h6')`
|
|||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
font-weight: 500;
|
font-weight: 500;
|
||||||
margin: 0;
|
margin: 0;
|
||||||
color: rgb(95, 107, 124);
|
color: var(--color-muted-text);
|
||||||
`;
|
`;
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ import { isEmpty } from 'lodash';
|
|||||||
* Bills actions bar.
|
* Bills actions bar.
|
||||||
*/
|
*/
|
||||||
function BillActionsBar({
|
function BillActionsBar({
|
||||||
// #withBillActions
|
// #withBillsActions
|
||||||
setBillsTableState,
|
setBillsTableState,
|
||||||
|
|
||||||
// #withBills
|
// #withBills
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ import {
|
|||||||
import BillsEmptyStatus from './BillsEmptyStatus';
|
import BillsEmptyStatus from './BillsEmptyStatus';
|
||||||
|
|
||||||
import { withBills } from './withBills';
|
import { withBills } from './withBills';
|
||||||
import { withBillActions } from './withBillsActions';
|
import { withBillsActions } from './withBillsActions';
|
||||||
import { withAlertActions } from '@/containers/Alert/withAlertActions';
|
import { withAlertActions } from '@/containers/Alert/withAlertActions';
|
||||||
import { withDialogActions } from '@/containers/Dialog/withDialogActions';
|
import { withDialogActions } from '@/containers/Dialog/withDialogActions';
|
||||||
import { withDrawerActions } from '@/containers/Drawer/withDrawerActions';
|
import { withDrawerActions } from '@/containers/Drawer/withDrawerActions';
|
||||||
@@ -163,7 +163,7 @@ function BillsDataTable({
|
|||||||
|
|
||||||
export default compose(
|
export default compose(
|
||||||
withBills(({ billsTableState }) => ({ billsTableState })),
|
withBills(({ billsTableState }) => ({ billsTableState })),
|
||||||
withBillActions,
|
withBillsActions,
|
||||||
withAlertActions,
|
withAlertActions,
|
||||||
withDrawerActions,
|
withDrawerActions,
|
||||||
withDialogActions,
|
withDialogActions,
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import { DashboardViewsTabs } from '@/components';
|
|||||||
import { useBillsListContext } from './BillsListProvider';
|
import { useBillsListContext } from './BillsListProvider';
|
||||||
|
|
||||||
import { withBills } from './withBills';
|
import { withBills } from './withBills';
|
||||||
import { withBillActions } from './withBillsActions';
|
import { withBillsActions } from './withBillsActions';
|
||||||
|
|
||||||
import { compose, transfromViewsToTabs } from '@/utils';
|
import { compose, transfromViewsToTabs } from '@/utils';
|
||||||
|
|
||||||
@@ -14,7 +14,7 @@ import { compose, transfromViewsToTabs } from '@/utils';
|
|||||||
* Bills view tabs.
|
* Bills view tabs.
|
||||||
*/
|
*/
|
||||||
function BillViewTabs({
|
function BillViewTabs({
|
||||||
// #withBillActions
|
// #withBillsActions
|
||||||
setBillsTableState,
|
setBillsTableState,
|
||||||
|
|
||||||
// #withBills
|
// #withBills
|
||||||
@@ -47,7 +47,7 @@ function BillViewTabs({
|
|||||||
}
|
}
|
||||||
|
|
||||||
export default compose(
|
export default compose(
|
||||||
withBillActions,
|
withBillsActions,
|
||||||
withBills(({ billsTableState }) => ({
|
withBills(({ billsTableState }) => ({
|
||||||
billsCurrentView: billsTableState.viewSlug,
|
billsCurrentView: billsTableState.viewSlug,
|
||||||
})),
|
})),
|
||||||
|
|||||||
@@ -12,7 +12,6 @@ import { useIsDarkMode } from '@/hooks/useDarkMode';
|
|||||||
const inputGroupCss = css`
|
const inputGroupCss = css`
|
||||||
& .bp4-input {
|
& .bp4-input {
|
||||||
max-width: 110px;
|
max-width: 110px;
|
||||||
color: rgb(17, 17, 17);
|
|
||||||
padding-left: 8px;
|
padding-left: 8px;
|
||||||
}
|
}
|
||||||
`;
|
`;
|
||||||
|
|||||||
@@ -13,7 +13,6 @@ import { useIsDarkMode } from '@/hooks/useDarkMode';
|
|||||||
const inputGroupCss = css`
|
const inputGroupCss = css`
|
||||||
& .bp4-input {
|
& .bp4-input {
|
||||||
max-width: 110px;
|
max-width: 110px;
|
||||||
color: rgb(17, 17, 17);
|
|
||||||
padding-left: 8px;
|
padding-left: 8px;
|
||||||
}
|
}
|
||||||
`;
|
`;
|
||||||
|
|||||||
@@ -127,7 +127,7 @@ const PaymentOptionsText = styled(Box)`
|
|||||||
font-size: 13px;
|
font-size: 13px;
|
||||||
display: inline-flex;
|
display: inline-flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
color: #5f6b7c;
|
color: var(--color-muted-text);
|
||||||
`;
|
`;
|
||||||
|
|
||||||
const PaymentOptionsButton = styled(Button)`
|
const PaymentOptionsButton = styled(Button)`
|
||||||
|
|||||||
@@ -11,12 +11,11 @@ import {
|
|||||||
Menu,
|
Menu,
|
||||||
MenuItem,
|
MenuItem,
|
||||||
} from '@blueprintjs/core';
|
} from '@blueprintjs/core';
|
||||||
import { If, Icon, FormattedMessage as T } from '@/components';
|
import { If, Icon, FormattedMessage as T, Group } from '@/components';
|
||||||
import classNames from 'classnames';
|
import classNames from 'classnames';
|
||||||
import { useFormikContext } from 'formik';
|
import { useFormikContext } from 'formik';
|
||||||
import { CLASSES } from '@/constants/classes';
|
|
||||||
|
|
||||||
import { useWarehouseTransferFormContext } from './WarehouseTransferFormProvider';
|
import { useWarehouseTransferFormContext } from './WarehouseTransferFormProvider';
|
||||||
|
import { CLASSES } from '@/constants/classes';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Warehouse transfer floating actions bar.
|
* Warehouse transfer floating actions bar.
|
||||||
@@ -77,98 +76,101 @@ export default function WarehouseTransferFloatingActions() {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={classNames(CLASSES.PAGE_FORM_FLOATING_ACTIONS)}>
|
<div className={classNames(CLASSES.PAGE_FORM_FLOATING_ACTIONS)}>
|
||||||
{/* ----------- Save Intitate & transferred ----------- */}
|
<Group spacing={10}>
|
||||||
<If condition={!warehouseTransfer || !warehouseTransfer?.is_transferred}>
|
{/* ----------- Save Intitate & transferred ----------- */}
|
||||||
<ButtonGroup>
|
<If condition={!warehouseTransfer || !warehouseTransfer?.is_transferred}>
|
||||||
|
<ButtonGroup>
|
||||||
|
<Button
|
||||||
|
disabled={isSubmitting}
|
||||||
|
loading={isSubmitting}
|
||||||
|
intent={Intent.PRIMARY}
|
||||||
|
type="submit"
|
||||||
|
onClick={handleSubmitInitiateBtnClick}
|
||||||
|
style={{ minWidth: '85px' }}
|
||||||
|
text={<T id={'warehouse_transfer.save_initiate_transfer'} />}
|
||||||
|
/>
|
||||||
|
<Popover
|
||||||
|
content={
|
||||||
|
<Menu>
|
||||||
|
<MenuItem
|
||||||
|
text={
|
||||||
|
<T id={'warehouse_transfer.save_mark_as_transferred'} />
|
||||||
|
}
|
||||||
|
onClick={handleSubmitTransferredBtnClick}
|
||||||
|
/>
|
||||||
|
</Menu>
|
||||||
|
}
|
||||||
|
minimal={true}
|
||||||
|
interactionKind={PopoverInteractionKind.CLICK}
|
||||||
|
position={Position.BOTTOM_LEFT}
|
||||||
|
>
|
||||||
|
<Button
|
||||||
|
disabled={isSubmitting}
|
||||||
|
intent={Intent.PRIMARY}
|
||||||
|
rightIcon={<Icon icon="arrow-drop-up-16" iconSize={20} />}
|
||||||
|
/>
|
||||||
|
</Popover>
|
||||||
|
</ButtonGroup>
|
||||||
|
|
||||||
|
{/* ----------- Save As Draft ----------- */}
|
||||||
|
<ButtonGroup>
|
||||||
|
<Button
|
||||||
|
disabled={isSubmitting}
|
||||||
|
className={'ml1'}
|
||||||
|
onClick={handleSubmitDraftBtnClick}
|
||||||
|
text={<T id={'save_as_draft'} />}
|
||||||
|
/>
|
||||||
|
<Popover
|
||||||
|
content={
|
||||||
|
<Menu>
|
||||||
|
<MenuItem
|
||||||
|
text={<T id={'save_and_new'} />}
|
||||||
|
onClick={handleSubmitDraftAndNewBtnClick}
|
||||||
|
/>
|
||||||
|
<MenuItem
|
||||||
|
text={<T id={'save_continue_editing'} />}
|
||||||
|
onClick={handleSubmitDraftContinueEditingBtnClick}
|
||||||
|
/>
|
||||||
|
</Menu>
|
||||||
|
}
|
||||||
|
minimal={true}
|
||||||
|
interactionKind={PopoverInteractionKind.CLICK}
|
||||||
|
position={Position.BOTTOM_LEFT}
|
||||||
|
>
|
||||||
|
<Button
|
||||||
|
disabled={isSubmitting}
|
||||||
|
rightIcon={<Icon icon="arrow-drop-up-16" iconSize={20} />}
|
||||||
|
/>
|
||||||
|
</Popover>
|
||||||
|
</ButtonGroup>
|
||||||
|
</If>
|
||||||
|
<If condition={warehouseTransfer && warehouseTransfer?.is_transferred}>
|
||||||
<Button
|
<Button
|
||||||
disabled={isSubmitting}
|
disabled={isSubmitting}
|
||||||
loading={isSubmitting}
|
loading={isSubmitting}
|
||||||
intent={Intent.PRIMARY}
|
intent={Intent.PRIMARY}
|
||||||
type="submit"
|
onClick={handleSubmitTransferredBtnClick}
|
||||||
onClick={handleSubmitInitiateBtnClick}
|
style={{ minWidth: '100px' }}
|
||||||
style={{ minWidth: '85px' }}
|
text={<T id={'save'} />}
|
||||||
text={<T id={'warehouse_transfer.save_initiate_transfer'} />}
|
|
||||||
/>
|
/>
|
||||||
<Popover
|
</If>
|
||||||
content={
|
|
||||||
<Menu>
|
|
||||||
<MenuItem
|
|
||||||
text={
|
|
||||||
<T id={'warehouse_transfer.save_mark_as_transferred'} />
|
|
||||||
}
|
|
||||||
onClick={handleSubmitTransferredBtnClick}
|
|
||||||
/>
|
|
||||||
</Menu>
|
|
||||||
}
|
|
||||||
minimal={true}
|
|
||||||
interactionKind={PopoverInteractionKind.CLICK}
|
|
||||||
position={Position.BOTTOM_LEFT}
|
|
||||||
>
|
|
||||||
<Button
|
|
||||||
disabled={isSubmitting}
|
|
||||||
intent={Intent.PRIMARY}
|
|
||||||
rightIcon={<Icon icon="arrow-drop-up-16" iconSize={20} />}
|
|
||||||
/>
|
|
||||||
</Popover>
|
|
||||||
</ButtonGroup>
|
|
||||||
|
|
||||||
{/* ----------- Save As Draft ----------- */}
|
{/* ----------- Clear & Reset----------- */}
|
||||||
<ButtonGroup>
|
|
||||||
<Button
|
|
||||||
disabled={isSubmitting}
|
|
||||||
className={'ml1'}
|
|
||||||
onClick={handleSubmitDraftBtnClick}
|
|
||||||
text={<T id={'save_as_draft'} />}
|
|
||||||
/>
|
|
||||||
<Popover
|
|
||||||
content={
|
|
||||||
<Menu>
|
|
||||||
<MenuItem
|
|
||||||
text={<T id={'save_and_new'} />}
|
|
||||||
onClick={handleSubmitDraftAndNewBtnClick}
|
|
||||||
/>
|
|
||||||
<MenuItem
|
|
||||||
text={<T id={'save_continue_editing'} />}
|
|
||||||
onClick={handleSubmitDraftContinueEditingBtnClick}
|
|
||||||
/>
|
|
||||||
</Menu>
|
|
||||||
}
|
|
||||||
minimal={true}
|
|
||||||
interactionKind={PopoverInteractionKind.CLICK}
|
|
||||||
position={Position.BOTTOM_LEFT}
|
|
||||||
>
|
|
||||||
<Button
|
|
||||||
disabled={isSubmitting}
|
|
||||||
rightIcon={<Icon icon="arrow-drop-up-16" iconSize={20} />}
|
|
||||||
/>
|
|
||||||
</Popover>
|
|
||||||
</ButtonGroup>
|
|
||||||
</If>
|
|
||||||
<If condition={warehouseTransfer && warehouseTransfer?.is_transferred}>
|
|
||||||
<Button
|
<Button
|
||||||
|
className={'ml1'}
|
||||||
disabled={isSubmitting}
|
disabled={isSubmitting}
|
||||||
loading={isSubmitting}
|
onClick={handleClearBtnClick}
|
||||||
intent={Intent.PRIMARY}
|
text={warehouseTransfer ? <T id={'reset'} /> : <T id={'clear'} />}
|
||||||
onClick={handleSubmitTransferredBtnClick}
|
|
||||||
style={{ minWidth: '100px' }}
|
|
||||||
text={<T id={'save'} />}
|
|
||||||
/>
|
/>
|
||||||
</If>
|
|
||||||
{/* ----------- Clear & Reset----------- */}
|
|
||||||
<Button
|
|
||||||
className={'ml1'}
|
|
||||||
disabled={isSubmitting}
|
|
||||||
onClick={handleClearBtnClick}
|
|
||||||
text={warehouseTransfer ? <T id={'reset'} /> : <T id={'clear'} />}
|
|
||||||
/>
|
|
||||||
|
|
||||||
{/* ----------- Cancel ----------- */}
|
{/* ----------- Cancel ----------- */}
|
||||||
<Button
|
<Button
|
||||||
className={'ml1'}
|
className={'ml1'}
|
||||||
disabled={isSubmitting}
|
disabled={isSubmitting}
|
||||||
onClick={handleCancelBtnClick}
|
onClick={handleCancelBtnClick}
|
||||||
text={<T id={'cancel'} />}
|
text={<T id={'cancel'} />}
|
||||||
/>
|
/>
|
||||||
|
</Group>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -80,6 +80,7 @@ function WarehouseTransferFormHeaderFields({
|
|||||||
inputProps={{
|
inputProps={{
|
||||||
leftIcon: <Icon icon={'date-range'} />,
|
leftIcon: <Icon icon={'date-range'} />,
|
||||||
}}
|
}}
|
||||||
|
fill
|
||||||
fastField
|
fastField
|
||||||
/>
|
/>
|
||||||
</FFormGroup>
|
</FFormGroup>
|
||||||
|
|||||||
@@ -8,12 +8,19 @@
|
|||||||
|
|
||||||
.avatar.td {
|
.avatar.td {
|
||||||
.avatar {
|
.avatar {
|
||||||
|
--x-color-background: #adbcc9;
|
||||||
|
--x-color-text: #fff;
|
||||||
|
|
||||||
|
.bp4-dark & {
|
||||||
|
--x-color-background: rgba(255, 255, 255, 0.2);
|
||||||
|
--x-color-text: #fff;
|
||||||
|
}
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
background: #adbcc9;
|
background: var(--x-color-background);
|
||||||
border-radius: 50%;
|
border-radius: 50%;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
color: #fff;
|
color: var(--x-color-text);
|
||||||
|
|
||||||
&[data-size='medium'] {
|
&[data-size='medium'] {
|
||||||
height: 30px;
|
height: 30px;
|
||||||
|
|||||||
@@ -9,12 +9,19 @@
|
|||||||
|
|
||||||
.avatar.td {
|
.avatar.td {
|
||||||
.avatar {
|
.avatar {
|
||||||
|
--x-color-background: #adbcc9;
|
||||||
|
--x-color-text: #fff;
|
||||||
|
|
||||||
|
.bp4-dark & {
|
||||||
|
--x-color-background: rgba(255, 255, 255, 0.2);
|
||||||
|
--x-color-text: #fff;
|
||||||
|
}
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
background: #adbcc9;
|
background: var(--x-color-background);
|
||||||
|
color: var(--x-color-text);
|
||||||
border-radius: 50%;
|
border-radius: 50%;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
color: #fff;
|
|
||||||
|
|
||||||
&[data-size='medium'] {
|
&[data-size='medium'] {
|
||||||
height: 30px;
|
height: 30px;
|
||||||
|
|||||||
Reference in New Issue
Block a user