[multicheck] Select multiple domains in setup (#11709)

* [multicheck] select multiple domains in setup

* use multiple domains in make_sample_data

* revert to setting in domains child table

* domains slide validation

* update setup wizard test
This commit is contained in:
Prateeksha Singh
2017-12-06 13:28:06 +05:30
committed by Nabin Hait
parent cd477fc187
commit 7351709980
6 changed files with 28 additions and 27 deletions

View File

@@ -15,11 +15,12 @@ erpnext.setup.slides_settings = [
{
// Domain
name: 'domain',
domains: ["all"],
title: __('Select your Domain'),
title: __('Select your Domains'),
fields: [
{
fieldname: 'domain', label: __('Domain'), fieldtype: 'Select',
fieldname: 'domains',
label: __('Domains'),
fieldtype: 'MultiCheck',
options: [
{ "label": __("Distribution"), "value": "Distribution" },
{ "label": __("Manufacturing"), "value": "Manufacturing" },
@@ -32,18 +33,19 @@ erpnext.setup.slides_settings = [
},
],
// help: __('Select the nature of your business.'),
onload: function (slide) {
slide.get_input("domain").on("change", function () {
frappe.setup.domain = $(this).val();
frappe.wizard.refresh_slides();
});
validate: function () {
if (this.values.domains.length === 0) {
frappe.msgprint(__("Please select at least one domain."));
return false;
}
frappe.setup.domains = this.values.domains;
return true;
},
},
{
// Brand
name: 'brand',
domains: ["all"],
icon: "fa fa-bookmark",
title: __("The Brand"),
// help: __('Upload your letter head and logo. (you can edit them later).'),
@@ -57,14 +59,14 @@ erpnext.setup.slides_settings = [
},
{
fieldname: 'company_name',
label: frappe.setup.domain === 'Education' ?
label: frappe.setup.domains.includes('Education') ?
__('Institute Name') : __('Company Name'),
fieldtype: 'Data',
reqd: 1
},
{
fieldname: 'company_abbr',
label: frappe.setup.domain === 'Education' ?
label: frappe.setup.domains.includes('Education') ?
__('Institute Abbreviation') : __('Company Abbreviation'),
fieldtype: 'Data'
}
@@ -100,10 +102,9 @@ erpnext.setup.slides_settings = [
{
// Organisation
name: 'organisation',
domains: ["all"],
title: __("Your Organization"),
icon: "fa fa-building",
// help: (frappe.setup.domain === 'Education' ?
// help: frappe.setup.domains.includes('Education') ?
// __('The name of the institute for which you are setting up this system.') :
// __('The name of your company for which you are setting up this system.')),
fields: [
@@ -111,7 +112,7 @@ erpnext.setup.slides_settings = [
fieldname: 'company_tagline',
label: __('What does it do?'),
fieldtype: 'Data',
placeholder: frappe.setup.domain === 'Education' ?
placeholder: frappe.setup.domains.includes('Education') ?
__('e.g. "Primary School" or "University"') :
__('e.g. "Build tools for builders"'),
reqd: 1