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

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

fix(ux): add items in system settings, move auto update to system
This commit is contained in:
Alan 2021-11-25 16:53:57 +05:30 committed by GitHub
commit 4a99c3ac46
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,4 +1,5 @@
const { DateTime } = require('luxon');
const { _ } = require('frappejs/utils');
let dateFormatOptions = (() => {
let formats = [
@ -8,15 +9,15 @@ let dateFormatOptions = (() => {
'MM-dd-yyyy',
'yyyy-MM-dd',
'd MMM, y',
'MMM d, y'
'MMM d, y',
];
let today = DateTime.local();
return formats.map(format => {
return formats.map((format) => {
return {
label: today.toFormat(format),
value: format
value: format,
};
});
})();
@ -35,7 +36,7 @@ module.exports = {
fieldtype: 'Select',
options: dateFormatOptions,
default: 'MMM d, y',
required: 1
required: 1,
},
{
fieldname: 'floatPrecision',
@ -43,10 +44,28 @@ module.exports = {
fieldtype: 'Select',
options: ['2', '3', '4', '5'],
default: '2',
required: 1
required: 1,
},
{
fieldname: 'hideGetStarted',
label: 'Hide Get Started',
fieldtype: 'Check',
default: 0,
},
{
fieldname: 'autoUpdate',
label: 'Auto Update',
fieldtype: 'Check',
default: 1,
description: _(
'Automatically check for updates and download them if available. The update will be applied after you restart the app.'
),
},
],
quickEditFields: [
'dateFormat'
]
'dateFormat',
'floatPrecision',
'hideGetStarted',
'autoUpdate',
],
};