2
0
mirror of https://github.com/frappe/books.git synced 2024-12-24 11:55:46 +00:00

Merge pull request #257 from 18alantom/shift-systemsettings

refactor: shift autoupdate to systemsettings
This commit is contained in:
Alan 2021-11-25 16:54:01 +05:30 committed by GitHub
commit 36f175c714
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 7 additions and 25 deletions

View File

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

View File

@ -111,7 +111,12 @@ export default {
}, },
async mounted() { async mounted() {
this.companyName = await sidebarConfig.getTitle(); 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; let currentPath = this.$router.currentRoute.fullPath;
this.activeGroup = this.groups.find((g) => { this.activeGroup = this.groups.find((g) => {

View File

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

View File

@ -1,31 +1,17 @@
<template> <template>
<div> <div>
<TwoColumnForm v-if="doc" :doc="doc" :fields="fields" :autosave="true" /> <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> </div>
</template> </template>
<script> <script>
import frappe from 'frappejs'; import frappe from 'frappejs';
import TwoColumnForm from '@/components/TwoColumnForm'; import TwoColumnForm from '@/components/TwoColumnForm';
import FormControl from '@/components/Controls/FormControl';
export default { export default {
name: 'TabSystem', name: 'TabSystem',
components: { components: {
TwoColumnForm, TwoColumnForm,
FormControl,
}, },
data() { data() {
return { return {
@ -41,9 +27,6 @@ export default {
let meta = frappe.getMeta('SystemSettings'); let meta = frappe.getMeta('SystemSettings');
return meta.getQuickEditFields(); return meta.getQuickEditFields();
}, },
AccountingSettings() {
return frappe.AccountingSettings;
},
}, },
}; };
</script> </script>