@webiny/app-trash-bin 6.3.0-beta.4 → 6.4.0-beta.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 +0 -3
- package/Domain/Models/TrashBinItem/TrashBinItem.js +13 -12
- package/Domain/Models/TrashBinItem/TrashBinItem.js.map +1 -1
- package/Domain/Models/TrashBinItem/index.js +0 -2
- package/Domain/Models/index.js +0 -2
- package/Domain/Repositories/Search/ISearchRepository.js +0 -3
- package/Domain/Repositories/Search/SearchRepository.js +12 -11
- package/Domain/Repositories/Search/SearchRepository.js.map +1 -1
- package/Domain/Repositories/Search/SearchRepositoryFactory.js +13 -12
- package/Domain/Repositories/Search/SearchRepositoryFactory.js.map +1 -1
- package/Domain/Repositories/Search/index.js +0 -2
- package/Domain/Repositories/SelectedItems/ISelectedItemsRepository.js +0 -3
- package/Domain/Repositories/SelectedItems/SelectedItemsRepository.js +24 -23
- package/Domain/Repositories/SelectedItems/SelectedItemsRepository.js.map +1 -1
- package/Domain/Repositories/SelectedItems/SelectedItemsRepositoryFactory.js +13 -12
- package/Domain/Repositories/SelectedItems/SelectedItemsRepositoryFactory.js.map +1 -1
- package/Domain/Repositories/SelectedItems/index.js +0 -2
- package/Domain/Repositories/Sorting/SortingRepositoryWithDefaults.js +16 -17
- package/Domain/Repositories/Sorting/SortingRepositoryWithDefaults.js.map +1 -1
- package/Domain/Repositories/Sorting/index.js +0 -2
- package/Domain/Repositories/TrashBinItems/ITrashBinItemsRepository.js +0 -3
- package/Domain/Repositories/TrashBinItems/TrashBinItemMapper.js +16 -15
- package/Domain/Repositories/TrashBinItems/TrashBinItemMapper.js.map +1 -1
- package/Domain/Repositories/TrashBinItems/TrashBinItemsRepository.js +81 -90
- package/Domain/Repositories/TrashBinItems/TrashBinItemsRepository.js.map +1 -1
- package/Domain/Repositories/TrashBinItems/TrashBinItemsRepositoryFactory.js +13 -12
- package/Domain/Repositories/TrashBinItems/TrashBinItemsRepositoryFactory.js.map +1 -1
- package/Domain/Repositories/TrashBinItems/TrashBinItemsRepositoryWithLoading.js +34 -33
- package/Domain/Repositories/TrashBinItems/TrashBinItemsRepositoryWithLoading.js.map +1 -1
- package/Domain/Repositories/TrashBinItems/index.js +0 -2
- package/Domain/Repositories/index.js +0 -3
- package/Domain/index.js +0 -2
- package/Gateways/TrashBinBulkActions/ITrashBinBulkActionsGateway.js +0 -3
- package/Gateways/TrashBinBulkActions/index.js +0 -3
- package/Gateways/TrashBinDeleteItem/ITrashBinDeleteItemGateway.js +0 -3
- package/Gateways/TrashBinDeleteItem/index.js +0 -3
- package/Gateways/TrashBinListItems/ITrashBinListGateway.js +0 -3
- package/Gateways/TrashBinListItems/index.js +0 -3
- package/Gateways/TrashBinRestoreItem/ITrashBinRestoreItemGateway.js +0 -3
- package/Gateways/TrashBinRestoreItem/index.js +0 -3
- package/Gateways/index.js +0 -3
- package/Presentation/TrashBin/TrashBin.js +51 -40
- package/Presentation/TrashBin/TrashBin.js.map +1 -1
- package/Presentation/TrashBin/TrashBin.test.js +778 -752
- package/Presentation/TrashBin/TrashBin.test.js.map +1 -1
- package/Presentation/TrashBin/TrashBinControllers.js +53 -75
- package/Presentation/TrashBin/TrashBinControllers.js.map +1 -1
- package/Presentation/TrashBin/TrashBinPresenter.js +50 -53
- package/Presentation/TrashBin/TrashBinPresenter.js.map +1 -1
- package/Presentation/TrashBin/controllers/BulkAction/BulkActionsController.js +10 -9
- package/Presentation/TrashBin/controllers/BulkAction/BulkActionsController.js.map +1 -1
- package/Presentation/TrashBin/controllers/BulkAction/IBulkActionsController.js +0 -3
- package/Presentation/TrashBin/controllers/BulkAction/index.js +0 -2
- package/Presentation/TrashBin/controllers/DeleteItem/DeleteItemController.js +9 -8
- package/Presentation/TrashBin/controllers/DeleteItem/DeleteItemController.js.map +1 -1
- package/Presentation/TrashBin/controllers/DeleteItem/IDeleteItemController.js +0 -3
- package/Presentation/TrashBin/controllers/DeleteItem/index.js +0 -2
- package/Presentation/TrashBin/controllers/GetRestoredItemById/GetRestoredItemByIdController.js +11 -10
- package/Presentation/TrashBin/controllers/GetRestoredItemById/GetRestoredItemByIdController.js.map +1 -1
- package/Presentation/TrashBin/controllers/GetRestoredItemById/IGetRestoredItemByIdController.js +0 -3
- package/Presentation/TrashBin/controllers/GetRestoredItemById/index.js +0 -2
- package/Presentation/TrashBin/controllers/ListItems/IListItemsController.js +0 -3
- package/Presentation/TrashBin/controllers/ListItems/ListItemsController.js +9 -8
- package/Presentation/TrashBin/controllers/ListItems/ListItemsController.js.map +1 -1
- package/Presentation/TrashBin/controllers/ListItems/index.js +0 -2
- package/Presentation/TrashBin/controllers/ListMoreItems/IListMoreItemsController.js +0 -3
- package/Presentation/TrashBin/controllers/ListMoreItems/ListMoreItemsController.js +9 -8
- package/Presentation/TrashBin/controllers/ListMoreItems/ListMoreItemsController.js.map +1 -1
- package/Presentation/TrashBin/controllers/ListMoreItems/index.js +0 -2
- package/Presentation/TrashBin/controllers/RestoreItem/IRestoreItemController.js +0 -3
- package/Presentation/TrashBin/controllers/RestoreItem/RestoreItemController.js +9 -8
- package/Presentation/TrashBin/controllers/RestoreItem/RestoreItemController.js.map +1 -1
- package/Presentation/TrashBin/controllers/RestoreItem/index.js +0 -2
- package/Presentation/TrashBin/controllers/SearchItems/ISearchItemsController.js +0 -3
- package/Presentation/TrashBin/controllers/SearchItems/SearchItemsController.js +12 -11
- package/Presentation/TrashBin/controllers/SearchItems/SearchItemsController.js.map +1 -1
- package/Presentation/TrashBin/controllers/SearchItems/index.js +0 -2
- package/Presentation/TrashBin/controllers/SelectAllItems/ISelectAllItemsController.js +0 -3
- package/Presentation/TrashBin/controllers/SelectAllItems/SelectAllItemsController.js +9 -8
- package/Presentation/TrashBin/controllers/SelectAllItems/SelectAllItemsController.js.map +1 -1
- package/Presentation/TrashBin/controllers/SelectAllItems/index.js +0 -2
- package/Presentation/TrashBin/controllers/SelectItems/ISelectItemsController.js +0 -3
- package/Presentation/TrashBin/controllers/SelectItems/SelectItemsController.js +10 -9
- package/Presentation/TrashBin/controllers/SelectItems/SelectItemsController.js.map +1 -1
- package/Presentation/TrashBin/controllers/SelectItems/index.js +0 -2
- package/Presentation/TrashBin/controllers/SortItems/ISortItemsController.d.ts +2 -2
- package/Presentation/TrashBin/controllers/SortItems/ISortItemsController.js +0 -3
- package/Presentation/TrashBin/controllers/SortItems/SortItemsController.d.ts +2 -2
- package/Presentation/TrashBin/controllers/SortItems/SortItemsController.js +13 -14
- package/Presentation/TrashBin/controllers/SortItems/SortItemsController.js.map +1 -1
- package/Presentation/TrashBin/controllers/SortItems/index.js +0 -2
- package/Presentation/TrashBin/controllers/UnselectAllItems/IUnselectAllItemsController.js +0 -3
- package/Presentation/TrashBin/controllers/UnselectAllItems/UnselectAllItemsController.js +9 -8
- package/Presentation/TrashBin/controllers/UnselectAllItems/UnselectAllItemsController.js.map +1 -1
- package/Presentation/TrashBin/controllers/UnselectAllItems/index.js +0 -2
- package/Presentation/TrashBin/controllers/index.js +0 -2
- package/Presentation/TrashBin/index.js +0 -2
- package/Presentation/TrashBinConfigs/TrashBinConfigs.js +49 -52
- package/Presentation/TrashBinConfigs/TrashBinConfigs.js.map +1 -1
- package/Presentation/TrashBinConfigs/index.js +0 -2
- package/Presentation/TrashBinRenderer/TrashBinRenderer.js +10 -15
- package/Presentation/TrashBinRenderer/TrashBinRenderer.js.map +1 -1
- package/Presentation/TrashBinRenderer/index.js +0 -2
- package/Presentation/abstractions/ITrashBinControllers.js +0 -3
- package/Presentation/abstractions/ITrashBinPresenter.js +0 -3
- package/Presentation/abstractions/index.js +0 -3
- package/Presentation/components/Actions/DeleteItem/DeleteItem.js +15 -20
- package/Presentation/components/Actions/DeleteItem/DeleteItem.js.map +1 -1
- package/Presentation/components/Actions/DeleteItem/index.js +0 -2
- package/Presentation/components/Actions/RestoreItem/RestoreItem.js +14 -19
- package/Presentation/components/Actions/RestoreItem/RestoreItem.js.map +1 -1
- package/Presentation/components/Actions/RestoreItem/index.js +0 -2
- package/Presentation/components/Actions/index.js +0 -2
- package/Presentation/components/BottomInfoBar/BottomInfoBar.js +15 -16
- 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 +13 -16
- package/Presentation/components/BottomInfoBar/ListStatus.js.map +1 -1
- package/Presentation/components/BottomInfoBar/index.js +0 -2
- package/Presentation/components/BulkActions/BulkActions/BulkActions.js +47 -56
- package/Presentation/components/BulkActions/BulkActions/BulkActions.js.map +1 -1
- package/Presentation/components/BulkActions/BulkActions/index.js +0 -2
- package/Presentation/components/BulkActions/DeleteItems/DeleteItems.js +58 -73
- package/Presentation/components/BulkActions/DeleteItems/DeleteItems.js.map +1 -1
- package/Presentation/components/BulkActions/DeleteItems/index.js +0 -2
- package/Presentation/components/BulkActions/RestoreItems/RestoreItems.js +67 -83
- package/Presentation/components/BulkActions/RestoreItems/RestoreItems.js.map +1 -1
- package/Presentation/components/BulkActions/RestoreItems/RestoreItemsReportMessage.js +9 -10
- package/Presentation/components/BulkActions/RestoreItems/RestoreItemsReportMessage.js.map +1 -1
- package/Presentation/components/BulkActions/RestoreItems/index.js +0 -2
- package/Presentation/components/BulkActions/index.js +0 -2
- package/Presentation/components/Cells/CellActions/CellActions.js +12 -17
- package/Presentation/components/Cells/CellActions/CellActions.js.map +1 -1
- package/Presentation/components/Cells/CellActions/index.js +0 -2
- package/Presentation/components/Cells/CellCreatedBy/CellCreatedBy.js +7 -12
- package/Presentation/components/Cells/CellCreatedBy/CellCreatedBy.js.map +1 -1
- package/Presentation/components/Cells/CellCreatedBy/index.js +0 -2
- package/Presentation/components/Cells/CellDeletedBy/CellDeletedBy.js +7 -12
- package/Presentation/components/Cells/CellDeletedBy/CellDeletedBy.js.map +1 -1
- package/Presentation/components/Cells/CellDeletedBy/index.js +0 -2
- package/Presentation/components/Cells/CellDeletedOn/CellDeletedOn.js +10 -15
- package/Presentation/components/Cells/CellDeletedOn/CellDeletedOn.js.map +1 -1
- package/Presentation/components/Cells/CellDeletedOn/index.js +0 -2
- package/Presentation/components/Cells/CellTitle/CellTitle.js +16 -19
- package/Presentation/components/Cells/CellTitle/CellTitle.js.map +1 -1
- package/Presentation/components/Cells/CellTitle/index.js +0 -2
- package/Presentation/components/Cells/index.js +0 -2
- package/Presentation/components/Empty/Empty.js +19 -20
- package/Presentation/components/Empty/Empty.js.map +1 -1
- package/Presentation/components/Empty/index.js +0 -2
- package/Presentation/components/SearchInput/SearchInput.js +25 -32
- package/Presentation/components/SearchInput/SearchInput.js.map +1 -1
- package/Presentation/components/SearchInput/index.js +0 -2
- package/Presentation/components/Table/Table.js +23 -28
- package/Presentation/components/Table/Table.js.map +1 -1
- package/Presentation/components/Table/index.js +0 -2
- package/Presentation/components/Title/Title.js +9 -12
- package/Presentation/components/Title/Title.js.map +1 -1
- package/Presentation/components/Title/index.js +0 -2
- package/Presentation/components/TrashBinOverlay/TrashBinOverlay.js +18 -24
- package/Presentation/components/TrashBinOverlay/TrashBinOverlay.js.map +1 -1
- package/Presentation/components/TrashBinOverlay/index.js +0 -2
- package/Presentation/configs/index.js +0 -2
- package/Presentation/configs/list/Browser/BulkAction.js +56 -66
- package/Presentation/configs/list/Browser/BulkAction.js.map +1 -1
- package/Presentation/configs/list/Browser/EntryAction.js +8 -11
- package/Presentation/configs/list/Browser/EntryAction.js.map +1 -1
- package/Presentation/configs/list/Browser/Table/Column.js +7 -10
- package/Presentation/configs/list/Browser/Table/Column.js.map +1 -1
- package/Presentation/configs/list/Browser/Table/Sorting.js +4 -7
- package/Presentation/configs/list/Browser/Table/Sorting.js.map +1 -1
- package/Presentation/configs/list/Browser/Table/index.js +4 -3
- package/Presentation/configs/list/Browser/Table/index.js.map +1 -1
- package/Presentation/configs/list/Browser/index.js +5 -4
- package/Presentation/configs/list/Browser/index.js.map +1 -1
- package/Presentation/configs/list/TrashBinListConfig.js +24 -23
- package/Presentation/configs/list/TrashBinListConfig.js.map +1 -1
- package/Presentation/configs/list/index.js +0 -2
- package/Presentation/hooks/index.js +0 -2
- package/Presentation/hooks/useDeleteTrashBinItem.js +22 -27
- package/Presentation/hooks/useDeleteTrashBinItem.js.map +1 -1
- package/Presentation/hooks/useRestoreTrashBinItem.js +28 -36
- package/Presentation/hooks/useRestoreTrashBinItem.js.map +1 -1
- package/Presentation/hooks/useTrashBin.js +68 -44
- package/Presentation/hooks/useTrashBin.js.map +1 -1
- package/Presentation/hooks/useTrashBinItem.js +4 -6
- package/Presentation/hooks/useTrashBinItem.js.map +1 -1
- package/Presentation/index.js +36 -43
- package/Presentation/index.js.map +1 -1
- package/UseCases/BulkAction/BulkActionUseCase.js +9 -8
- package/UseCases/BulkAction/BulkActionUseCase.js.map +1 -1
- package/UseCases/BulkAction/IBulkActionUseCase.js +0 -3
- package/UseCases/BulkAction/index.js +0 -2
- package/UseCases/DeleteItem/DeleteItemUseCase.js +9 -8
- package/UseCases/DeleteItem/DeleteItemUseCase.js.map +1 -1
- package/UseCases/DeleteItem/IDeleteItemUseCase.js +0 -3
- package/UseCases/DeleteItem/index.js +0 -2
- package/UseCases/GetRestoredItem/GetRestoredItemUseCase.js +10 -9
- package/UseCases/GetRestoredItem/GetRestoredItemUseCase.js.map +1 -1
- package/UseCases/GetRestoredItem/IGetRestoredItemUseCase.js +0 -3
- package/UseCases/GetRestoredItem/index.js +0 -2
- package/UseCases/ListItems/IListItemsUseCase.js +0 -3
- package/UseCases/ListItems/ListItemsUseCase.js +11 -10
- package/UseCases/ListItems/ListItemsUseCase.js.map +1 -1
- package/UseCases/ListItems/ListItemsUseCaseWithSearch.js +14 -13
- package/UseCases/ListItems/ListItemsUseCaseWithSearch.js.map +1 -1
- package/UseCases/ListItems/ListItemsUseCaseWithSorting.js +14 -13
- package/UseCases/ListItems/ListItemsUseCaseWithSorting.js.map +1 -1
- package/UseCases/ListItems/index.js +0 -2
- package/UseCases/ListMoreItems/IListMoreItemsUseCase.js +0 -3
- package/UseCases/ListMoreItems/ListMoreItemsUseCase.js +9 -8
- package/UseCases/ListMoreItems/ListMoreItemsUseCase.js.map +1 -1
- package/UseCases/ListMoreItems/index.js +0 -2
- package/UseCases/RestoreItem/IRestoreItemUseCase.js +0 -3
- package/UseCases/RestoreItem/RestoreItemUseCase.js +9 -8
- package/UseCases/RestoreItem/RestoreItemUseCase.js.map +1 -1
- package/UseCases/RestoreItem/index.js +0 -2
- package/UseCases/SearchItems/ISearchItemsUseCase.js +0 -3
- package/UseCases/SearchItems/SearchItemsUseCase.js +9 -8
- package/UseCases/SearchItems/SearchItemsUseCase.js.map +1 -1
- package/UseCases/SearchItems/index.js +0 -2
- package/UseCases/SelectAllItems/ISelectAllItemsUseCase.js +0 -3
- package/UseCases/SelectAllItems/SelectAllItemsUseCase.js +9 -8
- package/UseCases/SelectAllItems/SelectAllItemsUseCase.js.map +1 -1
- package/UseCases/SelectAllItems/index.js +0 -2
- package/UseCases/SelectItems/ISelectItemsUseCase.js +0 -3
- package/UseCases/SelectItems/SelectItemsUseCase.js +9 -8
- package/UseCases/SelectItems/SelectItemsUseCase.js.map +1 -1
- package/UseCases/SelectItems/index.js +0 -2
- package/UseCases/SortItems/ISortItemsUseCase.js +0 -3
- package/UseCases/SortItems/SortItemsUseCase.js +9 -8
- package/UseCases/SortItems/SortItemsUseCase.js.map +1 -1
- package/UseCases/SortItems/index.js +0 -2
- package/UseCases/UnSelectAllItems/IUnselectAllItemsUseCase.js +0 -3
- package/UseCases/UnSelectAllItems/UnselectAllItemsUseCase.js +9 -8
- package/UseCases/UnSelectAllItems/UnselectAllItemsUseCase.js.map +1 -1
- package/UseCases/UnSelectAllItems/index.js +0 -2
- package/UseCases/index.js +0 -2
- package/index.js +0 -2
- package/package.json +13 -14
- package/types.js +7 -6
- package/types.js.map +1 -1
- package/Domain/Models/TrashBinItem/ITrashBinItemMapper.js.map +0 -1
- package/Domain/Models/TrashBinItem/index.js.map +0 -1
- package/Domain/Models/index.js.map +0 -1
- package/Domain/Repositories/Search/ISearchRepository.js.map +0 -1
- package/Domain/Repositories/Search/index.js.map +0 -1
- package/Domain/Repositories/SelectedItems/ISelectedItemsRepository.js.map +0 -1
- package/Domain/Repositories/SelectedItems/index.js.map +0 -1
- package/Domain/Repositories/Sorting/index.js.map +0 -1
- package/Domain/Repositories/TrashBinItems/ITrashBinItemsRepository.js.map +0 -1
- package/Domain/Repositories/TrashBinItems/index.js.map +0 -1
- package/Domain/Repositories/index.js.map +0 -1
- package/Domain/index.js.map +0 -1
- package/Gateways/TrashBinBulkActions/ITrashBinBulkActionsGateway.js.map +0 -1
- package/Gateways/TrashBinBulkActions/index.js.map +0 -1
- package/Gateways/TrashBinDeleteItem/ITrashBinDeleteItemGateway.js.map +0 -1
- package/Gateways/TrashBinDeleteItem/index.js.map +0 -1
- package/Gateways/TrashBinListItems/ITrashBinListGateway.js.map +0 -1
- package/Gateways/TrashBinListItems/index.js.map +0 -1
- package/Gateways/TrashBinRestoreItem/ITrashBinRestoreItemGateway.js.map +0 -1
- package/Gateways/TrashBinRestoreItem/index.js.map +0 -1
- package/Gateways/index.js.map +0 -1
- package/Presentation/TrashBin/controllers/BulkAction/IBulkActionsController.js.map +0 -1
- package/Presentation/TrashBin/controllers/BulkAction/index.js.map +0 -1
- package/Presentation/TrashBin/controllers/DeleteItem/IDeleteItemController.js.map +0 -1
- package/Presentation/TrashBin/controllers/DeleteItem/index.js.map +0 -1
- package/Presentation/TrashBin/controllers/GetRestoredItemById/IGetRestoredItemByIdController.js.map +0 -1
- package/Presentation/TrashBin/controllers/GetRestoredItemById/index.js.map +0 -1
- package/Presentation/TrashBin/controllers/ListItems/IListItemsController.js.map +0 -1
- package/Presentation/TrashBin/controllers/ListItems/index.js.map +0 -1
- package/Presentation/TrashBin/controllers/ListMoreItems/IListMoreItemsController.js.map +0 -1
- package/Presentation/TrashBin/controllers/ListMoreItems/index.js.map +0 -1
- package/Presentation/TrashBin/controllers/RestoreItem/IRestoreItemController.js.map +0 -1
- package/Presentation/TrashBin/controllers/RestoreItem/index.js.map +0 -1
- package/Presentation/TrashBin/controllers/SearchItems/ISearchItemsController.js.map +0 -1
- package/Presentation/TrashBin/controllers/SearchItems/index.js.map +0 -1
- package/Presentation/TrashBin/controllers/SelectAllItems/ISelectAllItemsController.js.map +0 -1
- package/Presentation/TrashBin/controllers/SelectAllItems/index.js.map +0 -1
- package/Presentation/TrashBin/controllers/SelectItems/ISelectItemsController.js.map +0 -1
- package/Presentation/TrashBin/controllers/SelectItems/index.js.map +0 -1
- package/Presentation/TrashBin/controllers/SortItems/ISortItemsController.js.map +0 -1
- package/Presentation/TrashBin/controllers/SortItems/index.js.map +0 -1
- package/Presentation/TrashBin/controllers/UnselectAllItems/IUnselectAllItemsController.js.map +0 -1
- package/Presentation/TrashBin/controllers/UnselectAllItems/index.js.map +0 -1
- package/Presentation/TrashBin/controllers/index.js.map +0 -1
- package/Presentation/TrashBin/index.js.map +0 -1
- package/Presentation/TrashBinConfigs/index.js.map +0 -1
- package/Presentation/TrashBinRenderer/index.js.map +0 -1
- package/Presentation/abstractions/ITrashBinControllers.js.map +0 -1
- package/Presentation/abstractions/ITrashBinPresenter.js.map +0 -1
- package/Presentation/abstractions/index.js.map +0 -1
- package/Presentation/components/Actions/DeleteItem/index.js.map +0 -1
- package/Presentation/components/Actions/RestoreItem/index.js.map +0 -1
- package/Presentation/components/Actions/index.js.map +0 -1
- package/Presentation/components/BottomInfoBar/index.js.map +0 -1
- package/Presentation/components/BulkActions/BulkActions/index.js.map +0 -1
- package/Presentation/components/BulkActions/DeleteItems/index.js.map +0 -1
- package/Presentation/components/BulkActions/RestoreItems/index.js.map +0 -1
- package/Presentation/components/BulkActions/index.js.map +0 -1
- package/Presentation/components/Cells/CellActions/index.js.map +0 -1
- package/Presentation/components/Cells/CellCreatedBy/index.js.map +0 -1
- package/Presentation/components/Cells/CellDeletedBy/index.js.map +0 -1
- package/Presentation/components/Cells/CellDeletedOn/index.js.map +0 -1
- package/Presentation/components/Cells/CellTitle/index.js.map +0 -1
- package/Presentation/components/Cells/index.js.map +0 -1
- package/Presentation/components/Empty/index.js.map +0 -1
- package/Presentation/components/SearchInput/index.js.map +0 -1
- package/Presentation/components/Table/index.js.map +0 -1
- package/Presentation/components/Title/index.js.map +0 -1
- package/Presentation/components/TrashBinOverlay/index.js.map +0 -1
- package/Presentation/configs/index.js.map +0 -1
- package/Presentation/configs/list/index.js.map +0 -1
- package/Presentation/hooks/index.js.map +0 -1
- package/UseCases/BulkAction/IBulkActionUseCase.js.map +0 -1
- package/UseCases/BulkAction/index.js.map +0 -1
- package/UseCases/DeleteItem/IDeleteItemUseCase.js.map +0 -1
- package/UseCases/DeleteItem/index.js.map +0 -1
- package/UseCases/GetRestoredItem/IGetRestoredItemUseCase.js.map +0 -1
- package/UseCases/GetRestoredItem/index.js.map +0 -1
- package/UseCases/ListItems/IListItemsUseCase.js.map +0 -1
- package/UseCases/ListItems/index.js.map +0 -1
- package/UseCases/ListMoreItems/IListMoreItemsUseCase.js.map +0 -1
- package/UseCases/ListMoreItems/index.js.map +0 -1
- package/UseCases/RestoreItem/IRestoreItemUseCase.js.map +0 -1
- package/UseCases/RestoreItem/index.js.map +0 -1
- package/UseCases/SearchItems/ISearchItemsUseCase.js.map +0 -1
- package/UseCases/SearchItems/index.js.map +0 -1
- package/UseCases/SelectAllItems/ISelectAllItemsUseCase.js.map +0 -1
- package/UseCases/SelectAllItems/index.js.map +0 -1
- package/UseCases/SelectItems/ISelectItemsUseCase.js.map +0 -1
- package/UseCases/SelectItems/index.js.map +0 -1
- package/UseCases/SortItems/ISortItemsUseCase.js.map +0 -1
- package/UseCases/SortItems/index.js.map +0 -1
- package/UseCases/UnSelectAllItems/IUnselectAllItemsUseCase.js.map +0 -1
- package/UseCases/UnSelectAllItems/index.js.map +0 -1
- package/UseCases/index.js.map +0 -1
- package/index.js.map +0 -1
|
@@ -1,15 +1,16 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
1
|
+
class TrashBinItem {
|
|
2
|
+
constructor(item){
|
|
3
|
+
this.id = item.id;
|
|
4
|
+
this.title = item.title;
|
|
5
|
+
this.location = item.location;
|
|
6
|
+
this.createdBy = item.createdBy;
|
|
7
|
+
this.deletedOn = item.deletedOn;
|
|
8
|
+
this.deletedBy = item.deletedBy;
|
|
9
|
+
}
|
|
10
|
+
static create(item) {
|
|
11
|
+
return new TrashBinItem(item);
|
|
12
|
+
}
|
|
13
13
|
}
|
|
14
|
+
export { TrashBinItem };
|
|
14
15
|
|
|
15
16
|
//# sourceMappingURL=TrashBinItem.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"Domain/Models/TrashBinItem/TrashBinItem.js","sources":["../../../../src/Domain/Models/TrashBinItem/TrashBinItem.ts"],"sourcesContent":["import type { TrashBinIdentity, TrashBinLocation } from \"~/types.js\";\nimport type { TableRow } from \"@webiny/app-aco\";\n\nexport interface TrashBinItemDTO {\n id: string;\n title: string;\n createdBy: TrashBinIdentity;\n deletedBy: TrashBinIdentity;\n deletedOn: string;\n location: TrashBinLocation;\n [key: string]: any;\n}\n\nexport type TrashBinTableRow = TableRow<TrashBinItemDTO>;\n\nexport class TrashBinItem {\n public id: string;\n public title: string;\n public location: TrashBinLocation;\n public createdBy: TrashBinIdentity;\n public deletedOn: string;\n public deletedBy: TrashBinIdentity;\n\n protected constructor(item: TrashBinItemDTO) {\n this.id = item.id;\n this.title = item.title;\n this.location = item.location;\n this.createdBy = item.createdBy;\n this.deletedOn = item.deletedOn;\n this.deletedBy = item.deletedBy;\n }\n\n static create(item: TrashBinItemDTO) {\n return new TrashBinItem(item);\n }\n}\n"],"names":["TrashBinItem","item"],"mappings":"AAeO,MAAMA;IAQT,YAAsBC,IAAqB,CAAE;QACzC,IAAI,CAAC,EAAE,GAAGA,KAAK,EAAE;QACjB,IAAI,CAAC,KAAK,GAAGA,KAAK,KAAK;QACvB,IAAI,CAAC,QAAQ,GAAGA,KAAK,QAAQ;QAC7B,IAAI,CAAC,SAAS,GAAGA,KAAK,SAAS;QAC/B,IAAI,CAAC,SAAS,GAAGA,KAAK,SAAS;QAC/B,IAAI,CAAC,SAAS,GAAGA,KAAK,SAAS;IACnC;IAEA,OAAO,OAAOA,IAAqB,EAAE;QACjC,OAAO,IAAID,aAAaC;IAC5B;AACJ"}
|
package/Domain/Models/index.js
CHANGED
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
import { makeAutoObservable } from "mobx";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
2
|
+
class SearchRepository {
|
|
3
|
+
constructor(){
|
|
4
|
+
this.query = "";
|
|
5
|
+
makeAutoObservable(this);
|
|
6
|
+
}
|
|
7
|
+
get() {
|
|
8
|
+
return this.query;
|
|
9
|
+
}
|
|
10
|
+
async set(query) {
|
|
11
|
+
this.query = query;
|
|
12
|
+
}
|
|
13
13
|
}
|
|
14
|
+
export { SearchRepository };
|
|
14
15
|
|
|
15
16
|
//# sourceMappingURL=SearchRepository.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"Domain/Repositories/Search/SearchRepository.js","sources":["../../../../src/Domain/Repositories/Search/SearchRepository.ts"],"sourcesContent":["import { makeAutoObservable } from \"mobx\";\nimport type { ISearchRepository } from \"./ISearchRepository.js\";\n\nexport class SearchRepository implements ISearchRepository {\n private query = \"\";\n\n constructor() {\n makeAutoObservable(this);\n }\n\n get() {\n return this.query;\n }\n\n async set(query: string) {\n this.query = query;\n }\n}\n"],"names":["SearchRepository","makeAutoObservable","query"],"mappings":";AAGO,MAAMA;IAGT,aAAc;aAFN,KAAK,GAAG;QAGZC,mBAAmB,IAAI;IAC3B;IAEA,MAAM;QACF,OAAO,IAAI,CAAC,KAAK;IACrB;IAEA,MAAM,IAAIC,KAAa,EAAE;QACrB,IAAI,CAAC,KAAK,GAAGA;IACjB;AACJ"}
|
|
@@ -1,17 +1,18 @@
|
|
|
1
1
|
import { SearchRepository } from "./SearchRepository.js";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
2
|
+
class SearchRepositoryFactory {
|
|
3
|
+
getRepository() {
|
|
4
|
+
const cacheKey = this.getCacheKey();
|
|
5
|
+
if (!this.cache.has(cacheKey)) this.cache.set(cacheKey, new SearchRepository());
|
|
6
|
+
return this.cache.get(cacheKey);
|
|
7
|
+
}
|
|
8
|
+
getCacheKey() {
|
|
9
|
+
return Date.now().toString();
|
|
10
|
+
}
|
|
11
|
+
constructor(){
|
|
12
|
+
this.cache = new Map();
|
|
8
13
|
}
|
|
9
|
-
return this.cache.get(cacheKey);
|
|
10
|
-
}
|
|
11
|
-
getCacheKey() {
|
|
12
|
-
return Date.now().toString();
|
|
13
|
-
}
|
|
14
14
|
}
|
|
15
|
-
|
|
15
|
+
const searchRepositoryFactory = new SearchRepositoryFactory();
|
|
16
|
+
export { SearchRepositoryFactory, searchRepositoryFactory };
|
|
16
17
|
|
|
17
18
|
//# sourceMappingURL=SearchRepositoryFactory.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"Domain/Repositories/Search/SearchRepositoryFactory.js","sources":["../../../../src/Domain/Repositories/Search/SearchRepositoryFactory.ts"],"sourcesContent":["import { SearchRepository } from \"./SearchRepository.js\";\n\nexport class SearchRepositoryFactory {\n private cache: Map<string, SearchRepository> = new Map();\n\n getRepository() {\n const cacheKey = this.getCacheKey();\n\n if (!this.cache.has(cacheKey)) {\n this.cache.set(cacheKey, new SearchRepository());\n }\n\n return this.cache.get(cacheKey) as SearchRepository;\n }\n\n private getCacheKey() {\n return Date.now().toString();\n }\n}\n\nexport const searchRepositoryFactory = new SearchRepositoryFactory();\n"],"names":["SearchRepositoryFactory","cacheKey","SearchRepository","Date","Map","searchRepositoryFactory"],"mappings":";AAEO,MAAMA;IAGT,gBAAgB;QACZ,MAAMC,WAAW,IAAI,CAAC,WAAW;QAEjC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAACA,WAChB,IAAI,CAAC,KAAK,CAAC,GAAG,CAACA,UAAU,IAAIC;QAGjC,OAAO,IAAI,CAAC,KAAK,CAAC,GAAG,CAACD;IAC1B;IAEQ,cAAc;QAClB,OAAOE,KAAK,GAAG,GAAG,QAAQ;IAC9B;;aAdQ,KAAK,GAAkC,IAAIC;;AAevD;AAEO,MAAMC,0BAA0B,IAAIL"}
|
|
@@ -1,27 +1,28 @@
|
|
|
1
1
|
import { makeAutoObservable } from "mobx";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
2
|
+
class SelectedItemsRepository {
|
|
3
|
+
constructor(){
|
|
4
|
+
this.items = [];
|
|
5
|
+
this.selectedAll = false;
|
|
6
|
+
makeAutoObservable(this);
|
|
7
|
+
}
|
|
8
|
+
getSelectedItems() {
|
|
9
|
+
return this.items;
|
|
10
|
+
}
|
|
11
|
+
getSelectedAllItems() {
|
|
12
|
+
return this.selectedAll;
|
|
13
|
+
}
|
|
14
|
+
async selectItems(items) {
|
|
15
|
+
this.items = items;
|
|
16
|
+
this.selectedAll = false;
|
|
17
|
+
}
|
|
18
|
+
async selectAllItems() {
|
|
19
|
+
this.selectedAll = true;
|
|
20
|
+
}
|
|
21
|
+
async unselectAllItems() {
|
|
22
|
+
this.items = [];
|
|
23
|
+
this.selectedAll = false;
|
|
24
|
+
}
|
|
25
25
|
}
|
|
26
|
+
export { SelectedItemsRepository };
|
|
26
27
|
|
|
27
28
|
//# sourceMappingURL=SelectedItemsRepository.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"Domain/Repositories/SelectedItems/SelectedItemsRepository.js","sources":["../../../../src/Domain/Repositories/SelectedItems/SelectedItemsRepository.ts"],"sourcesContent":["import { makeAutoObservable } from \"mobx\";\nimport type { TrashBinItem } from \"~/Domain/index.js\";\nimport type { ISelectedItemsRepository } from \"./ISelectedItemsRepository.js\";\n\nexport class SelectedItemsRepository implements ISelectedItemsRepository {\n private items: TrashBinItem[] = [];\n private selectedAll = false;\n\n constructor() {\n makeAutoObservable(this);\n }\n\n getSelectedItems() {\n return this.items;\n }\n\n getSelectedAllItems() {\n return this.selectedAll;\n }\n\n async selectItems(items: TrashBinItem[]) {\n this.items = items;\n this.selectedAll = false;\n }\n\n async selectAllItems() {\n this.selectedAll = true;\n }\n\n async unselectAllItems() {\n this.items = [];\n this.selectedAll = false;\n }\n}\n"],"names":["SelectedItemsRepository","makeAutoObservable","items"],"mappings":";AAIO,MAAMA;IAIT,aAAc;aAHN,KAAK,GAAmB,EAAE;aAC1B,WAAW,GAAG;QAGlBC,mBAAmB,IAAI;IAC3B;IAEA,mBAAmB;QACf,OAAO,IAAI,CAAC,KAAK;IACrB;IAEA,sBAAsB;QAClB,OAAO,IAAI,CAAC,WAAW;IAC3B;IAEA,MAAM,YAAYC,KAAqB,EAAE;QACrC,IAAI,CAAC,KAAK,GAAGA;QACb,IAAI,CAAC,WAAW,GAAG;IACvB;IAEA,MAAM,iBAAiB;QACnB,IAAI,CAAC,WAAW,GAAG;IACvB;IAEA,MAAM,mBAAmB;QACrB,IAAI,CAAC,KAAK,GAAG,EAAE;QACf,IAAI,CAAC,WAAW,GAAG;IACvB;AACJ"}
|
|
@@ -1,17 +1,18 @@
|
|
|
1
1
|
import { SelectedItemsRepository } from "./SelectedItemsRepository.js";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
2
|
+
class SelectedItemsRepositoryFactory {
|
|
3
|
+
getRepository() {
|
|
4
|
+
const cacheKey = this.getCacheKey();
|
|
5
|
+
if (!this.cache.has(cacheKey)) this.cache.set(cacheKey, new SelectedItemsRepository());
|
|
6
|
+
return this.cache.get(cacheKey);
|
|
7
|
+
}
|
|
8
|
+
getCacheKey() {
|
|
9
|
+
return Date.now().toString();
|
|
10
|
+
}
|
|
11
|
+
constructor(){
|
|
12
|
+
this.cache = new Map();
|
|
8
13
|
}
|
|
9
|
-
return this.cache.get(cacheKey);
|
|
10
|
-
}
|
|
11
|
-
getCacheKey() {
|
|
12
|
-
return Date.now().toString();
|
|
13
|
-
}
|
|
14
14
|
}
|
|
15
|
-
|
|
15
|
+
const selectedItemsRepositoryFactory = new SelectedItemsRepositoryFactory();
|
|
16
|
+
export { SelectedItemsRepositoryFactory, selectedItemsRepositoryFactory };
|
|
16
17
|
|
|
17
18
|
//# sourceMappingURL=SelectedItemsRepositoryFactory.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"Domain/Repositories/SelectedItems/SelectedItemsRepositoryFactory.js","sources":["../../../../src/Domain/Repositories/SelectedItems/SelectedItemsRepositoryFactory.ts"],"sourcesContent":["import { SelectedItemsRepository } from \"./SelectedItemsRepository.js\";\n\nexport class SelectedItemsRepositoryFactory {\n private cache: Map<string, SelectedItemsRepository> = new Map();\n\n getRepository() {\n const cacheKey = this.getCacheKey();\n\n if (!this.cache.has(cacheKey)) {\n this.cache.set(cacheKey, new SelectedItemsRepository());\n }\n\n return this.cache.get(cacheKey) as SelectedItemsRepository;\n }\n\n private getCacheKey() {\n return Date.now().toString();\n }\n}\n\nexport const selectedItemsRepositoryFactory = new SelectedItemsRepositoryFactory();\n"],"names":["SelectedItemsRepositoryFactory","cacheKey","SelectedItemsRepository","Date","Map","selectedItemsRepositoryFactory"],"mappings":";AAEO,MAAMA;IAGT,gBAAgB;QACZ,MAAMC,WAAW,IAAI,CAAC,WAAW;QAEjC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAACA,WAChB,IAAI,CAAC,KAAK,CAAC,GAAG,CAACA,UAAU,IAAIC;QAGjC,OAAO,IAAI,CAAC,KAAK,CAAC,GAAG,CAACD;IAC1B;IAEQ,cAAc;QAClB,OAAOE,KAAK,GAAG,GAAG,QAAQ;IAC9B;;aAdQ,KAAK,GAAyC,IAAIC;;AAe9D;AAEO,MAAMC,iCAAiC,IAAIL"}
|
|
@@ -1,22 +1,21 @@
|
|
|
1
1
|
import { makeAutoObservable, runInAction } from "mobx";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
2
|
+
class SortingRepositoryWithDefaults {
|
|
3
|
+
constructor(defaults, repository){
|
|
4
|
+
this.defaults = defaults;
|
|
5
|
+
this.repository = repository;
|
|
6
|
+
makeAutoObservable(this);
|
|
7
|
+
}
|
|
8
|
+
get() {
|
|
9
|
+
const existingSort = this.repository.get();
|
|
10
|
+
if (0 === existingSort.length) runInAction(()=>{
|
|
11
|
+
this.set(this.defaults);
|
|
12
|
+
});
|
|
13
|
+
return this.repository.get();
|
|
14
|
+
}
|
|
15
|
+
async set(sorts) {
|
|
16
|
+
return this.repository.set(sorts);
|
|
14
17
|
}
|
|
15
|
-
return this.repository.get();
|
|
16
|
-
}
|
|
17
|
-
async set(sorts) {
|
|
18
|
-
return this.repository.set(sorts);
|
|
19
|
-
}
|
|
20
18
|
}
|
|
19
|
+
export { SortingRepositoryWithDefaults };
|
|
21
20
|
|
|
22
21
|
//# sourceMappingURL=SortingRepositoryWithDefaults.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"Domain/Repositories/Sorting/SortingRepositoryWithDefaults.js","sources":["../../../../src/Domain/Repositories/Sorting/SortingRepositoryWithDefaults.ts"],"sourcesContent":["import { makeAutoObservable, runInAction } from \"mobx\";\nimport type { ISortingRepository, Sorting } from \"@webiny/app-utils\";\n\nexport class SortingRepositoryWithDefaults implements ISortingRepository {\n private defaults: Sorting[];\n private repository: ISortingRepository;\n\n constructor(defaults: Sorting[], repository: ISortingRepository) {\n this.defaults = defaults;\n this.repository = repository;\n makeAutoObservable(this);\n }\n\n get() {\n const existingSort = this.repository.get();\n\n if (existingSort.length === 0) {\n runInAction(() => {\n this.set(this.defaults);\n });\n }\n\n return this.repository.get();\n }\n\n async set(sorts: Sorting[]) {\n return this.repository.set(sorts);\n }\n}\n"],"names":["SortingRepositoryWithDefaults","defaults","repository","makeAutoObservable","existingSort","runInAction","sorts"],"mappings":";AAGO,MAAMA;IAIT,YAAYC,QAAmB,EAAEC,UAA8B,CAAE;QAC7D,IAAI,CAAC,QAAQ,GAAGD;QAChB,IAAI,CAAC,UAAU,GAAGC;QAClBC,mBAAmB,IAAI;IAC3B;IAEA,MAAM;QACF,MAAMC,eAAe,IAAI,CAAC,UAAU,CAAC,GAAG;QAExC,IAAIA,AAAwB,MAAxBA,aAAa,MAAM,EACnBC,YAAY;YACR,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,QAAQ;QAC1B;QAGJ,OAAO,IAAI,CAAC,UAAU,CAAC,GAAG;IAC9B;IAEA,MAAM,IAAIC,KAAgB,EAAE;QACxB,OAAO,IAAI,CAAC,UAAU,CAAC,GAAG,CAACA;IAC/B;AACJ"}
|
|
@@ -1,18 +1,19 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
1
|
+
class TrashBinItemMapper {
|
|
2
|
+
toDTO(data) {
|
|
3
|
+
return {
|
|
4
|
+
id: data.id,
|
|
5
|
+
title: data.title,
|
|
6
|
+
location: data.location,
|
|
7
|
+
createdBy: data.createdBy,
|
|
8
|
+
deletedBy: {
|
|
9
|
+
id: data.deletedBy?.id || "",
|
|
10
|
+
displayName: data.deletedBy?.displayName || "",
|
|
11
|
+
type: data.deletedBy?.type || ""
|
|
12
|
+
},
|
|
13
|
+
deletedOn: data.deletedOn || ""
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
16
|
}
|
|
17
|
+
export { TrashBinItemMapper };
|
|
17
18
|
|
|
18
19
|
//# sourceMappingURL=TrashBinItemMapper.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"Domain/Repositories/TrashBinItems/TrashBinItemMapper.js","sources":["../../../../src/Domain/Repositories/TrashBinItems/TrashBinItemMapper.ts"],"sourcesContent":["import type { ITrashBinItemMapper, TrashBinItem } from \"~/Domain/index.js\";\n\nexport class TrashBinItemMapper implements ITrashBinItemMapper<TrashBinItem> {\n toDTO(data: TrashBinItem) {\n return {\n id: data.id,\n title: data.title,\n location: data.location,\n createdBy: data.createdBy,\n deletedBy: {\n id: data.deletedBy?.id || \"\",\n displayName: data.deletedBy?.displayName || \"\",\n type: data.deletedBy?.type || \"\"\n },\n deletedOn: data.deletedOn || \"\"\n };\n }\n}\n"],"names":["TrashBinItemMapper","data"],"mappings":"AAEO,MAAMA;IACT,MAAMC,IAAkB,EAAE;QACtB,OAAO;YACH,IAAIA,KAAK,EAAE;YACX,OAAOA,KAAK,KAAK;YACjB,UAAUA,KAAK,QAAQ;YACvB,WAAWA,KAAK,SAAS;YACzB,WAAW;gBACP,IAAIA,KAAK,SAAS,EAAE,MAAM;gBAC1B,aAAaA,KAAK,SAAS,EAAE,eAAe;gBAC5C,MAAMA,KAAK,SAAS,EAAE,QAAQ;YAClC;YACA,WAAWA,KAAK,SAAS,IAAI;QACjC;IACJ;AACJ"}
|
|
@@ -2,101 +2,92 @@ import { makeAutoObservable, runInAction } from "mobx";
|
|
|
2
2
|
import uniqBy from "lodash/uniqBy.js";
|
|
3
3
|
import { TrashBinItem } from "../../index.js";
|
|
4
4
|
import { Meta } from "@webiny/app-utils";
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
}
|
|
19
|
-
getItems() {
|
|
20
|
-
return this.items;
|
|
21
|
-
}
|
|
22
|
-
getRestoredItems() {
|
|
23
|
-
return this.restoredItems;
|
|
24
|
-
}
|
|
25
|
-
getMeta() {
|
|
26
|
-
return this.metaRepository.get();
|
|
27
|
-
}
|
|
28
|
-
getLoading() {
|
|
29
|
-
return {};
|
|
30
|
-
}
|
|
31
|
-
async listItems(params) {
|
|
32
|
-
this.params = params || {};
|
|
33
|
-
const response = await this.listGateway.execute({
|
|
34
|
-
...params
|
|
35
|
-
});
|
|
36
|
-
if (!response) {
|
|
37
|
-
return;
|
|
5
|
+
class TrashBinItemsRepository {
|
|
6
|
+
constructor(metaRepository, listGateway, deleteGateway, restoreGateway, bulkActionsGateway, entryMapper){
|
|
7
|
+
this.items = [];
|
|
8
|
+
this.restoredItems = [];
|
|
9
|
+
this.params = {};
|
|
10
|
+
this.metaRepository = metaRepository;
|
|
11
|
+
this.listGateway = listGateway;
|
|
12
|
+
this.deleteGateway = deleteGateway;
|
|
13
|
+
this.restoreGateway = restoreGateway;
|
|
14
|
+
this.bulkActionsGateway = bulkActionsGateway;
|
|
15
|
+
this.itemMapper = entryMapper;
|
|
16
|
+
this.params = {};
|
|
17
|
+
makeAutoObservable(this);
|
|
38
18
|
}
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
this.items = items.map(entry => TrashBinItem.create(this.itemMapper.toDTO(entry)));
|
|
42
|
-
this.metaRepository.set(Meta.create(meta));
|
|
43
|
-
});
|
|
44
|
-
}
|
|
45
|
-
async listMoreItems() {
|
|
46
|
-
const {
|
|
47
|
-
cursor
|
|
48
|
-
} = this.metaRepository.get();
|
|
49
|
-
if (!cursor) {
|
|
50
|
-
return;
|
|
19
|
+
getItems() {
|
|
20
|
+
return this.items;
|
|
51
21
|
}
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
after: cursor
|
|
55
|
-
});
|
|
56
|
-
if (!response) {
|
|
57
|
-
return;
|
|
22
|
+
getRestoredItems() {
|
|
23
|
+
return this.restoredItems;
|
|
58
24
|
}
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
const itemsDTO = items.map(entry => TrashBinItem.create(this.itemMapper.toDTO(entry)));
|
|
62
|
-
this.items = uniqBy([...this.items, ...itemsDTO], "id");
|
|
63
|
-
this.metaRepository.set(Meta.create(meta));
|
|
64
|
-
});
|
|
65
|
-
}
|
|
66
|
-
async deleteItem(id) {
|
|
67
|
-
const response = await this.deleteGateway.execute(id);
|
|
68
|
-
if (!response) {
|
|
69
|
-
return;
|
|
25
|
+
getMeta() {
|
|
26
|
+
return this.metaRepository.get();
|
|
70
27
|
}
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
28
|
+
getLoading() {
|
|
29
|
+
return {};
|
|
30
|
+
}
|
|
31
|
+
async listItems(params) {
|
|
32
|
+
this.params = params || {};
|
|
33
|
+
const response = await this.listGateway.execute({
|
|
34
|
+
...params
|
|
35
|
+
});
|
|
36
|
+
if (!response) return;
|
|
37
|
+
runInAction(()=>{
|
|
38
|
+
const [items, meta] = response;
|
|
39
|
+
this.items = items.map((entry)=>TrashBinItem.create(this.itemMapper.toDTO(entry)));
|
|
40
|
+
this.metaRepository.set(Meta.create(meta));
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
async listMoreItems() {
|
|
44
|
+
const { cursor } = this.metaRepository.get();
|
|
45
|
+
if (!cursor) return;
|
|
46
|
+
const response = await this.listGateway.execute({
|
|
47
|
+
...this.params,
|
|
48
|
+
after: cursor
|
|
49
|
+
});
|
|
50
|
+
if (!response) return;
|
|
51
|
+
runInAction(()=>{
|
|
52
|
+
const [items, meta] = response;
|
|
53
|
+
const itemsDTO = items.map((entry)=>TrashBinItem.create(this.itemMapper.toDTO(entry)));
|
|
54
|
+
this.items = uniqBy([
|
|
55
|
+
...this.items,
|
|
56
|
+
...itemsDTO
|
|
57
|
+
], "id");
|
|
58
|
+
this.metaRepository.set(Meta.create(meta));
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
async deleteItem(id) {
|
|
62
|
+
const response = await this.deleteGateway.execute(id);
|
|
63
|
+
if (!response) return;
|
|
64
|
+
runInAction(()=>{
|
|
65
|
+
this.items = this.items.filter((item)=>item.id !== id);
|
|
66
|
+
this.metaRepository.decreaseTotalCount(1);
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
async restoreItem(id) {
|
|
70
|
+
const item = await this.restoreGateway.execute(id);
|
|
71
|
+
if (!item) return;
|
|
72
|
+
runInAction(()=>{
|
|
73
|
+
this.items = this.items.filter((item)=>item.id !== id);
|
|
74
|
+
this.restoredItems = [
|
|
75
|
+
...this.restoredItems,
|
|
76
|
+
TrashBinItem.create(this.itemMapper.toDTO(item))
|
|
77
|
+
];
|
|
78
|
+
this.metaRepository.decreaseTotalCount(1);
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
async bulkAction(action, params) {
|
|
82
|
+
const { where, search, data } = params;
|
|
83
|
+
await this.bulkActionsGateway.execute({
|
|
84
|
+
action,
|
|
85
|
+
where,
|
|
86
|
+
search,
|
|
87
|
+
data
|
|
88
|
+
});
|
|
80
89
|
}
|
|
81
|
-
runInAction(() => {
|
|
82
|
-
this.items = this.items.filter(item => item.id !== id);
|
|
83
|
-
this.restoredItems = [...this.restoredItems, TrashBinItem.create(this.itemMapper.toDTO(item))];
|
|
84
|
-
this.metaRepository.decreaseTotalCount(1);
|
|
85
|
-
});
|
|
86
|
-
}
|
|
87
|
-
async bulkAction(action, params) {
|
|
88
|
-
const {
|
|
89
|
-
where,
|
|
90
|
-
search,
|
|
91
|
-
data
|
|
92
|
-
} = params;
|
|
93
|
-
await this.bulkActionsGateway.execute({
|
|
94
|
-
action,
|
|
95
|
-
where,
|
|
96
|
-
search,
|
|
97
|
-
data
|
|
98
|
-
});
|
|
99
|
-
}
|
|
100
90
|
}
|
|
91
|
+
export { TrashBinItemsRepository };
|
|
101
92
|
|
|
102
93
|
//# sourceMappingURL=TrashBinItemsRepository.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"Domain/Repositories/TrashBinItems/TrashBinItemsRepository.js","sources":["../../../../src/Domain/Repositories/TrashBinItems/TrashBinItemsRepository.ts"],"sourcesContent":["import { makeAutoObservable, runInAction } from \"mobx\";\nimport uniqBy from \"lodash/uniqBy.js\";\nimport type { ITrashBinItemMapper } from \"~/Domain/index.js\";\nimport { TrashBinItem } from \"~/Domain/index.js\";\nimport type {\n ITrashBinListGateway,\n ITrashBinDeleteItemGateway,\n ITrashBinRestoreItemGateway,\n ITrashBinBulkActionsGateway\n} from \"~/Gateways/index.js\";\nimport type { IMetaRepository } from \"@webiny/app-utils\";\nimport { Meta } from \"@webiny/app-utils\";\nimport type { TrashBinBulkActionsParams, TrashBinListQueryVariables } from \"~/types.js\";\nimport type { ITrashBinItemsRepository } from \"./ITrashBinItemsRepository.js\";\n\nexport class TrashBinItemsRepository<\n TItem extends Record<string, any>\n> implements ITrashBinItemsRepository {\n private metaRepository: IMetaRepository;\n private listGateway: ITrashBinListGateway<TItem>;\n private deleteGateway: ITrashBinDeleteItemGateway;\n private restoreGateway: ITrashBinRestoreItemGateway<TItem>;\n private bulkActionsGateway: ITrashBinBulkActionsGateway;\n private itemMapper: ITrashBinItemMapper<TItem>;\n private items: TrashBinItem[] = [];\n private restoredItems: TrashBinItem[] = [];\n private params: TrashBinListQueryVariables = {};\n\n constructor(\n metaRepository: IMetaRepository,\n listGateway: ITrashBinListGateway<TItem>,\n deleteGateway: ITrashBinDeleteItemGateway,\n restoreGateway: ITrashBinRestoreItemGateway<TItem>,\n bulkActionsGateway: ITrashBinBulkActionsGateway,\n entryMapper: ITrashBinItemMapper<TItem>\n ) {\n this.metaRepository = metaRepository;\n this.listGateway = listGateway;\n this.deleteGateway = deleteGateway;\n this.restoreGateway = restoreGateway;\n this.bulkActionsGateway = bulkActionsGateway;\n this.itemMapper = entryMapper;\n this.params = {};\n makeAutoObservable(this);\n }\n\n getItems() {\n return this.items;\n }\n\n getRestoredItems() {\n return this.restoredItems;\n }\n\n getMeta() {\n return this.metaRepository.get();\n }\n\n getLoading() {\n return {};\n }\n\n async listItems(params?: TrashBinListQueryVariables) {\n this.params = params || {};\n\n const response = await this.listGateway.execute({ ...params });\n\n if (!response) {\n return;\n }\n\n runInAction(() => {\n const [items, meta] = response;\n this.items = items.map(entry => TrashBinItem.create(this.itemMapper.toDTO(entry)));\n this.metaRepository.set(Meta.create(meta));\n });\n }\n\n async listMoreItems() {\n const { cursor } = this.metaRepository.get();\n\n if (!cursor) {\n return;\n }\n\n const response = await this.listGateway.execute({ ...this.params, after: cursor });\n\n if (!response) {\n return;\n }\n\n runInAction(() => {\n const [items, meta] = response;\n const itemsDTO = items.map(entry => TrashBinItem.create(this.itemMapper.toDTO(entry)));\n this.items = uniqBy([...this.items, ...itemsDTO], \"id\");\n this.metaRepository.set(Meta.create(meta));\n });\n }\n\n async deleteItem(id: string) {\n const response = await this.deleteGateway.execute(id);\n\n if (!response) {\n return;\n }\n\n runInAction(() => {\n this.items = this.items.filter(item => item.id !== id);\n this.metaRepository.decreaseTotalCount(1);\n });\n }\n\n async restoreItem(id: string) {\n const item = await this.restoreGateway.execute(id);\n\n if (!item) {\n return;\n }\n\n runInAction(() => {\n this.items = this.items.filter(item => item.id !== id);\n this.restoredItems = [\n ...this.restoredItems,\n TrashBinItem.create(this.itemMapper.toDTO(item))\n ];\n this.metaRepository.decreaseTotalCount(1);\n });\n }\n\n async bulkAction(action: string, params: TrashBinBulkActionsParams) {\n const { where, search, data } = params;\n await this.bulkActionsGateway.execute({ action, where, search, data });\n }\n}\n"],"names":["TrashBinItemsRepository","metaRepository","listGateway","deleteGateway","restoreGateway","bulkActionsGateway","entryMapper","makeAutoObservable","params","response","runInAction","items","meta","entry","TrashBinItem","Meta","cursor","itemsDTO","uniqBy","id","item","action","where","search","data"],"mappings":"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"}
|