2
0
mirror of https://github.com/frappe/books.git synced 2025-01-25 16:18:33 +00:00

Merge branch 'move-to-vue' of https://github.com/frappe/accounting into move-to-vue

This commit is contained in:
Suraj Shetty 2018-07-14 20:01:22 +05:30
commit 904baba237
4 changed files with 109 additions and 132 deletions

View File

@ -2,7 +2,15 @@
module.exports = {
"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": {},
// to edit target browsers: use "browserslist" field in package.json
"autoprefixer": {}

View File

@ -10,7 +10,7 @@ function getSettings() {
try {
settings = require(configFilePath);
} catch (e) {
settings = {}
settings = {};
}
return settings;
@ -23,4 +23,4 @@ async function saveSettings(settings) {
module.exports = {
getSettings,
saveSettings
}
};

View File

@ -5,25 +5,15 @@
import Vue from 'vue';
import App from './App';
import router from './router';
import frappeVue from 'frappejs/ui/plugins/frappeVue';
// frappejs imports
import io from 'socket.io-client';
import frappe from 'frappejs';
import io from 'socket.io-client';
import HTTPClient from 'frappejs/backends/http';
import Observable from 'frappejs/utils/observable';
import common from 'frappejs/common';
import coreModels from 'frappejs/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';
frappe.init();
@ -35,8 +25,6 @@ frappe.fetch = window.fetch.bind();
frappe.db = new HTTPClient({ server });
const socket = io.connect(`http://${server}`);
frappe.db.bindSocketClient(socket);
frappe.registerModels(models);
frappe.docs = new Observable();
frappe.getSingle('SystemSettings');
registerReportMethods();
@ -54,29 +42,7 @@ frappe.getSingle('AccountingSettings')
window.frappe = frappe;
Vue.config.productionTip = false;
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);
}
}
});
Vue.use(frappeVue);
/* eslint-disable no-new */
new Vue({

View File

@ -40,10 +40,11 @@ import indicatorColor from 'frappejs/ui/constants/indicators';
import setupConfig from './config';
export default {
name: 'SetupWizard',
data() {
return {
currentSection: 0
}
};
},
components: {
FormLayout
@ -85,7 +86,9 @@ export default {
this.currentSection -= 1;
},
indicatorColor(i) {
return i === this.currentSection ? indicatorColor.BLUE : '';
return i === this.currentSection
? indicatorColor.BLUE
: indicatorColor.GREY;
}
},
computed: {
@ -96,5 +99,5 @@ export default {
return setupConfig.layout;
}
}
}
};
</script>