2
0
mirror of https://github.com/frappe/books.git synced 2024-12-22 19:09:01 +00:00

refactor: shift autoupdate to systemsettings

This commit is contained in:
18alantom 2021-11-25 16:48:26 +05:30
parent f4b14bc0da
commit f45ea81224
4 changed files with 7 additions and 25 deletions

View File

@ -107,12 +107,6 @@ export default {
default: 0
},
{
fieldname: 'autoUpdate',
label: 'Auto Update',
fieldtype: 'Check',
default: 1
}
],
quickEditFields: [
'fullname',

View File

@ -111,7 +111,12 @@ export default {
},
async mounted() {
this.companyName = await sidebarConfig.getTitle();
this.groups = sidebarConfig.groups;
this.groups = sidebarConfig.groups.filter(group=>{
if(group.route === '/get-started' && frappe.SystemSettings.hideGetStarted) {
return false
}
return true;
});
let currentPath = this.$router.currentRoute.fullPath;
this.activeGroup = this.groups.find((g) => {

View File

@ -30,7 +30,7 @@ import { IPC_MESSAGES } from './messages';
});
frappe.events.on('check-for-updates', () => {
let { autoUpdate } = frappe.AccountingSettings;
let { autoUpdate } = frappe.SystemSettings;
if (autoUpdate == null || autoUpdate === 1) {
ipcRenderer.send(IPC_MESSAGES.CHECK_FOR_UPDATES);
}

View File

@ -1,31 +1,17 @@
<template>
<div>
<TwoColumnForm v-if="doc" :doc="doc" :fields="fields" :autosave="true" />
<div class="mt-6">
<FormControl
:show-label="true"
:df="AccountingSettings.meta.getField('autoUpdate')"
@change="(value) => AccountingSettings.update('autoUpdate', value)"
:value="AccountingSettings.autoUpdate"
/>
<p class="pl-6 mt-1 text-sm text-gray-600">
<!-- prettier-ignore -->
{{ _('Automatically check for updates and download them if available. The update will be applied after you restart the app.') }}
</p>
</div>
</div>
</template>
<script>
import frappe from 'frappejs';
import TwoColumnForm from '@/components/TwoColumnForm';
import FormControl from '@/components/Controls/FormControl';
export default {
name: 'TabSystem',
components: {
TwoColumnForm,
FormControl,
},
data() {
return {
@ -41,9 +27,6 @@ export default {
let meta = frappe.getMeta('SystemSettings');
return meta.getQuickEditFields();
},
AccountingSettings() {
return frappe.AccountingSettings;
},
},
};
</script>