Refind clearing selection

This commit is contained in:
Hillel Coren 2020-08-02 18:28:24 +03:00
parent 30435ed482
commit 34b398f610
16 changed files with 88 additions and 46 deletions

View File

@ -921,9 +921,9 @@ abstract class SettingsEntity
invoiceFields: clientSettings?.invoiceFields ??
groupSettings?.invoiceFields ??
companySettings?.invoiceFields,
emailFooter: clientSettings?.emailFooter ??
groupSettings?.emailFooter ??
companySettings?.emailFooter,
emailSignature: clientSettings?.emailSignature ??
groupSettings?.emailSignature ??
companySettings?.emailSignature,
emailSubjectInvoice: clientSettings?.emailSubjectInvoice ??
groupSettings?.emailSubjectInvoice ??
companySettings?.emailSubjectInvoice,
@ -1453,8 +1453,8 @@ abstract class SettingsEntity
BuiltMap<String, BuiltList<String>> get pdfVariables;
@nullable
@BuiltValueField(wireName: 'email_footer')
String get emailFooter;
@BuiltValueField(wireName: 'email_signature')
String get emailSignature;
@nullable
@BuiltValueField(wireName: 'email_subject_invoice')

View File

@ -1424,10 +1424,10 @@ class _$SettingsEntitySerializer
const FullType(BuiltList, const [const FullType(String)])
])));
}
if (object.emailFooter != null) {
if (object.emailSignature != null) {
result
..add('email_footer')
..add(serializers.serialize(object.emailFooter,
..add('email_signature')
..add(serializers.serialize(object.emailSignature,
specifiedType: const FullType(String)));
}
if (object.emailSubjectInvoice != null) {
@ -2256,8 +2256,8 @@ class _$SettingsEntitySerializer
const FullType(BuiltList, const [const FullType(String)])
])));
break;
case 'email_footer':
result.emailFooter = serializers.deserialize(value,
case 'email_signature':
result.emailSignature = serializers.deserialize(value,
specifiedType: const FullType(String)) as String;
break;
case 'email_subject_invoice':
@ -4553,7 +4553,7 @@ class _$SettingsEntity extends SettingsEntity {
@override
final BuiltMap<String, BuiltList<String>> pdfVariables;
@override
final String emailFooter;
final String emailSignature;
@override
final String emailSubjectInvoice;
@override
@ -4802,7 +4802,7 @@ class _$SettingsEntity extends SettingsEntity {
this.defaultPaymentTypeId,
this.invoiceFields,
this.pdfVariables,
this.emailFooter,
this.emailSignature,
this.emailSubjectInvoice,
this.emailSubjectQuote,
this.emailSubjectPayment,
@ -4977,7 +4977,7 @@ class _$SettingsEntity extends SettingsEntity {
defaultPaymentTypeId == other.defaultPaymentTypeId &&
invoiceFields == other.invoiceFields &&
pdfVariables == other.pdfVariables &&
emailFooter == other.emailFooter &&
emailSignature == other.emailSignature &&
emailSubjectInvoice == other.emailSubjectInvoice &&
emailSubjectQuote == other.emailSubjectQuote &&
emailSubjectPayment == other.emailSubjectPayment &&
@ -5086,7 +5086,7 @@ class _$SettingsEntity extends SettingsEntity {
$jc(
$jc(
$jc(
$jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc(0, timezoneId.hashCode), dateFormatId.hashCode), enableMilitaryTime.hashCode), languageId.hashCode), showCurrencyCode.hashCode), currencyId.hashCode), customValue1.hashCode), customValue2.hashCode), customValue3.hashCode), customValue4.hashCode), defaultPaymentTerms.hashCode), companyGatewayIds.hashCode), defaultTaskRate.hashCode), sendReminders.hashCode), enablePortal.hashCode), enablePortalDashboard.hashCode), enablePortalTasks.hashCode), emailStyle.hashCode), replyToEmail.hashCode), bccEmail.hashCode), pdfEmailAttachment.hashCode), ublEmailAttachment.hashCode), documentEmailAttachment.hashCode), emailStyleCustom.hashCode), customMessageDashboard.hashCode), customMessageUnpaidInvoice.hashCode), customMessagePaidInvoice.hashCode), customMessageUnapprovedQuote.hashCode), lockSentInvoices.hashCode), autoArchiveInvoice.hashCode), autoArchiveQuote.hashCode), autoEmailInvoice.hashCode), autoConvertQuote.hashCode), enableInclusiveTaxes.hashCode), translations.hashCode), taskNumberPattern.hashCode), taskNumberCounter.hashCode), expenseNumberPattern.hashCode), expenseNumberCounter.hashCode), vendorNumberPattern.hashCode), vendorNumberCounter.hashCode), ticketNumberPattern.hashCode), ticketNumberCounter.hashCode), paymentNumberPattern.hashCode), paymentNumberCounter.hashCode), invoiceNumberPattern.hashCode), invoiceNumberCounter.hashCode), quoteNumberPattern.hashCode), quoteNumberCounter.hashCode), clientNumberPattern.hashCode), clientNumberCounter.hashCode), creditNumberPattern.hashCode), creditNumberCounter.hashCode), recurringNumberPrefix.hashCode), resetCounterFrequencyId.hashCode), resetCounterDate.hashCode), counterPadding.hashCode), sharedInvoiceQuoteCounter.hashCode), defaultInvoiceTerms.hashCode), defaultQuoteTerms.hashCode), defaultQuoteFooter.hashCode), defaultCreditTerms.hashCode), defaultCreditFooter.hashCode), defaultInvoiceDesignId.hashCode), defaultQuoteDesignId.hashCode), defaultCreditDesignId.hashCode), defaultInvoiceFooter.hashCode), invoiceLabels.hashCode), defaultTaxName1.hashCode), defaultTaxRate1.hashCode), defaultTaxName2.hashCode), defaultTaxRate2.hashCode), defaultTaxName3.hashCode), defaultTaxRate3.hashCode), defaultPaymentTypeId.hashCode), invoiceFields.hashCode), pdfVariables.hashCode), emailFooter.hashCode), emailSubjectInvoice.hashCode), emailSubjectQuote.hashCode), emailSubjectPayment.hashCode), emailSubjectPaymentPartial.hashCode), emailBodyInvoice.hashCode), emailBodyQuote.hashCode), emailBodyPayment.hashCode), emailBodyPaymentPartial.hashCode), emailSubjectReminder1.hashCode), emailSubjectReminder2.hashCode), emailSubjectReminder3.hashCode), emailBodyReminder1.hashCode), emailBodyReminder2.hashCode), emailBodyReminder3.hashCode), emailSubjectCustom1.hashCode), emailBodyCustom1.hashCode), emailSubjectCustom2.hashCode), emailBodyCustom2.hashCode), emailSubjectCustom3.hashCode), emailBodyCustom3.hashCode), enablePortalPassword.hashCode), signatureOnPdf.hashCode), enableEmailMarkup.hashCode), showAcceptInvoiceTerms.hashCode), showAcceptQuoteTerms.hashCode), requireInvoiceSignature.hashCode), requireQuoteSignature.hashCode), name.hashCode), companyLogo.hashCode), website.hashCode), address1.hashCode), address2.hashCode), city.hashCode), state.hashCode), postalCode.hashCode), phone.hashCode), email.hashCode), countryId.hashCode), vatNumber.hashCode), idNumber.hashCode), pageSize.hashCode), fontSize.hashCode), primaryColor.hashCode), secondaryColor.hashCode), primaryFont.hashCode), secondaryFont.hashCode), hidePaidToDate.hashCode), embedDocuments.hashCode), allPagesHeader.hashCode), allPagesFooter.hashCode), enableReminder1.hashCode), enableReminder2.hashCode), enableReminder3.hashCode), enableReminder4.hashCode), numDaysReminder1.hashCode), numDaysReminder2.hashCode), numDaysReminder3.hashCode), scheduleReminder1.hashCode), scheduleReminder2.hashCode), scheduleReminder3.hashCode), endlessReminderFrequencyId.hashCode), lateFeeAmount1.hashCode), lateFeeAmount2.hashCode), lateFeeAmount3.hashCode),
$jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc(0, timezoneId.hashCode), dateFormatId.hashCode), enableMilitaryTime.hashCode), languageId.hashCode), showCurrencyCode.hashCode), currencyId.hashCode), customValue1.hashCode), customValue2.hashCode), customValue3.hashCode), customValue4.hashCode), defaultPaymentTerms.hashCode), companyGatewayIds.hashCode), defaultTaskRate.hashCode), sendReminders.hashCode), enablePortal.hashCode), enablePortalDashboard.hashCode), enablePortalTasks.hashCode), emailStyle.hashCode), replyToEmail.hashCode), bccEmail.hashCode), pdfEmailAttachment.hashCode), ublEmailAttachment.hashCode), documentEmailAttachment.hashCode), emailStyleCustom.hashCode), customMessageDashboard.hashCode), customMessageUnpaidInvoice.hashCode), customMessagePaidInvoice.hashCode), customMessageUnapprovedQuote.hashCode), lockSentInvoices.hashCode), autoArchiveInvoice.hashCode), autoArchiveQuote.hashCode), autoEmailInvoice.hashCode), autoConvertQuote.hashCode), enableInclusiveTaxes.hashCode), translations.hashCode), taskNumberPattern.hashCode), taskNumberCounter.hashCode), expenseNumberPattern.hashCode), expenseNumberCounter.hashCode), vendorNumberPattern.hashCode), vendorNumberCounter.hashCode), ticketNumberPattern.hashCode), ticketNumberCounter.hashCode), paymentNumberPattern.hashCode), paymentNumberCounter.hashCode), invoiceNumberPattern.hashCode), invoiceNumberCounter.hashCode), quoteNumberPattern.hashCode), quoteNumberCounter.hashCode), clientNumberPattern.hashCode), clientNumberCounter.hashCode), creditNumberPattern.hashCode), creditNumberCounter.hashCode), recurringNumberPrefix.hashCode), resetCounterFrequencyId.hashCode), resetCounterDate.hashCode), counterPadding.hashCode), sharedInvoiceQuoteCounter.hashCode), defaultInvoiceTerms.hashCode), defaultQuoteTerms.hashCode), defaultQuoteFooter.hashCode), defaultCreditTerms.hashCode), defaultCreditFooter.hashCode), defaultInvoiceDesignId.hashCode), defaultQuoteDesignId.hashCode), defaultCreditDesignId.hashCode), defaultInvoiceFooter.hashCode), invoiceLabels.hashCode), defaultTaxName1.hashCode), defaultTaxRate1.hashCode), defaultTaxName2.hashCode), defaultTaxRate2.hashCode), defaultTaxName3.hashCode), defaultTaxRate3.hashCode), defaultPaymentTypeId.hashCode), invoiceFields.hashCode), pdfVariables.hashCode), emailSignature.hashCode), emailSubjectInvoice.hashCode), emailSubjectQuote.hashCode), emailSubjectPayment.hashCode), emailSubjectPaymentPartial.hashCode), emailBodyInvoice.hashCode), emailBodyQuote.hashCode), emailBodyPayment.hashCode), emailBodyPaymentPartial.hashCode), emailSubjectReminder1.hashCode), emailSubjectReminder2.hashCode), emailSubjectReminder3.hashCode), emailBodyReminder1.hashCode), emailBodyReminder2.hashCode), emailBodyReminder3.hashCode), emailSubjectCustom1.hashCode), emailBodyCustom1.hashCode), emailSubjectCustom2.hashCode), emailBodyCustom2.hashCode), emailSubjectCustom3.hashCode), emailBodyCustom3.hashCode), enablePortalPassword.hashCode), signatureOnPdf.hashCode), enableEmailMarkup.hashCode), showAcceptInvoiceTerms.hashCode), showAcceptQuoteTerms.hashCode), requireInvoiceSignature.hashCode), requireQuoteSignature.hashCode), name.hashCode), companyLogo.hashCode), website.hashCode), address1.hashCode), address2.hashCode), city.hashCode), state.hashCode), postalCode.hashCode), phone.hashCode), email.hashCode), countryId.hashCode), vatNumber.hashCode), idNumber.hashCode), pageSize.hashCode), fontSize.hashCode), primaryColor.hashCode), secondaryColor.hashCode), primaryFont.hashCode), secondaryFont.hashCode), hidePaidToDate.hashCode), embedDocuments.hashCode), allPagesHeader.hashCode), allPagesFooter.hashCode), enableReminder1.hashCode), enableReminder2.hashCode), enableReminder3.hashCode), enableReminder4.hashCode), numDaysReminder1.hashCode), numDaysReminder2.hashCode), numDaysReminder3.hashCode), scheduleReminder1.hashCode), scheduleReminder2.hashCode), scheduleReminder3.hashCode), endlessReminderFrequencyId.hashCode), lateFeeAmount1.hashCode), lateFeeAmount2.hashCode), lateFeeAmount3.hashCode),
lateFeeAmountEndless.hashCode),
lateFeePercent1.hashCode),
lateFeePercent2.hashCode),
@ -5188,7 +5188,7 @@ class _$SettingsEntity extends SettingsEntity {
..add('defaultPaymentTypeId', defaultPaymentTypeId)
..add('invoiceFields', invoiceFields)
..add('pdfVariables', pdfVariables)
..add('emailFooter', emailFooter)
..add('emailSignature', emailSignature)
..add('emailSubjectInvoice', emailSubjectInvoice)
..add('emailSubjectQuote', emailSubjectQuote)
..add('emailSubjectPayment', emailSubjectPayment)
@ -5658,9 +5658,10 @@ class SettingsEntityBuilder
set pdfVariables(MapBuilder<String, BuiltList<String>> pdfVariables) =>
_$this._pdfVariables = pdfVariables;
String _emailFooter;
String get emailFooter => _$this._emailFooter;
set emailFooter(String emailFooter) => _$this._emailFooter = emailFooter;
String _emailSignature;
String get emailSignature => _$this._emailSignature;
set emailSignature(String emailSignature) =>
_$this._emailSignature = emailSignature;
String _emailSubjectInvoice;
String get emailSubjectInvoice => _$this._emailSubjectInvoice;
@ -6143,7 +6144,7 @@ class SettingsEntityBuilder
_defaultPaymentTypeId = _$v.defaultPaymentTypeId;
_invoiceFields = _$v.invoiceFields;
_pdfVariables = _$v.pdfVariables?.toBuilder();
_emailFooter = _$v.emailFooter;
_emailSignature = _$v.emailSignature;
_emailSubjectInvoice = _$v.emailSubjectInvoice;
_emailSubjectQuote = _$v.emailSubjectQuote;
_emailSubjectPayment = _$v.emailSubjectPayment;
@ -6328,7 +6329,7 @@ class SettingsEntityBuilder
defaultPaymentTypeId: defaultPaymentTypeId,
invoiceFields: invoiceFields,
pdfVariables: _pdfVariables?.build(),
emailFooter: emailFooter,
emailSignature: emailSignature,
emailSubjectInvoice: emailSubjectInvoice,
emailSubjectQuote: emailSubjectQuote,
emailSubjectPayment: emailSubjectPayment,

View File

@ -168,10 +168,15 @@ class ClearEntitySelection {
}
class FilterByEntity implements PersistUI {
FilterByEntity({this.entityId, this.entityType});
FilterByEntity({
@required this.entityId,
@required this.entityType,
this.clearSelection = false,
});
final String entityId;
final EntityType entityType;
final bool clearSelection;
}
class FilterCompany implements PersistUI {
@ -330,6 +335,14 @@ void viewEntityById({
entityId: filterEntity.id,
entityType: filterEntity.entityType,
));
} else if (uiState.filterEntityType != null &&
uiState.filterEntityId != entityId &&
uiState.filterEntityType == entityType) {
store.dispatch(FilterByEntity(
entityId: entityId,
entityType: entityType,
clearSelection: true,
));
}
if (entityId != null &&

View File

@ -56,8 +56,10 @@ final selectedIdReducer = combineReducers<String>([
TypedReducer<String, ClearEntityFilter>((selectedId, action) => ''),
TypedReducer<String, ClearEntitySelection>((selectedId, action) =>
action.entityType == EntityType.client ? '' : selectedId),
TypedReducer<String, FilterByEntity>((selectedId, action) =>
action.entityType == EntityType.client ? action.entityId : selectedId),
TypedReducer<String, FilterByEntity>((selectedId, action) => action
.clearSelection
? ''
: action.entityType == EntityType.client ? action.entityId : selectedId),
]);
final editingReducer = combineReducers<ClientEntity>([

View File

@ -1,5 +1,6 @@
import 'package:built_collection/built_collection.dart';
import 'package:invoiceninja_flutter/data/models/company_gateway_model.dart';
import 'package:invoiceninja_flutter/data/models/entities.dart';
import 'package:invoiceninja_flutter/redux/app/app_actions.dart';
import 'package:invoiceninja_flutter/redux/company/company_actions.dart';
import 'package:invoiceninja_flutter/redux/company_gateway/company_gateway_actions.dart';
@ -27,6 +28,12 @@ Reducer<String> selectedIdReducer = combineReducers([
TypedReducer<String, ArchiveCompanyGatewaySuccess>(
(selectedId, action) => ''),
TypedReducer<String, ClearEntityFilter>((selectedId, action) => ''),
TypedReducer<String, FilterByEntity>((selectedId, action) =>
action.clearSelection
? ''
: action.entityType == EntityType.companyGateway
? action.entityId
: selectedId),
]);
final editingReducer = combineReducers<CompanyGatewayEntity>([

View File

@ -44,8 +44,10 @@ Reducer<String> selectedIdReducer = combineReducers([
TypedReducer<String, ClearEntityFilter>((selectedId, action) => ''),
TypedReducer<String, ClearEntitySelection>((selectedId, action) =>
action.entityType == EntityType.credit ? '' : selectedId),
TypedReducer<String, FilterByEntity>((selectedId, action) =>
action.entityType == EntityType.credit ? action.entityId : selectedId),
TypedReducer<String, FilterByEntity>((selectedId, action) => action
.clearSelection
? ''
: action.entityType == EntityType.credit ? action.entityId : selectedId),
]);
final editingReducer = combineReducers<InvoiceEntity>([

View File

@ -28,8 +28,10 @@ Reducer<String> selectedIdReducer = combineReducers([
TypedReducer<String, ClearEntityFilter>((selectedId, action) => ''),
TypedReducer<String, ClearEntitySelection>((selectedId, action) =>
action.entityType == EntityType.group ? '' : selectedId),
TypedReducer<String, FilterByEntity>((selectedId, action) =>
action.entityType == EntityType.group ? action.entityId : selectedId),
TypedReducer<String, FilterByEntity>((selectedId, action) => action
.clearSelection
? ''
: action.entityType == EntityType.group ? action.entityId : selectedId),
]);
final editingReducer = combineReducers<GroupEntity>([

View File

@ -46,8 +46,10 @@ Reducer<String> selectedIdReducer = combineReducers([
TypedReducer<String, ClearEntityFilter>((selectedId, action) => ''),
TypedReducer<String, ClearEntitySelection>((selectedId, action) =>
action.entityType == EntityType.invoice ? '' : selectedId),
TypedReducer<String, FilterByEntity>((selectedId, action) =>
action.entityType == EntityType.invoice ? action.entityId : selectedId),
TypedReducer<String, FilterByEntity>((selectedId, action) => action
.clearSelection
? ''
: action.entityType == EntityType.invoice ? action.entityId : selectedId),
]);
final editingReducer = combineReducers<InvoiceEntity>([

View File

@ -26,8 +26,10 @@ Reducer<String> selectedIdReducer = combineReducers([
TypedReducer<String, ClearEntityFilter>((selectedId, action) => ''),
TypedReducer<String, ClearEntitySelection>((selectedId, action) =>
action.entityType == EntityType.payment ? '' : selectedId),
TypedReducer<String, FilterByEntity>((selectedId, action) =>
action.entityType == EntityType.payment ? action.entityId : selectedId),
TypedReducer<String, FilterByEntity>((selectedId, action) => action
.clearSelection
? ''
: action.entityType == EntityType.payment ? action.entityId : selectedId),
]);
final editingReducer = combineReducers<PaymentEntity>([

View File

@ -44,8 +44,10 @@ Reducer<String> selectedIdReducer = combineReducers([
TypedReducer<String, ClearEntityFilter>((selectedId, action) => ''),
TypedReducer<String, ClearEntitySelection>((selectedId, action) =>
action.entityType == EntityType.quote ? '' : selectedId),
TypedReducer<String, FilterByEntity>((selectedId, action) =>
action.entityType == EntityType.quote ? action.entityId : selectedId),
TypedReducer<String, FilterByEntity>((selectedId, action) => action
.clearSelection
? ''
: action.entityType == EntityType.quote ? action.entityId : selectedId),
]);
final editingReducer = combineReducers<InvoiceEntity>([

View File

@ -26,8 +26,10 @@ Reducer<String> selectedIdReducer = combineReducers([
TypedReducer<String, DeleteTokensSuccess>((selectedId, action) => ''),
TypedReducer<String, ArchiveTokensSuccess>((selectedId, action) => ''),
TypedReducer<String, ClearEntityFilter>((selectedId, action) => ''),
TypedReducer<String, FilterByEntity>((selectedId, action) =>
action.entityType == EntityType.token ? action.entityId : selectedId),
TypedReducer<String, FilterByEntity>((selectedId, action) => action
.clearSelection
? ''
: action.entityType == EntityType.token ? action.entityId : selectedId),
]);
final editingReducer = combineReducers<TokenEntity>([

View File

@ -26,8 +26,10 @@ Reducer<String> selectedIdReducer = combineReducers([
TypedReducer<String, ClearEntityFilter>((selectedId, action) => ''),
TypedReducer<String, ClearEntitySelection>((selectedId, action) =>
action.entityType == EntityType.user ? '' : selectedId),
TypedReducer<String, FilterByEntity>((selectedId, action) =>
action.entityType == EntityType.user ? action.entityId : selectedId),
TypedReducer<String, FilterByEntity>((selectedId, action) => action
.clearSelection
? ''
: action.entityType == EntityType.user ? action.entityId : selectedId),
]);
final editingReducer = combineReducers<UserEntity>([

View File

@ -26,8 +26,10 @@ Reducer<String> selectedIdReducer = combineReducers([
TypedReducer<String, DeleteWebhooksSuccess>((selectedId, action) => ''),
TypedReducer<String, ArchiveWebhooksSuccess>((selectedId, action) => ''),
TypedReducer<String, ClearEntityFilter>((selectedId, action) => ''),
TypedReducer<String, FilterByEntity>((selectedId, action) =>
action.entityType == EntityType.webhook ? action.entityId : selectedId),
TypedReducer<String, FilterByEntity>((selectedId, action) => action
.clearSelection
? ''
: action.entityType == EntityType.webhook ? action.entityId : selectedId),
]);
final editingReducer = combineReducers<WebhookEntity>([

View File

@ -146,7 +146,7 @@ class SettingsViewer extends StatelessWidget {
? staticState.paymentTypeMap[settings.defaultPaymentTypeId]?.name
: null,
localization.invoiceFields: settings.invoiceFields,
localization.emailSignature: settings.emailFooter,
localization.emailSignature: settings.emailSignature,
localization.emailStyle: settings.emailStyle,
localization.replyToEmail: settings.replyToEmail,
localization.bccEmail: settings.bccEmail,

View File

@ -38,7 +38,7 @@ class _EmailSettingsState extends State<EmailSettings> {
final _replyToEmailController = TextEditingController();
final _bccEmailController = TextEditingController();
final _emailStyleCustomController = TextEditingController();
final _emailFooterController = TextEditingController();
final _emailSignatureController = TextEditingController();
List<TextEditingController> _controllers = [];
@ -65,7 +65,7 @@ class _EmailSettingsState extends State<EmailSettings> {
_replyToEmailController,
_bccEmailController,
_emailStyleCustomController,
_emailFooterController,
_emailSignatureController,
];
_controllers
@ -75,7 +75,7 @@ class _EmailSettingsState extends State<EmailSettings> {
_replyToEmailController.text = settings.replyToEmail;
_bccEmailController.text = settings.bccEmail;
_emailStyleCustomController.text = settings.emailStyleCustom;
_emailFooterController.text = settings.emailFooter;
_emailSignatureController.text = settings.emailSignature;
_controllers
.forEach((dynamic controller) => controller.addListener(_onChanged));
@ -88,7 +88,7 @@ class _EmailSettingsState extends State<EmailSettings> {
..replyToEmail = _replyToEmailController.text.trim()
..bccEmail = _bccEmailController.text.trim()
..emailStyleCustom = _emailStyleCustomController.text.trim()
..emailFooter = _emailFooterController.text.trim());
..emailSignature = _emailSignatureController.text.trim());
if (settings != widget.viewModel.settings) {
widget.viewModel.onSettingsChanged(settings);
}
@ -202,7 +202,7 @@ class _EmailSettingsState extends State<EmailSettings> {
],
DecoratedFormField(
label: localization.emailSignature,
controller: _emailFooterController,
controller: _emailSignatureController,
maxLines: 6,
keyboardType: TextInputType.multiline,
),

View File

@ -26,7 +26,10 @@ Reducer<String> selectedIdReducer = combineReducers([
TypedReducer<String, ArchiveStubsSuccess>((selectedId, action) => ''),
TypedReducer<String, ClearEntityFilter>((selectedId, action) => ''),
TypedReducer<String, FilterByEntity>((selectedId, action) =>
action.entityType == EntityType.stub ? action.entityId : selectedId),
action
.clearSelection
? ''
: action.entityType == EntityType.stub ? action.entityId : selectedId),
]);