Merge branch 'feature/tooltip-oneline' into develop

This commit is contained in:
a.bouhuolia
2022-04-15 06:26:42 +02:00
6 changed files with 59 additions and 10 deletions

45
src/config/interfaces.tsx Normal file
View File

@@ -0,0 +1,45 @@
export enum ISidebarMenuItemType {
Label = 'label',
Link = 'link',
Group = 'group',
Overlay = 'overlay'
}
export interface ISidebarMenuItemOverlay extends ISidebarMenuItemCommon {
type: ISidebarMenuItemType.Overlay;
}
export interface ISidebarMenuItemLink extends ISidebarMenuItemCommon {
text: string | JSX.Element;
href: string;
type: ISidebarMenuItemType.Link;
matchExact?: boolean;
}
export interface ISidebarMenuItemLabel extends ISidebarMenuItemCommon {
text?: string;
type: ISidebarMenuItemType.Label;
}
export interface ISidebarMenuItemGroup extends ISidebarMenuItemCommon {
type: ISidebarMenuItemType.Group;
}
export interface ISidebarMenuItemPermission {
subject: string;
ability: string;
}
export interface ISidebarMenuItemCommon {
ability?: ISidebarMenuItemPermission | ISidebarMenuItemPermission[];
feature?: string;
disabled?: boolean;
children?: ISidebarMenuItem[];
onlySubscriptionExpired?: boolean;
}
export type ISidebarMenuItem =
| ISidebarMenuItemLink
| ISidebarMenuItemLabel
| ISidebarMenuItemGroup
| ISidebarMenuItemOverlay;

View File

@@ -19,6 +19,7 @@ export const useExpenseReadEntriesColumns = () => {
{
Header: intl.get('expense_account'),
accessor: 'expense_account.name',
Cell: TextOverviewTooltipCell,
width: 110,
disableSortBy: true,
textOverview: true,

View File

@@ -10,7 +10,10 @@ import { TableStyle } from '../../../common';
* Manual journal drawer table.
*/
export default function ManualJournalDrawerTable() {
// Retrieves the readonly manual journal entries columns.
const columns = useManualJournalEntriesColumns();
// Manual journal drawer context.
const { manualJournal } = useManualJournalDrawerContext();
return (

View File

@@ -49,19 +49,19 @@ export const useManualJournalEntriesColumns = () => {
() => [
{
Header: intl.get('account_name'),
Cell: TextOverviewTooltipCell,
accessor: 'account.name',
width: 130,
disableSortBy: true,
textOverview: true,
className: 'account',
},
{
Header: intl.get('contact'),
accessor: 'contact.display_name',
width: 130,
Cell: TextOverviewTooltipCell,
width: 100,
disableSortBy: true,
textOverview: true,
className: 'contact',
},
{
Header: intl.get('note'),
@@ -69,16 +69,15 @@ export const useManualJournalEntriesColumns = () => {
Cell: TextOverviewTooltipCell,
disableSortBy: true,
textOverview: true,
className: 'note',
width: 100,
},
...(featureCan(Features.Branches)
? [
{
Header: intl.get('branch'),
width: 130,
width: 100,
accessor: 'branch.name',
disableSortBy: true,
className: 'branch',
},
]
: []),
@@ -94,7 +93,6 @@ export const useManualJournalEntriesColumns = () => {
disableSortBy: true,
textOverview: true,
formatNumber: { noZero: true },
className: 'credit',
align: 'right',
},
{
@@ -109,10 +107,9 @@ export const useManualJournalEntriesColumns = () => {
textOverview: true,
disableSortBy: true,
formatNumber: { noZero: true },
className: 'debit',
align: 'right',
},
],
[featureCan],
[],
);
};

View File

@@ -11,6 +11,9 @@ import {
Choose,
} from '../../../components';
/**
* Retrieves the readonly warehouse transfer entries columns.
*/
export const useWarehouseTransferReadOnlyEntriesColumns = () => {
const {
warehouseTransfer: { entries },
@@ -50,6 +53,7 @@ export const useWarehouseTransferReadOnlyEntriesColumns = () => {
[],
);
};
/**
* Warehouses transfer details status.
* @returns {React.JSX}

View File

@@ -12,7 +12,6 @@ function VendorsBalanceSummaryProvider({ filter, ...props }) {
const query = React.useMemo(() => transformFilterFormToQuery(filter), [
filter,
]);
// Fetching vendors balance summary report based on the given query.
const {
data: VendorBalanceSummary,