Don't show restore options for payments
This commit is contained in:
parent
76fa354b25
commit
6458dd398f
|
|
@ -367,6 +367,8 @@ abstract class BaseEntity implements SelectableEntity {
|
||||||
|
|
||||||
bool get isEditable => !isDeleted;
|
bool get isEditable => !isDeleted;
|
||||||
|
|
||||||
|
bool get isRestorable => true;
|
||||||
|
|
||||||
bool userCanAccess(String userId) =>
|
bool userCanAccess(String userId) =>
|
||||||
createdUserId == userId || assignedUserId == userId;
|
createdUserId == userId || assignedUserId == userId;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -471,6 +471,9 @@ abstract class PaymentEntity extends Object
|
||||||
kPaymentStatusPartiallyRefunded
|
kPaymentStatusPartiallyRefunded
|
||||||
].contains(statusId);
|
].contains(statusId);
|
||||||
|
|
||||||
|
@override
|
||||||
|
bool get isRestorable => false;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
FormatNumberType get listDisplayAmountType => FormatNumberType.money;
|
FormatNumberType get listDisplayAmountType => FormatNumberType.money;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -85,8 +85,8 @@ class DismissibleEntity extends StatelessWidget {
|
||||||
endActionPane: ActionPane(
|
endActionPane: ActionPane(
|
||||||
motion: const DrawerMotion(),
|
motion: const DrawerMotion(),
|
||||||
children: [
|
children: [
|
||||||
entity.isActive
|
if (entity.isActive)
|
||||||
? SlidableAction(
|
SlidableAction(
|
||||||
label: localization.archive,
|
label: localization.archive,
|
||||||
backgroundColor: Colors.orange,
|
backgroundColor: Colors.orange,
|
||||||
foregroundColor: Colors.white,
|
foregroundColor: Colors.white,
|
||||||
|
|
@ -94,7 +94,8 @@ class DismissibleEntity extends StatelessWidget {
|
||||||
onPressed: (context) =>
|
onPressed: (context) =>
|
||||||
handleEntityAction(entity, EntityAction.archive),
|
handleEntityAction(entity, EntityAction.archive),
|
||||||
)
|
)
|
||||||
: SlidableAction(
|
else if (entity.isRestorable)
|
||||||
|
SlidableAction(
|
||||||
label: localization.restore,
|
label: localization.restore,
|
||||||
backgroundColor: Colors.blue,
|
backgroundColor: Colors.blue,
|
||||||
foregroundColor: Colors.white,
|
foregroundColor: Colors.white,
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue