From c32377e37d678a47dc2d0861a9fdb3d60c3b9848 Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Sun, 4 Jun 2023 17:34:57 +0300 Subject: [PATCH] Cancel button for client settings doesn't work --- lib/redux/ui/pref_reducer.dart | 76 +++++++++++++++++++++++++++++++--- 1 file changed, 70 insertions(+), 6 deletions(-) diff --git a/lib/redux/ui/pref_reducer.dart b/lib/redux/ui/pref_reducer.dart index 6a0070be1..eb4d20f08 100644 --- a/lib/redux/ui/pref_reducer.dart +++ b/lib/redux/ui/pref_reducer.dart @@ -560,6 +560,9 @@ Reducer> historyReducer = combineReducers([ TypedReducer, ViewProduct>((historyList, action) => _addToHistory(historyList, HistoryRecord(id: action.productId, entityType: EntityType.product))), + TypedReducer, ViewProductList>( + (historyList, action) => _addToHistory( + historyList, HistoryRecord(entityType: EntityType.product))), TypedReducer, EditProduct>((historyList, action) => _addToHistory( historyList, @@ -568,6 +571,9 @@ Reducer> historyReducer = combineReducers([ TypedReducer, ViewInvoice>((historyList, action) => _addToHistory(historyList, HistoryRecord(id: action.invoiceId, entityType: EntityType.invoice))), + TypedReducer, ViewInvoiceList>( + (historyList, action) => _addToHistory( + historyList, HistoryRecord(entityType: EntityType.invoice))), TypedReducer, EditInvoice>((historyList, action) => _addToHistory( historyList, @@ -576,6 +582,9 @@ Reducer> historyReducer = combineReducers([ TypedReducer, ViewPayment>((historyList, action) => _addToHistory(historyList, HistoryRecord(id: action.paymentId, entityType: EntityType.payment))), + TypedReducer, ViewPaymentList>( + (historyList, action) => _addToHistory( + historyList, HistoryRecord(entityType: EntityType.payment))), TypedReducer, EditPayment>((historyList, action) => _addToHistory( historyList, @@ -584,18 +593,25 @@ Reducer> historyReducer = combineReducers([ TypedReducer, ViewQuote>((historyList, action) => _addToHistory(historyList, HistoryRecord(id: action.quoteId, entityType: EntityType.quote))), + TypedReducer, ViewQuoteList>((historyList, action) => + _addToHistory(historyList, HistoryRecord(entityType: EntityType.quote))), TypedReducer, EditQuote>((historyList, action) => _addToHistory(historyList, HistoryRecord(id: action.quote.id, entityType: EntityType.quote))), TypedReducer, ViewTask>((historyList, action) => _addToHistory(historyList, HistoryRecord(id: action.taskId, entityType: EntityType.task))), + TypedReducer, ViewTaskList>((historyList, action) => + _addToHistory(historyList, HistoryRecord(entityType: EntityType.task))), TypedReducer, EditTask>((historyList, action) => _addToHistory(historyList, HistoryRecord(id: action.task.id, entityType: EntityType.task))), TypedReducer, ViewProject>((historyList, action) => _addToHistory(historyList, HistoryRecord(id: action.projectId, entityType: EntityType.project))), + TypedReducer, ViewProjectList>( + (historyList, action) => _addToHistory( + historyList, HistoryRecord(entityType: EntityType.project))), TypedReducer, EditProject>((historyList, action) => _addToHistory( historyList, @@ -604,12 +620,18 @@ Reducer> historyReducer = combineReducers([ TypedReducer, ViewVendor>((historyList, action) => _addToHistory(historyList, HistoryRecord(id: action.vendorId, entityType: EntityType.vendor))), + TypedReducer, ViewVendorList>((historyList, + action) => + _addToHistory(historyList, HistoryRecord(entityType: EntityType.vendor))), TypedReducer, EditVendor>((historyList, action) => _addToHistory(historyList, HistoryRecord(id: action.vendor.id, entityType: EntityType.vendor))), TypedReducer, ViewExpense>((historyList, action) => _addToHistory(historyList, HistoryRecord(id: action.expenseId, entityType: EntityType.expense))), + TypedReducer, ViewExpenseList>( + (historyList, action) => _addToHistory( + historyList, HistoryRecord(entityType: EntityType.expense))), TypedReducer, EditExpense>((historyList, action) => _addToHistory( historyList, @@ -621,6 +643,9 @@ Reducer> historyReducer = combineReducers([ HistoryRecord( id: action.companyGatewayId, entityType: EntityType.companyGateway))), + TypedReducer, ViewCompanyGatewayList>( + (historyList, action) => _addToHistory( + historyList, HistoryRecord(entityType: EntityType.companyGateway))), TypedReducer, EditCompanyGateway>( (historyList, action) => _addToHistory( historyList, @@ -630,12 +655,16 @@ Reducer> historyReducer = combineReducers([ TypedReducer, ViewUser>((historyList, action) => _addToHistory(historyList, HistoryRecord(id: action.userId, entityType: EntityType.user))), + TypedReducer, ViewUserList>((historyList, action) => + _addToHistory(historyList, HistoryRecord(entityType: EntityType.user))), TypedReducer, EditUser>((historyList, action) => _addToHistory(historyList, HistoryRecord(id: action.user.id, entityType: EntityType.user))), TypedReducer, ViewGroup>((historyList, action) => _addToHistory(historyList, HistoryRecord(id: action.groupId, entityType: EntityType.group))), + TypedReducer, ViewGroupList>((historyList, action) => + _addToHistory(historyList, HistoryRecord(entityType: EntityType.group))), TypedReducer, EditGroup>((historyList, action) => _addToHistory(historyList, HistoryRecord(id: action.group.id, entityType: EntityType.group))), @@ -645,6 +674,9 @@ Reducer> historyReducer = combineReducers([ historyList, HistoryRecord( id: action.scheduleId, entityType: EntityType.schedule))), + TypedReducer, ViewScheduleList>( + (historyList, action) => _addToHistory( + historyList, HistoryRecord(entityType: EntityType.schedule))), TypedReducer, EditSchedule>((historyList, action) => _addToHistory( historyList, @@ -657,6 +689,9 @@ Reducer> historyReducer = combineReducers([ HistoryRecord( id: action.transactionRuleId, entityType: EntityType.transactionRule))), + TypedReducer, ViewTransactionRuleList>( + (historyList, action) => _addToHistory( + historyList, HistoryRecord(entityType: EntityType.transactionRule))), TypedReducer, EditTransactionRule>( (historyList, action) => _addToHistory( historyList, @@ -669,6 +704,9 @@ Reducer> historyReducer = combineReducers([ historyList, HistoryRecord( id: action.transactionId, entityType: EntityType.transaction))), + TypedReducer, ViewTransactionList>( + (historyList, action) => _addToHistory( + historyList, HistoryRecord(entityType: EntityType.transaction))), TypedReducer, EditTransaction>( (historyList, action) => _addToHistory( historyList, @@ -680,25 +718,33 @@ Reducer> historyReducer = combineReducers([ historyList, HistoryRecord( id: action.bankAccountId, entityType: EntityType.bankAccount))), + TypedReducer, ViewBankAccountList>( + (historyList, action) => _addToHistory( + historyList, HistoryRecord(entityType: EntityType.bankAccount))), TypedReducer, ViewPurchaseOrder>( (historyList, action) => _addToHistory( historyList, HistoryRecord( id: action.purchaseOrderId, entityType: EntityType.purchaseOrder))), + TypedReducer, ViewPurchaseOrderList>( + (historyList, action) => _addToHistory( + historyList, HistoryRecord(entityType: EntityType.purchaseOrder))), TypedReducer, EditPurchaseOrder>( (historyList, action) => _addToHistory( historyList, HistoryRecord( id: action.purchaseOrder.id, entityType: EntityType.purchaseOrder))), - TypedReducer, ViewRecurringExpense>( (historyList, action) => _addToHistory( historyList, HistoryRecord( id: action.recurringExpenseId, entityType: EntityType.recurringExpense))), + TypedReducer, ViewRecurringExpenseList>( + (historyList, action) => _addToHistory( + historyList, HistoryRecord(entityType: EntityType.recurringExpense))), TypedReducer, EditRecurringExpense>( (historyList, action) => _addToHistory( historyList, @@ -711,6 +757,9 @@ Reducer> historyReducer = combineReducers([ historyList, HistoryRecord( id: action.subscriptionId, entityType: EntityType.subscription))), + TypedReducer, ViewSubscriptionList>( + (historyList, action) => _addToHistory( + historyList, HistoryRecord(entityType: EntityType.subscription))), TypedReducer, EditSubscription>( (historyList, action) => _addToHistory( historyList, @@ -723,31 +772,38 @@ Reducer> historyReducer = combineReducers([ historyList, HistoryRecord( id: action.taskStatusId, entityType: EntityType.taskStatus))), + TypedReducer, ViewTaskStatusList>( + (historyList, action) => _addToHistory( + historyList, HistoryRecord(entityType: EntityType.taskStatus))), TypedReducer, EditTaskStatus>( (historyList, action) => _addToHistory( historyList, HistoryRecord( id: action.taskStatus.id, entityType: EntityType.taskStatus))), - TypedReducer, ViewExpenseCategory>( (historyList, action) => _addToHistory( historyList, HistoryRecord( id: action.expenseCategoryId, entityType: EntityType.expenseCategory))), + TypedReducer, ViewExpenseCategoryList>( + (historyList, action) => _addToHistory( + historyList, HistoryRecord(entityType: EntityType.expenseCategory))), TypedReducer, EditExpenseCategory>( (historyList, action) => _addToHistory( historyList, HistoryRecord( id: action.expenseCategory.id, entityType: EntityType.expenseCategory))), - TypedReducer, ViewRecurringInvoice>( (historyList, action) => _addToHistory( historyList, HistoryRecord( id: action.recurringInvoiceId, entityType: EntityType.recurringInvoice))), + TypedReducer, ViewRecurringInvoiceList>( + (historyList, action) => _addToHistory( + historyList, HistoryRecord(entityType: EntityType.recurringInvoice))), TypedReducer, EditRecurringInvoice>( (historyList, action) => _addToHistory( historyList, @@ -758,36 +814,44 @@ Reducer> historyReducer = combineReducers([ TypedReducer, ViewWebhook>((historyList, action) => _addToHistory(historyList, HistoryRecord(id: action.webhookId, entityType: EntityType.webhook))), + TypedReducer, ViewWebhookList>( + (historyList, action) => _addToHistory( + historyList, HistoryRecord(entityType: EntityType.webhook))), TypedReducer, EditWebhook>((historyList, action) => _addToHistory( historyList, HistoryRecord( id: action.webhook.id, entityType: EntityType.webhook))), - TypedReducer, ViewToken>((historyList, action) => _addToHistory(historyList, HistoryRecord(id: action.tokenId, entityType: EntityType.token))), + TypedReducer, ViewTokenList>((historyList, action) => + _addToHistory(historyList, HistoryRecord(entityType: EntityType.token))), TypedReducer, EditToken>((historyList, action) => _addToHistory(historyList, HistoryRecord(id: action.token.id, entityType: EntityType.token))), - TypedReducer, ViewPaymentTerm>( (historyList, action) => _addToHistory( historyList, HistoryRecord( id: action.paymentTermId, entityType: EntityType.paymentTerm))), + TypedReducer, ViewPaymentTermList>( + (historyList, action) => _addToHistory( + historyList, HistoryRecord(entityType: EntityType.paymentTerm))), TypedReducer, EditPaymentTerm>( (historyList, action) => _addToHistory( historyList, HistoryRecord( id: action.paymentTerm.id, entityType: EntityType.paymentTerm))), - TypedReducer, EditDesign>((historyList, action) => _addToHistory(historyList, HistoryRecord(id: action.design.id, entityType: EntityType.design))), TypedReducer, ViewCredit>((historyList, action) => _addToHistory(historyList, HistoryRecord(id: action.creditId, entityType: EntityType.credit))), + TypedReducer, ViewCreditList>((historyList, + action) => + _addToHistory(historyList, HistoryRecord(entityType: EntityType.credit))), TypedReducer, EditCredit>((historyList, action) => _addToHistory(historyList, HistoryRecord(id: action.credit.id, entityType: EntityType.credit))),