@webiny/app-scheduler 6.4.5 → 6.6.0-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/{Gateways/schema → domain}/schedulerEntry.d.ts +1 -1
- package/{Gateways/schema → domain}/schedulerEntry.js +1 -1
- package/domain/schedulerEntry.js.map +1 -0
- package/features/cancelScheduledAction/CancelScheduledActionGateway.d.ts +11 -0
- package/features/cancelScheduledAction/CancelScheduledActionGateway.js +41 -0
- package/features/cancelScheduledAction/CancelScheduledActionGateway.js.map +1 -0
- package/features/cancelScheduledAction/abstractions.d.ts +11 -0
- package/features/cancelScheduledAction/abstractions.js +5 -0
- package/features/cancelScheduledAction/abstractions.js.map +1 -0
- package/features/cancelScheduledAction/feature.d.ts +1 -0
- package/features/cancelScheduledAction/feature.js +11 -0
- package/features/cancelScheduledAction/feature.js.map +1 -0
- package/features/feature.d.ts +1 -0
- package/features/feature.js +19 -0
- package/features/feature.js.map +1 -0
- package/features/getScheduledAction/GetScheduledActionGateway.d.ts +11 -0
- package/features/getScheduledAction/GetScheduledActionGateway.js +57 -0
- package/features/getScheduledAction/GetScheduledActionGateway.js.map +1 -0
- package/{Gateways/abstractions/GetScheduledActionGateway.d.ts → features/getScheduledAction/abstractions.d.ts} +4 -0
- package/features/getScheduledAction/abstractions.js +5 -0
- package/features/getScheduledAction/abstractions.js.map +1 -0
- package/features/getScheduledAction/feature.d.ts +1 -0
- package/features/getScheduledAction/feature.js +11 -0
- package/features/getScheduledAction/feature.js.map +1 -0
- package/features/graphqlFields.d.ts +2 -0
- package/features/graphqlFields.js +23 -0
- package/features/graphqlFields.js.map +1 -0
- package/features/listScheduledActions/ListScheduledActionsGateway.d.ts +11 -0
- package/features/listScheduledActions/ListScheduledActionsGateway.js +84 -0
- package/features/listScheduledActions/ListScheduledActionsGateway.js.map +1 -0
- package/{Gateways/abstractions/ListScheduledActionsGateway.d.ts → features/listScheduledActions/abstractions.d.ts} +5 -2
- package/features/listScheduledActions/abstractions.js +5 -0
- package/features/listScheduledActions/abstractions.js.map +1 -0
- package/features/listScheduledActions/feature.d.ts +1 -0
- package/features/listScheduledActions/feature.js +11 -0
- package/features/listScheduledActions/feature.js.map +1 -0
- package/features/schedulePublishAction/SchedulePublishActionGateway.d.ts +11 -0
- package/features/schedulePublishAction/SchedulePublishActionGateway.js +67 -0
- package/features/schedulePublishAction/SchedulePublishActionGateway.js.map +1 -0
- package/{Gateways/abstractions/SchedulePublishActionGateway.d.ts → features/schedulePublishAction/abstractions.d.ts} +4 -0
- package/features/schedulePublishAction/abstractions.js +5 -0
- package/features/schedulePublishAction/abstractions.js.map +1 -0
- package/features/schedulePublishAction/feature.d.ts +1 -0
- package/features/schedulePublishAction/feature.js +11 -0
- package/features/schedulePublishAction/feature.js.map +1 -0
- package/features/scheduleUnpublishAction/ScheduleUnpublishActionGateway.d.ts +11 -0
- package/features/scheduleUnpublishAction/ScheduleUnpublishActionGateway.js +71 -0
- package/features/scheduleUnpublishAction/ScheduleUnpublishActionGateway.js.map +1 -0
- package/{Gateways/abstractions/ScheduleUnpublishActionGateway.d.ts → features/scheduleUnpublishAction/abstractions.d.ts} +4 -0
- package/features/scheduleUnpublishAction/abstractions.js +5 -0
- package/features/scheduleUnpublishAction/abstractions.js.map +1 -0
- package/features/scheduleUnpublishAction/feature.d.ts +1 -0
- package/features/scheduleUnpublishAction/feature.js +11 -0
- package/features/scheduleUnpublishAction/feature.js.map +1 -0
- package/index.d.ts +9 -1
- package/index.js +16 -1
- package/index.js.map +1 -0
- package/package.json +15 -16
- package/{Presentation → presentation}/SchedulerConfigs/SchedulerConfigs.js.map +1 -1
- package/{Presentation → presentation}/components/Actions/CancelItem/CancelItem.js +2 -3
- package/presentation/components/Actions/CancelItem/CancelItem.js.map +1 -0
- package/{Presentation → presentation}/components/BottomInfoBar/BottomInfoBar.styled.js.map +1 -1
- package/{Presentation → presentation}/components/BottomInfoBar/ListMeta.js.map +1 -1
- package/{Presentation → presentation}/components/BottomInfoBar/ListStatus.js.map +1 -1
- package/{Presentation → presentation}/components/Cells/CellActions/CellActions.js.map +1 -1
- package/{Presentation → presentation}/components/Cells/CellRevision/CellRevision.js.map +1 -1
- package/{Presentation → presentation}/components/Cells/CellRevision/CellRevision.styled.js.map +1 -1
- package/{Presentation → presentation}/components/Cells/CellScheduledBy/CellScheduledBy.js.map +1 -1
- package/{Presentation → presentation}/components/Cells/CellScheduledOn/CellScheduledOn.js.map +1 -1
- package/{Presentation → presentation}/components/Cells/CellTitle/CellTitle.js.map +1 -1
- package/{Presentation → presentation}/components/Cells/CellTitle/CellTitle.styled.js.map +1 -1
- package/{Presentation → presentation}/components/Cells/CellType/CellActionType.js.map +1 -1
- package/{Presentation → presentation}/components/Cells/CellType/CellActionType.styled.js.map +1 -1
- package/{Presentation → presentation}/components/Empty/Empty.styled.js.map +1 -1
- package/{Presentation → presentation}/components/Title/Title.js.map +1 -1
- package/{Presentation → presentation}/components/Title/Title.styled.js.map +1 -1
- package/{Presentation → presentation}/configs/list/Browser/EntryAction.d.ts +2 -1
- package/{Presentation → presentation}/configs/list/Browser/EntryAction.js.map +1 -1
- package/{Presentation → presentation}/configs/list/Browser/Table/Column.d.ts +4 -3
- package/{Presentation → presentation}/configs/list/Browser/Table/Column.js.map +1 -1
- package/{Presentation → presentation}/configs/list/Browser/Table/Sorting.js.map +1 -1
- package/presentation/configs/list/Browser/Table/index.d.ts +19 -0
- package/{Presentation → presentation}/configs/list/Browser/Table/index.js.map +1 -1
- package/presentation/configs/list/Browser/index.d.ts +23 -0
- package/{Presentation → presentation}/configs/list/Browser/index.js.map +1 -1
- package/{Presentation → presentation}/configs/list/SchedulerListConfig.d.ts +8 -6
- package/{Presentation → presentation}/configs/list/SchedulerListConfig.js.map +1 -1
- package/{Presentation → presentation}/hooks/index.d.ts +0 -1
- package/{Presentation → presentation}/hooks/index.js +0 -1
- package/{Presentation → presentation}/hooks/useCancelSchedulerItem.js +12 -7
- package/presentation/hooks/useCancelSchedulerItem.js.map +1 -0
- package/{Presentation → presentation}/hooks/useSchedulerItem.js.map +1 -1
- package/presentation/scheduleDialog/ScheduleDialogPresenter.d.ts +23 -0
- package/{Presentation/components/ScheduleDialog → presentation/scheduleDialog}/ScheduleDialogPresenter.js +22 -8
- package/presentation/scheduleDialog/ScheduleDialogPresenter.js.map +1 -0
- package/{Presentation/components/ScheduleDialog/IScheduleDialogPresenter.d.ts → presentation/scheduleDialog/abstractions.d.ts} +5 -1
- package/presentation/scheduleDialog/abstractions.js +5 -0
- package/presentation/scheduleDialog/abstractions.js.map +1 -0
- package/presentation/scheduleDialog/feature.d.ts +3 -0
- package/presentation/scheduleDialog/feature.js +17 -0
- package/presentation/scheduleDialog/feature.js.map +1 -0
- package/{Presentation/components/ScheduleDialog → presentation/scheduleDialog}/useScheduleDialog.d.ts +0 -2
- package/{Presentation/components/ScheduleDialog → presentation/scheduleDialog}/useScheduleDialog.js +63 -60
- package/presentation/scheduleDialog/useScheduleDialog.js.map +1 -0
- package/{Presentation/index.d.ts → presentation/schedulerList/Scheduler.d.ts} +2 -9
- package/presentation/schedulerList/Scheduler.js +28 -0
- package/presentation/schedulerList/Scheduler.js.map +1 -0
- package/presentation/schedulerList/SchedulerListDataSource.d.ts +15 -0
- package/presentation/schedulerList/SchedulerListDataSource.js +41 -0
- package/presentation/schedulerList/SchedulerListDataSource.js.map +1 -0
- package/presentation/schedulerList/SchedulerListPresenter.d.ts +21 -0
- package/presentation/schedulerList/SchedulerListPresenter.js +47 -0
- package/presentation/schedulerList/SchedulerListPresenter.js.map +1 -0
- package/presentation/schedulerList/abstractions.d.ts +13 -0
- package/presentation/schedulerList/abstractions.js +5 -0
- package/presentation/schedulerList/abstractions.js.map +1 -0
- package/presentation/schedulerList/components/BottomInfoBar.d.ts +9 -0
- package/presentation/schedulerList/components/BottomInfoBar.js +18 -0
- package/presentation/schedulerList/components/BottomInfoBar.js.map +1 -0
- package/presentation/schedulerList/components/Empty.d.ts +9 -0
- package/{Presentation/components/Empty → presentation/schedulerList/components}/Empty.js +6 -6
- package/presentation/schedulerList/components/Empty.js.map +1 -0
- package/presentation/schedulerList/components/SchedulerListView.d.ts +8 -0
- package/presentation/schedulerList/components/SchedulerListView.js +40 -0
- package/presentation/schedulerList/components/SchedulerListView.js.map +1 -0
- package/presentation/schedulerList/components/SchedulerOverlay.d.ts +11 -0
- package/presentation/schedulerList/components/SchedulerOverlay.js +38 -0
- package/presentation/schedulerList/components/SchedulerOverlay.js.map +1 -0
- package/presentation/schedulerList/components/SchedulerTable.d.ts +9 -0
- package/presentation/schedulerList/components/SchedulerTable.js +48 -0
- package/presentation/schedulerList/components/SchedulerTable.js.map +1 -0
- package/presentation/schedulerList/components/SearchInput.d.ts +9 -0
- package/{Presentation/components/SearchInput → presentation/schedulerList/components}/SearchInput.js +8 -8
- package/presentation/schedulerList/components/SearchInput.js.map +1 -0
- package/presentation/schedulerList/feature.d.ts +3 -0
- package/presentation/schedulerList/feature.js +17 -0
- package/presentation/schedulerList/feature.js.map +1 -0
- package/presentation/schedulerList/useSchedulerListPresenter.d.ts +1 -0
- package/presentation/schedulerList/useSchedulerListPresenter.js +6 -0
- package/presentation/schedulerList/useSchedulerListPresenter.js.map +1 -0
- package/types.d.ts +0 -7
- package/types.js +1 -9
- package/types.js.map +1 -1
- package/Domain/Models/SchedulerItem/SchedulerItem.d.ts +0 -13
- package/Domain/Models/SchedulerItem/SchedulerItem.js +0 -18
- package/Domain/Models/SchedulerItem/SchedulerItem.js.map +0 -1
- package/Domain/Models/SchedulerItem/index.d.ts +0 -1
- package/Domain/Models/SchedulerItem/index.js +0 -1
- package/Domain/Models/index.d.ts +0 -1
- package/Domain/Models/index.js +0 -1
- package/Domain/Repositories/SchedulerItems/ISchedulerItemsRepository.d.ts +0 -14
- package/Domain/Repositories/SchedulerItems/ISchedulerItemsRepository.js +0 -0
- package/Domain/Repositories/SchedulerItems/SchedulerItemsRepository.d.ts +0 -36
- package/Domain/Repositories/SchedulerItems/SchedulerItemsRepository.js +0 -119
- package/Domain/Repositories/SchedulerItems/SchedulerItemsRepository.js.map +0 -1
- package/Domain/Repositories/SchedulerItems/SchedulerItemsRepositoryFactory.d.ts +0 -19
- package/Domain/Repositories/SchedulerItems/SchedulerItemsRepositoryFactory.js +0 -18
- package/Domain/Repositories/SchedulerItems/SchedulerItemsRepositoryFactory.js.map +0 -1
- package/Domain/Repositories/SchedulerItems/SchedulerItemsRepositoryWithLoading.d.ts +0 -17
- package/Domain/Repositories/SchedulerItems/SchedulerItemsRepositoryWithLoading.js +0 -39
- package/Domain/Repositories/SchedulerItems/SchedulerItemsRepositoryWithLoading.js.map +0 -1
- package/Domain/Repositories/SchedulerItems/index.d.ts +0 -4
- package/Domain/Repositories/SchedulerItems/index.js +0 -3
- package/Domain/Repositories/Search/ISearchRepository.d.ts +0 -4
- package/Domain/Repositories/Search/ISearchRepository.js +0 -0
- package/Domain/Repositories/Search/SearchRepository.d.ts +0 -7
- package/Domain/Repositories/Search/SearchRepository.js +0 -16
- package/Domain/Repositories/Search/SearchRepository.js.map +0 -1
- package/Domain/Repositories/Search/SearchRepositoryFactory.d.ts +0 -7
- package/Domain/Repositories/Search/SearchRepositoryFactory.js +0 -18
- package/Domain/Repositories/Search/SearchRepositoryFactory.js.map +0 -1
- package/Domain/Repositories/Search/index.d.ts +0 -3
- package/Domain/Repositories/Search/index.js +0 -2
- package/Domain/Repositories/SelectedItems/ISelectedItemsRepository.d.ts +0 -8
- package/Domain/Repositories/SelectedItems/ISelectedItemsRepository.js +0 -0
- package/Domain/Repositories/SelectedItems/SelectedItemsRepository.d.ts +0 -12
- package/Domain/Repositories/SelectedItems/SelectedItemsRepository.js +0 -28
- package/Domain/Repositories/SelectedItems/SelectedItemsRepository.js.map +0 -1
- package/Domain/Repositories/SelectedItems/SelectedItemsRepositoryFactory.d.ts +0 -7
- package/Domain/Repositories/SelectedItems/SelectedItemsRepositoryFactory.js +0 -18
- package/Domain/Repositories/SelectedItems/SelectedItemsRepositoryFactory.js.map +0 -1
- package/Domain/Repositories/SelectedItems/index.d.ts +0 -3
- package/Domain/Repositories/SelectedItems/index.js +0 -2
- package/Domain/Repositories/Sorting/SortingRepositoryWithDefaults.d.ts +0 -8
- package/Domain/Repositories/Sorting/SortingRepositoryWithDefaults.js +0 -21
- package/Domain/Repositories/Sorting/SortingRepositoryWithDefaults.js.map +0 -1
- package/Domain/Repositories/Sorting/index.d.ts +0 -1
- package/Domain/Repositories/Sorting/index.js +0 -1
- package/Domain/Repositories/index.d.ts +0 -4
- package/Domain/Repositories/index.js +0 -4
- package/Domain/index.d.ts +0 -2
- package/Domain/index.js +0 -2
- package/Gateways/SchedulerCancelGraphQLGateway.d.ts +0 -7
- package/Gateways/SchedulerCancelGraphQLGateway.js +0 -42
- package/Gateways/SchedulerCancelGraphQLGateway.js.map +0 -1
- package/Gateways/SchedulerGetGraphQLGateway.d.ts +0 -21
- package/Gateways/SchedulerGetGraphQLGateway.js +0 -68
- package/Gateways/SchedulerGetGraphQLGateway.js.map +0 -1
- package/Gateways/SchedulerListGraphQLGateway.d.ts +0 -7
- package/Gateways/SchedulerListGraphQLGateway.js +0 -86
- package/Gateways/SchedulerListGraphQLGateway.js.map +0 -1
- package/Gateways/SchedulerPublishGraphQLGateway.d.ts +0 -7
- package/Gateways/SchedulerPublishGraphQLGateway.js +0 -59
- package/Gateways/SchedulerPublishGraphQLGateway.js.map +0 -1
- package/Gateways/SchedulerUnpublishGraphQLGateway.d.ts +0 -23
- package/Gateways/SchedulerUnpublishGraphQLGateway.js +0 -63
- package/Gateways/SchedulerUnpublishGraphQLGateway.js.map +0 -1
- package/Gateways/abstractions/CancelScheduledActionGateway.d.ts +0 -7
- package/Gateways/abstractions/CancelScheduledActionGateway.js +0 -0
- package/Gateways/abstractions/GetScheduledActionGateway.js +0 -0
- package/Gateways/abstractions/ListScheduledActionsGateway.js +0 -0
- package/Gateways/abstractions/SchedulePublishActionGateway.js +0 -0
- package/Gateways/abstractions/ScheduleUnpublishActionGateway.js +0 -0
- package/Gateways/graphql/fields.d.ts +0 -1
- package/Gateways/graphql/fields.js +0 -17
- package/Gateways/graphql/fields.js.map +0 -1
- package/Gateways/index.d.ts +0 -5
- package/Gateways/index.js +0 -0
- package/Gateways/schema/schedulerEntry.js.map +0 -1
- package/Presentation/Scheduler/Scheduler.d.ts +0 -17
- package/Presentation/Scheduler/Scheduler.js +0 -78
- package/Presentation/Scheduler/Scheduler.js.map +0 -1
- package/Presentation/Scheduler/SchedulerControllers.d.ts +0 -30
- package/Presentation/Scheduler/SchedulerControllers.js +0 -54
- package/Presentation/Scheduler/SchedulerControllers.js.map +0 -1
- package/Presentation/Scheduler/SchedulerPresenter.d.ts +0 -32
- package/Presentation/Scheduler/SchedulerPresenter.js +0 -45
- package/Presentation/Scheduler/SchedulerPresenter.js.map +0 -1
- package/Presentation/Scheduler/controllers/CancelItem/CancelItemController.d.ts +0 -7
- package/Presentation/Scheduler/controllers/CancelItem/CancelItemController.js +0 -12
- package/Presentation/Scheduler/controllers/CancelItem/CancelItemController.js.map +0 -1
- package/Presentation/Scheduler/controllers/CancelItem/ICancelItemController.d.ts +0 -3
- package/Presentation/Scheduler/controllers/CancelItem/ICancelItemController.js +0 -0
- package/Presentation/Scheduler/controllers/CancelItem/index.d.ts +0 -2
- package/Presentation/Scheduler/controllers/CancelItem/index.js +0 -1
- package/Presentation/Scheduler/controllers/GetItem/GetItemController.d.ts +0 -8
- package/Presentation/Scheduler/controllers/GetItem/GetItemController.js +0 -12
- package/Presentation/Scheduler/controllers/GetItem/GetItemController.js.map +0 -1
- package/Presentation/Scheduler/controllers/GetItem/IGetItemController.d.ts +0 -4
- package/Presentation/Scheduler/controllers/GetItem/IGetItemController.js +0 -0
- package/Presentation/Scheduler/controllers/GetItem/index.d.ts +0 -2
- package/Presentation/Scheduler/controllers/GetItem/index.js +0 -1
- package/Presentation/Scheduler/controllers/ListItems/IListItemsController.d.ts +0 -4
- package/Presentation/Scheduler/controllers/ListItems/IListItemsController.js +0 -0
- package/Presentation/Scheduler/controllers/ListItems/ListItemsController.d.ts +0 -8
- package/Presentation/Scheduler/controllers/ListItems/ListItemsController.js +0 -12
- package/Presentation/Scheduler/controllers/ListItems/ListItemsController.js.map +0 -1
- package/Presentation/Scheduler/controllers/ListItems/index.d.ts +0 -2
- package/Presentation/Scheduler/controllers/ListItems/index.js +0 -1
- package/Presentation/Scheduler/controllers/ListMoreItems/IListMoreItemsController.d.ts +0 -3
- package/Presentation/Scheduler/controllers/ListMoreItems/IListMoreItemsController.js +0 -0
- package/Presentation/Scheduler/controllers/ListMoreItems/ListMoreItemsController.d.ts +0 -7
- package/Presentation/Scheduler/controllers/ListMoreItems/ListMoreItemsController.js +0 -12
- package/Presentation/Scheduler/controllers/ListMoreItems/ListMoreItemsController.js.map +0 -1
- package/Presentation/Scheduler/controllers/ListMoreItems/index.d.ts +0 -2
- package/Presentation/Scheduler/controllers/ListMoreItems/index.js +0 -1
- package/Presentation/Scheduler/controllers/PublishItem/IPublishItemController.d.ts +0 -3
- package/Presentation/Scheduler/controllers/PublishItem/IPublishItemController.js +0 -0
- package/Presentation/Scheduler/controllers/PublishItem/PublishItemController.d.ts +0 -7
- package/Presentation/Scheduler/controllers/PublishItem/PublishItemController.js +0 -12
- package/Presentation/Scheduler/controllers/PublishItem/PublishItemController.js.map +0 -1
- package/Presentation/Scheduler/controllers/PublishItem/index.d.ts +0 -2
- package/Presentation/Scheduler/controllers/PublishItem/index.js +0 -1
- package/Presentation/Scheduler/controllers/SearchItems/ISearchItemsController.d.ts +0 -3
- package/Presentation/Scheduler/controllers/SearchItems/ISearchItemsController.js +0 -0
- package/Presentation/Scheduler/controllers/SearchItems/SearchItemsController.d.ts +0 -8
- package/Presentation/Scheduler/controllers/SearchItems/SearchItemsController.js +0 -15
- package/Presentation/Scheduler/controllers/SearchItems/SearchItemsController.js.map +0 -1
- package/Presentation/Scheduler/controllers/SearchItems/index.d.ts +0 -2
- package/Presentation/Scheduler/controllers/SearchItems/index.js +0 -1
- package/Presentation/Scheduler/controllers/SelectAllItems/ISelectAllItemsController.d.ts +0 -3
- package/Presentation/Scheduler/controllers/SelectAllItems/ISelectAllItemsController.js +0 -0
- package/Presentation/Scheduler/controllers/SelectAllItems/SelectAllItemsController.d.ts +0 -7
- package/Presentation/Scheduler/controllers/SelectAllItems/SelectAllItemsController.js +0 -12
- package/Presentation/Scheduler/controllers/SelectAllItems/SelectAllItemsController.js.map +0 -1
- package/Presentation/Scheduler/controllers/SelectAllItems/index.d.ts +0 -2
- package/Presentation/Scheduler/controllers/SelectAllItems/index.js +0 -1
- package/Presentation/Scheduler/controllers/SelectItems/ISelectItemsController.d.ts +0 -4
- package/Presentation/Scheduler/controllers/SelectItems/ISelectItemsController.js +0 -0
- package/Presentation/Scheduler/controllers/SelectItems/SelectItemsController.d.ts +0 -8
- package/Presentation/Scheduler/controllers/SelectItems/SelectItemsController.js +0 -14
- package/Presentation/Scheduler/controllers/SelectItems/SelectItemsController.js.map +0 -1
- package/Presentation/Scheduler/controllers/SelectItems/index.d.ts +0 -2
- package/Presentation/Scheduler/controllers/SelectItems/index.js +0 -1
- package/Presentation/Scheduler/controllers/SortItems/ISortItemsController.d.ts +0 -4
- package/Presentation/Scheduler/controllers/SortItems/ISortItemsController.js +0 -0
- package/Presentation/Scheduler/controllers/SortItems/SortItemsController.d.ts +0 -9
- package/Presentation/Scheduler/controllers/SortItems/SortItemsController.js +0 -18
- package/Presentation/Scheduler/controllers/SortItems/SortItemsController.js.map +0 -1
- package/Presentation/Scheduler/controllers/SortItems/index.d.ts +0 -2
- package/Presentation/Scheduler/controllers/SortItems/index.js +0 -1
- package/Presentation/Scheduler/controllers/UnpublishItem/IUnpublishItemController.d.ts +0 -3
- package/Presentation/Scheduler/controllers/UnpublishItem/IUnpublishItemController.js +0 -0
- package/Presentation/Scheduler/controllers/UnpublishItem/UnpublishItemController.d.ts +0 -7
- package/Presentation/Scheduler/controllers/UnpublishItem/UnpublishItemController.js +0 -12
- package/Presentation/Scheduler/controllers/UnpublishItem/UnpublishItemController.js.map +0 -1
- package/Presentation/Scheduler/controllers/UnpublishItem/index.d.ts +0 -2
- package/Presentation/Scheduler/controllers/UnpublishItem/index.js +0 -1
- package/Presentation/Scheduler/controllers/UnselectAllItems/IUnselectAllItemsController.d.ts +0 -3
- package/Presentation/Scheduler/controllers/UnselectAllItems/IUnselectAllItemsController.js +0 -0
- package/Presentation/Scheduler/controllers/UnselectAllItems/UnselectAllItemsController.d.ts +0 -7
- package/Presentation/Scheduler/controllers/UnselectAllItems/UnselectAllItemsController.js +0 -12
- package/Presentation/Scheduler/controllers/UnselectAllItems/UnselectAllItemsController.js.map +0 -1
- package/Presentation/Scheduler/controllers/UnselectAllItems/index.d.ts +0 -2
- package/Presentation/Scheduler/controllers/UnselectAllItems/index.js +0 -1
- package/Presentation/Scheduler/controllers/index.d.ts +0 -11
- package/Presentation/Scheduler/controllers/index.js +0 -11
- package/Presentation/Scheduler/index.d.ts +0 -1
- package/Presentation/Scheduler/index.js +0 -1
- package/Presentation/SchedulerRenderer/SchedulerRenderer.d.ts +0 -6
- package/Presentation/SchedulerRenderer/SchedulerRenderer.js +0 -16
- package/Presentation/SchedulerRenderer/SchedulerRenderer.js.map +0 -1
- package/Presentation/SchedulerRenderer/index.d.ts +0 -1
- package/Presentation/SchedulerRenderer/index.js +0 -1
- package/Presentation/abstractions/ISchedulerControllers.d.ts +0 -14
- package/Presentation/abstractions/ISchedulerControllers.js +0 -0
- package/Presentation/abstractions/ISchedulerPresenter.d.ts +0 -20
- package/Presentation/abstractions/ISchedulerPresenter.js +0 -0
- package/Presentation/abstractions/index.d.ts +0 -2
- package/Presentation/abstractions/index.js +0 -0
- package/Presentation/components/Actions/CancelItem/CancelItem.js.map +0 -1
- package/Presentation/components/BottomInfoBar/BottomInfoBar.d.ts +0 -2
- package/Presentation/components/BottomInfoBar/BottomInfoBar.js +0 -19
- package/Presentation/components/BottomInfoBar/BottomInfoBar.js.map +0 -1
- package/Presentation/components/BottomInfoBar/index.d.ts +0 -1
- package/Presentation/components/BottomInfoBar/index.js +0 -1
- package/Presentation/components/Empty/Empty.d.ts +0 -2
- package/Presentation/components/Empty/Empty.js.map +0 -1
- package/Presentation/components/Empty/index.d.ts +0 -1
- package/Presentation/components/Empty/index.js +0 -1
- package/Presentation/components/ScheduleDialog/IScheduleDialogPresenter.js +0 -0
- package/Presentation/components/ScheduleDialog/ScheduleDialogPresenter.d.ts +0 -22
- package/Presentation/components/ScheduleDialog/ScheduleDialogPresenter.js.map +0 -1
- package/Presentation/components/ScheduleDialog/index.d.ts +0 -1
- package/Presentation/components/ScheduleDialog/index.js +0 -1
- package/Presentation/components/ScheduleDialog/types.d.ts +0 -15
- package/Presentation/components/ScheduleDialog/types.js +0 -0
- package/Presentation/components/ScheduleDialog/useScheduleDialog.js.map +0 -1
- package/Presentation/components/SchedulerOverlay/SchedulerOverlay.d.ts +0 -7
- package/Presentation/components/SchedulerOverlay/SchedulerOverlay.js +0 -30
- package/Presentation/components/SchedulerOverlay/SchedulerOverlay.js.map +0 -1
- package/Presentation/components/SchedulerOverlay/index.d.ts +0 -1
- package/Presentation/components/SchedulerOverlay/index.js +0 -1
- package/Presentation/components/SearchInput/SearchInput.d.ts +0 -2
- package/Presentation/components/SearchInput/SearchInput.js.map +0 -1
- package/Presentation/components/SearchInput/index.d.ts +0 -1
- package/Presentation/components/SearchInput/index.js +0 -1
- package/Presentation/components/Table/Table.d.ts +0 -2
- package/Presentation/components/Table/Table.js +0 -29
- package/Presentation/components/Table/Table.js.map +0 -1
- package/Presentation/components/Table/index.d.ts +0 -1
- package/Presentation/components/Table/index.js +0 -1
- package/Presentation/configs/list/Browser/Table/index.d.ts +0 -18
- package/Presentation/configs/list/Browser/index.d.ts +0 -23
- package/Presentation/hooks/useCancelSchedulerItem.js.map +0 -1
- package/Presentation/hooks/useScheduler.d.ts +0 -28
- package/Presentation/hooks/useScheduler.js +0 -68
- package/Presentation/hooks/useScheduler.js.map +0 -1
- package/Presentation/index.js +0 -49
- package/Presentation/index.js.map +0 -1
- package/UseCases/CancelItem/CancelItemUseCase.d.ts +0 -7
- package/UseCases/CancelItem/CancelItemUseCase.js +0 -13
- package/UseCases/CancelItem/CancelItemUseCase.js.map +0 -1
- package/UseCases/CancelItem/ICancelItemUseCase.d.ts +0 -3
- package/UseCases/CancelItem/ICancelItemUseCase.js +0 -0
- package/UseCases/CancelItem/index.d.ts +0 -2
- package/UseCases/CancelItem/index.js +0 -1
- package/UseCases/GetItem/GetItemUseCase.d.ts +0 -8
- package/UseCases/GetItem/GetItemUseCase.js +0 -13
- package/UseCases/GetItem/GetItemUseCase.js.map +0 -1
- package/UseCases/GetItem/IGetItemUseCase.d.ts +0 -4
- package/UseCases/GetItem/IGetItemUseCase.js +0 -0
- package/UseCases/GetItem/index.d.ts +0 -2
- package/UseCases/GetItem/index.js +0 -1
- package/UseCases/GetScheduledItem/GetScheduledItemUseCase.d.ts +0 -7
- package/UseCases/GetScheduledItem/GetScheduledItemUseCase.js +0 -14
- package/UseCases/GetScheduledItem/GetScheduledItemUseCase.js.map +0 -1
- package/UseCases/GetScheduledItem/IGetScheduledItemUseCase.d.ts +0 -4
- package/UseCases/GetScheduledItem/IGetScheduledItemUseCase.js +0 -0
- package/UseCases/GetScheduledItem/index.d.ts +0 -2
- package/UseCases/GetScheduledItem/index.js +0 -1
- package/UseCases/ListItems/IListItemsUseCase.d.ts +0 -4
- package/UseCases/ListItems/IListItemsUseCase.js +0 -0
- package/UseCases/ListItems/ListItemsUseCase.d.ts +0 -8
- package/UseCases/ListItems/ListItemsUseCase.js +0 -13
- package/UseCases/ListItems/ListItemsUseCase.js.map +0 -1
- package/UseCases/ListItems/ListItemsUseCaseWithSearch.d.ts +0 -9
- package/UseCases/ListItems/ListItemsUseCaseWithSearch.js +0 -23
- package/UseCases/ListItems/ListItemsUseCaseWithSearch.js.map +0 -1
- package/UseCases/ListItems/ListItemsUseCaseWithSorting.d.ts +0 -9
- package/UseCases/ListItems/ListItemsUseCaseWithSorting.js +0 -21
- package/UseCases/ListItems/ListItemsUseCaseWithSorting.js.map +0 -1
- package/UseCases/ListItems/index.d.ts +0 -4
- package/UseCases/ListItems/index.js +0 -3
- package/UseCases/ListMoreItems/IListMoreItemsUseCase.d.ts +0 -3
- package/UseCases/ListMoreItems/IListMoreItemsUseCase.js +0 -0
- package/UseCases/ListMoreItems/ListMoreItemsUseCase.d.ts +0 -7
- package/UseCases/ListMoreItems/ListMoreItemsUseCase.js +0 -13
- package/UseCases/ListMoreItems/ListMoreItemsUseCase.js.map +0 -1
- package/UseCases/ListMoreItems/index.d.ts +0 -2
- package/UseCases/ListMoreItems/index.js +0 -1
- package/UseCases/PublishItem/IPublishItemUseCase.d.ts +0 -3
- package/UseCases/PublishItem/IPublishItemUseCase.js +0 -0
- package/UseCases/PublishItem/PublishItemUseCase.d.ts +0 -7
- package/UseCases/PublishItem/PublishItemUseCase.js +0 -13
- package/UseCases/PublishItem/PublishItemUseCase.js.map +0 -1
- package/UseCases/PublishItem/index.d.ts +0 -2
- package/UseCases/PublishItem/index.js +0 -1
- package/UseCases/SearchItems/ISearchItemsUseCase.d.ts +0 -3
- package/UseCases/SearchItems/ISearchItemsUseCase.js +0 -0
- package/UseCases/SearchItems/SearchItemsUseCase.d.ts +0 -7
- package/UseCases/SearchItems/SearchItemsUseCase.js +0 -13
- package/UseCases/SearchItems/SearchItemsUseCase.js.map +0 -1
- package/UseCases/SearchItems/index.d.ts +0 -2
- package/UseCases/SearchItems/index.js +0 -1
- package/UseCases/SelectAllItems/ISelectAllItemsUseCase.d.ts +0 -3
- package/UseCases/SelectAllItems/ISelectAllItemsUseCase.js +0 -0
- package/UseCases/SelectAllItems/SelectAllItemsUseCase.d.ts +0 -7
- package/UseCases/SelectAllItems/SelectAllItemsUseCase.js +0 -13
- package/UseCases/SelectAllItems/SelectAllItemsUseCase.js.map +0 -1
- package/UseCases/SelectAllItems/index.d.ts +0 -2
- package/UseCases/SelectAllItems/index.js +0 -1
- package/UseCases/SelectItems/ISelectItemsUseCase.d.ts +0 -4
- package/UseCases/SelectItems/ISelectItemsUseCase.js +0 -0
- package/UseCases/SelectItems/SelectItemsUseCase.d.ts +0 -7
- package/UseCases/SelectItems/SelectItemsUseCase.js +0 -13
- package/UseCases/SelectItems/SelectItemsUseCase.js.map +0 -1
- package/UseCases/SelectItems/index.d.ts +0 -2
- package/UseCases/SelectItems/index.js +0 -1
- package/UseCases/SortItems/ISortItemsUseCase.d.ts +0 -4
- package/UseCases/SortItems/ISortItemsUseCase.js +0 -0
- package/UseCases/SortItems/SortItemsUseCase.d.ts +0 -7
- package/UseCases/SortItems/SortItemsUseCase.js +0 -13
- package/UseCases/SortItems/SortItemsUseCase.js.map +0 -1
- package/UseCases/SortItems/index.d.ts +0 -2
- package/UseCases/SortItems/index.js +0 -1
- package/UseCases/UnSelectAllItems/IUnselectAllItemsUseCase.d.ts +0 -3
- package/UseCases/UnSelectAllItems/IUnselectAllItemsUseCase.js +0 -0
- package/UseCases/UnSelectAllItems/UnselectAllItemsUseCase.d.ts +0 -7
- package/UseCases/UnSelectAllItems/UnselectAllItemsUseCase.js +0 -13
- package/UseCases/UnSelectAllItems/UnselectAllItemsUseCase.js.map +0 -1
- package/UseCases/UnSelectAllItems/index.d.ts +0 -2
- package/UseCases/UnSelectAllItems/index.js +0 -1
- package/UseCases/UnpublishItem/IUnpublishItemUseCase.d.ts +0 -3
- package/UseCases/UnpublishItem/IUnpublishItemUseCase.js +0 -0
- package/UseCases/UnpublishItem/UnpublishItemUseCase.d.ts +0 -7
- package/UseCases/UnpublishItem/UnpublishItemUseCase.js +0 -13
- package/UseCases/UnpublishItem/UnpublishItemUseCase.js.map +0 -1
- package/UseCases/UnpublishItem/index.d.ts +0 -2
- package/UseCases/UnpublishItem/index.js +0 -1
- package/UseCases/index.d.ts +0 -11
- package/UseCases/index.js +0 -11
- /package/{Presentation → presentation}/SchedulerConfigs/SchedulerConfigs.d.ts +0 -0
- /package/{Presentation → presentation}/SchedulerConfigs/SchedulerConfigs.js +0 -0
- /package/{Presentation → presentation}/SchedulerConfigs/index.d.ts +0 -0
- /package/{Presentation → presentation}/SchedulerConfigs/index.js +0 -0
- /package/{Presentation → presentation}/components/Actions/CancelItem/CancelItem.d.ts +0 -0
- /package/{Presentation → presentation}/components/Actions/CancelItem/index.d.ts +0 -0
- /package/{Presentation → presentation}/components/Actions/CancelItem/index.js +0 -0
- /package/{Presentation → presentation}/components/Actions/index.d.ts +0 -0
- /package/{Presentation → presentation}/components/Actions/index.js +0 -0
- /package/{Presentation → presentation}/components/BottomInfoBar/BottomInfoBar.styled.d.ts +0 -0
- /package/{Presentation → presentation}/components/BottomInfoBar/BottomInfoBar.styled.js +0 -0
- /package/{Presentation → presentation}/components/BottomInfoBar/ListMeta.d.ts +0 -0
- /package/{Presentation → presentation}/components/BottomInfoBar/ListMeta.js +0 -0
- /package/{Presentation → presentation}/components/BottomInfoBar/ListStatus.d.ts +0 -0
- /package/{Presentation → presentation}/components/BottomInfoBar/ListStatus.js +0 -0
- /package/{Presentation → presentation}/components/Cells/CellActions/CellActions.d.ts +0 -0
- /package/{Presentation → presentation}/components/Cells/CellActions/CellActions.js +0 -0
- /package/{Presentation → presentation}/components/Cells/CellActions/index.d.ts +0 -0
- /package/{Presentation → presentation}/components/Cells/CellActions/index.js +0 -0
- /package/{Presentation → presentation}/components/Cells/CellRevision/CellRevision.d.ts +0 -0
- /package/{Presentation → presentation}/components/Cells/CellRevision/CellRevision.js +0 -0
- /package/{Presentation → presentation}/components/Cells/CellRevision/CellRevision.styled.d.ts +0 -0
- /package/{Presentation → presentation}/components/Cells/CellRevision/CellRevision.styled.js +0 -0
- /package/{Presentation → presentation}/components/Cells/CellRevision/index.d.ts +0 -0
- /package/{Presentation → presentation}/components/Cells/CellRevision/index.js +0 -0
- /package/{Presentation → presentation}/components/Cells/CellScheduledBy/CellScheduledBy.d.ts +0 -0
- /package/{Presentation → presentation}/components/Cells/CellScheduledBy/CellScheduledBy.js +0 -0
- /package/{Presentation → presentation}/components/Cells/CellScheduledBy/index.d.ts +0 -0
- /package/{Presentation → presentation}/components/Cells/CellScheduledBy/index.js +0 -0
- /package/{Presentation → presentation}/components/Cells/CellScheduledOn/CellScheduledOn.d.ts +0 -0
- /package/{Presentation → presentation}/components/Cells/CellScheduledOn/CellScheduledOn.js +0 -0
- /package/{Presentation → presentation}/components/Cells/CellScheduledOn/index.d.ts +0 -0
- /package/{Presentation → presentation}/components/Cells/CellScheduledOn/index.js +0 -0
- /package/{Presentation → presentation}/components/Cells/CellTitle/CellTitle.d.ts +0 -0
- /package/{Presentation → presentation}/components/Cells/CellTitle/CellTitle.js +0 -0
- /package/{Presentation → presentation}/components/Cells/CellTitle/CellTitle.styled.d.ts +0 -0
- /package/{Presentation → presentation}/components/Cells/CellTitle/CellTitle.styled.js +0 -0
- /package/{Presentation → presentation}/components/Cells/CellTitle/index.d.ts +0 -0
- /package/{Presentation → presentation}/components/Cells/CellTitle/index.js +0 -0
- /package/{Presentation → presentation}/components/Cells/CellType/CellActionType.d.ts +0 -0
- /package/{Presentation → presentation}/components/Cells/CellType/CellActionType.js +0 -0
- /package/{Presentation → presentation}/components/Cells/CellType/CellActionType.styled.d.ts +0 -0
- /package/{Presentation → presentation}/components/Cells/CellType/CellActionType.styled.js +0 -0
- /package/{Presentation → presentation}/components/Cells/CellType/index.d.ts +0 -0
- /package/{Presentation → presentation}/components/Cells/CellType/index.js +0 -0
- /package/{Presentation → presentation}/components/Cells/index.d.ts +0 -0
- /package/{Presentation → presentation}/components/Cells/index.js +0 -0
- /package/{Presentation → presentation}/components/Empty/Empty.styled.d.ts +0 -0
- /package/{Presentation → presentation}/components/Empty/Empty.styled.js +0 -0
- /package/{Presentation → presentation}/components/Title/Title.d.ts +0 -0
- /package/{Presentation → presentation}/components/Title/Title.js +0 -0
- /package/{Presentation → presentation}/components/Title/Title.styled.d.ts +0 -0
- /package/{Presentation → presentation}/components/Title/Title.styled.js +0 -0
- /package/{Presentation → presentation}/components/Title/index.d.ts +0 -0
- /package/{Presentation → presentation}/components/Title/index.js +0 -0
- /package/{Presentation → presentation}/configs/index.d.ts +0 -0
- /package/{Presentation → presentation}/configs/index.js +0 -0
- /package/{Presentation → presentation}/configs/list/Browser/EntryAction.js +0 -0
- /package/{Presentation → presentation}/configs/list/Browser/Table/Column.js +0 -0
- /package/{Presentation → presentation}/configs/list/Browser/Table/Sorting.d.ts +0 -0
- /package/{Presentation → presentation}/configs/list/Browser/Table/Sorting.js +0 -0
- /package/{Presentation → presentation}/configs/list/Browser/Table/index.js +0 -0
- /package/{Presentation → presentation}/configs/list/Browser/index.js +0 -0
- /package/{Presentation → presentation}/configs/list/SchedulerListConfig.js +0 -0
- /package/{Presentation → presentation}/configs/list/index.d.ts +0 -0
- /package/{Presentation → presentation}/configs/list/index.js +0 -0
- /package/{Presentation → presentation}/hooks/useCancelSchedulerItem.d.ts +0 -0
- /package/{Presentation → presentation}/hooks/useSchedulerItem.d.ts +0 -0
- /package/{Presentation → presentation}/hooks/useSchedulerItem.js +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"
|
|
1
|
+
{"version":3,"file":"presentation/configs/list/SchedulerListConfig.js","sources":["../../../../src/presentation/configs/list/SchedulerListConfig.tsx"],"sourcesContent":["import React, { useMemo } from \"react\";\nimport { createConfigurableComponent } from \"@webiny/react-properties\";\nimport type { BrowserConfig } from \"./Browser/index.js\";\nimport { Browser } from \"./Browser/index.js\";\nimport { CompositionScope } from \"@webiny/react-composition\";\nimport { useAcoConfig } from \"@webiny/app-aco\";\n\nconst base = createConfigurableComponent<SchedulerListConfig>(\"SchedulerListConfig\");\n\nconst ScopedSchedulerListConfig = ({ children }: { children: React.ReactNode }) => {\n return (\n <CompositionScope name={\"scheduler\"}>\n <base.Config>{children}</base.Config>\n </CompositionScope>\n );\n};\n\nScopedSchedulerListConfig.displayName = \"SchedulerListConfig\";\n\nexport const SchedulerListConfig = Object.assign(ScopedSchedulerListConfig, { Browser });\nexport const SchedulerListWithConfig = base.WithConfig;\n\ninterface SchedulerListConfig {\n browser: BrowserConfig;\n}\n\nexport function useSchedulerListConfig() {\n const config = base.useConfig();\n const acoConfig = useAcoConfig(config);\n\n return useMemo(\n () => ({\n browser: {\n table: acoConfig.table,\n entryActions: acoConfig.record.actions,\n bulkActions: []\n }\n }),\n [config]\n );\n}\n"],"names":["base","createConfigurableComponent","ScopedSchedulerListConfig","children","CompositionScope","SchedulerListConfig","Object","Browser","SchedulerListWithConfig","useSchedulerListConfig","config","acoConfig","useAcoConfig","useMemo"],"mappings":";;;;;AAOA,MAAMA,OAAOC,4BAAiD;AAE9D,MAAMC,4BAA4B,CAAC,EAAEC,QAAQ,EAAiC,GACnE,WAAP,GACI,oBAACC,kBAAgBA;QAAC,MAAM;qBACpB,oBAACJ,KAAK,MAAM,QAAEG;AAK1BD,0BAA0B,WAAW,GAAG;AAEjC,MAAMG,sBAAsBC,OAAO,MAAM,CAACJ,2BAA2B;IAAEK,SAAOA;AAAC;AAC/E,MAAMC,0BAA0BR,KAAK,UAAU;AAM/C,SAASS;IACZ,MAAMC,SAASV,KAAK,SAAS;IAC7B,MAAMW,YAAYC,aAAaF;IAE/B,OAAOG,QACH,IAAO;YACH,SAAS;gBACL,OAAOF,UAAU,KAAK;gBACtB,cAAcA,UAAU,MAAM,CAAC,OAAO;gBACtC,aAAa,EAAE;YACnB;QACJ,IACA;QAACD;KAAO;AAEhB"}
|
|
@@ -1,19 +1,24 @@
|
|
|
1
1
|
import react, { useCallback } from "react";
|
|
2
|
-
import { useConfirmationDialog
|
|
3
|
-
import {
|
|
2
|
+
import { useConfirmationDialog } from "@webiny/app-admin";
|
|
3
|
+
import { useSchedulerListPresenter } from "../schedulerList/useSchedulerListPresenter.js";
|
|
4
|
+
import { useToast } from "@webiny/admin-ui";
|
|
4
5
|
const useCancelSchedulerItem = ({ item })=>{
|
|
5
|
-
const
|
|
6
|
-
const
|
|
6
|
+
const presenter = useSchedulerListPresenter();
|
|
7
|
+
const toast = useToast();
|
|
7
8
|
const { showConfirmation } = useConfirmationDialog({
|
|
8
9
|
title: "Cancel scheduled action?",
|
|
9
10
|
message: /*#__PURE__*/ react.createElement("p", null, "You are about to cancel scheduled action for this item!", /*#__PURE__*/ react.createElement("br", null), "Are you sure you want to cancel scheduled ", /*#__PURE__*/ react.createElement("strong", null, item.actionType), " for", " ", /*#__PURE__*/ react.createElement("strong", null, item.title), "?")
|
|
10
11
|
});
|
|
11
12
|
const openDialogCancelSchedulerItem = useCallback(()=>showConfirmation(async ()=>{
|
|
12
13
|
try {
|
|
13
|
-
await cancelItem(item.id);
|
|
14
|
-
|
|
14
|
+
await presenter.cancelItem(item.id);
|
|
15
|
+
toast.showSuccessToast({
|
|
16
|
+
title: `Action on item "${item.title}" was canceled successfully!`
|
|
17
|
+
});
|
|
15
18
|
} catch (ex) {
|
|
16
|
-
|
|
19
|
+
toast.showWarningToast({
|
|
20
|
+
title: ex.message || `Error while canceling action for "${item.title}".`
|
|
21
|
+
});
|
|
17
22
|
}
|
|
18
23
|
}), [
|
|
19
24
|
item
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"presentation/hooks/useCancelSchedulerItem.js","sources":["../../../src/presentation/hooks/useCancelSchedulerItem.tsx"],"sourcesContent":["import React, { useCallback } from \"react\";\nimport { useConfirmationDialog } from \"@webiny/app-admin\";\nimport type { SchedulerEntry } from \"~/types.js\";\nimport { useSchedulerListPresenter } from \"~/presentation/schedulerList/useSchedulerListPresenter.js\";\nimport { useToast } from \"@webiny/admin-ui\";\n\ninterface UseCancelScheduleItemParams {\n item: Pick<SchedulerEntry, \"id\" | \"title\" | \"actionType\">;\n}\n\nexport const useCancelSchedulerItem = ({ item }: UseCancelScheduleItemParams) => {\n const presenter = useSchedulerListPresenter();\n const toast = useToast();\n\n const { showConfirmation } = useConfirmationDialog({\n title: \"Cancel scheduled action?\",\n message: (\n <p>\n You are about to cancel scheduled action for this item!\n <br />\n Are you sure you want to cancel scheduled <strong>{item.actionType}</strong> for{\" \"}\n <strong>{item.title}</strong>?\n </p>\n )\n });\n\n const openDialogCancelSchedulerItem = useCallback(\n () =>\n showConfirmation(async () => {\n try {\n await presenter.cancelItem(item.id);\n toast.showSuccessToast({\n title: `Action on item \"${item.title}\" was canceled successfully!`\n });\n } catch (ex) {\n toast.showWarningToast({\n title: ex.message || `Error while canceling action for \"${item.title}\".`\n });\n }\n }),\n [item]\n );\n\n return { openDialogCancelSchedulerItem };\n};\n"],"names":["useCancelSchedulerItem","item","presenter","useSchedulerListPresenter","toast","useToast","showConfirmation","useConfirmationDialog","openDialogCancelSchedulerItem","useCallback","ex"],"mappings":";;;;AAUO,MAAMA,yBAAyB,CAAC,EAAEC,IAAI,EAA+B;IACxE,MAAMC,YAAYC;IAClB,MAAMC,QAAQC;IAEd,MAAM,EAAEC,gBAAgB,EAAE,GAAGC,sBAAsB;QAC/C,OAAO;QACP,SAAS,WAAT,GACI,oBAAC,WAAE,yEAEC,oBAAC,aAAK,4DACoC,oBAAC,gBAAQN,KAAK,UAAU,GAAU,QAAK,mBACjF,oBAAC,gBAAQA,KAAK,KAAK,GAAU;IAGzC;IAEA,MAAMO,gCAAgCC,YAClC,IACIH,iBAAiB;YACb,IAAI;gBACA,MAAMJ,UAAU,UAAU,CAACD,KAAK,EAAE;gBAClCG,MAAM,gBAAgB,CAAC;oBACnB,OAAO,CAAC,gBAAgB,EAAEH,KAAK,KAAK,CAAC,4BAA4B,CAAC;gBACtE;YACJ,EAAE,OAAOS,IAAI;gBACTN,MAAM,gBAAgB,CAAC;oBACnB,OAAOM,GAAG,OAAO,IAAI,CAAC,kCAAkC,EAAET,KAAK,KAAK,CAAC,EAAE,CAAC;gBAC5E;YACJ;QACJ,IACJ;QAACA;KAAK;IAGV,OAAO;QAAEO;IAA8B;AAC3C"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"
|
|
1
|
+
{"version":3,"file":"presentation/hooks/useSchedulerItem.js","sources":["../../../src/presentation/hooks/useSchedulerItem.tsx"],"sourcesContent":["import { createGenericContext } from \"@webiny/app-admin\";\nimport type { SchedulerEntry } from \"~/types.js\";\n\nexport interface SchedulerItemContext {\n item: SchedulerEntry;\n}\n\nconst { Provider, useHook } = createGenericContext<SchedulerItemContext>(\"SchedulerItemContext\");\n\nexport const useSchedulerItem = useHook;\nexport const SchedulerItemProvider = Provider;\n"],"names":["Provider","useHook","createGenericContext","useSchedulerItem","SchedulerItemProvider"],"mappings":";AAOA,MAAM,EAAEA,UAAAA,QAAQ,EAAEC,SAAAA,OAAO,EAAE,GAAGC,qBAA2C;AAElE,MAAMC,mBAAmBF;AACzB,MAAMG,wBAAwBJ"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { GetScheduledActionGateway } from "../../features/getScheduledAction/abstractions.js";
|
|
2
|
+
import { CancelScheduledActionGateway } from "../../features/cancelScheduledAction/abstractions.js";
|
|
3
|
+
import { SchedulePublishActionGateway } from "../../features/schedulePublishAction/abstractions.js";
|
|
4
|
+
import { ScheduleUnpublishActionGateway } from "../../features/scheduleUnpublishAction/abstractions.js";
|
|
5
|
+
import { type IScheduleDialogPresenter, type IScheduleDialogPresenterViewModel, type IScheduleDialogPresenterLoadParams, type IScheduleDialogPresenterScheduleParams, type IScheduleDialogPresenterCancelParams } from "./abstractions.js";
|
|
6
|
+
declare class ScheduleDialogPresenterImpl implements IScheduleDialogPresenter {
|
|
7
|
+
private readonly getGateway;
|
|
8
|
+
private readonly cancelGateway;
|
|
9
|
+
private readonly publishGateway;
|
|
10
|
+
private readonly unpublishGateway;
|
|
11
|
+
private loading;
|
|
12
|
+
private entry;
|
|
13
|
+
constructor(getGateway: GetScheduledActionGateway.Interface, cancelGateway: CancelScheduledActionGateway.Interface, publishGateway: SchedulePublishActionGateway.Interface, unpublishGateway: ScheduleUnpublishActionGateway.Interface);
|
|
14
|
+
get vm(): IScheduleDialogPresenterViewModel;
|
|
15
|
+
load(params: IScheduleDialogPresenterLoadParams): Promise<void>;
|
|
16
|
+
schedule(params: IScheduleDialogPresenterScheduleParams): Promise<void>;
|
|
17
|
+
cancel(params: IScheduleDialogPresenterCancelParams): Promise<void>;
|
|
18
|
+
reset(): void;
|
|
19
|
+
}
|
|
20
|
+
export declare const ScheduleDialogPresenter: typeof ScheduleDialogPresenterImpl & {
|
|
21
|
+
__abstraction: import("@webiny/di").Abstraction<IScheduleDialogPresenter>;
|
|
22
|
+
};
|
|
23
|
+
export {};
|
|
@@ -1,13 +1,18 @@
|
|
|
1
1
|
import { makeAutoObservable, runInAction } from "mobx";
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
import { GetScheduledActionGateway } from "../../features/getScheduledAction/abstractions.js";
|
|
3
|
+
import { CancelScheduledActionGateway } from "../../features/cancelScheduledAction/abstractions.js";
|
|
4
|
+
import { SchedulePublishActionGateway } from "../../features/schedulePublishAction/abstractions.js";
|
|
5
|
+
import { ScheduleUnpublishActionGateway } from "../../features/scheduleUnpublishAction/abstractions.js";
|
|
6
|
+
import { ScheduleActionType } from "../../types.js";
|
|
7
|
+
import { ScheduleDialogPresenter } from "./abstractions.js";
|
|
8
|
+
class ScheduleDialogPresenterImpl {
|
|
9
|
+
constructor(getGateway, cancelGateway, publishGateway, unpublishGateway){
|
|
10
|
+
this.getGateway = getGateway;
|
|
11
|
+
this.cancelGateway = cancelGateway;
|
|
12
|
+
this.publishGateway = publishGateway;
|
|
13
|
+
this.unpublishGateway = unpublishGateway;
|
|
5
14
|
this.loading = false;
|
|
6
15
|
this.entry = null;
|
|
7
|
-
this.getGateway = params.getGateway;
|
|
8
|
-
this.cancelGateway = params.cancelGateway;
|
|
9
|
-
this.publishGateway = params.publishGateway;
|
|
10
|
-
this.unpublishGateway = params.unpublishGateway;
|
|
11
16
|
makeAutoObservable(this);
|
|
12
17
|
}
|
|
13
18
|
get vm() {
|
|
@@ -81,6 +86,15 @@ class ScheduleDialogPresenter {
|
|
|
81
86
|
this.loading = false;
|
|
82
87
|
}
|
|
83
88
|
}
|
|
84
|
-
|
|
89
|
+
const ScheduleDialogPresenter_ScheduleDialogPresenter = ScheduleDialogPresenter.createImplementation({
|
|
90
|
+
implementation: ScheduleDialogPresenterImpl,
|
|
91
|
+
dependencies: [
|
|
92
|
+
GetScheduledActionGateway,
|
|
93
|
+
CancelScheduledActionGateway,
|
|
94
|
+
SchedulePublishActionGateway,
|
|
95
|
+
ScheduleUnpublishActionGateway
|
|
96
|
+
]
|
|
97
|
+
});
|
|
98
|
+
export { ScheduleDialogPresenter_ScheduleDialogPresenter as ScheduleDialogPresenter };
|
|
85
99
|
|
|
86
100
|
//# sourceMappingURL=ScheduleDialogPresenter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"presentation/scheduleDialog/ScheduleDialogPresenter.js","sources":["../../../src/presentation/scheduleDialog/ScheduleDialogPresenter.ts"],"sourcesContent":["import { makeAutoObservable, runInAction } from \"mobx\";\nimport { GetScheduledActionGateway } from \"~/features/getScheduledAction/abstractions.js\";\nimport { CancelScheduledActionGateway } from \"~/features/cancelScheduledAction/abstractions.js\";\nimport { SchedulePublishActionGateway } from \"~/features/schedulePublishAction/abstractions.js\";\nimport { ScheduleUnpublishActionGateway } from \"~/features/scheduleUnpublishAction/abstractions.js\";\nimport { ScheduleActionType } from \"~/types.js\";\nimport type { SchedulerEntry } from \"~/types.js\";\nimport {\n ScheduleDialogPresenter as Abstraction,\n type IScheduleDialogPresenter,\n type IScheduleDialogPresenterViewModel,\n type IScheduleDialogPresenterLoadParams,\n type IScheduleDialogPresenterScheduleParams,\n type IScheduleDialogPresenterCancelParams\n} from \"./abstractions.js\";\n\nclass ScheduleDialogPresenterImpl implements IScheduleDialogPresenter {\n private loading = false;\n private entry: SchedulerEntry | null = null;\n\n constructor(\n private readonly getGateway: GetScheduledActionGateway.Interface,\n private readonly cancelGateway: CancelScheduledActionGateway.Interface,\n private readonly publishGateway: SchedulePublishActionGateway.Interface,\n private readonly unpublishGateway: ScheduleUnpublishActionGateway.Interface\n ) {\n makeAutoObservable(this);\n }\n\n get vm(): IScheduleDialogPresenterViewModel {\n return {\n loading: this.loading,\n entry: this.entry\n };\n }\n\n async load(params: IScheduleDialogPresenterLoadParams): Promise<void> {\n this.loading = true;\n\n try {\n const entry = await this.getGateway.execute(params);\n runInAction(() => {\n this.entry = entry;\n this.loading = false;\n });\n } catch {\n runInAction(() => {\n this.loading = false;\n });\n }\n }\n\n async schedule(params: IScheduleDialogPresenterScheduleParams): Promise<void> {\n const { targetId, namespace, scheduleOn, actionType } = params;\n this.loading = true;\n\n try {\n switch (actionType) {\n case ScheduleActionType.publish:\n await this.publishGateway.execute({ namespace, targetId, scheduleOn });\n break;\n case ScheduleActionType.unpublish:\n await this.unpublishGateway.execute({ namespace, targetId, scheduleOn });\n break;\n default:\n throw new Error(`Unsupported action type \"${actionType}\".`);\n }\n runInAction(() => {\n this.entry = null;\n this.loading = false;\n });\n } catch {\n runInAction(() => {\n this.loading = false;\n });\n }\n }\n\n async cancel(params: IScheduleDialogPresenterCancelParams): Promise<void> {\n this.loading = true;\n\n try {\n await this.cancelGateway.execute(params);\n runInAction(() => {\n this.entry = null;\n this.loading = false;\n });\n } catch {\n runInAction(() => {\n this.loading = false;\n });\n }\n }\n\n reset(): void {\n this.entry = null;\n this.loading = false;\n }\n}\n\nexport const ScheduleDialogPresenter = Abstraction.createImplementation({\n implementation: ScheduleDialogPresenterImpl,\n dependencies: [\n GetScheduledActionGateway,\n CancelScheduledActionGateway,\n SchedulePublishActionGateway,\n ScheduleUnpublishActionGateway\n ]\n});\n"],"names":["ScheduleDialogPresenterImpl","getGateway","cancelGateway","publishGateway","unpublishGateway","makeAutoObservable","params","entry","runInAction","targetId","namespace","scheduleOn","actionType","ScheduleActionType","Error","ScheduleDialogPresenter","Abstraction","GetScheduledActionGateway","CancelScheduledActionGateway","SchedulePublishActionGateway","ScheduleUnpublishActionGateway"],"mappings":";;;;;;;AAgBA,MAAMA;IAIF,YACqBC,UAA+C,EAC/CC,aAAqD,EACrDC,cAAsD,EACtDC,gBAA0D,CAC7E;aAJmBH,UAAU,GAAVA;aACAC,aAAa,GAAbA;aACAC,cAAc,GAAdA;aACAC,gBAAgB,GAAhBA;aAPb,OAAO,GAAG;aACV,KAAK,GAA0B;QAQnCC,mBAAmB,IAAI;IAC3B;IAEA,IAAI,KAAwC;QACxC,OAAO;YACH,SAAS,IAAI,CAAC,OAAO;YACrB,OAAO,IAAI,CAAC,KAAK;QACrB;IACJ;IAEA,MAAM,KAAKC,MAA0C,EAAiB;QAClE,IAAI,CAAC,OAAO,GAAG;QAEf,IAAI;YACA,MAAMC,QAAQ,MAAM,IAAI,CAAC,UAAU,CAAC,OAAO,CAACD;YAC5CE,YAAY;gBACR,IAAI,CAAC,KAAK,GAAGD;gBACb,IAAI,CAAC,OAAO,GAAG;YACnB;QACJ,EAAE,OAAM;YACJC,YAAY;gBACR,IAAI,CAAC,OAAO,GAAG;YACnB;QACJ;IACJ;IAEA,MAAM,SAASF,MAA8C,EAAiB;QAC1E,MAAM,EAAEG,QAAQ,EAAEC,SAAS,EAAEC,UAAU,EAAEC,UAAU,EAAE,GAAGN;QACxD,IAAI,CAAC,OAAO,GAAG;QAEf,IAAI;YACA,OAAQM;gBACJ,KAAKC,mBAAmB,OAAO;oBAC3B,MAAM,IAAI,CAAC,cAAc,CAAC,OAAO,CAAC;wBAAEH;wBAAWD;wBAAUE;oBAAW;oBACpE;gBACJ,KAAKE,mBAAmB,SAAS;oBAC7B,MAAM,IAAI,CAAC,gBAAgB,CAAC,OAAO,CAAC;wBAAEH;wBAAWD;wBAAUE;oBAAW;oBACtE;gBACJ;oBACI,MAAM,IAAIG,MAAM,CAAC,yBAAyB,EAAEF,WAAW,EAAE,CAAC;YAClE;YACAJ,YAAY;gBACR,IAAI,CAAC,KAAK,GAAG;gBACb,IAAI,CAAC,OAAO,GAAG;YACnB;QACJ,EAAE,OAAM;YACJA,YAAY;gBACR,IAAI,CAAC,OAAO,GAAG;YACnB;QACJ;IACJ;IAEA,MAAM,OAAOF,MAA4C,EAAiB;QACtE,IAAI,CAAC,OAAO,GAAG;QAEf,IAAI;YACA,MAAM,IAAI,CAAC,aAAa,CAAC,OAAO,CAACA;YACjCE,YAAY;gBACR,IAAI,CAAC,KAAK,GAAG;gBACb,IAAI,CAAC,OAAO,GAAG;YACnB;QACJ,EAAE,OAAM;YACJA,YAAY;gBACR,IAAI,CAAC,OAAO,GAAG;YACnB;QACJ;IACJ;IAEA,QAAc;QACV,IAAI,CAAC,KAAK,GAAG;QACb,IAAI,CAAC,OAAO,GAAG;IACnB;AACJ;AAEO,MAAMO,kDAA0BC,wBAAAA,oBAAgC,CAAC;IACpE,gBAAgBhB;IAChB,cAAc;QACViB;QACAC;QACAC;QACAC;KACH;AACL"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ScheduleActionType, SchedulerEntry } from "
|
|
1
|
+
import type { ScheduleActionType, SchedulerEntry } from "../../types.js";
|
|
2
2
|
export interface IScheduleDialogPresenterViewModel {
|
|
3
3
|
loading: boolean;
|
|
4
4
|
entry: SchedulerEntry | null;
|
|
@@ -24,3 +24,7 @@ export interface IScheduleDialogPresenter {
|
|
|
24
24
|
cancel(params: IScheduleDialogPresenterCancelParams): Promise<void>;
|
|
25
25
|
reset(): void;
|
|
26
26
|
}
|
|
27
|
+
export declare const ScheduleDialogPresenter: import("@webiny/di").Abstraction<IScheduleDialogPresenter>;
|
|
28
|
+
export declare namespace ScheduleDialogPresenter {
|
|
29
|
+
type Interface = IScheduleDialogPresenter;
|
|
30
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"presentation/scheduleDialog/abstractions.js","sources":["../../../src/presentation/scheduleDialog/abstractions.ts"],"sourcesContent":["import { createAbstraction } from \"@webiny/feature/admin\";\nimport type { ScheduleActionType, SchedulerEntry } from \"~/types.js\";\n\nexport interface IScheduleDialogPresenterViewModel {\n loading: boolean;\n entry: SchedulerEntry | null;\n}\n\nexport interface IScheduleDialogPresenterLoadParams {\n namespace: string;\n id: string;\n}\n\nexport interface IScheduleDialogPresenterScheduleParams {\n targetId: string;\n namespace: string;\n scheduleOn: Date;\n actionType: ScheduleActionType;\n}\n\nexport interface IScheduleDialogPresenterCancelParams {\n id: string;\n namespace: string;\n}\n\nexport interface IScheduleDialogPresenter {\n get vm(): IScheduleDialogPresenterViewModel;\n load(params: IScheduleDialogPresenterLoadParams): Promise<void>;\n schedule(params: IScheduleDialogPresenterScheduleParams): Promise<void>;\n cancel(params: IScheduleDialogPresenterCancelParams): Promise<void>;\n reset(): void;\n}\n\nexport const ScheduleDialogPresenter = createAbstraction<IScheduleDialogPresenter>(\n \"Scheduler/ScheduleDialogPresenter\"\n);\n\nexport namespace ScheduleDialogPresenter {\n export type Interface = IScheduleDialogPresenter;\n}\n"],"names":["ScheduleDialogPresenter","createAbstraction"],"mappings":";AAiCO,MAAMA,0BAA0BC,kBACnC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { createFeature } from "@webiny/feature/admin";
|
|
2
|
+
import { ScheduleDialogPresenter } from "./abstractions.js";
|
|
3
|
+
import { ScheduleDialogPresenter as external_ScheduleDialogPresenter_js_ScheduleDialogPresenter } from "./ScheduleDialogPresenter.js";
|
|
4
|
+
const ScheduleDialogPresenterFeature = createFeature({
|
|
5
|
+
name: "Scheduler/ScheduleDialogPresenter",
|
|
6
|
+
register (container) {
|
|
7
|
+
container.register(external_ScheduleDialogPresenter_js_ScheduleDialogPresenter);
|
|
8
|
+
},
|
|
9
|
+
resolve (container) {
|
|
10
|
+
return {
|
|
11
|
+
presenter: container.resolve(ScheduleDialogPresenter)
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
});
|
|
15
|
+
export { ScheduleDialogPresenterFeature };
|
|
16
|
+
|
|
17
|
+
//# sourceMappingURL=feature.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"presentation/scheduleDialog/feature.js","sources":["../../../src/presentation/scheduleDialog/feature.ts"],"sourcesContent":["import { createFeature } from \"@webiny/feature/admin\";\nimport { ScheduleDialogPresenter as PresenterAbstraction } from \"./abstractions.js\";\nimport { ScheduleDialogPresenter } from \"./ScheduleDialogPresenter.js\";\n\nexport const ScheduleDialogPresenterFeature = createFeature({\n name: \"Scheduler/ScheduleDialogPresenter\",\n register(container) {\n container.register(ScheduleDialogPresenter);\n },\n resolve(container) {\n return { presenter: container.resolve(PresenterAbstraction) };\n }\n});\n"],"names":["ScheduleDialogPresenterFeature","createFeature","container","ScheduleDialogPresenter","PresenterAbstraction"],"mappings":";;;AAIO,MAAMA,iCAAiCC,cAAc;IACxD,MAAM;IACN,UAASC,SAAS;QACdA,UAAU,QAAQ,CAACC;IACvB;IACA,SAAQD,SAAS;QACb,OAAO;YAAE,WAAWA,UAAU,OAAO,CAACE;QAAsB;IAChE;AACJ"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { type BindComponentRenderProp } from "@webiny/form";
|
|
3
|
-
import ApolloClient from "apollo-client/ApolloClient.js";
|
|
4
3
|
export type ShowDialogParamsEntryStatus = "published" | "unpublished" | "draft" | string;
|
|
5
4
|
export interface IShowDialogParamsEntry {
|
|
6
5
|
id: string;
|
|
@@ -33,7 +32,6 @@ export declare const SchedulerDialogFormComponentDateTimeInput: ((props: ISchedu
|
|
|
33
32
|
}>) => (props: unknown) => React.JSX.Element;
|
|
34
33
|
};
|
|
35
34
|
export interface IUseScheduleDialogProps {
|
|
36
|
-
client: ApolloClient<object>;
|
|
37
35
|
namespace: string;
|
|
38
36
|
target: IShowDialogParamsEntry;
|
|
39
37
|
}
|
package/{Presentation/components/ScheduleDialog → presentation/scheduleDialog}/useScheduleDialog.js
RENAMED
|
@@ -1,17 +1,15 @@
|
|
|
1
1
|
import react, { useCallback, useMemo, useRef } from "react";
|
|
2
|
-
import {
|
|
2
|
+
import { observer } from "mobx-react-lite";
|
|
3
|
+
import { useContainer } from "@webiny/app";
|
|
4
|
+
import { Alert, Button, DatePicker, Grid, useToast } from "@webiny/admin-ui";
|
|
3
5
|
import { ReactComponent } from "@webiny/icons/delete.svg";
|
|
4
|
-
import { useDialogs
|
|
6
|
+
import { useDialogs } from "@webiny/app-admin";
|
|
5
7
|
import { Bind } from "@webiny/form";
|
|
6
8
|
import { validation } from "@webiny/validation";
|
|
7
|
-
import { ScheduleActionType } from "../../../types.js";
|
|
8
9
|
import validationError from "@webiny/validation/validationError.js";
|
|
9
10
|
import { makeDecoratable } from "@webiny/react-composition";
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import { SchedulerUnpublishGraphQLGateway } from "../../../Gateways/SchedulerUnpublishGraphQLGateway.js";
|
|
13
|
-
import { SchedulerGetGraphQLGateway } from "../../../Gateways/SchedulerGetGraphQLGateway.js";
|
|
14
|
-
import { ScheduleDialogPresenter } from "./ScheduleDialogPresenter.js";
|
|
11
|
+
import { ScheduleActionType } from "../../types.js";
|
|
12
|
+
import { ScheduleDialogPresenter } from "./abstractions.js";
|
|
15
13
|
const dateToLocaleStringFormatter = new Intl.DateTimeFormat(void 0, {
|
|
16
14
|
year: "numeric",
|
|
17
15
|
month: "2-digit",
|
|
@@ -28,17 +26,6 @@ const ReschedulingAlert = ({ scheduleOn, actionType })=>{
|
|
|
28
26
|
type: "danger"
|
|
29
27
|
}, /*#__PURE__*/ react.createElement(react.Fragment, null, "A ", actionName, " is already scheduled at", /*#__PURE__*/ react.createElement("br", null), /*#__PURE__*/ react.createElement("strong", null, dateToLocaleStringFormatter.format(scheduleOn)), "."));
|
|
30
28
|
};
|
|
31
|
-
const padLeft = (num)=>String(num).padStart(2, "0");
|
|
32
|
-
const formatDateForDateTimeLocal = (date)=>{
|
|
33
|
-
if (!date) return;
|
|
34
|
-
if ("string" == typeof date) date = new Date(date);
|
|
35
|
-
const year = date.getFullYear();
|
|
36
|
-
const month = padLeft(date.getMonth() + 1);
|
|
37
|
-
const day = padLeft(date.getDate());
|
|
38
|
-
const hours = padLeft(date.getHours());
|
|
39
|
-
const minutes = padLeft(date.getMinutes());
|
|
40
|
-
return `${year}-${month}-${day}T${hours}:${minutes}`;
|
|
41
|
-
};
|
|
42
29
|
const minDateValidator = (input)=>{
|
|
43
30
|
const value = new Date(input);
|
|
44
31
|
const minDate = new Date(new Date().getTime() + 120000);
|
|
@@ -46,7 +33,10 @@ const minDateValidator = (input)=>{
|
|
|
46
33
|
throw new validationError(`The date must be at least 2 minutes in the future. Current minimum date is ${dateToLocaleStringFormatter.format(minDate)}.`);
|
|
47
34
|
};
|
|
48
35
|
minDateValidator.validatorName = "minDateValidator";
|
|
49
|
-
const CancelButtonComponent = ({
|
|
36
|
+
const CancelButtonComponent = observer(({ presenter, onCancel })=>{
|
|
37
|
+
const { entry } = presenter.vm;
|
|
38
|
+
const scheduleOn = entry?.publishOn || entry?.unpublishOn;
|
|
39
|
+
const enabled = !!scheduleOn;
|
|
50
40
|
if (!enabled) return null;
|
|
51
41
|
return /*#__PURE__*/ react.createElement(Button, {
|
|
52
42
|
variant: "ghost",
|
|
@@ -56,21 +46,21 @@ const CancelButtonComponent = ({ enabled, onCancel })=>{
|
|
|
56
46
|
icon: /*#__PURE__*/ react.createElement(ReactComponent, null),
|
|
57
47
|
iconPosition: "start"
|
|
58
48
|
});
|
|
59
|
-
};
|
|
49
|
+
});
|
|
60
50
|
const SchedulerDialogFormComponentDateTimeInput = makeDecoratable("SchedulerDialogFormComponentDateTimeInput", (props)=>{
|
|
61
51
|
const { bind } = props;
|
|
62
|
-
return /*#__PURE__*/ react.createElement(
|
|
52
|
+
return /*#__PURE__*/ react.createElement(DatePicker, {
|
|
63
53
|
...bind,
|
|
64
|
-
|
|
65
|
-
title: "Schedule On",
|
|
54
|
+
type: "dateTimeLocal",
|
|
66
55
|
label: "Schedule On",
|
|
67
|
-
size: "lg"
|
|
68
|
-
type: "datetime-local",
|
|
69
|
-
required: true,
|
|
70
|
-
autoFocus: true
|
|
56
|
+
size: "lg"
|
|
71
57
|
});
|
|
72
58
|
});
|
|
73
|
-
const FormComponent = ({
|
|
59
|
+
const FormComponent = observer(({ presenter })=>{
|
|
60
|
+
const { entry } = presenter.vm;
|
|
61
|
+
const scheduleOn = entry?.publishOn || entry?.unpublishOn;
|
|
62
|
+
const actionType = entry?.actionType;
|
|
63
|
+
return /*#__PURE__*/ react.createElement(react.Fragment, null, /*#__PURE__*/ react.createElement(ReschedulingAlert, {
|
|
74
64
|
actionType: actionType,
|
|
75
65
|
scheduleOn: scheduleOn
|
|
76
66
|
}), /*#__PURE__*/ react.createElement(Grid, null, /*#__PURE__*/ react.createElement(Grid.Column, {
|
|
@@ -84,17 +74,14 @@ const FormComponent = ({ scheduleOn, actionType })=>/*#__PURE__*/ react.createEl
|
|
|
84
74
|
}, (bind)=>/*#__PURE__*/ react.createElement(SchedulerDialogFormComponentDateTimeInput, {
|
|
85
75
|
bind: bind
|
|
86
76
|
})))));
|
|
77
|
+
});
|
|
87
78
|
const useScheduleDialog = (props)=>{
|
|
88
|
-
const {
|
|
79
|
+
const { target, namespace } = props;
|
|
80
|
+
const container = useContainer();
|
|
89
81
|
const dialog = useDialogs();
|
|
90
|
-
const
|
|
91
|
-
const presenter = useMemo(()=>
|
|
92
|
-
|
|
93
|
-
cancelGateway: new SchedulerCancelGraphQLGateway(client),
|
|
94
|
-
publishGateway: new SchedulerPublishGraphQLGateway(client),
|
|
95
|
-
unpublishGateway: new SchedulerUnpublishGraphQLGateway(client)
|
|
96
|
-
}), [
|
|
97
|
-
client
|
|
82
|
+
const toast = useToast();
|
|
83
|
+
const presenter = useMemo(()=>container.resolve(ScheduleDialogPresenter), [
|
|
84
|
+
container
|
|
98
85
|
]);
|
|
99
86
|
const dialogClose = useRef(()=>{});
|
|
100
87
|
const onAccept = useCallback(async (params)=>{
|
|
@@ -106,9 +93,13 @@ const useScheduleDialog = (props)=>{
|
|
|
106
93
|
scheduleOn,
|
|
107
94
|
actionType
|
|
108
95
|
});
|
|
109
|
-
|
|
96
|
+
toast.showSuccessToast({
|
|
97
|
+
title: `Scheduled ${actionType} action for "${target.title}"!`
|
|
98
|
+
});
|
|
110
99
|
} catch (error) {
|
|
111
|
-
|
|
100
|
+
toast.showWarningToast({
|
|
101
|
+
title: error.message
|
|
102
|
+
});
|
|
112
103
|
console.error(error);
|
|
113
104
|
}
|
|
114
105
|
}, [
|
|
@@ -117,60 +108,72 @@ const useScheduleDialog = (props)=>{
|
|
|
117
108
|
const onCancel = useCallback(async ()=>{
|
|
118
109
|
const entry = presenter.vm.entry;
|
|
119
110
|
if (!entry) {
|
|
120
|
-
|
|
111
|
+
toast.showWarningToast({
|
|
112
|
+
title: `No scheduled action found for "${target.title}"!`
|
|
113
|
+
});
|
|
121
114
|
if (dialogClose.current) {
|
|
122
115
|
dialogClose.current();
|
|
123
116
|
dialogClose.current = null;
|
|
124
117
|
}
|
|
125
118
|
return;
|
|
126
119
|
}
|
|
120
|
+
if (dialogClose.current) {
|
|
121
|
+
dialogClose.current();
|
|
122
|
+
dialogClose.current = null;
|
|
123
|
+
}
|
|
127
124
|
try {
|
|
128
125
|
await presenter.cancel({
|
|
129
126
|
id: entry.id,
|
|
130
127
|
namespace: entry.namespace
|
|
131
128
|
});
|
|
132
|
-
|
|
129
|
+
toast.showSuccessToast({
|
|
130
|
+
title: `Canceled scheduled ${entry.actionType} on "${entry.title}"!`
|
|
131
|
+
});
|
|
133
132
|
} catch (error) {
|
|
134
|
-
|
|
133
|
+
toast.showWarningToast({
|
|
134
|
+
title: error.message
|
|
135
|
+
});
|
|
135
136
|
}
|
|
136
|
-
if (!dialogClose.current) return;
|
|
137
|
-
dialogClose.current();
|
|
138
|
-
dialogClose.current = null;
|
|
139
137
|
}, [
|
|
140
138
|
presenter.vm
|
|
141
139
|
]);
|
|
142
140
|
const showDialog = async ()=>{
|
|
143
|
-
await presenter.load({
|
|
144
|
-
namespace,
|
|
145
|
-
id: target.id
|
|
146
|
-
});
|
|
147
141
|
const isPublished = "published" === target.status;
|
|
148
|
-
const entry = presenter.vm.entry;
|
|
149
|
-
const scheduleOn = entry?.publishOn || entry?.unpublishOn;
|
|
150
142
|
dialogClose.current = dialog.showDialog({
|
|
151
143
|
title: `Schedule "${target.title}"`,
|
|
152
144
|
content: /*#__PURE__*/ react.createElement(FormComponent, {
|
|
153
|
-
|
|
154
|
-
scheduleOn: scheduleOn
|
|
145
|
+
presenter: presenter
|
|
155
146
|
}),
|
|
156
|
-
formData: {
|
|
157
|
-
|
|
147
|
+
formData: async ()=>{
|
|
148
|
+
await presenter.load({
|
|
149
|
+
namespace,
|
|
150
|
+
id: target.id
|
|
151
|
+
});
|
|
152
|
+
const entry = presenter.vm.entry;
|
|
153
|
+
const scheduleOn = entry?.publishOn || entry?.unpublishOn;
|
|
154
|
+
return {
|
|
155
|
+
scheduleOn
|
|
156
|
+
};
|
|
158
157
|
},
|
|
159
158
|
acceptLabel: isPublished ? "Schedule Unpublish" : "Schedule Publish",
|
|
160
159
|
cancelLabel: "Discard",
|
|
161
160
|
loadingLabel: "Scheduling...",
|
|
161
|
+
dataLoadingLabel: "Checking schedule...",
|
|
162
162
|
info: /*#__PURE__*/ react.createElement(CancelButtonComponent, {
|
|
163
|
-
|
|
163
|
+
presenter: presenter,
|
|
164
164
|
onCancel: onCancel
|
|
165
165
|
}),
|
|
166
|
+
dismissible: false,
|
|
166
167
|
onAccept: (data)=>{
|
|
167
|
-
if (!data.scheduleOn) return void
|
|
168
|
+
if (!data.scheduleOn) return void toast.showWarningToast({
|
|
169
|
+
title: 'Missing "Schedule On" date!'
|
|
170
|
+
});
|
|
168
171
|
let scheduleOn;
|
|
169
172
|
try {
|
|
170
173
|
scheduleOn = new Date(data.scheduleOn);
|
|
171
174
|
} catch (ex) {
|
|
172
|
-
|
|
173
|
-
|
|
175
|
+
toast.showWarningToast({
|
|
176
|
+
title: 'Invalid "Schedule On" date!'
|
|
174
177
|
});
|
|
175
178
|
console.error(ex);
|
|
176
179
|
return;
|
|
@@ -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 { observer } from \"mobx-react-lite\";\nimport { useContainer } from \"@webiny/app\";\nimport { useToast } from \"@webiny/admin-ui\";\nimport { Alert, Button, Grid, DatePicker } from \"@webiny/admin-ui\";\nimport { ReactComponent as DeleteIcon } from \"@webiny/icons/delete.svg\";\nimport { useDialogs } from \"@webiny/app-admin\";\nimport { Bind, type BindComponentRenderProp } from \"@webiny/form\";\nimport { validation } from \"@webiny/validation\";\nimport type { Validator } from \"@webiny/validation/types.js\";\nimport ValidationError from \"@webiny/validation/validationError.js\";\nimport { makeDecoratable } from \"@webiny/react-composition\";\nimport { ScheduleActionType } from \"~/types.js\";\nimport { ScheduleDialogPresenter } from \"./abstractions.js\";\nimport type { IScheduleDialogPresenter } from \"./abstractions.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 FormComponentProps {\n presenter: IScheduleDialogPresenter;\n}\n\nconst dateToLocaleStringFormatter = new Intl.DateTimeFormat(undefined, {\n year: \"numeric\",\n month: \"2-digit\",\n day: \"2-digit\",\n hour: \"2-digit\",\n minute: \"2-digit\",\n second: undefined,\n hour12: false\n});\n\ninterface IReschedulingAlertProps {\n scheduleOn: Date | undefined;\n actionType: ScheduleActionType | undefined;\n}\n\nconst ReschedulingAlert = ({ scheduleOn, actionType }: IReschedulingAlertProps) => {\n if (!scheduleOn || !actionType) {\n return null;\n }\n const actionName = actionType === ScheduleActionType.publish ? \"publish\" : \"unpublish\";\n return (\n <Alert type={\"danger\"}>\n <>\n A {actionName} is already scheduled at\n <br />\n <strong>{dateToLocaleStringFormatter.format(scheduleOn)}</strong>.\n </>\n </Alert>\n );\n};\n\nconst minDateValidator: Validator = (input: string) => {\n const value = new Date(input);\n const minDate = new Date(new Date().getTime() + 120 * 1000);\n if (minDate < value) {\n return;\n }\n throw new ValidationError(\n `The date must be at least 2 minutes in the future. Current minimum date is ${dateToLocaleStringFormatter.format(\n minDate\n )}.`\n );\n};\n\nminDateValidator.validatorName = \"minDateValidator\";\n\nexport interface ISchedulerDialogFormComponentDateTimeInputProps {\n bind: BindComponentRenderProp<Date>;\n}\n\ninterface ICancelButtonComponentProps {\n presenter: IScheduleDialogPresenter;\n onCancel: OnCancelCallable;\n}\nconst CancelButtonComponent = observer(({ presenter, onCancel }: ICancelButtonComponentProps) => {\n const { entry } = presenter.vm;\n const scheduleOn = entry?.publishOn || entry?.unpublishOn;\n const enabled = !!scheduleOn;\n\n if (!enabled) {\n return null;\n }\n return (\n <Button\n variant=\"ghost\"\n onClick={onCancel}\n text={\"Cancel Schedule\"}\n size=\"md\"\n icon={<DeleteIcon />}\n iconPosition=\"start\"\n />\n );\n});\n\nexport const SchedulerDialogFormComponentDateTimeInput = makeDecoratable(\n \"SchedulerDialogFormComponentDateTimeInput\",\n (props: ISchedulerDialogFormComponentDateTimeInputProps) => {\n const { bind } = props;\n\n return <DatePicker {...bind} type={\"dateTimeLocal\"} label={\"Schedule On\"} size={\"lg\"} />;\n }\n);\n\nconst FormComponent = observer(({ presenter }: FormComponentProps) => {\n const { entry } = presenter.vm;\n const scheduleOn = entry?.publishOn || entry?.unpublishOn;\n const actionType = entry?.actionType;\n\n return (\n <>\n {<ReschedulingAlert actionType={actionType} scheduleOn={scheduleOn} />}\n <Grid>\n <Grid.Column span={12}>\n <Bind\n name={\"scheduleOn\"}\n validators={[validation.create(\"required\"), minDateValidator]}\n >\n {bind => {\n return <SchedulerDialogFormComponentDateTimeInput bind={bind} />;\n }}\n </Bind>\n </Grid.Column>\n </Grid>\n </>\n );\n});\n\ninterface ScheduleFormData {\n scheduleOn?: string;\n}\n\ninterface IOnAcceptParams {\n scheduleOn: Date;\n actionType: ScheduleActionType;\n}\n\ninterface OnCancelCallable {\n (): Promise<void>;\n}\n\nexport interface IUseScheduleDialogProps {\n namespace: string;\n target: IShowDialogParamsEntry;\n}\n\nexport const useScheduleDialog = (\n props: IUseScheduleDialogProps\n): UseShowScheduleDialogResponse => {\n const { target, namespace } = 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 } 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 } 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":["dateToLocaleStringFormatter","Intl","undefined","ReschedulingAlert","scheduleOn","actionType","actionName","ScheduleActionType","Alert","minDateValidator","input","value","Date","minDate","ValidationError","CancelButtonComponent","observer","presenter","onCancel","entry","enabled","Button","DeleteIcon","SchedulerDialogFormComponentDateTimeInput","makeDecoratable","props","bind","DatePicker","FormComponent","Grid","Bind","validation","useScheduleDialog","target","namespace","container","useContainer","dialog","useDialogs","toast","useToast","useMemo","ScheduleDialogPresenter","dialogClose","useRef","onAccept","useCallback","params","error","console","showDialog","isPublished","data","ex"],"mappings":"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"}
|
|
@@ -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,
|
|
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"}
|