Skip to content

Commit

Permalink
Vendor bulk updates
Browse files Browse the repository at this point in the history
  • Loading branch information
hillelcoren committed Dec 1, 2024
1 parent 4b80902 commit 7ab8ea3
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/data/models/client_model.dart
Original file line number Diff line number Diff line change
Expand Up @@ -691,7 +691,7 @@ abstract class ClientEntity extends Object
}
}

if (!isDeleted! && multiselect) {
if (!isDeleted!) {
actions.add(EntityAction.bulkUpdate);
}

Expand Down
6 changes: 6 additions & 0 deletions lib/data/models/vendor_model.dart
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,12 @@ abstract class VendorEntity extends Object
actions.add(EntityAction.addComment);
}

/*
if (!isDeleted!) {
actions.add(EntityAction.bulkUpdate);
}
*/

if (actions.isNotEmpty && actions.last != null) {
actions.add(null);
}
Expand Down
11 changes: 11 additions & 0 deletions lib/redux/vendor/vendor_actions.dart
Original file line number Diff line number Diff line change
Expand Up @@ -354,6 +354,17 @@ void handleVendorAction(BuildContext? context, List<BaseEntity> vendors,
store.dispatch(
DeleteVendorRequest(snackBarCompleter<Null>(message), vendorIds));
break;
case EntityAction.bulkUpdate:
showDialog<void>(
context: context,
barrierDismissible: false,
builder: (context) => BulkUpdateDialog(
entityType: EntityType.vendor,
entities: vendors,
),
);
break;

case EntityAction.toggleMultiselect:
if (!store.state.vendorListState.isInMultiselect()) {
store.dispatch(StartVendorMultiselect());
Expand Down

0 comments on commit 7ab8ea3

Please sign in to comment.