2
0
mirror of https://github.com/frappe/books.git synced 2024-11-10 07:40:55 +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
},
{
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>