mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-18 22:00:31 +00:00
feat: universal search.
This commit is contained in:
33
client/src/containers/Customers/CustomersUniversalSearch.js
Normal file
33
client/src/containers/Customers/CustomersUniversalSearch.js
Normal file
@@ -0,0 +1,33 @@
|
||||
import { RESOURCES_TYPES } from '../../common/resourcesTypes';
|
||||
import withDrawerActions from '../Drawer/withDrawerActions';
|
||||
|
||||
function CustomerUniversalSearchSelectComponent({ resourceType, resourceId }) {
|
||||
if (resourceType === RESOURCES_TYPES.CUSTOMER) {
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
const CustomerUniversalSearchSelectAction = withDrawerActions(
|
||||
CustomerUniversalSearchSelectComponent
|
||||
);
|
||||
|
||||
/**
|
||||
* Transformes customers to search.
|
||||
* @param {*} contact
|
||||
* @returns
|
||||
*/
|
||||
const customersToSearch = (contact) => ({
|
||||
text: contact.display_name,
|
||||
label: contact.formatted_balance,
|
||||
reference: contact,
|
||||
});
|
||||
|
||||
/**
|
||||
* Binds universal search invoice configure.
|
||||
*/
|
||||
export const universalSearchCustomerBind = () => ({
|
||||
resourceType: RESOURCES_TYPES.CUSTOMER,
|
||||
optionItemLabel: 'Customers',
|
||||
selectItemAction: CustomerUniversalSearchSelectAction,
|
||||
itemSelect: customersToSearch,
|
||||
});
|
||||
Reference in New Issue
Block a user