diff --git a/models/doctype/PurchaseInvoice/PurchaseInvoiceList.js b/models/doctype/PurchaseInvoice/PurchaseInvoiceList.js index 8fde9d54..d6ba799d 100644 --- a/models/doctype/PurchaseInvoice/PurchaseInvoiceList.js +++ b/models/doctype/PurchaseInvoice/PurchaseInvoiceList.js @@ -1,5 +1,5 @@ import { _ } from 'frappejs/utils'; -import indicators from 'frappejs/ui/constants/indicators'; +import Badge from '@/components/Badge'; export default { doctype: 'PurchaseInvoice', @@ -13,17 +13,17 @@ export default { fieldtype: 'Select', size: 'small', options: ['Status...', 'Paid', 'Pending'], - getValue(doc) { + render(doc) { + let status = 'Pending'; + let color = 'orange'; if (doc.submitted === 1 && doc.outstandingAmount === 0.0) { - return 'Paid'; + status = 'Paid'; + color = 'green'; } - return 'Pending'; - }, - getIndicator(doc) { - if (doc.submitted === 1 && doc.outstandingAmount === 0.0) { - return indicators.GREEN; - } - return indicators.ORANGE; + return { + template: `${status}`, + components: { Badge } + }; } }, 'date', diff --git a/src/App.vue b/src/App.vue index af814426..2964ffc3 100644 --- a/src/App.vue +++ b/src/App.vue @@ -3,6 +3,7 @@ + @@ -12,6 +13,7 @@ import frappe from 'frappejs'; import Desk from './pages/Desk'; import SetupWizard from './pages/SetupWizard/SetupWizard'; import DatabaseSelector from './pages/DatabaseSelector'; +import Settings from '@/pages/Settings.vue'; import { remote } from 'electron'; export default { @@ -20,7 +22,8 @@ export default { return { showDatabaseSelector: false, showDesk: false, - showSetupWizard: false + showSetupWizard: false, + showSettings: false }; }, watch: { @@ -34,19 +37,27 @@ export default { remote.getCurrentWindow().setSize(600, 600); } }, + showSettings(newValue) { + if (newValue) { + remote.getCurrentWindow().setSize(460, 577); + } + }, showDesk(newValue) { if (newValue) { remote.getCurrentWindow().setSize(1200, 907); } - }, + } }, components: { Desk, SetupWizard, - DatabaseSelector + DatabaseSelector, + Settings }, mounted() { - if (!localStorage.dbPath) { + if (this.$route.path === '/settings') { + this.showSettings = true; + } else if (!localStorage.dbPath) { this.showDatabaseSelector = true; } else { frappe.events.trigger('connect-database', localStorage.dbPath); diff --git a/src/components/Sidebar.vue b/src/components/Sidebar.vue index 11c5e709..7b5a1c2f 100644 --- a/src/components/Sidebar.vue +++ b/src/components/Sidebar.vue @@ -76,6 +76,9 @@ export default { return this.activeGroup && group.title === this.activeGroup.title; }, onGroupClick(group) { + if (group.action) { + group.action(); + } if (group.route) { this.routeTo(group.route); } diff --git a/src/pages/Report.vue b/src/pages/Report.vue index e35b01fe..9103e2d7 100644 --- a/src/pages/Report.vue +++ b/src/pages/Report.vue @@ -15,7 +15,7 @@ >{{ column.label }}
- +
+
+
+
+ +
+
+
+ +
{{ tab.label }}
+
+
+
+
+ + diff --git a/src/router.js b/src/router.js index 7d0d9b56..9f37f937 100644 --- a/src/router.js +++ b/src/router.js @@ -8,12 +8,9 @@ import PrintView from '@/pages/PrintView'; import QuickEditForm from '@/pages/QuickEditForm'; import Report from '@/pages/Report.vue'; -import reportViewConfig from '../reports/view'; import DataImport from '@/pages/DataImport'; -import Settings from '@/pages/Settings/Settings'; - import ReportList from '@/pages/ReportList'; import ChartOfAccounts from '@/pages/ChartOfAccounts'; @@ -81,11 +78,11 @@ const routes = [ name: 'Data Import', component: DataImport }, - { - path: '/settings', - name: 'Settings', - component: Settings - }, + // { + // path: '/settings', + // name: 'Settings', + // component: Settings + // }, { path: '/reportList', name: 'Report', @@ -112,6 +109,6 @@ const routes = [ ]; let router = new Router({ routes }); -router.replace('/report/general-ledger'); +router.replace('/list/Item'); export default router; diff --git a/src/sidebarConfig.js b/src/sidebarConfig.js index 8568181d..4f1f8fe5 100644 --- a/src/sidebarConfig.js +++ b/src/sidebarConfig.js @@ -103,7 +103,10 @@ const config = { }, { title: _('Settings'), - icon: SettingsIcon + icon: SettingsIcon, + action() { + window.open('/index.html#/settings'); + } } ] };