mirror of
https://github.com/frappe/books.git
synced 2024-11-12 16:36:27 +00:00
fix: Remove unused imports and Vue plugins
This commit is contained in:
parent
4ea71aca1a
commit
387254fbbb
@ -1,15 +1,9 @@
|
||||
const frappe = require('frappejs');
|
||||
const registerReportMethods = require('../reports');
|
||||
const sender = require('../email/sender');
|
||||
|
||||
module.exports = function registerServerMethods() {
|
||||
registerReportMethods();
|
||||
|
||||
frappe.registerMethod({
|
||||
method: 'send-mail',
|
||||
handler: sender.sendMail
|
||||
});
|
||||
|
||||
frappe.registerMethod({
|
||||
method: 'import-coa',
|
||||
async handler() {
|
||||
@ -17,26 +11,4 @@ module.exports = function registerServerMethods() {
|
||||
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 }
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
|
@ -1,20 +1,18 @@
|
||||
// frappejs imports
|
||||
import frappe from 'frappejs';
|
||||
import path from 'path';
|
||||
import SQLite from 'frappejs/backends/sqlite';
|
||||
import common from 'frappejs/common';
|
||||
import coreModels from 'frappejs/models';
|
||||
import FeatherIcon from 'frappejs/ui/components/FeatherIcon';
|
||||
import outsideClickDirective from 'frappejs/ui/plugins/outsideClickDirective';
|
||||
import models from '../models';
|
||||
import postStart from '../server/postStart';
|
||||
import { ipcRenderer } from 'electron';
|
||||
import { getSettings, saveSettings } from '../electron/settings';
|
||||
|
||||
// vue imports
|
||||
import Vue from 'vue';
|
||||
import App from './App';
|
||||
import router from './router';
|
||||
import frappeVue from 'frappejs/ui/plugins/frappeVue';
|
||||
import Toasted from 'vue-toasted';
|
||||
|
||||
(async () => {
|
||||
frappe.isServer = true;
|
||||
@ -216,10 +214,19 @@ import Toasted from 'vue-toasted';
|
||||
window.frappe = frappe;
|
||||
|
||||
Vue.config.productionTip = false;
|
||||
Vue.use(frappeVue);
|
||||
Vue.use(Toasted, {
|
||||
position: 'bottom-right',
|
||||
duration: 3000
|
||||
Vue.component('feather-icon', FeatherIcon);
|
||||
Vue.directive('on-outside-click', outsideClickDirective);
|
||||
Vue.mixin({
|
||||
computed: {
|
||||
frappe() {
|
||||
return frappe;
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
_(...args) {
|
||||
return frappe._(...args);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
Vue.config.errorHandler = (err, vm, info) => {
|
||||
|
Loading…
Reference in New Issue
Block a user