@webiny/app-trash-bin 5.43.2-beta.0 → 6.0.0-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Domain/Models/TrashBinItem/ITrashBinItemMapper.js +1 -5
- package/Domain/Models/TrashBinItem/TrashBinItem.js +6 -19
- package/Domain/Models/TrashBinItem/TrashBinItem.js.map +1 -1
- package/Domain/Models/TrashBinItem/index.js +2 -27
- package/Domain/Models/TrashBinItem/index.js.map +1 -1
- package/Domain/Models/index.js +1 -16
- package/Domain/Models/index.js.map +1 -1
- package/Domain/Repositories/Search/ISearchRepository.js +1 -5
- package/Domain/Repositories/Search/SearchRepository.js +12 -28
- package/Domain/Repositories/Search/SearchRepository.js.map +1 -1
- package/Domain/Repositories/Search/SearchRepositoryFactory.js +14 -32
- package/Domain/Repositories/Search/SearchRepositoryFactory.js.map +1 -1
- package/Domain/Repositories/Search/index.js +3 -38
- package/Domain/Repositories/Search/index.js.map +1 -1
- package/Domain/Repositories/SelectedItems/ISelectedItemsRepository.js +1 -5
- package/Domain/Repositories/SelectedItems/SelectedItemsRepository.js +24 -46
- package/Domain/Repositories/SelectedItems/SelectedItemsRepository.js.map +1 -1
- package/Domain/Repositories/SelectedItems/SelectedItemsRepositoryFactory.js +14 -32
- package/Domain/Repositories/SelectedItems/SelectedItemsRepositoryFactory.js.map +1 -1
- package/Domain/Repositories/SelectedItems/index.js +3 -38
- package/Domain/Repositories/SelectedItems/index.js.map +1 -1
- package/Domain/Repositories/Sorting/SortingRepositoryWithDefaults.d.ts +1 -1
- package/Domain/Repositories/Sorting/SortingRepositoryWithDefaults.js +16 -32
- package/Domain/Repositories/Sorting/SortingRepositoryWithDefaults.js.map +1 -1
- package/Domain/Repositories/Sorting/index.js +1 -16
- package/Domain/Repositories/Sorting/index.js.map +1 -1
- package/Domain/Repositories/TrashBinItems/ITrashBinItemsRepository.js +1 -5
- package/Domain/Repositories/TrashBinItems/TrashBinItemMapper.js +16 -31
- package/Domain/Repositories/TrashBinItems/TrashBinItemMapper.js.map +1 -1
- package/Domain/Repositories/TrashBinItems/TrashBinItemsRepository.js +87 -130
- package/Domain/Repositories/TrashBinItems/TrashBinItemsRepository.js.map +1 -1
- package/Domain/Repositories/TrashBinItems/TrashBinItemsRepositoryFactory.js +14 -32
- package/Domain/Repositories/TrashBinItems/TrashBinItemsRepositoryFactory.js.map +1 -1
- package/Domain/Repositories/TrashBinItems/TrashBinItemsRepositoryWithLoading.js +33 -62
- package/Domain/Repositories/TrashBinItems/TrashBinItemsRepositoryWithLoading.js.map +1 -1
- package/Domain/Repositories/TrashBinItems/index.js +5 -60
- package/Domain/Repositories/TrashBinItems/index.js.map +1 -1
- package/Domain/Repositories/index.js +5 -49
- package/Domain/Repositories/index.js.map +1 -1
- package/Domain/index.js +2 -27
- package/Domain/index.js.map +1 -1
- package/Gateways/TrashBinBulkActions/ITrashBinBulkActionsGateway.js +1 -5
- package/Gateways/TrashBinBulkActions/index.js +1 -16
- package/Gateways/TrashBinBulkActions/index.js.map +1 -1
- package/Gateways/TrashBinDeleteItem/ITrashBinDeleteItemGateway.js +1 -5
- package/Gateways/TrashBinDeleteItem/index.js +1 -16
- package/Gateways/TrashBinDeleteItem/index.js.map +1 -1
- package/Gateways/TrashBinListItems/ITrashBinListGateway.js +1 -5
- package/Gateways/TrashBinListItems/index.js +1 -16
- package/Gateways/TrashBinListItems/index.js.map +1 -1
- package/Gateways/TrashBinRestoreItem/ITrashBinRestoreItemGateway.js +1 -5
- package/Gateways/TrashBinRestoreItem/index.js +1 -16
- package/Gateways/TrashBinRestoreItem/index.js.map +1 -1
- package/Gateways/index.js +4 -49
- package/Gateways/index.js.map +1 -1
- package/Presentation/TrashBin/TrashBin.js +30 -37
- package/Presentation/TrashBin/TrashBin.js.map +1 -1
- package/Presentation/TrashBin/TrashBin.test.js +186 -175
- package/Presentation/TrashBin/TrashBin.test.js.map +1 -1
- package/Presentation/TrashBin/TrashBinControllers.js +60 -94
- package/Presentation/TrashBin/TrashBinControllers.js.map +1 -1
- package/Presentation/TrashBin/TrashBinPresenter.js +49 -77
- package/Presentation/TrashBin/TrashBinPresenter.js.map +1 -1
- package/Presentation/TrashBin/controllers/BulkAction/BulkActionsController.js +7 -20
- package/Presentation/TrashBin/controllers/BulkAction/BulkActionsController.js.map +1 -1
- package/Presentation/TrashBin/controllers/BulkAction/IBulkActionsController.js +1 -5
- package/Presentation/TrashBin/controllers/BulkAction/index.js +2 -27
- package/Presentation/TrashBin/controllers/BulkAction/index.js.map +1 -1
- package/Presentation/TrashBin/controllers/DeleteItem/DeleteItemController.js +7 -20
- package/Presentation/TrashBin/controllers/DeleteItem/DeleteItemController.js.map +1 -1
- package/Presentation/TrashBin/controllers/DeleteItem/IDeleteItemController.js +1 -5
- package/Presentation/TrashBin/controllers/DeleteItem/index.js +2 -27
- package/Presentation/TrashBin/controllers/DeleteItem/index.js.map +1 -1
- package/Presentation/TrashBin/controllers/GetRestoredItemById/GetRestoredItemByIdController.js +10 -23
- package/Presentation/TrashBin/controllers/GetRestoredItemById/GetRestoredItemByIdController.js.map +1 -1
- package/Presentation/TrashBin/controllers/GetRestoredItemById/IGetRestoredItemByIdController.js +1 -5
- package/Presentation/TrashBin/controllers/GetRestoredItemById/index.js +2 -27
- package/Presentation/TrashBin/controllers/GetRestoredItemById/index.js.map +1 -1
- package/Presentation/TrashBin/controllers/ListItems/IListItemsController.js +1 -5
- package/Presentation/TrashBin/controllers/ListItems/ListItemsController.js +7 -20
- package/Presentation/TrashBin/controllers/ListItems/ListItemsController.js.map +1 -1
- package/Presentation/TrashBin/controllers/ListItems/index.js +2 -27
- package/Presentation/TrashBin/controllers/ListItems/index.js.map +1 -1
- package/Presentation/TrashBin/controllers/ListMoreItems/IListMoreItemsController.js +1 -5
- package/Presentation/TrashBin/controllers/ListMoreItems/ListMoreItemsController.js +7 -20
- package/Presentation/TrashBin/controllers/ListMoreItems/ListMoreItemsController.js.map +1 -1
- package/Presentation/TrashBin/controllers/ListMoreItems/index.js +2 -27
- package/Presentation/TrashBin/controllers/ListMoreItems/index.js.map +1 -1
- package/Presentation/TrashBin/controllers/RestoreItem/IRestoreItemController.js +1 -5
- package/Presentation/TrashBin/controllers/RestoreItem/RestoreItemController.js +7 -20
- package/Presentation/TrashBin/controllers/RestoreItem/RestoreItemController.js.map +1 -1
- package/Presentation/TrashBin/controllers/RestoreItem/index.js +2 -27
- package/Presentation/TrashBin/controllers/RestoreItem/index.js.map +1 -1
- package/Presentation/TrashBin/controllers/SearchItems/ISearchItemsController.js +1 -5
- package/Presentation/TrashBin/controllers/SearchItems/SearchItemsController.js +9 -22
- package/Presentation/TrashBin/controllers/SearchItems/SearchItemsController.js.map +1 -1
- package/Presentation/TrashBin/controllers/SearchItems/index.js +2 -27
- package/Presentation/TrashBin/controllers/SearchItems/index.js.map +1 -1
- package/Presentation/TrashBin/controllers/SelectAllItems/ISelectAllItemsController.js +1 -5
- package/Presentation/TrashBin/controllers/SelectAllItems/SelectAllItemsController.js +7 -20
- package/Presentation/TrashBin/controllers/SelectAllItems/SelectAllItemsController.js.map +1 -1
- package/Presentation/TrashBin/controllers/SelectAllItems/index.js +2 -27
- package/Presentation/TrashBin/controllers/SelectAllItems/index.js.map +1 -1
- package/Presentation/TrashBin/controllers/SelectItems/ISelectItemsController.js +1 -5
- package/Presentation/TrashBin/controllers/SelectItems/SelectItemsController.js +9 -24
- package/Presentation/TrashBin/controllers/SelectItems/SelectItemsController.js.map +1 -1
- package/Presentation/TrashBin/controllers/SelectItems/index.js +2 -27
- package/Presentation/TrashBin/controllers/SelectItems/index.js.map +1 -1
- package/Presentation/TrashBin/controllers/SortItems/ISortItemsController.js +1 -5
- package/Presentation/TrashBin/controllers/SortItems/SortItemsController.js +13 -25
- package/Presentation/TrashBin/controllers/SortItems/SortItemsController.js.map +1 -1
- package/Presentation/TrashBin/controllers/SortItems/index.js +2 -27
- package/Presentation/TrashBin/controllers/SortItems/index.js.map +1 -1
- package/Presentation/TrashBin/controllers/UnselectAllItems/IUnselectAllItemsController.js +1 -5
- package/Presentation/TrashBin/controllers/UnselectAllItems/UnselectAllItemsController.js +7 -20
- package/Presentation/TrashBin/controllers/UnselectAllItems/UnselectAllItemsController.js.map +1 -1
- package/Presentation/TrashBin/controllers/UnselectAllItems/index.js +2 -27
- package/Presentation/TrashBin/controllers/UnselectAllItems/index.js.map +1 -1
- package/Presentation/TrashBin/controllers/index.js +11 -126
- package/Presentation/TrashBin/controllers/index.js.map +1 -1
- package/Presentation/TrashBin/index.js +1 -16
- package/Presentation/TrashBin/index.js.map +1 -1
- package/Presentation/TrashBinConfigs/TrashBinConfigs.js +31 -36
- package/Presentation/TrashBinConfigs/TrashBinConfigs.js.map +1 -1
- package/Presentation/TrashBinConfigs/index.js +1 -16
- package/Presentation/TrashBinConfigs/index.js.map +1 -1
- package/Presentation/TrashBinRenderer/TrashBinRenderer.js +13 -23
- package/Presentation/TrashBinRenderer/TrashBinRenderer.js.map +1 -1
- package/Presentation/TrashBinRenderer/index.js +1 -16
- package/Presentation/TrashBinRenderer/index.js.map +1 -1
- package/Presentation/abstractions/ITrashBinControllers.js +1 -5
- package/Presentation/abstractions/ITrashBinPresenter.js +1 -5
- package/Presentation/abstractions/index.js +2 -27
- package/Presentation/abstractions/index.js.map +1 -1
- package/Presentation/components/Actions/DeleteItem/DeleteItem.js +20 -22
- package/Presentation/components/Actions/DeleteItem/DeleteItem.js.map +1 -1
- package/Presentation/components/Actions/DeleteItem/index.js +1 -16
- package/Presentation/components/Actions/DeleteItem/index.js.map +1 -1
- package/Presentation/components/Actions/RestoreItem/RestoreItem.js +18 -21
- package/Presentation/components/Actions/RestoreItem/RestoreItem.js.map +1 -1
- package/Presentation/components/Actions/RestoreItem/index.js +1 -16
- package/Presentation/components/Actions/RestoreItem/index.js.map +1 -1
- package/Presentation/components/Actions/index.js +2 -27
- package/Presentation/components/Actions/index.js.map +1 -1
- package/Presentation/components/BottomInfoBar/BottomInfoBar.js +18 -20
- package/Presentation/components/BottomInfoBar/BottomInfoBar.js.map +1 -1
- package/Presentation/components/BottomInfoBar/ListMeta.js +10 -13
- package/Presentation/components/BottomInfoBar/ListMeta.js.map +1 -1
- package/Presentation/components/BottomInfoBar/ListStatus.js +14 -16
- package/Presentation/components/BottomInfoBar/ListStatus.js.map +1 -1
- package/Presentation/components/BottomInfoBar/index.js +1 -16
- package/Presentation/components/BottomInfoBar/index.js.map +1 -1
- package/Presentation/components/BulkActions/BulkActions/BulkActions.js +49 -35
- package/Presentation/components/BulkActions/BulkActions/BulkActions.js.map +1 -1
- package/Presentation/components/BulkActions/BulkActions/index.js +1 -16
- package/Presentation/components/BulkActions/BulkActions/index.js.map +1 -1
- package/Presentation/components/BulkActions/DeleteItems/DeleteItems.js +75 -74
- package/Presentation/components/BulkActions/DeleteItems/DeleteItems.js.map +1 -1
- package/Presentation/components/BulkActions/DeleteItems/index.js +1 -16
- package/Presentation/components/BulkActions/DeleteItems/index.js.map +1 -1
- package/Presentation/components/BulkActions/RestoreItems/RestoreItems.js +83 -84
- package/Presentation/components/BulkActions/RestoreItems/RestoreItems.js.map +1 -1
- package/Presentation/components/BulkActions/RestoreItems/RestoreItemsReportMessage.js +9 -14
- package/Presentation/components/BulkActions/RestoreItems/RestoreItemsReportMessage.js.map +1 -1
- package/Presentation/components/BulkActions/RestoreItems/index.js +1 -16
- package/Presentation/components/BulkActions/RestoreItems/index.js.map +1 -1
- package/Presentation/components/BulkActions/index.js +3 -38
- package/Presentation/components/BulkActions/index.js.map +1 -1
- package/Presentation/components/Cells/CellActions/CellActions.js +17 -20
- package/Presentation/components/Cells/CellActions/CellActions.js.map +1 -1
- package/Presentation/components/Cells/CellActions/index.js +1 -16
- package/Presentation/components/Cells/CellActions/index.js.map +1 -1
- package/Presentation/components/Cells/CellCreatedBy/CellCreatedBy.js +10 -14
- package/Presentation/components/Cells/CellCreatedBy/CellCreatedBy.js.map +1 -1
- package/Presentation/components/Cells/CellCreatedBy/index.js +1 -16
- package/Presentation/components/Cells/CellCreatedBy/index.js.map +1 -1
- package/Presentation/components/Cells/CellDeletedBy/CellDeletedBy.js +10 -14
- package/Presentation/components/Cells/CellDeletedBy/CellDeletedBy.js.map +1 -1
- package/Presentation/components/Cells/CellDeletedBy/index.js +1 -16
- package/Presentation/components/Cells/CellDeletedBy/index.js.map +1 -1
- package/Presentation/components/Cells/CellDeletedOn/CellDeletedOn.js +11 -15
- package/Presentation/components/Cells/CellDeletedOn/CellDeletedOn.js.map +1 -1
- package/Presentation/components/Cells/CellDeletedOn/index.js +1 -16
- package/Presentation/components/Cells/CellDeletedOn/index.js.map +1 -1
- package/Presentation/components/Cells/CellTitle/CellTitle.js +20 -17
- package/Presentation/components/Cells/CellTitle/CellTitle.js.map +1 -1
- package/Presentation/components/Cells/CellTitle/index.js +1 -16
- package/Presentation/components/Cells/CellTitle/index.js.map +1 -1
- package/Presentation/components/Cells/index.js +5 -60
- package/Presentation/components/Cells/index.js.map +1 -1
- package/Presentation/components/Empty/Empty.js +18 -21
- package/Presentation/components/Empty/Empty.js.map +1 -1
- package/Presentation/components/Empty/index.js +1 -16
- package/Presentation/components/Empty/index.js.map +1 -1
- package/Presentation/components/SearchInput/SearchInput.js +27 -32
- package/Presentation/components/SearchInput/SearchInput.js.map +1 -1
- package/Presentation/components/SearchInput/index.js +1 -16
- package/Presentation/components/SearchInput/index.js.map +1 -1
- package/Presentation/components/Table/Table.js +14 -24
- package/Presentation/components/Table/Table.js.map +1 -1
- package/Presentation/components/Table/index.js +1 -16
- package/Presentation/components/Table/index.js.map +1 -1
- package/Presentation/components/Title/Title.js +11 -18
- package/Presentation/components/Title/Title.js.map +1 -1
- package/Presentation/components/Title/index.js +1 -16
- package/Presentation/components/Title/index.js.map +1 -1
- package/Presentation/components/TrashBinOverlay/TrashBinOverlay.js +27 -35
- package/Presentation/components/TrashBinOverlay/TrashBinOverlay.js.map +1 -1
- package/Presentation/components/TrashBinOverlay/index.js +1 -16
- package/Presentation/components/TrashBinOverlay/index.js.map +1 -1
- package/Presentation/configs/index.js +1 -16
- package/Presentation/configs/index.js.map +1 -1
- package/Presentation/configs/list/Browser/BulkAction.js +36 -47
- package/Presentation/configs/list/Browser/BulkAction.js.map +1 -1
- package/Presentation/configs/list/Browser/EntryAction.js +11 -21
- package/Presentation/configs/list/Browser/EntryAction.js.map +1 -1
- package/Presentation/configs/list/Browser/Table/Column.d.ts +1 -1
- package/Presentation/configs/list/Browser/Table/Column.js +9 -19
- package/Presentation/configs/list/Browser/Table/Column.js.map +1 -1
- package/Presentation/configs/list/Browser/Table/Sorting.js +8 -18
- package/Presentation/configs/list/Browser/Table/Sorting.js.map +1 -1
- package/Presentation/configs/list/Browser/Table/index.d.ts +1 -1
- package/Presentation/configs/list/Browser/Table/index.js +5 -11
- package/Presentation/configs/list/Browser/Table/index.js.map +1 -1
- package/Presentation/configs/list/Browser/index.d.ts +1 -1
- package/Presentation/configs/list/Browser/index.js +7 -13
- package/Presentation/configs/list/Browser/index.js.map +1 -1
- package/Presentation/configs/list/TrashBinListConfig.d.ts +1 -1
- package/Presentation/configs/list/TrashBinListConfig.js +22 -33
- package/Presentation/configs/list/TrashBinListConfig.js.map +1 -1
- package/Presentation/configs/list/index.js +1 -16
- package/Presentation/configs/list/index.js.map +1 -1
- package/Presentation/hooks/index.js +4 -49
- package/Presentation/hooks/index.js.map +1 -1
- package/Presentation/hooks/useDeleteTrashBinItem.js +27 -32
- package/Presentation/hooks/useDeleteTrashBinItem.js.map +1 -1
- package/Presentation/hooks/useRestoreTrashBinItem.js +36 -43
- package/Presentation/hooks/useRestoreTrashBinItem.js.map +1 -1
- package/Presentation/hooks/useTrashBin.d.ts +1 -1
- package/Presentation/hooks/useTrashBin.js +41 -77
- package/Presentation/hooks/useTrashBin.js.map +1 -1
- package/Presentation/hooks/useTrashBinItem.js +7 -12
- package/Presentation/hooks/useTrashBinItem.js.map +1 -1
- package/Presentation/index.js +21 -48
- package/Presentation/index.js.map +1 -1
- package/UseCases/BulkAction/BulkActionUseCase.js +8 -21
- package/UseCases/BulkAction/BulkActionUseCase.js.map +1 -1
- package/UseCases/BulkAction/IBulkActionUseCase.js +1 -5
- package/UseCases/BulkAction/index.js +2 -27
- package/UseCases/BulkAction/index.js.map +1 -1
- package/UseCases/DeleteItem/DeleteItemUseCase.js +8 -21
- package/UseCases/DeleteItem/DeleteItemUseCase.js.map +1 -1
- package/UseCases/DeleteItem/IDeleteItemUseCase.js +1 -5
- package/UseCases/DeleteItem/index.js +2 -27
- package/UseCases/DeleteItem/index.js.map +1 -1
- package/UseCases/GetRestoredItem/GetRestoredItemUseCase.js +9 -24
- package/UseCases/GetRestoredItem/GetRestoredItemUseCase.js.map +1 -1
- package/UseCases/GetRestoredItem/IGetRestoredItemUseCase.js +1 -5
- package/UseCases/GetRestoredItem/index.js +2 -27
- package/UseCases/GetRestoredItem/index.js.map +1 -1
- package/UseCases/ListItems/IListItemsUseCase.js +1 -5
- package/UseCases/ListItems/ListItemsUseCase.js +10 -22
- package/UseCases/ListItems/ListItemsUseCase.js.map +1 -1
- package/UseCases/ListItems/ListItemsUseCaseWithSearch.js +12 -25
- package/UseCases/ListItems/ListItemsUseCaseWithSearch.js.map +1 -1
- package/UseCases/ListItems/ListItemsUseCaseWithSorting.js +13 -28
- package/UseCases/ListItems/ListItemsUseCaseWithSorting.js.map +1 -1
- package/UseCases/ListItems/index.js +4 -49
- package/UseCases/ListItems/index.js.map +1 -1
- package/UseCases/ListMoreItems/IListMoreItemsUseCase.js +1 -5
- package/UseCases/ListMoreItems/ListMoreItemsUseCase.js +8 -21
- package/UseCases/ListMoreItems/ListMoreItemsUseCase.js.map +1 -1
- package/UseCases/ListMoreItems/index.js +2 -27
- package/UseCases/ListMoreItems/index.js.map +1 -1
- package/UseCases/RestoreItem/IRestoreItemUseCase.js +1 -5
- package/UseCases/RestoreItem/RestoreItemUseCase.js +8 -21
- package/UseCases/RestoreItem/RestoreItemUseCase.js.map +1 -1
- package/UseCases/RestoreItem/index.js +2 -27
- package/UseCases/RestoreItem/index.js.map +1 -1
- package/UseCases/SearchItems/ISearchItemsUseCase.js +1 -5
- package/UseCases/SearchItems/SearchItemsUseCase.js +8 -21
- package/UseCases/SearchItems/SearchItemsUseCase.js.map +1 -1
- package/UseCases/SearchItems/index.js +2 -27
- package/UseCases/SearchItems/index.js.map +1 -1
- package/UseCases/SelectAllItems/ISelectAllItemsUseCase.js +1 -5
- package/UseCases/SelectAllItems/SelectAllItemsUseCase.js +8 -21
- package/UseCases/SelectAllItems/SelectAllItemsUseCase.js.map +1 -1
- package/UseCases/SelectAllItems/index.js +2 -27
- package/UseCases/SelectAllItems/index.js.map +1 -1
- package/UseCases/SelectItems/ISelectItemsUseCase.js +1 -5
- package/UseCases/SelectItems/SelectItemsUseCase.js +8 -21
- package/UseCases/SelectItems/SelectItemsUseCase.js.map +1 -1
- package/UseCases/SelectItems/index.js +2 -27
- package/UseCases/SelectItems/index.js.map +1 -1
- package/UseCases/SortItems/ISortItemsUseCase.js +1 -5
- package/UseCases/SortItems/SortItemsUseCase.js +8 -21
- package/UseCases/SortItems/SortItemsUseCase.js.map +1 -1
- package/UseCases/SortItems/index.js +2 -27
- package/UseCases/SortItems/index.js.map +1 -1
- package/UseCases/UnSelectAllItems/IUnselectAllItemsUseCase.js +1 -5
- package/UseCases/UnSelectAllItems/UnselectAllItemsUseCase.js +8 -21
- package/UseCases/UnSelectAllItems/UnselectAllItemsUseCase.js.map +1 -1
- package/UseCases/UnSelectAllItems/index.js +2 -27
- package/UseCases/UnSelectAllItems/index.js.map +1 -1
- package/UseCases/index.js +11 -126
- package/UseCases/index.js.map +1 -1
- package/index.js +3 -38
- package/index.js.map +1 -1
- package/package.json +11 -11
- package/types.js +1 -7
- package/types.js.map +1 -1
- package/Presentation/components/BottomInfoBar/BottomInfoBar.styled.d.ts +0 -21
- package/Presentation/components/BottomInfoBar/BottomInfoBar.styled.js +0 -81
- package/Presentation/components/BottomInfoBar/BottomInfoBar.styled.js.map +0 -1
- package/Presentation/components/BulkActions/BulkActions/BulkActions.styled.d.ts +0 -13
- package/Presentation/components/BulkActions/BulkActions/BulkActions.styled.js +0 -46
- package/Presentation/components/BulkActions/BulkActions/BulkActions.styled.js.map +0 -1
- package/Presentation/components/BulkActions/RestoreItems/RestoredItems.styled.d.ts +0 -5
- package/Presentation/components/BulkActions/RestoreItems/RestoredItems.styled.js +0 -25
- package/Presentation/components/BulkActions/RestoreItems/RestoredItems.styled.js.map +0 -1
- package/Presentation/components/Cells/CellTitle/CellTitle.styled.d.ts +0 -12
- package/Presentation/components/Cells/CellTitle/CellTitle.styled.js +0 -54
- package/Presentation/components/Cells/CellTitle/CellTitle.styled.js.map +0 -1
- package/Presentation/components/Empty/Empty.styled.d.ts +0 -9
- package/Presentation/components/Empty/Empty.styled.js +0 -39
- package/Presentation/components/Empty/Empty.styled.js.map +0 -1
- package/Presentation/components/SearchInput/SearchInput.styled.d.ts +0 -11
- package/Presentation/components/SearchInput/SearchInput.styled.js +0 -55
- package/Presentation/components/SearchInput/SearchInput.styled.js.map +0 -1
- package/Presentation/components/SelectAll/Messages.d.ts +0 -7
- package/Presentation/components/SelectAll/Messages.js +0 -29
- package/Presentation/components/SelectAll/Messages.js.map +0 -1
- package/Presentation/components/SelectAll/SelectAll.d.ts +0 -3
- package/Presentation/components/SelectAll/SelectAll.js +0 -35
- package/Presentation/components/SelectAll/SelectAll.js.map +0 -1
- package/Presentation/components/SelectAll/SelectAll.styled.d.ts +0 -12
- package/Presentation/components/SelectAll/SelectAll.styled.js +0 -54
- package/Presentation/components/SelectAll/SelectAll.styled.js.map +0 -1
- package/Presentation/components/SelectAll/index.d.ts +0 -1
- package/Presentation/components/SelectAll/index.js +0 -18
- package/Presentation/components/SelectAll/index.js.map +0 -1
- package/Presentation/components/Title/Title.styled.d.ts +0 -4
- package/Presentation/components/Title/Title.styled.js +0 -26
- package/Presentation/components/Title/Title.styled.js.map +0 -1
|
@@ -1,75 +1,59 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
var _TrashBinControllers = require("./TrashBinControllers");
|
|
11
|
-
var _Search = require("../../Domain/Repositories/Search");
|
|
12
|
-
var _SelectedItems = require("../../Domain/Repositories/SelectedItems");
|
|
13
|
-
var _Sorting = require("../../Domain/Repositories/Sorting");
|
|
14
|
-
var _TrashBinItems = require("../../Domain/Repositories/TrashBinItems");
|
|
15
|
-
var identity1 = {
|
|
1
|
+
import { TrashBinPresenter } from "./TrashBinPresenter";
|
|
2
|
+
import { LoadingRepository, MetaRepository, SortingRepository } from "@webiny/app-utils";
|
|
3
|
+
import { LoadingActions } from "../../types";
|
|
4
|
+
import { TrashBinControllers } from "./TrashBinControllers";
|
|
5
|
+
import { SearchRepository } from "../../Domain/Repositories/Search";
|
|
6
|
+
import { SelectedItemsRepository } from "../../Domain/Repositories/SelectedItems";
|
|
7
|
+
import { SortingRepositoryWithDefaults } from "../../Domain/Repositories/Sorting";
|
|
8
|
+
import { TrashBinItemsRepository, TrashBinItemsRepositoryWithLoading } from "../../Domain/Repositories/TrashBinItems";
|
|
9
|
+
const identity1 = {
|
|
16
10
|
id: "1234",
|
|
17
11
|
displayName: "John Doe",
|
|
18
12
|
type: "admin"
|
|
19
13
|
};
|
|
20
|
-
|
|
14
|
+
const identity2 = {
|
|
21
15
|
id: "5678",
|
|
22
16
|
displayName: "Jane Doe",
|
|
23
17
|
type: "admin"
|
|
24
18
|
};
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
19
|
+
const createBinListGateway = ({
|
|
20
|
+
execute
|
|
21
|
+
}) => ({
|
|
22
|
+
execute
|
|
23
|
+
});
|
|
24
|
+
const createBinDeleteItemGateway = ({
|
|
25
|
+
execute
|
|
26
|
+
}) => ({
|
|
27
|
+
execute
|
|
28
|
+
});
|
|
29
|
+
const createBinRestoreItemGateway = ({
|
|
30
|
+
execute
|
|
31
|
+
}) => ({
|
|
32
|
+
execute
|
|
33
|
+
});
|
|
34
|
+
const createBinBulkActionsGateway = ({
|
|
35
|
+
execute
|
|
36
|
+
}) => ({
|
|
37
|
+
execute
|
|
38
|
+
});
|
|
39
|
+
class CustomItemMapper {
|
|
40
|
+
toDTO(data) {
|
|
41
|
+
return {
|
|
42
|
+
id: data.id,
|
|
43
|
+
title: data.title,
|
|
44
|
+
location: data.location,
|
|
45
|
+
createdBy: data.createdBy,
|
|
46
|
+
deletedOn: data.deletedOn,
|
|
47
|
+
deletedBy: data.deletedBy
|
|
48
|
+
};
|
|
52
49
|
}
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
value: function toDTO(data) {
|
|
56
|
-
return {
|
|
57
|
-
id: data.id,
|
|
58
|
-
title: data.title,
|
|
59
|
-
location: data.location,
|
|
60
|
-
createdBy: data.createdBy,
|
|
61
|
-
deletedOn: data.deletedOn,
|
|
62
|
-
deletedBy: data.deletedBy
|
|
63
|
-
};
|
|
64
|
-
}
|
|
65
|
-
}]);
|
|
66
|
-
}();
|
|
67
|
-
var defaultSorting = [{
|
|
50
|
+
}
|
|
51
|
+
const defaultSorting = [{
|
|
68
52
|
field: "deletedOn",
|
|
69
53
|
order: "desc"
|
|
70
54
|
}];
|
|
71
|
-
describe("TrashBin",
|
|
72
|
-
|
|
55
|
+
describe("TrashBin", () => {
|
|
56
|
+
const item1 = {
|
|
73
57
|
id: "item-1",
|
|
74
58
|
title: "Item 1",
|
|
75
59
|
location: {
|
|
@@ -80,7 +64,7 @@ describe("TrashBin", function () {
|
|
|
80
64
|
deletedOn: new Date().toString(),
|
|
81
65
|
custom: "any custom data"
|
|
82
66
|
};
|
|
83
|
-
|
|
67
|
+
const item2 = {
|
|
84
68
|
id: "item-2",
|
|
85
69
|
title: "Item 2",
|
|
86
70
|
location: {
|
|
@@ -91,7 +75,7 @@ describe("TrashBin", function () {
|
|
|
91
75
|
deletedOn: new Date().toString(),
|
|
92
76
|
custom: "any custom data"
|
|
93
77
|
};
|
|
94
|
-
|
|
78
|
+
const item3 = {
|
|
95
79
|
id: "item-3",
|
|
96
80
|
title: "Item 3",
|
|
97
81
|
location: {
|
|
@@ -102,7 +86,7 @@ describe("TrashBin", function () {
|
|
|
102
86
|
deletedOn: new Date().toString(),
|
|
103
87
|
custom: "any custom data"
|
|
104
88
|
};
|
|
105
|
-
|
|
89
|
+
const item4 = {
|
|
106
90
|
id: "item-4",
|
|
107
91
|
title: "Item 4",
|
|
108
92
|
location: {
|
|
@@ -113,8 +97,8 @@ describe("TrashBin", function () {
|
|
|
113
97
|
deletedOn: new Date().toString(),
|
|
114
98
|
custom: "any custom data"
|
|
115
99
|
};
|
|
116
|
-
|
|
117
|
-
execute: jest.fn().mockImplementation(
|
|
100
|
+
const listGateway = createBinListGateway({
|
|
101
|
+
execute: jest.fn().mockImplementation(() => {
|
|
118
102
|
return Promise.resolve([[item1, item2, item3], {
|
|
119
103
|
totalCount: 3,
|
|
120
104
|
cursor: null,
|
|
@@ -122,54 +106,56 @@ describe("TrashBin", function () {
|
|
|
122
106
|
}]);
|
|
123
107
|
})
|
|
124
108
|
});
|
|
125
|
-
|
|
126
|
-
execute: jest.fn().mockImplementation(
|
|
109
|
+
const deleteItemGateway = createBinDeleteItemGateway({
|
|
110
|
+
execute: jest.fn().mockImplementation(() => {
|
|
127
111
|
return Promise.resolve(true);
|
|
128
112
|
})
|
|
129
113
|
});
|
|
130
|
-
|
|
131
|
-
execute: jest.fn().mockImplementation(
|
|
114
|
+
const restoreItemGateway = createBinRestoreItemGateway({
|
|
115
|
+
execute: jest.fn().mockImplementation(() => {
|
|
132
116
|
return Promise.resolve(item1);
|
|
133
117
|
})
|
|
134
118
|
});
|
|
135
|
-
|
|
136
|
-
execute: jest.fn().mockImplementation(
|
|
119
|
+
const bulkActionGateway = createBinBulkActionsGateway({
|
|
120
|
+
execute: jest.fn().mockImplementation(() => {
|
|
137
121
|
return Promise.resolve({
|
|
138
122
|
id: "123456789"
|
|
139
123
|
});
|
|
140
124
|
})
|
|
141
125
|
});
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
var itemsRepo = new _TrashBinItems.TrashBinItemsRepositoryWithLoading(loadingRepo, trashBinItemsRepo);
|
|
126
|
+
const itemMapper = new CustomItemMapper();
|
|
127
|
+
const BulkActionDeleteItems = "BulkDeleteItems";
|
|
128
|
+
const BulkActionRestoreItems = "BulkRestoreItems";
|
|
129
|
+
const init = (listGateway, deleteItemGateway, restoreItemGateway, retentionPeriod = 90) => {
|
|
130
|
+
const selectedRepo = new SelectedItemsRepository();
|
|
131
|
+
const loadingRepo = new LoadingRepository();
|
|
132
|
+
const sortRepo = new SortingRepository();
|
|
133
|
+
const sortRepoWithDefaults = new SortingRepositoryWithDefaults(defaultSorting, sortRepo);
|
|
134
|
+
const metaRepo = new MetaRepository();
|
|
135
|
+
const searchRepo = new SearchRepository();
|
|
136
|
+
const trashBinItemsRepo = new TrashBinItemsRepository(metaRepo, listGateway, deleteItemGateway, restoreItemGateway, bulkActionGateway, itemMapper);
|
|
137
|
+
const itemsRepo = new TrashBinItemsRepositoryWithLoading(loadingRepo, trashBinItemsRepo);
|
|
155
138
|
return {
|
|
156
|
-
presenter: new
|
|
157
|
-
controllers: new
|
|
139
|
+
presenter: new TrashBinPresenter(itemsRepo, selectedRepo, sortRepoWithDefaults, searchRepo, retentionPeriod),
|
|
140
|
+
controllers: new TrashBinControllers(itemsRepo, selectedRepo, sortRepoWithDefaults, searchRepo, BulkActionDeleteItems, BulkActionRestoreItems).getControllers()
|
|
158
141
|
};
|
|
159
142
|
};
|
|
160
|
-
beforeEach(
|
|
143
|
+
beforeEach(() => {
|
|
161
144
|
jest.clearAllMocks();
|
|
162
145
|
});
|
|
163
|
-
it("should create a presenter and list trash bin entries from the gateway", async
|
|
164
|
-
|
|
165
|
-
presenter
|
|
166
|
-
controllers
|
|
167
|
-
|
|
146
|
+
it("should create a presenter and list trash bin entries from the gateway", async () => {
|
|
147
|
+
const {
|
|
148
|
+
presenter,
|
|
149
|
+
controllers
|
|
150
|
+
} = init(listGateway, deleteItemGateway, restoreItemGateway);
|
|
151
|
+
const listPromise = controllers.listItems.execute();
|
|
168
152
|
|
|
169
153
|
// Let's check the transition to loading state
|
|
170
154
|
expect(presenter.vm).toMatchObject({
|
|
171
155
|
items: [],
|
|
172
|
-
loading:
|
|
156
|
+
loading: {
|
|
157
|
+
[LoadingActions.list]: true
|
|
158
|
+
}
|
|
173
159
|
});
|
|
174
160
|
await listPromise;
|
|
175
161
|
expect(listGateway.execute).toHaveBeenCalledTimes(1);
|
|
@@ -199,18 +185,20 @@ describe("TrashBin", function () {
|
|
|
199
185
|
deletedBy: identity2,
|
|
200
186
|
deletedOn: expect.any(String)
|
|
201
187
|
}],
|
|
202
|
-
loading:
|
|
188
|
+
loading: {
|
|
189
|
+
[LoadingActions.list]: false
|
|
190
|
+
}
|
|
203
191
|
});
|
|
204
192
|
});
|
|
205
|
-
it("should list more items from the gateway", async
|
|
206
|
-
|
|
207
|
-
execute: jest.fn().mockImplementationOnce(
|
|
193
|
+
it("should list more items from the gateway", async () => {
|
|
194
|
+
const listGateway = createBinListGateway({
|
|
195
|
+
execute: jest.fn().mockImplementationOnce(() => {
|
|
208
196
|
return Promise.resolve([[item1, item2, item3], {
|
|
209
197
|
totalCount: 4,
|
|
210
198
|
cursor: "IjMi",
|
|
211
199
|
hasMoreItems: true
|
|
212
200
|
}]);
|
|
213
|
-
}).mockImplementationOnce(
|
|
201
|
+
}).mockImplementationOnce(() => {
|
|
214
202
|
return Promise.resolve([[item4], {
|
|
215
203
|
totalCount: 4,
|
|
216
204
|
cursor: null,
|
|
@@ -218,18 +206,21 @@ describe("TrashBin", function () {
|
|
|
218
206
|
}]);
|
|
219
207
|
})
|
|
220
208
|
});
|
|
221
|
-
|
|
222
|
-
presenter
|
|
223
|
-
controllers
|
|
209
|
+
const {
|
|
210
|
+
presenter,
|
|
211
|
+
controllers
|
|
212
|
+
} = init(listGateway, deleteItemGateway, restoreItemGateway);
|
|
224
213
|
|
|
225
214
|
// Let's list some initial entries
|
|
226
215
|
await controllers.listItems.execute();
|
|
227
216
|
expect(listGateway.execute).toHaveBeenCalledTimes(1);
|
|
228
217
|
|
|
229
218
|
// Let's list more items from the gateway
|
|
230
|
-
|
|
219
|
+
const listMorePromise = controllers.listMoreItems.execute();
|
|
231
220
|
expect(presenter.vm).toMatchObject({
|
|
232
|
-
loading:
|
|
221
|
+
loading: {
|
|
222
|
+
[LoadingActions.listMore]: true
|
|
223
|
+
}
|
|
233
224
|
});
|
|
234
225
|
await listMorePromise;
|
|
235
226
|
expect(listGateway.execute).toHaveBeenCalledTimes(2);
|
|
@@ -268,18 +259,20 @@ describe("TrashBin", function () {
|
|
|
268
259
|
deletedBy: identity1,
|
|
269
260
|
deletedOn: expect.any(String)
|
|
270
261
|
}],
|
|
271
|
-
loading:
|
|
262
|
+
loading: {
|
|
263
|
+
[LoadingActions.listMore]: false
|
|
264
|
+
}
|
|
272
265
|
});
|
|
273
266
|
});
|
|
274
|
-
it("should be able to sort items", async
|
|
275
|
-
|
|
276
|
-
execute: jest.fn().mockImplementationOnce(
|
|
267
|
+
it("should be able to sort items", async () => {
|
|
268
|
+
const sortListGateway = createBinListGateway({
|
|
269
|
+
execute: jest.fn().mockImplementationOnce(() => {
|
|
277
270
|
return Promise.resolve([[item1, item2, item3], {
|
|
278
271
|
totalCount: 3,
|
|
279
272
|
cursor: null,
|
|
280
273
|
hasMoreItems: false
|
|
281
274
|
}]);
|
|
282
|
-
}).mockImplementation(
|
|
275
|
+
}).mockImplementation(() => {
|
|
283
276
|
return Promise.resolve([[item3, item2, item1], {
|
|
284
277
|
totalCount: 3,
|
|
285
278
|
cursor: null,
|
|
@@ -287,9 +280,10 @@ describe("TrashBin", function () {
|
|
|
287
280
|
}]);
|
|
288
281
|
})
|
|
289
282
|
});
|
|
290
|
-
|
|
291
|
-
presenter
|
|
292
|
-
controllers
|
|
283
|
+
const {
|
|
284
|
+
presenter,
|
|
285
|
+
controllers
|
|
286
|
+
} = init(sortListGateway, deleteItemGateway, restoreItemGateway);
|
|
293
287
|
|
|
294
288
|
// let's list some entries from the gateway
|
|
295
289
|
await controllers.listItems.execute();
|
|
@@ -298,12 +292,10 @@ describe("TrashBin", function () {
|
|
|
298
292
|
});
|
|
299
293
|
|
|
300
294
|
// Let's sort items, it should call back the list gateway to retrieve the items sorted
|
|
301
|
-
await controllers.sortItems.execute(
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
}];
|
|
306
|
-
});
|
|
295
|
+
await controllers.sortItems.execute(() => [{
|
|
296
|
+
id: "deletedOn",
|
|
297
|
+
desc: false
|
|
298
|
+
}]);
|
|
307
299
|
expect(sortListGateway.execute).toHaveBeenNthCalledWith(2, {
|
|
308
300
|
sort: ["deletedOn_ASC"]
|
|
309
301
|
});
|
|
@@ -330,28 +322,30 @@ describe("TrashBin", function () {
|
|
|
330
322
|
deletedBy: identity2,
|
|
331
323
|
deletedOn: expect.any(String)
|
|
332
324
|
}],
|
|
333
|
-
loading:
|
|
325
|
+
loading: {
|
|
326
|
+
[LoadingActions.list]: false
|
|
327
|
+
},
|
|
334
328
|
sorting: [{
|
|
335
329
|
id: "deletedOn",
|
|
336
330
|
desc: false
|
|
337
331
|
}]
|
|
338
332
|
});
|
|
339
333
|
});
|
|
340
|
-
it("should be able to search items", async
|
|
341
|
-
|
|
342
|
-
execute: jest.fn().mockImplementationOnce(
|
|
334
|
+
it("should be able to search items", async () => {
|
|
335
|
+
const searchItemsGateway = createBinListGateway({
|
|
336
|
+
execute: jest.fn().mockImplementationOnce(() => {
|
|
343
337
|
return Promise.resolve([[item1, item2, item3], {
|
|
344
338
|
totalCount: 3,
|
|
345
339
|
cursor: null,
|
|
346
340
|
hasMoreItems: false
|
|
347
341
|
}]);
|
|
348
|
-
}).mockImplementationOnce(
|
|
342
|
+
}).mockImplementationOnce(() => {
|
|
349
343
|
return Promise.resolve([[item1], {
|
|
350
344
|
totalCount: 1,
|
|
351
345
|
cursor: null,
|
|
352
346
|
hasMoreItems: false
|
|
353
347
|
}]);
|
|
354
|
-
}).mockImplementationOnce(
|
|
348
|
+
}).mockImplementationOnce(() => {
|
|
355
349
|
return Promise.resolve([[], {
|
|
356
350
|
totalCount: 0,
|
|
357
351
|
cursor: null,
|
|
@@ -359,9 +353,10 @@ describe("TrashBin", function () {
|
|
|
359
353
|
}]);
|
|
360
354
|
})
|
|
361
355
|
});
|
|
362
|
-
|
|
363
|
-
presenter
|
|
364
|
-
controllers
|
|
356
|
+
const {
|
|
357
|
+
presenter,
|
|
358
|
+
controllers
|
|
359
|
+
} = init(searchItemsGateway, deleteItemGateway, restoreItemGateway);
|
|
365
360
|
|
|
366
361
|
// let's list some entries from the gateway
|
|
367
362
|
await controllers.listItems.execute();
|
|
@@ -384,7 +379,9 @@ describe("TrashBin", function () {
|
|
|
384
379
|
deletedBy: identity2,
|
|
385
380
|
deletedOn: expect.any(String)
|
|
386
381
|
}],
|
|
387
|
-
loading:
|
|
382
|
+
loading: {
|
|
383
|
+
[LoadingActions.list]: false
|
|
384
|
+
},
|
|
388
385
|
searchQuery: "Item 1"
|
|
389
386
|
});
|
|
390
387
|
|
|
@@ -396,15 +393,18 @@ describe("TrashBin", function () {
|
|
|
396
393
|
});
|
|
397
394
|
expect(presenter.vm).toMatchObject({
|
|
398
395
|
items: [],
|
|
399
|
-
loading:
|
|
396
|
+
loading: {
|
|
397
|
+
[LoadingActions.list]: false
|
|
398
|
+
},
|
|
400
399
|
searchQuery: "Not found query",
|
|
401
400
|
isEmptyView: true
|
|
402
401
|
});
|
|
403
402
|
});
|
|
404
|
-
it("should be able to select items", async
|
|
405
|
-
|
|
406
|
-
presenter
|
|
407
|
-
controllers
|
|
403
|
+
it("should be able to select items", async () => {
|
|
404
|
+
const {
|
|
405
|
+
presenter,
|
|
406
|
+
controllers
|
|
407
|
+
} = init(listGateway, deleteItemGateway, restoreItemGateway);
|
|
408
408
|
|
|
409
409
|
// let's list some entries from the gateway
|
|
410
410
|
await controllers.listItems.execute();
|
|
@@ -486,10 +486,11 @@ describe("TrashBin", function () {
|
|
|
486
486
|
}]
|
|
487
487
|
});
|
|
488
488
|
});
|
|
489
|
-
it("should delete an item, removing it from the list", async
|
|
490
|
-
|
|
491
|
-
presenter
|
|
492
|
-
controllers
|
|
489
|
+
it("should delete an item, removing it from the list", async () => {
|
|
490
|
+
const {
|
|
491
|
+
presenter,
|
|
492
|
+
controllers
|
|
493
|
+
} = init(listGateway, deleteItemGateway, restoreItemGateway);
|
|
493
494
|
|
|
494
495
|
// let's list some entries from the gateway
|
|
495
496
|
await controllers.listItems.execute();
|
|
@@ -527,11 +528,13 @@ describe("TrashBin", function () {
|
|
|
527
528
|
deletedOn: expect.any(String)
|
|
528
529
|
}]
|
|
529
530
|
});
|
|
530
|
-
|
|
531
|
+
const deletePromise = controllers.deleteItem.execute(item1.id);
|
|
531
532
|
|
|
532
533
|
// Let's check the transition to loading state
|
|
533
534
|
expect(presenter.vm).toMatchObject({
|
|
534
|
-
loading:
|
|
535
|
+
loading: {
|
|
536
|
+
[LoadingActions.delete]: true
|
|
537
|
+
}
|
|
535
538
|
});
|
|
536
539
|
await deletePromise;
|
|
537
540
|
expect(deleteItemGateway.execute).toHaveBeenCalledTimes(1);
|
|
@@ -560,10 +563,11 @@ describe("TrashBin", function () {
|
|
|
560
563
|
}]
|
|
561
564
|
});
|
|
562
565
|
});
|
|
563
|
-
it("should restore an item, removing it from the list", async
|
|
564
|
-
|
|
565
|
-
presenter
|
|
566
|
-
controllers
|
|
566
|
+
it("should restore an item, removing it from the list", async () => {
|
|
567
|
+
const {
|
|
568
|
+
presenter,
|
|
569
|
+
controllers
|
|
570
|
+
} = init(listGateway, deleteItemGateway, restoreItemGateway);
|
|
567
571
|
|
|
568
572
|
// let's list some entries from the gateway
|
|
569
573
|
await controllers.listItems.execute();
|
|
@@ -601,11 +605,13 @@ describe("TrashBin", function () {
|
|
|
601
605
|
deletedOn: expect.any(String)
|
|
602
606
|
}]
|
|
603
607
|
});
|
|
604
|
-
|
|
608
|
+
const restorePromise = controllers.restoreItem.execute(item1.id);
|
|
605
609
|
|
|
606
610
|
// Let's check the transition to loading state
|
|
607
611
|
expect(presenter.vm).toMatchObject({
|
|
608
|
-
loading:
|
|
612
|
+
loading: {
|
|
613
|
+
[LoadingActions.restore]: true
|
|
614
|
+
}
|
|
609
615
|
});
|
|
610
616
|
await restorePromise;
|
|
611
617
|
expect(restoreItemGateway.execute).toHaveBeenCalledTimes(1);
|
|
@@ -646,7 +652,7 @@ describe("TrashBin", function () {
|
|
|
646
652
|
});
|
|
647
653
|
|
|
648
654
|
// We should be able to get the restored item by id
|
|
649
|
-
|
|
655
|
+
const restoredItem = await controllers.getRestoredItemById.execute("item-1");
|
|
650
656
|
expect(restoredItem).toMatchObject({
|
|
651
657
|
id: "item-1",
|
|
652
658
|
$selectable: true,
|
|
@@ -659,21 +665,23 @@ describe("TrashBin", function () {
|
|
|
659
665
|
deletedOn: expect.any(String)
|
|
660
666
|
});
|
|
661
667
|
});
|
|
662
|
-
it.each([[0, "0 days"], [1, "1 day"], [2, "2 days"]])("should set the retention period to `%s` when input is `%i`",
|
|
663
|
-
|
|
664
|
-
presenter
|
|
668
|
+
it.each([[0, "0 days"], [1, "1 day"], [2, "2 days"]])("should set the retention period to `%s` when input is `%i`", (input, output) => {
|
|
669
|
+
const {
|
|
670
|
+
presenter
|
|
671
|
+
} = init(listGateway, deleteItemGateway, restoreItemGateway, input);
|
|
665
672
|
expect(presenter.vm).toMatchObject({
|
|
666
673
|
retentionPeriod: output
|
|
667
674
|
});
|
|
668
675
|
});
|
|
669
|
-
it("should be able to perform bulk action - RESTORE", async
|
|
670
|
-
|
|
671
|
-
controllers
|
|
676
|
+
it("should be able to perform bulk action - RESTORE", async () => {
|
|
677
|
+
const {
|
|
678
|
+
controllers
|
|
679
|
+
} = init(listGateway, deleteItemGateway, restoreItemGateway);
|
|
672
680
|
|
|
673
681
|
// let's list some entries from the gateway
|
|
674
682
|
await controllers.listItems.execute();
|
|
675
683
|
expect(listGateway.execute).toHaveBeenCalledTimes(1);
|
|
676
|
-
|
|
684
|
+
const restoreBulkActionPromise = controllers.restoreBulkAction.execute({
|
|
677
685
|
search: "Custom search",
|
|
678
686
|
where: {
|
|
679
687
|
title: "Item title"
|
|
@@ -695,14 +703,15 @@ describe("TrashBin", function () {
|
|
|
695
703
|
}
|
|
696
704
|
});
|
|
697
705
|
});
|
|
698
|
-
it("should be able to perform bulk action - DELETE", async
|
|
699
|
-
|
|
700
|
-
controllers
|
|
706
|
+
it("should be able to perform bulk action - DELETE", async () => {
|
|
707
|
+
const {
|
|
708
|
+
controllers
|
|
709
|
+
} = init(listGateway, deleteItemGateway, restoreItemGateway);
|
|
701
710
|
|
|
702
711
|
// let's list some entries from the gateway
|
|
703
712
|
await controllers.listItems.execute();
|
|
704
713
|
expect(listGateway.execute).toHaveBeenCalledTimes(1);
|
|
705
|
-
|
|
714
|
+
const deleteBulkActionPromise = controllers.deleteBulkAction.execute({
|
|
706
715
|
search: "Custom search",
|
|
707
716
|
where: {
|
|
708
717
|
title: "Item title"
|
|
@@ -724,11 +733,11 @@ describe("TrashBin", function () {
|
|
|
724
733
|
}
|
|
725
734
|
});
|
|
726
735
|
});
|
|
727
|
-
it("should be able to `selectAll` and `unselectAll` items", async
|
|
736
|
+
it("should be able to `selectAll` and `unselectAll` items", async () => {
|
|
728
737
|
{
|
|
729
738
|
// let's test the functionality by listing items that span multiple pages.
|
|
730
|
-
|
|
731
|
-
execute: jest.fn().mockImplementation(
|
|
739
|
+
const listGateway = createBinListGateway({
|
|
740
|
+
execute: jest.fn().mockImplementation(() => {
|
|
732
741
|
return Promise.resolve([[item1, item2, item3], {
|
|
733
742
|
totalCount: 4,
|
|
734
743
|
cursor: "IjMi",
|
|
@@ -736,13 +745,14 @@ describe("TrashBin", function () {
|
|
|
736
745
|
}]);
|
|
737
746
|
})
|
|
738
747
|
});
|
|
739
|
-
|
|
740
|
-
presenter
|
|
741
|
-
controllers
|
|
748
|
+
const {
|
|
749
|
+
presenter,
|
|
750
|
+
controllers
|
|
751
|
+
} = init(listGateway, deleteItemGateway, restoreItemGateway);
|
|
742
752
|
|
|
743
753
|
// let's list some entries from the gateway
|
|
744
754
|
await controllers.listItems.execute();
|
|
745
|
-
expect(
|
|
755
|
+
expect(listGateway.execute).toHaveBeenCalledTimes(1);
|
|
746
756
|
|
|
747
757
|
// let's check the initial vm state
|
|
748
758
|
expect(presenter.vm.items.length).toBe(3);
|
|
@@ -779,8 +789,8 @@ describe("TrashBin", function () {
|
|
|
779
789
|
}
|
|
780
790
|
{
|
|
781
791
|
// let's test the functionality by listing items that span only one page.
|
|
782
|
-
|
|
783
|
-
execute: jest.fn().mockImplementation(
|
|
792
|
+
const listGateway = createBinListGateway({
|
|
793
|
+
execute: jest.fn().mockImplementation(() => {
|
|
784
794
|
return Promise.resolve([[item1, item2, item3], {
|
|
785
795
|
totalCount: 3,
|
|
786
796
|
cursor: null,
|
|
@@ -788,22 +798,23 @@ describe("TrashBin", function () {
|
|
|
788
798
|
}]);
|
|
789
799
|
})
|
|
790
800
|
});
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
801
|
+
const {
|
|
802
|
+
presenter,
|
|
803
|
+
controllers
|
|
804
|
+
} = init(listGateway, deleteItemGateway, restoreItemGateway);
|
|
794
805
|
|
|
795
806
|
// let's list some entries from the gateway
|
|
796
|
-
await
|
|
797
|
-
expect(
|
|
807
|
+
await controllers.listItems.execute();
|
|
808
|
+
expect(listGateway.execute).toHaveBeenCalledTimes(1);
|
|
798
809
|
|
|
799
810
|
// let's check the initial vm state
|
|
800
|
-
expect(
|
|
811
|
+
expect(presenter.vm.items.length).toBe(3);
|
|
801
812
|
|
|
802
813
|
// let's check the vm state after selecting all items in the page
|
|
803
|
-
await
|
|
804
|
-
expect(
|
|
805
|
-
expect(
|
|
806
|
-
expect(
|
|
814
|
+
await controllers.selectItems.execute([item1, item2, item3]);
|
|
815
|
+
expect(presenter.vm.selectedItems.length).toBe(3);
|
|
816
|
+
expect(presenter.vm.allowSelectAll).toBeFalsy();
|
|
817
|
+
expect(presenter.vm.isSelectedAll).toBeFalsy();
|
|
807
818
|
}
|
|
808
819
|
});
|
|
809
820
|
});
|