@webiny/app-scheduler 6.4.11 → 6.6.0-alpha.1

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 (538) hide show
  1. package/{Gateways/schema → domain}/schedulerEntry.d.ts +1 -1
  2. package/{Gateways/schema → domain}/schedulerEntry.js +1 -1
  3. package/domain/schedulerEntry.js.map +1 -0
  4. package/features/cancelScheduledAction/CancelScheduledActionGateway.d.ts +11 -0
  5. package/features/cancelScheduledAction/CancelScheduledActionGateway.js +41 -0
  6. package/features/cancelScheduledAction/CancelScheduledActionGateway.js.map +1 -0
  7. package/features/cancelScheduledAction/abstractions.d.ts +11 -0
  8. package/features/cancelScheduledAction/abstractions.js +5 -0
  9. package/features/cancelScheduledAction/abstractions.js.map +1 -0
  10. package/features/cancelScheduledAction/feature.d.ts +1 -0
  11. package/features/cancelScheduledAction/feature.js +11 -0
  12. package/features/cancelScheduledAction/feature.js.map +1 -0
  13. package/features/feature.d.ts +1 -0
  14. package/features/feature.js +19 -0
  15. package/features/feature.js.map +1 -0
  16. package/features/getScheduledAction/GetScheduledActionGateway.d.ts +11 -0
  17. package/features/getScheduledAction/GetScheduledActionGateway.js +57 -0
  18. package/features/getScheduledAction/GetScheduledActionGateway.js.map +1 -0
  19. package/{Gateways/abstractions/GetScheduledActionGateway.d.ts → features/getScheduledAction/abstractions.d.ts} +4 -0
  20. package/features/getScheduledAction/abstractions.js +5 -0
  21. package/features/getScheduledAction/abstractions.js.map +1 -0
  22. package/features/getScheduledAction/feature.d.ts +1 -0
  23. package/features/getScheduledAction/feature.js +11 -0
  24. package/features/getScheduledAction/feature.js.map +1 -0
  25. package/features/graphqlFields.d.ts +2 -0
  26. package/features/graphqlFields.js +23 -0
  27. package/features/graphqlFields.js.map +1 -0
  28. package/features/listScheduledActions/ListScheduledActionsGateway.d.ts +11 -0
  29. package/features/listScheduledActions/ListScheduledActionsGateway.js +84 -0
  30. package/features/listScheduledActions/ListScheduledActionsGateway.js.map +1 -0
  31. package/{Gateways/abstractions/ListScheduledActionsGateway.d.ts → features/listScheduledActions/abstractions.d.ts} +5 -2
  32. package/features/listScheduledActions/abstractions.js +5 -0
  33. package/features/listScheduledActions/abstractions.js.map +1 -0
  34. package/features/listScheduledActions/feature.d.ts +1 -0
  35. package/features/listScheduledActions/feature.js +11 -0
  36. package/features/listScheduledActions/feature.js.map +1 -0
  37. package/features/schedulePublishAction/SchedulePublishActionGateway.d.ts +11 -0
  38. package/features/schedulePublishAction/SchedulePublishActionGateway.js +67 -0
  39. package/features/schedulePublishAction/SchedulePublishActionGateway.js.map +1 -0
  40. package/{Gateways/abstractions/SchedulePublishActionGateway.d.ts → features/schedulePublishAction/abstractions.d.ts} +4 -0
  41. package/features/schedulePublishAction/abstractions.js +5 -0
  42. package/features/schedulePublishAction/abstractions.js.map +1 -0
  43. package/features/schedulePublishAction/feature.d.ts +1 -0
  44. package/features/schedulePublishAction/feature.js +11 -0
  45. package/features/schedulePublishAction/feature.js.map +1 -0
  46. package/features/scheduleUnpublishAction/ScheduleUnpublishActionGateway.d.ts +11 -0
  47. package/features/scheduleUnpublishAction/ScheduleUnpublishActionGateway.js +71 -0
  48. package/features/scheduleUnpublishAction/ScheduleUnpublishActionGateway.js.map +1 -0
  49. package/{Gateways/abstractions/ScheduleUnpublishActionGateway.d.ts → features/scheduleUnpublishAction/abstractions.d.ts} +4 -0
  50. package/features/scheduleUnpublishAction/abstractions.js +5 -0
  51. package/features/scheduleUnpublishAction/abstractions.js.map +1 -0
  52. package/features/scheduleUnpublishAction/feature.d.ts +1 -0
  53. package/features/scheduleUnpublishAction/feature.js +11 -0
  54. package/features/scheduleUnpublishAction/feature.js.map +1 -0
  55. package/index.d.ts +9 -1
  56. package/index.js +17 -1
  57. package/index.js.map +1 -0
  58. package/package.json +17 -18
  59. package/{Presentation → presentation}/SchedulerConfigs/SchedulerConfigs.js.map +1 -1
  60. package/{Presentation → presentation}/components/Actions/CancelItem/CancelItem.js +2 -3
  61. package/presentation/components/Actions/CancelItem/CancelItem.js.map +1 -0
  62. package/{Presentation → presentation}/components/BottomInfoBar/BottomInfoBar.styled.js.map +1 -1
  63. package/{Presentation → presentation}/components/BottomInfoBar/ListMeta.js.map +1 -1
  64. package/{Presentation → presentation}/components/BottomInfoBar/ListStatus.js.map +1 -1
  65. package/{Presentation → presentation}/components/Cells/CellActions/CellActions.js.map +1 -1
  66. package/{Presentation → presentation}/components/Cells/CellRevision/CellRevision.js.map +1 -1
  67. package/{Presentation → presentation}/components/Cells/CellRevision/CellRevision.styled.js.map +1 -1
  68. package/{Presentation → presentation}/components/Cells/CellScheduledBy/CellScheduledBy.js.map +1 -1
  69. package/{Presentation → presentation}/components/Cells/CellScheduledOn/CellScheduledOn.js +3 -1
  70. package/presentation/components/Cells/CellScheduledOn/CellScheduledOn.js.map +1 -0
  71. package/{Presentation → presentation}/components/Cells/CellTitle/CellTitle.js.map +1 -1
  72. package/{Presentation → presentation}/components/Cells/CellTitle/CellTitle.styled.js.map +1 -1
  73. package/{Presentation → presentation}/components/Cells/CellType/CellActionType.js.map +1 -1
  74. package/{Presentation → presentation}/components/Cells/CellType/CellActionType.styled.js.map +1 -1
  75. package/{Presentation → presentation}/components/Empty/Empty.styled.js.map +1 -1
  76. package/{Presentation → presentation}/components/Title/Title.js.map +1 -1
  77. package/{Presentation → presentation}/components/Title/Title.styled.js.map +1 -1
  78. package/{Presentation → presentation}/configs/list/Browser/EntryAction.d.ts +2 -1
  79. package/{Presentation → presentation}/configs/list/Browser/EntryAction.js.map +1 -1
  80. package/{Presentation → presentation}/configs/list/Browser/Table/Column.d.ts +4 -3
  81. package/{Presentation → presentation}/configs/list/Browser/Table/Column.js.map +1 -1
  82. package/{Presentation → presentation}/configs/list/Browser/Table/Sorting.js.map +1 -1
  83. package/presentation/configs/list/Browser/Table/index.d.ts +19 -0
  84. package/{Presentation → presentation}/configs/list/Browser/Table/index.js.map +1 -1
  85. package/presentation/configs/list/Browser/index.d.ts +23 -0
  86. package/{Presentation → presentation}/configs/list/Browser/index.js.map +1 -1
  87. package/{Presentation → presentation}/configs/list/SchedulerListConfig.d.ts +8 -6
  88. package/{Presentation → presentation}/configs/list/SchedulerListConfig.js.map +1 -1
  89. package/{Presentation → presentation}/hooks/index.d.ts +0 -1
  90. package/{Presentation → presentation}/hooks/index.js +0 -1
  91. package/{Presentation → presentation}/hooks/useCancelSchedulerItem.js +12 -7
  92. package/presentation/hooks/useCancelSchedulerItem.js.map +1 -0
  93. package/{Presentation → presentation}/hooks/useSchedulerItem.js.map +1 -1
  94. package/presentation/scheduleDialog/ScheduleDialogPresenter.d.ts +26 -0
  95. package/{Presentation/components/ScheduleDialog → presentation/scheduleDialog}/ScheduleDialogPresenter.js +38 -9
  96. package/presentation/scheduleDialog/ScheduleDialogPresenter.js.map +1 -0
  97. package/{Presentation/components/ScheduleDialog/IScheduleDialogPresenter.d.ts → presentation/scheduleDialog/abstractions.d.ts} +10 -1
  98. package/presentation/scheduleDialog/abstractions.js +5 -0
  99. package/presentation/scheduleDialog/abstractions.js.map +1 -0
  100. package/presentation/scheduleDialog/components/CancelButtonComponent.d.ts +10 -0
  101. package/presentation/scheduleDialog/components/CancelButtonComponent.js +20 -0
  102. package/presentation/scheduleDialog/components/CancelButtonComponent.js.map +1 -0
  103. package/presentation/scheduleDialog/components/FormComponent.d.ts +9 -0
  104. package/presentation/scheduleDialog/components/FormComponent.js +32 -0
  105. package/presentation/scheduleDialog/components/FormComponent.js.map +1 -0
  106. package/presentation/scheduleDialog/components/ReschedulingAlert.d.ts +7 -0
  107. package/presentation/scheduleDialog/components/ReschedulingAlert.js +14 -0
  108. package/presentation/scheduleDialog/components/ReschedulingAlert.js.map +1 -0
  109. package/{Presentation/components/ScheduleDialog/useScheduleDialog.d.ts → presentation/scheduleDialog/components/SchedulerDialogFormComponentDateTimeInput.d.ts} +1 -18
  110. package/presentation/scheduleDialog/components/SchedulerDialogFormComponentDateTimeInput.js +15 -0
  111. package/presentation/scheduleDialog/components/SchedulerDialogFormComponentDateTimeInput.js.map +1 -0
  112. package/presentation/scheduleDialog/createMinDateValidator.d.ts +7 -0
  113. package/presentation/scheduleDialog/createMinDateValidator.js +14 -0
  114. package/presentation/scheduleDialog/createMinDateValidator.js.map +1 -0
  115. package/presentation/scheduleDialog/feature.d.ts +3 -0
  116. package/presentation/scheduleDialog/feature.js +17 -0
  117. package/presentation/scheduleDialog/feature.js.map +1 -0
  118. package/presentation/scheduleDialog/useScheduleDialog.d.ts +20 -0
  119. package/presentation/scheduleDialog/useScheduleDialog.js +128 -0
  120. package/presentation/scheduleDialog/useScheduleDialog.js.map +1 -0
  121. package/{Presentation/index.d.ts → presentation/schedulerList/Scheduler.d.ts} +2 -9
  122. package/presentation/schedulerList/Scheduler.js +28 -0
  123. package/presentation/schedulerList/Scheduler.js.map +1 -0
  124. package/presentation/schedulerList/SchedulerListDataSource.d.ts +15 -0
  125. package/presentation/schedulerList/SchedulerListDataSource.js +41 -0
  126. package/presentation/schedulerList/SchedulerListDataSource.js.map +1 -0
  127. package/presentation/schedulerList/SchedulerListPresenter.d.ts +21 -0
  128. package/presentation/schedulerList/SchedulerListPresenter.js +47 -0
  129. package/presentation/schedulerList/SchedulerListPresenter.js.map +1 -0
  130. package/presentation/schedulerList/abstractions.d.ts +13 -0
  131. package/presentation/schedulerList/abstractions.js +5 -0
  132. package/presentation/schedulerList/abstractions.js.map +1 -0
  133. package/presentation/schedulerList/components/BottomInfoBar.d.ts +9 -0
  134. package/presentation/schedulerList/components/BottomInfoBar.js +18 -0
  135. package/presentation/schedulerList/components/BottomInfoBar.js.map +1 -0
  136. package/presentation/schedulerList/components/Empty.d.ts +9 -0
  137. package/{Presentation/components/Empty → presentation/schedulerList/components}/Empty.js +6 -6
  138. package/presentation/schedulerList/components/Empty.js.map +1 -0
  139. package/presentation/schedulerList/components/SchedulerListView.d.ts +8 -0
  140. package/presentation/schedulerList/components/SchedulerListView.js +40 -0
  141. package/presentation/schedulerList/components/SchedulerListView.js.map +1 -0
  142. package/presentation/schedulerList/components/SchedulerOverlay.d.ts +11 -0
  143. package/presentation/schedulerList/components/SchedulerOverlay.js +38 -0
  144. package/presentation/schedulerList/components/SchedulerOverlay.js.map +1 -0
  145. package/presentation/schedulerList/components/SchedulerTable.d.ts +9 -0
  146. package/presentation/schedulerList/components/SchedulerTable.js +48 -0
  147. package/presentation/schedulerList/components/SchedulerTable.js.map +1 -0
  148. package/presentation/schedulerList/components/SearchInput.d.ts +9 -0
  149. package/{Presentation/components/SearchInput → presentation/schedulerList/components}/SearchInput.js +8 -8
  150. package/presentation/schedulerList/components/SearchInput.js.map +1 -0
  151. package/presentation/schedulerList/feature.d.ts +3 -0
  152. package/presentation/schedulerList/feature.js +17 -0
  153. package/presentation/schedulerList/feature.js.map +1 -0
  154. package/presentation/schedulerList/useSchedulerListPresenter.d.ts +1 -0
  155. package/presentation/schedulerList/useSchedulerListPresenter.js +6 -0
  156. package/presentation/schedulerList/useSchedulerListPresenter.js.map +1 -0
  157. package/types.d.ts +0 -7
  158. package/types.js +1 -9
  159. package/types.js.map +1 -1
  160. package/Domain/Models/SchedulerItem/SchedulerItem.d.ts +0 -13
  161. package/Domain/Models/SchedulerItem/SchedulerItem.js +0 -18
  162. package/Domain/Models/SchedulerItem/SchedulerItem.js.map +0 -1
  163. package/Domain/Models/SchedulerItem/index.d.ts +0 -1
  164. package/Domain/Models/SchedulerItem/index.js +0 -1
  165. package/Domain/Models/index.d.ts +0 -1
  166. package/Domain/Models/index.js +0 -1
  167. package/Domain/Repositories/SchedulerItems/ISchedulerItemsRepository.d.ts +0 -14
  168. package/Domain/Repositories/SchedulerItems/ISchedulerItemsRepository.js +0 -0
  169. package/Domain/Repositories/SchedulerItems/SchedulerItemsRepository.d.ts +0 -36
  170. package/Domain/Repositories/SchedulerItems/SchedulerItemsRepository.js +0 -119
  171. package/Domain/Repositories/SchedulerItems/SchedulerItemsRepository.js.map +0 -1
  172. package/Domain/Repositories/SchedulerItems/SchedulerItemsRepositoryFactory.d.ts +0 -19
  173. package/Domain/Repositories/SchedulerItems/SchedulerItemsRepositoryFactory.js +0 -18
  174. package/Domain/Repositories/SchedulerItems/SchedulerItemsRepositoryFactory.js.map +0 -1
  175. package/Domain/Repositories/SchedulerItems/SchedulerItemsRepositoryWithLoading.d.ts +0 -17
  176. package/Domain/Repositories/SchedulerItems/SchedulerItemsRepositoryWithLoading.js +0 -39
  177. package/Domain/Repositories/SchedulerItems/SchedulerItemsRepositoryWithLoading.js.map +0 -1
  178. package/Domain/Repositories/SchedulerItems/index.d.ts +0 -4
  179. package/Domain/Repositories/SchedulerItems/index.js +0 -3
  180. package/Domain/Repositories/Search/ISearchRepository.d.ts +0 -4
  181. package/Domain/Repositories/Search/ISearchRepository.js +0 -0
  182. package/Domain/Repositories/Search/SearchRepository.d.ts +0 -7
  183. package/Domain/Repositories/Search/SearchRepository.js +0 -16
  184. package/Domain/Repositories/Search/SearchRepository.js.map +0 -1
  185. package/Domain/Repositories/Search/SearchRepositoryFactory.d.ts +0 -7
  186. package/Domain/Repositories/Search/SearchRepositoryFactory.js +0 -18
  187. package/Domain/Repositories/Search/SearchRepositoryFactory.js.map +0 -1
  188. package/Domain/Repositories/Search/index.d.ts +0 -3
  189. package/Domain/Repositories/Search/index.js +0 -2
  190. package/Domain/Repositories/SelectedItems/ISelectedItemsRepository.d.ts +0 -8
  191. package/Domain/Repositories/SelectedItems/ISelectedItemsRepository.js +0 -0
  192. package/Domain/Repositories/SelectedItems/SelectedItemsRepository.d.ts +0 -12
  193. package/Domain/Repositories/SelectedItems/SelectedItemsRepository.js +0 -28
  194. package/Domain/Repositories/SelectedItems/SelectedItemsRepository.js.map +0 -1
  195. package/Domain/Repositories/SelectedItems/SelectedItemsRepositoryFactory.d.ts +0 -7
  196. package/Domain/Repositories/SelectedItems/SelectedItemsRepositoryFactory.js +0 -18
  197. package/Domain/Repositories/SelectedItems/SelectedItemsRepositoryFactory.js.map +0 -1
  198. package/Domain/Repositories/SelectedItems/index.d.ts +0 -3
  199. package/Domain/Repositories/SelectedItems/index.js +0 -2
  200. package/Domain/Repositories/Sorting/SortingRepositoryWithDefaults.d.ts +0 -8
  201. package/Domain/Repositories/Sorting/SortingRepositoryWithDefaults.js +0 -21
  202. package/Domain/Repositories/Sorting/SortingRepositoryWithDefaults.js.map +0 -1
  203. package/Domain/Repositories/Sorting/index.d.ts +0 -1
  204. package/Domain/Repositories/Sorting/index.js +0 -1
  205. package/Domain/Repositories/index.d.ts +0 -4
  206. package/Domain/Repositories/index.js +0 -4
  207. package/Domain/index.d.ts +0 -2
  208. package/Domain/index.js +0 -2
  209. package/Gateways/SchedulerCancelGraphQLGateway.d.ts +0 -7
  210. package/Gateways/SchedulerCancelGraphQLGateway.js +0 -42
  211. package/Gateways/SchedulerCancelGraphQLGateway.js.map +0 -1
  212. package/Gateways/SchedulerGetGraphQLGateway.d.ts +0 -21
  213. package/Gateways/SchedulerGetGraphQLGateway.js +0 -68
  214. package/Gateways/SchedulerGetGraphQLGateway.js.map +0 -1
  215. package/Gateways/SchedulerListGraphQLGateway.d.ts +0 -7
  216. package/Gateways/SchedulerListGraphQLGateway.js +0 -86
  217. package/Gateways/SchedulerListGraphQLGateway.js.map +0 -1
  218. package/Gateways/SchedulerPublishGraphQLGateway.d.ts +0 -7
  219. package/Gateways/SchedulerPublishGraphQLGateway.js +0 -59
  220. package/Gateways/SchedulerPublishGraphQLGateway.js.map +0 -1
  221. package/Gateways/SchedulerUnpublishGraphQLGateway.d.ts +0 -23
  222. package/Gateways/SchedulerUnpublishGraphQLGateway.js +0 -63
  223. package/Gateways/SchedulerUnpublishGraphQLGateway.js.map +0 -1
  224. package/Gateways/abstractions/CancelScheduledActionGateway.d.ts +0 -7
  225. package/Gateways/abstractions/CancelScheduledActionGateway.js +0 -0
  226. package/Gateways/abstractions/GetScheduledActionGateway.js +0 -0
  227. package/Gateways/abstractions/ListScheduledActionsGateway.js +0 -0
  228. package/Gateways/abstractions/SchedulePublishActionGateway.js +0 -0
  229. package/Gateways/abstractions/ScheduleUnpublishActionGateway.js +0 -0
  230. package/Gateways/graphql/fields.d.ts +0 -1
  231. package/Gateways/graphql/fields.js +0 -17
  232. package/Gateways/graphql/fields.js.map +0 -1
  233. package/Gateways/index.d.ts +0 -5
  234. package/Gateways/index.js +0 -0
  235. package/Gateways/schema/schedulerEntry.js.map +0 -1
  236. package/Presentation/Scheduler/Scheduler.d.ts +0 -17
  237. package/Presentation/Scheduler/Scheduler.js +0 -78
  238. package/Presentation/Scheduler/Scheduler.js.map +0 -1
  239. package/Presentation/Scheduler/SchedulerControllers.d.ts +0 -30
  240. package/Presentation/Scheduler/SchedulerControllers.js +0 -54
  241. package/Presentation/Scheduler/SchedulerControllers.js.map +0 -1
  242. package/Presentation/Scheduler/SchedulerPresenter.d.ts +0 -32
  243. package/Presentation/Scheduler/SchedulerPresenter.js +0 -45
  244. package/Presentation/Scheduler/SchedulerPresenter.js.map +0 -1
  245. package/Presentation/Scheduler/controllers/CancelItem/CancelItemController.d.ts +0 -7
  246. package/Presentation/Scheduler/controllers/CancelItem/CancelItemController.js +0 -12
  247. package/Presentation/Scheduler/controllers/CancelItem/CancelItemController.js.map +0 -1
  248. package/Presentation/Scheduler/controllers/CancelItem/ICancelItemController.d.ts +0 -3
  249. package/Presentation/Scheduler/controllers/CancelItem/ICancelItemController.js +0 -0
  250. package/Presentation/Scheduler/controllers/CancelItem/index.d.ts +0 -2
  251. package/Presentation/Scheduler/controllers/CancelItem/index.js +0 -1
  252. package/Presentation/Scheduler/controllers/GetItem/GetItemController.d.ts +0 -8
  253. package/Presentation/Scheduler/controllers/GetItem/GetItemController.js +0 -12
  254. package/Presentation/Scheduler/controllers/GetItem/GetItemController.js.map +0 -1
  255. package/Presentation/Scheduler/controllers/GetItem/IGetItemController.d.ts +0 -4
  256. package/Presentation/Scheduler/controllers/GetItem/IGetItemController.js +0 -0
  257. package/Presentation/Scheduler/controllers/GetItem/index.d.ts +0 -2
  258. package/Presentation/Scheduler/controllers/GetItem/index.js +0 -1
  259. package/Presentation/Scheduler/controllers/ListItems/IListItemsController.d.ts +0 -4
  260. package/Presentation/Scheduler/controllers/ListItems/IListItemsController.js +0 -0
  261. package/Presentation/Scheduler/controllers/ListItems/ListItemsController.d.ts +0 -8
  262. package/Presentation/Scheduler/controllers/ListItems/ListItemsController.js +0 -12
  263. package/Presentation/Scheduler/controllers/ListItems/ListItemsController.js.map +0 -1
  264. package/Presentation/Scheduler/controllers/ListItems/index.d.ts +0 -2
  265. package/Presentation/Scheduler/controllers/ListItems/index.js +0 -1
  266. package/Presentation/Scheduler/controllers/ListMoreItems/IListMoreItemsController.d.ts +0 -3
  267. package/Presentation/Scheduler/controllers/ListMoreItems/IListMoreItemsController.js +0 -0
  268. package/Presentation/Scheduler/controllers/ListMoreItems/ListMoreItemsController.d.ts +0 -7
  269. package/Presentation/Scheduler/controllers/ListMoreItems/ListMoreItemsController.js +0 -12
  270. package/Presentation/Scheduler/controllers/ListMoreItems/ListMoreItemsController.js.map +0 -1
  271. package/Presentation/Scheduler/controllers/ListMoreItems/index.d.ts +0 -2
  272. package/Presentation/Scheduler/controllers/ListMoreItems/index.js +0 -1
  273. package/Presentation/Scheduler/controllers/PublishItem/IPublishItemController.d.ts +0 -3
  274. package/Presentation/Scheduler/controllers/PublishItem/IPublishItemController.js +0 -0
  275. package/Presentation/Scheduler/controllers/PublishItem/PublishItemController.d.ts +0 -7
  276. package/Presentation/Scheduler/controllers/PublishItem/PublishItemController.js +0 -12
  277. package/Presentation/Scheduler/controllers/PublishItem/PublishItemController.js.map +0 -1
  278. package/Presentation/Scheduler/controllers/PublishItem/index.d.ts +0 -2
  279. package/Presentation/Scheduler/controllers/PublishItem/index.js +0 -1
  280. package/Presentation/Scheduler/controllers/SearchItems/ISearchItemsController.d.ts +0 -3
  281. package/Presentation/Scheduler/controllers/SearchItems/ISearchItemsController.js +0 -0
  282. package/Presentation/Scheduler/controllers/SearchItems/SearchItemsController.d.ts +0 -8
  283. package/Presentation/Scheduler/controllers/SearchItems/SearchItemsController.js +0 -15
  284. package/Presentation/Scheduler/controllers/SearchItems/SearchItemsController.js.map +0 -1
  285. package/Presentation/Scheduler/controllers/SearchItems/index.d.ts +0 -2
  286. package/Presentation/Scheduler/controllers/SearchItems/index.js +0 -1
  287. package/Presentation/Scheduler/controllers/SelectAllItems/ISelectAllItemsController.d.ts +0 -3
  288. package/Presentation/Scheduler/controllers/SelectAllItems/ISelectAllItemsController.js +0 -0
  289. package/Presentation/Scheduler/controllers/SelectAllItems/SelectAllItemsController.d.ts +0 -7
  290. package/Presentation/Scheduler/controllers/SelectAllItems/SelectAllItemsController.js +0 -12
  291. package/Presentation/Scheduler/controllers/SelectAllItems/SelectAllItemsController.js.map +0 -1
  292. package/Presentation/Scheduler/controllers/SelectAllItems/index.d.ts +0 -2
  293. package/Presentation/Scheduler/controllers/SelectAllItems/index.js +0 -1
  294. package/Presentation/Scheduler/controllers/SelectItems/ISelectItemsController.d.ts +0 -4
  295. package/Presentation/Scheduler/controllers/SelectItems/ISelectItemsController.js +0 -0
  296. package/Presentation/Scheduler/controllers/SelectItems/SelectItemsController.d.ts +0 -8
  297. package/Presentation/Scheduler/controllers/SelectItems/SelectItemsController.js +0 -14
  298. package/Presentation/Scheduler/controllers/SelectItems/SelectItemsController.js.map +0 -1
  299. package/Presentation/Scheduler/controllers/SelectItems/index.d.ts +0 -2
  300. package/Presentation/Scheduler/controllers/SelectItems/index.js +0 -1
  301. package/Presentation/Scheduler/controllers/SortItems/ISortItemsController.d.ts +0 -4
  302. package/Presentation/Scheduler/controllers/SortItems/ISortItemsController.js +0 -0
  303. package/Presentation/Scheduler/controllers/SortItems/SortItemsController.d.ts +0 -9
  304. package/Presentation/Scheduler/controllers/SortItems/SortItemsController.js +0 -18
  305. package/Presentation/Scheduler/controllers/SortItems/SortItemsController.js.map +0 -1
  306. package/Presentation/Scheduler/controllers/SortItems/index.d.ts +0 -2
  307. package/Presentation/Scheduler/controllers/SortItems/index.js +0 -1
  308. package/Presentation/Scheduler/controllers/UnpublishItem/IUnpublishItemController.d.ts +0 -3
  309. package/Presentation/Scheduler/controllers/UnpublishItem/IUnpublishItemController.js +0 -0
  310. package/Presentation/Scheduler/controllers/UnpublishItem/UnpublishItemController.d.ts +0 -7
  311. package/Presentation/Scheduler/controllers/UnpublishItem/UnpublishItemController.js +0 -12
  312. package/Presentation/Scheduler/controllers/UnpublishItem/UnpublishItemController.js.map +0 -1
  313. package/Presentation/Scheduler/controllers/UnpublishItem/index.d.ts +0 -2
  314. package/Presentation/Scheduler/controllers/UnpublishItem/index.js +0 -1
  315. package/Presentation/Scheduler/controllers/UnselectAllItems/IUnselectAllItemsController.d.ts +0 -3
  316. package/Presentation/Scheduler/controllers/UnselectAllItems/IUnselectAllItemsController.js +0 -0
  317. package/Presentation/Scheduler/controllers/UnselectAllItems/UnselectAllItemsController.d.ts +0 -7
  318. package/Presentation/Scheduler/controllers/UnselectAllItems/UnselectAllItemsController.js +0 -12
  319. package/Presentation/Scheduler/controllers/UnselectAllItems/UnselectAllItemsController.js.map +0 -1
  320. package/Presentation/Scheduler/controllers/UnselectAllItems/index.d.ts +0 -2
  321. package/Presentation/Scheduler/controllers/UnselectAllItems/index.js +0 -1
  322. package/Presentation/Scheduler/controllers/index.d.ts +0 -11
  323. package/Presentation/Scheduler/controllers/index.js +0 -11
  324. package/Presentation/Scheduler/index.d.ts +0 -1
  325. package/Presentation/Scheduler/index.js +0 -1
  326. package/Presentation/SchedulerRenderer/SchedulerRenderer.d.ts +0 -6
  327. package/Presentation/SchedulerRenderer/SchedulerRenderer.js +0 -16
  328. package/Presentation/SchedulerRenderer/SchedulerRenderer.js.map +0 -1
  329. package/Presentation/SchedulerRenderer/index.d.ts +0 -1
  330. package/Presentation/SchedulerRenderer/index.js +0 -1
  331. package/Presentation/abstractions/ISchedulerControllers.d.ts +0 -14
  332. package/Presentation/abstractions/ISchedulerControllers.js +0 -0
  333. package/Presentation/abstractions/ISchedulerPresenter.d.ts +0 -20
  334. package/Presentation/abstractions/ISchedulerPresenter.js +0 -0
  335. package/Presentation/abstractions/index.d.ts +0 -2
  336. package/Presentation/abstractions/index.js +0 -0
  337. package/Presentation/components/Actions/CancelItem/CancelItem.js.map +0 -1
  338. package/Presentation/components/BottomInfoBar/BottomInfoBar.d.ts +0 -2
  339. package/Presentation/components/BottomInfoBar/BottomInfoBar.js +0 -19
  340. package/Presentation/components/BottomInfoBar/BottomInfoBar.js.map +0 -1
  341. package/Presentation/components/BottomInfoBar/index.d.ts +0 -1
  342. package/Presentation/components/BottomInfoBar/index.js +0 -1
  343. package/Presentation/components/Cells/CellScheduledOn/CellScheduledOn.js.map +0 -1
  344. package/Presentation/components/Empty/Empty.d.ts +0 -2
  345. package/Presentation/components/Empty/Empty.js.map +0 -1
  346. package/Presentation/components/Empty/index.d.ts +0 -1
  347. package/Presentation/components/Empty/index.js +0 -1
  348. package/Presentation/components/ScheduleDialog/IScheduleDialogPresenter.js +0 -0
  349. package/Presentation/components/ScheduleDialog/ScheduleDialogPresenter.d.ts +0 -22
  350. package/Presentation/components/ScheduleDialog/ScheduleDialogPresenter.js.map +0 -1
  351. package/Presentation/components/ScheduleDialog/index.d.ts +0 -1
  352. package/Presentation/components/ScheduleDialog/index.js +0 -1
  353. package/Presentation/components/ScheduleDialog/types.d.ts +0 -15
  354. package/Presentation/components/ScheduleDialog/types.js +0 -0
  355. package/Presentation/components/ScheduleDialog/useScheduleDialog.js +0 -192
  356. package/Presentation/components/ScheduleDialog/useScheduleDialog.js.map +0 -1
  357. package/Presentation/components/SchedulerOverlay/SchedulerOverlay.d.ts +0 -7
  358. package/Presentation/components/SchedulerOverlay/SchedulerOverlay.js +0 -30
  359. package/Presentation/components/SchedulerOverlay/SchedulerOverlay.js.map +0 -1
  360. package/Presentation/components/SchedulerOverlay/index.d.ts +0 -1
  361. package/Presentation/components/SchedulerOverlay/index.js +0 -1
  362. package/Presentation/components/SearchInput/SearchInput.d.ts +0 -2
  363. package/Presentation/components/SearchInput/SearchInput.js.map +0 -1
  364. package/Presentation/components/SearchInput/index.d.ts +0 -1
  365. package/Presentation/components/SearchInput/index.js +0 -1
  366. package/Presentation/components/Table/Table.d.ts +0 -2
  367. package/Presentation/components/Table/Table.js +0 -29
  368. package/Presentation/components/Table/Table.js.map +0 -1
  369. package/Presentation/components/Table/index.d.ts +0 -1
  370. package/Presentation/components/Table/index.js +0 -1
  371. package/Presentation/configs/list/Browser/Table/index.d.ts +0 -18
  372. package/Presentation/configs/list/Browser/index.d.ts +0 -23
  373. package/Presentation/hooks/useCancelSchedulerItem.js.map +0 -1
  374. package/Presentation/hooks/useScheduler.d.ts +0 -28
  375. package/Presentation/hooks/useScheduler.js +0 -68
  376. package/Presentation/hooks/useScheduler.js.map +0 -1
  377. package/Presentation/index.js +0 -49
  378. package/Presentation/index.js.map +0 -1
  379. package/UseCases/CancelItem/CancelItemUseCase.d.ts +0 -7
  380. package/UseCases/CancelItem/CancelItemUseCase.js +0 -13
  381. package/UseCases/CancelItem/CancelItemUseCase.js.map +0 -1
  382. package/UseCases/CancelItem/ICancelItemUseCase.d.ts +0 -3
  383. package/UseCases/CancelItem/ICancelItemUseCase.js +0 -0
  384. package/UseCases/CancelItem/index.d.ts +0 -2
  385. package/UseCases/CancelItem/index.js +0 -1
  386. package/UseCases/GetItem/GetItemUseCase.d.ts +0 -8
  387. package/UseCases/GetItem/GetItemUseCase.js +0 -13
  388. package/UseCases/GetItem/GetItemUseCase.js.map +0 -1
  389. package/UseCases/GetItem/IGetItemUseCase.d.ts +0 -4
  390. package/UseCases/GetItem/IGetItemUseCase.js +0 -0
  391. package/UseCases/GetItem/index.d.ts +0 -2
  392. package/UseCases/GetItem/index.js +0 -1
  393. package/UseCases/GetScheduledItem/GetScheduledItemUseCase.d.ts +0 -7
  394. package/UseCases/GetScheduledItem/GetScheduledItemUseCase.js +0 -14
  395. package/UseCases/GetScheduledItem/GetScheduledItemUseCase.js.map +0 -1
  396. package/UseCases/GetScheduledItem/IGetScheduledItemUseCase.d.ts +0 -4
  397. package/UseCases/GetScheduledItem/IGetScheduledItemUseCase.js +0 -0
  398. package/UseCases/GetScheduledItem/index.d.ts +0 -2
  399. package/UseCases/GetScheduledItem/index.js +0 -1
  400. package/UseCases/ListItems/IListItemsUseCase.d.ts +0 -4
  401. package/UseCases/ListItems/IListItemsUseCase.js +0 -0
  402. package/UseCases/ListItems/ListItemsUseCase.d.ts +0 -8
  403. package/UseCases/ListItems/ListItemsUseCase.js +0 -13
  404. package/UseCases/ListItems/ListItemsUseCase.js.map +0 -1
  405. package/UseCases/ListItems/ListItemsUseCaseWithSearch.d.ts +0 -9
  406. package/UseCases/ListItems/ListItemsUseCaseWithSearch.js +0 -23
  407. package/UseCases/ListItems/ListItemsUseCaseWithSearch.js.map +0 -1
  408. package/UseCases/ListItems/ListItemsUseCaseWithSorting.d.ts +0 -9
  409. package/UseCases/ListItems/ListItemsUseCaseWithSorting.js +0 -21
  410. package/UseCases/ListItems/ListItemsUseCaseWithSorting.js.map +0 -1
  411. package/UseCases/ListItems/index.d.ts +0 -4
  412. package/UseCases/ListItems/index.js +0 -3
  413. package/UseCases/ListMoreItems/IListMoreItemsUseCase.d.ts +0 -3
  414. package/UseCases/ListMoreItems/IListMoreItemsUseCase.js +0 -0
  415. package/UseCases/ListMoreItems/ListMoreItemsUseCase.d.ts +0 -7
  416. package/UseCases/ListMoreItems/ListMoreItemsUseCase.js +0 -13
  417. package/UseCases/ListMoreItems/ListMoreItemsUseCase.js.map +0 -1
  418. package/UseCases/ListMoreItems/index.d.ts +0 -2
  419. package/UseCases/ListMoreItems/index.js +0 -1
  420. package/UseCases/PublishItem/IPublishItemUseCase.d.ts +0 -3
  421. package/UseCases/PublishItem/IPublishItemUseCase.js +0 -0
  422. package/UseCases/PublishItem/PublishItemUseCase.d.ts +0 -7
  423. package/UseCases/PublishItem/PublishItemUseCase.js +0 -13
  424. package/UseCases/PublishItem/PublishItemUseCase.js.map +0 -1
  425. package/UseCases/PublishItem/index.d.ts +0 -2
  426. package/UseCases/PublishItem/index.js +0 -1
  427. package/UseCases/SearchItems/ISearchItemsUseCase.d.ts +0 -3
  428. package/UseCases/SearchItems/ISearchItemsUseCase.js +0 -0
  429. package/UseCases/SearchItems/SearchItemsUseCase.d.ts +0 -7
  430. package/UseCases/SearchItems/SearchItemsUseCase.js +0 -13
  431. package/UseCases/SearchItems/SearchItemsUseCase.js.map +0 -1
  432. package/UseCases/SearchItems/index.d.ts +0 -2
  433. package/UseCases/SearchItems/index.js +0 -1
  434. package/UseCases/SelectAllItems/ISelectAllItemsUseCase.d.ts +0 -3
  435. package/UseCases/SelectAllItems/ISelectAllItemsUseCase.js +0 -0
  436. package/UseCases/SelectAllItems/SelectAllItemsUseCase.d.ts +0 -7
  437. package/UseCases/SelectAllItems/SelectAllItemsUseCase.js +0 -13
  438. package/UseCases/SelectAllItems/SelectAllItemsUseCase.js.map +0 -1
  439. package/UseCases/SelectAllItems/index.d.ts +0 -2
  440. package/UseCases/SelectAllItems/index.js +0 -1
  441. package/UseCases/SelectItems/ISelectItemsUseCase.d.ts +0 -4
  442. package/UseCases/SelectItems/ISelectItemsUseCase.js +0 -0
  443. package/UseCases/SelectItems/SelectItemsUseCase.d.ts +0 -7
  444. package/UseCases/SelectItems/SelectItemsUseCase.js +0 -13
  445. package/UseCases/SelectItems/SelectItemsUseCase.js.map +0 -1
  446. package/UseCases/SelectItems/index.d.ts +0 -2
  447. package/UseCases/SelectItems/index.js +0 -1
  448. package/UseCases/SortItems/ISortItemsUseCase.d.ts +0 -4
  449. package/UseCases/SortItems/ISortItemsUseCase.js +0 -0
  450. package/UseCases/SortItems/SortItemsUseCase.d.ts +0 -7
  451. package/UseCases/SortItems/SortItemsUseCase.js +0 -13
  452. package/UseCases/SortItems/SortItemsUseCase.js.map +0 -1
  453. package/UseCases/SortItems/index.d.ts +0 -2
  454. package/UseCases/SortItems/index.js +0 -1
  455. package/UseCases/UnSelectAllItems/IUnselectAllItemsUseCase.d.ts +0 -3
  456. package/UseCases/UnSelectAllItems/IUnselectAllItemsUseCase.js +0 -0
  457. package/UseCases/UnSelectAllItems/UnselectAllItemsUseCase.d.ts +0 -7
  458. package/UseCases/UnSelectAllItems/UnselectAllItemsUseCase.js +0 -13
  459. package/UseCases/UnSelectAllItems/UnselectAllItemsUseCase.js.map +0 -1
  460. package/UseCases/UnSelectAllItems/index.d.ts +0 -2
  461. package/UseCases/UnSelectAllItems/index.js +0 -1
  462. package/UseCases/UnpublishItem/IUnpublishItemUseCase.d.ts +0 -3
  463. package/UseCases/UnpublishItem/IUnpublishItemUseCase.js +0 -0
  464. package/UseCases/UnpublishItem/UnpublishItemUseCase.d.ts +0 -7
  465. package/UseCases/UnpublishItem/UnpublishItemUseCase.js +0 -13
  466. package/UseCases/UnpublishItem/UnpublishItemUseCase.js.map +0 -1
  467. package/UseCases/UnpublishItem/index.d.ts +0 -2
  468. package/UseCases/UnpublishItem/index.js +0 -1
  469. package/UseCases/index.d.ts +0 -11
  470. package/UseCases/index.js +0 -11
  471. /package/{Presentation → presentation}/SchedulerConfigs/SchedulerConfigs.d.ts +0 -0
  472. /package/{Presentation → presentation}/SchedulerConfigs/SchedulerConfigs.js +0 -0
  473. /package/{Presentation → presentation}/SchedulerConfigs/index.d.ts +0 -0
  474. /package/{Presentation → presentation}/SchedulerConfigs/index.js +0 -0
  475. /package/{Presentation → presentation}/components/Actions/CancelItem/CancelItem.d.ts +0 -0
  476. /package/{Presentation → presentation}/components/Actions/CancelItem/index.d.ts +0 -0
  477. /package/{Presentation → presentation}/components/Actions/CancelItem/index.js +0 -0
  478. /package/{Presentation → presentation}/components/Actions/index.d.ts +0 -0
  479. /package/{Presentation → presentation}/components/Actions/index.js +0 -0
  480. /package/{Presentation → presentation}/components/BottomInfoBar/BottomInfoBar.styled.d.ts +0 -0
  481. /package/{Presentation → presentation}/components/BottomInfoBar/BottomInfoBar.styled.js +0 -0
  482. /package/{Presentation → presentation}/components/BottomInfoBar/ListMeta.d.ts +0 -0
  483. /package/{Presentation → presentation}/components/BottomInfoBar/ListMeta.js +0 -0
  484. /package/{Presentation → presentation}/components/BottomInfoBar/ListStatus.d.ts +0 -0
  485. /package/{Presentation → presentation}/components/BottomInfoBar/ListStatus.js +0 -0
  486. /package/{Presentation → presentation}/components/Cells/CellActions/CellActions.d.ts +0 -0
  487. /package/{Presentation → presentation}/components/Cells/CellActions/CellActions.js +0 -0
  488. /package/{Presentation → presentation}/components/Cells/CellActions/index.d.ts +0 -0
  489. /package/{Presentation → presentation}/components/Cells/CellActions/index.js +0 -0
  490. /package/{Presentation → presentation}/components/Cells/CellRevision/CellRevision.d.ts +0 -0
  491. /package/{Presentation → presentation}/components/Cells/CellRevision/CellRevision.js +0 -0
  492. /package/{Presentation → presentation}/components/Cells/CellRevision/CellRevision.styled.d.ts +0 -0
  493. /package/{Presentation → presentation}/components/Cells/CellRevision/CellRevision.styled.js +0 -0
  494. /package/{Presentation → presentation}/components/Cells/CellRevision/index.d.ts +0 -0
  495. /package/{Presentation → presentation}/components/Cells/CellRevision/index.js +0 -0
  496. /package/{Presentation → presentation}/components/Cells/CellScheduledBy/CellScheduledBy.d.ts +0 -0
  497. /package/{Presentation → presentation}/components/Cells/CellScheduledBy/CellScheduledBy.js +0 -0
  498. /package/{Presentation → presentation}/components/Cells/CellScheduledBy/index.d.ts +0 -0
  499. /package/{Presentation → presentation}/components/Cells/CellScheduledBy/index.js +0 -0
  500. /package/{Presentation → presentation}/components/Cells/CellScheduledOn/CellScheduledOn.d.ts +0 -0
  501. /package/{Presentation → presentation}/components/Cells/CellScheduledOn/index.d.ts +0 -0
  502. /package/{Presentation → presentation}/components/Cells/CellScheduledOn/index.js +0 -0
  503. /package/{Presentation → presentation}/components/Cells/CellTitle/CellTitle.d.ts +0 -0
  504. /package/{Presentation → presentation}/components/Cells/CellTitle/CellTitle.js +0 -0
  505. /package/{Presentation → presentation}/components/Cells/CellTitle/CellTitle.styled.d.ts +0 -0
  506. /package/{Presentation → presentation}/components/Cells/CellTitle/CellTitle.styled.js +0 -0
  507. /package/{Presentation → presentation}/components/Cells/CellTitle/index.d.ts +0 -0
  508. /package/{Presentation → presentation}/components/Cells/CellTitle/index.js +0 -0
  509. /package/{Presentation → presentation}/components/Cells/CellType/CellActionType.d.ts +0 -0
  510. /package/{Presentation → presentation}/components/Cells/CellType/CellActionType.js +0 -0
  511. /package/{Presentation → presentation}/components/Cells/CellType/CellActionType.styled.d.ts +0 -0
  512. /package/{Presentation → presentation}/components/Cells/CellType/CellActionType.styled.js +0 -0
  513. /package/{Presentation → presentation}/components/Cells/CellType/index.d.ts +0 -0
  514. /package/{Presentation → presentation}/components/Cells/CellType/index.js +0 -0
  515. /package/{Presentation → presentation}/components/Cells/index.d.ts +0 -0
  516. /package/{Presentation → presentation}/components/Cells/index.js +0 -0
  517. /package/{Presentation → presentation}/components/Empty/Empty.styled.d.ts +0 -0
  518. /package/{Presentation → presentation}/components/Empty/Empty.styled.js +0 -0
  519. /package/{Presentation → presentation}/components/Title/Title.d.ts +0 -0
  520. /package/{Presentation → presentation}/components/Title/Title.js +0 -0
  521. /package/{Presentation → presentation}/components/Title/Title.styled.d.ts +0 -0
  522. /package/{Presentation → presentation}/components/Title/Title.styled.js +0 -0
  523. /package/{Presentation → presentation}/components/Title/index.d.ts +0 -0
  524. /package/{Presentation → presentation}/components/Title/index.js +0 -0
  525. /package/{Presentation → presentation}/configs/index.d.ts +0 -0
  526. /package/{Presentation → presentation}/configs/index.js +0 -0
  527. /package/{Presentation → presentation}/configs/list/Browser/EntryAction.js +0 -0
  528. /package/{Presentation → presentation}/configs/list/Browser/Table/Column.js +0 -0
  529. /package/{Presentation → presentation}/configs/list/Browser/Table/Sorting.d.ts +0 -0
  530. /package/{Presentation → presentation}/configs/list/Browser/Table/Sorting.js +0 -0
  531. /package/{Presentation → presentation}/configs/list/Browser/Table/index.js +0 -0
  532. /package/{Presentation → presentation}/configs/list/Browser/index.js +0 -0
  533. /package/{Presentation → presentation}/configs/list/SchedulerListConfig.js +0 -0
  534. /package/{Presentation → presentation}/configs/list/index.d.ts +0 -0
  535. /package/{Presentation → presentation}/configs/list/index.js +0 -0
  536. /package/{Presentation → presentation}/hooks/useCancelSchedulerItem.d.ts +0 -0
  537. /package/{Presentation → presentation}/hooks/useSchedulerItem.d.ts +0 -0
  538. /package/{Presentation → presentation}/hooks/useSchedulerItem.js +0 -0
@@ -0,0 +1,128 @@
1
+ import react, { useCallback, useMemo, useRef } from "react";
2
+ import { useContainer } from "@webiny/app";
3
+ import { useToast } from "@webiny/admin-ui";
4
+ import { useDialogs } from "@webiny/app-admin";
5
+ import { ScheduleActionType } from "../../types.js";
6
+ import { ScheduleDialogPresenter } from "./abstractions.js";
7
+ import { FormComponent } from "./components/FormComponent.js";
8
+ import { CancelButtonComponent } from "./components/CancelButtonComponent.js";
9
+ const useScheduleDialog = (props)=>{
10
+ const { target, namespace, onCompleted } = props;
11
+ const container = useContainer();
12
+ const dialog = useDialogs();
13
+ const toast = useToast();
14
+ const presenter = useMemo(()=>container.resolve(ScheduleDialogPresenter), [
15
+ container
16
+ ]);
17
+ const dialogClose = useRef(()=>{});
18
+ const onAccept = useCallback(async (params)=>{
19
+ const { scheduleOn, actionType } = params;
20
+ try {
21
+ await presenter.schedule({
22
+ targetId: target.id,
23
+ namespace,
24
+ scheduleOn,
25
+ actionType
26
+ });
27
+ toast.showSuccessToast({
28
+ title: `Scheduled ${actionType} action for "${target.title}"!`
29
+ });
30
+ onCompleted?.();
31
+ } catch (error) {
32
+ toast.showWarningToast({
33
+ title: error.message
34
+ });
35
+ console.error(error);
36
+ }
37
+ }, [
38
+ presenter.vm
39
+ ]);
40
+ const onCancel = useCallback(async ()=>{
41
+ const entry = presenter.vm.entry;
42
+ if (!entry) {
43
+ toast.showWarningToast({
44
+ title: `No scheduled action found for "${target.title}"!`
45
+ });
46
+ if (dialogClose.current) {
47
+ dialogClose.current();
48
+ dialogClose.current = null;
49
+ }
50
+ return;
51
+ }
52
+ if (dialogClose.current) {
53
+ dialogClose.current();
54
+ dialogClose.current = null;
55
+ }
56
+ try {
57
+ await presenter.cancel({
58
+ id: entry.id,
59
+ namespace: entry.namespace
60
+ });
61
+ toast.showSuccessToast({
62
+ title: `Canceled scheduled ${entry.actionType} on "${entry.title}"!`
63
+ });
64
+ onCompleted?.();
65
+ } catch (error) {
66
+ toast.showWarningToast({
67
+ title: error.message
68
+ });
69
+ }
70
+ }, [
71
+ presenter.vm
72
+ ]);
73
+ const showDialog = async ()=>{
74
+ const isPublished = "published" === target.status;
75
+ dialogClose.current = dialog.showDialog({
76
+ title: `Schedule "${target.title}"`,
77
+ content: /*#__PURE__*/ react.createElement(FormComponent, {
78
+ presenter: presenter
79
+ }),
80
+ formData: async ()=>{
81
+ await presenter.load({
82
+ namespace,
83
+ id: target.id
84
+ });
85
+ const entry = presenter.vm.entry;
86
+ const scheduleOn = entry?.publishOn || entry?.unpublishOn;
87
+ return {
88
+ scheduleOn
89
+ };
90
+ },
91
+ acceptLabel: isPublished ? "Schedule Unpublish" : "Schedule Publish",
92
+ cancelLabel: "Discard",
93
+ loadingLabel: "Scheduling...",
94
+ dataLoadingLabel: "Checking schedule...",
95
+ info: /*#__PURE__*/ react.createElement(CancelButtonComponent, {
96
+ presenter: presenter,
97
+ onCancel: onCancel
98
+ }),
99
+ dismissible: false,
100
+ onAccept: (data)=>{
101
+ if (!data.scheduleOn) return void toast.showWarningToast({
102
+ title: 'Missing "Schedule On" date!'
103
+ });
104
+ let scheduleOn;
105
+ try {
106
+ scheduleOn = new Date(data.scheduleOn);
107
+ } catch (ex) {
108
+ toast.showWarningToast({
109
+ title: 'Invalid "Schedule On" date!'
110
+ });
111
+ console.error(ex);
112
+ return;
113
+ }
114
+ const actionType = isPublished ? ScheduleActionType.unpublish : ScheduleActionType.publish;
115
+ return onAccept({
116
+ scheduleOn,
117
+ actionType
118
+ });
119
+ }
120
+ });
121
+ };
122
+ return {
123
+ showDialog
124
+ };
125
+ };
126
+ export { useScheduleDialog };
127
+
128
+ //# sourceMappingURL=useScheduleDialog.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"presentation/scheduleDialog/useScheduleDialog.js","sources":["../../../src/presentation/scheduleDialog/useScheduleDialog.tsx"],"sourcesContent":["import React, { useCallback, useMemo, useRef } from \"react\";\nimport { useContainer } from \"@webiny/app\";\nimport { useToast } from \"@webiny/admin-ui\";\nimport { useDialogs } from \"@webiny/app-admin\";\nimport { ScheduleActionType } from \"~/types.js\";\nimport { ScheduleDialogPresenter } from \"./abstractions.js\";\nimport { FormComponent } from \"./components/FormComponent.js\";\nimport { CancelButtonComponent } from \"./components/CancelButtonComponent.js\";\n\nexport type ShowDialogParamsEntryStatus = \"published\" | \"unpublished\" | \"draft\" | string;\n\nexport interface IShowDialogParamsEntry {\n id: string;\n status: ShowDialogParamsEntryStatus;\n title: string;\n}\n\ninterface UseShowScheduleDialogResponse {\n showDialog: () => void;\n}\n\ninterface ScheduleFormData {\n scheduleOn?: string;\n}\n\ninterface IOnAcceptParams {\n scheduleOn: Date;\n actionType: ScheduleActionType;\n}\n\nexport interface IUseScheduleDialogProps {\n namespace: string;\n target: IShowDialogParamsEntry;\n /**\n * Called after a scheduled action is successfully created/updated or cancelled. Use it to\n * refresh anything that displays the scheduled state (e.g. list cells, form banners).\n */\n onCompleted?: () => void;\n}\n\nexport const useScheduleDialog = (\n props: IUseScheduleDialogProps\n): UseShowScheduleDialogResponse => {\n const { target, namespace, onCompleted } = props;\n const container = useContainer();\n const dialog = useDialogs();\n const toast = useToast();\n\n const presenter = useMemo(() => {\n return container.resolve(ScheduleDialogPresenter);\n }, [container]);\n\n const dialogClose = useRef<null | (() => void)>(() => {\n return;\n });\n\n const onAccept = useCallback(\n async (params: IOnAcceptParams) => {\n const { scheduleOn, actionType } = params;\n\n try {\n await presenter.schedule({\n targetId: target.id,\n namespace,\n scheduleOn,\n actionType\n });\n toast.showSuccessToast({\n title: `Scheduled ${actionType} action for \"${target.title}\"!`\n });\n onCompleted?.();\n } catch (error) {\n toast.showWarningToast({ title: error.message });\n console.error(error);\n }\n },\n [presenter.vm]\n );\n\n const onCancel = useCallback(async () => {\n const entry = presenter.vm.entry;\n if (!entry) {\n toast.showWarningToast({ title: `No scheduled action found for \"${target.title}\"!` });\n if (dialogClose.current) {\n dialogClose.current();\n dialogClose.current = null;\n }\n return;\n }\n\n if (dialogClose.current) {\n dialogClose.current();\n dialogClose.current = null;\n }\n\n try {\n await presenter.cancel({\n id: entry.id,\n namespace: entry.namespace\n });\n toast.showSuccessToast({\n title: `Canceled scheduled ${entry.actionType} on \"${entry.title}\"!`\n });\n onCompleted?.();\n } catch (error) {\n toast.showWarningToast({ title: error.message });\n }\n }, [presenter.vm]);\n\n const showDialog = async () => {\n const isPublished = target.status === \"published\";\n\n dialogClose.current = dialog.showDialog({\n title: `Schedule \"${target.title}\"`,\n content: <FormComponent presenter={presenter} />,\n formData: async () => {\n await presenter.load({ namespace, id: target.id });\n\n const entry = presenter.vm.entry;\n const scheduleOn = entry?.publishOn || entry?.unpublishOn;\n\n return { scheduleOn };\n },\n acceptLabel: isPublished ? \"Schedule Unpublish\" : \"Schedule Publish\",\n cancelLabel: \"Discard\",\n loadingLabel: \"Scheduling...\",\n dataLoadingLabel: \"Checking schedule...\",\n info: <CancelButtonComponent presenter={presenter} onCancel={onCancel} />,\n dismissible: false,\n onAccept: (data: Partial<ScheduleFormData>) => {\n if (!data.scheduleOn) {\n toast.showWarningToast({ title: `Missing \"Schedule On\" date!` });\n return;\n }\n let scheduleOn: Date;\n try {\n scheduleOn = new Date(data.scheduleOn);\n } catch (ex) {\n toast.showWarningToast({ title: `Invalid \"Schedule On\" date!` });\n console.error(ex);\n return;\n }\n\n const actionType = isPublished\n ? ScheduleActionType.unpublish\n : ScheduleActionType.publish;\n\n return onAccept({\n scheduleOn,\n actionType\n });\n }\n });\n };\n\n return {\n showDialog\n };\n};\n"],"names":["useScheduleDialog","props","target","namespace","onCompleted","container","useContainer","dialog","useDialogs","toast","useToast","presenter","useMemo","ScheduleDialogPresenter","dialogClose","useRef","onAccept","useCallback","params","scheduleOn","actionType","error","console","onCancel","entry","showDialog","isPublished","FormComponent","CancelButtonComponent","data","Date","ex","ScheduleActionType"],"mappings":";;;;;;;;AAwCO,MAAMA,oBAAoB,CAC7BC;IAEA,MAAM,EAAEC,MAAM,EAAEC,SAAS,EAAEC,WAAW,EAAE,GAAGH;IAC3C,MAAMI,YAAYC;IAClB,MAAMC,SAASC;IACf,MAAMC,QAAQC;IAEd,MAAMC,YAAYC,QAAQ,IACfP,UAAU,OAAO,CAACQ,0BAC1B;QAACR;KAAU;IAEd,MAAMS,cAAcC,OAA4B,KAEhD;IAEA,MAAMC,WAAWC,YACb,OAAOC;QACH,MAAM,EAAEC,UAAU,EAAEC,UAAU,EAAE,GAAGF;QAEnC,IAAI;YACA,MAAMP,UAAU,QAAQ,CAAC;gBACrB,UAAUT,OAAO,EAAE;gBACnBC;gBACAgB;gBACAC;YACJ;YACAX,MAAM,gBAAgB,CAAC;gBACnB,OAAO,CAAC,UAAU,EAAEW,WAAW,aAAa,EAAElB,OAAO,KAAK,CAAC,EAAE,CAAC;YAClE;YACAE;QACJ,EAAE,OAAOiB,OAAO;YACZZ,MAAM,gBAAgB,CAAC;gBAAE,OAAOY,MAAM,OAAO;YAAC;YAC9CC,QAAQ,KAAK,CAACD;QAClB;IACJ,GACA;QAACV,UAAU,EAAE;KAAC;IAGlB,MAAMY,WAAWN,YAAY;QACzB,MAAMO,QAAQb,UAAU,EAAE,CAAC,KAAK;QAChC,IAAI,CAACa,OAAO;YACRf,MAAM,gBAAgB,CAAC;gBAAE,OAAO,CAAC,+BAA+B,EAAEP,OAAO,KAAK,CAAC,EAAE,CAAC;YAAC;YACnF,IAAIY,YAAY,OAAO,EAAE;gBACrBA,YAAY,OAAO;gBACnBA,YAAY,OAAO,GAAG;YAC1B;YACA;QACJ;QAEA,IAAIA,YAAY,OAAO,EAAE;YACrBA,YAAY,OAAO;YACnBA,YAAY,OAAO,GAAG;QAC1B;QAEA,IAAI;YACA,MAAMH,UAAU,MAAM,CAAC;gBACnB,IAAIa,MAAM,EAAE;gBACZ,WAAWA,MAAM,SAAS;YAC9B;YACAf,MAAM,gBAAgB,CAAC;gBACnB,OAAO,CAAC,mBAAmB,EAAEe,MAAM,UAAU,CAAC,KAAK,EAAEA,MAAM,KAAK,CAAC,EAAE,CAAC;YACxE;YACApB;QACJ,EAAE,OAAOiB,OAAO;YACZZ,MAAM,gBAAgB,CAAC;gBAAE,OAAOY,MAAM,OAAO;YAAC;QAClD;IACJ,GAAG;QAACV,UAAU,EAAE;KAAC;IAEjB,MAAMc,aAAa;QACf,MAAMC,cAAcxB,AAAkB,gBAAlBA,OAAO,MAAM;QAEjCY,YAAY,OAAO,GAAGP,OAAO,UAAU,CAAC;YACpC,OAAO,CAAC,UAAU,EAAEL,OAAO,KAAK,CAAC,CAAC,CAAC;YACnC,SAAS,WAAT,GAAS,oBAACyB,eAAaA;gBAAC,WAAWhB;;YACnC,UAAU;gBACN,MAAMA,UAAU,IAAI,CAAC;oBAAER;oBAAW,IAAID,OAAO,EAAE;gBAAC;gBAEhD,MAAMsB,QAAQb,UAAU,EAAE,CAAC,KAAK;gBAChC,MAAMQ,aAAaK,OAAO,aAAaA,OAAO;gBAE9C,OAAO;oBAAEL;gBAAW;YACxB;YACA,aAAaO,cAAc,uBAAuB;YAClD,aAAa;YACb,cAAc;YACd,kBAAkB;YAClB,MAAM,WAAN,GAAM,oBAACE,uBAAqBA;gBAAC,WAAWjB;gBAAW,UAAUY;;YAC7D,aAAa;YACb,UAAU,CAACM;gBACP,IAAI,CAACA,KAAK,UAAU,EAAE,YAClBpB,MAAM,gBAAgB,CAAC;oBAAE,OAAO;gBAA8B;gBAGlE,IAAIU;gBACJ,IAAI;oBACAA,aAAa,IAAIW,KAAKD,KAAK,UAAU;gBACzC,EAAE,OAAOE,IAAI;oBACTtB,MAAM,gBAAgB,CAAC;wBAAE,OAAO;oBAA8B;oBAC9Da,QAAQ,KAAK,CAACS;oBACd;gBACJ;gBAEA,MAAMX,aAAaM,cACbM,mBAAmB,SAAS,GAC5BA,mBAAmB,OAAO;gBAEhC,OAAOhB,SAAS;oBACZG;oBACAC;gBACJ;YACJ;QACJ;IACJ;IAEA,OAAO;QACHK;IACJ;AACJ"}
@@ -1,11 +1,4 @@
1
1
  import React from "react";
2
- import type ApolloClient from "apollo-client";
3
- export * from "./components/ScheduleDialog/index.js";
4
- export * from "../Presentation/SchedulerConfigs/index.js";
5
- /**
6
- * Decoratable Cells.
7
- */
8
- export * from "./components/Cells/CellScheduledOn/index.js";
9
2
  export interface SchedulerRenderPropParams {
10
3
  showScheduler: () => void;
11
4
  }
@@ -15,11 +8,11 @@ interface SchedulerRenderProps {
15
8
  export interface SchedulerProps {
16
9
  namespace: string;
17
10
  render: SchedulerRenderProps;
18
- client: ApolloClient<object>;
19
11
  onClose?: () => void;
20
12
  show?: boolean;
21
13
  title?: string;
22
14
  canPublish: boolean;
23
15
  canUnpublish: boolean;
24
16
  }
25
- export declare const Scheduler: ({ render, client, show: initialShow, ...rest }: SchedulerProps) => React.JSX.Element;
17
+ export declare const Scheduler: ({ render, show: initialShow, ...rest }: SchedulerProps) => React.JSX.Element;
18
+ export {};
@@ -0,0 +1,28 @@
1
+ import react, { useCallback, useState } from "react";
2
+ import { CompositionScope } from "@webiny/react-composition";
3
+ import { SchedulerListWithConfig } from "../configs/index.js";
4
+ import { SchedulerListView } from "./components/SchedulerListView.js";
5
+ const Scheduler = ({ render, show: initialShow, ...rest })=>{
6
+ const [show, setShow] = useState(initialShow ?? false);
7
+ const showScheduler = useCallback(()=>{
8
+ setShow(true);
9
+ }, []);
10
+ const onClose = useCallback(()=>{
11
+ if ("function" == typeof rest.onClose) rest.onClose();
12
+ setShow(false);
13
+ }, [
14
+ rest.onClose
15
+ ]);
16
+ return /*#__PURE__*/ react.createElement(react.Fragment, null, show ? /*#__PURE__*/ react.createElement(CompositionScope, {
17
+ name: "scheduler"
18
+ }, /*#__PURE__*/ react.createElement(SchedulerListWithConfig, null, /*#__PURE__*/ react.createElement(SchedulerListView, {
19
+ namespace: rest.namespace,
20
+ onClose: onClose,
21
+ title: rest.title ?? "Scheduler"
22
+ }))) : null, render ? render({
23
+ showScheduler
24
+ }) : null);
25
+ };
26
+ export { Scheduler };
27
+
28
+ //# sourceMappingURL=Scheduler.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"presentation/schedulerList/Scheduler.js","sources":["../../../src/presentation/schedulerList/Scheduler.tsx"],"sourcesContent":["import React, { useCallback, useState } from \"react\";\nimport { CompositionScope } from \"@webiny/react-composition\";\nimport { SchedulerListWithConfig } from \"~/presentation/configs/index.js\";\nimport { SchedulerListView } from \"./components/SchedulerListView.js\";\n\nexport interface SchedulerRenderPropParams {\n showScheduler: () => void;\n}\n\ninterface SchedulerRenderProps {\n (params: SchedulerRenderPropParams): React.ReactNode;\n}\n\nexport interface SchedulerProps {\n namespace: string;\n render: SchedulerRenderProps;\n onClose?: () => void;\n show?: boolean;\n title?: string;\n canPublish: boolean;\n canUnpublish: boolean;\n}\n\nexport const Scheduler = ({ render, show: initialShow, ...rest }: SchedulerProps) => {\n const [show, setShow] = useState(initialShow ?? false);\n\n const showScheduler = useCallback(() => {\n setShow(true);\n }, []);\n\n const onClose = useCallback(() => {\n if (typeof rest.onClose === \"function\") {\n rest.onClose();\n }\n setShow(false);\n }, [rest.onClose]);\n\n return (\n <>\n {show ? (\n <CompositionScope name={\"scheduler\"}>\n <SchedulerListWithConfig>\n <SchedulerListView\n namespace={rest.namespace}\n onClose={onClose}\n title={rest.title ?? \"Scheduler\"}\n />\n </SchedulerListWithConfig>\n </CompositionScope>\n ) : null}\n {render ? render({ showScheduler }) : null}\n </>\n );\n};\n"],"names":["Scheduler","render","initialShow","rest","show","setShow","useState","showScheduler","useCallback","onClose","CompositionScope","SchedulerListWithConfig","SchedulerListView"],"mappings":";;;;AAuBO,MAAMA,YAAY,CAAC,EAAEC,MAAM,EAAE,MAAMC,WAAW,EAAE,GAAGC,MAAsB;IAC5E,MAAM,CAACC,MAAMC,QAAQ,GAAGC,SAASJ,eAAe;IAEhD,MAAMK,gBAAgBC,YAAY;QAC9BH,QAAQ;IACZ,GAAG,EAAE;IAEL,MAAMI,UAAUD,YAAY;QACxB,IAAI,AAAwB,cAAxB,OAAOL,KAAK,OAAO,EACnBA,KAAK,OAAO;QAEhBE,QAAQ;IACZ,GAAG;QAACF,KAAK,OAAO;KAAC;IAEjB,OAAO,WAAP,GACI,0CACKC,OAAO,WAAPA,GACG,oBAACM,kBAAgBA;QAAC,MAAM;qBACpB,oBAACC,yBAAuBA,MAAAA,WAAAA,GACpB,oBAACC,mBAAiBA;QACd,WAAWT,KAAK,SAAS;QACzB,SAASM;QACT,OAAON,KAAK,KAAK,IAAI;WAIjC,MACHF,SAASA,OAAO;QAAEM;IAAc,KAAK;AAGlD"}
@@ -0,0 +1,15 @@
1
+ import { SimpleDataSource } from "@webiny/app-admin/presentation/listPresenter/SimpleDataSource.js";
2
+ import type { FetchResult } from "@webiny/app-admin/presentation/listPresenter/FolderAwareDataSource.js";
3
+ import type { IDataSourceQuery } from "@webiny/app-admin/presentation/listPresenter/abstractions.js";
4
+ import type { ListScheduledActionsGateway } from "../../features/listScheduledActions/abstractions.js";
5
+ import type { SchedulerEntry } from "../../types.js";
6
+ export declare class SchedulerListDataSource extends SimpleDataSource<SchedulerEntry> {
7
+ private readonly gateway;
8
+ private readonly namespace;
9
+ private _rows;
10
+ constructor(gateway: ListScheduledActionsGateway.Interface, namespace: string);
11
+ get rows(): SchedulerEntry[];
12
+ fetch(params: IDataSourceQuery): Promise<FetchResult<SchedulerEntry>>;
13
+ onQueryResult(data: SchedulerEntry[]): void;
14
+ onLoadMoreResult(data: SchedulerEntry[]): void;
15
+ }
@@ -0,0 +1,41 @@
1
+ import { makeObservable, observable } from "mobx";
2
+ import { SimpleDataSource } from "@webiny/app-admin/presentation/listPresenter/SimpleDataSource.js";
3
+ class SchedulerListDataSource extends SimpleDataSource {
4
+ constructor(gateway, namespace){
5
+ super(), this.gateway = gateway, this.namespace = namespace, this._rows = [];
6
+ makeObservable(this, {
7
+ _rows: observable
8
+ });
9
+ }
10
+ get rows() {
11
+ return this._rows;
12
+ }
13
+ async fetch(params) {
14
+ const sort = params.sort ? [
15
+ `${params.sort.field}_${params.sort.direction}`
16
+ ] : void 0;
17
+ const result = await this.gateway.execute({
18
+ namespace: this.namespace,
19
+ where: params.filters,
20
+ sort: sort,
21
+ limit: params.limit,
22
+ after: params.cursor
23
+ });
24
+ return {
25
+ data: result.items,
26
+ meta: result.meta
27
+ };
28
+ }
29
+ onQueryResult(data) {
30
+ this._rows = data;
31
+ }
32
+ onLoadMoreResult(data) {
33
+ this._rows = [
34
+ ...this._rows,
35
+ ...data
36
+ ];
37
+ }
38
+ }
39
+ export { SchedulerListDataSource };
40
+
41
+ //# sourceMappingURL=SchedulerListDataSource.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"presentation/schedulerList/SchedulerListDataSource.js","sources":["../../../src/presentation/schedulerList/SchedulerListDataSource.ts"],"sourcesContent":["import { makeObservable, observable } from \"mobx\";\nimport { SimpleDataSource } from \"@webiny/app-admin/presentation/listPresenter/SimpleDataSource.js\";\nimport type { FetchResult } from \"@webiny/app-admin/presentation/listPresenter/FolderAwareDataSource.js\";\nimport type { IDataSourceQuery } from \"@webiny/app-admin/presentation/listPresenter/abstractions.js\";\nimport type { ListScheduledActionsGateway } from \"~/features/listScheduledActions/abstractions.js\";\nimport type { SchedulerEntry } from \"~/types.js\";\n\nexport class SchedulerListDataSource extends SimpleDataSource<SchedulerEntry> {\n private _rows: SchedulerEntry[] = [];\n\n constructor(\n private readonly gateway: ListScheduledActionsGateway.Interface,\n private readonly namespace: string\n ) {\n super();\n makeObservable<SchedulerListDataSource, \"_rows\">(this, {\n _rows: observable\n });\n }\n\n get rows(): SchedulerEntry[] {\n return this._rows;\n }\n\n async fetch(params: IDataSourceQuery): Promise<FetchResult<SchedulerEntry>> {\n const sort = params.sort ? [`${params.sort.field}_${params.sort.direction}`] : undefined;\n\n const result = await this.gateway.execute({\n namespace: this.namespace,\n where: params.filters as Record<string, any> | undefined,\n sort: sort as any,\n limit: params.limit,\n after: params.cursor\n });\n\n return {\n data: result.items,\n meta: result.meta\n };\n }\n\n override onQueryResult(data: SchedulerEntry[]): void {\n this._rows = data;\n }\n\n override onLoadMoreResult(data: SchedulerEntry[]): void {\n this._rows = [...this._rows, ...data];\n }\n}\n"],"names":["SchedulerListDataSource","SimpleDataSource","gateway","namespace","makeObservable","observable","params","sort","undefined","result","data"],"mappings":";;AAOO,MAAMA,gCAAgCC;IAGzC,YACqBC,OAA8C,EAC9CC,SAAiB,CACpC;QACE,KAAK,SAHYD,OAAO,GAAPA,SAAAA,IAAAA,CACAC,SAAS,GAATA,WAAAA,IAAAA,CAJb,KAAK,GAAqB,EAAE;QAOhCC,eAAiD,IAAI,EAAE;YACnD,OAAOC;QACX;IACJ;IAEA,IAAI,OAAyB;QACzB,OAAO,IAAI,CAAC,KAAK;IACrB;IAEA,MAAM,MAAMC,MAAwB,EAAwC;QACxE,MAAMC,OAAOD,OAAO,IAAI,GAAG;YAAC,GAAGA,OAAO,IAAI,CAAC,KAAK,CAAC,CAAC,EAAEA,OAAO,IAAI,CAAC,SAAS,EAAE;SAAC,GAAGE;QAE/E,MAAMC,SAAS,MAAM,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC;YACtC,WAAW,IAAI,CAAC,SAAS;YACzB,OAAOH,OAAO,OAAO;YACrB,MAAMC;YACN,OAAOD,OAAO,KAAK;YACnB,OAAOA,OAAO,MAAM;QACxB;QAEA,OAAO;YACH,MAAMG,OAAO,KAAK;YAClB,MAAMA,OAAO,IAAI;QACrB;IACJ;IAES,cAAcC,IAAsB,EAAQ;QACjD,IAAI,CAAC,KAAK,GAAGA;IACjB;IAES,iBAAiBA,IAAsB,EAAQ;QACpD,IAAI,CAAC,KAAK,GAAG;eAAI,IAAI,CAAC,KAAK;eAAKA;SAAK;IACzC;AACJ"}
@@ -0,0 +1,21 @@
1
+ import { ListPresenter } from "@webiny/app-admin/presentation/listPresenter/abstractions.js";
2
+ import { ListScheduledActionsGateway } from "../../features/listScheduledActions/abstractions.js";
3
+ import { CancelScheduledActionGateway } from "../../features/cancelScheduledAction/abstractions.js";
4
+ import { type ISchedulerListPresenter } from "./abstractions.js";
5
+ import type { SchedulerEntry } from "../../types.js";
6
+ declare class SchedulerListPresenterImpl implements ISchedulerListPresenter {
7
+ private readonly _listPresenter;
8
+ private readonly listGateway;
9
+ private readonly cancelGateway;
10
+ private _namespace;
11
+ constructor(_listPresenter: ListPresenter.Interface<SchedulerEntry>, listGateway: ListScheduledActionsGateway.Interface, cancelGateway: CancelScheduledActionGateway.Interface);
12
+ get list(): ListPresenter.Interface<SchedulerEntry>;
13
+ init(params: {
14
+ namespace: string;
15
+ }): void;
16
+ cancelItem(id: string): Promise<void>;
17
+ }
18
+ export declare const SchedulerListPresenter: typeof SchedulerListPresenterImpl & {
19
+ __abstraction: import("@webiny/di").Abstraction<ISchedulerListPresenter>;
20
+ };
21
+ export {};
@@ -0,0 +1,47 @@
1
+ import { makeAutoObservable } from "mobx";
2
+ import { ListPresenter } from "@webiny/app-admin/presentation/listPresenter/abstractions.js";
3
+ import { ListScheduledActionsGateway } from "../../features/listScheduledActions/abstractions.js";
4
+ import { CancelScheduledActionGateway } from "../../features/cancelScheduledAction/abstractions.js";
5
+ import { SchedulerListPresenter } from "./abstractions.js";
6
+ import { SchedulerListDataSource } from "./SchedulerListDataSource.js";
7
+ class SchedulerListPresenterImpl {
8
+ constructor(_listPresenter, listGateway, cancelGateway){
9
+ this._listPresenter = _listPresenter;
10
+ this.listGateway = listGateway;
11
+ this.cancelGateway = cancelGateway;
12
+ makeAutoObservable(this);
13
+ }
14
+ get list() {
15
+ return this._listPresenter;
16
+ }
17
+ init(params) {
18
+ this._namespace = params.namespace;
19
+ const dataSource = new SchedulerListDataSource(this.listGateway, params.namespace);
20
+ this._listPresenter.init({
21
+ dataSource,
22
+ initialSort: {
23
+ field: "scheduledFor",
24
+ direction: "DESC"
25
+ },
26
+ limit: 50
27
+ });
28
+ }
29
+ async cancelItem(id) {
30
+ await this.cancelGateway.execute({
31
+ namespace: this._namespace,
32
+ id
33
+ });
34
+ await this._listPresenter.actions.refresh();
35
+ }
36
+ }
37
+ const SchedulerListPresenter_SchedulerListPresenter = SchedulerListPresenter.createImplementation({
38
+ implementation: SchedulerListPresenterImpl,
39
+ dependencies: [
40
+ ListPresenter,
41
+ ListScheduledActionsGateway,
42
+ CancelScheduledActionGateway
43
+ ]
44
+ });
45
+ export { SchedulerListPresenter_SchedulerListPresenter as SchedulerListPresenter };
46
+
47
+ //# sourceMappingURL=SchedulerListPresenter.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"presentation/schedulerList/SchedulerListPresenter.js","sources":["../../../src/presentation/schedulerList/SchedulerListPresenter.ts"],"sourcesContent":["import { makeAutoObservable } from \"mobx\";\nimport { ListPresenter } from \"@webiny/app-admin/presentation/listPresenter/abstractions.js\";\nimport { ListScheduledActionsGateway } from \"~/features/listScheduledActions/abstractions.js\";\nimport { CancelScheduledActionGateway } from \"~/features/cancelScheduledAction/abstractions.js\";\nimport {\n SchedulerListPresenter as Abstraction,\n type ISchedulerListPresenter\n} from \"./abstractions.js\";\nimport { SchedulerListDataSource } from \"./SchedulerListDataSource.js\";\nimport type { SchedulerEntry } from \"~/types.js\";\n\nclass SchedulerListPresenterImpl implements ISchedulerListPresenter {\n private _namespace!: string;\n\n constructor(\n private readonly _listPresenter: ListPresenter.Interface<SchedulerEntry>,\n private readonly listGateway: ListScheduledActionsGateway.Interface,\n private readonly cancelGateway: CancelScheduledActionGateway.Interface\n ) {\n makeAutoObservable(this);\n }\n\n get list(): ListPresenter.Interface<SchedulerEntry> {\n return this._listPresenter;\n }\n\n init(params: { namespace: string }) {\n this._namespace = params.namespace;\n const dataSource = new SchedulerListDataSource(this.listGateway, params.namespace);\n this._listPresenter.init({\n dataSource,\n initialSort: { field: \"scheduledFor\", direction: \"DESC\" },\n limit: 50\n });\n }\n\n async cancelItem(id: string) {\n await this.cancelGateway.execute({ namespace: this._namespace, id });\n await this._listPresenter.actions.refresh();\n }\n}\n\nexport const SchedulerListPresenter = Abstraction.createImplementation({\n implementation: SchedulerListPresenterImpl,\n dependencies: [ListPresenter, ListScheduledActionsGateway, CancelScheduledActionGateway]\n});\n"],"names":["SchedulerListPresenterImpl","_listPresenter","listGateway","cancelGateway","makeAutoObservable","params","dataSource","SchedulerListDataSource","id","SchedulerListPresenter","Abstraction","ListPresenter","ListScheduledActionsGateway","CancelScheduledActionGateway"],"mappings":";;;;;;AAWA,MAAMA;IAGF,YACqBC,cAAuD,EACvDC,WAAkD,EAClDC,aAAqD,CACxE;aAHmBF,cAAc,GAAdA;aACAC,WAAW,GAAXA;aACAC,aAAa,GAAbA;QAEjBC,mBAAmB,IAAI;IAC3B;IAEA,IAAI,OAAgD;QAChD,OAAO,IAAI,CAAC,cAAc;IAC9B;IAEA,KAAKC,MAA6B,EAAE;QAChC,IAAI,CAAC,UAAU,GAAGA,OAAO,SAAS;QAClC,MAAMC,aAAa,IAAIC,wBAAwB,IAAI,CAAC,WAAW,EAAEF,OAAO,SAAS;QACjF,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC;YACrBC;YACA,aAAa;gBAAE,OAAO;gBAAgB,WAAW;YAAO;YACxD,OAAO;QACX;IACJ;IAEA,MAAM,WAAWE,EAAU,EAAE;QACzB,MAAM,IAAI,CAAC,aAAa,CAAC,OAAO,CAAC;YAAE,WAAW,IAAI,CAAC,UAAU;YAAEA;QAAG;QAClE,MAAM,IAAI,CAAC,cAAc,CAAC,OAAO,CAAC,OAAO;IAC7C;AACJ;AAEO,MAAMC,gDAAyBC,uBAAAA,oBAAgC,CAAC;IACnE,gBAAgBV;IAChB,cAAc;QAACW;QAAeC;QAA6BC;KAA6B;AAC5F"}
@@ -0,0 +1,13 @@
1
+ import type { ListPresenter } from "@webiny/app-admin/presentation/listPresenter/abstractions.js";
2
+ import type { SchedulerEntry } from "../../types.js";
3
+ export interface ISchedulerListPresenter {
4
+ readonly list: ListPresenter.Interface<SchedulerEntry>;
5
+ init(params: {
6
+ namespace: string;
7
+ }): void;
8
+ cancelItem(id: string): Promise<void>;
9
+ }
10
+ export declare const SchedulerListPresenter: import("@webiny/di").Abstraction<ISchedulerListPresenter>;
11
+ export declare namespace SchedulerListPresenter {
12
+ type Interface = ISchedulerListPresenter;
13
+ }
@@ -0,0 +1,5 @@
1
+ import { createAbstraction } from "@webiny/feature/admin";
2
+ const SchedulerListPresenter = createAbstraction("Scheduler/ListPresenter");
3
+ export { SchedulerListPresenter };
4
+
5
+ //# sourceMappingURL=abstractions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"presentation/schedulerList/abstractions.js","sources":["../../../src/presentation/schedulerList/abstractions.ts"],"sourcesContent":["import { createAbstraction } from \"@webiny/feature/admin\";\nimport type { ListPresenter } from \"@webiny/app-admin/presentation/listPresenter/abstractions.js\";\nimport type { SchedulerEntry } from \"~/types.js\";\n\nexport interface ISchedulerListPresenter {\n readonly list: ListPresenter.Interface<SchedulerEntry>;\n init(params: { namespace: string }): void;\n cancelItem(id: string): Promise<void>;\n}\n\nexport const SchedulerListPresenter =\n createAbstraction<ISchedulerListPresenter>(\"Scheduler/ListPresenter\");\n\nexport namespace SchedulerListPresenter {\n export type Interface = ISchedulerListPresenter;\n}\n"],"names":["SchedulerListPresenter","createAbstraction"],"mappings":";AAUO,MAAMA,yBACTC,kBAA2C"}
@@ -0,0 +1,9 @@
1
+ import React from "react";
2
+ import type { ISchedulerListPresenter } from "../abstractions.js";
3
+ interface BottomInfoBarProps {
4
+ presenter: ISchedulerListPresenter;
5
+ }
6
+ export declare const BottomInfoBar: (({ presenter }: BottomInfoBarProps) => React.JSX.Element) & React.NamedExoticComponent<BottomInfoBarProps> & {
7
+ readonly type: ({ presenter }: BottomInfoBarProps) => React.JSX.Element;
8
+ };
9
+ export {};
@@ -0,0 +1,18 @@
1
+ import react from "react";
2
+ import { observer } from "mobx-react-lite";
3
+ import { ListMeta } from "../../components/BottomInfoBar/ListMeta.js";
4
+ import { ListStatus } from "../../components/BottomInfoBar/ListStatus.js";
5
+ import { BottomInfoBarInner, BottomInfoBarWrapper } from "../../components/BottomInfoBar/BottomInfoBar.styled.js";
6
+ const BottomInfoBar = observer(({ presenter })=>{
7
+ const { vm } = presenter.list;
8
+ return /*#__PURE__*/ react.createElement(BottomInfoBarWrapper, null, /*#__PURE__*/ react.createElement(BottomInfoBarInner, null, /*#__PURE__*/ react.createElement(ListMeta, {
9
+ loading: vm.pagination.loading,
10
+ totalCount: vm.pagination.totalCount,
11
+ currentCount: vm.pagination.currentCount
12
+ }), /*#__PURE__*/ react.createElement(ListStatus, {
13
+ loading: vm.pagination.loadingMore
14
+ })));
15
+ });
16
+ export { BottomInfoBar };
17
+
18
+ //# sourceMappingURL=BottomInfoBar.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"presentation/schedulerList/components/BottomInfoBar.js","sources":["../../../../src/presentation/schedulerList/components/BottomInfoBar.tsx"],"sourcesContent":["import React from \"react\";\nimport { observer } from \"mobx-react-lite\";\nimport { ListMeta } from \"~/presentation/components/BottomInfoBar/ListMeta.js\";\nimport { ListStatus } from \"~/presentation/components/BottomInfoBar/ListStatus.js\";\nimport {\n BottomInfoBarInner,\n BottomInfoBarWrapper\n} from \"~/presentation/components/BottomInfoBar/BottomInfoBar.styled.js\";\nimport type { ISchedulerListPresenter } from \"../abstractions.js\";\n\ninterface BottomInfoBarProps {\n presenter: ISchedulerListPresenter;\n}\n\nexport const BottomInfoBar = observer(({ presenter }: BottomInfoBarProps) => {\n const { vm } = presenter.list;\n\n return (\n <BottomInfoBarWrapper>\n <BottomInfoBarInner>\n <ListMeta\n loading={vm.pagination.loading}\n totalCount={vm.pagination.totalCount}\n currentCount={vm.pagination.currentCount}\n />\n <ListStatus loading={vm.pagination.loadingMore} />\n </BottomInfoBarInner>\n </BottomInfoBarWrapper>\n );\n});\n"],"names":["BottomInfoBar","observer","presenter","vm","BottomInfoBarWrapper","BottomInfoBarInner","ListMeta","ListStatus"],"mappings":";;;;;AAcO,MAAMA,gBAAgBC,SAAS,CAAC,EAAEC,SAAS,EAAsB;IACpE,MAAM,EAAEC,EAAE,EAAE,GAAGD,UAAU,IAAI;IAE7B,OAAO,WAAP,GACI,oBAACE,sBAAoBA,MAAAA,WAAAA,GACjB,oBAACC,oBAAkBA,MAAAA,WAAAA,GACf,oBAACC,UAAQA;QACL,SAASH,GAAG,UAAU,CAAC,OAAO;QAC9B,YAAYA,GAAG,UAAU,CAAC,UAAU;QACpC,cAAcA,GAAG,UAAU,CAAC,YAAY;sBAE5C,oBAACI,YAAUA;QAAC,SAASJ,GAAG,UAAU,CAAC,WAAW;;AAI9D"}
@@ -0,0 +1,9 @@
1
+ import React from "react";
2
+ import type { ISchedulerListPresenter } from "../abstractions.js";
3
+ interface EmptyProps {
4
+ presenter: ISchedulerListPresenter;
5
+ }
6
+ export declare const Empty: (({ presenter }: EmptyProps) => React.JSX.Element) & React.NamedExoticComponent<EmptyProps> & {
7
+ readonly type: ({ presenter }: EmptyProps) => React.JSX.Element;
8
+ };
9
+ export {};
@@ -1,12 +1,12 @@
1
1
  import react from "react";
2
+ import { observer } from "mobx-react-lite";
2
3
  import { ReactComponent } from "@material-design-icons/svg/outlined/search.svg";
3
4
  import { ReactComponent as view_list_svg_ReactComponent } from "@material-design-icons/svg/outlined/view_list.svg";
4
5
  import { EmptyView } from "@webiny/app-admin";
5
- import { EmptyOuter, EmptyWrapper } from "./Empty.styled.js";
6
- import { useScheduler } from "../../hooks/index.js";
7
- const Empty = ()=>{
8
- const { vm } = useScheduler();
9
- return /*#__PURE__*/ react.createElement(EmptyWrapper, null, /*#__PURE__*/ react.createElement(EmptyOuter, null, vm.isSearchView ? /*#__PURE__*/ react.createElement(EmptyView, {
6
+ import { EmptyOuter, EmptyWrapper } from "../../components/Empty/Empty.styled.js";
7
+ const Empty = observer(({ presenter })=>{
8
+ const { vm } = presenter.list;
9
+ return /*#__PURE__*/ react.createElement(EmptyWrapper, null, /*#__PURE__*/ react.createElement(EmptyOuter, null, vm.emptyWithFilters ? /*#__PURE__*/ react.createElement(EmptyView, {
10
10
  icon: /*#__PURE__*/ react.createElement(ReactComponent, null),
11
11
  title: "No items found.",
12
12
  action: null
@@ -15,7 +15,7 @@ const Empty = ()=>{
15
15
  title: "No scheduled items.",
16
16
  action: null
17
17
  })));
18
- };
18
+ });
19
19
  export { Empty };
20
20
 
21
21
  //# sourceMappingURL=Empty.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"presentation/schedulerList/components/Empty.js","sources":["../../../../src/presentation/schedulerList/components/Empty.tsx"],"sourcesContent":["import React from \"react\";\nimport { observer } from \"mobx-react-lite\";\nimport { ReactComponent as SearchIcon } from \"@material-design-icons/svg/outlined/search.svg\";\nimport { ReactComponent as ListIcon } from \"@material-design-icons/svg/outlined/view_list.svg\";\nimport { EmptyView } from \"@webiny/app-admin\";\nimport { EmptyOuter, EmptyWrapper } from \"~/presentation/components/Empty/Empty.styled.js\";\nimport type { ISchedulerListPresenter } from \"../abstractions.js\";\n\ninterface EmptyProps {\n presenter: ISchedulerListPresenter;\n}\n\nexport const Empty = observer(({ presenter }: EmptyProps) => {\n const { vm } = presenter.list;\n\n return (\n <EmptyWrapper>\n <EmptyOuter>\n {vm.emptyWithFilters ? (\n <EmptyView icon={<SearchIcon />} title={\"No items found.\"} action={null} />\n ) : (\n <EmptyView icon={<ListIcon />} title={`No scheduled items.`} action={null} />\n )}\n </EmptyOuter>\n </EmptyWrapper>\n );\n});\n"],"names":["Empty","observer","presenter","vm","EmptyWrapper","EmptyOuter","EmptyView","SearchIcon","ListIcon"],"mappings":";;;;;;AAYO,MAAMA,QAAQC,SAAS,CAAC,EAAEC,SAAS,EAAc;IACpD,MAAM,EAAEC,EAAE,EAAE,GAAGD,UAAU,IAAI;IAE7B,OAAO,WAAP,GACI,oBAACE,cAAYA,MAAAA,WAAAA,GACT,oBAACC,YAAUA,MACNF,GAAG,gBAAgB,GAAG,WAAH,GAChB,oBAACG,WAASA;QAAC,oBAAM,oBAACC,gBAAUA;QAAK,OAAO;QAAmB,QAAQ;uBAEnE,oBAACD,WAASA;QAAC,oBAAM,oBAACE,8BAAQA;QAAK,OAAO;QAAuB,QAAQ;;AAKzF"}
@@ -0,0 +1,8 @@
1
+ import React from "react";
2
+ interface SchedulerListViewProps {
3
+ namespace: string;
4
+ onClose: () => void;
5
+ title: string;
6
+ }
7
+ export declare const SchedulerListView: (props: SchedulerListViewProps) => React.JSX.Element;
8
+ export {};
@@ -0,0 +1,40 @@
1
+ import react, { useEffect, useMemo } from "react";
2
+ import { observer } from "mobx-react-lite";
3
+ import { DiContainerProvider, useContainer } from "@webiny/app";
4
+ import { SchedulerListPresenterFeature } from "../feature.js";
5
+ import { useSchedulerListPresenter } from "../useSchedulerListPresenter.js";
6
+ import { ListScheduledActionsFeature } from "../../../features/listScheduledActions/feature.js";
7
+ import { CancelScheduledActionFeature } from "../../../features/cancelScheduledAction/feature.js";
8
+ import { SchedulerOverlay } from "./SchedulerOverlay.js";
9
+ const SchedulerListView_SchedulerListViewInner = observer(function(props) {
10
+ const presenter = useSchedulerListPresenter();
11
+ useEffect(()=>{
12
+ presenter.init({
13
+ namespace: props.namespace
14
+ });
15
+ }, [
16
+ presenter,
17
+ props.namespace
18
+ ]);
19
+ return /*#__PURE__*/ react.createElement(SchedulerOverlay, {
20
+ presenter: presenter,
21
+ onExited: props.onClose,
22
+ title: props.title
23
+ });
24
+ });
25
+ const SchedulerListView = (props)=>{
26
+ const container = useContainer();
27
+ const scopedContainer = useMemo(()=>{
28
+ const child = container.createChildContainer();
29
+ ListScheduledActionsFeature.register(child);
30
+ CancelScheduledActionFeature.register(child);
31
+ SchedulerListPresenterFeature.register(child);
32
+ return child;
33
+ }, []);
34
+ return /*#__PURE__*/ react.createElement(DiContainerProvider, {
35
+ container: scopedContainer
36
+ }, /*#__PURE__*/ react.createElement(SchedulerListView_SchedulerListViewInner, props));
37
+ };
38
+ export { SchedulerListView };
39
+
40
+ //# sourceMappingURL=SchedulerListView.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"presentation/schedulerList/components/SchedulerListView.js","sources":["../../../../src/presentation/schedulerList/components/SchedulerListView.tsx"],"sourcesContent":["import React, { useEffect, useMemo } from \"react\";\nimport { observer } from \"mobx-react-lite\";\nimport { DiContainerProvider, useContainer } from \"@webiny/app\";\nimport { SchedulerListPresenterFeature } from \"../feature.js\";\nimport { useSchedulerListPresenter } from \"../useSchedulerListPresenter.js\";\nimport { ListScheduledActionsFeature } from \"~/features/listScheduledActions/feature.js\";\nimport { CancelScheduledActionFeature } from \"~/features/cancelScheduledAction/feature.js\";\nimport { SchedulerOverlay } from \"./SchedulerOverlay.js\";\n\ninterface SchedulerListViewProps {\n namespace: string;\n onClose: () => void;\n title: string;\n}\n\nconst SchedulerListViewInner = observer(function SchedulerListViewInner(\n props: SchedulerListViewProps\n) {\n const presenter = useSchedulerListPresenter();\n\n useEffect(() => {\n presenter.init({ namespace: props.namespace });\n }, [presenter, props.namespace]);\n\n return <SchedulerOverlay presenter={presenter} onExited={props.onClose} title={props.title} />;\n});\n\nexport const SchedulerListView = (props: SchedulerListViewProps) => {\n const container = useContainer();\n\n const scopedContainer = useMemo(() => {\n const child = container.createChildContainer();\n ListScheduledActionsFeature.register(child);\n CancelScheduledActionFeature.register(child);\n SchedulerListPresenterFeature.register(child);\n return child;\n }, []);\n\n return (\n <DiContainerProvider container={scopedContainer}>\n <SchedulerListViewInner {...props} />\n </DiContainerProvider>\n );\n};\n"],"names":["SchedulerListViewInner","observer","props","presenter","useSchedulerListPresenter","useEffect","SchedulerOverlay","SchedulerListView","container","useContainer","scopedContainer","useMemo","child","ListScheduledActionsFeature","CancelScheduledActionFeature","SchedulerListPresenterFeature","DiContainerProvider"],"mappings":";;;;;;;;AAeA,MAAMA,2CAAyBC,SAAS,SACpCC,KAA6B;IAE7B,MAAMC,YAAYC;IAElBC,UAAU;QACNF,UAAU,IAAI,CAAC;YAAE,WAAWD,MAAM,SAAS;QAAC;IAChD,GAAG;QAACC;QAAWD,MAAM,SAAS;KAAC;IAE/B,OAAO,WAAP,GAAO,oBAACI,kBAAgBA;QAAC,WAAWH;QAAW,UAAUD,MAAM,OAAO;QAAE,OAAOA,MAAM,KAAK;;AAC9F;AAEO,MAAMK,oBAAoB,CAACL;IAC9B,MAAMM,YAAYC;IAElB,MAAMC,kBAAkBC,QAAQ;QAC5B,MAAMC,QAAQJ,UAAU,oBAAoB;QAC5CK,4BAA4B,QAAQ,CAACD;QACrCE,6BAA6B,QAAQ,CAACF;QACtCG,8BAA8B,QAAQ,CAACH;QACvC,OAAOA;IACX,GAAG,EAAE;IAEL,OAAO,WAAP,GACI,oBAACI,qBAAmBA;QAAC,WAAWN;qBAC5B,oBAACV,0CAA2BE;AAGxC"}
@@ -0,0 +1,11 @@
1
+ import React from "react";
2
+ import type { ISchedulerListPresenter } from "../abstractions.js";
3
+ interface SchedulerOverlayProps {
4
+ presenter: ISchedulerListPresenter;
5
+ title: string;
6
+ onExited: () => void;
7
+ }
8
+ export declare const SchedulerOverlay: (({ presenter, title, onExited }: SchedulerOverlayProps) => React.JSX.Element) & React.NamedExoticComponent<SchedulerOverlayProps> & {
9
+ readonly type: ({ presenter, title, onExited }: SchedulerOverlayProps) => React.JSX.Element;
10
+ };
11
+ export {};
@@ -0,0 +1,38 @@
1
+ import react from "react";
2
+ import { observer } from "mobx-react-lite";
3
+ import debounce from "lodash/debounce.js";
4
+ import { OverlayLayout } from "@webiny/app-admin";
5
+ import { Scrollbar } from "@webiny/admin-ui";
6
+ import { Title } from "../../components/Title/index.js";
7
+ import { SearchInput } from "./SearchInput.js";
8
+ import { Empty } from "./Empty.js";
9
+ import { SchedulerTable } from "./SchedulerTable.js";
10
+ import { BottomInfoBar } from "./BottomInfoBar.js";
11
+ const SchedulerOverlay = observer(({ presenter, title, onExited })=>{
12
+ const { vm } = presenter.list;
13
+ const onTableScroll = debounce(async ({ scrollFrame })=>{
14
+ if (scrollFrame.top > 0.8) await presenter.list.actions.loadMore();
15
+ }, 200);
16
+ return /*#__PURE__*/ react.createElement(OverlayLayout, {
17
+ onExited: onExited,
18
+ barLeft: /*#__PURE__*/ react.createElement(Title, {
19
+ title: title
20
+ }),
21
+ barMiddle: /*#__PURE__*/ react.createElement(SearchInput, {
22
+ presenter: presenter
23
+ })
24
+ }, /*#__PURE__*/ react.createElement(Scrollbar, {
25
+ onScrollFrame: (scrollFrame)=>onTableScroll({
26
+ scrollFrame
27
+ })
28
+ }, vm.empty ? /*#__PURE__*/ react.createElement(Empty, {
29
+ presenter: presenter
30
+ }) : /*#__PURE__*/ react.createElement(SchedulerTable, {
31
+ presenter: presenter
32
+ })), /*#__PURE__*/ react.createElement(BottomInfoBar, {
33
+ presenter: presenter
34
+ }));
35
+ });
36
+ export { SchedulerOverlay };
37
+
38
+ //# sourceMappingURL=SchedulerOverlay.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"presentation/schedulerList/components/SchedulerOverlay.js","sources":["../../../../src/presentation/schedulerList/components/SchedulerOverlay.tsx"],"sourcesContent":["import React from \"react\";\nimport { observer } from \"mobx-react-lite\";\nimport debounce from \"lodash/debounce.js\";\nimport { OverlayLayout } from \"@webiny/app-admin\";\nimport { Scrollbar } from \"@webiny/admin-ui\";\nimport { Title } from \"~/presentation/components/Title/index.js\";\nimport { SearchInput } from \"./SearchInput.js\";\nimport { Empty } from \"./Empty.js\";\nimport { SchedulerTable } from \"./SchedulerTable.js\";\nimport { BottomInfoBar } from \"./BottomInfoBar.js\";\nimport type { ISchedulerListPresenter } from \"../abstractions.js\";\n\ninterface SchedulerOverlayProps {\n presenter: ISchedulerListPresenter;\n title: string;\n onExited: () => void;\n}\n\nexport const SchedulerOverlay = observer(\n ({ presenter, title, onExited }: SchedulerOverlayProps) => {\n const { vm } = presenter.list;\n\n const onTableScroll = debounce(async ({ scrollFrame }) => {\n if (scrollFrame.top > 0.8) {\n await presenter.list.actions.loadMore();\n }\n }, 200);\n\n return (\n <OverlayLayout\n onExited={onExited}\n barLeft={<Title title={title} />}\n barMiddle={<SearchInput presenter={presenter} />}\n >\n <Scrollbar onScrollFrame={scrollFrame => onTableScroll({ scrollFrame })}>\n {vm.empty ? (\n <Empty presenter={presenter} />\n ) : (\n <SchedulerTable presenter={presenter} />\n )}\n </Scrollbar>\n <BottomInfoBar presenter={presenter} />\n </OverlayLayout>\n );\n }\n);\n"],"names":["SchedulerOverlay","observer","presenter","title","onExited","vm","onTableScroll","debounce","scrollFrame","OverlayLayout","Title","SearchInput","Scrollbar","Empty","SchedulerTable","BottomInfoBar"],"mappings":";;;;;;;;;;AAkBO,MAAMA,mBAAmBC,SAC5B,CAAC,EAAEC,SAAS,EAAEC,KAAK,EAAEC,QAAQ,EAAyB;IAClD,MAAM,EAAEC,EAAE,EAAE,GAAGH,UAAU,IAAI;IAE7B,MAAMI,gBAAgBC,SAAS,OAAO,EAAEC,WAAW,EAAE;QACjD,IAAIA,YAAY,GAAG,GAAG,KAClB,MAAMN,UAAU,IAAI,CAAC,OAAO,CAAC,QAAQ;IAE7C,GAAG;IAEH,OAAO,WAAP,GACI,oBAACO,eAAaA;QACV,UAAUL;QACV,uBAAS,oBAACM,OAAKA;YAAC,OAAOP;;QACvB,yBAAW,oBAACQ,aAAWA;YAAC,WAAWT;;qBAEnC,oBAACU,WAASA;QAAC,eAAeJ,CAAAA,cAAeF,cAAc;gBAAEE;YAAY;OAChEH,GAAG,KAAK,GAAG,WAAH,GACL,oBAACQ,OAAKA;QAAC,WAAWX;uBAElB,oBAACY,gBAAcA;QAAC,WAAWZ;uBAGnC,oBAACa,eAAaA;QAAC,WAAWb;;AAGtC"}
@@ -0,0 +1,9 @@
1
+ import React from "react";
2
+ import type { ISchedulerListPresenter } from "../abstractions.js";
3
+ interface SchedulerTableProps {
4
+ presenter: ISchedulerListPresenter;
5
+ }
6
+ export declare const SchedulerTable: (({ presenter }: SchedulerTableProps) => React.JSX.Element) & React.NamedExoticComponent<SchedulerTableProps> & {
7
+ readonly type: ({ presenter }: SchedulerTableProps) => React.JSX.Element;
8
+ };
9
+ export {};