Add ‘Refresh Data’ option on cron error popup
This commit is contained in:
parent
e7ab8accae
commit
27898eccd0
|
|
@ -440,14 +440,16 @@ Future handleCreditAction(
|
||||||
showMessageDialog(
|
showMessageDialog(
|
||||||
context: context,
|
context: context,
|
||||||
message: localization.clientEmailNotSet,
|
message: localization.clientEmailNotSet,
|
||||||
secondaryAction: FlatButton(
|
secondaryActions: [
|
||||||
|
FlatButton(
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
Navigator.of(context).pop();
|
Navigator.of(context).pop();
|
||||||
editEntity(
|
editEntity(
|
||||||
context: context,
|
context: context,
|
||||||
entity: state.clientState.get(credit.clientId));
|
entity: state.clientState.get(credit.clientId));
|
||||||
},
|
},
|
||||||
child: Text(localization.editClient.toUpperCase())));
|
child: Text(localization.editClient.toUpperCase()))
|
||||||
|
]);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (creditIds.length == 1) {
|
if (creditIds.length == 1) {
|
||||||
|
|
|
||||||
|
|
@ -539,14 +539,16 @@ void handleInvoiceAction(BuildContext context, List<BaseEntity> invoices,
|
||||||
showMessageDialog(
|
showMessageDialog(
|
||||||
context: context,
|
context: context,
|
||||||
message: localization.clientEmailNotSet,
|
message: localization.clientEmailNotSet,
|
||||||
secondaryAction: FlatButton(
|
secondaryActions: [
|
||||||
|
FlatButton(
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
Navigator.of(context).pop();
|
Navigator.of(context).pop();
|
||||||
editEntity(
|
editEntity(
|
||||||
context: context,
|
context: context,
|
||||||
entity: state.clientState.get(invoice.clientId));
|
entity: state.clientState.get(invoice.clientId));
|
||||||
},
|
},
|
||||||
child: Text(localization.editClient.toUpperCase())));
|
child: Text(localization.editClient.toUpperCase()))
|
||||||
|
]);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (invoiceIds.length == 1) {
|
if (invoiceIds.length == 1) {
|
||||||
|
|
|
||||||
|
|
@ -463,14 +463,16 @@ Future handleQuoteAction(
|
||||||
showMessageDialog(
|
showMessageDialog(
|
||||||
context: context,
|
context: context,
|
||||||
message: localization.clientEmailNotSet,
|
message: localization.clientEmailNotSet,
|
||||||
secondaryAction: FlatButton(
|
secondaryActions: [
|
||||||
|
FlatButton(
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
Navigator.of(context).pop();
|
Navigator.of(context).pop();
|
||||||
editEntity(
|
editEntity(
|
||||||
context: context,
|
context: context,
|
||||||
entity: state.clientState.get(quote.clientId));
|
entity: state.clientState.get(quote.clientId));
|
||||||
},
|
},
|
||||||
child: Text(localization.editClient.toUpperCase())));
|
child: Text(localization.editClient.toUpperCase()))
|
||||||
|
]);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (quoteIds.length == 1) {
|
if (quoteIds.length == 1) {
|
||||||
|
|
|
||||||
|
|
@ -7,12 +7,12 @@ class MessageDialog extends StatelessWidget {
|
||||||
this.onDismiss,
|
this.onDismiss,
|
||||||
this.onDiscard,
|
this.onDiscard,
|
||||||
this.dismissLabel,
|
this.dismissLabel,
|
||||||
this.secondaryAction,
|
this.secondaryActions,
|
||||||
});
|
});
|
||||||
|
|
||||||
final String message;
|
final String message;
|
||||||
final String dismissLabel;
|
final String dismissLabel;
|
||||||
final FlatButton secondaryAction;
|
final List<FlatButton> secondaryActions;
|
||||||
final Function onDismiss;
|
final Function onDismiss;
|
||||||
final Function onDiscard;
|
final Function onDiscard;
|
||||||
|
|
||||||
|
|
@ -50,10 +50,14 @@ class MessageDialog extends StatelessWidget {
|
||||||
onDiscard();
|
onDiscard();
|
||||||
}),
|
}),
|
||||||
),
|
),
|
||||||
if (secondaryAction != null)
|
if (secondaryActions != null)
|
||||||
Padding(
|
Row(
|
||||||
|
children: secondaryActions
|
||||||
|
.map((action) => Padding(
|
||||||
padding: const EdgeInsets.only(right: 10),
|
padding: const EdgeInsets.only(right: 10),
|
||||||
child: secondaryAction,
|
child: action,
|
||||||
|
))
|
||||||
|
.toList(),
|
||||||
),
|
),
|
||||||
FlatButton(
|
FlatButton(
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
|
|
|
||||||
|
|
@ -501,7 +501,7 @@ class SidebarFooter extends StatelessWidget {
|
||||||
Expanded(child: SizedBox())
|
Expanded(child: SizedBox())
|
||||||
] else ...[
|
] else ...[
|
||||||
if (!Config.DEMO_MODE && !state.isDemo)
|
if (!Config.DEMO_MODE && !state.isDemo)
|
||||||
if (!account.isCronEnabled)
|
if (true || !account.isCronEnabled)
|
||||||
IconButton(
|
IconButton(
|
||||||
icon: Icon(
|
icon: Icon(
|
||||||
Icons.warning,
|
Icons.warning,
|
||||||
|
|
@ -510,14 +510,22 @@ class SidebarFooter extends StatelessWidget {
|
||||||
onPressed: () => showMessageDialog(
|
onPressed: () => showMessageDialog(
|
||||||
context: context,
|
context: context,
|
||||||
message: localization.cronsNotEnabled,
|
message: localization.cronsNotEnabled,
|
||||||
secondaryAction: FlatButton(
|
secondaryActions: [
|
||||||
|
FlatButton(
|
||||||
child: Text(localization.learnMore.toUpperCase()),
|
child: Text(localization.learnMore.toUpperCase()),
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
launch(kCronsHelpUrl,
|
launch(kCronsHelpUrl,
|
||||||
forceSafariVC: false, forceWebView: false);
|
forceSafariVC: false, forceWebView: false);
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
|
FlatButton(
|
||||||
|
child: Text(localization.refreshData.toUpperCase()),
|
||||||
|
onPressed: () {
|
||||||
|
store.dispatch(RefreshData());
|
||||||
|
Navigator.of(context).pop();
|
||||||
|
},
|
||||||
),
|
),
|
||||||
|
]),
|
||||||
)
|
)
|
||||||
else if (state.credentials.token.isEmpty)
|
else if (state.credentials.token.isEmpty)
|
||||||
IconButton(
|
IconButton(
|
||||||
|
|
|
||||||
|
|
@ -22,14 +22,14 @@ void showErrorDialog({
|
||||||
void showMessageDialog({
|
void showMessageDialog({
|
||||||
@required BuildContext context,
|
@required BuildContext context,
|
||||||
@required String message,
|
@required String message,
|
||||||
FlatButton secondaryAction,
|
List<FlatButton> secondaryActions,
|
||||||
}) {
|
}) {
|
||||||
showDialog<MessageDialog>(
|
showDialog<MessageDialog>(
|
||||||
context: context,
|
context: context,
|
||||||
builder: (BuildContext context) {
|
builder: (BuildContext context) {
|
||||||
return MessageDialog(
|
return MessageDialog(
|
||||||
message,
|
message,
|
||||||
secondaryAction: secondaryAction,
|
secondaryActions: secondaryActions,
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue