Microsoft Login

This commit is contained in:
Hillel Coren 2022-06-19 18:59:11 +03:00
parent b8ae352672
commit 0b50c7a8dd
2 changed files with 4 additions and 22 deletions

View File

@ -20,7 +20,6 @@ import 'package:invoiceninja_flutter/ui/app/forms/bool_dropdown_button.dart';
import 'package:invoiceninja_flutter/ui/app/forms/decorated_form_field.dart';
import 'package:invoiceninja_flutter/ui/app/forms/dynamic_selector.dart';
import 'package:invoiceninja_flutter/ui/settings/email_settings_vm.dart';
import 'package:invoiceninja_flutter/utils/dialogs.dart';
import 'package:invoiceninja_flutter/utils/localization.dart';
import 'package:invoiceninja_flutter/utils/platforms.dart';
@ -110,23 +109,6 @@ class _EmailSettingsState extends State<EmailSettings> {
}
}
void _onSavePressed(BuildContext context) {
final viewModel = widget.viewModel;
final settings = viewModel.settings;
final sendingUserId = settings.gmailSendingUserId ?? '';
final sendingMethod = settings.emailSendingMethod;
if (sendingMethod == SettingsEntity.EMAIL_SENDING_METHOD_GMAIL &&
sendingUserId.isEmpty) {
showErrorDialog(
context: context,
message: AppLocalization.of(context).selectAGmailUser);
return;
}
viewModel.onSavePressed(context);
}
@override
Widget build(BuildContext context) {
final localization = AppLocalization.of(context);
@ -138,13 +120,13 @@ class _EmailSettingsState extends State<EmailSettings> {
memoizedMicrosoftUserList(viewModel.state.userState.map);
final gmailSendingUserId = settings.gmailSendingUserId ?? '';
final disableSave = settings.emailSendingMethod ==
SettingsEntity.EMAIL_SENDING_METHOD_GMAIL &&
final disableSave = settings.emailSendingMethod !=
SettingsEntity.EMAIL_SENDING_METHOD_DEFAULT &&
(gmailSendingUserId.isEmpty || gmailSendingUserId == '0');
return EditScaffold(
title: localization.emailSettings,
onSavePressed: disableSave ? null : _onSavePressed,
onSavePressed: disableSave ? null : viewModel.onSavePressed,
body: AppForm(
formKey: _formKey,
focusNode: _focusNode,

View File

@ -16,7 +16,7 @@ mixin LocalizationsProvider on LocaleCodeAware {
static final Map<String, Map<String, String>> _localizedValues = {
'en': {
// STARTER: lang key - do not remove comment
'use_web_app_to_connect_microsoft':
'use_web_app_to_connect_microsoft':
'Please use the web app to connect to Microsoft',
'email_provider': 'Email Provider',
'connect_microsoft': 'Connect Microsoft',