Clarify setting default design
This commit is contained in:
parent
5ede246086
commit
d8bcd0a227
|
|
@ -139,88 +139,104 @@ class _InvoiceDesignState extends State<InvoiceDesign>
|
|||
),
|
||||
),
|
||||
FormCard(
|
||||
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||
children: <Widget>[
|
||||
if (company.isModuleEnabled(EntityType.invoice)) ...[
|
||||
DesignPicker(
|
||||
label: localization.invoiceDesign,
|
||||
initialValue: settings.defaultInvoiceDesignId,
|
||||
onSelected: (value) {
|
||||
setState(() {
|
||||
_wasInvoiceDesignChanged = true;
|
||||
});
|
||||
viewModel.onSettingsChanged(settings.rebuild(
|
||||
(b) => b..defaultInvoiceDesignId = value.id));
|
||||
},
|
||||
),
|
||||
if (!isFiltered &&
|
||||
_wasInvoiceDesignChanged &&
|
||||
state.userCompany.isAdmin)
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(bottom: 8),
|
||||
child: CheckboxListTile(
|
||||
activeColor: Theme.of(context).colorScheme.secondary,
|
||||
title: Text(localization.updateAllRecords),
|
||||
value: _updateAllInvoiceDesigns,
|
||||
onChanged: (value) => setState(
|
||||
() => _updateAllInvoiceDesigns = value,
|
||||
if (state.isProPlan) ...[
|
||||
if (company.isModuleEnabled(EntityType.invoice)) ...[
|
||||
DesignPicker(
|
||||
label: localization.invoiceDesign,
|
||||
initialValue: settings.defaultInvoiceDesignId,
|
||||
onSelected: (value) {
|
||||
setState(() {
|
||||
_wasInvoiceDesignChanged = true;
|
||||
});
|
||||
viewModel.onSettingsChanged(settings.rebuild(
|
||||
(b) => b..defaultInvoiceDesignId = value.id));
|
||||
},
|
||||
),
|
||||
if (!isFiltered &&
|
||||
_wasInvoiceDesignChanged &&
|
||||
state.userCompany.isAdmin)
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(bottom: 8),
|
||||
child: CheckboxListTile(
|
||||
activeColor:
|
||||
Theme.of(context).colorScheme.secondary,
|
||||
title: Text(localization.updateAllRecords),
|
||||
value: _updateAllInvoiceDesigns,
|
||||
onChanged: (value) => setState(
|
||||
() => _updateAllInvoiceDesigns = value,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
if (company.isModuleEnabled(EntityType.quote)) ...[
|
||||
DesignPicker(
|
||||
label: localization.quoteDesign,
|
||||
initialValue: settings.defaultQuoteDesignId,
|
||||
onSelected: (value) {
|
||||
setState(() {
|
||||
_wasQuoteDesignChanged = true;
|
||||
});
|
||||
viewModel.onSettingsChanged(settings.rebuild(
|
||||
(b) => b..defaultQuoteDesignId = value.id));
|
||||
},
|
||||
),
|
||||
],
|
||||
if (company.isModuleEnabled(EntityType.quote)) ...[
|
||||
DesignPicker(
|
||||
label: localization.quoteDesign,
|
||||
initialValue: settings.defaultQuoteDesignId,
|
||||
onSelected: (value) {
|
||||
setState(() {
|
||||
_wasQuoteDesignChanged = true;
|
||||
});
|
||||
viewModel.onSettingsChanged(settings.rebuild(
|
||||
(b) => b..defaultQuoteDesignId = value.id));
|
||||
},
|
||||
),
|
||||
if (!isFiltered &&
|
||||
_wasQuoteDesignChanged &&
|
||||
state.userCompany.isAdmin)
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(bottom: 8),
|
||||
child: CheckboxListTile(
|
||||
activeColor: Theme.of(context).colorScheme.secondary,
|
||||
title: Text(localization.updateAllRecords),
|
||||
value: _updateAllQuoteDesigns,
|
||||
onChanged: (value) => setState(
|
||||
() => _updateAllQuoteDesigns = value,
|
||||
if (!isFiltered &&
|
||||
_wasQuoteDesignChanged &&
|
||||
state.userCompany.isAdmin)
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(bottom: 8),
|
||||
child: CheckboxListTile(
|
||||
activeColor:
|
||||
Theme.of(context).colorScheme.secondary,
|
||||
title: Text(localization.updateAllRecords),
|
||||
value: _updateAllQuoteDesigns,
|
||||
onChanged: (value) => setState(
|
||||
() => _updateAllQuoteDesigns = value,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
if (company.isModuleEnabled(EntityType.credit)) ...[
|
||||
DesignPicker(
|
||||
label: localization.creditDesign,
|
||||
initialValue: settings.defaultCreditDesignId,
|
||||
onSelected: (value) {
|
||||
setState(() {
|
||||
_wasCreditDesignChanged = true;
|
||||
});
|
||||
viewModel.onSettingsChanged(settings.rebuild(
|
||||
(b) => b..defaultCreditDesignId = value.id));
|
||||
},
|
||||
),
|
||||
],
|
||||
if (company.isModuleEnabled(EntityType.credit)) ...[
|
||||
DesignPicker(
|
||||
label: localization.creditDesign,
|
||||
initialValue: settings.defaultCreditDesignId,
|
||||
onSelected: (value) {
|
||||
setState(() {
|
||||
_wasCreditDesignChanged = true;
|
||||
});
|
||||
viewModel.onSettingsChanged(settings.rebuild(
|
||||
(b) => b..defaultCreditDesignId = value.id));
|
||||
},
|
||||
),
|
||||
if (!isFiltered &&
|
||||
_wasCreditDesignChanged &&
|
||||
state.userCompany.isAdmin)
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(bottom: 8),
|
||||
child: CheckboxListTile(
|
||||
activeColor: Theme.of(context).colorScheme.secondary,
|
||||
title: Text(localization.updateAllRecords),
|
||||
value: _updateAllCreditDesigns,
|
||||
onChanged: (value) => setState(
|
||||
() => _updateAllCreditDesigns = value,
|
||||
if (!isFiltered &&
|
||||
_wasCreditDesignChanged &&
|
||||
state.userCompany.isAdmin)
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(bottom: 8),
|
||||
child: CheckboxListTile(
|
||||
activeColor:
|
||||
Theme.of(context).colorScheme.secondary,
|
||||
title: Text(localization.updateAllRecords),
|
||||
value: _updateAllCreditDesigns,
|
||||
onChanged: (value) => setState(
|
||||
() => _updateAllCreditDesigns = value,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
],
|
||||
] else
|
||||
OutlinedButton(
|
||||
child: Text(localization.setDefaultDesign.toUpperCase()),
|
||||
onPressed: () {
|
||||
store.dispatch(ViewSettings(
|
||||
company: state.company,
|
||||
section: kSettingsCompanyDetails,
|
||||
tabIndex: 3,
|
||||
));
|
||||
},
|
||||
),
|
||||
AppDropdownButton(
|
||||
labelText: localization.pageLayout,
|
||||
value: settings.pageLayout,
|
||||
|
|
|
|||
|
|
@ -16,7 +16,8 @@ mixin LocalizationsProvider on LocaleCodeAware {
|
|||
static final Map<String, Map<String, String>> _localizedValues = {
|
||||
'en': {
|
||||
// STARTER: lang key - do not remove comment
|
||||
'add_gateway': 'Add Gateway',
|
||||
'set_default_design': 'Set Default Design',
|
||||
'add_gateway': 'Add Gateway',
|
||||
'add_gateway_help_message':
|
||||
'Add a payment gateway (ie. Stripe, WePay or PayPal) to accept online payments',
|
||||
'left': 'Left',
|
||||
|
|
@ -70523,6 +70524,10 @@ mixin LocalizationsProvider on LocaleCodeAware {
|
|||
_localizedValues[localeCode]['add_gateway'] ??
|
||||
_localizedValues['en']['add_gateway'];
|
||||
|
||||
String get setDefaultDesign =>
|
||||
_localizedValues[localeCode]['set_default_design'] ??
|
||||
_localizedValues['en']['set_default_design'];
|
||||
|
||||
String get addGatewayHelpMessage =>
|
||||
_localizedValues[localeCode]['add_gateway_help_message'] ??
|
||||
_localizedValues['en']['add_gateway_help_message'];
|
||||
|
|
|
|||
Loading…
Reference in New Issue