@webiny/app-file-manager 0.0.0-mt-3 → 0.0.0-unstable.06b2ede40f
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/BatchFileUploader.d.ts +34 -0
- package/BatchFileUploader.js +87 -0
- package/BatchFileUploader.js.map +1 -0
- package/app.d.ts +2 -0
- package/app.js +11 -0
- package/app.js.map +1 -0
- package/components/BottomInfoBar/BottomInfoBar.d.ts +6 -0
- package/components/BottomInfoBar/BottomInfoBar.js +23 -0
- package/components/BottomInfoBar/BottomInfoBar.js.map +1 -0
- package/components/BottomInfoBar/ListStatus.d.ts +6 -0
- package/components/BottomInfoBar/ListStatus.js +23 -0
- package/components/BottomInfoBar/ListStatus.js.map +1 -0
- package/components/BottomInfoBar/SupportedFileTypes.d.ts +9 -0
- package/components/BottomInfoBar/SupportedFileTypes.js +60 -0
- package/components/BottomInfoBar/SupportedFileTypes.js.map +1 -0
- package/components/BottomInfoBar/index.d.ts +1 -0
- package/components/BottomInfoBar/index.js +3 -0
- package/components/BottomInfoBar/index.js.map +1 -0
- package/components/BulkActions/ActionDelete.d.ts +4 -0
- package/components/BulkActions/ActionDelete.js +80 -0
- package/components/BulkActions/ActionDelete.js.map +1 -0
- package/components/BulkActions/ActionEdit/ActionEdit.d.ts +4 -0
- package/components/BulkActions/ActionEdit/ActionEdit.js +62 -0
- package/components/BulkActions/ActionEdit/ActionEdit.js.map +1 -0
- package/components/BulkActions/ActionEdit/ActionEdit.types.d.ts +2 -0
- package/components/BulkActions/ActionEdit/ActionEdit.types.js +3 -0
- package/components/BulkActions/ActionEdit/ActionEdit.types.js.map +1 -0
- package/components/BulkActions/ActionEdit/ActionEditPresenter.d.ts +35 -0
- package/components/BulkActions/ActionEdit/ActionEditPresenter.js +55 -0
- package/components/BulkActions/ActionEdit/ActionEditPresenter.js.map +1 -0
- package/components/BulkActions/ActionEdit/ActionEditPresenter.test.d.ts +1 -0
- package/components/BulkActions/ActionEdit/ActionEditPresenter.test.js +158 -0
- package/components/BulkActions/ActionEdit/ActionEditPresenter.test.js.map +1 -0
- package/components/BulkActions/ActionEdit/BatchEditorDialog/AddOperation.d.ts +7 -0
- package/components/BulkActions/ActionEdit/BatchEditorDialog/AddOperation.js +19 -0
- package/components/BulkActions/ActionEdit/BatchEditorDialog/AddOperation.js.map +1 -0
- package/components/BulkActions/ActionEdit/BatchEditorDialog/BatchEditor.d.ts +15 -0
- package/components/BulkActions/ActionEdit/BatchEditorDialog/BatchEditor.js +45 -0
- package/components/BulkActions/ActionEdit/BatchEditorDialog/BatchEditor.js.map +1 -0
- package/components/BulkActions/ActionEdit/BatchEditorDialog/BatchEditorDialog.d.ts +15 -0
- package/components/BulkActions/ActionEdit/BatchEditorDialog/BatchEditorDialog.js +52 -0
- package/components/BulkActions/ActionEdit/BatchEditorDialog/BatchEditorDialog.js.map +1 -0
- package/components/BulkActions/ActionEdit/BatchEditorDialog/BatchEditorDialogPresenter.d.ts +61 -0
- package/components/BulkActions/ActionEdit/BatchEditorDialog/BatchEditorDialogPresenter.js +140 -0
- package/components/BulkActions/ActionEdit/BatchEditorDialog/BatchEditorDialogPresenter.js.map +1 -0
- package/components/BulkActions/ActionEdit/BatchEditorDialog/BatchEditorDialogPresenter.test.d.ts +1 -0
- package/components/BulkActions/ActionEdit/BatchEditorDialog/BatchEditorDialogPresenter.test.js +336 -0
- package/components/BulkActions/ActionEdit/BatchEditorDialog/BatchEditorDialogPresenter.test.js.map +1 -0
- package/components/BulkActions/ActionEdit/BatchEditorDialog/FieldRenderer.d.ts +8 -0
- package/components/BulkActions/ActionEdit/BatchEditorDialog/FieldRenderer.js +33 -0
- package/components/BulkActions/ActionEdit/BatchEditorDialog/FieldRenderer.js.map +1 -0
- package/components/BulkActions/ActionEdit/BatchEditorDialog/Operation.d.ts +11 -0
- package/components/BulkActions/ActionEdit/BatchEditorDialog/Operation.js +41 -0
- package/components/BulkActions/ActionEdit/BatchEditorDialog/Operation.js.map +1 -0
- package/components/BulkActions/ActionEdit/BatchEditorDialog/index.d.ts +1 -0
- package/components/BulkActions/ActionEdit/BatchEditorDialog/index.js +3 -0
- package/components/BulkActions/ActionEdit/BatchEditorDialog/index.js.map +1 -0
- package/components/BulkActions/ActionEdit/GraphQLInputMapper.d.ts +41 -0
- package/components/BulkActions/ActionEdit/GraphQLInputMapper.js +44 -0
- package/components/BulkActions/ActionEdit/GraphQLInputMapper.js.map +1 -0
- package/components/BulkActions/ActionEdit/GraphQLInputMapper.test.d.ts +1 -0
- package/components/BulkActions/ActionEdit/GraphQLInputMapper.test.js +270 -0
- package/components/BulkActions/ActionEdit/GraphQLInputMapper.test.js.map +1 -0
- package/components/BulkActions/ActionEdit/domain/Batch.d.ts +53 -0
- package/components/BulkActions/ActionEdit/domain/Batch.js +29 -0
- package/components/BulkActions/ActionEdit/domain/Batch.js.map +1 -0
- package/components/BulkActions/ActionEdit/domain/BatchMapper.d.ts +4 -0
- package/components/BulkActions/ActionEdit/domain/BatchMapper.js +13 -0
- package/components/BulkActions/ActionEdit/domain/BatchMapper.js.map +1 -0
- package/components/BulkActions/ActionEdit/domain/Field.d.ts +32 -0
- package/components/BulkActions/ActionEdit/domain/Field.js +47 -0
- package/components/BulkActions/ActionEdit/domain/Field.js.map +1 -0
- package/components/BulkActions/ActionEdit/domain/FieldMapper.d.ts +7 -0
- package/components/BulkActions/ActionEdit/domain/FieldMapper.js +22 -0
- package/components/BulkActions/ActionEdit/domain/FieldMapper.js.map +1 -0
- package/components/BulkActions/ActionEdit/domain/index.d.ts +4 -0
- package/components/BulkActions/ActionEdit/domain/index.js +6 -0
- package/components/BulkActions/ActionEdit/domain/index.js.map +1 -0
- package/components/BulkActions/ActionEdit/index.d.ts +1 -0
- package/components/BulkActions/ActionEdit/index.js +3 -0
- package/components/BulkActions/ActionEdit/index.js.map +1 -0
- package/components/BulkActions/ActionEdit/useActionEditWorker.d.ts +7 -0
- package/components/BulkActions/ActionEdit/useActionEditWorker.js +73 -0
- package/components/BulkActions/ActionEdit/useActionEditWorker.js.map +1 -0
- package/components/BulkActions/ActionMove.d.ts +4 -0
- package/components/BulkActions/ActionMove.js +91 -0
- package/components/BulkActions/ActionMove.js.map +1 -0
- package/components/BulkActions/BulkActions.d.ts +3 -0
- package/components/BulkActions/BulkActions.js +46 -0
- package/components/BulkActions/BulkActions.js.map +1 -0
- package/components/BulkActions/index.d.ts +4 -0
- package/components/BulkActions/index.js +6 -0
- package/components/BulkActions/index.js.map +1 -0
- package/components/EditFileUsingUrl/EditFileUsingUrl.d.ts +14 -0
- package/components/EditFileUsingUrl/EditFileUsingUrl.js +53 -0
- package/components/EditFileUsingUrl/EditFileUsingUrl.js.map +1 -0
- package/components/EditFileUsingUrl/EditFileUsingUrlPresenter.d.ts +18 -0
- package/components/EditFileUsingUrl/EditFileUsingUrlPresenter.js +43 -0
- package/components/EditFileUsingUrl/EditFileUsingUrlPresenter.js.map +1 -0
- package/components/EditFileUsingUrl/EditFileUsingUrlRepository.d.ts +17 -0
- package/components/EditFileUsingUrl/EditFileUsingUrlRepository.js +39 -0
- package/components/EditFileUsingUrl/EditFileUsingUrlRepository.js.map +1 -0
- package/components/EditFileUsingUrl/GetFileByUrl.d.ts +10 -0
- package/components/EditFileUsingUrl/GetFileByUrl.js +27 -0
- package/components/EditFileUsingUrl/GetFileByUrl.js.map +1 -0
- package/components/EditFileUsingUrl/Loading.d.ts +18 -0
- package/components/EditFileUsingUrl/Loading.js +42 -0
- package/components/EditFileUsingUrl/Loading.js.map +1 -0
- package/components/EditFileUsingUrl/UpdateFile.d.ts +10 -0
- package/components/EditFileUsingUrl/UpdateFile.js +10 -0
- package/components/EditFileUsingUrl/UpdateFile.js.map +1 -0
- package/components/EditFileUsingUrl/getFileByUrl.graphql.d.ts +2 -0
- package/components/EditFileUsingUrl/getFileByUrl.graphql.js +19 -0
- package/components/EditFileUsingUrl/getFileByUrl.graphql.js.map +1 -0
- package/components/EditFileUsingUrl/index.d.ts +1 -0
- package/components/EditFileUsingUrl/index.js +3 -0
- package/components/EditFileUsingUrl/index.js.map +1 -0
- package/components/Empty/Empty.d.ts +8 -0
- package/components/Empty/Empty.js +27 -0
- package/components/Empty/Empty.js.map +1 -0
- package/components/Empty/index.d.ts +1 -0
- package/components/Empty/index.js +3 -0
- package/components/Empty/index.js.map +1 -0
- package/components/FileDetails/FileDetails.d.ts +11 -0
- package/components/FileDetails/FileDetails.js +155 -0
- package/components/FileDetails/FileDetails.js.map +1 -0
- package/components/FileDetails/FileDetailsProvider.d.ts +16 -0
- package/components/FileDetails/FileDetailsProvider.js +21 -0
- package/components/FileDetails/FileDetailsProvider.js.map +1 -0
- package/components/FileDetails/components/ActionButton.d.ts +10 -0
- package/components/FileDetails/components/ActionButton.js +23 -0
- package/components/FileDetails/components/ActionButton.js.map +1 -0
- package/components/FileDetails/components/Actions.d.ts +2 -0
- package/components/FileDetails/components/Actions.js +14 -0
- package/components/FileDetails/components/Actions.js.map +1 -0
- package/components/FileDetails/components/BaseFields.d.ts +7 -0
- package/components/FileDetails/components/BaseFields.js +29 -0
- package/components/FileDetails/components/BaseFields.js.map +1 -0
- package/components/FileDetails/components/Content.d.ts +14 -0
- package/components/FileDetails/components/Content.js +35 -0
- package/components/FileDetails/components/Content.js.map +1 -0
- package/components/FileDetails/components/CreatedOn.d.ts +2 -0
- package/components/FileDetails/components/CreatedOn.js +22 -0
- package/components/FileDetails/components/CreatedOn.js.map +1 -0
- package/components/FileDetails/components/Description.d.ts +2 -0
- package/components/FileDetails/components/Description.js +23 -0
- package/components/FileDetails/components/Description.js.map +1 -0
- package/components/FileDetails/components/Extensions.d.ts +7 -0
- package/components/FileDetails/components/Extensions.js +36 -0
- package/components/FileDetails/components/Extensions.js.map +1 -0
- package/components/FileDetails/components/Preview.d.ts +2 -0
- package/components/FileDetails/components/Preview.js +12 -0
- package/components/FileDetails/components/Preview.js.map +1 -0
- package/components/FileDetails/components/Thumbnail.d.ts +2 -0
- package/components/FileDetails/components/Thumbnail.js +16 -0
- package/components/FileDetails/components/Thumbnail.js.map +1 -0
- package/components/FileDetails/index.d.ts +1 -0
- package/components/FileDetails/index.js +3 -0
- package/components/FileDetails/index.js.map +1 -0
- package/components/FileDropArea/FileDropArea.d.ts +9 -0
- package/components/FileDropArea/FileDropArea.js +69 -0
- package/components/FileDropArea/FileDropArea.js.map +1 -0
- package/components/FileDropArea/index.d.ts +1 -0
- package/components/FileDropArea/index.js +3 -0
- package/components/FileDropArea/index.js.map +1 -0
- package/components/FileDropPlaceholder/FileDropPlaceholder.d.ts +2 -0
- package/components/FileDropPlaceholder/FileDropPlaceholder.js +12 -0
- package/components/FileDropPlaceholder/FileDropPlaceholder.js.map +1 -0
- package/components/FileDropPlaceholder/index.d.ts +1 -0
- package/components/FileDropPlaceholder/index.js +3 -0
- package/components/FileDropPlaceholder/index.js.map +1 -0
- package/components/Filters/Filters.d.ts +2 -0
- package/components/Filters/Filters.js +26 -0
- package/components/Filters/Filters.js.map +1 -0
- package/components/Filters/index.d.ts +1 -0
- package/components/Filters/index.js +3 -0
- package/components/Filters/index.js.map +1 -0
- package/components/Grid/ActionButton.d.ts +9 -0
- package/components/Grid/ActionButton.js +28 -0
- package/components/Grid/ActionButton.js.map +1 -0
- package/components/Grid/File.d.ts +32 -0
- package/components/Grid/File.js +89 -0
- package/components/Grid/File.js.map +1 -0
- package/components/Grid/Grid.d.ts +19 -0
- package/components/Grid/Grid.js +69 -0
- package/components/Grid/Grid.js.map +1 -0
- package/components/Grid/Thumbnail.d.ts +2 -0
- package/components/Grid/Thumbnail.js +16 -0
- package/components/Grid/Thumbnail.js.map +1 -0
- package/components/Grid/index.d.ts +1 -0
- package/components/Grid/index.js +3 -0
- package/components/Grid/index.js.map +1 -0
- package/components/Header/Actions.d.ts +5 -0
- package/components/Header/Actions.js +99 -0
- package/components/Header/Actions.js.map +1 -0
- package/components/Header/Header.d.ts +9 -0
- package/components/Header/Header.js +17 -0
- package/components/Header/Header.js.map +1 -0
- package/components/Header/Title.d.ts +2 -0
- package/components/Header/Title.js +62 -0
- package/components/Header/Title.js.map +1 -0
- package/components/Header/index.d.ts +1 -0
- package/components/Header/index.js +3 -0
- package/components/Header/index.js.map +1 -0
- package/components/ImageEditor/ImageEditor.d.ts +45 -0
- package/components/ImageEditor/ImageEditor.js +218 -0
- package/components/ImageEditor/ImageEditor.js.map +1 -0
- package/components/ImageEditor/ImageEditorDialog.d.ts +16 -0
- package/components/ImageEditor/ImageEditorDialog.js +53 -0
- package/components/ImageEditor/ImageEditorDialog.js.map +1 -0
- package/components/ImageEditor/index.d.ts +1 -0
- package/components/ImageEditor/index.js +3 -0
- package/components/ImageEditor/index.js.map +1 -0
- package/components/ImageEditor/toolbar/crop.d.ts +4 -0
- package/components/ImageEditor/toolbar/crop.js +67 -0
- package/components/ImageEditor/toolbar/crop.js.map +1 -0
- package/components/ImageEditor/toolbar/filter.d.ts +3 -0
- package/components/ImageEditor/toolbar/filter.js +167 -0
- package/components/ImageEditor/toolbar/filter.js.map +1 -0
- package/components/ImageEditor/toolbar/flip.d.ts +4 -0
- package/components/ImageEditor/toolbar/flip.js +94 -0
- package/components/ImageEditor/toolbar/flip.js.map +1 -0
- package/components/ImageEditor/toolbar/index.d.ts +4 -0
- package/components/ImageEditor/toolbar/index.js +6 -0
- package/components/ImageEditor/toolbar/index.js.map +1 -0
- package/components/ImageEditor/toolbar/rotate.d.ts +4 -0
- package/components/ImageEditor/toolbar/rotate.js +93 -0
- package/components/ImageEditor/toolbar/rotate.js.map +1 -0
- package/components/ImageEditor/toolbar/types.d.ts +32 -0
- package/components/ImageEditor/toolbar/types.js +3 -0
- package/components/ImageEditor/toolbar/types.js.map +1 -0
- package/components/LayoutSwitch/LayoutSwitch.d.ts +2 -0
- package/components/LayoutSwitch/LayoutSwitch.js +22 -0
- package/components/LayoutSwitch/LayoutSwitch.js.map +1 -0
- package/components/LayoutSwitch/index.d.ts +1 -0
- package/components/LayoutSwitch/index.js +3 -0
- package/components/LayoutSwitch/index.js.map +1 -0
- package/components/NoPermissions/NoPermissions.d.ts +2 -0
- package/components/NoPermissions/NoPermissions.js +28 -0
- package/components/NoPermissions/NoPermissions.js.map +1 -0
- package/components/NoPermissions/index.d.ts +1 -0
- package/components/NoPermissions/index.js +3 -0
- package/components/NoPermissions/index.js.map +1 -0
- package/components/NoResults/NoResults.d.ts +2 -0
- package/components/NoResults/NoResults.js +22 -0
- package/components/NoResults/NoResults.js.map +1 -0
- package/components/NoResults/index.d.ts +1 -0
- package/components/NoResults/index.js +3 -0
- package/components/NoResults/index.js.map +1 -0
- package/components/SearchWidget/SearchWidget.d.ts +2 -0
- package/components/SearchWidget/SearchWidget.js +31 -0
- package/components/SearchWidget/SearchWidget.js.map +1 -0
- package/components/SearchWidget/index.d.ts +1 -0
- package/components/SearchWidget/index.js +3 -0
- package/components/SearchWidget/index.js.map +1 -0
- package/components/Table/Actions/CopyFile.d.ts +2 -0
- package/components/Table/Actions/CopyFile.js +26 -0
- package/components/Table/Actions/CopyFile.js.map +1 -0
- package/components/Table/Actions/DeleteFile.d.ts +2 -0
- package/components/Table/Actions/DeleteFile.js +33 -0
- package/components/Table/Actions/DeleteFile.js.map +1 -0
- package/components/Table/Actions/EditFile.d.ts +2 -0
- package/components/Table/Actions/EditFile.js +24 -0
- package/components/Table/Actions/EditFile.js.map +1 -0
- package/components/Table/Actions/MoveFile.d.ts +2 -0
- package/components/Table/Actions/MoveFile.js +22 -0
- package/components/Table/Actions/MoveFile.js.map +1 -0
- package/components/Table/Actions/index.d.ts +4 -0
- package/components/Table/Actions/index.js +6 -0
- package/components/Table/Actions/index.js.map +1 -0
- package/components/Table/Cells/CellActions.d.ts +2 -0
- package/components/Table/Cells/CellActions.js +38 -0
- package/components/Table/Cells/CellActions.js.map +1 -0
- package/components/Table/Cells/CellAuthor.d.ts +2 -0
- package/components/Table/Cells/CellAuthor.js +13 -0
- package/components/Table/Cells/CellAuthor.js.map +1 -0
- package/components/Table/Cells/CellCreated.d.ts +2 -0
- package/components/Table/Cells/CellCreated.js +16 -0
- package/components/Table/Cells/CellCreated.js.map +1 -0
- package/components/Table/Cells/CellModified.d.ts +2 -0
- package/components/Table/Cells/CellModified.js +16 -0
- package/components/Table/Cells/CellModified.js.map +1 -0
- package/components/Table/Cells/CellName.d.ts +16 -0
- package/components/Table/Cells/CellName.js +70 -0
- package/components/Table/Cells/CellName.js.map +1 -0
- package/components/Table/Cells/CellSize.d.ts +2 -0
- package/components/Table/Cells/CellSize.js +20 -0
- package/components/Table/Cells/CellSize.js.map +1 -0
- package/components/Table/Cells/CellThumbnail.d.ts +2 -0
- package/components/Table/Cells/CellThumbnail.js +16 -0
- package/components/Table/Cells/CellThumbnail.js.map +1 -0
- package/components/Table/Cells/CellType.d.ts +2 -0
- package/components/Table/Cells/CellType.js +17 -0
- package/components/Table/Cells/CellType.js.map +1 -0
- package/components/Table/Cells/index.d.ts +7 -0
- package/components/Table/Cells/index.js +9 -0
- package/components/Table/Cells/index.js.map +1 -0
- package/components/Table/Table.d.ts +10 -0
- package/components/Table/Table.js +30 -0
- package/components/Table/Table.js.map +1 -0
- package/components/Table/index.d.ts +3 -0
- package/components/Table/index.js +5 -0
- package/components/Table/index.js.map +1 -0
- package/components/TagsList/Empty.d.ts +6 -0
- package/components/TagsList/Empty.js +11 -0
- package/components/TagsList/Empty.js.map +1 -0
- package/components/TagsList/FilterSelect.d.ts +2 -0
- package/components/TagsList/FilterSelect.js +28 -0
- package/components/TagsList/FilterSelect.js.map +1 -0
- package/components/TagsList/FilterStatus.d.ts +7 -0
- package/components/TagsList/FilterStatus.js +27 -0
- package/components/TagsList/FilterStatus.js.map +1 -0
- package/components/TagsList/Tag.d.ts +9 -0
- package/components/TagsList/Tag.js +16 -0
- package/components/TagsList/Tag.js.map +1 -0
- package/components/TagsList/Tags.d.ts +8 -0
- package/components/TagsList/Tags.js +32 -0
- package/components/TagsList/Tags.js.map +1 -0
- package/components/TagsList/TagsList.d.ts +11 -0
- package/components/TagsList/TagsList.js +31 -0
- package/components/TagsList/TagsList.js.map +1 -0
- package/components/TagsList/index.d.ts +1 -0
- package/components/TagsList/index.js +3 -0
- package/components/TagsList/index.js.map +1 -0
- package/components/Thumbnail/Thumbnail.d.ts +2 -0
- package/components/Thumbnail/Thumbnail.js +16 -0
- package/components/Thumbnail/Thumbnail.js.map +1 -0
- package/components/Thumbnail/index.d.ts +1 -0
- package/components/Thumbnail/index.js +3 -0
- package/components/Thumbnail/index.js.map +1 -0
- package/components/UploadStatus/UploadStatus.d.ts +8 -0
- package/components/UploadStatus/UploadStatus.js +38 -0
- package/components/UploadStatus/UploadStatus.js.map +1 -0
- package/components/UploadStatus/index.d.ts +1 -0
- package/components/UploadStatus/index.js +3 -0
- package/components/UploadStatus/index.js.map +1 -0
- package/components/fields/AccessControl.d.ts +7 -0
- package/components/fields/AccessControl.js +49 -0
- package/components/fields/AccessControl.js.map +1 -0
- package/components/fields/Aliases.d.ts +2 -0
- package/components/fields/Aliases.js +85 -0
- package/components/fields/Aliases.js.map +1 -0
- package/components/fields/Name.d.ts +2 -0
- package/components/fields/Name.js +29 -0
- package/components/fields/Name.js.map +1 -0
- package/components/fields/Tags.d.ts +2 -0
- package/components/fields/Tags.js +39 -0
- package/components/fields/Tags.js.map +1 -0
- package/components/fields/index.d.ts +4 -0
- package/components/fields/index.js +6 -0
- package/components/fields/index.js.map +1 -0
- package/components/fields/useAccessControlField.d.ts +7 -0
- package/components/fields/useAccessControlField.js +26 -0
- package/components/fields/useAccessControlField.js.map +1 -0
- package/components/fields/useFileOrUndefined.d.ts +3 -0
- package/components/fields/useFileOrUndefined.js +12 -0
- package/components/fields/useFileOrUndefined.js.map +1 -0
- package/constants.d.ts +4 -0
- package/constants.js +6 -0
- package/constants.js.map +1 -0
- package/contexts/FileProvider.d.ts +13 -0
- package/contexts/FileProvider.js +22 -0
- package/contexts/FileProvider.js.map +1 -0
- package/hooks/useCopyFile.d.ts +11 -0
- package/hooks/useCopyFile.js +25 -0
- package/hooks/useCopyFile.js.map +1 -0
- package/hooks/useDeleteFile.d.ts +9 -0
- package/hooks/useDeleteFile.js +44 -0
- package/hooks/useDeleteFile.js.map +1 -0
- package/hooks/useFile.d.ts +2 -0
- package/hooks/useFile.js +11 -0
- package/hooks/useFile.js.map +1 -0
- package/hooks/useFileDetails.d.ts +2 -0
- package/hooks/useFileDetails.js +11 -0
- package/hooks/useFileDetails.js.map +1 -0
- package/hooks/useFileModel.d.ts +1 -0
- package/hooks/useFileModel.js +11 -0
- package/hooks/useFileModel.js.map +1 -0
- package/hooks/useMoveFileToFolder.d.ts +2 -0
- package/hooks/useMoveFileToFolder.js +32 -0
- package/hooks/useMoveFileToFolder.js.map +1 -0
- package/index.d.ts +8 -0
- package/index.js +10 -0
- package/index.js.map +1 -0
- package/modules/Enterprise/HandleWebsocketMessages.d.ts +1 -0
- package/modules/Enterprise/HandleWebsocketMessages.js +57 -0
- package/modules/Enterprise/HandleWebsocketMessages.js.map +1 -0
- package/modules/Enterprise/components/ThreatScanInProgressFileBody.d.ts +2 -0
- package/modules/Enterprise/components/ThreatScanInProgressFileBody.js +23 -0
- package/modules/Enterprise/components/ThreatScanInProgressFileBody.js.map +1 -0
- package/modules/Enterprise/components/ThreatScanInProgressTableCell.d.ts +6 -0
- package/modules/Enterprise/components/ThreatScanInProgressTableCell.js +32 -0
- package/modules/Enterprise/components/ThreatScanInProgressTableCell.js.map +1 -0
- package/modules/Enterprise/constants.d.ts +3 -0
- package/modules/Enterprise/constants.js +5 -0
- package/modules/Enterprise/constants.js.map +1 -0
- package/modules/Enterprise/index.d.ts +2 -0
- package/modules/Enterprise/index.js +40 -0
- package/modules/Enterprise/index.js.map +1 -0
- package/modules/FileManagerApiProvider/FileManagerApiContext/FileManagerApiContext.d.ts +44 -0
- package/modules/FileManagerApiProvider/FileManagerApiContext/FileManagerApiContext.js +210 -0
- package/modules/FileManagerApiProvider/FileManagerApiContext/FileManagerApiContext.js.map +1 -0
- package/modules/FileManagerApiProvider/FileManagerApiContext/FileModelContext.d.ts +6 -0
- package/modules/FileManagerApiProvider/FileManagerApiContext/FileModelContext.js +25 -0
- package/modules/FileManagerApiProvider/FileManagerApiContext/FileModelContext.js.map +1 -0
- package/modules/FileManagerApiProvider/FileManagerApiContext/getFileGraphQLSelection.d.ts +2 -0
- package/modules/FileManagerApiProvider/FileManagerApiContext/getFileGraphQLSelection.js +30 -0
- package/modules/FileManagerApiProvider/FileManagerApiContext/getFileGraphQLSelection.js.map +1 -0
- package/modules/FileManagerApiProvider/FileManagerApiContext/getFileUploader.d.ts +2 -0
- package/modules/FileManagerApiProvider/FileManagerApiContext/getFileUploader.js +10 -0
- package/modules/FileManagerApiProvider/FileManagerApiContext/getFileUploader.js.map +1 -0
- package/modules/FileManagerApiProvider/FileManagerApiContext/index.d.ts +3 -0
- package/modules/FileManagerApiProvider/FileManagerApiContext/index.js +5 -0
- package/modules/FileManagerApiProvider/FileManagerApiContext/index.js.map +1 -0
- package/modules/FileManagerApiProvider/FileManagerApiContext/useFileManagerApi.d.ts +3 -0
- package/modules/FileManagerApiProvider/FileManagerApiContext/useFileManagerApi.js +11 -0
- package/modules/FileManagerApiProvider/FileManagerApiContext/useFileManagerApi.js.map +1 -0
- package/modules/FileManagerApiProvider/graphql.d.ts +125 -0
- package/modules/FileManagerApiProvider/graphql.js +118 -0
- package/modules/FileManagerApiProvider/graphql.js.map +1 -0
- package/modules/FileManagerApiProvider/index.d.ts +2 -0
- package/modules/FileManagerApiProvider/index.js +18 -0
- package/modules/FileManagerApiProvider/index.js.map +1 -0
- package/modules/FileManagerRenderer/FileActions/FileDetails/CopyUrl.d.ts +2 -0
- package/modules/FileManagerRenderer/FileActions/FileDetails/CopyUrl.js +24 -0
- package/modules/FileManagerRenderer/FileActions/FileDetails/CopyUrl.js.map +1 -0
- package/modules/FileManagerRenderer/FileActions/FileDetails/DeleteImage.d.ts +2 -0
- package/modules/FileManagerRenderer/FileActions/FileDetails/DeleteImage.js +35 -0
- package/modules/FileManagerRenderer/FileActions/FileDetails/DeleteImage.js.map +1 -0
- package/modules/FileManagerRenderer/FileActions/FileDetails/Download.d.ts +2 -0
- package/modules/FileManagerRenderer/FileActions/FileDetails/Download.js +24 -0
- package/modules/FileManagerRenderer/FileActions/FileDetails/Download.js.map +1 -0
- package/modules/FileManagerRenderer/FileActions/FileDetails/EditImage.d.ts +2 -0
- package/modules/FileManagerRenderer/FileActions/FileDetails/EditImage.js +111 -0
- package/modules/FileManagerRenderer/FileActions/FileDetails/EditImage.js.map +1 -0
- package/modules/FileManagerRenderer/FileActions/FileDetails/MoveToFolder.d.ts +2 -0
- package/modules/FileManagerRenderer/FileActions/FileDetails/MoveToFolder.js +19 -0
- package/modules/FileManagerRenderer/FileActions/FileDetails/MoveToFolder.js.map +1 -0
- package/modules/FileManagerRenderer/FileActions/Grid/Delete.d.ts +2 -0
- package/modules/FileManagerRenderer/FileActions/Grid/Delete.js +29 -0
- package/modules/FileManagerRenderer/FileActions/Grid/Delete.js.map +1 -0
- package/modules/FileManagerRenderer/FileActions/Grid/Download.d.ts +2 -0
- package/modules/FileManagerRenderer/FileActions/Grid/Download.js +24 -0
- package/modules/FileManagerRenderer/FileActions/Grid/Download.js.map +1 -0
- package/modules/FileManagerRenderer/FileActions/Grid/MoveToFolder.d.ts +2 -0
- package/modules/FileManagerRenderer/FileActions/Grid/MoveToFolder.js +19 -0
- package/modules/FileManagerRenderer/FileActions/Grid/MoveToFolder.js.map +1 -0
- package/modules/FileManagerRenderer/FileActions/Grid/Settings.d.ts +2 -0
- package/modules/FileManagerRenderer/FileActions/Grid/Settings.js +23 -0
- package/modules/FileManagerRenderer/FileActions/Grid/Settings.js.map +1 -0
- package/modules/FileManagerRenderer/FileActions/index.d.ts +2 -0
- package/modules/FileManagerRenderer/FileActions/index.js +47 -0
- package/modules/FileManagerRenderer/FileActions/index.js.map +1 -0
- package/modules/FileManagerRenderer/FileManagerView/FileManagerView.d.ts +5 -0
- package/modules/FileManagerRenderer/FileManagerView/FileManagerView.js +301 -0
- package/modules/FileManagerRenderer/FileManagerView/FileManagerView.js.map +1 -0
- package/modules/FileManagerRenderer/FileManagerView/FileManagerViewConfig.d.ts +281 -0
- package/modules/FileManagerRenderer/FileManagerView/FileManagerViewConfig.js +54 -0
- package/modules/FileManagerRenderer/FileManagerView/FileManagerViewConfig.js.map +1 -0
- package/modules/FileManagerRenderer/FileManagerView/LeftSidebar.d.ts +8 -0
- package/modules/FileManagerRenderer/FileManagerView/LeftSidebar.js +37 -0
- package/modules/FileManagerRenderer/FileManagerView/LeftSidebar.js.map +1 -0
- package/modules/FileManagerRenderer/FileManagerView/NavigateFolderProvider.d.ts +4 -0
- package/modules/FileManagerRenderer/FileManagerView/NavigateFolderProvider.js +26 -0
- package/modules/FileManagerRenderer/FileManagerView/NavigateFolderProvider.js.map +1 -0
- package/modules/FileManagerRenderer/FileManagerView/configComponents/Browser/BulkAction.d.ts +26 -0
- package/modules/FileManagerRenderer/FileManagerView/configComponents/Browser/BulkAction.js +66 -0
- package/modules/FileManagerRenderer/FileManagerView/configComponents/Browser/BulkAction.js.map +1 -0
- package/modules/FileManagerRenderer/FileManagerView/configComponents/Browser/BulkEditField.d.ts +10 -0
- package/modules/FileManagerRenderer/FileManagerView/configComponents/Browser/BulkEditField.js +26 -0
- package/modules/FileManagerRenderer/FileManagerView/configComponents/Browser/BulkEditField.js.map +1 -0
- package/modules/FileManagerRenderer/FileManagerView/configComponents/Browser/FileAction.d.ts +8 -0
- package/modules/FileManagerRenderer/FileManagerView/configComponents/Browser/FileAction.js +14 -0
- package/modules/FileManagerRenderer/FileManagerView/configComponents/Browser/FileAction.js.map +1 -0
- package/modules/FileManagerRenderer/FileManagerView/configComponents/Browser/Filter.d.ts +39 -0
- package/modules/FileManagerRenderer/FileManagerView/configComponents/Browser/Filter.js +44 -0
- package/modules/FileManagerRenderer/FileManagerView/configComponents/Browser/Filter.js.map +1 -0
- package/modules/FileManagerRenderer/FileManagerView/configComponents/Browser/FilterByTags.d.ts +5 -0
- package/modules/FileManagerRenderer/FileManagerView/configComponents/Browser/FilterByTags.js +17 -0
- package/modules/FileManagerRenderer/FileManagerView/configComponents/Browser/FilterByTags.js.map +1 -0
- package/modules/FileManagerRenderer/FileManagerView/configComponents/Browser/FiltersToWhere.d.ts +7 -0
- package/modules/FileManagerRenderer/FileManagerView/configComponents/Browser/FiltersToWhere.js +16 -0
- package/modules/FileManagerRenderer/FileManagerView/configComponents/Browser/FiltersToWhere.js.map +1 -0
- package/modules/FileManagerRenderer/FileManagerView/configComponents/Browser/FolderAction.d.ts +7 -0
- package/modules/FileManagerRenderer/FileManagerView/configComponents/Browser/FolderAction.js +13 -0
- package/modules/FileManagerRenderer/FileManagerView/configComponents/Browser/FolderAction.js.map +1 -0
- package/modules/FileManagerRenderer/FileManagerView/configComponents/Browser/FolderFieldDecorator.d.ts +7 -0
- package/modules/FileManagerRenderer/FileManagerView/configComponents/Browser/FolderFieldDecorator.js +16 -0
- package/modules/FileManagerRenderer/FileManagerView/configComponents/Browser/FolderFieldDecorator.js.map +1 -0
- package/modules/FileManagerRenderer/FileManagerView/configComponents/Browser/Grid/Action.d.ts +31 -0
- package/modules/FileManagerRenderer/FileManagerView/configComponents/Browser/Grid/Action.js +38 -0
- package/modules/FileManagerRenderer/FileManagerView/configComponents/Browser/Grid/Action.js.map +1 -0
- package/modules/FileManagerRenderer/FileManagerView/configComponents/Browser/Grid/Thumbnail.d.ts +28 -0
- package/modules/FileManagerRenderer/FileManagerView/configComponents/Browser/Grid/Thumbnail.js +30 -0
- package/modules/FileManagerRenderer/FileManagerView/configComponents/Browser/Grid/Thumbnail.js.map +1 -0
- package/modules/FileManagerRenderer/FileManagerView/configComponents/Browser/Grid/index.d.ts +6 -0
- package/modules/FileManagerRenderer/FileManagerView/configComponents/Browser/Grid/index.js +3 -0
- package/modules/FileManagerRenderer/FileManagerView/configComponents/Browser/Grid/index.js.map +1 -0
- package/modules/FileManagerRenderer/FileManagerView/configComponents/Browser/Table/Column.d.ts +32 -0
- package/modules/FileManagerRenderer/FileManagerView/configComponents/Browser/Table/Column.js +16 -0
- package/modules/FileManagerRenderer/FileManagerView/configComponents/Browser/Table/Column.js.map +1 -0
- package/modules/FileManagerRenderer/FileManagerView/configComponents/Browser/Table/Thumbnail.d.ts +28 -0
- package/modules/FileManagerRenderer/FileManagerView/configComponents/Browser/Table/Thumbnail.js +30 -0
- package/modules/FileManagerRenderer/FileManagerView/configComponents/Browser/Table/Thumbnail.js.map +1 -0
- package/modules/FileManagerRenderer/FileManagerView/configComponents/Browser/Table/index.d.ts +57 -0
- package/modules/FileManagerRenderer/FileManagerView/configComponents/Browser/Table/index.js +10 -0
- package/modules/FileManagerRenderer/FileManagerView/configComponents/Browser/Table/index.js.map +1 -0
- package/modules/FileManagerRenderer/FileManagerView/configComponents/Browser/index.d.ts +196 -0
- package/modules/FileManagerRenderer/FileManagerView/configComponents/Browser/index.js +47 -0
- package/modules/FileManagerRenderer/FileManagerView/configComponents/Browser/index.js.map +1 -0
- package/modules/FileManagerRenderer/FileManagerView/configComponents/FileDetails/Action.d.ts +31 -0
- package/modules/FileManagerRenderer/FileManagerView/configComponents/FileDetails/Action.js +35 -0
- package/modules/FileManagerRenderer/FileManagerView/configComponents/FileDetails/Action.js.map +1 -0
- package/modules/FileManagerRenderer/FileManagerView/configComponents/FileDetails/Field.d.ts +39 -0
- package/modules/FileManagerRenderer/FileManagerView/configComponents/FileDetails/Field.js +44 -0
- package/modules/FileManagerRenderer/FileManagerView/configComponents/FileDetails/Field.js.map +1 -0
- package/modules/FileManagerRenderer/FileManagerView/configComponents/FileDetails/FieldDecorator.d.ts +8 -0
- package/modules/FileManagerRenderer/FileManagerView/configComponents/FileDetails/FieldDecorator.js +25 -0
- package/modules/FileManagerRenderer/FileManagerView/configComponents/FileDetails/FieldDecorator.js.map +1 -0
- package/modules/FileManagerRenderer/FileManagerView/configComponents/FileDetails/GroupFields.d.ts +5 -0
- package/modules/FileManagerRenderer/FileManagerView/configComponents/FileDetails/GroupFields.js +16 -0
- package/modules/FileManagerRenderer/FileManagerView/configComponents/FileDetails/GroupFields.js.map +1 -0
- package/modules/FileManagerRenderer/FileManagerView/configComponents/FileDetails/Thumbnail.d.ts +28 -0
- package/modules/FileManagerRenderer/FileManagerView/configComponents/FileDetails/Thumbnail.js +27 -0
- package/modules/FileManagerRenderer/FileManagerView/configComponents/FileDetails/Thumbnail.js.map +1 -0
- package/modules/FileManagerRenderer/FileManagerView/configComponents/FileDetails/Width.d.ts +5 -0
- package/modules/FileManagerRenderer/FileManagerView/configComponents/FileDetails/Width.js +16 -0
- package/modules/FileManagerRenderer/FileManagerView/configComponents/FileDetails/Width.js.map +1 -0
- package/modules/FileManagerRenderer/FileManagerView/configComponents/FileDetails/index.d.ts +87 -0
- package/modules/FileManagerRenderer/FileManagerView/configComponents/FileDetails/index.js +23 -0
- package/modules/FileManagerRenderer/FileManagerView/configComponents/FileDetails/index.js.map +1 -0
- package/modules/FileManagerRenderer/FileManagerView/getThumbnailRenderer.d.ts +4 -0
- package/modules/FileManagerRenderer/FileManagerView/getThumbnailRenderer.js +21 -0
- package/modules/FileManagerRenderer/FileManagerView/getThumbnailRenderer.js.map +1 -0
- package/modules/FileManagerRenderer/FileManagerView/index.d.ts +13 -0
- package/modules/FileManagerRenderer/FileManagerView/index.js +88 -0
- package/modules/FileManagerRenderer/FileManagerView/index.js.map +1 -0
- package/modules/FileManagerRenderer/FileManagerView/outputFileSelectionError.d.ts +2 -0
- package/modules/FileManagerRenderer/FileManagerView/outputFileSelectionError.js +30 -0
- package/modules/FileManagerRenderer/FileManagerView/outputFileSelectionError.js.map +1 -0
- package/modules/FileManagerRenderer/FileManagerViewProvider/FileManagerViewContext.d.ts +86 -0
- package/modules/FileManagerRenderer/FileManagerViewProvider/FileManagerViewContext.js +458 -0
- package/modules/FileManagerRenderer/FileManagerViewProvider/FileManagerViewContext.js.map +1 -0
- package/modules/FileManagerRenderer/FileManagerViewProvider/index.d.ts +2 -0
- package/modules/FileManagerRenderer/FileManagerViewProvider/index.js +4 -0
- package/modules/FileManagerRenderer/FileManagerViewProvider/index.js.map +1 -0
- package/modules/FileManagerRenderer/FileManagerViewProvider/setSelection.d.ts +31 -0
- package/modules/FileManagerRenderer/FileManagerViewProvider/setSelection.js +100 -0
- package/modules/FileManagerRenderer/FileManagerViewProvider/setSelection.js.map +1 -0
- package/modules/FileManagerRenderer/FileManagerViewProvider/state.d.ts +33 -0
- package/modules/FileManagerRenderer/FileManagerViewProvider/state.js +34 -0
- package/modules/FileManagerRenderer/FileManagerViewProvider/state.js.map +1 -0
- package/modules/FileManagerRenderer/FileManagerViewProvider/useFileManagerView.d.ts +3 -0
- package/modules/FileManagerRenderer/FileManagerViewProvider/useFileManagerView.js +11 -0
- package/modules/FileManagerRenderer/FileManagerViewProvider/useFileManagerView.js.map +1 -0
- package/modules/FileManagerRenderer/FileManagerViewProvider/useListFiles.d.ts +25 -0
- package/modules/FileManagerRenderer/FileManagerViewProvider/useListFiles.js +153 -0
- package/modules/FileManagerRenderer/FileManagerViewProvider/useListFiles.js.map +1 -0
- package/modules/FileManagerRenderer/FileManagerViewProvider/useTags.d.ts +11 -0
- package/modules/FileManagerRenderer/FileManagerViewProvider/useTags.js +89 -0
- package/modules/FileManagerRenderer/FileManagerViewProvider/useTags.js.map +1 -0
- package/modules/FileManagerRenderer/filters/FilterByType.d.ts +2 -0
- package/modules/FileManagerRenderer/filters/FilterByType.js +32 -0
- package/modules/FileManagerRenderer/filters/FilterByType.js.map +1 -0
- package/modules/FileManagerRenderer/index.d.ts +2 -0
- package/modules/FileManagerRenderer/index.js +139 -0
- package/modules/FileManagerRenderer/index.js.map +1 -0
- package/modules/HeadlessCms/fileField.d.ts +2 -0
- package/modules/HeadlessCms/fileField.js +40 -0
- package/modules/HeadlessCms/fileField.js.map +1 -0
- package/modules/HeadlessCms/fileRenderer/fileField.d.ts +2 -0
- package/modules/HeadlessCms/fileRenderer/fileField.js +62 -0
- package/modules/HeadlessCms/fileRenderer/fileField.js.map +1 -0
- package/modules/HeadlessCms/fileRenderer/fileFields.d.ts +2 -0
- package/modules/HeadlessCms/fileRenderer/fileFields.js +99 -0
- package/modules/HeadlessCms/fileRenderer/fileFields.js.map +1 -0
- package/modules/HeadlessCms/fileRenderer/utils.d.ts +2 -0
- package/modules/HeadlessCms/fileRenderer/utils.js +6 -0
- package/modules/HeadlessCms/fileRenderer/utils.js.map +1 -0
- package/modules/HeadlessCms/index.d.ts +1 -0
- package/modules/HeadlessCms/index.js +13 -0
- package/modules/HeadlessCms/index.js.map +1 -0
- package/{admin → modules/Settings}/graphql.d.ts +7 -0
- package/modules/Settings/graphql.js +29 -0
- package/modules/Settings/graphql.js.map +1 -0
- package/modules/Settings/index.d.ts +2 -0
- package/modules/Settings/index.js +39 -0
- package/modules/Settings/index.js.map +1 -0
- package/modules/Settings/plugins/installation.d.ts +3 -0
- package/modules/Settings/plugins/installation.js +96 -0
- package/modules/Settings/plugins/installation.js.map +1 -0
- package/modules/Settings/plugins/permissionRenderer/FileManagerPermissions.d.ts +14 -0
- package/modules/Settings/plugins/permissionRenderer/FileManagerPermissions.js +205 -0
- package/modules/Settings/plugins/permissionRenderer/FileManagerPermissions.js.map +1 -0
- package/{admin → modules/Settings}/plugins/permissionRenderer/index.d.ts +1 -1
- package/modules/Settings/plugins/permissionRenderer/index.js +23 -0
- package/modules/Settings/plugins/permissionRenderer/index.js.map +1 -0
- package/modules/Settings/views/FileManagerSettings.d.ts +2 -0
- package/modules/Settings/views/FileManagerSettings.js +106 -0
- package/modules/Settings/views/FileManagerSettings.js.map +1 -0
- package/modules/ThumbnailRenderers/FilePreviewDefaultRenderer.d.ts +2 -0
- package/modules/ThumbnailRenderers/FilePreviewDefaultRenderer.js +12 -0
- package/modules/ThumbnailRenderers/FilePreviewDefaultRenderer.js.map +1 -0
- package/modules/ThumbnailRenderers/FilePreviewImageRenderer.d.ts +2 -0
- package/modules/ThumbnailRenderers/FilePreviewImageRenderer.js +19 -0
- package/modules/ThumbnailRenderers/FilePreviewImageRenderer.js.map +1 -0
- package/modules/ThumbnailRenderers/GridItemDefaultRenderer.d.ts +2 -0
- package/modules/ThumbnailRenderers/GridItemDefaultRenderer.js +12 -0
- package/modules/ThumbnailRenderers/GridItemDefaultRenderer.js.map +1 -0
- package/modules/ThumbnailRenderers/GridItemImageRenderer.d.ts +2 -0
- package/modules/ThumbnailRenderers/GridItemImageRenderer.js +19 -0
- package/modules/ThumbnailRenderers/GridItemImageRenderer.js.map +1 -0
- package/modules/ThumbnailRenderers/TableItemDefaultRenderer.d.ts +2 -0
- package/modules/ThumbnailRenderers/TableItemDefaultRenderer.js +19 -0
- package/modules/ThumbnailRenderers/TableItemDefaultRenderer.js.map +1 -0
- package/modules/ThumbnailRenderers/TableItemImageRenderer.d.ts +2 -0
- package/modules/ThumbnailRenderers/TableItemImageRenderer.js +19 -0
- package/modules/ThumbnailRenderers/TableItemImageRenderer.js.map +1 -0
- package/package.json +49 -32
- package/tagsHelpers.d.ts +16 -0
- package/tagsHelpers.js +35 -0
- package/tagsHelpers.js.map +1 -0
- package/types.d.ts +26 -5
- package/types.js +3 -1
- package/types.js.map +1 -0
- package/admin/graphql.js +0 -13
- package/admin/index.d.ts +0 -2
- package/admin/index.js +0 -4
- package/admin/plugins/index.d.ts +0 -2
- package/admin/plugins/index.js +0 -6
- package/admin/plugins/installation.d.ts +0 -3
- package/admin/plugins/installation.js +0 -112
- package/admin/plugins/menus.d.ts +0 -5
- package/admin/plugins/menus.js +0 -101
- package/admin/plugins/permissionRenderer/FileManagerPermissions.d.ts +0 -5
- package/admin/plugins/permissionRenderer/FileManagerPermissions.js +0 -226
- package/admin/plugins/permissionRenderer/index.js +0 -22
- package/admin/plugins/upgrades/v5.0.0.d.ts +0 -5
- package/admin/plugins/upgrades/v5.0.0.js +0 -85
- package/admin/views/FileManagerSettings.d.ts +0 -3
- package/admin/views/FileManagerSettings.js +0 -95
- /package/{admin → modules/Settings}/assets/icons/folder-open.svg +0 -0
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
import { ActionEditPresenter } from "./ActionEditPresenter";
|
|
2
|
+
describe("ActionEditPresenter", () => {
|
|
3
|
+
const extensionFields = [{
|
|
4
|
+
id: "field1",
|
|
5
|
+
fieldId: "field1",
|
|
6
|
+
label: "Field 1",
|
|
7
|
+
type: "text",
|
|
8
|
+
renderer: {
|
|
9
|
+
name: "text-input"
|
|
10
|
+
},
|
|
11
|
+
tags: ["$bulk-edit"],
|
|
12
|
+
storageId: "text@field1"
|
|
13
|
+
}, {
|
|
14
|
+
id: "field2",
|
|
15
|
+
fieldId: "field2",
|
|
16
|
+
label: "Field 2",
|
|
17
|
+
type: "ref",
|
|
18
|
+
renderer: {
|
|
19
|
+
name: "ref-inputs"
|
|
20
|
+
},
|
|
21
|
+
multipleValues: true,
|
|
22
|
+
settings: {
|
|
23
|
+
models: [{
|
|
24
|
+
modelId: "any-model"
|
|
25
|
+
}]
|
|
26
|
+
},
|
|
27
|
+
tags: ["$bulk-edit"],
|
|
28
|
+
storageId: "ref@field2"
|
|
29
|
+
}, {
|
|
30
|
+
id: "field3",
|
|
31
|
+
fieldId: "field3",
|
|
32
|
+
label: "Field 3",
|
|
33
|
+
type: "number",
|
|
34
|
+
renderer: {
|
|
35
|
+
name: "number-input"
|
|
36
|
+
},
|
|
37
|
+
tags: [],
|
|
38
|
+
storageId: "number@field3"
|
|
39
|
+
}];
|
|
40
|
+
const createFields = extensionFields => {
|
|
41
|
+
return [{
|
|
42
|
+
id: "name",
|
|
43
|
+
storageId: "text@name",
|
|
44
|
+
fieldId: "name",
|
|
45
|
+
label: "Name",
|
|
46
|
+
type: "text",
|
|
47
|
+
settings: {},
|
|
48
|
+
listValidation: [],
|
|
49
|
+
validation: [{
|
|
50
|
+
name: "required",
|
|
51
|
+
message: "Value is required."
|
|
52
|
+
}],
|
|
53
|
+
multipleValues: false,
|
|
54
|
+
predefinedValues: {
|
|
55
|
+
values: [],
|
|
56
|
+
enabled: false
|
|
57
|
+
},
|
|
58
|
+
renderer: {
|
|
59
|
+
name: "text-input"
|
|
60
|
+
}
|
|
61
|
+
}, {
|
|
62
|
+
id: "extensions",
|
|
63
|
+
storageId: "object@extensions",
|
|
64
|
+
fieldId: "extensions",
|
|
65
|
+
label: "Extensions",
|
|
66
|
+
type: "object",
|
|
67
|
+
settings: {
|
|
68
|
+
layout: extensionFields.map(field => [field.id]),
|
|
69
|
+
fields: extensionFields
|
|
70
|
+
},
|
|
71
|
+
listValidation: [],
|
|
72
|
+
validation: [],
|
|
73
|
+
multipleValues: false,
|
|
74
|
+
predefinedValues: {
|
|
75
|
+
values: [],
|
|
76
|
+
enabled: false
|
|
77
|
+
},
|
|
78
|
+
renderer: {
|
|
79
|
+
name: "any"
|
|
80
|
+
}
|
|
81
|
+
}];
|
|
82
|
+
};
|
|
83
|
+
let presenter;
|
|
84
|
+
beforeEach(() => {
|
|
85
|
+
jest.clearAllMocks();
|
|
86
|
+
presenter = new ActionEditPresenter();
|
|
87
|
+
});
|
|
88
|
+
it("should create a presenter and load extensions fields", () => {
|
|
89
|
+
presenter.load(createFields(extensionFields));
|
|
90
|
+
|
|
91
|
+
// I should see the bulk edit action
|
|
92
|
+
expect(presenter.vm.show).toEqual(true);
|
|
93
|
+
|
|
94
|
+
// I should receive a `currentBatch`
|
|
95
|
+
expect(presenter.vm.currentBatch).toEqual({
|
|
96
|
+
operations: [{
|
|
97
|
+
field: "",
|
|
98
|
+
operator: "",
|
|
99
|
+
value: undefined
|
|
100
|
+
}]
|
|
101
|
+
});
|
|
102
|
+
|
|
103
|
+
// I should receive the `fields` available for bulk edit
|
|
104
|
+
expect(presenter.vm.fields).toEqual([{
|
|
105
|
+
label: "Field 1",
|
|
106
|
+
value: "extensions.field1",
|
|
107
|
+
operators: [{
|
|
108
|
+
label: "Override existing values",
|
|
109
|
+
value: "OVERRIDE"
|
|
110
|
+
}, {
|
|
111
|
+
label: "Clear all existing values",
|
|
112
|
+
value: "REMOVE"
|
|
113
|
+
}],
|
|
114
|
+
raw: extensionFields[0]
|
|
115
|
+
}, {
|
|
116
|
+
label: "Field 2",
|
|
117
|
+
value: "extensions.field2",
|
|
118
|
+
operators: [{
|
|
119
|
+
label: "Override existing values",
|
|
120
|
+
value: "OVERRIDE"
|
|
121
|
+
}, {
|
|
122
|
+
label: "Clear all existing values",
|
|
123
|
+
value: "REMOVE"
|
|
124
|
+
}, {
|
|
125
|
+
label: "Append to existing values",
|
|
126
|
+
value: "APPEND"
|
|
127
|
+
}],
|
|
128
|
+
raw: extensionFields[1]
|
|
129
|
+
}]);
|
|
130
|
+
|
|
131
|
+
// I should receive the editor.vm
|
|
132
|
+
expect(presenter.vm.editorVm).toEqual({
|
|
133
|
+
isOpen: false
|
|
134
|
+
});
|
|
135
|
+
});
|
|
136
|
+
it("should not show the bulk action if no `extensions` fields are defined", () => {
|
|
137
|
+
presenter.load(createFields([]));
|
|
138
|
+
|
|
139
|
+
// The editor action should not be rendered
|
|
140
|
+
expect(presenter.vm.show).toBe(false);
|
|
141
|
+
});
|
|
142
|
+
it("should open / close the editor", () => {
|
|
143
|
+
presenter.load(createFields(extensionFields));
|
|
144
|
+
|
|
145
|
+
// The editor should be closed by default
|
|
146
|
+
expect(presenter.vm.editorVm.isOpen).toBe(false);
|
|
147
|
+
|
|
148
|
+
// Let's open the editor
|
|
149
|
+
presenter.openEditor();
|
|
150
|
+
expect(presenter.vm.editorVm.isOpen).toBe(true);
|
|
151
|
+
|
|
152
|
+
// Let's open the editor
|
|
153
|
+
presenter.closeEditor();
|
|
154
|
+
expect(presenter.vm.editorVm.isOpen).toBe(false);
|
|
155
|
+
});
|
|
156
|
+
});
|
|
157
|
+
|
|
158
|
+
//# sourceMappingURL=ActionEditPresenter.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["ActionEditPresenter","describe","extensionFields","id","fieldId","label","type","renderer","name","tags","storageId","multipleValues","settings","models","modelId","createFields","listValidation","validation","message","predefinedValues","values","enabled","layout","map","field","fields","presenter","beforeEach","jest","clearAllMocks","it","load","expect","vm","show","toEqual","currentBatch","operations","operator","value","undefined","operators","raw","editorVm","isOpen","toBe","openEditor","closeEditor"],"sources":["ActionEditPresenter.test.ts"],"sourcesContent":["import { ActionEditPresenter } from \"./ActionEditPresenter\";\nimport type { FieldRaw } from \"~/components/BulkActions/ActionEdit/domain\";\n\ndescribe(\"ActionEditPresenter\", () => {\n const extensionFields = [\n {\n id: \"field1\",\n fieldId: \"field1\",\n label: \"Field 1\",\n type: \"text\",\n renderer: {\n name: \"text-input\"\n },\n tags: [\"$bulk-edit\"],\n storageId: \"text@field1\"\n },\n {\n id: \"field2\",\n fieldId: \"field2\",\n label: \"Field 2\",\n type: \"ref\",\n renderer: {\n name: \"ref-inputs\"\n },\n multipleValues: true,\n settings: {\n models: [\n {\n modelId: \"any-model\"\n }\n ]\n },\n tags: [\"$bulk-edit\"],\n storageId: \"ref@field2\"\n },\n {\n id: \"field3\",\n fieldId: \"field3\",\n label: \"Field 3\",\n type: \"number\",\n renderer: {\n name: \"number-input\"\n },\n tags: [],\n storageId: \"number@field3\"\n }\n ];\n\n const createFields = (extensionFields: FieldRaw[]) => {\n return [\n {\n id: \"name\",\n storageId: \"text@name\",\n fieldId: \"name\",\n label: \"Name\",\n type: \"text\",\n settings: {},\n listValidation: [],\n validation: [\n {\n name: \"required\",\n message: \"Value is required.\"\n }\n ],\n multipleValues: false,\n predefinedValues: {\n values: [],\n enabled: false\n },\n renderer: {\n name: \"text-input\"\n }\n },\n {\n id: \"extensions\",\n storageId: \"object@extensions\",\n fieldId: \"extensions\",\n label: \"Extensions\",\n type: \"object\",\n settings: {\n layout: extensionFields.map(field => [field.id]),\n fields: extensionFields\n },\n listValidation: [],\n validation: [],\n multipleValues: false,\n predefinedValues: {\n values: [],\n enabled: false\n },\n renderer: {\n name: \"any\"\n }\n }\n ];\n };\n\n let presenter: ActionEditPresenter;\n\n beforeEach(() => {\n jest.clearAllMocks();\n presenter = new ActionEditPresenter();\n });\n\n it(\"should create a presenter and load extensions fields\", () => {\n presenter.load(createFields(extensionFields));\n\n // I should see the bulk edit action\n expect(presenter.vm.show).toEqual(true);\n\n // I should receive a `currentBatch`\n expect(presenter.vm.currentBatch).toEqual({\n operations: [\n {\n field: \"\",\n operator: \"\",\n value: undefined\n }\n ]\n });\n\n // I should receive the `fields` available for bulk edit\n expect(presenter.vm.fields).toEqual([\n {\n label: \"Field 1\",\n value: \"extensions.field1\",\n operators: [\n {\n label: \"Override existing values\",\n value: \"OVERRIDE\"\n },\n {\n label: \"Clear all existing values\",\n value: \"REMOVE\"\n }\n ],\n raw: extensionFields[0]\n },\n {\n label: \"Field 2\",\n value: \"extensions.field2\",\n operators: [\n {\n label: \"Override existing values\",\n value: \"OVERRIDE\"\n },\n {\n label: \"Clear all existing values\",\n value: \"REMOVE\"\n },\n {\n label: \"Append to existing values\",\n value: \"APPEND\"\n }\n ],\n raw: extensionFields[1]\n }\n ]);\n\n // I should receive the editor.vm\n expect(presenter.vm.editorVm).toEqual({\n isOpen: false\n });\n });\n\n it(\"should not show the bulk action if no `extensions` fields are defined\", () => {\n presenter.load(createFields([]));\n\n // The editor action should not be rendered\n expect(presenter.vm.show).toBe(false);\n });\n\n it(\"should open / close the editor\", () => {\n presenter.load(createFields(extensionFields));\n\n // The editor should be closed by default\n expect(presenter.vm.editorVm.isOpen).toBe(false);\n\n // Let's open the editor\n presenter.openEditor();\n expect(presenter.vm.editorVm.isOpen).toBe(true);\n\n // Let's open the editor\n presenter.closeEditor();\n expect(presenter.vm.editorVm.isOpen).toBe(false);\n });\n});\n"],"mappings":"AAAA,SAASA,mBAAmB;AAG5BC,QAAQ,CAAC,qBAAqB,EAAE,MAAM;EAClC,MAAMC,eAAe,GAAG,CACpB;IACIC,EAAE,EAAE,QAAQ;IACZC,OAAO,EAAE,QAAQ;IACjBC,KAAK,EAAE,SAAS;IAChBC,IAAI,EAAE,MAAM;IACZC,QAAQ,EAAE;MACNC,IAAI,EAAE;IACV,CAAC;IACDC,IAAI,EAAE,CAAC,YAAY,CAAC;IACpBC,SAAS,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
1
|
+
import React from "react";
|
|
2
|
+
import { Button } from "@webiny/admin-ui";
|
|
3
|
+
import { ReactComponent as AddIcon } from "@webiny/icons/add.svg";
|
|
4
|
+
export const AddOperation = ({
|
|
5
|
+
disabled,
|
|
6
|
+
onClick
|
|
7
|
+
}) => {
|
|
8
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
9
|
+
className: "wby-mt-lg wby-text-center"
|
|
10
|
+
}, /*#__PURE__*/React.createElement(Button, {
|
|
11
|
+
onClick: onClick,
|
|
12
|
+
text: "Add new operation",
|
|
13
|
+
icon: /*#__PURE__*/React.createElement(AddIcon, null),
|
|
14
|
+
variant: "secondary",
|
|
15
|
+
disabled: disabled
|
|
16
|
+
}));
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
//# sourceMappingURL=AddOperation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","Button","ReactComponent","AddIcon","AddOperation","disabled","onClick","createElement","className","text","icon","variant"],"sources":["AddOperation.tsx"],"sourcesContent":["import React from \"react\";\nimport { Button } from \"@webiny/admin-ui\";\nimport { ReactComponent as AddIcon } from \"@webiny/icons/add.svg\";\n\ninterface AddOperationProps {\n disabled: boolean;\n onClick: () => void;\n}\n\nexport const AddOperation = ({ disabled, onClick }: AddOperationProps) => {\n return (\n <div className={\"wby-mt-lg wby-text-center\"}>\n <Button\n onClick={onClick}\n text={\"Add new operation\"}\n icon={<AddIcon />}\n variant={\"secondary\"}\n disabled={disabled}\n />\n </div>\n );\n};\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,MAAM,QAAQ,kBAAkB;AACzC,SAASC,cAAc,IAAIC,OAAO,QAAQ,uBAAuB;AAOjE,OAAO,MAAMC,YAAY,GAAGA,CAAC;EAAEC,QAAQ;EAAEC;AAA2B,CAAC,KAAK;EACtE,oBACIN,KAAA,CAAAO,aAAA;IAAKC,SAAS,EAAE;EAA4B,gBACxCR,KAAA,CAAAO,aAAA,CAACN,MAAM;IACHK,OAAO,EAAEA,OAAQ;IACjBG,IAAI,EAAE,mBAAoB;IAC1BC,IAAI,eAAEV,KAAA,CAAAO,aAAA,CAACJ,OAAO,MAAE,CAAE;IAClBQ,OAAO,EAAE,WAAY;IACrBN,QAAQ,EAAEA;EAAS,CACtB,CACA,CAAC;AAEd,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import type { FormAPI, FormOnSubmit } from "@webiny/form";
|
|
3
|
+
import type { BatchEditorDialogViewModel, BatchEditorFormData } from "./BatchEditorDialogPresenter";
|
|
4
|
+
export interface BatchEditorProps {
|
|
5
|
+
onForm: (form: FormAPI) => void;
|
|
6
|
+
onAdd: () => void;
|
|
7
|
+
onDelete: (operationIndex: number) => void;
|
|
8
|
+
onChange: (data: BatchEditorFormData) => void;
|
|
9
|
+
onSetOperationFieldData: (operationIndex: number, data: string) => void;
|
|
10
|
+
onSubmit: FormOnSubmit<BatchEditorFormData>;
|
|
11
|
+
vm: BatchEditorDialogViewModel;
|
|
12
|
+
}
|
|
13
|
+
export declare const BatchEditor: ((props: BatchEditorProps) => React.JSX.Element) & {
|
|
14
|
+
displayName: string;
|
|
15
|
+
};
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import React, { useEffect } from "react";
|
|
2
|
+
import { observer } from "mobx-react-lite";
|
|
3
|
+
import { ReactComponent as DeleteIcon } from "@webiny/icons/delete_outline.svg";
|
|
4
|
+
import { Form } from "@webiny/form";
|
|
5
|
+
import { AddOperation } from "./AddOperation";
|
|
6
|
+
import { Operation } from "./Operation";
|
|
7
|
+
import { Accordion } from "@webiny/admin-ui";
|
|
8
|
+
export const BatchEditor = observer(props => {
|
|
9
|
+
const formRef = /*#__PURE__*/React.createRef();
|
|
10
|
+
useEffect(() => {
|
|
11
|
+
if (formRef.current) {
|
|
12
|
+
props.onForm(formRef.current);
|
|
13
|
+
}
|
|
14
|
+
}, []);
|
|
15
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
16
|
+
className: "wby-py-lg"
|
|
17
|
+
}, /*#__PURE__*/React.createElement(Form, {
|
|
18
|
+
ref: formRef,
|
|
19
|
+
data: props.vm.data,
|
|
20
|
+
onChange: props.onChange,
|
|
21
|
+
invalidFields: props.vm.invalidFields
|
|
22
|
+
}, () => /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Accordion, {
|
|
23
|
+
variant: "container",
|
|
24
|
+
background: "light"
|
|
25
|
+
}, props.vm.data.operations.map((operation, operationIndex) => /*#__PURE__*/React.createElement(Accordion.Item, {
|
|
26
|
+
key: `operation-${operationIndex}`,
|
|
27
|
+
title: operation.title,
|
|
28
|
+
defaultOpen: operation.open,
|
|
29
|
+
actions: /*#__PURE__*/React.createElement(Accordion.Item.Action, {
|
|
30
|
+
icon: /*#__PURE__*/React.createElement(DeleteIcon, null),
|
|
31
|
+
onClick: () => props.onDelete(operationIndex),
|
|
32
|
+
disabled: !operation.canDelete
|
|
33
|
+
})
|
|
34
|
+
}, /*#__PURE__*/React.createElement(Operation, {
|
|
35
|
+
name: `operations.${operationIndex}`,
|
|
36
|
+
operation: operation,
|
|
37
|
+
onDelete: () => props.onDelete(operationIndex),
|
|
38
|
+
onSetOperationFieldData: data => props.onSetOperationFieldData(operationIndex, data)
|
|
39
|
+
})))), /*#__PURE__*/React.createElement(AddOperation, {
|
|
40
|
+
disabled: !props.vm.canAddOperation,
|
|
41
|
+
onClick: () => props.onAdd()
|
|
42
|
+
}))));
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
//# sourceMappingURL=BatchEditor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","useEffect","observer","ReactComponent","DeleteIcon","Form","AddOperation","Operation","Accordion","BatchEditor","props","formRef","createRef","current","onForm","createElement","className","ref","data","vm","onChange","invalidFields","Fragment","variant","background","operations","map","operation","operationIndex","Item","key","title","defaultOpen","open","actions","Action","icon","onClick","onDelete","disabled","canDelete","name","onSetOperationFieldData","canAddOperation","onAdd"],"sources":["BatchEditor.tsx"],"sourcesContent":["import React, { useEffect } from \"react\";\n\nimport { observer } from \"mobx-react-lite\";\nimport { ReactComponent as DeleteIcon } from \"@webiny/icons/delete_outline.svg\";\nimport type { FormAPI, FormOnSubmit } from \"@webiny/form\";\nimport { Form } from \"@webiny/form\";\n\nimport { AddOperation } from \"~/components/BulkActions/ActionEdit/BatchEditorDialog/AddOperation\";\nimport { Operation } from \"~/components/BulkActions/ActionEdit/BatchEditorDialog/Operation\";\nimport type {\n BatchEditorDialogViewModel,\n BatchEditorFormData\n} from \"~/components/BulkActions/ActionEdit/BatchEditorDialog/BatchEditorDialogPresenter\";\nimport { Accordion } from \"@webiny/admin-ui\";\n\nexport interface BatchEditorProps {\n onForm: (form: FormAPI) => void;\n onAdd: () => void;\n onDelete: (operationIndex: number) => void;\n onChange: (data: BatchEditorFormData) => void;\n onSetOperationFieldData: (operationIndex: number, data: string) => void;\n onSubmit: FormOnSubmit<BatchEditorFormData>;\n vm: BatchEditorDialogViewModel;\n}\n\nexport const BatchEditor = observer((props: BatchEditorProps) => {\n const formRef = React.createRef<FormAPI>();\n\n useEffect(() => {\n if (formRef.current) {\n props.onForm(formRef.current);\n }\n }, []);\n\n return (\n <div className={\"wby-py-lg\"}>\n <Form\n ref={formRef}\n data={props.vm.data}\n onChange={props.onChange}\n invalidFields={props.vm.invalidFields}\n >\n {() => (\n <>\n <Accordion variant={\"container\"} background={\"light\"}>\n {props.vm.data.operations.map((operation, operationIndex) => (\n <Accordion.Item\n key={`operation-${operationIndex}`}\n title={operation.title}\n defaultOpen={operation.open}\n actions={\n <Accordion.Item.Action\n icon={<DeleteIcon />}\n onClick={() => props.onDelete(operationIndex)}\n disabled={!operation.canDelete}\n />\n }\n >\n <Operation\n name={`operations.${operationIndex}`}\n operation={operation}\n onDelete={() => props.onDelete(operationIndex)}\n onSetOperationFieldData={data =>\n props.onSetOperationFieldData(operationIndex, data)\n }\n />\n </Accordion.Item>\n ))}\n </Accordion>\n <AddOperation\n disabled={!props.vm.canAddOperation}\n onClick={() => props.onAdd()}\n />\n </>\n )}\n </Form>\n </div>\n );\n});\n"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,SAAS,QAAQ,OAAO;AAExC,SAASC,QAAQ,QAAQ,iBAAiB;AAC1C,SAASC,cAAc,IAAIC,UAAU,QAAQ,kCAAkC;AAE/E,SAASC,IAAI,QAAQ,cAAc;AAEnC,SAASC,YAAY;AACrB,SAASC,SAAS;AAKlB,SAASC,SAAS,QAAQ,kBAAkB;AAY5C,OAAO,MAAMC,WAAW,GAAGP,QAAQ,CAAEQ,KAAuB,IAAK;EAC7D,MAAMC,OAAO,gBAAGX,KAAK,CAACY,SAAS,CAAU,CAAC;EAE1CX,SAAS,CAAC,MAAM;IACZ,IAAIU,OAAO,CAACE,OAAO,EAAE;MACjBH,KAAK,CAACI,MAAM,CAACH,OAAO,CAACE,OAAO,CAAC;IACjC;EACJ,CAAC,EAAE,EAAE,CAAC;EAEN,oBACIb,KAAA,CAAAe,aAAA;IAAKC,SAAS,EAAE;EAAY,gBACxBhB,KAAA,CAAAe,aAAA,CAACV,IAAI;IACDY,GAAG,EAAEN,OAAQ;IACbO,IAAI,EAAER,KAAK,CAACS,EAAE,CAACD,IAAK;IACpBE,QAAQ,EAAEV,KAAK,CAACU,QAAS;IACzBC,aAAa,EAAEX,KAAK,CAACS,EAAE,CAACE;EAAc,GAErC,mBACGrB,KAAA,CAAAe,aAAA,CAAAf,KAAA,CAAAsB,QAAA,qBACItB,KAAA,CAAAe,aAAA,CAACP,SAAS;IAACe,OAAO,EAAE,WAAY;IAACC,UAAU,EAAE;EAAQ,GAChDd,KAAK,CAACS,EAAE,CAACD,IAAI,CAACO,UAAU,CAACC,GAAG,CAAC,CAACC,SAAS,EAAEC,cAAc,kBACpD5B,KAAA,CAAAe,aAAA,CAACP,SAAS,CAACqB,IAAI;IACXC,GAAG,EAAE,aAAaF,cAAc,EAAG;IACnCG,KAAK,EAAEJ,SAAS,CAACI,KAAM;IACvBC,WAAW,EAAEL,SAAS,CAACM,IAAK;IAC5BC,OAAO,eACHlC,KAAA,CAAAe,aAAA,CAACP,SAAS,CAACqB,IAAI,CAACM,MAAM;MAClBC,IAAI,eAAEpC,KAAA,CAAAe,aAAA,CAACX,UAAU,MAAE,CAAE;MACrBiC,OAAO,EAAEA,CAAA,KAAM3B,KAAK,CAAC4B,QAAQ,CAACV,cAAc,CAAE;MAC9CW,QAAQ,EAAE,CAACZ,SAAS,CAACa;IAAU,CAClC;EACJ,gBAEDxC,KAAA,CAAAe,aAAA,CAACR,SAAS;IACNkC,IAAI,EAAE,cAAcb,cAAc,EAAG;IACrCD,SAAS,EAAEA,SAAU;IACrBW,QAAQ,EAAEA,CAAA,KAAM5B,KAAK,CAAC4B,QAAQ,CAACV,cAAc,CAAE;IAC/Cc,uBAAuB,EAAExB,IAAI,IACzBR,KAAK,CAACgC,uBAAuB,CAACd,cAAc,EAAEV,IAAI;EACrD,CACJ,CACW,CACnB,CACM,CAAC,eACZlB,KAAA,CAAAe,aAAA,CAACT,YAAY;IACTiC,QAAQ,EAAE,CAAC7B,KAAK,CAACS,EAAE,CAACwB,eAAgB;IACpCN,OAAO,EAAEA,CAAA,KAAM3B,KAAK,CAACkC,KAAK,CAAC;EAAE,CAChC,CACH,CAEJ,CACL,CAAC;AAEd,CAAC,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import type { BatchDTO, FieldDTO } from "../domain";
|
|
3
|
+
interface BatchEditorDialogProps {
|
|
4
|
+
fields: FieldDTO[];
|
|
5
|
+
batch: BatchDTO;
|
|
6
|
+
vm: {
|
|
7
|
+
isOpen: boolean;
|
|
8
|
+
};
|
|
9
|
+
onApply: (batch: BatchDTO) => void;
|
|
10
|
+
onClose: () => void;
|
|
11
|
+
}
|
|
12
|
+
export declare const BatchEditorDialog: ((props: BatchEditorDialogProps) => React.JSX.Element) & {
|
|
13
|
+
displayName: string;
|
|
14
|
+
};
|
|
15
|
+
export {};
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import React, { useMemo, useEffect, useRef } from "react";
|
|
2
|
+
import { Drawer } from "@webiny/admin-ui";
|
|
3
|
+
import { observer } from "mobx-react-lite";
|
|
4
|
+
import { BatchEditorDialogPresenter } from "./BatchEditorDialogPresenter";
|
|
5
|
+
import { BatchEditor } from "./BatchEditor";
|
|
6
|
+
export const BatchEditorDialog = observer(props => {
|
|
7
|
+
const presenter = useMemo(() => {
|
|
8
|
+
return new BatchEditorDialogPresenter();
|
|
9
|
+
}, []);
|
|
10
|
+
const ref = useRef(null);
|
|
11
|
+
useEffect(() => {
|
|
12
|
+
presenter.load(props.batch, props.fields);
|
|
13
|
+
}, [props.batch, props.fields]);
|
|
14
|
+
const onChange = data => {
|
|
15
|
+
presenter.setBatch(data);
|
|
16
|
+
};
|
|
17
|
+
const onApply = () => {
|
|
18
|
+
ref.current?.validate().then(isValid => {
|
|
19
|
+
if (isValid) {
|
|
20
|
+
presenter.onApply(batch => {
|
|
21
|
+
props.onApply(batch);
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
};
|
|
26
|
+
return /*#__PURE__*/React.createElement(Drawer, {
|
|
27
|
+
open: props.vm.isOpen,
|
|
28
|
+
onClose: props.onClose,
|
|
29
|
+
modal: true,
|
|
30
|
+
width: 800,
|
|
31
|
+
headerSeparator: true,
|
|
32
|
+
footerSeparator: true,
|
|
33
|
+
title: "Edit items",
|
|
34
|
+
actions: /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Drawer.CancelButton, {
|
|
35
|
+
text: "Cancel",
|
|
36
|
+
onClick: props.onClose
|
|
37
|
+
}), /*#__PURE__*/React.createElement(Drawer.ConfirmButton, {
|
|
38
|
+
onClick: onApply,
|
|
39
|
+
text: "Submit"
|
|
40
|
+
}))
|
|
41
|
+
}, /*#__PURE__*/React.createElement(BatchEditor, {
|
|
42
|
+
onForm: form => ref.current = form,
|
|
43
|
+
onChange: data => onChange(data),
|
|
44
|
+
onSubmit: onApply,
|
|
45
|
+
onDelete: operationIndex => presenter.deleteOperation(operationIndex),
|
|
46
|
+
onAdd: () => presenter.addOperation(),
|
|
47
|
+
onSetOperationFieldData: (operationIndex, data) => presenter.setOperationFieldData(operationIndex, data),
|
|
48
|
+
vm: presenter.vm
|
|
49
|
+
}));
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
//# sourceMappingURL=BatchEditorDialog.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","useMemo","useEffect","useRef","Drawer","observer","BatchEditorDialogPresenter","BatchEditor","BatchEditorDialog","props","presenter","ref","load","batch","fields","onChange","data","setBatch","onApply","current","validate","then","isValid","createElement","open","vm","isOpen","onClose","modal","width","headerSeparator","footerSeparator","title","actions","Fragment","CancelButton","text","onClick","ConfirmButton","onForm","form","onSubmit","onDelete","operationIndex","deleteOperation","onAdd","addOperation","onSetOperationFieldData","setOperationFieldData"],"sources":["BatchEditorDialog.tsx"],"sourcesContent":["import React, { useMemo, useEffect, useRef } from \"react\";\n\nimport { Drawer } from \"@webiny/admin-ui\";\nimport { observer } from \"mobx-react-lite\";\nimport type { FormAPI } from \"@webiny/form\";\n\nimport type { BatchEditorFormData } from \"./BatchEditorDialogPresenter\";\nimport { BatchEditorDialogPresenter } from \"./BatchEditorDialogPresenter\";\nimport { BatchEditor } from \"~/components/BulkActions/ActionEdit/BatchEditorDialog/BatchEditor\";\nimport type { BatchDTO, FieldDTO } from \"~/components/BulkActions/ActionEdit/domain\";\n\ninterface BatchEditorDialogProps {\n fields: FieldDTO[];\n batch: BatchDTO;\n vm: {\n isOpen: boolean;\n };\n onApply: (batch: BatchDTO) => void;\n onClose: () => void;\n}\n\nexport const BatchEditorDialog = observer((props: BatchEditorDialogProps) => {\n const presenter = useMemo<BatchEditorDialogPresenter>(() => {\n return new BatchEditorDialogPresenter();\n }, []);\n\n const ref = useRef<FormAPI | null>(null);\n\n useEffect(() => {\n presenter.load(props.batch, props.fields);\n }, [props.batch, props.fields]);\n\n const onChange = (data: BatchEditorFormData) => {\n presenter.setBatch(data);\n };\n\n const onApply = () => {\n ref.current?.validate().then(isValid => {\n if (isValid) {\n presenter.onApply(batch => {\n props.onApply(batch);\n });\n }\n });\n };\n\n return (\n <Drawer\n open={props.vm.isOpen}\n onClose={props.onClose}\n modal={true}\n width={800}\n headerSeparator={true}\n footerSeparator={true}\n title={\"Edit items\"}\n actions={\n <>\n <Drawer.CancelButton text={\"Cancel\"} onClick={props.onClose} />\n <Drawer.ConfirmButton onClick={onApply} text={\"Submit\"} />\n </>\n }\n >\n <BatchEditor\n onForm={form => (ref.current = form)}\n onChange={data => onChange(data)}\n onSubmit={onApply}\n onDelete={operationIndex => presenter.deleteOperation(operationIndex)}\n onAdd={() => presenter.addOperation()}\n onSetOperationFieldData={(operationIndex, data) =>\n presenter.setOperationFieldData(operationIndex, data)\n }\n vm={presenter.vm}\n />\n </Drawer>\n );\n});\n"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,OAAO,EAAEC,SAAS,EAAEC,MAAM,QAAQ,OAAO;AAEzD,SAASC,MAAM,QAAQ,kBAAkB;AACzC,SAASC,QAAQ,QAAQ,iBAAiB;AAI1C,SAASC,0BAA0B;AACnC,SAASC,WAAW;AAapB,OAAO,MAAMC,iBAAiB,GAAGH,QAAQ,CAAEI,KAA6B,IAAK;EACzE,MAAMC,SAAS,GAAGT,OAAO,CAA6B,MAAM;IACxD,OAAO,IAAIK,0BAA0B,CAAC,CAAC;EAC3C,CAAC,EAAE,EAAE,CAAC;EAEN,MAAMK,GAAG,GAAGR,MAAM,CAAiB,IAAI,CAAC;EAExCD,SAAS,CAAC,MAAM;IACZQ,SAAS,CAACE,IAAI,CAACH,KAAK,CAACI,KAAK,EAAEJ,KAAK,CAACK,MAAM,CAAC;EAC7C,CAAC,EAA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EAAEvB,OAAQ;IAClBwB,QAAQ,EAAEC,cAAc,IAAIjC,SAAS,CAACkC,eAAe,CAACD,cAAc,CAAE;IACtEE,KAAK,EAAEA,CAAA,KAAMnC,SAAS,CAACoC,YAAY,CAAC,CAAE;IACtCC,uBAAuB,EAAEA,CAACJ,cAAc,EAAE3B,IAAI,KAC1CN,SAAS,CAACsC,qBAAqB,CAACL,cAAc,EAAE3B,IAAI,CACvD;IACDS,EAAE,EAAEf,SAAS,CAACe;EAAG,CACpB,CACG,CAAC;AAEjB,CAAC,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import type { BatchDTO, FieldDTO, OperationDTO, OperatorDTO } from "../domain";
|
|
2
|
+
import type { FormInvalidFields } from "@webiny/form";
|
|
3
|
+
export interface IBatchEditorDialogPresenter {
|
|
4
|
+
load(batch: BatchDTO, fields: FieldDTO[]): void;
|
|
5
|
+
addOperation(): void;
|
|
6
|
+
deleteOperation(operationIndex: number): void;
|
|
7
|
+
setOperationFieldData(operationIndex: number, data: string): void;
|
|
8
|
+
setBatch(data: any): void;
|
|
9
|
+
onApply(onSuccess?: (batch: BatchDTO) => void, onError?: (batch: BatchDTO) => void): void;
|
|
10
|
+
get vm(): BatchEditorDialogViewModel;
|
|
11
|
+
}
|
|
12
|
+
export interface BatchEditorDialogViewModel {
|
|
13
|
+
invalidFields: FormInvalidFields;
|
|
14
|
+
canAddOperation: boolean;
|
|
15
|
+
data: BatchEditorFormData;
|
|
16
|
+
}
|
|
17
|
+
export interface BatchEditorFormData {
|
|
18
|
+
operations: OperationFormData[];
|
|
19
|
+
}
|
|
20
|
+
export type OperationFormData = OperationDTO & {
|
|
21
|
+
canDelete: boolean;
|
|
22
|
+
title: string;
|
|
23
|
+
open: boolean;
|
|
24
|
+
fieldOptions: FieldDTO[];
|
|
25
|
+
operatorOptions: OperatorDTO[];
|
|
26
|
+
selectedField?: FieldDTO;
|
|
27
|
+
};
|
|
28
|
+
export declare class BatchEditorDialogPresenter implements IBatchEditorDialogPresenter {
|
|
29
|
+
private batch;
|
|
30
|
+
private fields;
|
|
31
|
+
private invalidFields;
|
|
32
|
+
private formWasSubmitted;
|
|
33
|
+
constructor();
|
|
34
|
+
load(batch: BatchDTO, fields: FieldDTO[]): void;
|
|
35
|
+
get vm(): {
|
|
36
|
+
invalidFields: FormInvalidFields;
|
|
37
|
+
canAddOperation: boolean;
|
|
38
|
+
data: {
|
|
39
|
+
operations: {
|
|
40
|
+
title: string;
|
|
41
|
+
open: boolean;
|
|
42
|
+
field: string;
|
|
43
|
+
operator: string;
|
|
44
|
+
value: Record<string, any> | undefined;
|
|
45
|
+
canDelete: boolean;
|
|
46
|
+
fieldOptions: FieldDTO[];
|
|
47
|
+
selectedField: FieldDTO | undefined;
|
|
48
|
+
operatorOptions: OperatorDTO[];
|
|
49
|
+
}[];
|
|
50
|
+
};
|
|
51
|
+
};
|
|
52
|
+
addOperation(): void;
|
|
53
|
+
deleteOperation(operationIndex: number): void;
|
|
54
|
+
setOperationFieldData(batchIndex: number, data: string): void;
|
|
55
|
+
setBatch(data: BatchEditorFormData): void;
|
|
56
|
+
onApply(onSuccess?: (batch: BatchDTO) => void, onError?: (batch: BatchDTO, invalidFields: BatchEditorDialogViewModel["invalidFields"]) => void): void;
|
|
57
|
+
private getOperations;
|
|
58
|
+
private getOperationTitle;
|
|
59
|
+
private getFieldOptions;
|
|
60
|
+
private validateBatch;
|
|
61
|
+
}
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
import { makeAutoObservable } from "mobx";
|
|
2
|
+
import { Batch } from "../domain";
|
|
3
|
+
export class BatchEditorDialogPresenter {
|
|
4
|
+
invalidFields = {};
|
|
5
|
+
formWasSubmitted = false;
|
|
6
|
+
constructor() {
|
|
7
|
+
this.batch = undefined;
|
|
8
|
+
this.fields = [];
|
|
9
|
+
makeAutoObservable(this);
|
|
10
|
+
}
|
|
11
|
+
load(batch, fields) {
|
|
12
|
+
this.batch = batch;
|
|
13
|
+
this.fields = fields;
|
|
14
|
+
}
|
|
15
|
+
get vm() {
|
|
16
|
+
const operations = this.getOperations();
|
|
17
|
+
const canAddOperation = operations[operations.length - 1]?.fieldOptions.length > 1 ?? false;
|
|
18
|
+
return {
|
|
19
|
+
invalidFields: this.invalidFields,
|
|
20
|
+
canAddOperation,
|
|
21
|
+
data: {
|
|
22
|
+
operations
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
addOperation() {
|
|
27
|
+
if (!this.batch) {
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
this.batch.operations.push({
|
|
31
|
+
field: "",
|
|
32
|
+
operator: "",
|
|
33
|
+
value: undefined
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
deleteOperation(operationIndex) {
|
|
37
|
+
if (!this.batch) {
|
|
38
|
+
return;
|
|
39
|
+
}
|
|
40
|
+
this.batch.operations = this.batch.operations.filter((_, index) => index !== operationIndex);
|
|
41
|
+
|
|
42
|
+
// Make sure we always have at least 1 operation!
|
|
43
|
+
if (this.batch.operations.length === 0) {
|
|
44
|
+
this.addOperation();
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
setOperationFieldData(batchIndex, data) {
|
|
48
|
+
if (!this.batch) {
|
|
49
|
+
return;
|
|
50
|
+
}
|
|
51
|
+
this.batch.operations = [...this.batch.operations.slice(0, batchIndex), {
|
|
52
|
+
field: data,
|
|
53
|
+
operator: "",
|
|
54
|
+
value: undefined
|
|
55
|
+
}, ...this.batch.operations.slice(batchIndex + 1)];
|
|
56
|
+
}
|
|
57
|
+
setBatch(data) {
|
|
58
|
+
if (!this.batch) {
|
|
59
|
+
return;
|
|
60
|
+
}
|
|
61
|
+
this.batch = {
|
|
62
|
+
...this.batch,
|
|
63
|
+
operations: data.operations.map(operation => ({
|
|
64
|
+
field: operation.field,
|
|
65
|
+
operator: operation.operator,
|
|
66
|
+
value: operation.value
|
|
67
|
+
}))
|
|
68
|
+
};
|
|
69
|
+
if (this.formWasSubmitted) {
|
|
70
|
+
this.validateBatch(this.batch);
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
onApply(onSuccess, onError) {
|
|
74
|
+
if (!this.batch) {
|
|
75
|
+
return;
|
|
76
|
+
}
|
|
77
|
+
const result = this.validateBatch(this.batch);
|
|
78
|
+
if (result.success) {
|
|
79
|
+
onSuccess && onSuccess(this.batch);
|
|
80
|
+
} else {
|
|
81
|
+
onError && onError(this.batch, this.invalidFields);
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
getOperations = () => {
|
|
85
|
+
return this.batch?.operations.map((operation, operationIndex) => {
|
|
86
|
+
const fieldOptions = this.getFieldOptions(operation.field);
|
|
87
|
+
const selectedField = fieldOptions.find(field => field.value === operation.field);
|
|
88
|
+
const operatorOptions = selectedField?.operators || [];
|
|
89
|
+
return {
|
|
90
|
+
title: this.getOperationTitle(operation.field, operation.operator) ?? `Operation #${operationIndex + 1}`,
|
|
91
|
+
open: true,
|
|
92
|
+
field: operation.field,
|
|
93
|
+
operator: operation.operator,
|
|
94
|
+
value: operation.value,
|
|
95
|
+
canDelete: operationIndex !== 0,
|
|
96
|
+
fieldOptions,
|
|
97
|
+
selectedField,
|
|
98
|
+
operatorOptions
|
|
99
|
+
};
|
|
100
|
+
}) || [];
|
|
101
|
+
};
|
|
102
|
+
getOperationTitle(inputField, inputOperation) {
|
|
103
|
+
if (!inputField || !inputOperation) {
|
|
104
|
+
return undefined;
|
|
105
|
+
}
|
|
106
|
+
const field = this.fields.find(field => field.value === inputField);
|
|
107
|
+
if (!field) {
|
|
108
|
+
return undefined;
|
|
109
|
+
}
|
|
110
|
+
const operator = field.operators.find(operator => operator.value === inputOperation);
|
|
111
|
+
if (!operator) {
|
|
112
|
+
return undefined;
|
|
113
|
+
}
|
|
114
|
+
return `${operator.label} for field "${field.label}"`;
|
|
115
|
+
}
|
|
116
|
+
getFieldOptions(currentFieldId = "") {
|
|
117
|
+
if (!this.batch) {
|
|
118
|
+
return [];
|
|
119
|
+
}
|
|
120
|
+
const existings = this.batch.operations.filter(operation => operation.field !== currentFieldId).map(operation => operation.field);
|
|
121
|
+
return this.fields.filter(field => !existings.includes(field.value));
|
|
122
|
+
}
|
|
123
|
+
validateBatch(data) {
|
|
124
|
+
this.formWasSubmitted = true;
|
|
125
|
+
const validation = Batch.validate(data);
|
|
126
|
+
if (!validation.success) {
|
|
127
|
+
this.invalidFields = validation.error.issues.reduce((acc, issue) => {
|
|
128
|
+
return {
|
|
129
|
+
...acc,
|
|
130
|
+
[issue.path.join(".")]: issue.message
|
|
131
|
+
};
|
|
132
|
+
}, {});
|
|
133
|
+
} else {
|
|
134
|
+
this.invalidFields = {};
|
|
135
|
+
}
|
|
136
|
+
return validation;
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
//# sourceMappingURL=BatchEditorDialogPresenter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["makeAutoObservable","Batch","BatchEditorDialogPresenter","invalidFields","formWasSubmitted","constructor","batch","undefined","fields","load","vm","operations","getOperations","canAddOperation","length","fieldOptions","data","addOperation","push","field","operator","value","deleteOperation","operationIndex","filter","_","index","setOperationFieldData","batchIndex","slice","setBatch","map","operation","validateBatch","onApply","onSuccess","onError","result","success","getFieldOptions","selectedField","find","operatorOptions","operators","title","getOperationTitle","open","canDelete","inputField","inputOperation","label","currentFieldId","existings","includes","validation","validate","error","issues","reduce","acc","issue","path","join","message"],"sources":["BatchEditorDialogPresenter.tsx"],"sourcesContent":["import { makeAutoObservable } from \"mobx\";\n\nimport type {\n BatchDTO,\n FieldDTO,\n OperationDTO,\n OperatorDTO\n} from \"~/components/BulkActions/ActionEdit/domain\";\nimport { Batch } from \"~/components/BulkActions/ActionEdit/domain\";\nimport type { FormInvalidFields } from \"@webiny/form\";\n\nexport interface IBatchEditorDialogPresenter {\n load(batch: BatchDTO, fields: FieldDTO[]): void;\n addOperation(): void;\n deleteOperation(operationIndex: number): void;\n setOperationFieldData(operationIndex: number, data: string): void;\n setBatch(data: any): void;\n onApply(onSuccess?: (batch: BatchDTO) => void, onError?: (batch: BatchDTO) => void): void;\n get vm(): BatchEditorDialogViewModel;\n}\n\nexport interface BatchEditorDialogViewModel {\n invalidFields: FormInvalidFields;\n canAddOperation: boolean;\n data: BatchEditorFormData;\n}\n\nexport interface BatchEditorFormData {\n operations: OperationFormData[];\n}\n\nexport type OperationFormData = OperationDTO & {\n canDelete: boolean;\n title: string;\n open: boolean;\n fieldOptions: FieldDTO[];\n operatorOptions: OperatorDTO[];\n selectedField?: FieldDTO;\n};\n\nexport class BatchEditorDialogPresenter implements IBatchEditorDialogPresenter {\n private batch: BatchDTO | undefined;\n private fields: FieldDTO[];\n private invalidFields: BatchEditorDialogViewModel[\"invalidFields\"] = {};\n private formWasSubmitted = false;\n\n constructor() {\n this.batch = undefined;\n this.fields = [];\n makeAutoObservable(this);\n }\n\n load(batch: BatchDTO, fields: FieldDTO[]) {\n this.batch = batch;\n this.fields = fields;\n }\n\n get vm() {\n const operations = this.getOperations();\n const canAddOperation = operations[operations.length - 1]?.fieldOptions.length > 1 ?? false;\n\n return {\n invalidFields: this.invalidFields,\n canAddOperation,\n data: {\n operations\n }\n };\n }\n\n addOperation(): void {\n if (!this.batch) {\n return;\n }\n\n this.batch.operations.push({\n field: \"\",\n operator: \"\",\n value: undefined\n });\n }\n\n deleteOperation(operationIndex: number): void {\n if (!this.batch) {\n return;\n }\n\n this.batch.operations = this.batch.operations.filter(\n (_, index) => index !== operationIndex\n );\n\n // Make sure we always have at least 1 operation!\n if (this.batch.operations.length === 0) {\n this.addOperation();\n }\n }\n\n setOperationFieldData(batchIndex: number, data: string) {\n if (!this.batch) {\n return;\n }\n\n this.batch.operations = [\n ...this.batch.operations.slice(0, batchIndex),\n {\n field: data,\n operator: \"\",\n value: undefined\n },\n ...this.batch.operations.slice(batchIndex + 1)\n ];\n }\n\n setBatch(data: BatchEditorFormData): void {\n if (!this.batch) {\n return;\n }\n\n this.batch = {\n ...this.batch,\n operations: data.operations.map(operation => ({\n field: operation.field,\n operator: operation.operator,\n value: operation.value\n }))\n };\n\n if (this.formWasSubmitted) {\n this.validateBatch(this.batch);\n }\n }\n\n onApply(\n onSuccess?: (batch: BatchDTO) => void,\n onError?: (\n batch: BatchDTO,\n invalidFields: BatchEditorDialogViewModel[\"invalidFields\"]\n ) => void\n ) {\n if (!this.batch) {\n return;\n }\n\n const result = this.validateBatch(this.batch);\n if (result.success) {\n onSuccess && onSuccess(this.batch);\n } else {\n onError && onError(this.batch, this.invalidFields);\n }\n }\n\n private getOperations = () => {\n return (\n this.batch?.operations.map((operation: OperationDTO, operationIndex) => {\n const fieldOptions = this.getFieldOptions(operation.field);\n const selectedField = fieldOptions.find(field => field.value === operation.field);\n const operatorOptions = selectedField?.operators || [];\n\n return {\n title:\n this.getOperationTitle(operation.field, operation.operator) ??\n `Operation #${operationIndex + 1}`,\n open: true,\n field: operation.field,\n operator: operation.operator,\n value: operation.value,\n canDelete: operationIndex !== 0,\n fieldOptions,\n selectedField,\n operatorOptions\n };\n }) || []\n );\n };\n\n private getOperationTitle(inputField?: string, inputOperation?: string) {\n if (!inputField || !inputOperation) {\n return undefined;\n }\n\n const field = this.fields.find(field => field.value === inputField);\n\n if (!field) {\n return undefined;\n }\n\n const operator = field.operators.find(operator => operator.value === inputOperation);\n\n if (!operator) {\n return undefined;\n }\n\n return `${operator.label} for field \"${field.label}\"`;\n }\n\n private getFieldOptions(currentFieldId = \"\") {\n if (!this.batch) {\n return [];\n }\n\n const existings = this.batch.operations\n .filter(operation => operation.field !== currentFieldId)\n .map(operation => operation.field);\n\n return this.fields.filter(field => !existings.includes(field.value));\n }\n\n private validateBatch(data: BatchDTO) {\n this.formWasSubmitted = true;\n const validation = Batch.validate(data);\n\n if (!validation.success) {\n this.invalidFields = validation.error.issues.reduce((acc, issue) => {\n return {\n ...acc,\n [issue.path.join(\".\")]: issue.message\n };\n }, {});\n } else {\n this.invalid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5D,aAAa,GAAG,CAAC,CAAC;IAC3B;IAEA,OAAOmD,UAAU;EACrB;AACJ","ignoreList":[]}
|
package/components/BulkActions/ActionEdit/BatchEditorDialog/BatchEditorDialogPresenter.test.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|