Show email status/errors
This commit is contained in:
parent
4806051bca
commit
e1187d53d1
|
|
@ -1772,6 +1772,8 @@ abstract class InvitationEntity extends Object
|
||||||
clientContactId: clientContactId ?? '',
|
clientContactId: clientContactId ?? '',
|
||||||
vendorContactId: vendorContactId ?? '',
|
vendorContactId: vendorContactId ?? '',
|
||||||
createdAt: 0,
|
createdAt: 0,
|
||||||
|
emailStatus: '',
|
||||||
|
emailError: '',
|
||||||
key: '',
|
key: '',
|
||||||
link: '',
|
link: '',
|
||||||
sentDate: '',
|
sentDate: '',
|
||||||
|
|
@ -1813,7 +1815,10 @@ abstract class InvitationEntity extends Object
|
||||||
String get openedDate;
|
String get openedDate;
|
||||||
|
|
||||||
@BuiltValueField(wireName: 'email_status', compare: false)
|
@BuiltValueField(wireName: 'email_status', compare: false)
|
||||||
String? get emailStatus;
|
String get emailStatus;
|
||||||
|
|
||||||
|
@BuiltValueField(wireName: 'email_error', compare: false)
|
||||||
|
String get emailError;
|
||||||
|
|
||||||
String get downloadLink =>
|
String get downloadLink =>
|
||||||
'$link/download?t=${DateTime.now().millisecondsSinceEpoch}';
|
'$link/download?t=${DateTime.now().millisecondsSinceEpoch}';
|
||||||
|
|
@ -1857,7 +1862,9 @@ abstract class InvitationEntity extends Object
|
||||||
// ignore: unused_element
|
// ignore: unused_element
|
||||||
static void _initializeBuilder(InvitationEntityBuilder builder) => builder
|
static void _initializeBuilder(InvitationEntityBuilder builder) => builder
|
||||||
..clientContactId = ''
|
..clientContactId = ''
|
||||||
..vendorContactId = '';
|
..vendorContactId = ''
|
||||||
|
..emailError = ''
|
||||||
|
..emailStatus = '';
|
||||||
|
|
||||||
static Serializer<InvitationEntity> get serializer =>
|
static Serializer<InvitationEntity> get serializer =>
|
||||||
_$invitationEntitySerializer;
|
_$invitationEntitySerializer;
|
||||||
|
|
|
||||||
|
|
@ -988,6 +988,12 @@ class _$InvitationEntitySerializer
|
||||||
'opened_date',
|
'opened_date',
|
||||||
serializers.serialize(object.openedDate,
|
serializers.serialize(object.openedDate,
|
||||||
specifiedType: const FullType(String)),
|
specifiedType: const FullType(String)),
|
||||||
|
'email_status',
|
||||||
|
serializers.serialize(object.emailStatus,
|
||||||
|
specifiedType: const FullType(String)),
|
||||||
|
'email_error',
|
||||||
|
serializers.serialize(object.emailError,
|
||||||
|
specifiedType: const FullType(String)),
|
||||||
'created_at',
|
'created_at',
|
||||||
serializers.serialize(object.createdAt,
|
serializers.serialize(object.createdAt,
|
||||||
specifiedType: const FullType(int)),
|
specifiedType: const FullType(int)),
|
||||||
|
|
@ -1001,13 +1007,6 @@ class _$InvitationEntitySerializer
|
||||||
serializers.serialize(object.id, specifiedType: const FullType(String)),
|
serializers.serialize(object.id, specifiedType: const FullType(String)),
|
||||||
];
|
];
|
||||||
Object? value;
|
Object? value;
|
||||||
value = object.emailStatus;
|
|
||||||
if (value != null) {
|
|
||||||
result
|
|
||||||
..add('email_status')
|
|
||||||
..add(serializers.serialize(value,
|
|
||||||
specifiedType: const FullType(String)));
|
|
||||||
}
|
|
||||||
value = object.isChanged;
|
value = object.isChanged;
|
||||||
if (value != null) {
|
if (value != null) {
|
||||||
result
|
result
|
||||||
|
|
@ -1088,7 +1087,11 @@ class _$InvitationEntitySerializer
|
||||||
break;
|
break;
|
||||||
case 'email_status':
|
case 'email_status':
|
||||||
result.emailStatus = serializers.deserialize(value,
|
result.emailStatus = serializers.deserialize(value,
|
||||||
specifiedType: const FullType(String)) as String?;
|
specifiedType: const FullType(String))! as String;
|
||||||
|
break;
|
||||||
|
case 'email_error':
|
||||||
|
result.emailError = serializers.deserialize(value,
|
||||||
|
specifiedType: const FullType(String))! as String;
|
||||||
break;
|
break;
|
||||||
case 'isChanged':
|
case 'isChanged':
|
||||||
result.isChanged = serializers.deserialize(value,
|
result.isChanged = serializers.deserialize(value,
|
||||||
|
|
@ -3002,7 +3005,9 @@ class _$InvitationEntity extends InvitationEntity {
|
||||||
@override
|
@override
|
||||||
final String openedDate;
|
final String openedDate;
|
||||||
@override
|
@override
|
||||||
final String? emailStatus;
|
final String emailStatus;
|
||||||
|
@override
|
||||||
|
final String emailError;
|
||||||
@override
|
@override
|
||||||
final bool? isChanged;
|
final bool? isChanged;
|
||||||
@override
|
@override
|
||||||
|
|
@ -3034,7 +3039,8 @@ class _$InvitationEntity extends InvitationEntity {
|
||||||
required this.sentDate,
|
required this.sentDate,
|
||||||
required this.viewedDate,
|
required this.viewedDate,
|
||||||
required this.openedDate,
|
required this.openedDate,
|
||||||
this.emailStatus,
|
required this.emailStatus,
|
||||||
|
required this.emailError,
|
||||||
this.isChanged,
|
this.isChanged,
|
||||||
required this.createdAt,
|
required this.createdAt,
|
||||||
required this.updatedAt,
|
required this.updatedAt,
|
||||||
|
|
@ -3057,6 +3063,10 @@ class _$InvitationEntity extends InvitationEntity {
|
||||||
viewedDate, r'InvitationEntity', 'viewedDate');
|
viewedDate, r'InvitationEntity', 'viewedDate');
|
||||||
BuiltValueNullFieldError.checkNotNull(
|
BuiltValueNullFieldError.checkNotNull(
|
||||||
openedDate, r'InvitationEntity', 'openedDate');
|
openedDate, r'InvitationEntity', 'openedDate');
|
||||||
|
BuiltValueNullFieldError.checkNotNull(
|
||||||
|
emailStatus, r'InvitationEntity', 'emailStatus');
|
||||||
|
BuiltValueNullFieldError.checkNotNull(
|
||||||
|
emailError, r'InvitationEntity', 'emailError');
|
||||||
BuiltValueNullFieldError.checkNotNull(
|
BuiltValueNullFieldError.checkNotNull(
|
||||||
createdAt, r'InvitationEntity', 'createdAt');
|
createdAt, r'InvitationEntity', 'createdAt');
|
||||||
BuiltValueNullFieldError.checkNotNull(
|
BuiltValueNullFieldError.checkNotNull(
|
||||||
|
|
@ -3126,6 +3136,7 @@ class _$InvitationEntity extends InvitationEntity {
|
||||||
..add('viewedDate', viewedDate)
|
..add('viewedDate', viewedDate)
|
||||||
..add('openedDate', openedDate)
|
..add('openedDate', openedDate)
|
||||||
..add('emailStatus', emailStatus)
|
..add('emailStatus', emailStatus)
|
||||||
|
..add('emailError', emailError)
|
||||||
..add('isChanged', isChanged)
|
..add('isChanged', isChanged)
|
||||||
..add('createdAt', createdAt)
|
..add('createdAt', createdAt)
|
||||||
..add('updatedAt', updatedAt)
|
..add('updatedAt', updatedAt)
|
||||||
|
|
@ -3177,6 +3188,10 @@ class InvitationEntityBuilder
|
||||||
String? get emailStatus => _$this._emailStatus;
|
String? get emailStatus => _$this._emailStatus;
|
||||||
set emailStatus(String? emailStatus) => _$this._emailStatus = emailStatus;
|
set emailStatus(String? emailStatus) => _$this._emailStatus = emailStatus;
|
||||||
|
|
||||||
|
String? _emailError;
|
||||||
|
String? get emailError => _$this._emailError;
|
||||||
|
set emailError(String? emailError) => _$this._emailError = emailError;
|
||||||
|
|
||||||
bool? _isChanged;
|
bool? _isChanged;
|
||||||
bool? get isChanged => _$this._isChanged;
|
bool? get isChanged => _$this._isChanged;
|
||||||
set isChanged(bool? isChanged) => _$this._isChanged = isChanged;
|
set isChanged(bool? isChanged) => _$this._isChanged = isChanged;
|
||||||
|
|
@ -3230,6 +3245,7 @@ class InvitationEntityBuilder
|
||||||
_viewedDate = $v.viewedDate;
|
_viewedDate = $v.viewedDate;
|
||||||
_openedDate = $v.openedDate;
|
_openedDate = $v.openedDate;
|
||||||
_emailStatus = $v.emailStatus;
|
_emailStatus = $v.emailStatus;
|
||||||
|
_emailError = $v.emailError;
|
||||||
_isChanged = $v.isChanged;
|
_isChanged = $v.isChanged;
|
||||||
_createdAt = $v.createdAt;
|
_createdAt = $v.createdAt;
|
||||||
_updatedAt = $v.updatedAt;
|
_updatedAt = $v.updatedAt;
|
||||||
|
|
@ -3275,12 +3291,13 @@ class InvitationEntityBuilder
|
||||||
viewedDate, r'InvitationEntity', 'viewedDate'),
|
viewedDate, r'InvitationEntity', 'viewedDate'),
|
||||||
openedDate: BuiltValueNullFieldError.checkNotNull(
|
openedDate: BuiltValueNullFieldError.checkNotNull(
|
||||||
openedDate, r'InvitationEntity', 'openedDate'),
|
openedDate, r'InvitationEntity', 'openedDate'),
|
||||||
emailStatus: emailStatus,
|
emailStatus: BuiltValueNullFieldError.checkNotNull(
|
||||||
|
emailStatus, r'InvitationEntity', 'emailStatus'),
|
||||||
|
emailError:
|
||||||
|
BuiltValueNullFieldError.checkNotNull(emailError, r'InvitationEntity', 'emailError'),
|
||||||
isChanged: isChanged,
|
isChanged: isChanged,
|
||||||
createdAt: BuiltValueNullFieldError.checkNotNull(
|
createdAt: BuiltValueNullFieldError.checkNotNull(createdAt, r'InvitationEntity', 'createdAt'),
|
||||||
createdAt, r'InvitationEntity', 'createdAt'),
|
updatedAt: BuiltValueNullFieldError.checkNotNull(updatedAt, r'InvitationEntity', 'updatedAt'),
|
||||||
updatedAt:
|
|
||||||
BuiltValueNullFieldError.checkNotNull(updatedAt, r'InvitationEntity', 'updatedAt'),
|
|
||||||
archivedAt: BuiltValueNullFieldError.checkNotNull(archivedAt, r'InvitationEntity', 'archivedAt'),
|
archivedAt: BuiltValueNullFieldError.checkNotNull(archivedAt, r'InvitationEntity', 'archivedAt'),
|
||||||
isDeleted: isDeleted,
|
isDeleted: isDeleted,
|
||||||
createdUserId: createdUserId,
|
createdUserId: createdUserId,
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
// Flutter imports:
|
// Flutter imports:
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:invoiceninja_flutter/ui/app/copy_to_clipboard.dart';
|
||||||
|
|
||||||
// Package imports:
|
// Package imports:
|
||||||
import 'package:invoiceninja_flutter/ui/app/portal_links.dart';
|
import 'package:invoiceninja_flutter/ui/app/portal_links.dart';
|
||||||
|
|
@ -42,7 +43,7 @@ class _InvitationListTile extends StatelessWidget {
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
final localization = AppLocalization.of(context);
|
final localization = AppLocalization.of(context)!;
|
||||||
final state = viewModel.state!;
|
final state = viewModel.state!;
|
||||||
final client = state.clientState.get(viewModel.invoice!.clientId);
|
final client = state.clientState.get(viewModel.invoice!.clientId);
|
||||||
final vendor = state.vendorState.get(viewModel.invoice!.vendorId);
|
final vendor = state.vendorState.get(viewModel.invoice!.vendorId);
|
||||||
|
|
@ -78,19 +79,19 @@ class _InvitationListTile extends StatelessWidget {
|
||||||
case InvitationEntity.EMAIL_STATUS_DELIVERED:
|
case InvitationEntity.EMAIL_STATUS_DELIVERED:
|
||||||
icon = Tooltip(
|
icon = Tooltip(
|
||||||
child: Icon(Icons.check_circle),
|
child: Icon(Icons.check_circle),
|
||||||
message: localization!.delivered,
|
message: localization.delivered,
|
||||||
);
|
);
|
||||||
break;
|
break;
|
||||||
case InvitationEntity.EMAIL_STATUS_BOUNCED:
|
case InvitationEntity.EMAIL_STATUS_BOUNCED:
|
||||||
icon = Tooltip(
|
icon = Tooltip(
|
||||||
child: Icon(Icons.error),
|
child: Icon(Icons.error),
|
||||||
message: localization!.bounced,
|
message: localization.bounced,
|
||||||
);
|
);
|
||||||
break;
|
break;
|
||||||
case InvitationEntity.EMAIL_STATUS_SPAM:
|
case InvitationEntity.EMAIL_STATUS_SPAM:
|
||||||
icon = Tooltip(
|
icon = Tooltip(
|
||||||
child: Icon(Icons.error),
|
child: Icon(Icons.error),
|
||||||
message: localization!.spam,
|
message: localization.spam,
|
||||||
);
|
);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
@ -106,7 +107,7 @@ class _InvitationListTile extends StatelessWidget {
|
||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsets.only(bottom: 4),
|
padding: const EdgeInsets.only(bottom: 4),
|
||||||
child: Text(
|
child: Text(
|
||||||
'${localization!.sent}: ' +
|
'${localization.sent}: ' +
|
||||||
formatDate(invitation.sentDate, context, showTime: true),
|
formatDate(invitation.sentDate, context, showTime: true),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|
@ -114,7 +115,7 @@ class _InvitationListTile extends StatelessWidget {
|
||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsets.only(bottom: 4),
|
padding: const EdgeInsets.only(bottom: 4),
|
||||||
child: Text(
|
child: Text(
|
||||||
'${localization!.opened}: ' +
|
'${localization.opened}: ' +
|
||||||
formatDate(invitation.openedDate, context, showTime: true),
|
formatDate(invitation.openedDate, context, showTime: true),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|
@ -122,11 +123,22 @@ class _InvitationListTile extends StatelessWidget {
|
||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsets.only(bottom: 4),
|
padding: const EdgeInsets.only(bottom: 4),
|
||||||
child: Text(
|
child: Text(
|
||||||
'${localization!.viewed}: ' +
|
'${localization.viewed}: ' +
|
||||||
formatDate(invitation.viewedDate, context, showTime: true),
|
formatDate(invitation.viewedDate, context, showTime: true),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
SizedBox(height: 8),
|
if (invitation.emailStatus.isNotEmpty)
|
||||||
|
CopyToClipboard(
|
||||||
|
value: invitation.emailError,
|
||||||
|
child: Padding(
|
||||||
|
padding: const EdgeInsets.symmetric(vertical: 8),
|
||||||
|
child: Text(
|
||||||
|
invitation.emailError,
|
||||||
|
style: TextStyle(fontWeight: FontWeight.bold),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
SizedBox(height: 16),
|
||||||
PortalLinks(
|
PortalLinks(
|
||||||
viewLink: invitation.silentLink,
|
viewLink: invitation.silentLink,
|
||||||
copyLink: invitation.link,
|
copyLink: invitation.link,
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue