Recurring invoices
This commit is contained in:
parent
cc486a23ce
commit
b4613f2e8e
|
|
@ -218,8 +218,11 @@ Middleware<AppState> _createLoadState(
|
||||||
store.dispatch(LoadStateSuccess(appState));
|
store.dispatch(LoadStateSuccess(appState));
|
||||||
|
|
||||||
if (appState.isStale) {
|
if (appState.isStale) {
|
||||||
print('## Load state: is stale - refreshing...');
|
store.dispatch(RefreshData(
|
||||||
store.dispatch(RefreshData());
|
completer: Completer<Null>()
|
||||||
|
..future.catchError(() {
|
||||||
|
store.dispatch(UserLogout(action.context));
|
||||||
|
})));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (uiState.currentRoute != LoginScreen.route &&
|
if (uiState.currentRoute != LoginScreen.route &&
|
||||||
|
|
|
||||||
|
|
@ -231,7 +231,6 @@ Middleware<AppState> _createRefreshRequest(AuthRepository repository) {
|
||||||
loginResponse: data,
|
loginResponse: data,
|
||||||
));
|
));
|
||||||
}).catchError((Object error) {
|
}).catchError((Object error) {
|
||||||
print('Refresh data error: $error');
|
|
||||||
if (action.completer != null) {
|
if (action.completer != null) {
|
||||||
action.completer.completeError(error);
|
action.completer.completeError(error);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -177,12 +177,6 @@ class AddRecurringInvoiceSuccess implements StopSaving, PersistData, PersistUI {
|
||||||
final InvoiceEntity recurringInvoice;
|
final InvoiceEntity recurringInvoice;
|
||||||
}
|
}
|
||||||
|
|
||||||
class AddQuoteItem implements PersistUI {
|
|
||||||
AddQuoteItem({this.quoteItem});
|
|
||||||
|
|
||||||
final InvoiceItemEntity quoteItem;
|
|
||||||
}
|
|
||||||
|
|
||||||
class AddRecurringInvoiceItem implements PersistUI {
|
class AddRecurringInvoiceItem implements PersistUI {
|
||||||
AddRecurringInvoiceItem({this.invoiceItem});
|
AddRecurringInvoiceItem({this.invoiceItem});
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2,9 +2,9 @@ import 'package:flutter/foundation.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:invoiceninja_flutter/ui/app/edit_scaffold.dart';
|
import 'package:invoiceninja_flutter/ui/app/edit_scaffold.dart';
|
||||||
import 'package:invoiceninja_flutter/ui/invoice/edit/invoice_edit_vm.dart';
|
import 'package:invoiceninja_flutter/ui/invoice/edit/invoice_edit_vm.dart';
|
||||||
import 'package:invoiceninja_flutter/ui/quote/edit/quote_edit_details_vm.dart';
|
import 'package:invoiceninja_flutter/ui/recurring_invoice/edit/recurring_invoice_edit_details_vm.dart';
|
||||||
import 'package:invoiceninja_flutter/ui/quote/edit/quote_edit_items_vm.dart';
|
import 'package:invoiceninja_flutter/ui/recurring_invoice/edit/recurring_invoice_edit_items_vm.dart';
|
||||||
import 'package:invoiceninja_flutter/ui/quote/edit/quote_edit_notes_vm.dart';
|
import 'package:invoiceninja_flutter/ui/recurring_invoice/edit/recurring_invoice_edit_notes_vm.dart';
|
||||||
import 'package:invoiceninja_flutter/utils/localization.dart';
|
import 'package:invoiceninja_flutter/utils/localization.dart';
|
||||||
|
|
||||||
class RecurringInvoiceEdit extends StatefulWidget {
|
class RecurringInvoiceEdit extends StatefulWidget {
|
||||||
|
|
@ -103,20 +103,20 @@ class _RecurringInvoiceEditState extends State<RecurringInvoiceEdit>
|
||||||
body: Form(
|
body: Form(
|
||||||
key: _formKey,
|
key: _formKey,
|
||||||
child: state.prefState.isDesktop
|
child: state.prefState.isDesktop
|
||||||
? QuoteEditDetailsScreen(
|
? RecurringInvoiceEditDetailsScreen(
|
||||||
viewModel: widget.viewModel,
|
viewModel: widget.viewModel,
|
||||||
)
|
)
|
||||||
: TabBarView(
|
: TabBarView(
|
||||||
key: ValueKey('__quote_${viewModel.invoice.id}__'),
|
key: ValueKey('__quote_${viewModel.invoice.id}__'),
|
||||||
controller: _controller,
|
controller: _controller,
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
QuoteEditDetailsScreen(
|
RecurringInvoiceEditDetailsScreen(
|
||||||
viewModel: widget.viewModel,
|
viewModel: widget.viewModel,
|
||||||
),
|
),
|
||||||
QuoteEditItemsScreen(
|
RecurringInvoiceEditItemsScreen(
|
||||||
viewModel: widget.viewModel,
|
viewModel: widget.viewModel,
|
||||||
),
|
),
|
||||||
QuoteEditNotesScreen(),
|
RecurringInvoiceEditNotesScreen(),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|
|
||||||
|
|
@ -35,12 +35,12 @@ class RecurringInvoiceEditDetailsScreen extends StatelessWidget {
|
||||||
viewModel: viewModel,
|
viewModel: viewModel,
|
||||||
entityViewModel: this.viewModel,
|
entityViewModel: this.viewModel,
|
||||||
key: ValueKey('__quote_${viewModel.invoice.id}__'),
|
key: ValueKey('__quote_${viewModel.invoice.id}__'),
|
||||||
entityType: EntityType.quote,
|
entityType: EntityType.recurringInvoice,
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
return InvoiceEditDetails(
|
return InvoiceEditDetails(
|
||||||
viewModel: viewModel,
|
viewModel: viewModel,
|
||||||
entityType: EntityType.quote,
|
entityType: EntityType.recurringInvoice,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue