@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.
- 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 +17 -1
- package/index.js.map +1 -0
- package/package.json +17 -18
- 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 +3 -1
- package/presentation/components/Cells/CellScheduledOn/CellScheduledOn.js.map +1 -0
- 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 +26 -0
- package/{Presentation/components/ScheduleDialog → presentation/scheduleDialog}/ScheduleDialogPresenter.js +38 -9
- package/presentation/scheduleDialog/ScheduleDialogPresenter.js.map +1 -0
- package/{Presentation/components/ScheduleDialog/IScheduleDialogPresenter.d.ts → presentation/scheduleDialog/abstractions.d.ts} +10 -1
- package/presentation/scheduleDialog/abstractions.js +5 -0
- package/presentation/scheduleDialog/abstractions.js.map +1 -0
- package/presentation/scheduleDialog/components/CancelButtonComponent.d.ts +10 -0
- package/presentation/scheduleDialog/components/CancelButtonComponent.js +20 -0
- package/presentation/scheduleDialog/components/CancelButtonComponent.js.map +1 -0
- package/presentation/scheduleDialog/components/FormComponent.d.ts +9 -0
- package/presentation/scheduleDialog/components/FormComponent.js +32 -0
- package/presentation/scheduleDialog/components/FormComponent.js.map +1 -0
- package/presentation/scheduleDialog/components/ReschedulingAlert.d.ts +7 -0
- package/presentation/scheduleDialog/components/ReschedulingAlert.js +14 -0
- package/presentation/scheduleDialog/components/ReschedulingAlert.js.map +1 -0
- package/{Presentation/components/ScheduleDialog/useScheduleDialog.d.ts → presentation/scheduleDialog/components/SchedulerDialogFormComponentDateTimeInput.d.ts} +1 -18
- package/presentation/scheduleDialog/components/SchedulerDialogFormComponentDateTimeInput.js +15 -0
- package/presentation/scheduleDialog/components/SchedulerDialogFormComponentDateTimeInput.js.map +1 -0
- package/presentation/scheduleDialog/createMinDateValidator.d.ts +7 -0
- package/presentation/scheduleDialog/createMinDateValidator.js +14 -0
- package/presentation/scheduleDialog/createMinDateValidator.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/scheduleDialog/useScheduleDialog.d.ts +20 -0
- package/presentation/scheduleDialog/useScheduleDialog.js +128 -0
- 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/Cells/CellScheduledOn/CellScheduledOn.js.map +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 +0 -192
- 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/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
|
@@ -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,
|
|
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 @@
|
|
|
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 "
|
|
6
|
-
|
|
7
|
-
const
|
|
8
|
-
|
|
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,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 {};
|