2
0
mirror of https://github.com/frappe/books.git synced 2025-02-09 15:38:39 +00:00
books/src/router.ts

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

123 lines
2.9 KiB
TypeScript
Raw Normal View History

2022-04-28 12:04:55 +05:30
import ChartOfAccounts from 'src/pages/ChartOfAccounts.vue';
import CommonForm from 'src/pages/CommonForm/CommonForm.vue';
2022-04-20 12:08:47 +05:30
import Dashboard from 'src/pages/Dashboard/Dashboard.vue';
2022-04-25 16:07:25 +05:30
import GetStarted from 'src/pages/GetStarted.vue';
import ImportWizard from 'src/pages/ImportWizard.vue';
2022-04-27 17:32:43 +05:30
import ListView from 'src/pages/ListView/ListView.vue';
import PrintView from 'src/pages/PrintView/PrintView.vue';
2022-04-27 17:32:43 +05:30
import QuickEditForm from 'src/pages/QuickEditForm.vue';
import Report from 'src/pages/Report.vue';
import Settings from 'src/pages/Settings/Settings.vue';
import TemplateBuilder from 'src/pages/TemplateBuilder/TemplateBuilder.vue';
import { createRouter, createWebHistory, RouteRecordRaw } from 'vue-router';
import { historyState } from './utils/refs';
2018-06-27 20:06:42 +05:30
const routes: RouteRecordRaw[] = [
2019-07-25 15:20:48 +05:30
{
path: '/',
component: Dashboard,
2019-07-25 15:20:48 +05:30
},
{
path: '/get-started',
component: GetStarted,
},
{
path: `/edit/:schemaName/:name`,
name: `CommonForm`,
components: {
default: CommonForm,
edit: QuickEditForm,
},
props: {
default: (route) => ({
schemaName: route.params.schemaName,
name: route.params.name,
}),
edit: (route) => route.query,
},
},
{
path: '/list/:schemaName/:pageTitle?',
name: 'ListView',
components: {
default: ListView,
edit: QuickEditForm,
2019-10-05 01:48:10 +05:30
},
props: {
default: (route) => {
const { schemaName } = route.params;
const pageTitle = route.params.pageTitle ?? '';
const filters = {};
const filterString = route.query.filters;
if (typeof filterString === 'string') {
Object.assign(filters, JSON.parse(filterString));
2022-03-10 12:06:37 +05:30
}
return {
2022-04-27 17:32:43 +05:30
schemaName,
filters,
pageTitle,
};
},
edit: (route) => route.query,
},
2018-06-27 20:06:42 +05:30
},
2018-10-15 17:35:01 +05:30
{
2022-05-01 10:15:47 +05:30
path: '/print/:schemaName/:name',
2018-10-15 17:35:01 +05:30
name: 'PrintView',
component: PrintView,
props: true,
2018-10-22 23:40:22 +05:30
},
2018-06-27 20:06:42 +05:30
{
2022-05-18 12:34:33 +05:30
path: '/report/:reportClassName',
2018-06-27 20:06:42 +05:30
name: 'Report',
component: Report,
props: true,
2018-10-10 16:02:56 +05:30
},
Winter Sprint: Work (#79) * init() * Country-wise Chart of accounts on setup * Add a sample invoice template * Some error fixes * [fix] missing COA - move importCOA.js from models/doctype/account to models/doctype/Account * All Account initial balance zero * setup Bank Reconciliation * New chart of accounts tree component * GST taxes added. initialized gst reports. * [chore] add *.db to .gitignore * [fix] importCOA path error * fix error + bank reconciliation fields * [feat] add gst taxes * GST report initialized * GST report finalized * GST report finalized * Complete min. reconciliation * [feat] auto select tax in invoice based on states * [chore] fix merge changes * Fix date issue - Make Payment * Add invoice templates and invoice customizer panel * Restructure invoice vue components * update file with fiscal year * Fix issues in invoice designs * Add company settings. Dynamic addresses in invoice * Move invoice styles to different file and add separate components for addresses * [feat] add export-filtered-data-to-csv to reports * [feat] add Export Wizard component for customizing export * Fix invoice customizer position while scrolling. Fix address displayed as undefined in invoice if not found in db * [chore] change markup for select all chkbox * Setup config as doctype * GSTIN bug fix * Add custom google fonts * Add Send email footer * Fix DateTime * Complete Merge + Resolve * Complete Merge + Resolve * [chore] change layout of Export Wizard * [enh] optimize checkNoneSelected, style export modal footer divider * Add Tax to SideBar * Remove extra logs * [fix] db name section in sidebar showing absolute path instead of dbname in windows i.e. platform=win32 * Country-wise Chart of accounts on setup (#78) * Country-wise Chart of accounts on setup * Some error fixes * All Account initial balance zero * Update README.md - updated installation instructions with more detail * Merge #79 Winter Sprint: Work https://github.com/frappe/accounting/pull/79 * Revert "Merge #79 Winter Sprint: Work" This reverts commit 171511666817caa430af672791c8d452e3b4b680.
2019-02-18 11:12:04 +05:30
{
2019-12-23 13:56:41 +05:30
path: '/chart-of-accounts',
Winter Sprint: Work (#79) * init() * Country-wise Chart of accounts on setup * Add a sample invoice template * Some error fixes * [fix] missing COA - move importCOA.js from models/doctype/account to models/doctype/Account * All Account initial balance zero * setup Bank Reconciliation * New chart of accounts tree component * GST taxes added. initialized gst reports. * [chore] add *.db to .gitignore * [fix] importCOA path error * fix error + bank reconciliation fields * [feat] add gst taxes * GST report initialized * GST report finalized * GST report finalized * Complete min. reconciliation * [feat] auto select tax in invoice based on states * [chore] fix merge changes * Fix date issue - Make Payment * Add invoice templates and invoice customizer panel * Restructure invoice vue components * update file with fiscal year * Fix issues in invoice designs * Add company settings. Dynamic addresses in invoice * Move invoice styles to different file and add separate components for addresses * [feat] add export-filtered-data-to-csv to reports * [feat] add Export Wizard component for customizing export * Fix invoice customizer position while scrolling. Fix address displayed as undefined in invoice if not found in db * [chore] change markup for select all chkbox * Setup config as doctype * GSTIN bug fix * Add custom google fonts * Add Send email footer * Fix DateTime * Complete Merge + Resolve * Complete Merge + Resolve * [chore] change layout of Export Wizard * [enh] optimize checkNoneSelected, style export modal footer divider * Add Tax to SideBar * Remove extra logs * [fix] db name section in sidebar showing absolute path instead of dbname in windows i.e. platform=win32 * Country-wise Chart of accounts on setup (#78) * Country-wise Chart of accounts on setup * Some error fixes * All Account initial balance zero * Update README.md - updated installation instructions with more detail * Merge #79 Winter Sprint: Work https://github.com/frappe/accounting/pull/79 * Revert "Merge #79 Winter Sprint: Work" This reverts commit 171511666817caa430af672791c8d452e3b4b680.
2019-02-18 11:12:04 +05:30
name: 'Chart Of Accounts',
2019-10-14 02:48:18 +05:30
components: {
default: ChartOfAccounts,
edit: QuickEditForm,
2019-10-14 02:48:18 +05:30
},
props: {
default: true,
edit: (route) => route.query,
},
},
{
path: '/import-wizard',
name: 'Import Wizard',
component: ImportWizard,
},
2023-02-22 14:15:59 +05:30
{
path: '/template-builder/:name',
2023-02-22 14:15:59 +05:30
name: 'Template Builder',
component: TemplateBuilder,
props: true,
2023-02-22 14:15:59 +05:30
},
{
path: '/settings',
name: 'Settings',
2022-10-12 14:05:18 +05:30
components: {
default: Settings,
edit: QuickEditForm,
},
props: {
default: true,
edit: (route) => route.query,
},
},
];
2018-06-27 20:06:42 +05:30
2022-04-20 12:08:47 +05:30
const router = createRouter({ routes, history: createWebHistory() });
router.afterEach(() => {
historyState.forward = !!history.state?.forward;
historyState.back = !!history.state?.back;
});
export default router;