2
0
mirror of https://github.com/frappe/books.git synced 2024-11-10 15:50:56 +00:00

fix: Remove unused imports and Vue plugins

This commit is contained in:
Faris Ansari 2019-11-25 23:59:53 +05:30
parent 4ea71aca1a
commit 387254fbbb
2 changed files with 15 additions and 36 deletions

View File

@ -1,15 +1,9 @@
const frappe = require('frappejs'); const frappe = require('frappejs');
const registerReportMethods = require('../reports'); const registerReportMethods = require('../reports');
const sender = require('../email/sender');
module.exports = function registerServerMethods() { module.exports = function registerServerMethods() {
registerReportMethods(); registerReportMethods();
frappe.registerMethod({
method: 'send-mail',
handler: sender.sendMail
});
frappe.registerMethod({ frappe.registerMethod({
method: 'import-coa', method: 'import-coa',
async handler() { async handler() {
@ -17,26 +11,4 @@ module.exports = function registerServerMethods() {
await importCOA(); await importCOA();
} }
}); });
frappe.registerMethod({
method: 'print-pdf',
handler({ doctype, name, html }) {
if (frappe.isElectron) {
const path = require('path');
const { getPDFForElectron } = require('frappejs/server/pdf');
const { getSettings } = require('../electron/settings');
getPDFForElectron(doctype, name, undefined, html);
}
}
});
frappe.registerMethod({
method: 'show-dialog',
handler({ title, message }) {
frappe.showModal({
modalProps: { title, noFooter: true },
component: require('../src/components/MessageDialog').default,
props: { message }
});
}
});
}; };

View File

@ -1,20 +1,18 @@
// frappejs imports // frappejs imports
import frappe from 'frappejs'; import frappe from 'frappejs';
import path from 'path';
import SQLite from 'frappejs/backends/sqlite'; import SQLite from 'frappejs/backends/sqlite';
import common from 'frappejs/common'; import common from 'frappejs/common';
import coreModels from 'frappejs/models'; import coreModels from 'frappejs/models';
import FeatherIcon from 'frappejs/ui/components/FeatherIcon';
import outsideClickDirective from 'frappejs/ui/plugins/outsideClickDirective';
import models from '../models'; import models from '../models';
import postStart from '../server/postStart'; import postStart from '../server/postStart';
import { ipcRenderer } from 'electron'; import { ipcRenderer } from 'electron';
import { getSettings, saveSettings } from '../electron/settings';
// vue imports // vue imports
import Vue from 'vue'; import Vue from 'vue';
import App from './App'; import App from './App';
import router from './router'; import router from './router';
import frappeVue from 'frappejs/ui/plugins/frappeVue';
import Toasted from 'vue-toasted';
(async () => { (async () => {
frappe.isServer = true; frappe.isServer = true;
@ -216,10 +214,19 @@ import Toasted from 'vue-toasted';
window.frappe = frappe; window.frappe = frappe;
Vue.config.productionTip = false; Vue.config.productionTip = false;
Vue.use(frappeVue); Vue.component('feather-icon', FeatherIcon);
Vue.use(Toasted, { Vue.directive('on-outside-click', outsideClickDirective);
position: 'bottom-right', Vue.mixin({
duration: 3000 computed: {
frappe() {
return frappe;
}
},
methods: {
_(...args) {
return frappe._(...args);
}
}
}); });
Vue.config.errorHandler = (err, vm, info) => { Vue.config.errorHandler = (err, vm, info) => {