@webiny/app-trash-bin 5.43.2 → 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.
Files changed (344) hide show
  1. package/Domain/Models/TrashBinItem/ITrashBinItemMapper.js +1 -5
  2. package/Domain/Models/TrashBinItem/TrashBinItem.js +6 -19
  3. package/Domain/Models/TrashBinItem/TrashBinItem.js.map +1 -1
  4. package/Domain/Models/TrashBinItem/index.js +2 -27
  5. package/Domain/Models/TrashBinItem/index.js.map +1 -1
  6. package/Domain/Models/index.js +1 -16
  7. package/Domain/Models/index.js.map +1 -1
  8. package/Domain/Repositories/Search/ISearchRepository.js +1 -5
  9. package/Domain/Repositories/Search/SearchRepository.js +12 -28
  10. package/Domain/Repositories/Search/SearchRepository.js.map +1 -1
  11. package/Domain/Repositories/Search/SearchRepositoryFactory.js +14 -32
  12. package/Domain/Repositories/Search/SearchRepositoryFactory.js.map +1 -1
  13. package/Domain/Repositories/Search/index.js +3 -38
  14. package/Domain/Repositories/Search/index.js.map +1 -1
  15. package/Domain/Repositories/SelectedItems/ISelectedItemsRepository.js +1 -5
  16. package/Domain/Repositories/SelectedItems/SelectedItemsRepository.js +24 -46
  17. package/Domain/Repositories/SelectedItems/SelectedItemsRepository.js.map +1 -1
  18. package/Domain/Repositories/SelectedItems/SelectedItemsRepositoryFactory.js +14 -32
  19. package/Domain/Repositories/SelectedItems/SelectedItemsRepositoryFactory.js.map +1 -1
  20. package/Domain/Repositories/SelectedItems/index.js +3 -38
  21. package/Domain/Repositories/SelectedItems/index.js.map +1 -1
  22. package/Domain/Repositories/Sorting/SortingRepositoryWithDefaults.d.ts +1 -1
  23. package/Domain/Repositories/Sorting/SortingRepositoryWithDefaults.js +16 -32
  24. package/Domain/Repositories/Sorting/SortingRepositoryWithDefaults.js.map +1 -1
  25. package/Domain/Repositories/Sorting/index.js +1 -16
  26. package/Domain/Repositories/Sorting/index.js.map +1 -1
  27. package/Domain/Repositories/TrashBinItems/ITrashBinItemsRepository.js +1 -5
  28. package/Domain/Repositories/TrashBinItems/TrashBinItemMapper.js +16 -31
  29. package/Domain/Repositories/TrashBinItems/TrashBinItemMapper.js.map +1 -1
  30. package/Domain/Repositories/TrashBinItems/TrashBinItemsRepository.js +87 -130
  31. package/Domain/Repositories/TrashBinItems/TrashBinItemsRepository.js.map +1 -1
  32. package/Domain/Repositories/TrashBinItems/TrashBinItemsRepositoryFactory.js +14 -32
  33. package/Domain/Repositories/TrashBinItems/TrashBinItemsRepositoryFactory.js.map +1 -1
  34. package/Domain/Repositories/TrashBinItems/TrashBinItemsRepositoryWithLoading.js +33 -62
  35. package/Domain/Repositories/TrashBinItems/TrashBinItemsRepositoryWithLoading.js.map +1 -1
  36. package/Domain/Repositories/TrashBinItems/index.js +5 -60
  37. package/Domain/Repositories/TrashBinItems/index.js.map +1 -1
  38. package/Domain/Repositories/index.js +5 -49
  39. package/Domain/Repositories/index.js.map +1 -1
  40. package/Domain/index.js +2 -27
  41. package/Domain/index.js.map +1 -1
  42. package/Gateways/TrashBinBulkActions/ITrashBinBulkActionsGateway.js +1 -5
  43. package/Gateways/TrashBinBulkActions/index.js +1 -16
  44. package/Gateways/TrashBinBulkActions/index.js.map +1 -1
  45. package/Gateways/TrashBinDeleteItem/ITrashBinDeleteItemGateway.js +1 -5
  46. package/Gateways/TrashBinDeleteItem/index.js +1 -16
  47. package/Gateways/TrashBinDeleteItem/index.js.map +1 -1
  48. package/Gateways/TrashBinListItems/ITrashBinListGateway.js +1 -5
  49. package/Gateways/TrashBinListItems/index.js +1 -16
  50. package/Gateways/TrashBinListItems/index.js.map +1 -1
  51. package/Gateways/TrashBinRestoreItem/ITrashBinRestoreItemGateway.js +1 -5
  52. package/Gateways/TrashBinRestoreItem/index.js +1 -16
  53. package/Gateways/TrashBinRestoreItem/index.js.map +1 -1
  54. package/Gateways/index.js +4 -49
  55. package/Gateways/index.js.map +1 -1
  56. package/Presentation/TrashBin/TrashBin.js +30 -37
  57. package/Presentation/TrashBin/TrashBin.js.map +1 -1
  58. package/Presentation/TrashBin/TrashBin.test.js +186 -175
  59. package/Presentation/TrashBin/TrashBin.test.js.map +1 -1
  60. package/Presentation/TrashBin/TrashBinControllers.js +60 -94
  61. package/Presentation/TrashBin/TrashBinControllers.js.map +1 -1
  62. package/Presentation/TrashBin/TrashBinPresenter.js +49 -77
  63. package/Presentation/TrashBin/TrashBinPresenter.js.map +1 -1
  64. package/Presentation/TrashBin/controllers/BulkAction/BulkActionsController.js +7 -20
  65. package/Presentation/TrashBin/controllers/BulkAction/BulkActionsController.js.map +1 -1
  66. package/Presentation/TrashBin/controllers/BulkAction/IBulkActionsController.js +1 -5
  67. package/Presentation/TrashBin/controllers/BulkAction/index.js +2 -27
  68. package/Presentation/TrashBin/controllers/BulkAction/index.js.map +1 -1
  69. package/Presentation/TrashBin/controllers/DeleteItem/DeleteItemController.js +7 -20
  70. package/Presentation/TrashBin/controllers/DeleteItem/DeleteItemController.js.map +1 -1
  71. package/Presentation/TrashBin/controllers/DeleteItem/IDeleteItemController.js +1 -5
  72. package/Presentation/TrashBin/controllers/DeleteItem/index.js +2 -27
  73. package/Presentation/TrashBin/controllers/DeleteItem/index.js.map +1 -1
  74. package/Presentation/TrashBin/controllers/GetRestoredItemById/GetRestoredItemByIdController.js +10 -23
  75. package/Presentation/TrashBin/controllers/GetRestoredItemById/GetRestoredItemByIdController.js.map +1 -1
  76. package/Presentation/TrashBin/controllers/GetRestoredItemById/IGetRestoredItemByIdController.js +1 -5
  77. package/Presentation/TrashBin/controllers/GetRestoredItemById/index.js +2 -27
  78. package/Presentation/TrashBin/controllers/GetRestoredItemById/index.js.map +1 -1
  79. package/Presentation/TrashBin/controllers/ListItems/IListItemsController.js +1 -5
  80. package/Presentation/TrashBin/controllers/ListItems/ListItemsController.js +7 -20
  81. package/Presentation/TrashBin/controllers/ListItems/ListItemsController.js.map +1 -1
  82. package/Presentation/TrashBin/controllers/ListItems/index.js +2 -27
  83. package/Presentation/TrashBin/controllers/ListItems/index.js.map +1 -1
  84. package/Presentation/TrashBin/controllers/ListMoreItems/IListMoreItemsController.js +1 -5
  85. package/Presentation/TrashBin/controllers/ListMoreItems/ListMoreItemsController.js +7 -20
  86. package/Presentation/TrashBin/controllers/ListMoreItems/ListMoreItemsController.js.map +1 -1
  87. package/Presentation/TrashBin/controllers/ListMoreItems/index.js +2 -27
  88. package/Presentation/TrashBin/controllers/ListMoreItems/index.js.map +1 -1
  89. package/Presentation/TrashBin/controllers/RestoreItem/IRestoreItemController.js +1 -5
  90. package/Presentation/TrashBin/controllers/RestoreItem/RestoreItemController.js +7 -20
  91. package/Presentation/TrashBin/controllers/RestoreItem/RestoreItemController.js.map +1 -1
  92. package/Presentation/TrashBin/controllers/RestoreItem/index.js +2 -27
  93. package/Presentation/TrashBin/controllers/RestoreItem/index.js.map +1 -1
  94. package/Presentation/TrashBin/controllers/SearchItems/ISearchItemsController.js +1 -5
  95. package/Presentation/TrashBin/controllers/SearchItems/SearchItemsController.js +9 -22
  96. package/Presentation/TrashBin/controllers/SearchItems/SearchItemsController.js.map +1 -1
  97. package/Presentation/TrashBin/controllers/SearchItems/index.js +2 -27
  98. package/Presentation/TrashBin/controllers/SearchItems/index.js.map +1 -1
  99. package/Presentation/TrashBin/controllers/SelectAllItems/ISelectAllItemsController.js +1 -5
  100. package/Presentation/TrashBin/controllers/SelectAllItems/SelectAllItemsController.js +7 -20
  101. package/Presentation/TrashBin/controllers/SelectAllItems/SelectAllItemsController.js.map +1 -1
  102. package/Presentation/TrashBin/controllers/SelectAllItems/index.js +2 -27
  103. package/Presentation/TrashBin/controllers/SelectAllItems/index.js.map +1 -1
  104. package/Presentation/TrashBin/controllers/SelectItems/ISelectItemsController.js +1 -5
  105. package/Presentation/TrashBin/controllers/SelectItems/SelectItemsController.js +9 -24
  106. package/Presentation/TrashBin/controllers/SelectItems/SelectItemsController.js.map +1 -1
  107. package/Presentation/TrashBin/controllers/SelectItems/index.js +2 -27
  108. package/Presentation/TrashBin/controllers/SelectItems/index.js.map +1 -1
  109. package/Presentation/TrashBin/controllers/SortItems/ISortItemsController.js +1 -5
  110. package/Presentation/TrashBin/controllers/SortItems/SortItemsController.js +13 -25
  111. package/Presentation/TrashBin/controllers/SortItems/SortItemsController.js.map +1 -1
  112. package/Presentation/TrashBin/controllers/SortItems/index.js +2 -27
  113. package/Presentation/TrashBin/controllers/SortItems/index.js.map +1 -1
  114. package/Presentation/TrashBin/controllers/UnselectAllItems/IUnselectAllItemsController.js +1 -5
  115. package/Presentation/TrashBin/controllers/UnselectAllItems/UnselectAllItemsController.js +7 -20
  116. package/Presentation/TrashBin/controllers/UnselectAllItems/UnselectAllItemsController.js.map +1 -1
  117. package/Presentation/TrashBin/controllers/UnselectAllItems/index.js +2 -27
  118. package/Presentation/TrashBin/controllers/UnselectAllItems/index.js.map +1 -1
  119. package/Presentation/TrashBin/controllers/index.js +11 -126
  120. package/Presentation/TrashBin/controllers/index.js.map +1 -1
  121. package/Presentation/TrashBin/index.js +1 -16
  122. package/Presentation/TrashBin/index.js.map +1 -1
  123. package/Presentation/TrashBinConfigs/TrashBinConfigs.js +31 -36
  124. package/Presentation/TrashBinConfigs/TrashBinConfigs.js.map +1 -1
  125. package/Presentation/TrashBinConfigs/index.js +1 -16
  126. package/Presentation/TrashBinConfigs/index.js.map +1 -1
  127. package/Presentation/TrashBinRenderer/TrashBinRenderer.js +13 -23
  128. package/Presentation/TrashBinRenderer/TrashBinRenderer.js.map +1 -1
  129. package/Presentation/TrashBinRenderer/index.js +1 -16
  130. package/Presentation/TrashBinRenderer/index.js.map +1 -1
  131. package/Presentation/abstractions/ITrashBinControllers.js +1 -5
  132. package/Presentation/abstractions/ITrashBinPresenter.js +1 -5
  133. package/Presentation/abstractions/index.js +2 -27
  134. package/Presentation/abstractions/index.js.map +1 -1
  135. package/Presentation/components/Actions/DeleteItem/DeleteItem.js +20 -22
  136. package/Presentation/components/Actions/DeleteItem/DeleteItem.js.map +1 -1
  137. package/Presentation/components/Actions/DeleteItem/index.js +1 -16
  138. package/Presentation/components/Actions/DeleteItem/index.js.map +1 -1
  139. package/Presentation/components/Actions/RestoreItem/RestoreItem.js +18 -21
  140. package/Presentation/components/Actions/RestoreItem/RestoreItem.js.map +1 -1
  141. package/Presentation/components/Actions/RestoreItem/index.js +1 -16
  142. package/Presentation/components/Actions/RestoreItem/index.js.map +1 -1
  143. package/Presentation/components/Actions/index.js +2 -27
  144. package/Presentation/components/Actions/index.js.map +1 -1
  145. package/Presentation/components/BottomInfoBar/BottomInfoBar.js +18 -20
  146. package/Presentation/components/BottomInfoBar/BottomInfoBar.js.map +1 -1
  147. package/Presentation/components/BottomInfoBar/ListMeta.js +10 -13
  148. package/Presentation/components/BottomInfoBar/ListMeta.js.map +1 -1
  149. package/Presentation/components/BottomInfoBar/ListStatus.js +14 -16
  150. package/Presentation/components/BottomInfoBar/ListStatus.js.map +1 -1
  151. package/Presentation/components/BottomInfoBar/index.js +1 -16
  152. package/Presentation/components/BottomInfoBar/index.js.map +1 -1
  153. package/Presentation/components/BulkActions/BulkActions/BulkActions.js +49 -35
  154. package/Presentation/components/BulkActions/BulkActions/BulkActions.js.map +1 -1
  155. package/Presentation/components/BulkActions/BulkActions/index.js +1 -16
  156. package/Presentation/components/BulkActions/BulkActions/index.js.map +1 -1
  157. package/Presentation/components/BulkActions/DeleteItems/DeleteItems.js +75 -74
  158. package/Presentation/components/BulkActions/DeleteItems/DeleteItems.js.map +1 -1
  159. package/Presentation/components/BulkActions/DeleteItems/index.js +1 -16
  160. package/Presentation/components/BulkActions/DeleteItems/index.js.map +1 -1
  161. package/Presentation/components/BulkActions/RestoreItems/RestoreItems.js +83 -84
  162. package/Presentation/components/BulkActions/RestoreItems/RestoreItems.js.map +1 -1
  163. package/Presentation/components/BulkActions/RestoreItems/RestoreItemsReportMessage.js +9 -14
  164. package/Presentation/components/BulkActions/RestoreItems/RestoreItemsReportMessage.js.map +1 -1
  165. package/Presentation/components/BulkActions/RestoreItems/index.js +1 -16
  166. package/Presentation/components/BulkActions/RestoreItems/index.js.map +1 -1
  167. package/Presentation/components/BulkActions/index.js +3 -38
  168. package/Presentation/components/BulkActions/index.js.map +1 -1
  169. package/Presentation/components/Cells/CellActions/CellActions.js +17 -20
  170. package/Presentation/components/Cells/CellActions/CellActions.js.map +1 -1
  171. package/Presentation/components/Cells/CellActions/index.js +1 -16
  172. package/Presentation/components/Cells/CellActions/index.js.map +1 -1
  173. package/Presentation/components/Cells/CellCreatedBy/CellCreatedBy.js +10 -14
  174. package/Presentation/components/Cells/CellCreatedBy/CellCreatedBy.js.map +1 -1
  175. package/Presentation/components/Cells/CellCreatedBy/index.js +1 -16
  176. package/Presentation/components/Cells/CellCreatedBy/index.js.map +1 -1
  177. package/Presentation/components/Cells/CellDeletedBy/CellDeletedBy.js +10 -14
  178. package/Presentation/components/Cells/CellDeletedBy/CellDeletedBy.js.map +1 -1
  179. package/Presentation/components/Cells/CellDeletedBy/index.js +1 -16
  180. package/Presentation/components/Cells/CellDeletedBy/index.js.map +1 -1
  181. package/Presentation/components/Cells/CellDeletedOn/CellDeletedOn.js +11 -15
  182. package/Presentation/components/Cells/CellDeletedOn/CellDeletedOn.js.map +1 -1
  183. package/Presentation/components/Cells/CellDeletedOn/index.js +1 -16
  184. package/Presentation/components/Cells/CellDeletedOn/index.js.map +1 -1
  185. package/Presentation/components/Cells/CellTitle/CellTitle.js +20 -17
  186. package/Presentation/components/Cells/CellTitle/CellTitle.js.map +1 -1
  187. package/Presentation/components/Cells/CellTitle/index.js +1 -16
  188. package/Presentation/components/Cells/CellTitle/index.js.map +1 -1
  189. package/Presentation/components/Cells/index.js +5 -60
  190. package/Presentation/components/Cells/index.js.map +1 -1
  191. package/Presentation/components/Empty/Empty.js +18 -21
  192. package/Presentation/components/Empty/Empty.js.map +1 -1
  193. package/Presentation/components/Empty/index.js +1 -16
  194. package/Presentation/components/Empty/index.js.map +1 -1
  195. package/Presentation/components/SearchInput/SearchInput.js +27 -32
  196. package/Presentation/components/SearchInput/SearchInput.js.map +1 -1
  197. package/Presentation/components/SearchInput/index.js +1 -16
  198. package/Presentation/components/SearchInput/index.js.map +1 -1
  199. package/Presentation/components/Table/Table.js +14 -24
  200. package/Presentation/components/Table/Table.js.map +1 -1
  201. package/Presentation/components/Table/index.js +1 -16
  202. package/Presentation/components/Table/index.js.map +1 -1
  203. package/Presentation/components/Title/Title.js +11 -18
  204. package/Presentation/components/Title/Title.js.map +1 -1
  205. package/Presentation/components/Title/index.js +1 -16
  206. package/Presentation/components/Title/index.js.map +1 -1
  207. package/Presentation/components/TrashBinOverlay/TrashBinOverlay.js +27 -35
  208. package/Presentation/components/TrashBinOverlay/TrashBinOverlay.js.map +1 -1
  209. package/Presentation/components/TrashBinOverlay/index.js +1 -16
  210. package/Presentation/components/TrashBinOverlay/index.js.map +1 -1
  211. package/Presentation/configs/index.js +1 -16
  212. package/Presentation/configs/index.js.map +1 -1
  213. package/Presentation/configs/list/Browser/BulkAction.js +36 -47
  214. package/Presentation/configs/list/Browser/BulkAction.js.map +1 -1
  215. package/Presentation/configs/list/Browser/EntryAction.js +11 -21
  216. package/Presentation/configs/list/Browser/EntryAction.js.map +1 -1
  217. package/Presentation/configs/list/Browser/Table/Column.d.ts +1 -1
  218. package/Presentation/configs/list/Browser/Table/Column.js +9 -19
  219. package/Presentation/configs/list/Browser/Table/Column.js.map +1 -1
  220. package/Presentation/configs/list/Browser/Table/Sorting.js +8 -18
  221. package/Presentation/configs/list/Browser/Table/Sorting.js.map +1 -1
  222. package/Presentation/configs/list/Browser/Table/index.d.ts +1 -1
  223. package/Presentation/configs/list/Browser/Table/index.js +5 -11
  224. package/Presentation/configs/list/Browser/Table/index.js.map +1 -1
  225. package/Presentation/configs/list/Browser/index.d.ts +1 -1
  226. package/Presentation/configs/list/Browser/index.js +7 -13
  227. package/Presentation/configs/list/Browser/index.js.map +1 -1
  228. package/Presentation/configs/list/TrashBinListConfig.d.ts +1 -1
  229. package/Presentation/configs/list/TrashBinListConfig.js +22 -33
  230. package/Presentation/configs/list/TrashBinListConfig.js.map +1 -1
  231. package/Presentation/configs/list/index.js +1 -16
  232. package/Presentation/configs/list/index.js.map +1 -1
  233. package/Presentation/hooks/index.js +4 -49
  234. package/Presentation/hooks/index.js.map +1 -1
  235. package/Presentation/hooks/useDeleteTrashBinItem.js +27 -32
  236. package/Presentation/hooks/useDeleteTrashBinItem.js.map +1 -1
  237. package/Presentation/hooks/useRestoreTrashBinItem.js +36 -43
  238. package/Presentation/hooks/useRestoreTrashBinItem.js.map +1 -1
  239. package/Presentation/hooks/useTrashBin.d.ts +1 -1
  240. package/Presentation/hooks/useTrashBin.js +41 -77
  241. package/Presentation/hooks/useTrashBin.js.map +1 -1
  242. package/Presentation/hooks/useTrashBinItem.js +7 -12
  243. package/Presentation/hooks/useTrashBinItem.js.map +1 -1
  244. package/Presentation/index.js +21 -48
  245. package/Presentation/index.js.map +1 -1
  246. package/UseCases/BulkAction/BulkActionUseCase.js +8 -21
  247. package/UseCases/BulkAction/BulkActionUseCase.js.map +1 -1
  248. package/UseCases/BulkAction/IBulkActionUseCase.js +1 -5
  249. package/UseCases/BulkAction/index.js +2 -27
  250. package/UseCases/BulkAction/index.js.map +1 -1
  251. package/UseCases/DeleteItem/DeleteItemUseCase.js +8 -21
  252. package/UseCases/DeleteItem/DeleteItemUseCase.js.map +1 -1
  253. package/UseCases/DeleteItem/IDeleteItemUseCase.js +1 -5
  254. package/UseCases/DeleteItem/index.js +2 -27
  255. package/UseCases/DeleteItem/index.js.map +1 -1
  256. package/UseCases/GetRestoredItem/GetRestoredItemUseCase.js +9 -24
  257. package/UseCases/GetRestoredItem/GetRestoredItemUseCase.js.map +1 -1
  258. package/UseCases/GetRestoredItem/IGetRestoredItemUseCase.js +1 -5
  259. package/UseCases/GetRestoredItem/index.js +2 -27
  260. package/UseCases/GetRestoredItem/index.js.map +1 -1
  261. package/UseCases/ListItems/IListItemsUseCase.js +1 -5
  262. package/UseCases/ListItems/ListItemsUseCase.js +10 -22
  263. package/UseCases/ListItems/ListItemsUseCase.js.map +1 -1
  264. package/UseCases/ListItems/ListItemsUseCaseWithSearch.js +12 -25
  265. package/UseCases/ListItems/ListItemsUseCaseWithSearch.js.map +1 -1
  266. package/UseCases/ListItems/ListItemsUseCaseWithSorting.js +13 -28
  267. package/UseCases/ListItems/ListItemsUseCaseWithSorting.js.map +1 -1
  268. package/UseCases/ListItems/index.js +4 -49
  269. package/UseCases/ListItems/index.js.map +1 -1
  270. package/UseCases/ListMoreItems/IListMoreItemsUseCase.js +1 -5
  271. package/UseCases/ListMoreItems/ListMoreItemsUseCase.js +8 -21
  272. package/UseCases/ListMoreItems/ListMoreItemsUseCase.js.map +1 -1
  273. package/UseCases/ListMoreItems/index.js +2 -27
  274. package/UseCases/ListMoreItems/index.js.map +1 -1
  275. package/UseCases/RestoreItem/IRestoreItemUseCase.js +1 -5
  276. package/UseCases/RestoreItem/RestoreItemUseCase.js +8 -21
  277. package/UseCases/RestoreItem/RestoreItemUseCase.js.map +1 -1
  278. package/UseCases/RestoreItem/index.js +2 -27
  279. package/UseCases/RestoreItem/index.js.map +1 -1
  280. package/UseCases/SearchItems/ISearchItemsUseCase.js +1 -5
  281. package/UseCases/SearchItems/SearchItemsUseCase.js +8 -21
  282. package/UseCases/SearchItems/SearchItemsUseCase.js.map +1 -1
  283. package/UseCases/SearchItems/index.js +2 -27
  284. package/UseCases/SearchItems/index.js.map +1 -1
  285. package/UseCases/SelectAllItems/ISelectAllItemsUseCase.js +1 -5
  286. package/UseCases/SelectAllItems/SelectAllItemsUseCase.js +8 -21
  287. package/UseCases/SelectAllItems/SelectAllItemsUseCase.js.map +1 -1
  288. package/UseCases/SelectAllItems/index.js +2 -27
  289. package/UseCases/SelectAllItems/index.js.map +1 -1
  290. package/UseCases/SelectItems/ISelectItemsUseCase.js +1 -5
  291. package/UseCases/SelectItems/SelectItemsUseCase.js +8 -21
  292. package/UseCases/SelectItems/SelectItemsUseCase.js.map +1 -1
  293. package/UseCases/SelectItems/index.js +2 -27
  294. package/UseCases/SelectItems/index.js.map +1 -1
  295. package/UseCases/SortItems/ISortItemsUseCase.js +1 -5
  296. package/UseCases/SortItems/SortItemsUseCase.js +8 -21
  297. package/UseCases/SortItems/SortItemsUseCase.js.map +1 -1
  298. package/UseCases/SortItems/index.js +2 -27
  299. package/UseCases/SortItems/index.js.map +1 -1
  300. package/UseCases/UnSelectAllItems/IUnselectAllItemsUseCase.js +1 -5
  301. package/UseCases/UnSelectAllItems/UnselectAllItemsUseCase.js +8 -21
  302. package/UseCases/UnSelectAllItems/UnselectAllItemsUseCase.js.map +1 -1
  303. package/UseCases/UnSelectAllItems/index.js +2 -27
  304. package/UseCases/UnSelectAllItems/index.js.map +1 -1
  305. package/UseCases/index.js +11 -126
  306. package/UseCases/index.js.map +1 -1
  307. package/index.js +3 -38
  308. package/index.js.map +1 -1
  309. package/package.json +11 -11
  310. package/types.js +1 -7
  311. package/types.js.map +1 -1
  312. package/Presentation/components/BottomInfoBar/BottomInfoBar.styled.d.ts +0 -21
  313. package/Presentation/components/BottomInfoBar/BottomInfoBar.styled.js +0 -81
  314. package/Presentation/components/BottomInfoBar/BottomInfoBar.styled.js.map +0 -1
  315. package/Presentation/components/BulkActions/BulkActions/BulkActions.styled.d.ts +0 -13
  316. package/Presentation/components/BulkActions/BulkActions/BulkActions.styled.js +0 -46
  317. package/Presentation/components/BulkActions/BulkActions/BulkActions.styled.js.map +0 -1
  318. package/Presentation/components/BulkActions/RestoreItems/RestoredItems.styled.d.ts +0 -5
  319. package/Presentation/components/BulkActions/RestoreItems/RestoredItems.styled.js +0 -25
  320. package/Presentation/components/BulkActions/RestoreItems/RestoredItems.styled.js.map +0 -1
  321. package/Presentation/components/Cells/CellTitle/CellTitle.styled.d.ts +0 -12
  322. package/Presentation/components/Cells/CellTitle/CellTitle.styled.js +0 -54
  323. package/Presentation/components/Cells/CellTitle/CellTitle.styled.js.map +0 -1
  324. package/Presentation/components/Empty/Empty.styled.d.ts +0 -9
  325. package/Presentation/components/Empty/Empty.styled.js +0 -39
  326. package/Presentation/components/Empty/Empty.styled.js.map +0 -1
  327. package/Presentation/components/SearchInput/SearchInput.styled.d.ts +0 -11
  328. package/Presentation/components/SearchInput/SearchInput.styled.js +0 -55
  329. package/Presentation/components/SearchInput/SearchInput.styled.js.map +0 -1
  330. package/Presentation/components/SelectAll/Messages.d.ts +0 -7
  331. package/Presentation/components/SelectAll/Messages.js +0 -29
  332. package/Presentation/components/SelectAll/Messages.js.map +0 -1
  333. package/Presentation/components/SelectAll/SelectAll.d.ts +0 -3
  334. package/Presentation/components/SelectAll/SelectAll.js +0 -35
  335. package/Presentation/components/SelectAll/SelectAll.js.map +0 -1
  336. package/Presentation/components/SelectAll/SelectAll.styled.d.ts +0 -12
  337. package/Presentation/components/SelectAll/SelectAll.styled.js +0 -54
  338. package/Presentation/components/SelectAll/SelectAll.styled.js.map +0 -1
  339. package/Presentation/components/SelectAll/index.d.ts +0 -1
  340. package/Presentation/components/SelectAll/index.js +0 -18
  341. package/Presentation/components/SelectAll/index.js.map +0 -1
  342. package/Presentation/components/Title/Title.styled.d.ts +0 -4
  343. package/Presentation/components/Title/Title.styled.js +0 -26
  344. package/Presentation/components/Title/Title.styled.js.map +0 -1
@@ -1,75 +1,59 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
- var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
5
- var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
6
- var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
7
- var _TrashBinPresenter = require("./TrashBinPresenter");
8
- var _appUtils = require("@webiny/app-utils");
9
- var _types = require("../../types");
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
- var identity2 = {
14
+ const identity2 = {
21
15
  id: "5678",
22
16
  displayName: "Jane Doe",
23
17
  type: "admin"
24
18
  };
25
- var createBinListGateway = function createBinListGateway(_ref) {
26
- var execute = _ref.execute;
27
- return {
28
- execute: execute
29
- };
30
- };
31
- var createBinDeleteItemGateway = function createBinDeleteItemGateway(_ref2) {
32
- var execute = _ref2.execute;
33
- return {
34
- execute: execute
35
- };
36
- };
37
- var createBinRestoreItemGateway = function createBinRestoreItemGateway(_ref3) {
38
- var execute = _ref3.execute;
39
- return {
40
- execute: execute
41
- };
42
- };
43
- var createBinBulkActionsGateway = function createBinBulkActionsGateway(_ref4) {
44
- var execute = _ref4.execute;
45
- return {
46
- execute: execute
47
- };
48
- };
49
- var CustomItemMapper = /*#__PURE__*/function () {
50
- function CustomItemMapper() {
51
- (0, _classCallCheck2.default)(this, CustomItemMapper);
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
- return (0, _createClass2.default)(CustomItemMapper, [{
54
- key: "toDTO",
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", function () {
72
- var item1 = {
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
- var item2 = {
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
- var item3 = {
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
- var item4 = {
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
- var listGateway = createBinListGateway({
117
- execute: jest.fn().mockImplementation(function () {
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
- var deleteItemGateway = createBinDeleteItemGateway({
126
- execute: jest.fn().mockImplementation(function () {
109
+ const deleteItemGateway = createBinDeleteItemGateway({
110
+ execute: jest.fn().mockImplementation(() => {
127
111
  return Promise.resolve(true);
128
112
  })
129
113
  });
130
- var restoreItemGateway = createBinRestoreItemGateway({
131
- execute: jest.fn().mockImplementation(function () {
114
+ const restoreItemGateway = createBinRestoreItemGateway({
115
+ execute: jest.fn().mockImplementation(() => {
132
116
  return Promise.resolve(item1);
133
117
  })
134
118
  });
135
- var bulkActionGateway = createBinBulkActionsGateway({
136
- execute: jest.fn().mockImplementation(function () {
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
- var itemMapper = new CustomItemMapper();
143
- var BulkActionDeleteItems = "BulkDeleteItems";
144
- var BulkActionRestoreItems = "BulkRestoreItems";
145
- var init = function init(listGateway, deleteItemGateway, restoreItemGateway) {
146
- var retentionPeriod = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 90;
147
- var selectedRepo = new _SelectedItems.SelectedItemsRepository();
148
- var loadingRepo = new _appUtils.LoadingRepository();
149
- var sortRepo = new _appUtils.SortingRepository();
150
- var sortRepoWithDefaults = new _Sorting.SortingRepositoryWithDefaults(defaultSorting, sortRepo);
151
- var metaRepo = new _appUtils.MetaRepository();
152
- var searchRepo = new _Search.SearchRepository();
153
- var trashBinItemsRepo = new _TrashBinItems.TrashBinItemsRepository(metaRepo, listGateway, deleteItemGateway, restoreItemGateway, bulkActionGateway, itemMapper);
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 _TrashBinPresenter.TrashBinPresenter(itemsRepo, selectedRepo, sortRepoWithDefaults, searchRepo, retentionPeriod),
157
- controllers: new _TrashBinControllers.TrashBinControllers(itemsRepo, selectedRepo, sortRepoWithDefaults, searchRepo, BulkActionDeleteItems, BulkActionRestoreItems).getControllers()
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(function () {
143
+ beforeEach(() => {
161
144
  jest.clearAllMocks();
162
145
  });
163
- it("should create a presenter and list trash bin entries from the gateway", async function () {
164
- var _init = init(listGateway, deleteItemGateway, restoreItemGateway),
165
- presenter = _init.presenter,
166
- controllers = _init.controllers;
167
- var listPromise = controllers.listItems.execute();
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: (0, _defineProperty2.default)({}, _types.LoadingActions.list, true)
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: (0, _defineProperty2.default)({}, _types.LoadingActions.list, false)
188
+ loading: {
189
+ [LoadingActions.list]: false
190
+ }
203
191
  });
204
192
  });
205
- it("should list more items from the gateway", async function () {
206
- var listGateway = createBinListGateway({
207
- execute: jest.fn().mockImplementationOnce(function () {
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(function () {
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
- var _init2 = init(listGateway, deleteItemGateway, restoreItemGateway),
222
- presenter = _init2.presenter,
223
- controllers = _init2.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
- var listMorePromise = controllers.listMoreItems.execute();
219
+ const listMorePromise = controllers.listMoreItems.execute();
231
220
  expect(presenter.vm).toMatchObject({
232
- loading: (0, _defineProperty2.default)({}, _types.LoadingActions.listMore, true)
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: (0, _defineProperty2.default)({}, _types.LoadingActions.listMore, false)
262
+ loading: {
263
+ [LoadingActions.listMore]: false
264
+ }
272
265
  });
273
266
  });
274
- it("should be able to sort items", async function () {
275
- var sortListGateway = createBinListGateway({
276
- execute: jest.fn().mockImplementationOnce(function () {
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(function () {
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
- var _init3 = init(sortListGateway, deleteItemGateway, restoreItemGateway),
291
- presenter = _init3.presenter,
292
- controllers = _init3.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(function () {
302
- return [{
303
- id: "deletedOn",
304
- desc: false
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: (0, _defineProperty2.default)({}, _types.LoadingActions.list, false),
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 function () {
341
- var searchItemsGateway = createBinListGateway({
342
- execute: jest.fn().mockImplementationOnce(function () {
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(function () {
342
+ }).mockImplementationOnce(() => {
349
343
  return Promise.resolve([[item1], {
350
344
  totalCount: 1,
351
345
  cursor: null,
352
346
  hasMoreItems: false
353
347
  }]);
354
- }).mockImplementationOnce(function () {
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
- var _init4 = init(searchItemsGateway, deleteItemGateway, restoreItemGateway),
363
- presenter = _init4.presenter,
364
- controllers = _init4.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: (0, _defineProperty2.default)({}, _types.LoadingActions.list, false),
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: (0, _defineProperty2.default)({}, _types.LoadingActions.list, false),
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 function () {
405
- var _init5 = init(listGateway, deleteItemGateway, restoreItemGateway),
406
- presenter = _init5.presenter,
407
- controllers = _init5.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 function () {
490
- var _init6 = init(listGateway, deleteItemGateway, restoreItemGateway),
491
- presenter = _init6.presenter,
492
- controllers = _init6.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
- var deletePromise = controllers.deleteItem.execute(item1.id);
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: (0, _defineProperty2.default)({}, _types.LoadingActions.delete, true)
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 function () {
564
- var _init7 = init(listGateway, deleteItemGateway, restoreItemGateway),
565
- presenter = _init7.presenter,
566
- controllers = _init7.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
- var restorePromise = controllers.restoreItem.execute(item1.id);
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: (0, _defineProperty2.default)({}, _types.LoadingActions.restore, true)
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
- var restoredItem = await controllers.getRestoredItemById.execute("item-1");
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`", function (input, output) {
663
- var _init8 = init(listGateway, deleteItemGateway, restoreItemGateway, input),
664
- presenter = _init8.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 function () {
670
- var _init9 = init(listGateway, deleteItemGateway, restoreItemGateway),
671
- controllers = _init9.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
- var restoreBulkActionPromise = controllers.restoreBulkAction.execute({
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 function () {
699
- var _init10 = init(listGateway, deleteItemGateway, restoreItemGateway),
700
- controllers = _init10.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
- var deleteBulkActionPromise = controllers.deleteBulkAction.execute({
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 function () {
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
- var _listGateway = createBinListGateway({
731
- execute: jest.fn().mockImplementation(function () {
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
- var _init11 = init(_listGateway, deleteItemGateway, restoreItemGateway),
740
- presenter = _init11.presenter,
741
- controllers = _init11.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(_listGateway.execute).toHaveBeenCalledTimes(1);
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
- var _listGateway2 = createBinListGateway({
783
- execute: jest.fn().mockImplementation(function () {
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
- var _init12 = init(_listGateway2, deleteItemGateway, restoreItemGateway),
792
- _presenter = _init12.presenter,
793
- _controllers = _init12.controllers;
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 _controllers.listItems.execute();
797
- expect(_listGateway2.execute).toHaveBeenCalledTimes(1);
807
+ await controllers.listItems.execute();
808
+ expect(listGateway.execute).toHaveBeenCalledTimes(1);
798
809
 
799
810
  // let's check the initial vm state
800
- expect(_presenter.vm.items.length).toBe(3);
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 _controllers.selectItems.execute([item1, item2, item3]);
804
- expect(_presenter.vm.selectedItems.length).toBe(3);
805
- expect(_presenter.vm.allowSelectAll).toBeFalsy();
806
- expect(_presenter.vm.isSelectedAll).toBeFalsy();
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
  });