mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-15 20:30:33 +00:00
fix:globalhotkeys & quick new.
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
export default [
|
||||
{ id: 'invoices', name: 'Sale invoice', label: 'Shift+I' },
|
||||
{ id: 'Purchase invoice', name: 'Purchase invoice' },
|
||||
{ id: 'manual-journals', name: 'Manual journal', label: 'Shift+M' },
|
||||
{ id: 'expenses', name: 'Expense', label: 'Shift+X' },
|
||||
{ id: 'customers', name: 'Customer', label: 'Shift+C' },
|
||||
{ id: 'vendors', name: 'Vendor', label: 'Shift+V' },
|
||||
{ path: 'invoices/new', name: 'Sale invoice', label: 'Ctrl+Shift+I' },
|
||||
{ path: 'bill//new', name: 'Purchase invoice',label:'Ctrl+Shift+B' },
|
||||
{ path: 'make-journal-entry', name: 'Manual journal', label: 'Ctrl+Shift+M' },
|
||||
{ path: 'expenses/new', name: 'Expense', label: 'Ctrl+Shift+X' },
|
||||
{ path: 'customers/new', name: 'Customer', label: 'Ctrl+Shift+C' },
|
||||
{ path: 'vendors/new', name: 'Vendor', label: 'Ctrl+Shift+V' },
|
||||
];
|
||||
|
||||
@@ -5,25 +5,19 @@ import routes from 'routes/dashboard';
|
||||
import withDashboardActions from 'containers/Dashboard/withDashboardActions';
|
||||
import { compose } from 'utils';
|
||||
|
||||
|
||||
function GlobalHotkeys({
|
||||
// #withDashboardActions
|
||||
toggleSidebarExpend,
|
||||
recordSidebarPreviousExpand,
|
||||
}) {
|
||||
const history = useHistory();
|
||||
|
||||
const globalHotkeys = (function (array) {
|
||||
const result = [];
|
||||
array.forEach(({ hotkey }) =>
|
||||
typeof hotkey !== 'undefined' ? result.push(hotkey) : null,
|
||||
);
|
||||
return result.toString();
|
||||
})(routes);
|
||||
|
||||
const handleSidebarToggleBtn = () => {
|
||||
const globalHotkeys = routes
|
||||
.filter(({ hotkey }) => hotkey)
|
||||
.map(({ hotkey }) => hotkey)
|
||||
.toString();
|
||||
|
||||
const handleSidebarToggleBtn = () => {
|
||||
toggleSidebarExpend();
|
||||
recordSidebarPreviousExpand();
|
||||
};
|
||||
useHotkeys(
|
||||
globalHotkeys,
|
||||
|
||||
@@ -12,8 +12,8 @@ import quickNewOptions from 'common/quickNewOptions';
|
||||
function QuickNewDropdown() {
|
||||
const history = useHistory();
|
||||
|
||||
const handleClickQuickNew = ({ id }) => {
|
||||
history.push(`/${id}`);
|
||||
const handleClickQuickNew = ({path }) => {
|
||||
history.push(`/${path}`);
|
||||
};
|
||||
|
||||
return (
|
||||
|
||||
Reference in New Issue
Block a user