@webiny/app-headless-cms-workflows 0.0.0-unstable.0156a4c312
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/Components/CmsEntriesList/CmsReviewMoveEntryAction.d.ts +2 -0
- package/Components/CmsEntriesList/CmsReviewMoveEntryAction.js +43 -0
- package/Components/CmsEntriesList/CmsReviewMoveEntryAction.js.map +1 -0
- package/Components/CmsEntriesList/CmsReviewMoveEntryAction.test.d.ts +1 -0
- package/Components/CmsEntriesList/CmsReviewMoveEntryAction.test.js +118 -0
- package/Components/CmsEntriesList/CmsReviewMoveEntryAction.test.js.map +1 -0
- package/Components/CmsEntriesList/CmsReviewScheduleEntryAction.d.ts +2 -0
- package/Components/CmsEntriesList/CmsReviewScheduleEntryAction.js +22 -0
- package/Components/CmsEntriesList/CmsReviewScheduleEntryAction.js.map +1 -0
- package/Components/CmsEntriesList/CmsReviewScheduleEntryAction.test.d.ts +1 -0
- package/Components/CmsEntriesList/CmsReviewScheduleEntryAction.test.js +98 -0
- package/Components/CmsEntriesList/CmsReviewScheduleEntryAction.test.js.map +1 -0
- package/Components/ContentEntryForm/CmsEntryReviewBar.d.ts +2 -0
- package/Components/ContentEntryForm/CmsEntryReviewBar.js +32 -0
- package/Components/ContentEntryForm/CmsEntryReviewBar.js.map +1 -0
- package/Components/ContentEntryForm/CmsEntryReviewBar.test.d.ts +1 -0
- package/Components/ContentEntryForm/CmsEntryReviewBar.test.js +128 -0
- package/Components/ContentEntryForm/CmsEntryReviewBar.test.js.map +1 -0
- package/Components/ContentEntryForm/CmsEntryReviewBlockedActions.d.ts +2 -0
- package/Components/ContentEntryForm/CmsEntryReviewBlockedActions.js +46 -0
- package/Components/ContentEntryForm/CmsEntryReviewBlockedActions.js.map +1 -0
- package/Components/ContentEntryForm/CmsEntryReviewBlockedActions.test.d.ts +1 -0
- package/Components/ContentEntryForm/CmsEntryReviewBlockedActions.test.js +222 -0
- package/Components/ContentEntryForm/CmsEntryReviewBlockedActions.test.js.map +1 -0
- package/Components/ContentEntryForm/CmsEntryReviewFormLock.d.ts +2 -0
- package/Components/ContentEntryForm/CmsEntryReviewFormLock.js +32 -0
- package/Components/ContentEntryForm/CmsEntryReviewFormLock.js.map +1 -0
- package/Components/ContentEntryForm/CmsEntryReviewFormLock.test.d.ts +1 -0
- package/Components/ContentEntryForm/CmsEntryReviewFormLock.test.js +94 -0
- package/Components/ContentEntryForm/CmsEntryReviewFormLock.test.js.map +1 -0
- package/Components/ContentEntryForm/CmsEntryReviewNewRevision.d.ts +2 -0
- package/Components/ContentEntryForm/CmsEntryReviewNewRevision.js +56 -0
- package/Components/ContentEntryForm/CmsEntryReviewNewRevision.js.map +1 -0
- package/Components/ContentEntryForm/CmsEntryReviewNewRevision.test.d.ts +1 -0
- package/Components/ContentEntryForm/CmsEntryReviewNewRevision.test.js +186 -0
- package/Components/ContentEntryForm/CmsEntryReviewNewRevision.test.js.map +1 -0
- package/Components/ContentEntryForm/CmsEntryReviewScheduleMenuItem.d.ts +2 -0
- package/Components/ContentEntryForm/CmsEntryReviewScheduleMenuItem.js +26 -0
- package/Components/ContentEntryForm/CmsEntryReviewScheduleMenuItem.js.map +1 -0
- package/Components/ContentEntryForm/CmsEntryReviewScheduleMenuItem.test.d.ts +1 -0
- package/Components/ContentEntryForm/CmsEntryReviewScheduleMenuItem.test.js +78 -0
- package/Components/ContentEntryForm/CmsEntryReviewScheduleMenuItem.test.js.map +1 -0
- package/Components/ContentEntryForm/getModelFieldLabels.d.ts +3 -0
- package/Components/ContentEntryForm/getModelFieldLabels.js +8 -0
- package/Components/ContentEntryForm/getModelFieldLabels.js.map +1 -0
- package/Components/ContentEntryForm/index.d.ts +5 -0
- package/Components/ContentEntryForm/index.js +5 -0
- package/Components/ContentReviews/CmsContentReviews.d.ts +2 -0
- package/Components/ContentReviews/CmsContentReviews.js +11 -0
- package/Components/ContentReviews/CmsContentReviews.js.map +1 -0
- package/Components/ContentReviews/CmsContentReviews.test.d.ts +1 -0
- package/Components/ContentReviews/CmsContentReviews.test.js +214 -0
- package/Components/ContentReviews/CmsContentReviews.test.js.map +1 -0
- package/Components/ContentReviews/CmsContentReviewsMount.d.ts +4 -0
- package/Components/ContentReviews/CmsContentReviewsMount.js +44 -0
- package/Components/ContentReviews/CmsContentReviewsMount.js.map +1 -0
- package/Components/ContentReviews/CmsContentReviewsSidebarItem.d.ts +2 -0
- package/Components/ContentReviews/CmsContentReviewsSidebarItem.js +20 -0
- package/Components/ContentReviews/CmsContentReviewsSidebarItem.js.map +1 -0
- package/Components/ContentReviews/CmsContentReviewsSidebarItem.test.d.ts +1 -0
- package/Components/ContentReviews/CmsContentReviewsSidebarItem.test.js +83 -0
- package/Components/ContentReviews/CmsContentReviewsSidebarItem.test.js.map +1 -0
- package/Components/ModelDelete/ModelBoundToWorkflowErrorData.d.ts +8 -0
- package/Components/ModelDelete/ModelBoundToWorkflowErrorData.js +0 -0
- package/Components/ModelDelete/ModelDeleteWorkflowCopy.d.ts +10 -0
- package/Components/ModelDelete/ModelDeleteWorkflowCopy.js +0 -0
- package/Components/ModelDelete/ModelDeleteWorkflowError.d.ts +2 -0
- package/Components/ModelDelete/ModelDeleteWorkflowError.js +34 -0
- package/Components/ModelDelete/ModelDeleteWorkflowError.js.map +1 -0
- package/Components/ModelDelete/ModelDeleteWorkflowError.test.d.ts +1 -0
- package/Components/ModelDelete/ModelDeleteWorkflowError.test.js +73 -0
- package/Components/ModelDelete/ModelDeleteWorkflowError.test.js.map +1 -0
- package/Components/ModelDelete/getModelDeleteWorkflowCopy.d.ts +3 -0
- package/Components/ModelDelete/getModelDeleteWorkflowCopy.js +17 -0
- package/Components/ModelDelete/getModelDeleteWorkflowCopy.js.map +1 -0
- package/Components/ModelDelete/getModelDeleteWorkflowCopy.test.d.ts +1 -0
- package/Components/ModelDelete/getModelDeleteWorkflowCopy.test.js +28 -0
- package/Components/ModelDelete/getModelDeleteWorkflowCopy.test.js.map +1 -0
- package/Components/ignoreAction.d.ts +1 -0
- package/Components/ignoreAction.js +4 -0
- package/Components/ignoreAction.js.map +1 -0
- package/LICENSE +21 -0
- package/README.md +11 -0
- package/Routes/CmsWorkflowEditor.d.ts +2 -0
- package/Routes/CmsWorkflowEditor.js +23 -0
- package/Routes/CmsWorkflowEditor.js.map +1 -0
- package/Routes/CmsWorkflowEditor.test.d.ts +1 -0
- package/Routes/CmsWorkflowEditor.test.js +141 -0
- package/Routes/CmsWorkflowEditor.test.js.map +1 -0
- package/Routes/index.d.ts +1 -0
- package/Routes/index.js +1 -0
- package/features/cache/CmsReviewCacheSyncHandler.d.ts +8 -0
- package/features/cache/CmsReviewCacheSyncHandler.js +14 -0
- package/features/cache/CmsReviewCacheSyncHandler.js.map +1 -0
- package/features/cache/CmsReviewCacheWriter.d.ts +14 -0
- package/features/cache/CmsReviewCacheWriter.js +39 -0
- package/features/cache/CmsReviewCacheWriter.js.map +1 -0
- package/features/cache/CmsReviewCacheWriter.test.d.ts +1 -0
- package/features/cache/CmsReviewCacheWriter.test.js +207 -0
- package/features/cache/CmsReviewCacheWriter.test.js.map +1 -0
- package/features/cache/CmsReviewEntriesCacheProviderDecorator.d.ts +12 -0
- package/features/cache/CmsReviewEntriesCacheProviderDecorator.js +17 -0
- package/features/cache/CmsReviewEntriesCacheProviderDecorator.js.map +1 -0
- package/features/cache/CmsReviewEntriesCacheProviderDecorator.test.d.ts +1 -0
- package/features/cache/CmsReviewEntriesCacheProviderDecorator.test.js +129 -0
- package/features/cache/CmsReviewEntriesCacheProviderDecorator.test.js.map +1 -0
- package/features/cache/ReviewPreservingEntriesCache.d.ts +18 -0
- package/features/cache/ReviewPreservingEntriesCache.js +54 -0
- package/features/cache/ReviewPreservingEntriesCache.js.map +1 -0
- package/features/cache/abstractions.d.ts +5 -0
- package/features/cache/abstractions.js +5 -0
- package/features/cache/abstractions.js.map +1 -0
- package/features/editorGateway/CmsWorkflowEditorGateway/CmsWorkflowEditorGateway.d.ts +26 -0
- package/features/editorGateway/CmsWorkflowEditorGateway/CmsWorkflowEditorGateway.js +104 -0
- package/features/editorGateway/CmsWorkflowEditorGateway/CmsWorkflowEditorGateway.js.map +1 -0
- package/features/editorGateway/CmsWorkflowEditorGateway/CmsWorkflowEditorGateway.test.d.ts +1 -0
- package/features/editorGateway/CmsWorkflowEditorGateway/CmsWorkflowEditorGateway.test.js +589 -0
- package/features/editorGateway/CmsWorkflowEditorGateway/CmsWorkflowEditorGateway.test.js.map +1 -0
- package/features/editorGateway/feature.d.ts +1 -0
- package/features/editorGateway/feature.js +11 -0
- package/features/editorGateway/feature.js.map +1 -0
- package/features/editorGateway/feature.test.d.ts +1 -0
- package/features/editorGateway/feature.test.js +272 -0
- package/features/editorGateway/feature.test.js.map +1 -0
- package/features/editorGateway/graphql/cmsEntryFolderExists.d.ts +1 -0
- package/features/editorGateway/graphql/cmsEntryFolderExists.js +16 -0
- package/features/editorGateway/graphql/cmsEntryFolderExists.js.map +1 -0
- package/features/editorGateway/graphql/deleteCmsEntryWorkflow.d.ts +1 -0
- package/features/editorGateway/graphql/deleteCmsEntryWorkflow.js +19 -0
- package/features/editorGateway/graphql/deleteCmsEntryWorkflow.js.map +1 -0
- package/features/editorGateway/graphql/getCmsEntryWorkflow.d.ts +1 -0
- package/features/editorGateway/graphql/getCmsEntryWorkflow.js +19 -0
- package/features/editorGateway/graphql/getCmsEntryWorkflow.js.map +1 -0
- package/features/editorGateway/graphql/inspectCmsEntryRouting.d.ts +1 -0
- package/features/editorGateway/graphql/inspectCmsEntryRouting.js +19 -0
- package/features/editorGateway/graphql/inspectCmsEntryRouting.js.map +1 -0
- package/features/editorGateway/graphql/listCmsEntryWorkflowModels.d.ts +1 -0
- package/features/editorGateway/graphql/listCmsEntryWorkflowModels.js +29 -0
- package/features/editorGateway/graphql/listCmsEntryWorkflowModels.js.map +1 -0
- package/features/editorGateway/graphql/storeCmsEntryWorkflow.d.ts +1 -0
- package/features/editorGateway/graphql/storeCmsEntryWorkflow.js +19 -0
- package/features/editorGateway/graphql/storeCmsEntryWorkflow.js.map +1 -0
- package/features/editorMounting/CmsWorkflowEditorAppAdapter.d.ts +25 -0
- package/features/editorMounting/CmsWorkflowEditorAppAdapter.js +51 -0
- package/features/editorMounting/CmsWorkflowEditorAppAdapter.js.map +1 -0
- package/features/editorMounting/CmsWorkflowEditorAppAdapter.test.d.ts +1 -0
- package/features/editorMounting/CmsWorkflowEditorAppAdapter.test.js +185 -0
- package/features/editorMounting/CmsWorkflowEditorAppAdapter.test.js.map +1 -0
- package/features/editorMounting/abstractions.d.ts +5 -0
- package/features/editorMounting/abstractions.js +5 -0
- package/features/editorMounting/abstractions.js.map +1 -0
- package/features/editorMounting/feature.d.ts +3 -0
- package/features/editorMounting/feature.js +19 -0
- package/features/editorMounting/feature.js.map +1 -0
- package/features/editorMounting/feature.test.d.ts +1 -0
- package/features/editorMounting/feature.test.js +100 -0
- package/features/editorMounting/feature.test.js.map +1 -0
- package/features/editorReview/CmsEntryReview.d.ts +8 -0
- package/features/editorReview/CmsEntryReview.js +14 -0
- package/features/editorReview/CmsEntryReview.js.map +1 -0
- package/features/editorReview/abstractions.d.ts +5 -0
- package/features/editorReview/abstractions.js +5 -0
- package/features/editorReview/abstractions.js.map +1 -0
- package/features/editorReview/feature.d.ts +3 -0
- package/features/editorReview/feature.js +17 -0
- package/features/editorReview/feature.js.map +1 -0
- package/features/editorReview/feature.test.d.ts +1 -0
- package/features/editorReview/feature.test.js +46 -0
- package/features/editorReview/feature.test.js.map +1 -0
- package/features/editorReview/useCmsEntryReview.d.ts +2 -0
- package/features/editorReview/useCmsEntryReview.js +8 -0
- package/features/editorReview/useCmsEntryReview.js.map +1 -0
- package/features/feature.d.ts +1 -0
- package/features/feature.js +15 -0
- package/features/feature.js.map +1 -0
- package/features/gateway/CmsReviewChangeMessageHandler.d.ts +8 -0
- package/features/gateway/CmsReviewChangeMessageHandler.js +16 -0
- package/features/gateway/CmsReviewChangeMessageHandler.js.map +1 -0
- package/features/gateway/CmsReviewContentAdapter/CmsReviewContentAdapter.d.ts +16 -0
- package/features/gateway/CmsReviewContentAdapter/CmsReviewContentAdapter.js +39 -0
- package/features/gateway/CmsReviewContentAdapter/CmsReviewContentAdapter.js.map +1 -0
- package/features/gateway/CmsReviewContentAdapter/CmsReviewContentAdapter.test.d.ts +1 -0
- package/features/gateway/CmsReviewContentAdapter/CmsReviewContentAdapter.test.js +83 -0
- package/features/gateway/CmsReviewContentAdapter/CmsReviewContentAdapter.test.js.map +1 -0
- package/features/gateway/CmsReviewContentAdapter/abstractions.d.ts +5 -0
- package/features/gateway/CmsReviewContentAdapter/abstractions.js +5 -0
- package/features/gateway/CmsReviewContentAdapter/abstractions.js.map +1 -0
- package/features/gateway/CmsReviewGateway/CmsReviewGateway.d.ts +52 -0
- package/features/gateway/CmsReviewGateway/CmsReviewGateway.js +221 -0
- package/features/gateway/CmsReviewGateway/CmsReviewGateway.js.map +1 -0
- package/features/gateway/CmsReviewGateway/CmsReviewGateway.test.d.ts +1 -0
- package/features/gateway/CmsReviewGateway/CmsReviewGateway.test.js +689 -0
- package/features/gateway/CmsReviewGateway/CmsReviewGateway.test.js.map +1 -0
- package/features/gateway/CmsReviewNotificationHandler.d.ts +8 -0
- package/features/gateway/CmsReviewNotificationHandler.js +16 -0
- package/features/gateway/CmsReviewNotificationHandler.js.map +1 -0
- package/features/gateway/CmsReviewRowProvider/CmsReviewRowProvider.d.ts +8 -0
- package/features/gateway/CmsReviewRowProvider/CmsReviewRowProvider.js +14 -0
- package/features/gateway/CmsReviewRowProvider/CmsReviewRowProvider.js.map +1 -0
- package/features/gateway/CmsReviewRowProvider/abstractions.d.ts +5 -0
- package/features/gateway/CmsReviewRowProvider/abstractions.js +5 -0
- package/features/gateway/CmsReviewRowProvider/abstractions.js.map +1 -0
- package/features/gateway/contentReviewsBindings.test.d.ts +1 -0
- package/features/gateway/contentReviewsBindings.test.js +125 -0
- package/features/gateway/contentReviewsBindings.test.js.map +1 -0
- package/features/gateway/feature.d.ts +4 -0
- package/features/gateway/feature.js +27 -0
- package/features/gateway/feature.js.map +1 -0
- package/features/gateway/feature.test.d.ts +1 -0
- package/features/gateway/feature.test.js +79 -0
- package/features/gateway/feature.test.js.map +1 -0
- package/features/gateway/graphql/CmsOperationResponse.d.ts +3 -0
- package/features/gateway/graphql/CmsOperationResponse.js +0 -0
- package/features/gateway/graphql/approveCmsEntryReviewStep.d.ts +1 -0
- package/features/gateway/graphql/approveCmsEntryReviewStep.js +18 -0
- package/features/gateway/graphql/approveCmsEntryReviewStep.js.map +1 -0
- package/features/gateway/graphql/cancelCmsEntryReview.d.ts +1 -0
- package/features/gateway/graphql/cancelCmsEntryReview.js +18 -0
- package/features/gateway/graphql/cancelCmsEntryReview.js.map +1 -0
- package/features/gateway/graphql/cancelCmsEntryReviewsForDelete.d.ts +1 -0
- package/features/gateway/graphql/cancelCmsEntryReviewsForDelete.js +28 -0
- package/features/gateway/graphql/cancelCmsEntryReviewsForDelete.js.map +1 -0
- package/features/gateway/graphql/getCmsEntryReview.d.ts +1 -0
- package/features/gateway/graphql/getCmsEntryReview.js +18 -0
- package/features/gateway/graphql/getCmsEntryReview.js.map +1 -0
- package/features/gateway/graphql/getCmsEntryReviewStepRun.d.ts +1 -0
- package/features/gateway/graphql/getCmsEntryReviewStepRun.js +18 -0
- package/features/gateway/graphql/getCmsEntryReviewStepRun.js.map +1 -0
- package/features/gateway/graphql/getCmsEntryTargetReview.d.ts +1 -0
- package/features/gateway/graphql/getCmsEntryTargetReview.js +18 -0
- package/features/gateway/graphql/getCmsEntryTargetReview.js.map +1 -0
- package/features/gateway/graphql/listCmsEntryBlockingReviews.d.ts +1 -0
- package/features/gateway/graphql/listCmsEntryBlockingReviews.js +18 -0
- package/features/gateway/graphql/listCmsEntryBlockingReviews.js.map +1 -0
- package/features/gateway/graphql/listCmsEntryReviewStepCandidates.d.ts +1 -0
- package/features/gateway/graphql/listCmsEntryReviewStepCandidates.js +18 -0
- package/features/gateway/graphql/listCmsEntryReviewStepCandidates.js.map +1 -0
- package/features/gateway/graphql/listCmsEntryReviews.d.ts +1 -0
- package/features/gateway/graphql/listCmsEntryReviews.js +34 -0
- package/features/gateway/graphql/listCmsEntryReviews.js.map +1 -0
- package/features/gateway/graphql/listCmsEntryStepCandidates.d.ts +1 -0
- package/features/gateway/graphql/listCmsEntryStepCandidates.js +28 -0
- package/features/gateway/graphql/listCmsEntryStepCandidates.js.map +1 -0
- package/features/gateway/graphql/listCmsEntryWorkflows.d.ts +1 -0
- package/features/gateway/graphql/listCmsEntryWorkflows.js +18 -0
- package/features/gateway/graphql/listCmsEntryWorkflows.js.map +1 -0
- package/features/gateway/graphql/reassignCmsEntryReviewStep.d.ts +1 -0
- package/features/gateway/graphql/reassignCmsEntryReviewStep.js +18 -0
- package/features/gateway/graphql/reassignCmsEntryReviewStep.js.map +1 -0
- package/features/gateway/graphql/rejectCmsEntryReviewStep.d.ts +1 -0
- package/features/gateway/graphql/rejectCmsEntryReviewStep.js +18 -0
- package/features/gateway/graphql/rejectCmsEntryReviewStep.js.map +1 -0
- package/features/gateway/graphql/requestCmsEntryReview.d.ts +1 -0
- package/features/gateway/graphql/requestCmsEntryReview.js +28 -0
- package/features/gateway/graphql/requestCmsEntryReview.js.map +1 -0
- package/features/gateway/graphql/restartCmsEntryReviewStep.d.ts +1 -0
- package/features/gateway/graphql/restartCmsEntryReviewStep.js +18 -0
- package/features/gateway/graphql/restartCmsEntryReviewStep.js.map +1 -0
- package/features/gateway/graphql/startCmsEntryReviewStep.d.ts +1 -0
- package/features/gateway/graphql/startCmsEntryReviewStep.js +18 -0
- package/features/gateway/graphql/startCmsEntryReviewStep.js.map +1 -0
- package/features/gateway/graphql/takeOverCmsEntryReviewStep.d.ts +1 -0
- package/features/gateway/graphql/takeOverCmsEntryReviewStep.js +22 -0
- package/features/gateway/graphql/takeOverCmsEntryReviewStep.js.map +1 -0
- package/features/trash/BulkDeletePresenterReviewDecorator.d.ts +20 -0
- package/features/trash/BulkDeletePresenterReviewDecorator.js +81 -0
- package/features/trash/BulkDeletePresenterReviewDecorator.js.map +1 -0
- package/features/trash/BulkDeletePresenterReviewDecorator.test.d.ts +1 -0
- package/features/trash/BulkDeletePresenterReviewDecorator.test.js +693 -0
- package/features/trash/BulkDeletePresenterReviewDecorator.test.js.map +1 -0
- package/features/trash/DeleteEntryRevisionUseCaseReviewDecorator.d.ts +13 -0
- package/features/trash/DeleteEntryRevisionUseCaseReviewDecorator.js +23 -0
- package/features/trash/DeleteEntryRevisionUseCaseReviewDecorator.js.map +1 -0
- package/features/trash/DeleteEntryRevisionUseCaseReviewDecorator.test.d.ts +1 -0
- package/features/trash/DeleteEntryRevisionUseCaseReviewDecorator.test.js +123 -0
- package/features/trash/DeleteEntryRevisionUseCaseReviewDecorator.test.js.map +1 -0
- package/features/trash/DeleteEntryUseCaseReviewDecorator.d.ts +13 -0
- package/features/trash/DeleteEntryUseCaseReviewDecorator.js +23 -0
- package/features/trash/DeleteEntryUseCaseReviewDecorator.js.map +1 -0
- package/features/trash/DeleteEntryUseCaseReviewDecorator.test.d.ts +1 -0
- package/features/trash/DeleteEntryUseCaseReviewDecorator.test.js +139 -0
- package/features/trash/DeleteEntryUseCaseReviewDecorator.test.js.map +1 -0
- package/features/trash/PermanentlyDeleteEntryUseCaseReviewDecorator.d.ts +13 -0
- package/features/trash/PermanentlyDeleteEntryUseCaseReviewDecorator.js +23 -0
- package/features/trash/PermanentlyDeleteEntryUseCaseReviewDecorator.js.map +1 -0
- package/features/trash/PermanentlyDeleteEntryUseCaseReviewDecorator.test.d.ts +1 -0
- package/features/trash/PermanentlyDeleteEntryUseCaseReviewDecorator.test.js +122 -0
- package/features/trash/PermanentlyDeleteEntryUseCaseReviewDecorator.test.js.map +1 -0
- package/features/trash/feature.d.ts +1 -0
- package/features/trash/feature.js +17 -0
- package/features/trash/feature.js.map +1 -0
- package/features/trash/feature.test.d.ts +1 -0
- package/features/trash/feature.test.js +213 -0
- package/features/trash/feature.test.js.map +1 -0
- package/index.d.ts +2 -0
- package/index.editor.test.d.ts +1 -0
- package/index.editor.test.js +149 -0
- package/index.editor.test.js.map +1 -0
- package/index.js +41 -0
- package/index.js.map +1 -0
- package/index.lists.test.d.ts +1 -0
- package/index.lists.test.js +172 -0
- package/index.lists.test.js.map +1 -0
- package/index.mount.test.d.ts +1 -0
- package/index.mount.test.js +49 -0
- package/index.mount.test.js.map +1 -0
- package/index.test.d.ts +1 -0
- package/index.test.js +414 -0
- package/index.test.js.map +1 -0
- package/package.json +54 -0
- package/presentation/CmsEntryContentReloader.d.ts +8 -0
- package/presentation/CmsEntryContentReloader.js +20 -0
- package/presentation/CmsEntryContentReloader.js.map +1 -0
- package/presentation/CmsEntryContentReloader.test.d.ts +1 -0
- package/presentation/CmsEntryContentReloader.test.js +118 -0
- package/presentation/CmsEntryContentReloader.test.js.map +1 -0
- package/presentation/CmsEntryFormPresenterReviewDecorator.d.ts +27 -0
- package/presentation/CmsEntryFormPresenterReviewDecorator.js +167 -0
- package/presentation/CmsEntryFormPresenterReviewDecorator.js.map +1 -0
- package/presentation/CmsEntryFormPresenterReviewDecorator.test.d.ts +1 -0
- package/presentation/CmsEntryFormPresenterReviewDecorator.test.js +601 -0
- package/presentation/CmsEntryFormPresenterReviewDecorator.test.js.map +1 -0
- package/presentation/CmsEntryUnsavedChanges.d.ts +7 -0
- package/presentation/CmsEntryUnsavedChanges.js +12 -0
- package/presentation/CmsEntryUnsavedChanges.js.map +1 -0
- package/presentation/CmsEntryUnsavedChanges.test.d.ts +1 -0
- package/presentation/CmsEntryUnsavedChanges.test.js +23 -0
- package/presentation/CmsEntryUnsavedChanges.test.js.map +1 -0
- package/presentation/CmsReviewFieldSelections.test.d.ts +1 -0
- package/presentation/CmsReviewFieldSelections.test.js +27 -0
- package/presentation/CmsReviewFieldSelections.test.js.map +1 -0
- package/presentation/CmsReviewGetEntryFieldSelection.d.ts +8 -0
- package/presentation/CmsReviewGetEntryFieldSelection.js +16 -0
- package/presentation/CmsReviewGetEntryFieldSelection.js.map +1 -0
- package/presentation/CmsReviewListEntriesFieldSelection.d.ts +8 -0
- package/presentation/CmsReviewListEntriesFieldSelection.js +16 -0
- package/presentation/CmsReviewListEntriesFieldSelection.js.map +1 -0
- package/presentation/CmsReviewTableRowMapperDecorator.d.ts +11 -0
- package/presentation/CmsReviewTableRowMapperDecorator.js +24 -0
- package/presentation/CmsReviewTableRowMapperDecorator.js.map +1 -0
- package/presentation/CmsReviewTableRowMapperDecorator.test.d.ts +1 -0
- package/presentation/CmsReviewTableRowMapperDecorator.test.js +120 -0
- package/presentation/CmsReviewTableRowMapperDecorator.test.js.map +1 -0
- package/presentation/CmsRevisionsListPresenterDecorator.d.ts +24 -0
- package/presentation/CmsRevisionsListPresenterDecorator.js +66 -0
- package/presentation/CmsRevisionsListPresenterDecorator.js.map +1 -0
- package/presentation/CmsRevisionsListPresenterDecorator.test.d.ts +1 -0
- package/presentation/CmsRevisionsListPresenterDecorator.test.js +174 -0
- package/presentation/CmsRevisionsListPresenterDecorator.test.js.map +1 -0
- package/presentation/contentReviews/CmsContentReviewsPresenter.d.ts +28 -0
- package/presentation/contentReviews/CmsContentReviewsPresenter.js +103 -0
- package/presentation/contentReviews/CmsContentReviewsPresenter.js.map +1 -0
- package/presentation/contentReviews/CmsContentReviewsPresenter.test.d.ts +1 -0
- package/presentation/contentReviews/CmsContentReviewsPresenter.test.js +238 -0
- package/presentation/contentReviews/CmsContentReviewsPresenter.test.js.map +1 -0
- package/presentation/contentReviews/abstractions.d.ts +31 -0
- package/presentation/contentReviews/abstractions.js +5 -0
- package/presentation/contentReviews/abstractions.js.map +1 -0
- package/presentation/contentReviews/feature.d.ts +3 -0
- package/presentation/contentReviews/feature.js +17 -0
- package/presentation/contentReviews/feature.js.map +1 -0
- package/presentation/contentReviews/toContentTypes.d.ts +3 -0
- package/presentation/contentReviews/toContentTypes.js +14 -0
- package/presentation/contentReviews/toContentTypes.js.map +1 -0
- package/presentation/contentReviews/toContentTypes.test.d.ts +1 -0
- package/presentation/contentReviews/toContentTypes.test.js +20 -0
- package/presentation/contentReviews/toContentTypes.test.js.map +1 -0
- package/presentation/feature.d.ts +1 -0
- package/presentation/feature.js +19 -0
- package/presentation/feature.js.map +1 -0
- package/presentation/getCmsEntryReviewContext.d.ts +4 -0
- package/presentation/getCmsEntryReviewContext.js +12 -0
- package/presentation/getCmsEntryReviewContext.js.map +1 -0
- package/presentation/getCmsEntryReviewInitParams.d.ts +13 -0
- package/presentation/getCmsEntryReviewInitParams.js +18 -0
- package/presentation/getCmsEntryReviewInitParams.js.map +1 -0
- package/presentation/getCmsEntryReviewInitParams.test.d.ts +1 -0
- package/presentation/getCmsEntryReviewInitParams.test.js +69 -0
- package/presentation/getCmsEntryReviewInitParams.test.js.map +1 -0
- package/routes.d.ts +11 -0
- package/routes.js +21 -0
- package/routes.js.map +1 -0
- package/testing/createEntry.d.ts +3 -0
- package/testing/createEntry.js +22 -0
- package/testing/createEntry.js.map +1 -0
- package/testing/createEntrySession.d.ts +9 -0
- package/testing/createEntrySession.js +29 -0
- package/testing/createEntrySession.js.map +1 -0
- package/testing/createFolder.d.ts +2 -0
- package/testing/createFolder.js +13 -0
- package/testing/createFolder.js.map +1 -0
- package/testing/createFormVm.d.ts +2 -0
- package/testing/createFormVm.js +22 -0
- package/testing/createFormVm.js.map +1 -0
- package/testing/models.d.ts +4 -0
- package/testing/models.js +23 -0
- package/testing/models.js.map +1 -0
- package/testing/renderEditorTree.d.ts +17 -0
- package/testing/renderEditorTree.js +93 -0
- package/testing/renderEditorTree.js.map +1 -0
- package/testing/reviewStates.d.ts +17 -0
- package/testing/reviewStates.js +65 -0
- package/testing/reviewStates.js.map +1 -0
- package/types.d.ts +10 -0
- package/types.js +0 -0
- package/utils/appName.d.ts +4 -0
- package/utils/appName.js +13 -0
- package/utils/appName.js.map +1 -0
- package/utils/isReviewableModel.d.ts +2 -0
- package/utils/isReviewableModel.js +7 -0
- package/utils/isReviewableModel.js.map +1 -0
- package/utils/renderModelIcon.d.ts +3 -0
- package/utils/renderModelIcon.js +19 -0
- package/utils/renderModelIcon.js.map +1 -0
- package/utils/renderModelIconOrFallback.d.ts +3 -0
- package/utils/renderModelIconOrFallback.js +17 -0
- package/utils/renderModelIconOrFallback.js.map +1 -0
|
@@ -0,0 +1,185 @@
|
|
|
1
|
+
import react from "react";
|
|
2
|
+
import { describe, expect, it, vi } from "vitest";
|
|
3
|
+
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
|
|
4
|
+
import { Container } from "@webiny/di";
|
|
5
|
+
import { ROOT_FOLDER } from "@webiny/app-aco/constants.js";
|
|
6
|
+
import { ListFoldersGateway } from "@webiny/app-aco/features/folders/listFolders/abstractions.js";
|
|
7
|
+
import { RootFolder } from "@webiny/app-aco/domain/folder/RootFolder.js";
|
|
8
|
+
import { ListCache } from "@webiny/app-admin/features/listCache/index.js";
|
|
9
|
+
import { ModelsCache } from "@webiny/app-headless-cms/features/model/abstractions.js";
|
|
10
|
+
import { ListModelsUseCase } from "@webiny/app-headless-cms/features/model/listModels/abstractions.js";
|
|
11
|
+
import { createFakeContentAdapter } from "@webiny/app-workflows/editor/testing/fakeReviewContentAdapter.js";
|
|
12
|
+
import { CmsReviewContentAdapter } from "../gateway/CmsReviewContentAdapter/abstractions.js";
|
|
13
|
+
import { createFolder } from "../../testing/createFolder.js";
|
|
14
|
+
import { MODEL } from "../../testing/models.js";
|
|
15
|
+
import { CmsWorkflowEditorAppAdapter } from "./abstractions.js";
|
|
16
|
+
import { CmsWorkflowEditorAppAdapter as external_CmsWorkflowEditorAppAdapter_js_CmsWorkflowEditorAppAdapter } from "./CmsWorkflowEditorAppAdapter.js";
|
|
17
|
+
const createModel = (modelId, name, icon)=>({
|
|
18
|
+
...MODEL,
|
|
19
|
+
modelId,
|
|
20
|
+
name,
|
|
21
|
+
icon
|
|
22
|
+
});
|
|
23
|
+
const contentAdapter = createFakeContentAdapter();
|
|
24
|
+
const createAdapter = (models, folders = [])=>{
|
|
25
|
+
const cache = new ListCache("modelId");
|
|
26
|
+
const execute = vi.fn(async ()=>{
|
|
27
|
+
if (!cache.hasItems()) cache.setItems(models);
|
|
28
|
+
return cache.getItems();
|
|
29
|
+
});
|
|
30
|
+
const container = new Container();
|
|
31
|
+
container.registerInstance(ModelsCache, cache);
|
|
32
|
+
container.registerInstance(ListModelsUseCase, {
|
|
33
|
+
execute
|
|
34
|
+
});
|
|
35
|
+
const rootFolder = RootFolder.create();
|
|
36
|
+
const listFoldersExecute = vi.fn().mockResolvedValue([
|
|
37
|
+
rootFolder,
|
|
38
|
+
...folders
|
|
39
|
+
]);
|
|
40
|
+
container.registerInstance(ListFoldersGateway, {
|
|
41
|
+
execute: listFoldersExecute
|
|
42
|
+
});
|
|
43
|
+
container.registerInstance(CmsReviewContentAdapter, contentAdapter);
|
|
44
|
+
container.register(external_CmsWorkflowEditorAppAdapter_js_CmsWorkflowEditorAppAdapter);
|
|
45
|
+
const adapter = container.resolve(CmsWorkflowEditorAppAdapter);
|
|
46
|
+
return {
|
|
47
|
+
adapter,
|
|
48
|
+
execute,
|
|
49
|
+
listFoldersExecute
|
|
50
|
+
};
|
|
51
|
+
};
|
|
52
|
+
describe("CmsWorkflowEditorAppAdapter", ()=>{
|
|
53
|
+
it("describes the CMS app", ()=>{
|
|
54
|
+
const { adapter } = createAdapter([]);
|
|
55
|
+
expect(adapter.appKind).toBe("cms");
|
|
56
|
+
expect(adapter.panelLabel).toBe("Content models");
|
|
57
|
+
expect(adapter.appliesToLabel).toBe("Headless CMS model");
|
|
58
|
+
expect(adapter.contentAdapter).toBe(contentAdapter);
|
|
59
|
+
});
|
|
60
|
+
it("lists the models on init", async ()=>{
|
|
61
|
+
const model = createModel("article", "Article", "fas/newspaper");
|
|
62
|
+
const { adapter, execute } = createAdapter([
|
|
63
|
+
model
|
|
64
|
+
]);
|
|
65
|
+
await adapter.init();
|
|
66
|
+
expect(execute).toHaveBeenCalledTimes(1);
|
|
67
|
+
});
|
|
68
|
+
it("does not reject when the models cannot be listed, renders no icon and retries on the next init", async ()=>{
|
|
69
|
+
const model = createModel("article", "Article", "fas/newspaper");
|
|
70
|
+
const { adapter, execute } = createAdapter([
|
|
71
|
+
model
|
|
72
|
+
]);
|
|
73
|
+
execute.mockRejectedValueOnce(new Error("Not authorized."));
|
|
74
|
+
await expect(adapter.init()).resolves.toBeUndefined();
|
|
75
|
+
const before = adapter.renderModelIcon("article");
|
|
76
|
+
await adapter.init();
|
|
77
|
+
const after = adapter.renderModelIcon("article");
|
|
78
|
+
expect(before).toBeNull();
|
|
79
|
+
expect(after).not.toBeNull();
|
|
80
|
+
expect(execute).toHaveBeenCalledTimes(2);
|
|
81
|
+
});
|
|
82
|
+
it("renders the model icon from the cached model", async ()=>{
|
|
83
|
+
const model = createModel("article", "Article", "fas/newspaper");
|
|
84
|
+
const { adapter } = createAdapter([
|
|
85
|
+
model
|
|
86
|
+
]);
|
|
87
|
+
await adapter.init();
|
|
88
|
+
const node = adapter.renderModelIcon("article");
|
|
89
|
+
if (!/*#__PURE__*/ react.isValidElement(node)) throw new Error("The model icon is not an element.");
|
|
90
|
+
expect(node.props.label).toBe("Article");
|
|
91
|
+
expect(node.props.icon.props.icon).toEqual([
|
|
92
|
+
"fas",
|
|
93
|
+
"newspaper"
|
|
94
|
+
]);
|
|
95
|
+
});
|
|
96
|
+
it("renders nothing for a model that is not cached", async ()=>{
|
|
97
|
+
const { adapter } = createAdapter([
|
|
98
|
+
createModel("article", "Article", "fas/newspaper")
|
|
99
|
+
]);
|
|
100
|
+
await adapter.init();
|
|
101
|
+
const node = adapter.renderModelIcon("missing");
|
|
102
|
+
expect(node).toBeNull();
|
|
103
|
+
});
|
|
104
|
+
it("renders the devices_other fallback icon for a model without an icon", async ()=>{
|
|
105
|
+
const { adapter } = createAdapter([
|
|
106
|
+
createModel("article", "Article", "")
|
|
107
|
+
]);
|
|
108
|
+
await adapter.init();
|
|
109
|
+
const node = adapter.renderModelIcon("article");
|
|
110
|
+
if (!/*#__PURE__*/ react.isValidElement(node)) throw new Error("The model icon is not an element.");
|
|
111
|
+
expect(node.props.label).toBe("Article");
|
|
112
|
+
expect(node.props.icon.type).not.toBe(FontAwesomeIcon);
|
|
113
|
+
});
|
|
114
|
+
describe("folders (R292)", ()=>{
|
|
115
|
+
it("names the folder type of a model cms:<modelId>", ()=>{
|
|
116
|
+
const { adapter } = createAdapter([]);
|
|
117
|
+
expect(adapter.getFolderType("article")).toBe("cms:article");
|
|
118
|
+
expect(adapter.getFolderType("author")).toBe("cms:author");
|
|
119
|
+
});
|
|
120
|
+
it("lists the folders with the type of the model, root excluded, and the title paths", async ()=>{
|
|
121
|
+
const { adapter, listFoldersExecute } = createAdapter([], [
|
|
122
|
+
createFolder("folder-a", "Campaigns", ROOT_FOLDER),
|
|
123
|
+
createFolder("folder-b", "Spring", "folder-a"),
|
|
124
|
+
createFolder("folder-c", "Press", ROOT_FOLDER)
|
|
125
|
+
]);
|
|
126
|
+
const folders = await adapter.listFolders("article");
|
|
127
|
+
expect(listFoldersExecute).toHaveBeenCalledTimes(1);
|
|
128
|
+
expect(listFoldersExecute).toHaveBeenCalledWith("cms:article");
|
|
129
|
+
expect(folders).toEqual([
|
|
130
|
+
{
|
|
131
|
+
id: "folder-a",
|
|
132
|
+
path: "/Campaigns"
|
|
133
|
+
},
|
|
134
|
+
{
|
|
135
|
+
id: "folder-b",
|
|
136
|
+
path: "/Campaigns/Spring"
|
|
137
|
+
},
|
|
138
|
+
{
|
|
139
|
+
id: "folder-c",
|
|
140
|
+
path: "/Press"
|
|
141
|
+
}
|
|
142
|
+
]);
|
|
143
|
+
});
|
|
144
|
+
it("asks for the folders of the model it is given each time", async ()=>{
|
|
145
|
+
const { adapter, listFoldersExecute } = createAdapter([]);
|
|
146
|
+
await adapter.listFolders("article");
|
|
147
|
+
await adapter.listFolders("author");
|
|
148
|
+
expect(listFoldersExecute.mock.calls).toEqual([
|
|
149
|
+
[
|
|
150
|
+
"cms:article"
|
|
151
|
+
],
|
|
152
|
+
[
|
|
153
|
+
"cms:author"
|
|
154
|
+
]
|
|
155
|
+
]);
|
|
156
|
+
});
|
|
157
|
+
it("passes a permission-filtered list through: a child of a hidden folder starts at its own title", async ()=>{
|
|
158
|
+
const { adapter, listFoldersExecute } = createAdapter([], [
|
|
159
|
+
createFolder("folder-b", "Spring", "folder-hidden")
|
|
160
|
+
]);
|
|
161
|
+
const folders = await adapter.listFolders("article");
|
|
162
|
+
expect(folders).toEqual([
|
|
163
|
+
{
|
|
164
|
+
id: "folder-b",
|
|
165
|
+
path: "/Spring"
|
|
166
|
+
}
|
|
167
|
+
]);
|
|
168
|
+
expect(listFoldersExecute).toHaveBeenCalledTimes(1);
|
|
169
|
+
});
|
|
170
|
+
it("lists nothing and sends no request without a model", async ()=>{
|
|
171
|
+
const { adapter, listFoldersExecute } = createAdapter([]);
|
|
172
|
+
const folders = await adapter.listFolders(null);
|
|
173
|
+
expect(folders).toEqual([]);
|
|
174
|
+
expect(listFoldersExecute).not.toHaveBeenCalled();
|
|
175
|
+
});
|
|
176
|
+
it("rejects when the folders cannot be loaded", async ()=>{
|
|
177
|
+
const { adapter, listFoldersExecute } = createAdapter([]);
|
|
178
|
+
const failure = new Error("Could not fetch folders");
|
|
179
|
+
listFoldersExecute.mockRejectedValue(failure);
|
|
180
|
+
await expect(adapter.listFolders("article")).rejects.toBe(failure);
|
|
181
|
+
});
|
|
182
|
+
});
|
|
183
|
+
});
|
|
184
|
+
|
|
185
|
+
//# sourceMappingURL=CmsWorkflowEditorAppAdapter.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"features/editorMounting/CmsWorkflowEditorAppAdapter.test.js","sources":["../../../src/features/editorMounting/CmsWorkflowEditorAppAdapter.test.tsx"],"sourcesContent":["import React from \"react\";\nimport { describe } from \"vitest\";\nimport { expect } from \"vitest\";\nimport { it } from \"vitest\";\nimport { vi } from \"vitest\";\nimport { FontAwesomeIcon } from \"@fortawesome/react-fontawesome\";\nimport { Container } from \"@webiny/di\";\nimport { ROOT_FOLDER } from \"@webiny/app-aco/constants.js\";\nimport { ListFoldersGateway } from \"@webiny/app-aco/features/folders/listFolders/abstractions.js\";\nimport { RootFolder } from \"@webiny/app-aco/domain/folder/RootFolder.js\";\nimport type { FolderDto } from \"@webiny/app-aco/domain/folder/FolderDto.js\";\nimport { ListCache } from \"@webiny/app-admin/features/listCache/index.js\";\nimport { ModelsCache } from \"@webiny/app-headless-cms/features/model/abstractions.js\";\nimport { ListModelsUseCase } from \"@webiny/app-headless-cms/features/model/listModels/abstractions.js\";\nimport type { CmsModel } from \"@webiny/app-headless-cms-common/types/index.js\";\nimport { createFakeContentAdapter } from \"@webiny/app-workflows/editor/testing/fakeReviewContentAdapter.js\";\nimport { CmsReviewContentAdapter } from \"~/features/gateway/CmsReviewContentAdapter/abstractions.js\";\nimport { createFolder } from \"~/testing/createFolder.js\";\nimport { MODEL } from \"~/testing/models.js\";\nimport { CmsWorkflowEditorAppAdapter as AdapterAbstraction } from \"./abstractions.js\";\nimport { CmsWorkflowEditorAppAdapter } from \"./CmsWorkflowEditorAppAdapter.js\";\n\ninterface FontAwesomeElementProps {\n icon: string[];\n}\n\ninterface RenderedIconProps {\n label: string;\n icon: React.ReactElement<FontAwesomeElementProps>;\n}\n\nconst createModel = (modelId: string, name: string, icon: string): CmsModel => {\n return { ...MODEL, modelId, name, icon };\n};\n\nconst contentAdapter = createFakeContentAdapter();\n\nconst createAdapter = (models: CmsModel[], folders: FolderDto[] = []) => {\n const cache = new ListCache<CmsModel>(\"modelId\");\n // Mirrors `ListModelsRepository`: the first call fills the cache, later calls serve it.\n const execute = vi.fn(async () => {\n if (!cache.hasItems()) {\n cache.setItems(models);\n }\n return cache.getItems();\n });\n const container = new Container();\n container.registerInstance(ModelsCache, cache);\n container.registerInstance(ListModelsUseCase, { execute });\n // Mirrors the gateway of app-aco: the virtual root row comes first.\n const rootFolder = RootFolder.create();\n const listFoldersExecute = vi\n .fn<ListFoldersGateway.Interface[\"execute\"]>()\n .mockResolvedValue([rootFolder, ...folders]);\n container.registerInstance(ListFoldersGateway, { execute: listFoldersExecute });\n container.registerInstance(CmsReviewContentAdapter, contentAdapter);\n container.register(CmsWorkflowEditorAppAdapter);\n const adapter = container.resolve(AdapterAbstraction);\n\n return { adapter, execute, listFoldersExecute };\n};\n\ndescribe(\"CmsWorkflowEditorAppAdapter\", () => {\n it(\"describes the CMS app\", () => {\n const { adapter } = createAdapter([]);\n\n expect(adapter.appKind).toBe(\"cms\");\n expect(adapter.panelLabel).toBe(\"Content models\");\n expect(adapter.appliesToLabel).toBe(\"Headless CMS model\");\n expect(adapter.contentAdapter).toBe(contentAdapter);\n });\n\n it(\"lists the models on init\", async () => {\n const model = createModel(\"article\", \"Article\", \"fas/newspaper\");\n const { adapter, execute } = createAdapter([model]);\n\n await adapter.init();\n\n expect(execute).toHaveBeenCalledTimes(1);\n });\n\n it(\"does not reject when the models cannot be listed, renders no icon and retries on the next init\", async () => {\n const model = createModel(\"article\", \"Article\", \"fas/newspaper\");\n const { adapter, execute } = createAdapter([model]);\n execute.mockRejectedValueOnce(new Error(\"Not authorized.\"));\n\n await expect(adapter.init()).resolves.toBeUndefined();\n const before = adapter.renderModelIcon(\"article\");\n await adapter.init();\n const after = adapter.renderModelIcon(\"article\");\n\n expect(before).toBeNull();\n expect(after).not.toBeNull();\n expect(execute).toHaveBeenCalledTimes(2);\n });\n\n it(\"renders the model icon from the cached model\", async () => {\n const model = createModel(\"article\", \"Article\", \"fas/newspaper\");\n const { adapter } = createAdapter([model]);\n await adapter.init();\n\n const node = adapter.renderModelIcon(\"article\");\n\n if (!React.isValidElement<RenderedIconProps>(node)) {\n throw new Error(\"The model icon is not an element.\");\n }\n expect(node.props.label).toBe(\"Article\");\n expect(node.props.icon.props.icon).toEqual([\"fas\", \"newspaper\"]);\n });\n\n it(\"renders nothing for a model that is not cached\", async () => {\n const { adapter } = createAdapter([createModel(\"article\", \"Article\", \"fas/newspaper\")]);\n await adapter.init();\n\n const node = adapter.renderModelIcon(\"missing\");\n\n expect(node).toBeNull();\n });\n\n it(\"renders the devices_other fallback icon for a model without an icon\", async () => {\n const { adapter } = createAdapter([createModel(\"article\", \"Article\", \"\")]);\n await adapter.init();\n\n const node = adapter.renderModelIcon(\"article\");\n\n if (!React.isValidElement<RenderedIconProps>(node)) {\n throw new Error(\"The model icon is not an element.\");\n }\n expect(node.props.label).toBe(\"Article\");\n expect(node.props.icon.type).not.toBe(FontAwesomeIcon);\n });\n\n describe(\"folders (R292)\", () => {\n it(\"names the folder type of a model cms:<modelId>\", () => {\n const { adapter } = createAdapter([]);\n\n expect(adapter.getFolderType(\"article\")).toBe(\"cms:article\");\n expect(adapter.getFolderType(\"author\")).toBe(\"cms:author\");\n });\n\n it(\"lists the folders with the type of the model, root excluded, and the title paths\", async () => {\n const { adapter, listFoldersExecute } = createAdapter(\n [],\n [\n createFolder(\"folder-a\", \"Campaigns\", ROOT_FOLDER),\n createFolder(\"folder-b\", \"Spring\", \"folder-a\"),\n createFolder(\"folder-c\", \"Press\", ROOT_FOLDER)\n ]\n );\n\n const folders = await adapter.listFolders(\"article\");\n\n expect(listFoldersExecute).toHaveBeenCalledTimes(1);\n expect(listFoldersExecute).toHaveBeenCalledWith(\"cms:article\");\n expect(folders).toEqual([\n { id: \"folder-a\", path: \"/Campaigns\" },\n { id: \"folder-b\", path: \"/Campaigns/Spring\" },\n { id: \"folder-c\", path: \"/Press\" }\n ]);\n });\n\n it(\"asks for the folders of the model it is given each time\", async () => {\n const { adapter, listFoldersExecute } = createAdapter([]);\n\n await adapter.listFolders(\"article\");\n await adapter.listFolders(\"author\");\n\n expect(listFoldersExecute.mock.calls).toEqual([[\"cms:article\"], [\"cms:author\"]]);\n });\n\n it(\"passes a permission-filtered list through: a child of a hidden folder starts at its own title\", async () => {\n const { adapter, listFoldersExecute } = createAdapter(\n [],\n [createFolder(\"folder-b\", \"Spring\", \"folder-hidden\")]\n );\n\n const folders = await adapter.listFolders(\"article\");\n\n expect(folders).toEqual([{ id: \"folder-b\", path: \"/Spring\" }]);\n expect(listFoldersExecute).toHaveBeenCalledTimes(1);\n });\n\n it(\"lists nothing and sends no request without a model\", async () => {\n const { adapter, listFoldersExecute } = createAdapter([]);\n\n const folders = await adapter.listFolders(null);\n\n expect(folders).toEqual([]);\n expect(listFoldersExecute).not.toHaveBeenCalled();\n });\n\n it(\"rejects when the folders cannot be loaded\", async () => {\n const { adapter, listFoldersExecute } = createAdapter([]);\n const failure = new Error(\"Could not fetch folders\");\n listFoldersExecute.mockRejectedValue(failure);\n\n await expect(adapter.listFolders(\"article\")).rejects.toBe(failure);\n });\n });\n});\n"],"names":["createModel","modelId","name","icon","MODEL","contentAdapter","createFakeContentAdapter","createAdapter","models","folders","cache","ListCache","execute","vi","container","Container","ModelsCache","ListModelsUseCase","rootFolder","RootFolder","listFoldersExecute","ListFoldersGateway","CmsReviewContentAdapter","CmsWorkflowEditorAppAdapter","adapter","AdapterAbstraction","describe","it","expect","model","Error","before","after","node","React","FontAwesomeIcon","createFolder","ROOT_FOLDER","failure"],"mappings":"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"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { WorkflowEditorAppAdapter } from "@webiny/app-workflows/editor/WorkflowEditorAppAdapter.js";
|
|
2
|
+
export declare const CmsWorkflowEditorAppAdapter: import("@webiny/di").Abstraction<WorkflowEditorAppAdapter>;
|
|
3
|
+
export declare namespace CmsWorkflowEditorAppAdapter {
|
|
4
|
+
type Interface = WorkflowEditorAppAdapter;
|
|
5
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"features/editorMounting/abstractions.js","sources":["../../../src/features/editorMounting/abstractions.ts"],"sourcesContent":["import { createAbstraction } from \"@webiny/feature/admin\";\nimport type { WorkflowEditorAppAdapter } from \"@webiny/app-workflows/editor/WorkflowEditorAppAdapter.js\";\n\nexport const CmsWorkflowEditorAppAdapter = createAbstraction<WorkflowEditorAppAdapter>(\n \"Cms/Workflows/EditorAppAdapter\"\n);\n\nexport namespace CmsWorkflowEditorAppAdapter {\n export type Interface = WorkflowEditorAppAdapter;\n}\n"],"names":["CmsWorkflowEditorAppAdapter","createAbstraction"],"mappings":";AAGO,MAAMA,8BAA8BC,kBACvC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { createFeature } from "@webiny/feature/admin";
|
|
2
|
+
import { ListFoldersGqlGateway } from "@webiny/app-aco/features/folders/listFolders/ListFoldersGqlGateway.js";
|
|
3
|
+
import { CmsWorkflowEditorAppAdapter } from "./abstractions.js";
|
|
4
|
+
import { CmsWorkflowEditorAppAdapter as external_CmsWorkflowEditorAppAdapter_js_CmsWorkflowEditorAppAdapter } from "./CmsWorkflowEditorAppAdapter.js";
|
|
5
|
+
const CmsWorkflowEditorMountingFeature = createFeature({
|
|
6
|
+
name: "CmsWorkflows/EditorMounting",
|
|
7
|
+
register (container) {
|
|
8
|
+
container.register(ListFoldersGqlGateway);
|
|
9
|
+
container.register(external_CmsWorkflowEditorAppAdapter_js_CmsWorkflowEditorAppAdapter).inSingletonScope();
|
|
10
|
+
},
|
|
11
|
+
resolve (container) {
|
|
12
|
+
return {
|
|
13
|
+
app: container.resolve(CmsWorkflowEditorAppAdapter)
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
});
|
|
17
|
+
export { CmsWorkflowEditorMountingFeature };
|
|
18
|
+
|
|
19
|
+
//# sourceMappingURL=feature.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"features/editorMounting/feature.js","sources":["../../../src/features/editorMounting/feature.ts"],"sourcesContent":["import { createFeature } from \"@webiny/feature/admin\";\nimport { ListFoldersGqlGateway } from \"@webiny/app-aco/features/folders/listFolders/ListFoldersGqlGateway.js\";\nimport { CmsWorkflowEditorAppAdapter as AdapterAbstraction } from \"./abstractions.js\";\nimport { CmsWorkflowEditorAppAdapter } from \"./CmsWorkflowEditorAppAdapter.js\";\n\n/*\n * Resolves only the app adapter: the mounting component renders in the plugin pass, where nothing\n * may resolve a use case (R349, R354).\n */\nexport const CmsWorkflowEditorMountingFeature = createFeature({\n name: \"CmsWorkflows/EditorMounting\",\n register(container) {\n // The adapter lists the model's folders through app-aco's gateway (R292). The Website\n // Builder registers the same implementation; the last registration wins and they are alike.\n container.register(ListFoldersGqlGateway);\n container.register(CmsWorkflowEditorAppAdapter).inSingletonScope();\n },\n resolve(container) {\n return {\n app: container.resolve(AdapterAbstraction)\n };\n }\n});\n"],"names":["CmsWorkflowEditorMountingFeature","createFeature","container","ListFoldersGqlGateway","CmsWorkflowEditorAppAdapter","AdapterAbstraction"],"mappings":";;;;AASO,MAAMA,mCAAmCC,cAAc;IAC1D,MAAM;IACN,UAASC,SAAS;QAGdA,UAAU,QAAQ,CAACC;QACnBD,UAAU,QAAQ,CAACE,qEAA6B,gBAAgB;IACpE;IACA,SAAQF,SAAS;QACb,OAAO;YACH,KAAKA,UAAU,OAAO,CAACG;QAC3B;IACJ;AACJ"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import { describe, expect, it, vi } from "vitest";
|
|
2
|
+
import { Container } from "@webiny/di";
|
|
3
|
+
import { MainGraphQLClient } from "@webiny/app/features/mainGraphQLClient/abstractions.js";
|
|
4
|
+
import { ListCache } from "@webiny/app-admin/features/listCache/index.js";
|
|
5
|
+
import { FolderModelProvider } from "@webiny/app-aco/features/folders/abstractions.js";
|
|
6
|
+
import { ModelsCache } from "@webiny/app-headless-cms/features/model/abstractions.js";
|
|
7
|
+
import { ListModelsUseCase } from "@webiny/app-headless-cms/features/model/listModels/abstractions.js";
|
|
8
|
+
import { createFakeContentAdapter } from "@webiny/app-workflows/editor/testing/fakeReviewContentAdapter.js";
|
|
9
|
+
import { CmsReviewContentAdapter } from "../gateway/CmsReviewContentAdapter/abstractions.js";
|
|
10
|
+
import { createFolder } from "../../testing/createFolder.js";
|
|
11
|
+
import { CmsWorkflowEditorAppAdapter } from "./abstractions.js";
|
|
12
|
+
import { CmsWorkflowEditorMountingFeature } from "./feature.js";
|
|
13
|
+
const contentAdapter = createFakeContentAdapter();
|
|
14
|
+
const createContainer = ()=>{
|
|
15
|
+
const client = {
|
|
16
|
+
execute: vi.fn()
|
|
17
|
+
};
|
|
18
|
+
const folderModelProvider = {
|
|
19
|
+
getModel: vi.fn().mockRejectedValue(new Error("The folder model is not needed here.")),
|
|
20
|
+
getGraphQLSelection: vi.fn().mockResolvedValue("{ id title parentId }")
|
|
21
|
+
};
|
|
22
|
+
const container = new Container();
|
|
23
|
+
container.registerInstance(MainGraphQLClient, client);
|
|
24
|
+
container.registerInstance(FolderModelProvider, folderModelProvider);
|
|
25
|
+
container.registerInstance(ModelsCache, new ListCache("modelId"));
|
|
26
|
+
container.registerInstance(ListModelsUseCase, {
|
|
27
|
+
execute: vi.fn().mockResolvedValue([])
|
|
28
|
+
});
|
|
29
|
+
container.registerInstance(CmsReviewContentAdapter, contentAdapter);
|
|
30
|
+
CmsWorkflowEditorMountingFeature.register(container);
|
|
31
|
+
return {
|
|
32
|
+
container,
|
|
33
|
+
client
|
|
34
|
+
};
|
|
35
|
+
};
|
|
36
|
+
describe("CmsWorkflowEditorMountingFeature", ()=>{
|
|
37
|
+
it("resolves only the app adapter for the view: no use case in the plugin pass (R349, R354)", ()=>{
|
|
38
|
+
const { container } = createContainer();
|
|
39
|
+
const resolved = CmsWorkflowEditorMountingFeature.resolve(container);
|
|
40
|
+
expect(Object.keys(resolved)).toEqual([
|
|
41
|
+
"app"
|
|
42
|
+
]);
|
|
43
|
+
expect(resolved.app.appKind).toBe("cms");
|
|
44
|
+
expect(resolved.app.contentAdapter).toBe(contentAdapter);
|
|
45
|
+
});
|
|
46
|
+
it("registers the app-aco folder gateway so the adapter lists the folders", async ()=>{
|
|
47
|
+
const { container, client } = createContainer();
|
|
48
|
+
client.execute.mockResolvedValue({
|
|
49
|
+
aco: {
|
|
50
|
+
listFolders: {
|
|
51
|
+
data: [
|
|
52
|
+
createFolder("folder-a", "Campaigns", "root"),
|
|
53
|
+
createFolder("folder-b", "Spring", "folder-a")
|
|
54
|
+
],
|
|
55
|
+
error: null
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
});
|
|
59
|
+
const { app } = CmsWorkflowEditorMountingFeature.resolve(container);
|
|
60
|
+
const folders = await app.listFolders("article");
|
|
61
|
+
expect(folders).toEqual([
|
|
62
|
+
{
|
|
63
|
+
id: "folder-a",
|
|
64
|
+
path: "/Campaigns"
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
id: "folder-b",
|
|
68
|
+
path: "/Campaigns/Spring"
|
|
69
|
+
}
|
|
70
|
+
]);
|
|
71
|
+
expect(client.execute).toHaveBeenCalledTimes(1);
|
|
72
|
+
expect(client.execute.mock.calls[0][0].variables).toEqual({
|
|
73
|
+
type: "cms:article",
|
|
74
|
+
limit: 10000
|
|
75
|
+
});
|
|
76
|
+
});
|
|
77
|
+
it("rejects when the folder query returns no data", async ()=>{
|
|
78
|
+
const { container, client } = createContainer();
|
|
79
|
+
client.execute.mockResolvedValue({
|
|
80
|
+
aco: {
|
|
81
|
+
listFolders: {
|
|
82
|
+
data: null,
|
|
83
|
+
error: {
|
|
84
|
+
message: "Not allowed."
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
});
|
|
89
|
+
const { app } = CmsWorkflowEditorMountingFeature.resolve(container);
|
|
90
|
+
await expect(app.listFolders("article")).rejects.toThrow("Not allowed.");
|
|
91
|
+
});
|
|
92
|
+
it("registers the adapter as a singleton", ()=>{
|
|
93
|
+
const { container } = createContainer();
|
|
94
|
+
const first = container.resolve(CmsWorkflowEditorAppAdapter);
|
|
95
|
+
const second = container.resolve(CmsWorkflowEditorAppAdapter);
|
|
96
|
+
expect(first).toBe(second);
|
|
97
|
+
});
|
|
98
|
+
});
|
|
99
|
+
|
|
100
|
+
//# sourceMappingURL=feature.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"features/editorMounting/feature.test.js","sources":["../../../src/features/editorMounting/feature.test.ts"],"sourcesContent":["import { describe } from \"vitest\";\nimport { expect } from \"vitest\";\nimport { it } from \"vitest\";\nimport { vi } from \"vitest\";\nimport { Container } from \"@webiny/di\";\nimport { MainGraphQLClient } from \"@webiny/app/features/mainGraphQLClient/abstractions.js\";\nimport { ListCache } from \"@webiny/app-admin/features/listCache/index.js\";\nimport { FolderModelProvider } from \"@webiny/app-aco/features/folders/abstractions.js\";\nimport { ModelsCache } from \"@webiny/app-headless-cms/features/model/abstractions.js\";\nimport { ListModelsUseCase } from \"@webiny/app-headless-cms/features/model/listModels/abstractions.js\";\nimport type { CmsModel } from \"@webiny/app-headless-cms-common/types/index.js\";\nimport { createFakeContentAdapter } from \"@webiny/app-workflows/editor/testing/fakeReviewContentAdapter.js\";\nimport { CmsReviewContentAdapter } from \"~/features/gateway/CmsReviewContentAdapter/abstractions.js\";\nimport { createFolder } from \"~/testing/createFolder.js\";\nimport { CmsWorkflowEditorAppAdapter } from \"./abstractions.js\";\nimport { CmsWorkflowEditorMountingFeature } from \"./feature.js\";\n\nconst contentAdapter = createFakeContentAdapter();\n\nconst createContainer = () => {\n const client = { execute: vi.fn() };\n const folderModelProvider = {\n getModel: vi.fn().mockRejectedValue(new Error(\"The folder model is not needed here.\")),\n getGraphQLSelection: vi.fn().mockResolvedValue(\"{ id title parentId }\")\n };\n const container = new Container();\n container.registerInstance(MainGraphQLClient, client);\n container.registerInstance(FolderModelProvider, folderModelProvider);\n container.registerInstance(ModelsCache, new ListCache<CmsModel>(\"modelId\"));\n container.registerInstance(ListModelsUseCase, { execute: vi.fn().mockResolvedValue([]) });\n container.registerInstance(CmsReviewContentAdapter, contentAdapter);\n CmsWorkflowEditorMountingFeature.register(container);\n\n return { container, client };\n};\n\ndescribe(\"CmsWorkflowEditorMountingFeature\", () => {\n it(\"resolves only the app adapter for the view: no use case in the plugin pass (R349, R354)\", () => {\n const { container } = createContainer();\n\n const resolved = CmsWorkflowEditorMountingFeature.resolve(container);\n\n expect(Object.keys(resolved)).toEqual([\"app\"]);\n expect(resolved.app.appKind).toBe(\"cms\");\n expect(resolved.app.contentAdapter).toBe(contentAdapter);\n });\n\n it(\"registers the app-aco folder gateway so the adapter lists the folders\", async () => {\n const { container, client } = createContainer();\n client.execute.mockResolvedValue({\n aco: {\n listFolders: {\n data: [\n createFolder(\"folder-a\", \"Campaigns\", \"root\"),\n createFolder(\"folder-b\", \"Spring\", \"folder-a\")\n ],\n error: null\n }\n }\n });\n const { app } = CmsWorkflowEditorMountingFeature.resolve(container);\n\n const folders = await app.listFolders(\"article\");\n\n expect(folders).toEqual([\n { id: \"folder-a\", path: \"/Campaigns\" },\n { id: \"folder-b\", path: \"/Campaigns/Spring\" }\n ]);\n expect(client.execute).toHaveBeenCalledTimes(1);\n expect(client.execute.mock.calls[0][0].variables).toEqual({\n type: \"cms:article\",\n limit: 10000\n });\n });\n\n it(\"rejects when the folder query returns no data\", async () => {\n const { container, client } = createContainer();\n client.execute.mockResolvedValue({\n aco: { listFolders: { data: null, error: { message: \"Not allowed.\" } } }\n });\n const { app } = CmsWorkflowEditorMountingFeature.resolve(container);\n\n await expect(app.listFolders(\"article\")).rejects.toThrow(\"Not allowed.\");\n });\n\n it(\"registers the adapter as a singleton\", () => {\n const { container } = createContainer();\n\n const first = container.resolve(CmsWorkflowEditorAppAdapter);\n const second = container.resolve(CmsWorkflowEditorAppAdapter);\n\n expect(first).toBe(second);\n });\n});\n"],"names":["contentAdapter","createFakeContentAdapter","createContainer","client","vi","folderModelProvider","Error","container","Container","MainGraphQLClient","FolderModelProvider","ModelsCache","ListCache","ListModelsUseCase","CmsReviewContentAdapter","CmsWorkflowEditorMountingFeature","describe","it","resolved","expect","Object","createFolder","app","folders","first","CmsWorkflowEditorAppAdapter","second"],"mappings":";;;;;;;;;;;;AAiBA,MAAMA,iBAAiBC;AAEvB,MAAMC,kBAAkB;IACpB,MAAMC,SAAS;QAAE,SAASC,GAAG,EAAE;IAAG;IAClC,MAAMC,sBAAsB;QACxB,UAAUD,GAAG,EAAE,GAAG,iBAAiB,CAAC,IAAIE,MAAM;QAC9C,qBAAqBF,GAAG,EAAE,GAAG,iBAAiB,CAAC;IACnD;IACA,MAAMG,YAAY,IAAIC;IACtBD,UAAU,gBAAgB,CAACE,mBAAmBN;IAC9CI,UAAU,gBAAgB,CAACG,qBAAqBL;IAChDE,UAAU,gBAAgB,CAACI,aAAa,IAAIC,UAAoB;IAChEL,UAAU,gBAAgB,CAACM,mBAAmB;QAAE,SAAST,GAAG,EAAE,GAAG,iBAAiB,CAAC,EAAE;IAAE;IACvFG,UAAU,gBAAgB,CAACO,yBAAyBd;IACpDe,iCAAiC,QAAQ,CAACR;IAE1C,OAAO;QAAEA;QAAWJ;IAAO;AAC/B;AAEAa,SAAS,oCAAoC;IACzCC,GAAG,2FAA2F;QAC1F,MAAM,EAAEV,SAAS,EAAE,GAAGL;QAEtB,MAAMgB,WAAWH,iCAAiC,OAAO,CAACR;QAE1DY,OAAOC,OAAO,IAAI,CAACF,WAAW,OAAO,CAAC;YAAC;SAAM;QAC7CC,OAAOD,SAAS,GAAG,CAAC,OAAO,EAAE,IAAI,CAAC;QAClCC,OAAOD,SAAS,GAAG,CAAC,cAAc,EAAE,IAAI,CAAClB;IAC7C;IAEAiB,GAAG,yEAAyE;QACxE,MAAM,EAAEV,SAAS,EAAEJ,MAAM,EAAE,GAAGD;QAC9BC,OAAO,OAAO,CAAC,iBAAiB,CAAC;YAC7B,KAAK;gBACD,aAAa;oBACT,MAAM;wBACFkB,aAAa,YAAY,aAAa;wBACtCA,aAAa,YAAY,UAAU;qBACtC;oBACD,OAAO;gBACX;YACJ;QACJ;QACA,MAAM,EAAEC,GAAG,EAAE,GAAGP,iCAAiC,OAAO,CAACR;QAEzD,MAAMgB,UAAU,MAAMD,IAAI,WAAW,CAAC;QAEtCH,OAAOI,SAAS,OAAO,CAAC;YACpB;gBAAE,IAAI;gBAAY,MAAM;YAAa;YACrC;gBAAE,IAAI;gBAAY,MAAM;YAAoB;SAC/C;QACDJ,OAAOhB,OAAO,OAAO,EAAE,qBAAqB,CAAC;QAC7CgB,OAAOhB,OAAO,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,EAAE,CAAC,SAAS,EAAE,OAAO,CAAC;YACtD,MAAM;YACN,OAAO;QACX;IACJ;IAEAc,GAAG,iDAAiD;QAChD,MAAM,EAAEV,SAAS,EAAEJ,MAAM,EAAE,GAAGD;QAC9BC,OAAO,OAAO,CAAC,iBAAiB,CAAC;YAC7B,KAAK;gBAAE,aAAa;oBAAE,MAAM;oBAAM,OAAO;wBAAE,SAAS;oBAAe;gBAAE;YAAE;QAC3E;QACA,MAAM,EAAEmB,GAAG,EAAE,GAAGP,iCAAiC,OAAO,CAACR;QAEzD,MAAMY,OAAOG,IAAI,WAAW,CAAC,YAAY,OAAO,CAAC,OAAO,CAAC;IAC7D;IAEAL,GAAG,wCAAwC;QACvC,MAAM,EAAEV,SAAS,EAAE,GAAGL;QAEtB,MAAMsB,QAAQjB,UAAU,OAAO,CAACkB;QAChC,MAAMC,SAASnB,UAAU,OAAO,CAACkB;QAEjCN,OAAOK,OAAO,IAAI,CAACE;IACvB;AACJ"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { EditorReviewSession } from "@webiny/app-workflows/review/editor/EditorReviewSession.js";
|
|
2
|
+
import { CmsEntryReview as Abstraction } from "./abstractions.js";
|
|
3
|
+
declare class CmsEntryReviewSessionImpl extends EditorReviewSession implements Abstraction.Interface {
|
|
4
|
+
}
|
|
5
|
+
export declare const CmsEntryReview: typeof CmsEntryReviewSessionImpl & {
|
|
6
|
+
__abstraction: import("@webiny/di").Abstraction<import("@webiny/app-workflows/review/editor/abstractions.js").IEditorReviewSession>;
|
|
7
|
+
};
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { EditorReviewSession } from "@webiny/app-workflows/review/editor/EditorReviewSession.js";
|
|
2
|
+
import { TargetReviewPresenter } from "@webiny/app-workflows/review/presentation/targetReview/abstractions.js";
|
|
3
|
+
import { CmsEntryReview } from "./abstractions.js";
|
|
4
|
+
class CmsEntryReviewSessionImpl extends EditorReviewSession {
|
|
5
|
+
}
|
|
6
|
+
const CmsEntryReview_CmsEntryReview = CmsEntryReview.createImplementation({
|
|
7
|
+
implementation: CmsEntryReviewSessionImpl,
|
|
8
|
+
dependencies: [
|
|
9
|
+
TargetReviewPresenter
|
|
10
|
+
]
|
|
11
|
+
});
|
|
12
|
+
export { CmsEntryReview_CmsEntryReview as CmsEntryReview };
|
|
13
|
+
|
|
14
|
+
//# sourceMappingURL=CmsEntryReview.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"features/editorReview/CmsEntryReview.js","sources":["../../../src/features/editorReview/CmsEntryReview.ts"],"sourcesContent":["import { EditorReviewSession } from \"@webiny/app-workflows/review/editor/EditorReviewSession.js\";\nimport { TargetReviewPresenter } from \"@webiny/app-workflows/review/presentation/targetReview/abstractions.js\";\nimport { CmsEntryReview as Abstraction } from \"./abstractions.js\";\n\n/*\n * The shared session class is never registered itself: `createImplementation` stores the\n * abstraction and dependencies on the class, so each app subclasses it once (R237).\n */\nclass CmsEntryReviewSessionImpl extends EditorReviewSession implements Abstraction.Interface {}\n\nexport const CmsEntryReview = Abstraction.createImplementation({\n implementation: CmsEntryReviewSessionImpl,\n dependencies: [TargetReviewPresenter]\n});\n"],"names":["CmsEntryReviewSessionImpl","EditorReviewSession","CmsEntryReview","Abstraction","TargetReviewPresenter"],"mappings":";;;AAQA,MAAMA,kCAAkCC;AAAsD;AAEvF,MAAMC,gCAAiBC,eAAAA,oBAAgC,CAAC;IAC3D,gBAAgBH;IAChB,cAAc;QAACI;KAAsB;AACzC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { IEditorReviewSession } from "@webiny/app-workflows/review/editor/abstractions.js";
|
|
2
|
+
export declare const CmsEntryReview: import("@webiny/di").Abstraction<IEditorReviewSession>;
|
|
3
|
+
export declare namespace CmsEntryReview {
|
|
4
|
+
type Interface = IEditorReviewSession;
|
|
5
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"features/editorReview/abstractions.js","sources":["../../../src/features/editorReview/abstractions.ts"],"sourcesContent":["import { createAbstraction } from \"@webiny/feature/admin\";\nimport type { IEditorReviewSession } from \"@webiny/app-workflows/review/editor/abstractions.js\";\n\nexport const CmsEntryReview = createAbstraction<IEditorReviewSession>(\"Cms/Workflows/EntryReview\");\n\nexport namespace CmsEntryReview {\n export type Interface = IEditorReviewSession;\n}\n"],"names":["CmsEntryReview","createAbstraction"],"mappings":";AAGO,MAAMA,iBAAiBC,kBAAwC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { createFeature } from "@webiny/feature/admin";
|
|
2
|
+
import { CmsEntryReview } from "./abstractions.js";
|
|
3
|
+
import { CmsEntryReview as external_CmsEntryReview_js_CmsEntryReview } from "./CmsEntryReview.js";
|
|
4
|
+
const CmsEntryReviewFeature = createFeature({
|
|
5
|
+
name: "CmsWorkflows/EntryReview",
|
|
6
|
+
register (container) {
|
|
7
|
+
container.register(external_CmsEntryReview_js_CmsEntryReview).inSingletonScope();
|
|
8
|
+
},
|
|
9
|
+
resolve (container) {
|
|
10
|
+
return {
|
|
11
|
+
session: container.resolve(CmsEntryReview)
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
});
|
|
15
|
+
export { CmsEntryReviewFeature };
|
|
16
|
+
|
|
17
|
+
//# sourceMappingURL=feature.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"features/editorReview/feature.js","sources":["../../../src/features/editorReview/feature.ts"],"sourcesContent":["import { createFeature } from \"@webiny/feature/admin\";\nimport { CmsEntryReview as Abstraction } from \"./abstractions.js\";\nimport { CmsEntryReview } from \"./CmsEntryReview.js\";\n\nexport const CmsEntryReviewFeature = createFeature({\n name: \"CmsWorkflows/EntryReview\",\n register(container) {\n container.register(CmsEntryReview).inSingletonScope();\n },\n resolve(container) {\n return {\n session: container.resolve(Abstraction)\n };\n }\n});\n"],"names":["CmsEntryReviewFeature","createFeature","container","CmsEntryReview","Abstraction"],"mappings":";;;AAIO,MAAMA,wBAAwBC,cAAc;IAC/C,MAAM;IACN,UAASC,SAAS;QACdA,UAAU,QAAQ,CAACC,2CAAgB,gBAAgB;IACvD;IACA,SAAQD,SAAS;QACb,OAAO;YACH,SAASA,UAAU,OAAO,CAACE;QAC/B;IACJ;AACJ"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { describe, expect, it } from "vitest";
|
|
2
|
+
import { Container } from "@webiny/di";
|
|
3
|
+
import { TargetReviewPresenter } from "@webiny/app-workflows/review/presentation/targetReview/abstractions.js";
|
|
4
|
+
import { EditorReviewSession } from "@webiny/app-workflows/review/editor/EditorReviewSession.js";
|
|
5
|
+
import { createFakePresenter } from "@webiny/app-workflows/review/testing/fakeTargetReviewPresenter.js";
|
|
6
|
+
import { CmsEntryReviewFeature } from "./feature.js";
|
|
7
|
+
function createContainer() {
|
|
8
|
+
const container = new Container();
|
|
9
|
+
const presenter = createFakePresenter();
|
|
10
|
+
container.registerInstance(TargetReviewPresenter, presenter);
|
|
11
|
+
CmsEntryReviewFeature.register(container);
|
|
12
|
+
return {
|
|
13
|
+
container,
|
|
14
|
+
presenter
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
describe("CmsEntryReviewFeature", ()=>{
|
|
18
|
+
it("builds the session from the shared presenter alone (R352)", ()=>{
|
|
19
|
+
const { container, presenter } = createContainer();
|
|
20
|
+
const { session } = CmsEntryReviewFeature.resolve(container);
|
|
21
|
+
expect(session.presenter).toBe(presenter);
|
|
22
|
+
expect(session).not.toHaveProperty("useCases");
|
|
23
|
+
});
|
|
24
|
+
it("registers a subclass of the shared session, not the shared class itself", ()=>{
|
|
25
|
+
const { container } = createContainer();
|
|
26
|
+
const { session } = CmsEntryReviewFeature.resolve(container);
|
|
27
|
+
expect(session).toBeInstanceOf(EditorReviewSession);
|
|
28
|
+
expect(session.constructor).not.toBe(EditorReviewSession);
|
|
29
|
+
});
|
|
30
|
+
it("keeps one session per container (one editor is open at a time)", ()=>{
|
|
31
|
+
const { container } = createContainer();
|
|
32
|
+
const first = CmsEntryReviewFeature.resolve(container).session;
|
|
33
|
+
const second = CmsEntryReviewFeature.resolve(container).session;
|
|
34
|
+
expect(first).toBe(second);
|
|
35
|
+
});
|
|
36
|
+
it("gives two containers two independent sessions", ()=>{
|
|
37
|
+
const one = createContainer();
|
|
38
|
+
const two = createContainer();
|
|
39
|
+
const first = CmsEntryReviewFeature.resolve(one.container).session;
|
|
40
|
+
const second = CmsEntryReviewFeature.resolve(two.container).session;
|
|
41
|
+
expect(first.presenter).toBe(one.presenter);
|
|
42
|
+
expect(second.presenter).toBe(two.presenter);
|
|
43
|
+
});
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
//# sourceMappingURL=feature.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"features/editorReview/feature.test.js","sources":["../../../src/features/editorReview/feature.test.ts"],"sourcesContent":["import { describe } from \"vitest\";\nimport { expect } from \"vitest\";\nimport { it } from \"vitest\";\nimport { Container } from \"@webiny/di\";\nimport { TargetReviewPresenter } from \"@webiny/app-workflows/review/presentation/targetReview/abstractions.js\";\nimport { EditorReviewSession } from \"@webiny/app-workflows/review/editor/EditorReviewSession.js\";\nimport { createFakePresenter } from \"@webiny/app-workflows/review/testing/fakeTargetReviewPresenter.js\";\nimport { CmsEntryReviewFeature } from \"~/features/editorReview/feature.js\";\n\nfunction createContainer() {\n const container = new Container();\n const presenter = createFakePresenter();\n container.registerInstance(TargetReviewPresenter, presenter);\n CmsEntryReviewFeature.register(container);\n\n return { container, presenter };\n}\n\ndescribe(\"CmsEntryReviewFeature\", () => {\n it(\"builds the session from the shared presenter alone (R352)\", () => {\n const { container, presenter } = createContainer();\n\n const { session } = CmsEntryReviewFeature.resolve(container);\n\n expect(session.presenter).toBe(presenter);\n expect(session).not.toHaveProperty(\"useCases\");\n });\n\n it(\"registers a subclass of the shared session, not the shared class itself\", () => {\n const { container } = createContainer();\n\n const { session } = CmsEntryReviewFeature.resolve(container);\n\n expect(session).toBeInstanceOf(EditorReviewSession);\n expect(session.constructor).not.toBe(EditorReviewSession);\n });\n\n it(\"keeps one session per container (one editor is open at a time)\", () => {\n const { container } = createContainer();\n\n const first = CmsEntryReviewFeature.resolve(container).session;\n const second = CmsEntryReviewFeature.resolve(container).session;\n\n expect(first).toBe(second);\n });\n\n it(\"gives two containers two independent sessions\", () => {\n const one = createContainer();\n const two = createContainer();\n\n const first = CmsEntryReviewFeature.resolve(one.container).session;\n const second = CmsEntryReviewFeature.resolve(two.container).session;\n\n expect(first.presenter).toBe(one.presenter);\n expect(second.presenter).toBe(two.presenter);\n });\n});\n"],"names":["createContainer","container","Container","presenter","createFakePresenter","TargetReviewPresenter","CmsEntryReviewFeature","describe","it","session","expect","EditorReviewSession","first","second","one","two"],"mappings":";;;;;;AASA,SAASA;IACL,MAAMC,YAAY,IAAIC;IACtB,MAAMC,YAAYC;IAClBH,UAAU,gBAAgB,CAACI,uBAAuBF;IAClDG,sBAAsB,QAAQ,CAACL;IAE/B,OAAO;QAAEA;QAAWE;IAAU;AAClC;AAEAI,SAAS,yBAAyB;IAC9BC,GAAG,6DAA6D;QAC5D,MAAM,EAAEP,SAAS,EAAEE,SAAS,EAAE,GAAGH;QAEjC,MAAM,EAAES,OAAO,EAAE,GAAGH,sBAAsB,OAAO,CAACL;QAElDS,OAAOD,QAAQ,SAAS,EAAE,IAAI,CAACN;QAC/BO,OAAOD,SAAS,GAAG,CAAC,cAAc,CAAC;IACvC;IAEAD,GAAG,2EAA2E;QAC1E,MAAM,EAAEP,SAAS,EAAE,GAAGD;QAEtB,MAAM,EAAES,OAAO,EAAE,GAAGH,sBAAsB,OAAO,CAACL;QAElDS,OAAOD,SAAS,cAAc,CAACE;QAC/BD,OAAOD,QAAQ,WAAW,EAAE,GAAG,CAAC,IAAI,CAACE;IACzC;IAEAH,GAAG,kEAAkE;QACjE,MAAM,EAAEP,SAAS,EAAE,GAAGD;QAEtB,MAAMY,QAAQN,sBAAsB,OAAO,CAACL,WAAW,OAAO;QAC9D,MAAMY,SAASP,sBAAsB,OAAO,CAACL,WAAW,OAAO;QAE/DS,OAAOE,OAAO,IAAI,CAACC;IACvB;IAEAL,GAAG,iDAAiD;QAChD,MAAMM,MAAMd;QACZ,MAAMe,MAAMf;QAEZ,MAAMY,QAAQN,sBAAsB,OAAO,CAACQ,IAAI,SAAS,EAAE,OAAO;QAClE,MAAMD,SAASP,sBAAsB,OAAO,CAACS,IAAI,SAAS,EAAE,OAAO;QAEnEL,OAAOE,MAAM,SAAS,EAAE,IAAI,CAACE,IAAI,SAAS;QAC1CJ,OAAOG,OAAO,SAAS,EAAE,IAAI,CAACE,IAAI,SAAS;IAC/C;AACJ"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { useFeature } from "@webiny/app";
|
|
2
|
+
import { CmsEntryReviewFeature } from "./feature.js";
|
|
3
|
+
function useCmsEntryReview() {
|
|
4
|
+
return useFeature(CmsEntryReviewFeature).session;
|
|
5
|
+
}
|
|
6
|
+
export { useCmsEntryReview };
|
|
7
|
+
|
|
8
|
+
//# sourceMappingURL=useCmsEntryReview.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"features/editorReview/useCmsEntryReview.js","sources":["../../../src/features/editorReview/useCmsEntryReview.ts"],"sourcesContent":["import { useFeature } from \"@webiny/app\";\nimport type { CmsEntryReview } from \"./abstractions.js\";\nimport { CmsEntryReviewFeature } from \"./feature.js\";\n\nexport function useCmsEntryReview(): CmsEntryReview.Interface {\n return useFeature(CmsEntryReviewFeature).session;\n}\n"],"names":["useCmsEntryReview","useFeature","CmsEntryReviewFeature"],"mappings":";;AAIO,SAASA;IACZ,OAAOC,WAAWC,uBAAuB,OAAO;AACpD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const CmsWorkflowsCacheFeature: import("@webiny/feature/admin").FeatureDefinition<any, []>;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { createFeature } from "@webiny/feature/admin";
|
|
2
|
+
import { CmsReviewCacheSyncHandler } from "./cache/CmsReviewCacheSyncHandler.js";
|
|
3
|
+
import { CmsReviewCacheWriter } from "./cache/CmsReviewCacheWriter.js";
|
|
4
|
+
import { CmsReviewEntriesCacheProviderDecorator } from "./cache/CmsReviewEntriesCacheProviderDecorator.js";
|
|
5
|
+
const CmsWorkflowsCacheFeature = createFeature({
|
|
6
|
+
name: "CmsWorkflows/Cache",
|
|
7
|
+
register (container) {
|
|
8
|
+
container.register(CmsReviewCacheWriter);
|
|
9
|
+
container.register(CmsReviewCacheSyncHandler);
|
|
10
|
+
container.registerDecorator(CmsReviewEntriesCacheProviderDecorator);
|
|
11
|
+
}
|
|
12
|
+
});
|
|
13
|
+
export { CmsWorkflowsCacheFeature };
|
|
14
|
+
|
|
15
|
+
//# sourceMappingURL=feature.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"features/feature.js","sources":["../../src/features/feature.ts"],"sourcesContent":["import { createFeature } from \"@webiny/feature/admin\";\nimport { CmsReviewCacheSyncHandler } from \"./cache/CmsReviewCacheSyncHandler.js\";\nimport { CmsReviewCacheWriter } from \"./cache/CmsReviewCacheWriter.js\";\nimport { CmsReviewEntriesCacheProviderDecorator } from \"./cache/CmsReviewEntriesCacheProviderDecorator.js\";\n\nexport const CmsWorkflowsCacheFeature = createFeature({\n name: \"CmsWorkflows/Cache\",\n register(container) {\n container.register(CmsReviewCacheWriter);\n container.register(CmsReviewCacheSyncHandler);\n container.registerDecorator(CmsReviewEntriesCacheProviderDecorator);\n }\n});\n"],"names":["CmsWorkflowsCacheFeature","createFeature","container","CmsReviewCacheWriter","CmsReviewCacheSyncHandler","CmsReviewEntriesCacheProviderDecorator"],"mappings":";;;;AAKO,MAAMA,2BAA2BC,cAAc;IAClD,MAAM;IACN,UAASC,SAAS;QACdA,UAAU,QAAQ,CAACC;QACnBD,UAAU,QAAQ,CAACE;QACnBF,UAAU,iBAAiB,CAACG;IAChC;AACJ"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { WebsocketEventHandler } from "@webiny/app-websockets/events/abstractions.js";
|
|
2
|
+
import { ReviewChangeMessageHandler } from "@webiny/app-workflows/review/mounting/ReviewChangeMessageHandler.js";
|
|
3
|
+
declare class CmsReviewChangeMessageHandlerImpl extends ReviewChangeMessageHandler implements WebsocketEventHandler.Interface {
|
|
4
|
+
}
|
|
5
|
+
export declare const CmsReviewChangeMessageHandler: typeof CmsReviewChangeMessageHandlerImpl & {
|
|
6
|
+
__abstraction: import("@webiny/di").Abstraction<import("@webiny/app/features/eventPublisher/abstractions.js").IEventHandler<import("@webiny/app-websockets/events/WebsocketEvent.js").WebsocketEvent>>;
|
|
7
|
+
};
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { WebsocketEventHandler } from "@webiny/app-websockets/events/abstractions.js";
|
|
2
|
+
import { ReviewActivity } from "@webiny/app-workflows/review/activity/abstractions.js";
|
|
3
|
+
import { ReviewChangeMessageHandler } from "@webiny/app-workflows/review/mounting/ReviewChangeMessageHandler.js";
|
|
4
|
+
import { CmsReviewContentAdapter } from "./CmsReviewContentAdapter/abstractions.js";
|
|
5
|
+
class CmsReviewChangeMessageHandlerImpl extends ReviewChangeMessageHandler {
|
|
6
|
+
}
|
|
7
|
+
const CmsReviewChangeMessageHandler = WebsocketEventHandler.createImplementation({
|
|
8
|
+
implementation: CmsReviewChangeMessageHandlerImpl,
|
|
9
|
+
dependencies: [
|
|
10
|
+
ReviewActivity,
|
|
11
|
+
CmsReviewContentAdapter
|
|
12
|
+
]
|
|
13
|
+
});
|
|
14
|
+
export { CmsReviewChangeMessageHandler };
|
|
15
|
+
|
|
16
|
+
//# sourceMappingURL=CmsReviewChangeMessageHandler.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"features/gateway/CmsReviewChangeMessageHandler.js","sources":["../../../src/features/gateway/CmsReviewChangeMessageHandler.ts"],"sourcesContent":["import { WebsocketEventHandler } from \"@webiny/app-websockets/events/abstractions.js\";\nimport { ReviewActivity } from \"@webiny/app-workflows/review/activity/abstractions.js\";\nimport { ReviewChangeMessageHandler } from \"@webiny/app-workflows/review/mounting/ReviewChangeMessageHandler.js\";\nimport { CmsReviewContentAdapter } from \"./CmsReviewContentAdapter/abstractions.js\";\n\n// A subclass of its own (see CmsReviewNotificationHandlerImpl): the Website Builder binds its own.\nclass CmsReviewChangeMessageHandlerImpl\n extends ReviewChangeMessageHandler\n implements WebsocketEventHandler.Interface {}\n\nexport const CmsReviewChangeMessageHandler = WebsocketEventHandler.createImplementation({\n implementation: CmsReviewChangeMessageHandlerImpl,\n dependencies: [ReviewActivity, CmsReviewContentAdapter]\n});\n"],"names":["CmsReviewChangeMessageHandlerImpl","ReviewChangeMessageHandler","CmsReviewChangeMessageHandler","WebsocketEventHandler","ReviewActivity","CmsReviewContentAdapter"],"mappings":";;;;AAMA,MAAMA,0CACMC;AACoC;AAEzC,MAAMC,gCAAgCC,sBAAsB,oBAAoB,CAAC;IACpF,gBAAgBH;IAChB,cAAc;QAACI;QAAgBC;KAAwB;AAC3D"}
|