mirror of
https://github.com/frappe/books.git
synced 2025-01-26 16:48:28 +00:00
Merge branch 'move-to-vue' of https://github.com/frappe/accounting into move-to-vue
This commit is contained in:
commit
904baba237
@ -2,7 +2,15 @@
|
|||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
"plugins": {
|
"plugins": {
|
||||||
"postcss-import": {},
|
"postcss-import": {
|
||||||
|
resolve(id) {
|
||||||
|
// sass imports that start with ~ (which refers node_modules) should be supported
|
||||||
|
if (id.startsWith('~')) {
|
||||||
|
return id.slice(1);
|
||||||
|
}
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
},
|
||||||
"postcss-url": {},
|
"postcss-url": {},
|
||||||
// to edit target browsers: use "browserslist" field in package.json
|
// to edit target browsers: use "browserslist" field in package.json
|
||||||
"autoprefixer": {}
|
"autoprefixer": {}
|
||||||
|
@ -10,7 +10,7 @@ function getSettings() {
|
|||||||
try {
|
try {
|
||||||
settings = require(configFilePath);
|
settings = require(configFilePath);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
settings = {}
|
settings = {};
|
||||||
}
|
}
|
||||||
|
|
||||||
return settings;
|
return settings;
|
||||||
@ -23,4 +23,4 @@ async function saveSettings(settings) {
|
|||||||
module.exports = {
|
module.exports = {
|
||||||
getSettings,
|
getSettings,
|
||||||
saveSettings
|
saveSettings
|
||||||
}
|
};
|
||||||
|
40
src/main.js
40
src/main.js
@ -5,25 +5,15 @@
|
|||||||
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';
|
||||||
|
|
||||||
// frappejs imports
|
// frappejs imports
|
||||||
import io from 'socket.io-client';
|
|
||||||
import frappe from 'frappejs';
|
import frappe from 'frappejs';
|
||||||
|
import io from 'socket.io-client';
|
||||||
import HTTPClient from 'frappejs/backends/http';
|
import HTTPClient from 'frappejs/backends/http';
|
||||||
import Observable from 'frappejs/utils/observable';
|
|
||||||
import common from 'frappejs/common';
|
import common from 'frappejs/common';
|
||||||
import coreModels from 'frappejs/models';
|
import coreModels from 'frappejs/models';
|
||||||
import models from '../models';
|
import models from '../models';
|
||||||
import { _ } from 'frappejs/utils';
|
|
||||||
|
|
||||||
// vue components
|
|
||||||
import NotFound from 'frappejs/ui/components/NotFound';
|
|
||||||
import FeatherIcon from 'frappejs/ui/components/FeatherIcon';
|
|
||||||
import FrappeControl from 'frappejs/ui/components/controls/FrappeControl';
|
|
||||||
import Button from 'frappejs/ui/components/Button';
|
|
||||||
import Indicator from 'frappejs/ui/components/Indicator';
|
|
||||||
import modalPlugin from 'frappejs/ui/components/Modal/plugin';
|
|
||||||
import formModalPlugin from 'frappejs/ui/plugins/formModal';
|
|
||||||
import registerReportMethods from '../reports';
|
import registerReportMethods from '../reports';
|
||||||
|
|
||||||
frappe.init();
|
frappe.init();
|
||||||
@ -35,8 +25,6 @@ frappe.fetch = window.fetch.bind();
|
|||||||
frappe.db = new HTTPClient({ server });
|
frappe.db = new HTTPClient({ server });
|
||||||
const socket = io.connect(`http://${server}`);
|
const socket = io.connect(`http://${server}`);
|
||||||
frappe.db.bindSocketClient(socket);
|
frappe.db.bindSocketClient(socket);
|
||||||
frappe.registerModels(models);
|
|
||||||
frappe.docs = new Observable();
|
|
||||||
frappe.getSingle('SystemSettings');
|
frappe.getSingle('SystemSettings');
|
||||||
registerReportMethods();
|
registerReportMethods();
|
||||||
|
|
||||||
@ -54,29 +42,7 @@ frappe.getSingle('AccountingSettings')
|
|||||||
window.frappe = frappe;
|
window.frappe = frappe;
|
||||||
|
|
||||||
Vue.config.productionTip = false;
|
Vue.config.productionTip = false;
|
||||||
|
Vue.use(frappeVue);
|
||||||
Vue.component('not-found', NotFound);
|
|
||||||
Vue.component('feather-icon', FeatherIcon);
|
|
||||||
Vue.component('frappe-control', FrappeControl);
|
|
||||||
Vue.component('f-button', Button);
|
|
||||||
Vue.component('indicator', Indicator);
|
|
||||||
|
|
||||||
Vue.use(modalPlugin);
|
|
||||||
Vue.use(formModalPlugin);
|
|
||||||
|
|
||||||
Vue.mixin({
|
|
||||||
computed: {
|
|
||||||
frappe() {
|
|
||||||
return frappe;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
// global translation function in every component
|
|
||||||
_(...args) {
|
|
||||||
return _(...args);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
/* eslint-disable no-new */
|
/* eslint-disable no-new */
|
||||||
new Vue({
|
new Vue({
|
||||||
|
@ -40,10 +40,11 @@ import indicatorColor from 'frappejs/ui/constants/indicators';
|
|||||||
import setupConfig from './config';
|
import setupConfig from './config';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
name: 'SetupWizard',
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
currentSection: 0
|
currentSection: 0
|
||||||
}
|
};
|
||||||
},
|
},
|
||||||
components: {
|
components: {
|
||||||
FormLayout
|
FormLayout
|
||||||
@ -85,7 +86,9 @@ export default {
|
|||||||
this.currentSection -= 1;
|
this.currentSection -= 1;
|
||||||
},
|
},
|
||||||
indicatorColor(i) {
|
indicatorColor(i) {
|
||||||
return i === this.currentSection ? indicatorColor.BLUE : '';
|
return i === this.currentSection
|
||||||
|
? indicatorColor.BLUE
|
||||||
|
: indicatorColor.GREY;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
@ -96,5 +99,5 @@ export default {
|
|||||||
return setupConfig.layout;
|
return setupConfig.layout;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
</script>
|
</script>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user