@webiny/app-headless-cms 5.41.4-beta.6 → 5.42.0-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/ContentEntryEditorConfig.d.ts +31 -12
- package/ContentEntryEditorConfig.js +3 -1
- package/ContentEntryEditorConfig.js.map +1 -1
- package/admin/components/ContentEntries/BulkActions/ActionDelete.js.map +1 -1
- package/admin/components/ContentEntries/BulkActions/ActionMove.js.map +1 -1
- package/admin/components/ContentEntries/BulkActions/ActionPublish.js.map +1 -1
- package/admin/components/ContentEntries/BulkActions/ActionUnpublish.js.map +1 -1
- package/admin/components/ContentEntries/BulkActions/BulkActions.js.map +1 -1
- package/admin/components/ContentEntries/BulkActions/BulkActions.styled.js +7 -7
- package/admin/components/ContentEntries/BulkActions/BulkActions.styled.js.map +1 -1
- package/admin/components/ContentEntries/Filters/FieldsMapper.js.map +1 -1
- package/admin/components/ContentEntries/Filters/FilterByStatus.js.map +1 -1
- package/admin/components/ContentEntries/Filters/RefFieldRenderer/adapters/EntriesGraphQLGateway.js.map +1 -1
- package/admin/components/ContentEntries/Filters/RefFieldRenderer/components/AutoComplete.js.map +1 -1
- package/admin/components/ContentEntries/Filters/RefFieldRenderer/components/RefPresenter.js.map +1 -1
- package/admin/components/ContentEntries/Filters/RefFieldRenderer/domain/Entry.js.map +1 -1
- package/admin/components/ContentEntries/Filters/RefFieldRenderer/domain/EntryMapper.js.map +1 -1
- package/admin/components/ContentEntries/Filters/RefFieldRenderer/domain/EntryRepository.js.map +1 -1
- package/admin/components/ContentEntries/Filters/RefFieldRenderer/domain/EntryRepositoryFactory.js.map +1 -1
- package/admin/components/ContentEntries/Filters/RefFieldRenderer/domain/Loading.js.map +1 -1
- package/admin/components/ContentEntries/Table/Actions/ChangeEntryStatus.js.map +1 -1
- package/admin/components/ContentEntries/Table/Cells/CellName.js.map +1 -1
- package/admin/components/ContentEntries/TrashBin/adapters/TrashBinBulkActionsGraphQLGateway.js.map +1 -1
- package/admin/components/ContentEntries/TrashBin/adapters/TrashBinDeleteItemGraphQLGateway.js.map +1 -1
- package/admin/components/ContentEntries/TrashBin/adapters/TrashBinItemMapper.js.map +1 -1
- package/admin/components/ContentEntries/TrashBin/adapters/TrashBinListGraphQLGateway.js.map +1 -1
- package/admin/components/ContentEntries/TrashBin/adapters/TrashBinRestoreItemGraphQLGateway.js.map +1 -1
- package/admin/components/ContentEntries/TrashBin/adapters/TrashBinRestoreItemGraphQLGatewayWithCallback.js.map +1 -1
- package/admin/components/ContentEntries/TrashBin/components/TrashBin.js.map +1 -1
- package/admin/components/ContentEntryForm/ContentEntryForm.d.ts +9 -7
- package/admin/components/ContentEntryForm/ContentEntryForm.js +13 -5
- package/admin/components/ContentEntryForm/ContentEntryForm.js.map +1 -1
- package/admin/components/ContentEntryForm/ContentEntryFormPreview.js.map +1 -1
- package/admin/components/ContentEntryForm/ContentEntryFormProvider.d.ts +5 -4
- package/admin/components/ContentEntryForm/ContentEntryFormProvider.js +3 -1
- package/admin/components/ContentEntryForm/ContentEntryFormProvider.js.map +1 -1
- package/admin/components/ContentEntryForm/DefaultLayout.d.ts +7 -7
- package/admin/components/ContentEntryForm/DefaultLayout.js +6 -3
- package/admin/components/ContentEntryForm/DefaultLayout.js.map +1 -1
- package/admin/components/ContentEntryForm/Header/Header.d.ts +19 -1
- package/admin/components/ContentEntryForm/Header/Header.js +7 -5
- package/admin/components/ContentEntryForm/Header/Header.js.map +1 -1
- package/admin/components/ContentEntryForm/Header/RevisionSelector/RevisionSelector.js.map +1 -1
- package/admin/components/ContentEntryForm/Header/RevisionSelector/RevisionSelector.styles.d.ts +2 -34
- package/admin/components/ContentEntryForm/Header/SaveContent/SaveContent.js.map +1 -1
- package/admin/components/ContentEntryForm/Header/ShowRevisionsList/ShowRevisionList.d.ts +2 -0
- package/admin/components/ContentEntryForm/Header/ShowRevisionsList/ShowRevisionList.js +28 -0
- package/admin/components/ContentEntryForm/Header/ShowRevisionsList/ShowRevisionList.js.map +1 -0
- package/admin/components/ContentEntryForm/Header/ShowRevisionsList/index.d.ts +1 -0
- package/admin/components/ContentEntryForm/Header/ShowRevisionsList/index.js +18 -0
- package/admin/components/ContentEntryForm/Header/ShowRevisionsList/index.js.map +1 -0
- package/admin/components/ContentModelEditor/ContentModelEditor.js +9 -4
- package/admin/components/ContentModelEditor/ContentModelEditor.js.map +1 -1
- package/admin/components/ContentModelEditor/ModelIsBeingDeletedError/ModelIsBeingDeletedError.d.ts +10 -0
- package/admin/components/ContentModelEditor/ModelIsBeingDeletedError/ModelIsBeingDeletedError.js +79 -0
- package/admin/components/ContentModelEditor/ModelIsBeingDeletedError/ModelIsBeingDeletedError.js.map +1 -0
- package/admin/components/ContentModelEditor/ModelIsBeingDeletedError/SecureRouteError.svg +1 -0
- package/admin/components/ContentModelEditor/ModelIsBeingDeletedError/index.d.ts +1 -0
- package/admin/components/ContentModelEditor/ModelIsBeingDeletedError/index.js +14 -0
- package/admin/components/ContentModelEditor/ModelIsBeingDeletedError/index.js.map +1 -0
- package/admin/components/Decorators/ShowConfirmationOnDelete.js.map +1 -1
- package/admin/components/Decorators/ShowConfirmationOnDeleteRevision.js +1 -1
- package/admin/components/Decorators/ShowConfirmationOnDeleteRevision.js.map +1 -1
- package/admin/components/Decorators/ShowConfirmationOnPublish.js.map +1 -1
- package/admin/components/Decorators/ShowConfirmationOnUnpublish.js.map +1 -1
- package/admin/components/DragPreview.js.map +1 -1
- package/admin/components/Draggable.js.map +1 -1
- package/admin/components/Droppable.js.map +1 -1
- package/admin/components/FieldEditor/EditFieldDialog/GeneralTab.js.map +1 -1
- package/admin/components/FieldEditor/EditFieldDialog/PredefinedValues.js.map +1 -1
- package/admin/components/FieldEditor/EditFieldDialog/ValidatorsList.js +4 -4
- package/admin/components/FieldEditor/EditFieldDialog/ValidatorsList.js.map +1 -1
- package/admin/components/FieldEditor/Field.js.map +1 -1
- package/admin/components/FieldEditor/FieldEditor.js.map +1 -1
- package/admin/components/IconPicker.js +5 -9
- package/admin/components/IconPicker.js.map +1 -1
- package/admin/components/LexicalCmsEditor/TypographyDropDown.js.map +1 -1
- package/admin/config/contentEntries/list/Browser/BulkAction.js.map +1 -1
- package/admin/contexts/Cms/index.js.map +1 -1
- package/admin/elements/NothingToShowElement.js.map +1 -1
- package/admin/graphql/contentModels.js +1 -1
- package/admin/graphql/contentModels.js.map +1 -1
- package/admin/hooks/useContentModels.d.ts +2 -2
- package/admin/hooks/useContentModels.js +6 -1
- package/admin/hooks/useContentModels.js.map +1 -1
- package/admin/plugins/apiInformation/index.js.map +1 -1
- package/admin/plugins/definitions/CmsEditorFieldValidatorFileTypePlugin.js.map +1 -1
- package/admin/plugins/definitions/CmsFieldValidatorFileTypePlugin.js.map +1 -1
- package/admin/plugins/editor/defaultBar/BackButton.js.map +1 -1
- package/admin/plugins/editor/defaultBar/CreateContentButton.js.map +1 -1
- package/admin/plugins/editor/defaultBar/FormSettings/FormSettings.js.map +1 -1
- package/admin/plugins/editor/defaultBar/Name/Name.js.map +1 -1
- package/admin/plugins/editor/defaultBar/SaveContentModelButton.js.map +1 -1
- package/admin/plugins/editor/defaultBar/index.js.map +1 -1
- package/admin/plugins/editor/formSettings/index.js.map +1 -1
- package/admin/plugins/fieldRenderers/DynamicSection.js +47 -51
- package/admin/plugins/fieldRenderers/DynamicSection.js.map +1 -1
- package/admin/plugins/fieldRenderers/boolean/booleanSwitch.js.map +1 -1
- package/admin/plugins/fieldRenderers/checkboxes.js.map +1 -1
- package/admin/plugins/fieldRenderers/dateTime/DateOnly.js.map +1 -1
- package/admin/plugins/fieldRenderers/dateTime/DateTimeWithTimezone.js.map +1 -1
- package/admin/plugins/fieldRenderers/dateTime/DateTimeWithoutTimezone.js.map +1 -1
- package/admin/plugins/fieldRenderers/dateTime/Input.js.map +1 -1
- package/admin/plugins/fieldRenderers/dateTime/Time.js.map +1 -1
- package/admin/plugins/fieldRenderers/dateTime/dateTimeField.js.map +1 -1
- package/admin/plugins/fieldRenderers/dateTime/dateTimeFields.js.map +1 -1
- package/admin/plugins/fieldRenderers/dynamicZone/MultiValueDynamicZone.js.map +1 -1
- package/admin/plugins/fieldRenderers/dynamicZone/TemplateItem.js.map +1 -1
- package/admin/plugins/fieldRenderers/dynamicZone/dynamicZoneRenderer.js.map +1 -1
- package/admin/plugins/fieldRenderers/hidden.js.map +1 -1
- package/admin/plugins/fieldRenderers/lexicalText/lexicalTextInput.js +1 -0
- package/admin/plugins/fieldRenderers/lexicalText/lexicalTextInput.js.map +1 -1
- package/admin/plugins/fieldRenderers/lexicalText/lexicalTextInputs.js +1 -0
- package/admin/plugins/fieldRenderers/lexicalText/lexicalTextInputs.js.map +1 -1
- package/admin/plugins/fieldRenderers/longText/longText.js.map +1 -1
- package/admin/plugins/fieldRenderers/longText/longTexts.js.map +1 -1
- package/admin/plugins/fieldRenderers/number/numberInput.js.map +1 -1
- package/admin/plugins/fieldRenderers/number/numberInputs.js.map +1 -1
- package/admin/plugins/fieldRenderers/object/FieldSettings.js.map +1 -1
- package/admin/plugins/fieldRenderers/object/multipleObjects.js.map +1 -1
- package/admin/plugins/fieldRenderers/object/multipleObjectsAccordion.js.map +1 -1
- package/admin/plugins/fieldRenderers/object/singleObjectAccordion.js.map +1 -1
- package/admin/plugins/fieldRenderers/object/singleObjectInline.js.map +1 -1
- package/admin/plugins/fieldRenderers/radioButtons.js.map +1 -1
- package/admin/plugins/fieldRenderers/ref/advanced/components/AdvancedMultipleReferenceField.js +8 -7
- package/admin/plugins/fieldRenderers/ref/advanced/components/AdvancedMultipleReferenceField.js.map +1 -1
- package/admin/plugins/fieldRenderers/ref/advanced/detailedReferenceRenderer.js.map +1 -1
- package/admin/plugins/fieldRenderers/ref/advanced/detailedReferencesRenderer.js.map +1 -1
- package/admin/plugins/fieldRenderers/ref/advanced/hooks/useReferences.js +5 -5
- package/admin/plugins/fieldRenderers/ref/advanced/hooks/useReferences.js.map +1 -1
- package/admin/plugins/fieldRenderers/ref/components/ContentEntriesAutocomplete.js.map +1 -1
- package/admin/plugins/fieldRenderers/ref/components/ContentEntriesMultiAutoComplete.js.map +1 -1
- package/admin/plugins/fieldRenderers/ref/components/NewReferencedEntryDialog.js.map +1 -1
- package/admin/plugins/fieldRenderers/ref/refInput.js.map +1 -1
- package/admin/plugins/fieldRenderers/ref/refInputs.js.map +1 -1
- package/admin/plugins/fieldRenderers/ref/simple/components/useReferences.js +3 -3
- package/admin/plugins/fieldRenderers/ref/simple/components/useReferences.js.map +1 -1
- package/admin/plugins/fieldRenderers/ref/simple/simpleMultipleRenderer.js.map +1 -1
- package/admin/plugins/fieldRenderers/ref/simple/simpleSingleRenderer.js.map +1 -1
- package/admin/plugins/fieldRenderers/richText/richTextInput.js +1 -0
- package/admin/plugins/fieldRenderers/richText/richTextInput.js.map +1 -1
- package/admin/plugins/fieldRenderers/richText/richTextInputs.js +1 -0
- package/admin/plugins/fieldRenderers/richText/richTextInputs.js.map +1 -1
- package/admin/plugins/fieldRenderers/select.js.map +1 -1
- package/admin/plugins/fieldRenderers/text/tags.js.map +1 -1
- package/admin/plugins/fieldRenderers/text/textInput.js.map +1 -1
- package/admin/plugins/fieldRenderers/text/textInputs.js.map +1 -1
- package/admin/plugins/fieldValidators/dateGte.js.map +1 -1
- package/admin/plugins/fieldValidators/dateLte.js.map +1 -1
- package/admin/plugins/fieldValidators/dynamicZone.js.map +1 -1
- package/admin/plugins/fieldValidators/gte.js.map +1 -1
- package/admin/plugins/fieldValidators/in.js.map +1 -1
- package/admin/plugins/fieldValidators/lte.js.map +1 -1
- package/admin/plugins/fieldValidators/maxLength.js.map +1 -1
- package/admin/plugins/fieldValidators/minLength.js.map +1 -1
- package/admin/plugins/fieldValidators/pattern.js.map +1 -1
- package/admin/plugins/fieldValidators/required.js.map +1 -1
- package/admin/plugins/fieldValidators/unique.js.map +1 -1
- package/admin/plugins/fields/PredefinedValuesDynamicFieldset.js.map +1 -1
- package/admin/plugins/fields/boolean.js.map +1 -1
- package/admin/plugins/fields/dateTime.js.map +1 -1
- package/admin/plugins/fields/dynamicZone.js.map +1 -1
- package/admin/plugins/fields/longText.js.map +1 -1
- package/admin/plugins/fields/number.js.map +1 -1
- package/admin/plugins/fields/object.js.map +1 -1
- package/admin/plugins/fields/ref.js +4 -2
- package/admin/plugins/fields/ref.js.map +1 -1
- package/admin/plugins/fields/richText.js.map +1 -1
- package/admin/plugins/fields/text.js.map +1 -1
- package/admin/plugins/icons.js.map +1 -1
- package/admin/plugins/install.js.map +1 -1
- package/admin/plugins/permissionRenderer/components/ContentEntryPermission.js.map +1 -1
- package/admin/plugins/permissionRenderer/index.js.map +1 -1
- package/admin/plugins/routes.js +3 -3
- package/admin/plugins/routes.js.map +1 -1
- package/admin/plugins/transformers/dateTransformer.js.map +1 -1
- package/admin/plugins/transformers/dynamicZoneTransformer.js.map +1 -1
- package/admin/plugins/transformers/numberTransformer.js.map +1 -1
- package/admin/plugins/transformers/objectTransformer.js.map +1 -1
- package/admin/views/contentEntries/ContentEntries.js +6 -0
- package/admin/views/contentEntries/ContentEntries.js.map +1 -1
- package/admin/views/contentEntries/ContentEntriesContainer.js.map +1 -1
- package/admin/views/contentEntries/ContentEntriesModule.js +8 -1
- package/admin/views/contentEntries/ContentEntriesModule.js.map +1 -1
- package/admin/views/contentEntries/ContentEntry/ContentEntryContext.js.map +1 -1
- package/admin/views/contentEntries/ContentEntry/FullScreenContentEntry/FullScreenContentEntry.d.ts +2 -0
- package/admin/views/contentEntries/ContentEntry/FullScreenContentEntry/FullScreenContentEntry.js +68 -0
- package/admin/views/contentEntries/ContentEntry/FullScreenContentEntry/FullScreenContentEntry.js.map +1 -0
- package/admin/views/contentEntries/ContentEntry/FullScreenContentEntry/FullScreenContentEntry.styled.d.ts +56 -0
- package/admin/views/contentEntries/ContentEntry/FullScreenContentEntry/FullScreenContentEntry.styled.js +171 -0
- package/admin/views/contentEntries/ContentEntry/FullScreenContentEntry/FullScreenContentEntry.styled.js.map +1 -0
- package/admin/views/contentEntries/ContentEntry/FullScreenContentEntry/FullScreenContentEntryHeaderLeft.d.ts +2 -0
- package/admin/views/contentEntries/ContentEntry/FullScreenContentEntry/FullScreenContentEntryHeaderLeft.js +38 -0
- package/admin/views/contentEntries/ContentEntry/FullScreenContentEntry/FullScreenContentEntryHeaderLeft.js.map +1 -0
- package/admin/views/contentEntries/ContentEntry/FullScreenContentEntry/RevisionListDrawer/Header.d.ts +6 -0
- package/admin/views/contentEntries/ContentEntry/FullScreenContentEntry/RevisionListDrawer/Header.js +22 -0
- package/admin/views/contentEntries/ContentEntry/FullScreenContentEntry/RevisionListDrawer/Header.js.map +1 -0
- package/admin/views/contentEntries/ContentEntry/FullScreenContentEntry/RevisionListDrawer/RevisionListDrawer.d.ts +2 -0
- package/admin/views/contentEntries/ContentEntry/FullScreenContentEntry/RevisionListDrawer/RevisionListDrawer.js +48 -0
- package/admin/views/contentEntries/ContentEntry/FullScreenContentEntry/RevisionListDrawer/RevisionListDrawer.js.map +1 -0
- package/admin/views/contentEntries/ContentEntry/FullScreenContentEntry/RevisionListDrawer/RevisionListDrawer.styled.d.ts +11 -0
- package/admin/views/contentEntries/ContentEntry/FullScreenContentEntry/RevisionListDrawer/RevisionListDrawer.styled.js +41 -0
- package/admin/views/contentEntries/ContentEntry/FullScreenContentEntry/RevisionListDrawer/RevisionListDrawer.styled.js.map +1 -0
- package/admin/views/contentEntries/ContentEntry/FullScreenContentEntry/RevisionListDrawer/index.d.ts +1 -0
- package/admin/views/contentEntries/ContentEntry/FullScreenContentEntry/RevisionListDrawer/index.js +18 -0
- package/admin/views/contentEntries/ContentEntry/FullScreenContentEntry/RevisionListDrawer/index.js.map +1 -0
- package/admin/views/contentEntries/ContentEntry/FullScreenContentEntry/index.d.ts +1 -0
- package/admin/views/contentEntries/ContentEntry/FullScreenContentEntry/index.js +18 -0
- package/admin/views/contentEntries/ContentEntry/FullScreenContentEntry/index.js.map +1 -0
- package/admin/views/contentEntries/ContentEntry/FullScreenContentEntry/useFullScreenContentEntry.d.ts +12 -0
- package/admin/views/contentEntries/ContentEntry/FullScreenContentEntry/useFullScreenContentEntry.js +14 -0
- package/admin/views/contentEntries/ContentEntry/FullScreenContentEntry/useFullScreenContentEntry.js.map +1 -0
- package/admin/views/contentEntries/ContentEntry/RevisionsList/RevisionListDrawer.d.ts +0 -0
- package/admin/views/contentEntries/ContentEntry/RevisionsList/RevisionListDrawer.js +3 -0
- package/admin/views/contentEntries/ContentEntry/RevisionsList/RevisionListDrawer.js.map +1 -0
- package/admin/views/contentEntries/ContentEntry/RevisionsList/RevisionListItem.js.map +1 -1
- package/admin/views/contentEntries/ContentEntry/RevisionsList/useRevision.js +2 -2
- package/admin/views/contentEntries/ContentEntry/RevisionsList/useRevision.js.map +1 -1
- package/admin/views/contentEntries/ContentEntry/SingletonContentEntry.js.map +1 -1
- package/admin/views/contentEntries/ContentEntry.js +3 -2
- package/admin/views/contentEntries/ContentEntry.js.map +1 -1
- package/admin/views/contentEntries/Table/Main.js.map +1 -1
- package/admin/views/contentEntries/Table/Sidebar.js.map +1 -1
- package/admin/views/contentEntries/hooks/useMoveContentEntryToFolder.js.map +1 -1
- package/admin/views/contentModelGroups/ContentModelGroupsDataList.js.map +1 -1
- package/admin/views/contentModelGroups/ContentModelGroupsForm.js.map +1 -1
- package/admin/views/contentModels/CloneContentModelDialog.js.map +1 -1
- package/admin/views/contentModels/ContentModelEditor.js +2 -3
- package/admin/views/contentModels/ContentModelEditor.js.map +1 -1
- package/admin/views/contentModels/ContentModelsDataList.d.ts +4 -1
- package/admin/views/contentModels/ContentModelsDataList.js +45 -80
- package/admin/views/contentModels/ContentModelsDataList.js.map +1 -1
- package/admin/views/contentModels/NewContentModelDialog.js.map +1 -1
- package/admin/views/contentModels/cache.d.ts +12 -1
- package/admin/views/contentModels/cache.js +58 -1
- package/admin/views/contentModels/cache.js.map +1 -1
- package/admin/views/contentModels/fullDelete/FullyDeleteModelDialog.d.ts +11 -0
- package/admin/views/contentModels/fullDelete/FullyDeleteModelDialog.js +107 -0
- package/admin/views/contentModels/fullDelete/FullyDeleteModelDialog.js.map +1 -0
- package/admin/views/contentModels/fullDelete/ModelIsBeingDeleted.d.ts +6 -0
- package/admin/views/contentModels/fullDelete/ModelIsBeingDeleted.js +81 -0
- package/admin/views/contentModels/fullDelete/ModelIsBeingDeleted.js.map +1 -0
- package/admin/views/contentModels/fullDelete/dialog/Confirmation.d.ts +9 -0
- package/admin/views/contentModels/fullDelete/dialog/Confirmation.js +44 -0
- package/admin/views/contentModels/fullDelete/dialog/Confirmation.js.map +1 -0
- package/admin/views/contentModels/fullDelete/dialog/Content.d.ts +11 -0
- package/admin/views/contentModels/fullDelete/dialog/Content.js +41 -0
- package/admin/views/contentModels/fullDelete/dialog/Content.js.map +1 -0
- package/admin/views/contentModels/fullDelete/dialog/Information.d.ts +6 -0
- package/admin/views/contentModels/fullDelete/dialog/Information.js +20 -0
- package/admin/views/contentModels/fullDelete/dialog/Information.js.map +1 -0
- package/admin/views/contentModels/fullDelete/dialog/Processed.d.ts +6 -0
- package/admin/views/contentModels/fullDelete/dialog/Processed.js +20 -0
- package/admin/views/contentModels/fullDelete/dialog/Processed.js.map +1 -0
- package/admin/views/contentModels/fullDelete/dialog/process.d.ts +23 -0
- package/admin/views/contentModels/fullDelete/dialog/process.js +64 -0
- package/admin/views/contentModels/fullDelete/dialog/process.js.map +1 -0
- package/admin/views/contentModels/fullDelete/dialog/state.d.ts +18 -0
- package/admin/views/contentModels/fullDelete/dialog/state.js +104 -0
- package/admin/views/contentModels/fullDelete/dialog/state.js.map +1 -0
- package/admin/views/contentModels/fullDelete/dialog/validationValue.d.ts +2 -0
- package/admin/views/contentModels/fullDelete/dialog/validationValue.js +11 -0
- package/admin/views/contentModels/fullDelete/dialog/validationValue.js.map +1 -0
- package/admin/views/contentModels/fullDelete/types.d.ts +16 -0
- package/admin/views/contentModels/fullDelete/types.js +16 -0
- package/admin/views/contentModels/fullDelete/types.js.map +1 -0
- package/admin/views/contentModels/fullDelete/useCancelDelete.d.ts +7 -0
- package/admin/views/contentModels/fullDelete/useCancelDelete.js +62 -0
- package/admin/views/contentModels/fullDelete/useCancelDelete.js.map +1 -0
- package/admin/views/contentModels/importing/ImportContext.js +3 -3
- package/admin/views/contentModels/importing/ImportContext.js.map +1 -1
- package/admin/views/contentModels/importing/components/FileUpload.js.map +1 -1
- package/admin/viewsGraphql.d.ts +33 -0
- package/admin/viewsGraphql.js +16 -5
- package/admin/viewsGraphql.js.map +1 -1
- package/package.json +33 -39
- package/utils/CmsModelFieldValidatorConfigAdapter.js.map +1 -1
- package/utils/cmsLegacyEntryEditor.d.ts +1 -0
- package/utils/cmsLegacyEntryEditor.js +10 -0
- package/utils/cmsLegacyEntryEditor.js.map +1 -0
|
@@ -80,40 +80,40 @@ export declare const ContentEntryEditorConfig: (({ priority, children }: import(
|
|
|
80
80
|
} & {
|
|
81
81
|
createDecorator: (decorator: import("@webiny/react-composition").Decorator<() => import("./admin/views/contentEntries/ContentEntry/ContentEntryContext").ContentEntryContext>) => () => import("react").JSX.Element;
|
|
82
82
|
};
|
|
83
|
-
DefaultLayout: (({ model }: import("./admin/components/ContentEntryForm/DefaultLayout").DefaultLayoutProps) => import("react").JSX.Element) & {
|
|
84
|
-
original: ({ model }: import("./admin/components/ContentEntryForm/DefaultLayout").DefaultLayoutProps) => import("react").JSX.Element;
|
|
83
|
+
DefaultLayout: (({ model, ...props }: import("./admin/components/ContentEntryForm/DefaultLayout").DefaultLayoutProps) => import("react").JSX.Element) & {
|
|
84
|
+
original: ({ model, ...props }: import("./admin/components/ContentEntryForm/DefaultLayout").DefaultLayoutProps) => import("react").JSX.Element;
|
|
85
85
|
originalName: string;
|
|
86
86
|
displayName: string;
|
|
87
87
|
} & {
|
|
88
|
-
original: (({ model }: import("./admin/components/ContentEntryForm/DefaultLayout").DefaultLayoutProps) => import("react").JSX.Element) & {
|
|
89
|
-
original: ({ model }: import("./admin/components/ContentEntryForm/DefaultLayout").DefaultLayoutProps) => import("react").JSX.Element;
|
|
88
|
+
original: (({ model, ...props }: import("./admin/components/ContentEntryForm/DefaultLayout").DefaultLayoutProps) => import("react").JSX.Element) & {
|
|
89
|
+
original: ({ model, ...props }: import("./admin/components/ContentEntryForm/DefaultLayout").DefaultLayoutProps) => import("react").JSX.Element;
|
|
90
90
|
originalName: string;
|
|
91
91
|
displayName: string;
|
|
92
92
|
};
|
|
93
93
|
originalName: string;
|
|
94
94
|
displayName: string;
|
|
95
95
|
} & {
|
|
96
|
-
createDecorator: (decorator: import("@webiny/react-composition").ComponentDecorator<(({ model }: import("./admin/components/ContentEntryForm/DefaultLayout").DefaultLayoutProps) => import("react").JSX.Element) & {
|
|
97
|
-
original: ({ model }: import("./admin/components/ContentEntryForm/DefaultLayout").DefaultLayoutProps) => import("react").JSX.Element;
|
|
96
|
+
createDecorator: (decorator: import("@webiny/react-composition").ComponentDecorator<(({ model, ...props }: import("./admin/components/ContentEntryForm/DefaultLayout").DefaultLayoutProps) => import("react").JSX.Element) & {
|
|
97
|
+
original: ({ model, ...props }: import("./admin/components/ContentEntryForm/DefaultLayout").DefaultLayoutProps) => import("react").JSX.Element;
|
|
98
98
|
originalName: string;
|
|
99
99
|
displayName: string;
|
|
100
100
|
}>) => (props: unknown) => import("react").JSX.Element;
|
|
101
101
|
};
|
|
102
|
-
ContentEntryForm: (({ entry, persistEntry, onAfterCreate, setSaveEntry, header }: import("./admin/components/ContentEntryForm/ContentEntryForm").ContentEntryFormProps) => import("react").JSX.Element) & {
|
|
103
|
-
original: ({ entry, persistEntry, onAfterCreate, setSaveEntry, header }: import("./admin/components/ContentEntryForm/ContentEntryForm").ContentEntryFormProps) => import("react").JSX.Element;
|
|
102
|
+
ContentEntryForm: (({ entry, persistEntry, onChange, onAfterCreate, setSaveEntry, header, ...props }: import("./admin/components/ContentEntryForm/ContentEntryForm").ContentEntryFormProps) => import("react").JSX.Element) & {
|
|
103
|
+
original: ({ entry, persistEntry, onChange, onAfterCreate, setSaveEntry, header, ...props }: import("./admin/components/ContentEntryForm/ContentEntryForm").ContentEntryFormProps) => import("react").JSX.Element;
|
|
104
104
|
originalName: string;
|
|
105
105
|
displayName: string;
|
|
106
106
|
} & {
|
|
107
|
-
original: (({ entry, persistEntry, onAfterCreate, setSaveEntry, header }: import("./admin/components/ContentEntryForm/ContentEntryForm").ContentEntryFormProps) => import("react").JSX.Element) & {
|
|
108
|
-
original: ({ entry, persistEntry, onAfterCreate, setSaveEntry, header }: import("./admin/components/ContentEntryForm/ContentEntryForm").ContentEntryFormProps) => import("react").JSX.Element;
|
|
107
|
+
original: (({ entry, persistEntry, onChange, onAfterCreate, setSaveEntry, header, ...props }: import("./admin/components/ContentEntryForm/ContentEntryForm").ContentEntryFormProps) => import("react").JSX.Element) & {
|
|
108
|
+
original: ({ entry, persistEntry, onChange, onAfterCreate, setSaveEntry, header, ...props }: import("./admin/components/ContentEntryForm/ContentEntryForm").ContentEntryFormProps) => import("react").JSX.Element;
|
|
109
109
|
originalName: string;
|
|
110
110
|
displayName: string;
|
|
111
111
|
};
|
|
112
112
|
originalName: string;
|
|
113
113
|
displayName: string;
|
|
114
114
|
} & {
|
|
115
|
-
createDecorator: (decorator: import("@webiny/react-composition").ComponentDecorator<(({ entry, persistEntry, onAfterCreate, setSaveEntry, header }: import("./admin/components/ContentEntryForm/ContentEntryForm").ContentEntryFormProps) => import("react").JSX.Element) & {
|
|
116
|
-
original: ({ entry, persistEntry, onAfterCreate, setSaveEntry, header }: import("./admin/components/ContentEntryForm/ContentEntryForm").ContentEntryFormProps) => import("react").JSX.Element;
|
|
115
|
+
createDecorator: (decorator: import("@webiny/react-composition").ComponentDecorator<(({ entry, persistEntry, onChange, onAfterCreate, setSaveEntry, header, ...props }: import("./admin/components/ContentEntryForm/ContentEntryForm").ContentEntryFormProps) => import("react").JSX.Element) & {
|
|
116
|
+
original: ({ entry, persistEntry, onChange, onAfterCreate, setSaveEntry, header, ...props }: import("./admin/components/ContentEntryForm/ContentEntryForm").ContentEntryFormProps) => import("react").JSX.Element;
|
|
117
117
|
originalName: string;
|
|
118
118
|
displayName: string;
|
|
119
119
|
}>) => (props: unknown) => import("react").JSX.Element;
|
|
@@ -124,6 +124,25 @@ export declare const ContentEntryEditorConfig: (({ priority, children }: import(
|
|
|
124
124
|
} & {
|
|
125
125
|
createDecorator: (decorator: import("@webiny/react-composition").Decorator<() => import("./admin/components/ContentEntryForm/ContentEntryFormProvider").ContentEntryFormContext>) => () => import("react").JSX.Element;
|
|
126
126
|
};
|
|
127
|
+
Header: (() => import("react").JSX.Element) & {
|
|
128
|
+
original: () => import("react").JSX.Element;
|
|
129
|
+
originalName: string;
|
|
130
|
+
displayName: string;
|
|
131
|
+
} & {
|
|
132
|
+
original: (() => import("react").JSX.Element) & {
|
|
133
|
+
original: () => import("react").JSX.Element;
|
|
134
|
+
originalName: string;
|
|
135
|
+
displayName: string;
|
|
136
|
+
};
|
|
137
|
+
originalName: string;
|
|
138
|
+
displayName: string;
|
|
139
|
+
} & {
|
|
140
|
+
createDecorator: (decorator: import("@webiny/react-composition").ComponentDecorator<(() => import("react").JSX.Element) & {
|
|
141
|
+
original: () => import("react").JSX.Element;
|
|
142
|
+
originalName: string;
|
|
143
|
+
displayName: string;
|
|
144
|
+
}>) => (props: unknown) => import("react").JSX.Element;
|
|
145
|
+
};
|
|
127
146
|
};
|
|
128
147
|
ContentEntryFormPreview: ((props: import("./admin/components/ContentEntryForm/ContentEntryFormPreview").ContentEntryFormPreviewProps) => import("react").JSX.Element) & {
|
|
129
148
|
original: (props: import("./admin/components/ContentEntryForm/ContentEntryFormPreview").ContentEntryFormPreviewProps) => import("react").JSX.Element;
|
|
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.ContentEntryEditorConfig = void 0;
|
|
7
7
|
var _dynamicZone = require("./admin/plugins/fieldRenderers/dynamicZone");
|
|
8
8
|
var _ContentEntryForm = require("./admin/components/ContentEntryForm/ContentEntryForm");
|
|
9
|
+
var _Header = require("./admin/components/ContentEntryForm/Header");
|
|
9
10
|
var _ContentEntryFormPreview = require("./admin/components/ContentEntryForm/ContentEntryFormPreview");
|
|
10
11
|
var _useContentEntryForm = require("./admin/components/ContentEntryForm/useContentEntryForm");
|
|
11
12
|
var _DefaultLayout = require("./admin/components/ContentEntryForm/DefaultLayout");
|
|
@@ -19,7 +20,8 @@ var ContentEntryEditorConfig = exports.ContentEntryEditorConfig = Object.assign(
|
|
|
19
20
|
useContentEntry: _hooks.useContentEntry,
|
|
20
21
|
DefaultLayout: _DefaultLayout.DefaultLayout,
|
|
21
22
|
ContentEntryForm: Object.assign(_ContentEntryForm.ContentEntryForm, {
|
|
22
|
-
useContentEntryForm: _useContentEntryForm.useContentEntryForm
|
|
23
|
+
useContentEntryForm: _useContentEntryForm.useContentEntryForm,
|
|
24
|
+
Header: _Header.Header
|
|
23
25
|
}),
|
|
24
26
|
ContentEntryFormPreview: _ContentEntryFormPreview.ContentEntryFormPreview
|
|
25
27
|
}),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_dynamicZone","require","_ContentEntryForm","_ContentEntryFormPreview","_useContentEntryForm","_DefaultLayout","_hooks","_ContentEntry","_contentEntries","_SingletonContentEntry","_useSingletonContentEntry","ContentEntryEditorConfig","exports","Object","assign","BaseContentEntryEditorConfig","ContentEntry","useContentEntry","DefaultLayout","ContentEntryForm","BaseContentEntryForm","useContentEntryForm","ContentEntryFormPreview","SingletonContentEntry","useSingletonContentEntry","FieldRenderers","DynamicZone","Template","useTemplate","Container","DynamicZoneContainer","MultiValue","MultiValueContainer","ItemContainer","MultiValueItemContainer","Item","MultiValueItem","TemplateGallery"],"sources":["ContentEntryEditorConfig.ts"],"sourcesContent":["import {\n DynamicZoneContainer,\n MultiValueContainer,\n MultiValueItemContainer,\n MultiValueItem,\n TemplateGallery,\n useTemplate\n} from \"~/admin/plugins/fieldRenderers/dynamicZone\";\nimport { ContentEntryForm as BaseContentEntryForm } from \"./admin/components/ContentEntryForm/ContentEntryForm\";\nimport { ContentEntryFormPreview } from \"./admin/components/ContentEntryForm/ContentEntryFormPreview\";\nimport { useContentEntryForm } from \"./admin/components/ContentEntryForm/useContentEntryForm\";\nimport { DefaultLayout } from \"~/admin/components/ContentEntryForm/DefaultLayout\";\nimport { useContentEntry } from \"~/admin/views/contentEntries/hooks\";\nimport { ContentEntry } from \"~/admin/views/contentEntries/ContentEntry\";\nimport { ContentEntryEditorConfig as BaseContentEntryEditorConfig } from \"./admin/config/contentEntries\";\nimport { SingletonContentEntry } from \"~/admin/views/contentEntries/ContentEntry/SingletonContentEntry\";\nimport { useSingletonContentEntry } from \"~/admin/views/contentEntries/hooks/useSingletonContentEntry\";\n\nexport const ContentEntryEditorConfig = Object.assign(BaseContentEntryEditorConfig, {\n ContentEntry: Object.assign(ContentEntry, {\n useContentEntry,\n DefaultLayout,\n ContentEntryForm: Object.assign(BaseContentEntryForm, {\n useContentEntryForm\n }),\n ContentEntryFormPreview\n }),\n SingletonContentEntry: Object.assign(SingletonContentEntry, {\n useSingletonContentEntry\n }),\n FieldRenderers: {\n DynamicZone: {\n Template: {\n useTemplate\n },\n Container: DynamicZoneContainer,\n // SingleValue: {\n // Container: null,\n // ItemContainer: null,\n // Item: null\n // },\n MultiValue: {\n Container: MultiValueContainer,\n ItemContainer: MultiValueItemContainer,\n Item: MultiValueItem\n },\n TemplateGallery\n }\n }\n});\n"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AAQA,IAAAC,iBAAA,GAAAD,OAAA;AACA,IAAAE,
|
|
1
|
+
{"version":3,"names":["_dynamicZone","require","_ContentEntryForm","_Header","_ContentEntryFormPreview","_useContentEntryForm","_DefaultLayout","_hooks","_ContentEntry","_contentEntries","_SingletonContentEntry","_useSingletonContentEntry","ContentEntryEditorConfig","exports","Object","assign","BaseContentEntryEditorConfig","ContentEntry","useContentEntry","DefaultLayout","ContentEntryForm","BaseContentEntryForm","useContentEntryForm","Header","ContentEntryFormHeader","ContentEntryFormPreview","SingletonContentEntry","useSingletonContentEntry","FieldRenderers","DynamicZone","Template","useTemplate","Container","DynamicZoneContainer","MultiValue","MultiValueContainer","ItemContainer","MultiValueItemContainer","Item","MultiValueItem","TemplateGallery"],"sources":["ContentEntryEditorConfig.ts"],"sourcesContent":["import {\n DynamicZoneContainer,\n MultiValueContainer,\n MultiValueItemContainer,\n MultiValueItem,\n TemplateGallery,\n useTemplate\n} from \"~/admin/plugins/fieldRenderers/dynamicZone\";\nimport { ContentEntryForm as BaseContentEntryForm } from \"./admin/components/ContentEntryForm/ContentEntryForm\";\nimport { Header as ContentEntryFormHeader } from \"./admin/components/ContentEntryForm/Header\";\nimport { ContentEntryFormPreview } from \"./admin/components/ContentEntryForm/ContentEntryFormPreview\";\nimport { useContentEntryForm } from \"./admin/components/ContentEntryForm/useContentEntryForm\";\nimport { DefaultLayout } from \"~/admin/components/ContentEntryForm/DefaultLayout\";\nimport { useContentEntry } from \"~/admin/views/contentEntries/hooks\";\nimport { ContentEntry } from \"~/admin/views/contentEntries/ContentEntry\";\nimport { ContentEntryEditorConfig as BaseContentEntryEditorConfig } from \"./admin/config/contentEntries\";\nimport { SingletonContentEntry } from \"~/admin/views/contentEntries/ContentEntry/SingletonContentEntry\";\nimport { useSingletonContentEntry } from \"~/admin/views/contentEntries/hooks/useSingletonContentEntry\";\n\nexport const ContentEntryEditorConfig = Object.assign(BaseContentEntryEditorConfig, {\n ContentEntry: Object.assign(ContentEntry, {\n useContentEntry,\n DefaultLayout,\n ContentEntryForm: Object.assign(BaseContentEntryForm, {\n useContentEntryForm,\n Header: ContentEntryFormHeader\n }),\n ContentEntryFormPreview\n }),\n SingletonContentEntry: Object.assign(SingletonContentEntry, {\n useSingletonContentEntry\n }),\n FieldRenderers: {\n DynamicZone: {\n Template: {\n useTemplate\n },\n Container: DynamicZoneContainer,\n // SingleValue: {\n // Container: null,\n // ItemContainer: null,\n // Item: null\n // },\n MultiValue: {\n Container: MultiValueContainer,\n ItemContainer: MultiValueItemContainer,\n Item: MultiValueItem\n },\n Template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RequireDefault","require","_delete","_mobxReactLite","_parseIdentifier2","_appAco","_appAdmin","_contentEntries","_hooks","_BulkActions","ActionDelete","exports","observer","_useModel","useModel","model","_useCms","useCms","deleteEntry","_useRecords","useRecords","removeRecordFromCache","_useSnackbar","useSnackbar","showSnackbar","_ContentEntryListConf","ContentEntryListConfig","Browser","BulkAction","useWorker","useButtons","useDialog","_useButtons","IconButton","worker","_useDialog","showConfirmationDialog","showResultsDialog","entriesLabel","getEntriesLabel","openDeleteEntriesDialog","title","message","concat","loadingLabel","execute","isSelectedAll","processInBulk","action","resetItems","dismissIcon","timeout","processInSeries","_ref","item","report","_parseIdentifier","parseIdentifier","id","response","Error","error","success","meta","e","results","default","createElement","icon","ReactComponent","onAction","label","tooltipPlacement"],"sources":["ActionDelete.tsx"],"sourcesContent":["import React from \"react\";\nimport { ReactComponent as DeleteIcon } from \"@material-design-icons/svg/outlined/delete.svg\";\nimport { observer } from \"mobx-react-lite\";\nimport { parseIdentifier } from \"@webiny/utils/parseIdentifier\";\nimport { useRecords } from \"@webiny/app-aco\";\nimport { useSnackbar } from \"@webiny/app-admin\";\nimport { ContentEntryListConfig } from \"~/admin/config/contentEntries\";\nimport { useCms, useModel } from \"~/admin/hooks\";\nimport { getEntriesLabel } from \"~/admin/components/ContentEntries/BulkActions/BulkActions\";\n\nexport const ActionDelete = observer(() => {\n const { model } = useModel();\n const { deleteEntry } = useCms();\n const { removeRecordFromCache } = useRecords();\n const { showSnackbar } = useSnackbar();\n\n const { useWorker, useButtons, useDialog } = ContentEntryListConfig.Browser.BulkAction;\n const { IconButton } = useButtons();\n const worker = useWorker();\n const { showConfirmationDialog, showResultsDialog } = useDialog();\n\n const entriesLabel = getEntriesLabel();\n\n const openDeleteEntriesDialog = () =>\n showConfirmationDialog({\n title: \"Trash entries\",\n message: `You are about to move ${entriesLabel} to trash. Are you sure you want to continue?`,\n loadingLabel: `Processing ${entriesLabel}`,\n execute: async () => {\n if (worker.isSelectedAll) {\n await worker.processInBulk({ action: \"MoveToTrash\" });\n worker.resetItems();\n showSnackbar(\n \"All entries will be moved to trash. This process will be carried out in the background and may take some time. You can safely navigate away from this page while the process is running.\",\n {\n dismissIcon: true,\n timeout: -1\n }\n );\n return;\n }\n\n await worker.processInSeries(async ({ item, report }) => {\n try {\n /**\n * We need an entryId because we want to delete all revisions of the entry.\n * By sending an entryId (id without #version), we are telling to the API to delete all revisions.\n */\n const { id } = parseIdentifier(item.id);\n const response = await deleteEntry({ model, id });\n\n if (typeof response !== \"boolean\") {\n throw new Error(\n response.error.message ||\n \"Unknown error while moving the entry to trash.\"\n );\n }\n\n removeRecordFromCache(id);\n\n report.success({\n title: `${item.meta.title}`,\n message: \"Entry successfully moved to trash.\"\n });\n } catch (e) {\n report.error({\n title: `${item.meta.title}`,\n message: e.message\n });\n }\n });\n\n worker.resetItems();\n\n showResultsDialog({\n results: worker.results,\n title: \"Trash entries\",\n message: \"Finished moving entries to trash! See full report below:\"\n });\n }\n });\n\n return (\n <IconButton\n icon={<DeleteIcon />}\n onAction={openDeleteEntriesDialog}\n label={`Trash ${entriesLabel}`}\n tooltipPlacement={\"bottom\"}\n />\n );\n});\n"],"mappings":";;;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,OAAA,GAAAD,OAAA;AACA,IAAAE,cAAA,GAAAF,OAAA;AACA,IAAAG,iBAAA,GAAAH,OAAA;AACA,IAAAI,OAAA,GAAAJ,OAAA;AACA,IAAAK,SAAA,GAAAL,OAAA;AACA,IAAAM,eAAA,GAAAN,OAAA;AACA,IAAAO,MAAA,GAAAP,OAAA;AACA,IAAAQ,YAAA,GAAAR,OAAA;AAEO,IAAMS,YAAY,GAAAC,OAAA,CAAAD,YAAA,GAAG,IAAAE,uBAAQ,EAAC,YAAM;EACvC,IAAAC,SAAA,GAAkB,IAAAC,eAAQ,EAAC,CAAC;IAApBC,KAAK,GAAAF,SAAA,CAALE,KAAK;EACb,IAAAC,OAAA,GAAwB,IAAAC,aAAM,EAAC,CAAC;IAAxBC,WAAW,GAAAF,OAAA,CAAXE,WAAW;EACnB,IAAAC,WAAA,GAAkC,IAAAC,kBAAU,EAAC,CAAC;IAAtCC,qBAAqB,GAAAF,WAAA,CAArBE,qBAAqB;EAC7B,IAAAC,YAAA,GAAyB,IAAAC,qBAAW,EAAC,CAAC;IAA9BC,YAAY,GAAAF,YAAA,CAAZE,YAAY;EAEpB,IAAAC,qBAAA,GAA6CC,sCAAsB,CAACC,OAAO,CAACC,UAAU;IAA9EC,SAAS,GAAAJ,qBAAA,CAATI,SAAS;IAAEC,UAAU,GAAAL,qBAAA,CAAVK,UAAU;IAAEC,SAAS,GAAAN,qBAAA,CAATM,SAAS;EACxC,IAAAC,WAAA,GAAuBF,UAAU,CAAC,CAAC;IAA3BG,UAAU,GAAAD,WAAA,CAAVC,UAAU;EAClB,IAAMC,MAAM,GAAGL,SAAS,CAAC,CAAC;EAC1B,IAAAM,UAAA,GAAsDJ,SAAS,CAAC,CAAC;IAAzDK,sBAAsB,GAAAD,UAAA,CAAtBC,sBAAsB;IAAEC,iBAAiB,GAAAF,UAAA,CAAjBE,iBAAiB;EAEjD,IAAMC,YAAY,GAAG,IAAAC,4BAAe,EAAC,CAAC;EAEtC,IAAMC,uBAAuB,GAAG,SAA1BA,uBAAuBA,CAAA;IAAA,OACzBJ,sBAAsB,CAAC;MACnBK,KAAK,EAAE,eAAe;MACtBC,OAAO,2BAAAC,MAAA,CAA2BL,YAAY,kDAA+C;MAC7FM,YAAY,gBAAAD,MAAA,CAAgBL,YAAY,CAAE;MAC1CO,OAAO,EAAE,
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireDefault","require","_delete","_mobxReactLite","_parseIdentifier2","_appAco","_appAdmin","_contentEntries","_hooks","_BulkActions","ActionDelete","exports","observer","_useModel","useModel","model","_useCms","useCms","deleteEntry","_useRecords","useRecords","removeRecordFromCache","_useSnackbar","useSnackbar","showSnackbar","_ContentEntryListConf","ContentEntryListConfig","Browser","BulkAction","useWorker","useButtons","useDialog","_useButtons","IconButton","worker","_useDialog","showConfirmationDialog","showResultsDialog","entriesLabel","getEntriesLabel","openDeleteEntriesDialog","title","message","concat","loadingLabel","execute","isSelectedAll","processInBulk","action","resetItems","dismissIcon","timeout","processInSeries","_ref","item","report","_parseIdentifier","parseIdentifier","id","response","Error","error","success","meta","e","results","default","createElement","icon","ReactComponent","onAction","label","tooltipPlacement"],"sources":["ActionDelete.tsx"],"sourcesContent":["import React from \"react\";\nimport { ReactComponent as DeleteIcon } from \"@material-design-icons/svg/outlined/delete.svg\";\nimport { observer } from \"mobx-react-lite\";\nimport { parseIdentifier } from \"@webiny/utils/parseIdentifier\";\nimport { useRecords } from \"@webiny/app-aco\";\nimport { useSnackbar } from \"@webiny/app-admin\";\nimport { ContentEntryListConfig } from \"~/admin/config/contentEntries\";\nimport { useCms, useModel } from \"~/admin/hooks\";\nimport { getEntriesLabel } from \"~/admin/components/ContentEntries/BulkActions/BulkActions\";\n\nexport const ActionDelete = observer(() => {\n const { model } = useModel();\n const { deleteEntry } = useCms();\n const { removeRecordFromCache } = useRecords();\n const { showSnackbar } = useSnackbar();\n\n const { useWorker, useButtons, useDialog } = ContentEntryListConfig.Browser.BulkAction;\n const { IconButton } = useButtons();\n const worker = useWorker();\n const { showConfirmationDialog, showResultsDialog } = useDialog();\n\n const entriesLabel = getEntriesLabel();\n\n const openDeleteEntriesDialog = () =>\n showConfirmationDialog({\n title: \"Trash entries\",\n message: `You are about to move ${entriesLabel} to trash. Are you sure you want to continue?`,\n loadingLabel: `Processing ${entriesLabel}`,\n execute: async () => {\n if (worker.isSelectedAll) {\n await worker.processInBulk({ action: \"MoveToTrash\" });\n worker.resetItems();\n showSnackbar(\n \"All entries will be moved to trash. This process will be carried out in the background and may take some time. You can safely navigate away from this page while the process is running.\",\n {\n dismissIcon: true,\n timeout: -1\n }\n );\n return;\n }\n\n await worker.processInSeries(async ({ item, report }) => {\n try {\n /**\n * We need an entryId because we want to delete all revisions of the entry.\n * By sending an entryId (id without #version), we are telling to the API to delete all revisions.\n */\n const { id } = parseIdentifier(item.id);\n const response = await deleteEntry({ model, id });\n\n if (typeof response !== \"boolean\") {\n throw new Error(\n response.error.message ||\n \"Unknown error while moving the entry to trash.\"\n );\n }\n\n removeRecordFromCache(id);\n\n report.success({\n title: `${item.meta.title}`,\n message: \"Entry successfully moved to trash.\"\n });\n } catch (e) {\n report.error({\n title: `${item.meta.title}`,\n message: e.message\n });\n }\n });\n\n worker.resetItems();\n\n showResultsDialog({\n results: worker.results,\n title: \"Trash entries\",\n message: \"Finished moving entries to trash! See full report below:\"\n });\n }\n });\n\n return (\n <IconButton\n icon={<DeleteIcon />}\n onAction={openDeleteEntriesDialog}\n label={`Trash ${entriesLabel}`}\n tooltipPlacement={\"bottom\"}\n />\n );\n});\n"],"mappings":";;;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,OAAA,GAAAD,OAAA;AACA,IAAAE,cAAA,GAAAF,OAAA;AACA,IAAAG,iBAAA,GAAAH,OAAA;AACA,IAAAI,OAAA,GAAAJ,OAAA;AACA,IAAAK,SAAA,GAAAL,OAAA;AACA,IAAAM,eAAA,GAAAN,OAAA;AACA,IAAAO,MAAA,GAAAP,OAAA;AACA,IAAAQ,YAAA,GAAAR,OAAA;AAEO,IAAMS,YAAY,GAAAC,OAAA,CAAAD,YAAA,GAAG,IAAAE,uBAAQ,EAAC,YAAM;EACvC,IAAAC,SAAA,GAAkB,IAAAC,eAAQ,EAAC,CAAC;IAApBC,KAAK,GAAAF,SAAA,CAALE,KAAK;EACb,IAAAC,OAAA,GAAwB,IAAAC,aAAM,EAAC,CAAC;IAAxBC,WAAW,GAAAF,OAAA,CAAXE,WAAW;EACnB,IAAAC,WAAA,GAAkC,IAAAC,kBAAU,EAAC,CAAC;IAAtCC,qBAAqB,GAAAF,WAAA,CAArBE,qBAAqB;EAC7B,IAAAC,YAAA,GAAyB,IAAAC,qBAAW,EAAC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C9B,CAAC;AAEV,CAAC,CAAC","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","_interopRequireWildcard","require","_drive_file_move","_appAco","_appAdmin","_mobxReactLite","_contentEntries","_constants","_BulkActions","ActionMove","exports","observer","_useRecords","useRecords","moveRecord","_useNavigateFolder","useNavigateFolder","currentFolderId","_useSnackbar","useSnackbar","showSnackbar","_ContentEntryListConf","ContentEntryListConfig","Browser","BulkAction","useWorker","useButtons","useDialog","_useButtons","IconButton","worker","_useDialog","showConfirmationDialog","showResultsDialog","_useMoveToFolderDialo","useMoveToFolderDialog","showMoveDialog","showDialog","entriesLabel","getEntriesLabel","openWorkerDialog","useCallback","folder","title","message","concat","loadingLabel","execute","isSelectedAll","processInBulk","action","where","wbyAco_location","folderId_not","id","data","folderId","resetItems","dismissIcon","timeout","processInSeries","_ref","item","report","location","success","meta","e","error","results","openMoveEntriesDialog","acceptLabel","focusedFolderId","ROOT_FOLDER","onAccept","_ref2","default","createElement","icon","ReactComponent","onAction","label","tooltipPlacement"],"sources":["ActionMove.tsx"],"sourcesContent":["import React, { useCallback } from \"react\";\nimport { ReactComponent as MoveIcon } from \"@material-design-icons/svg/outlined/drive_file_move.svg\";\nimport { useRecords, useMoveToFolderDialog, useNavigateFolder } from \"@webiny/app-aco\";\nimport { useSnackbar } from \"@webiny/app-admin\";\nimport { FolderItem } from \"@webiny/app-aco/types\";\nimport { observer } from \"mobx-react-lite\";\nimport { ContentEntryListConfig } from \"~/admin/config/contentEntries\";\nimport { ROOT_FOLDER } from \"~/admin/constants\";\nimport { getEntriesLabel } from \"~/admin/components/ContentEntries/BulkActions/BulkActions\";\n\nexport const ActionMove = observer(() => {\n const { moveRecord } = useRecords();\n const { currentFolderId } = useNavigateFolder();\n const { showSnackbar } = useSnackbar();\n\n const { useWorker, useButtons, useDialog } = ContentEntryListConfig.Browser.BulkAction;\n const { IconButton } = useButtons();\n const worker = useWorker();\n const { showConfirmationDialog, showResultsDialog } = useDialog();\n const { showDialog: showMoveDialog } = useMoveToFolderDialog();\n\n const entriesLabel = getEntriesLabel();\n\n const openWorkerDialog = useCallback(\n (folder: FolderItem) => {\n showConfirmationDialog({\n title: \"Move entries\",\n message: `You are about to move ${entriesLabel} to ${folder.title}. Are you sure you want to continue?`,\n loadingLabel: `Processing ${entriesLabel}`,\n execute: async () => {\n if (worker.isSelectedAll) {\n await worker.processInBulk({\n action: \"MoveToFolder\",\n where: {\n wbyAco_location: {\n folderId_not: folder.id\n }\n },\n data: {\n folderId: folder.id\n }\n });\n worker.resetItems();\n showSnackbar(\n `All entries will be moved to ${folder.title}. This process will be carried out in the background and may take some time. You can safely navigate away from this page while the process is running.`,\n {\n dismissIcon: true,\n timeout: -1\n }\n );\n return;\n }\n\n await worker.processInSeries(async ({ item, report }) => {\n try {\n await moveRecord({\n id: item.id,\n location: {\n folderId: folder.id\n }\n });\n\n report.success({\n title: `${item.meta.title}`,\n message: \"Entry successfully moved.\"\n });\n } catch (e) {\n report.error({\n title: `${item.meta.title}`,\n message: e.message\n });\n }\n });\n\n worker.resetItems();\n\n showResultsDialog({\n results: worker.results,\n title: \"Move entries\",\n message: \"Finished moving entries! See full report below:\"\n });\n }\n });\n },\n [entriesLabel, worker.isSelectedAll]\n );\n\n const openMoveEntriesDialog = () =>\n showMoveDialog({\n title: \"Select folder\",\n message: \"Select a new location for selected entries:\",\n loadingLabel: `Processing ${entriesLabel}`,\n acceptLabel: `Move`,\n focusedFolderId: currentFolderId || ROOT_FOLDER,\n async onAccept({ folder }) {\n openWorkerDialog(folder);\n }\n });\n\n return (\n <IconButton\n icon={<MoveIcon />}\n onAction={openMoveEntriesDialog}\n label={`Move ${entriesLabel}`}\n tooltipPlacement={\"bottom\"}\n />\n );\n});\n"],"mappings":";;;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,gBAAA,GAAAD,OAAA;AACA,IAAAE,OAAA,GAAAF,OAAA;AACA,IAAAG,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Ac;MACrBC,OAAO,2BAAAC,MAAA,CAA2BP,YAAY,UAAAO,MAAA,CAAOH,MAAM,CAACC,KAAK,yCAAsC;MACvGG,YAAY,gBAAAD,MAAA,CAAgBP,YAAY,CAAE;MAC1CS,OAAO,EAAE,
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireWildcard","require","_drive_file_move","_appAco","_appAdmin","_mobxReactLite","_contentEntries","_constants","_BulkActions","ActionMove","exports","observer","_useRecords","useRecords","moveRecord","_useNavigateFolder","useNavigateFolder","currentFolderId","_useSnackbar","useSnackbar","showSnackbar","_ContentEntryListConf","ContentEntryListConfig","Browser","BulkAction","useWorker","useButtons","useDialog","_useButtons","IconButton","worker","_useDialog","showConfirmationDialog","showResultsDialog","_useMoveToFolderDialo","useMoveToFolderDialog","showMoveDialog","showDialog","entriesLabel","getEntriesLabel","openWorkerDialog","useCallback","folder","title","message","concat","loadingLabel","execute","isSelectedAll","processInBulk","action","where","wbyAco_location","folderId_not","id","data","folderId","resetItems","dismissIcon","timeout","processInSeries","_ref","item","report","location","success","meta","e","error","results","openMoveEntriesDialog","acceptLabel","focusedFolderId","ROOT_FOLDER","onAccept","_ref2","default","createElement","icon","ReactComponent","onAction","label","tooltipPlacement"],"sources":["ActionMove.tsx"],"sourcesContent":["import React, { useCallback } from \"react\";\nimport { ReactComponent as MoveIcon } from \"@material-design-icons/svg/outlined/drive_file_move.svg\";\nimport { useRecords, useMoveToFolderDialog, useNavigateFolder } from \"@webiny/app-aco\";\nimport { useSnackbar } from \"@webiny/app-admin\";\nimport { FolderItem } from \"@webiny/app-aco/types\";\nimport { observer } from \"mobx-react-lite\";\nimport { ContentEntryListConfig } from \"~/admin/config/contentEntries\";\nimport { ROOT_FOLDER } from \"~/admin/constants\";\nimport { getEntriesLabel } from \"~/admin/components/ContentEntries/BulkActions/BulkActions\";\n\nexport const ActionMove = observer(() => {\n const { moveRecord } = useRecords();\n const { currentFolderId } = useNavigateFolder();\n const { showSnackbar } = useSnackbar();\n\n const { useWorker, useButtons, useDialog } = ContentEntryListConfig.Browser.BulkAction;\n const { IconButton } = useButtons();\n const worker = useWorker();\n const { showConfirmationDialog, showResultsDialog } = useDialog();\n const { showDialog: showMoveDialog } = useMoveToFolderDialog();\n\n const entriesLabel = getEntriesLabel();\n\n const openWorkerDialog = useCallback(\n (folder: FolderItem) => {\n showConfirmationDialog({\n title: \"Move entries\",\n message: `You are about to move ${entriesLabel} to ${folder.title}. Are you sure you want to continue?`,\n loadingLabel: `Processing ${entriesLabel}`,\n execute: async () => {\n if (worker.isSelectedAll) {\n await worker.processInBulk({\n action: \"MoveToFolder\",\n where: {\n wbyAco_location: {\n folderId_not: folder.id\n }\n },\n data: {\n folderId: folder.id\n }\n });\n worker.resetItems();\n showSnackbar(\n `All entries will be moved to ${folder.title}. This process will be carried out in the background and may take some time. You can safely navigate away from this page while the process is running.`,\n {\n dismissIcon: true,\n timeout: -1\n }\n );\n return;\n }\n\n await worker.processInSeries(async ({ item, report }) => {\n try {\n await moveRecord({\n id: item.id,\n location: {\n folderId: folder.id\n }\n });\n\n report.success({\n title: `${item.meta.title}`,\n message: \"Entry successfully moved.\"\n });\n } catch (e) {\n report.error({\n title: `${item.meta.title}`,\n message: e.message\n });\n }\n });\n\n worker.resetItems();\n\n showResultsDialog({\n results: worker.results,\n title: \"Move entries\",\n message: \"Finished moving entries! See full report below:\"\n });\n }\n });\n },\n [entriesLabel, worker.isSelectedAll]\n );\n\n const openMoveEntriesDialog = () =>\n showMoveDialog({\n title: \"Select folder\",\n message: \"Select a new location for selected entries:\",\n loadingLabel: `Processing ${entriesLabel}`,\n acceptLabel: `Move`,\n focusedFolderId: currentFolderId || ROOT_FOLDER,\n async onAccept({ folder }) {\n openWorkerDialog(folder);\n }\n });\n\n return (\n <IconButton\n icon={<MoveIcon />}\n onAction={openMoveEntriesDialog}\n label={`Move ${entriesLabel}`}\n tooltipPlacement={\"bottom\"}\n />\n );\n});\n"],"mappings":";;;;;;;AAAA,IAAAA,MAAA,GAA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K,KAAK,CAAC;cACTzB,KAAK,KAAAE,MAAA,CAAKiB,IAAI,CAACI,IAAI,CAACvB,KAAK,CAAE;cAC3BC,OAAO,EAAEuB,CAAC,CAACvB;YACf,CAAC,CAAC;UACN;QACJ,CAAC,CAAC;QAEFd,MAAM,CAAC2B,UAAU,CAAC,CAAC;QAEnBxB,iBAAiB,CAAC;UACdoC,OAAO,EAAEvC,MAAM,CAACuC,OAAO;UACvB1B,KAAK,EAAE,cAAc;UACrBC,OAAO,EAAE;QACb,CAAC,CAAC;MACN;IACJ,CAAC,CAAC;EACN,CAAC,EACD,CAACN,YAAY,EAAER,MAAM,CAACkB,aAAa,CACvC,CAAC;EAED,IAAMsB,qBAAqB,GAAG,SAAxBA,qBAAqBA,CAAA;IAAA,OACvBlC,cAAc,CAAC;MACXO,KAAK,EAAE,eAAe;MACtBC,OAAO,EAAE,6CAA6C;MACtDE,YAAY,gBAAAD,MAAA,CAAgBP,YAAY,CAAE;MAC1CiC,WAAW,QAAQ;MACnBC,eAAe,EAAEvD,eAAe,IAAIwD,sBAAW;MACzCC,QAAQ,iBAARA,QAAQA,CAAAC,KAAA,EAAa;QAAA,IAAVjC,MAAM,GAAAiC,KAAA,CAANjC,MAAM;QACnBF,gBAAgB,CAACE,MAAM,CAAC;MAC5B;IACJ,CAAC,CAAC;EAAA;EAEN,oBACI3C,MAAA,CAAA6E,OAAA,CAAAC,aAAA,CAAChD,UAAU;IACPiD,IAAI,eAAE/E,MAAA,CAAA6E,OAAA,CAAAC,aAAA,CAAC3E,gBAAA,CAAA6E,cAAQ,MAAE,CAAE;IACnBC,QAAQ,EAAEV,qBAAsB;IAChCW,KAAK,UAAApC,MAAA,CAAUP,YAAY,CAAG;IAC9B4C,gBAAgB,EAAE;EAAS,CAC9B,CAAC;AAEV,CAAC,CAAC","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","_interopRequireDefault","require","_publish","_mobxReactLite","_contentEntries","_hooks","_BulkActions","_appAco","_appAdmin","ActionPublish","exports","observer","_useModel","useModel","model","_usePermission","usePermission","canPublish","_useCms","useCms","publishEntryRevision","_useRecords","useRecords","updateRecordInCache","_useSnackbar","useSnackbar","showSnackbar","_ContentEntryListConf","ContentEntryListConfig","Browser","BulkAction","useWorker","useButtons","useDialog","_useButtons","IconButton","worker","_useDialog","showConfirmationDialog","showResultsDialog","entriesLabel","getEntriesLabel","openPublishEntriesDialog","title","message","concat","loadingLabel","execute","isSelectedAll","processInBulk","action","resetItems","dismissIcon","timeout","processInSeries","_ref","item","report","response","id","error","Error","entry","success","meta","e","results","console","log","default","createElement","icon","ReactComponent","onAction","label","tooltipPlacement"],"sources":["ActionPublish.tsx"],"sourcesContent":["import React from \"react\";\nimport { ReactComponent as PublishIcon } from \"@material-design-icons/svg/outlined/publish.svg\";\nimport { observer } from \"mobx-react-lite\";\nimport { ContentEntryListConfig } from \"~/admin/config/contentEntries\";\nimport { usePermission, useCms, useModel } from \"~/admin/hooks\";\nimport { getEntriesLabel } from \"~/admin/components/ContentEntries/BulkActions/BulkActions\";\nimport { useRecords } from \"@webiny/app-aco\";\nimport { useSnackbar } from \"@webiny/app-admin\";\n\nexport const ActionPublish = observer(() => {\n const { model } = useModel();\n const { canPublish } = usePermission();\n const { publishEntryRevision } = useCms();\n const { updateRecordInCache } = useRecords();\n const { showSnackbar } = useSnackbar();\n\n const { useWorker, useButtons, useDialog } = ContentEntryListConfig.Browser.BulkAction;\n const { IconButton } = useButtons();\n const worker = useWorker();\n const { showConfirmationDialog, showResultsDialog } = useDialog();\n\n const entriesLabel = getEntriesLabel();\n\n const openPublishEntriesDialog = () =>\n showConfirmationDialog({\n title: \"Publish entries\",\n message: `You are about to publish ${entriesLabel}. Are you sure you want to continue?`,\n loadingLabel: `Processing ${entriesLabel}`,\n execute: async () => {\n if (worker.isSelectedAll) {\n await worker.processInBulk({\n action: \"Publish\"\n });\n worker.resetItems();\n showSnackbar(\n \"All entries will be published. This process will be carried out in the background and may take some time. You can safely navigate away from this page while the process is running.\",\n {\n dismissIcon: true,\n timeout: -1\n }\n );\n return;\n }\n\n await worker.processInSeries(async ({ item, report }) => {\n try {\n const response = await publishEntryRevision({ model, id: item.id });\n\n const { error } = response;\n\n if (error) {\n throw new Error(\n error.message || \"Unknown error while publishing the entry\"\n );\n }\n\n updateRecordInCache(response.entry);\n\n report.success({\n title: `${item.meta.title}`,\n message: \"Entry successfully published.\"\n });\n } catch (e) {\n report.error({\n title: `${item.meta.title}`,\n message: e.message\n });\n }\n });\n\n worker.resetItems();\n\n showResultsDialog({\n results: worker.results,\n title: \"Publish entries\",\n message: \"Finished publishing entries! See full report below:\"\n });\n }\n });\n\n if (!canPublish(\"cms.contentEntry\")) {\n console.log(\"You don't have permissions to publish entries.\");\n return null;\n }\n\n return (\n <IconButton\n icon={<PublishIcon />}\n onAction={openPublishEntriesDialog}\n label={`Publish ${entriesLabel}`}\n tooltipPlacement={\"bottom\"}\n />\n );\n});\n"],"mappings":";;;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,cAAA,GAAAF,OAAA;AACA,IAAAG,eAAA,GAAAH,OAAA;AACA,IAAAI,MAAA,GAAAJ,OAAA;AACA,IAAAK,YAAA,GAAAL,OAAA;AACA,IAAAM,OAAA,GAAAN,OAAA;AACA,IAAAO,SAAA,GAAAP,OAAA;AAEO,IAAMQ,aAAa,GAAAC,OAAA,CAAAD,aAAA,GAAG,IAAAE,uBAAQ,EAAC,YAAM;EACxC,IAAAC,SAAA,GAAkB,IAAAC,eAAQ,EAAC,CAAC;IAApBC,KAAK,GAAAF,SAAA,CAALE,KAAK;EACb,IAAAC,cAAA,GAAuB,IAAAC,oBAAa,EAAC,CAAC;IAA9BC,UAAU,GAAAF,cAAA,CAAVE,UAAU;EAClB,IAAAC,OAAA,GAAiC,IAAAC,aAAM,EAAC,CAAC;IAAjCC,oBAAoB,GAAAF,OAAA,CAApBE,oBAAoB;EAC5B,IAAAC,WAAA,GAAgC,IAAAC,kBAAU,EAAC,CAAC;IAApCC,mBAAmB,GAAAF,WAAA,CAAnBE,mBAAmB;EAC3B,IAAAC,YAAA,GAAyB,IAAAC,qBAAW,EAAC,CAAC;IAA9BC,YAAY,GAAAF,YAAA,CAAZE,YAAY;EAEpB,IAAAC,qBAAA,GAA6CC,sCAAsB,CAACC,OAAO,CAACC,UAAU;IAA9EC,SAAS,GAAAJ,qBAAA,CAATI,SAAS;IAAEC,UAAU,GAAAL,qBAAA,CAAVK,UAAU;IAAEC,SAAS,GAAAN,qBAAA,CAATM,SAAS;EACxC,IAAAC,WAAA,GAAuBF,UAAU,CAAC,CAAC;IAA3BG,UAAU,GAAAD,WAAA,CAAVC,UAAU;EAClB,IAAMC,MAAM,GAAGL,SAAS,CAAC,CAAC;EAC1B,IAAAM,UAAA,GAAsDJ,SAAS,CAAC,CAAC;IAAzDK,sBAAsB,GAAAD,UAAA,CAAtBC,sBAAsB;IAAEC,iBAAiB,GAAAF,UAAA,CAAjBE,iBAAiB;EAEjD,IAAMC,YAAY,GAAG,IAAAC,4BAAe,EAAC,CAAC;EAEtC,IAAMC,wBAAwB,GAAG,SAA3BA,wBAAwBA,CAAA;IAAA,OAC1BJ,sBAAsB,CAAC;MACnBK,KAAK,EAAE,iBAAiB;MACxBC,OAAO,8BAAAC,MAAA,CAA8BL,YAAY,yCAAsC;MACvFM,YAAY,gBAAAD,MAAA,CAAgBL,YAAY,CAAE;MAC1CO,OAAO,EAAE,
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireDefault","require","_publish","_mobxReactLite","_contentEntries","_hooks","_BulkActions","_appAco","_appAdmin","ActionPublish","exports","observer","_useModel","useModel","model","_usePermission","usePermission","canPublish","_useCms","useCms","publishEntryRevision","_useRecords","useRecords","updateRecordInCache","_useSnackbar","useSnackbar","showSnackbar","_ContentEntryListConf","ContentEntryListConfig","Browser","BulkAction","useWorker","useButtons","useDialog","_useButtons","IconButton","worker","_useDialog","showConfirmationDialog","showResultsDialog","entriesLabel","getEntriesLabel","openPublishEntriesDialog","title","message","concat","loadingLabel","execute","isSelectedAll","processInBulk","action","resetItems","dismissIcon","timeout","processInSeries","_ref","item","report","response","id","error","Error","entry","success","meta","e","results","console","log","default","createElement","icon","ReactComponent","onAction","label","tooltipPlacement"],"sources":["ActionPublish.tsx"],"sourcesContent":["import React from \"react\";\nimport { ReactComponent as PublishIcon } from \"@material-design-icons/svg/outlined/publish.svg\";\nimport { observer } from \"mobx-react-lite\";\nimport { ContentEntryListConfig } from \"~/admin/config/contentEntries\";\nimport { usePermission, useCms, useModel } from \"~/admin/hooks\";\nimport { getEntriesLabel } from \"~/admin/components/ContentEntries/BulkActions/BulkActions\";\nimport { useRecords } from \"@webiny/app-aco\";\nimport { useSnackbar } from \"@webiny/app-admin\";\n\nexport const ActionPublish = observer(() => {\n const { model } = useModel();\n const { canPublish } = usePermission();\n const { publishEntryRevision } = useCms();\n const { updateRecordInCache } = useRecords();\n const { showSnackbar } = useSnackbar();\n\n const { useWorker, useButtons, useDialog } = ContentEntryListConfig.Browser.BulkAction;\n const { IconButton } = useButtons();\n const worker = useWorker();\n const { showConfirmationDialog, showResultsDialog } = useDialog();\n\n const entriesLabel = getEntriesLabel();\n\n const openPublishEntriesDialog = () =>\n showConfirmationDialog({\n title: \"Publish entries\",\n message: `You are about to publish ${entriesLabel}. Are you sure you want to continue?`,\n loadingLabel: `Processing ${entriesLabel}`,\n execute: async () => {\n if (worker.isSelectedAll) {\n await worker.processInBulk({\n action: \"Publish\"\n });\n worker.resetItems();\n showSnackbar(\n \"All entries will be published. This process will be carried out in the background and may take some time. You can safely navigate away from this page while the process is running.\",\n {\n dismissIcon: true,\n timeout: -1\n }\n );\n return;\n }\n\n await worker.processInSeries(async ({ item, report }) => {\n try {\n const response = await publishEntryRevision({ model, id: item.id });\n\n const { error } = response;\n\n if (error) {\n throw new Error(\n error.message || \"Unknown error while publishing the entry\"\n );\n }\n\n updateRecordInCache(response.entry);\n\n report.success({\n title: `${item.meta.title}`,\n message: \"Entry successfully published.\"\n });\n } catch (e) {\n report.error({\n title: `${item.meta.title}`,\n message: e.message\n });\n }\n });\n\n worker.resetItems();\n\n showResultsDialog({\n results: worker.results,\n title: \"Publish entries\",\n message: \"Finished publishing entries! See full report below:\"\n });\n }\n });\n\n if (!canPublish(\"cms.contentEntry\")) {\n console.log(\"You don't have permissions to publish entries.\");\n return null;\n }\n\n return (\n <IconButton\n icon={<PublishIcon />}\n onAction={openPublishEntriesDialog}\n label={`Publish ${entriesLabel}`}\n tooltipPlacement={\"bottom\"}\n />\n );\n});\n"],"mappings":";;;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,cAAA,GAAAF,OAAA;AACA,IAAAG,eAAA,GAAAH,OAAA;AACA,IAAAI,MAAA,GAAAJ,OAAA;AACA,IAAAK,YAAA,GAAAL,OAAA;AACA,IAAAM,OAAA,GAAAN,OAAA;AACA,IAAAO,SAAA,GAAAP,OAAA;AAEO,IAAMQ,aAAa,GAAAC,OAAA,CAAAD,aAAA,GAAG,IAAAE,uBAAQ,EAAC,YAAM;EACxC,IAAAC,SAAA,GAAkB,IAAAC,eAAQ,EAAC,CAAC;IAApBC,KAAK,GAAAF,SAAA,CAALE,KAAK;EACb,IAAAC,cAAA,GAAuB,IAAAC,oBAAa,EAAC,CAAC;IAA9BC,UAAU,GAAAF,cAAA,CAAVE,UAAU;EAClB,IAAAC,OAAA,GAAiC,IAAAC,aAAM,EAAC,CAAC;IAAjCC,oBAAoB,GAAAF,OAAA,CAApBE,oBAAoB;EAC5B,IAAAC,WAAA,GAAgC,IAAAC,kBAAU,EAAC,CAAC;IAApCC,mBAAmB,GAAAF,WAAA,CAAnBE,mBAAmB;EAC3B,IAAAC,YAAA,GAAyB,IAAAC,qBAAW,EAAC,CAAC;IAA9BC,YAAY,GAAAF,YAAA,CAAZE,YAAY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AAEV,CAAC,CAAC","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","_interopRequireDefault","require","_settings_backup_restore","_mobxReactLite","_contentEntries","_hooks","_BulkActions","_appAco","_appAdmin","ActionUnpublish","exports","observer","_useModel","useModel","model","_usePermission","usePermission","canUnpublish","_useCms","useCms","unpublishEntryRevision","_useRecords","useRecords","updateRecordInCache","_useSnackbar","useSnackbar","showSnackbar","_ContentEntryListConf","ContentEntryListConfig","Browser","BulkAction","useWorker","useButtons","useDialog","_useButtons","IconButton","worker","_useDialog","showConfirmationDialog","showResultsDialog","entriesLabel","getEntriesLabel","openUnpublishEntriesDialog","title","message","concat","loadingLabel","execute","isSelectedAll","processInBulk","action","resetItems","dismissIcon","timeout","processInSeries","_ref","item","report","response","id","error","Error","entry","success","meta","e","results","console","log","default","createElement","icon","ReactComponent","onAction","label","tooltipPlacement"],"sources":["ActionUnpublish.tsx"],"sourcesContent":["import React from \"react\";\nimport { ReactComponent as UnpublishIcon } from \"@material-design-icons/svg/outlined/settings_backup_restore.svg\";\nimport { observer } from \"mobx-react-lite\";\nimport { ContentEntryListConfig } from \"~/admin/config/contentEntries\";\nimport { useCms, useModel, usePermission } from \"~/admin/hooks\";\nimport { getEntriesLabel } from \"~/admin/components/ContentEntries/BulkActions/BulkActions\";\nimport { useRecords } from \"@webiny/app-aco\";\nimport { useSnackbar } from \"@webiny/app-admin\";\n\nexport const ActionUnpublish = observer(() => {\n const { model } = useModel();\n const { canUnpublish } = usePermission();\n const { unpublishEntryRevision } = useCms();\n const { updateRecordInCache } = useRecords();\n const { showSnackbar } = useSnackbar();\n\n const { useWorker, useButtons, useDialog } = ContentEntryListConfig.Browser.BulkAction;\n const { IconButton } = useButtons();\n const worker = useWorker();\n const { showConfirmationDialog, showResultsDialog } = useDialog();\n\n const entriesLabel = getEntriesLabel();\n\n const openUnpublishEntriesDialog = () =>\n showConfirmationDialog({\n title: \"Unpublish entries\",\n message: `You are about to unpublish ${entriesLabel}. Are you sure you want to continue?`,\n loadingLabel: `Processing ${entriesLabel}`,\n execute: async () => {\n if (worker.isSelectedAll) {\n await worker.processInBulk({\n action: \"Unpublish\"\n });\n worker.resetItems();\n showSnackbar(\n \"All entries will be unpublished. This process will be carried out in the background and may take some time. You can safely navigate away from this page while the process is running.\",\n {\n dismissIcon: true,\n timeout: -1\n }\n );\n return;\n }\n\n await worker.processInSeries(async ({ item, report }) => {\n try {\n const response = await unpublishEntryRevision({\n model,\n id: item.id\n });\n\n const { error } = response;\n\n if (error) {\n throw new Error(\n error.message || \"Unknown error while unpublishing the entry\"\n );\n }\n\n updateRecordInCache(response.entry);\n\n report.success({\n title: `${item.meta.title}`,\n message: \"Entry successfully unpublished.\"\n });\n } catch (e) {\n report.error({\n title: `${item.meta.title}`,\n message: e.message\n });\n }\n });\n\n worker.resetItems();\n\n showResultsDialog({\n results: worker.results,\n title: \"Unpublish entries\",\n message: \"Finished unpublishing entries! See full report below:\"\n });\n }\n });\n\n if (!canUnpublish(\"cms.contentEntry\")) {\n console.log(\"You don't have permissions to unpublish entries.\");\n return null;\n }\n\n return (\n <IconButton\n icon={<UnpublishIcon />}\n onAction={openUnpublishEntriesDialog}\n label={`Unpublish ${entriesLabel}`}\n tooltipPlacement={\"bottom\"}\n />\n );\n});\n"],"mappings":";;;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,wBAAA,GAAAD,OAAA;AACA,IAAAE,cAAA,GAAAF,OAAA;AACA,IAAAG,eAAA,GAAAH,OAAA;AACA,IAAAI,MAAA,GAAAJ,OAAA;AACA,IAAAK,YAAA,GAAAL,OAAA;AACA,IAAAM,OAAA,GAAAN,OAAA;AACA,IAAAO,SAAA,GAAAP,OAAA;AAEO,IAAMQ,eAAe,GAAAC,OAAA,CAAAD,eAAA,GAAG,IAAAE,uBAAQ,EAAC,YAAM;EAC1C,IAAAC,SAAA,GAAkB,IAAAC,eAAQ,EAAC,CAAC;IAAp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Entries","_hooks","_BulkActions","_appAco","_appAdmin","ActionUnpublish","exports","observer","_useModel","useModel","model","_usePermission","usePermission","canUnpublish","_useCms","useCms","unpublishEntryRevision","_useRecords","useRecords","updateRecordInCache","_useSnackbar","useSnackbar","showSnackbar","_ContentEntryListConf","ContentEntryListConfig","Browser","BulkAction","useWorker","useButtons","useDialog","_useButtons","IconButton","worker","_useDialog","showConfirmationDialog","showResultsDialog","entriesLabel","getEntriesLabel","openUnpublishEntriesDialog","title","message","concat","loadingLabel","execute","isSelectedAll","processInBulk","action","resetItems","dismissIcon","timeout","processInSeries","_ref","item","report","response","id","error","Error","entry","success","meta","e","results","console","log","default","createElement","icon","ReactComponent","onAction","label","tooltipPlacement"],"sources":["ActionUnpublish.tsx"],"sourcesContent":["import React from \"react\";\nimport { ReactComponent as UnpublishIcon } from \"@material-design-icons/svg/outlined/settings_backup_restore.svg\";\nimport { observer } from \"mobx-react-lite\";\nimport { ContentEntryListConfig } from \"~/admin/config/contentEntries\";\nimport { useCms, useModel, usePermission } from \"~/admin/hooks\";\nimport { getEntriesLabel } from \"~/admin/components/ContentEntries/BulkActions/BulkActions\";\nimport { useRecords } from \"@webiny/app-aco\";\nimport { useSnackbar } from \"@webiny/app-admin\";\n\nexport const ActionUnpublish = observer(() => {\n const { model } = useModel();\n const { canUnpublish } = usePermission();\n const { unpublishEntryRevision } = useCms();\n const { updateRecordInCache } = useRecords();\n const { showSnackbar } = useSnackbar();\n\n const { useWorker, useButtons, useDialog } = ContentEntryListConfig.Browser.BulkAction;\n const { IconButton } = useButtons();\n const worker = useWorker();\n const { showConfirmationDialog, showResultsDialog } = useDialog();\n\n const entriesLabel = getEntriesLabel();\n\n const openUnpublishEntriesDialog = () =>\n showConfirmationDialog({\n title: \"Unpublish entries\",\n message: `You are about to unpublish ${entriesLabel}. Are you sure you want to continue?`,\n loadingLabel: `Processing ${entriesLabel}`,\n execute: async () => {\n if (worker.isSelectedAll) {\n await worker.processInBulk({\n action: \"Unpublish\"\n });\n worker.resetItems();\n showSnackbar(\n \"All entries will be unpublished. This process will be carried out in the background and may take some time. You can safely navigate away from this page while the process is running.\",\n {\n dismissIcon: true,\n timeout: -1\n }\n );\n return;\n }\n\n await worker.processInSeries(async ({ item, report }) => {\n try {\n const response = await unpublishEntryRevision({\n model,\n id: item.id\n });\n\n const { error } = response;\n\n if (error) {\n throw new Error(\n error.message || \"Unknown error while unpublishing the entry\"\n );\n }\n\n updateRecordInCache(response.entry);\n\n report.success({\n title: `${item.meta.title}`,\n message: \"Entry successfully unpublished.\"\n });\n } catch (e) {\n report.error({\n title: `${item.meta.title}`,\n message: e.message\n });\n }\n });\n\n worker.resetItems();\n\n showResultsDialog({\n results: worker.results,\n title: \"Unpublish entries\",\n message: \"Finished unpublishing entries! See full report below:\"\n });\n }\n });\n\n if (!canUnpublish(\"cms.contentEntry\")) {\n console.log(\"You don't have permissions to unpublish entries.\");\n return null;\n }\n\n return (\n <IconButton\n icon={<UnpublishIcon />}\n onAction={openUnpublishEntriesDialog}\n label={`Unpublish ${entriesLabel}`}\n tooltipPlacement={\"bottom\"}\n />\n );\n});\n"],"mappings":";;;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,wBAAA,GAAAD,OAAA;AACA,IAAAE,cAAA,GAAAF,OAAA;AACA,IAAAG,eAAA,GAAAH,OAAA;AACA,IAAAI,MAAA,GAAAJ,OAAA;AACA,IAAAK,YAAA,GAAAL,OAAA;AACA,IAAAM,OAAA,GAAAN,OAAA;AACA,IAAAO,SAAA,GAAAP,OAAA;AAEO,IAAMQ,eAAe,GAAAC,OAAA,CAAAD,eAAA,GAAG,IAAAE,uBAAQ,EAAC,YAAM;EAC1C,IAAAC,SAAA,GAAkB,IAAAC,eAAQ,EAAC,CAAC;IAApBC,KAAK,GAAAF,SAAA,CAALE,KAAK;EACb,IAAAC,cAAA,GAAyB,IAAAC,oBAAa,EAAC,CAAC;IAAhCC,YAAY,GAAAF,cAAA,CAAZE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AC/D,OAAO,IAAI;EACf;EAEA,oBACIrE,MAAA,CAAAsE,OAAA,CAAAC,aAAA,CAACnC,UAAU;IACPoC,IAAI,eAAExE,MAAA,CAAAsE,OAAA,CAAAC,aAAA,CAACpE,wBAAA,CAAAsE,cAAa,MAAE,CAAE;IACxBC,QAAQ,EAAE/B,0BAA2B;IACrCgC,KAAK,eAAA7B,MAAA,CAAeL,YAAY,CAAG;IACnCmC,gBAAgB,EAAE;EAAS,CAC9B,CAAC;AAEV,CAAC,CAAC","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","_interopRequireWildcard","require","_close","_appAdmin","_Button","_contentEntries","_hooks","_BulkActions","_Typography","_i18n","_templateObject","t","i18n","ns","getEntriesLabel","exports","_useContentEntriesLis","useContentEntriesList","selected","isSelectedAll","concat","length","BulkActions","_useContentEntryListC","useContentEntryListConfig","browser","_useContentEntriesLis2","setSelected","headline","useMemo","_taggedTemplateLiteral2","default","count","createElement","BulkActionsContainer","BulkActionsInner","ButtonsContainer","Typography","use","Buttons","actions","bulkActions","IconButton","icon","ReactComponent","onClick"],"sources":["BulkActions.tsx"],"sourcesContent":["import React, { useMemo } from \"react\";\nimport { ReactComponent as Close } from \"@material-design-icons/svg/outlined/close.svg\";\nimport { Buttons } from \"@webiny/app-admin\";\nimport { IconButton } from \"@webiny/ui/Button\";\n\nimport { useContentEntryListConfig } from \"~/admin/config/contentEntries\";\nimport { useContentEntriesList } from \"~/admin/views/contentEntries/hooks\";\n\nimport { BulkActionsContainer, BulkActionsInner, ButtonsContainer } from \"./BulkActions.styled\";\nimport { Typography } from \"@webiny/ui/Typography\";\nimport { i18n } from \"@webiny/app/i18n\";\n\nconst t = i18n.ns(\"app-headless-cms/admin/content-entries/bulk-actions\");\n\nexport const getEntriesLabel = (): string => {\n const { selected, isSelectedAll } = useContentEntriesList();\n\n if (isSelectedAll) {\n return \"all entries\";\n }\n\n return `${selected.length} ${selected.length === 1 ? \"entry\" : \"entries\"}`;\n};\n\nexport const BulkActions = () => {\n const { browser } = useContentEntryListConfig();\n const { selected, setSelected, isSelectedAll } = useContentEntriesList();\n\n const headline = useMemo((): string => {\n if (isSelectedAll) {\n return t(\"All entries selected:\");\n }\n\n return t`{count|count:1:entry:default:entries} selected:`({\n count: selected.length\n });\n }, [selected.length, isSelectedAll]);\n\n if (!selected.length) {\n return null;\n }\n\n return (\n <BulkActionsContainer>\n <BulkActionsInner>\n <ButtonsContainer>\n <Typography use={\"headline6\"}>{headline}</Typography>\n <Buttons actions={browser.bulkActions} />\n </ButtonsContainer>\n <IconButton icon={<Close />} onClick={() => setSelected([])} />\n </BulkActionsInner>\n </BulkActionsContainer>\n );\n};\n"],"mappings":";;;;;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AACA,IAAAE,SAAA,GAAAF,OAAA;AACA,IAAAG,OAAA,GAAAH,OAAA;AAEA,IAAAI,eAAA,GAAAJ,OAAA;AACA,IAAAK,MAAA,GAAAL,OAAA;AAEA,IAAAM,YAAA,GAAAN,OAAA;AACA,IAAAO,WAAA,GAAAP,OAAA;AACA,IAAAQ,KAAA,GAAAR,OAAA;AAAwC,IAAAS,eAAA;AAExC,IAAMC,CAAC,GAAGC,UAAI,CAACC,EAAE,CAAC,qDAAqD,CAAC;AAEjE,IAAMC,eAAe,GAAAC,OAAA,CAAAD,eAAA,GAAG,SAAlBA,eAAeA,CAAA,EAAiB;EACzC,IAAAE,qBAAA,GAAoC,IAAAC,4BAAqB,EAAC,CAAC;IAAnDC,QAAQ,GAAAF,qBAAA,CAARE,QAAQ;IAAEC,aAAa,GAAAH,qBAAA,CAAbG,aAAa;EAE/B,IAAIA,aAAa,EAAE;IACf,OAAO,aAAa;EACxB;EAEA,UAAAC,MAAA,CAAUF,QAAQ,CAACG,MAAM,OAAAD,MAAA,CAAIF,QAAQ,CAACG,MAAM,KAAK,CAAC,GAAG,OAAO,GAAG,S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C,eACnB1C,MAAA,CAAAgC,OAAA,CAAAE,aAAA,CAAC7B,OAAA,CAAAsC,UAAU;IAACC,IAAI,eAAE5C,MAAA,CAAAgC,OAAA,CAAAE,aAAA,CAAC/B,MAAA,CAAA0C,cAAK,MAAE,CAAE;IAACC,OAAO,EAAE,
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireWildcard","require","_close","_appAdmin","_Button","_contentEntries","_hooks","_BulkActions","_Typography","_i18n","_templateObject","t","i18n","ns","getEntriesLabel","exports","_useContentEntriesLis","useContentEntriesList","selected","isSelectedAll","concat","length","BulkActions","_useContentEntryListC","useContentEntryListConfig","browser","_useContentEntriesLis2","setSelected","headline","useMemo","_taggedTemplateLiteral2","default","count","createElement","BulkActionsContainer","BulkActionsInner","ButtonsContainer","Typography","use","Buttons","actions","bulkActions","IconButton","icon","ReactComponent","onClick"],"sources":["BulkActions.tsx"],"sourcesContent":["import React, { useMemo } from \"react\";\nimport { ReactComponent as Close } from \"@material-design-icons/svg/outlined/close.svg\";\nimport { Buttons } from \"@webiny/app-admin\";\nimport { IconButton } from \"@webiny/ui/Button\";\n\nimport { useContentEntryListConfig } from \"~/admin/config/contentEntries\";\nimport { useContentEntriesList } from \"~/admin/views/contentEntries/hooks\";\n\nimport { BulkActionsContainer, BulkActionsInner, ButtonsContainer } from \"./BulkActions.styled\";\nimport { Typography } from \"@webiny/ui/Typography\";\nimport { i18n } from \"@webiny/app/i18n\";\n\nconst t = i18n.ns(\"app-headless-cms/admin/content-entries/bulk-actions\");\n\nexport const getEntriesLabel = (): string => {\n const { selected, isSelectedAll } = useContentEntriesList();\n\n if (isSelectedAll) {\n return \"all entries\";\n }\n\n return `${selected.length} ${selected.length === 1 ? \"entry\" : \"entries\"}`;\n};\n\nexport const BulkActions = () => {\n const { browser } = useContentEntryListConfig();\n const { selected, setSelected, isSelectedAll } = useContentEntriesList();\n\n const headline = useMemo((): string => {\n if (isSelectedAll) {\n return t(\"All entries selected:\");\n }\n\n return t`{count|count:1:entry:default:entries} selected:`({\n count: selected.length\n });\n }, [selected.length, isSelectedAll]);\n\n if (!selected.length) {\n return null;\n }\n\n return (\n <BulkActionsContainer>\n <BulkActionsInner>\n <ButtonsContainer>\n <Typography use={\"headline6\"}>{headline}</Typography>\n <Buttons actions={browser.bulkActions} />\n </ButtonsContainer>\n <IconButton icon={<Close />} onClick={() => setSelected([])} />\n </BulkActionsInner>\n </BulkActionsContainer>\n );\n};\n"],"mappings":";;;;;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AACA,IAAAE,SAAA,GAAAF,OAAA;AACA,IAAAG,OAAA,GAAAH,OAAA;AAEA,IAAAI,eAAA,GAAAJ,OAAA;AACA,IAAAK,MAAA,GAAAL,OAAA;AAEA,IAAAM,YAAA,GAAAN,OAAA;AACA,IAAAO,WAAA,GAAAP,OAAA;AACA,IAAAQ,KAAA,GAAAR,OAAA;AAAwC,IAAAS,eAAA;AAExC,IAAMC,CAAC,GAAGC,UAAI,CAACC,EAAE,CAAC,qDAAqD,CAAC;AAEjE,IAAMC,eAAe,GAAAC,OAAA,CAAAD,eAAA,GAAG,SAAlBA,eAAeA,CAAA,EAAiB;EACzC,IAAAE,qBAAA,GAAoC,IAAAC,4BAAqB,EAAC,CAAC;IAAnDC,QAAQ,GAAAF,qBAAA,CAARE,QAAQ;IAAEC,aAAa,GAAAH,qBAAA,CAAbG,aAAa;EAE/B,IAAIA,aAAa,EAAE;IACf,OAAO,aAAa;EACxB;EAEA,UAAAC,MAAA,CAAUF,QAAQ,CAACG,MAAM,OAAAD,MAAA,CAAIF,QAAQ,CAACG,MAAM,KAAK,CAAC,GAAG,OAAO,GAAG,SAAS;AAC5E,CAAC;AAEM,IAAMC,WAAW,GAAAP,OAAA,CAAAO,WAAA,GAAG,SAAdA,WAAWA,CAAA,EAAS;EAC7B,IAAAC,qBAAA,GAAoB,IAAAC,yCAAyB,EAAC,CAAC;IAAvCC,OAA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AE;IAACC,OAAO,EAAE,SAATA,OAAOA,CAAA;MAAA,OAAQlB,WAAW,CAAC,EAAE,CAAC;IAAA;EAAC,CAAE,CAChD,CACA,CAAC;AAE/B,CAAC","ignoreList":[]}
|
|
@@ -14,12 +14,12 @@ var BulkActionsContainer = exports.BulkActionsContainer = /*#__PURE__*/(0, _base
|
|
|
14
14
|
target: "e1fy8tii2",
|
|
15
15
|
label: "BulkActionsContainer"
|
|
16
16
|
})(process.env.NODE_ENV === "production" ? {
|
|
17
|
-
name: "
|
|
18
|
-
styles: "width:100%;height:64px;background-color:var(--mdc-theme-surface);border-bottom:1px solid rgba(0, 0, 0, 0.12);position:absolute;top:0;left:0;z-index:
|
|
17
|
+
name: "u1c486",
|
|
18
|
+
styles: "width:100%;height:64px;background-color:var(--mdc-theme-surface);border-bottom:1px solid rgba(0, 0, 0, 0.12);position:absolute;top:0;left:0;z-index:3"
|
|
19
19
|
} : {
|
|
20
|
-
name: "
|
|
21
|
-
styles: "width:100%;height:64px;background-color:var(--mdc-theme-surface);border-bottom:1px solid rgba(0, 0, 0, 0.12);position:absolute;top:0;left:0;z-index:
|
|
22
|
-
map: "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,
|
|
20
|
+
name: "u1c486",
|
|
21
|
+
styles: "width:100%;height:64px;background-color:var(--mdc-theme-surface);border-bottom:1px solid rgba(0, 0, 0, 0.12);position:absolute;top:0;left:0;z-index:3",
|
|
22
|
+
map: "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIkJ1bGtBY3Rpb25zLnN0eWxlZC50c3giXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBRzhDIiwiZmlsZSI6IkJ1bGtBY3Rpb25zLnN0eWxlZC50c3giLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgc3R5bGVkIGZyb20gXCJAZW1vdGlvbi9zdHlsZWRcIjtcbmltcG9ydCB7IEJ1dHRvbkNvbnRhaW5lciB9IGZyb20gXCJAd2ViaW55L2FwcC1hZG1pblwiO1xuXG5leHBvcnQgY29uc3QgQnVsa0FjdGlvbnNDb250YWluZXIgPSBzdHlsZWQuZGl2YFxuICAgIHdpZHRoOiAxMDAlO1xuICAgIGhlaWdodDogNjRweDtcbiAgICBiYWNrZ3JvdW5kLWNvbG9yOiB2YXIoLS1tZGMtdGhlbWUtc3VyZmFjZSk7XG4gICAgYm9yZGVyLWJvdHRvbTogMXB4IHNvbGlkIHJnYmEoMCwgMCwgMCwgMC4xMik7XG4gICAgcG9zaXRpb246IGFic29sdXRlO1xuICAgIHRvcDogMDtcbiAgICBsZWZ0OiAwO1xuICAgIHotaW5kZXg6IDM7XG5gO1xuXG5leHBvcnQgY29uc3QgQnVsa0FjdGlvbnNJbm5lciA9IHN0eWxlZC5kaXZgXG4gICAgaGVpZ2h0OiAxMDAlO1xuICAgIGRpc3BsYXk6IGZsZXg7XG4gICAgYWxpZ24taXRlbXM6IGNlbnRlcjtcbiAgICBqdXN0aWZ5LWNvbnRlbnQ6IHNwYWNlLWJldHdlZW47XG4gICAgcGFkZGluZzogMCAxNnB4O1xuYDtcblxuZXhwb3J0IGNvbnN0IEJ1dHRvbnNDb250YWluZXIgPSBzdHlsZWQuZGl2YFxuICAgIGRpc3BsYXk6IGZsZXg7XG4gICAgYWxpZ24taXRlbXM6IGNlbnRlcjtcblxuICAgICR7QnV0dG9uQ29udGFpbmVyfSB7XG4gICAgICAgIG1hcmdpbjogMDtcbiAgICB9XG5gO1xuIl19 */",
|
|
23
23
|
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
|
24
24
|
});
|
|
25
25
|
var BulkActionsInner = exports.BulkActionsInner = /*#__PURE__*/(0, _base.default)("div", process.env.NODE_ENV === "production" ? {
|
|
@@ -33,7 +33,7 @@ var BulkActionsInner = exports.BulkActionsInner = /*#__PURE__*/(0, _base.default
|
|
|
33
33
|
} : {
|
|
34
34
|
name: "kil1pm",
|
|
35
35
|
styles: "height:100%;display:flex;align-items:center;justify-content:space-between;padding:0 16px",
|
|
36
|
-
map: "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,
|
|
36
|
+
map: "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIkJ1bGtBY3Rpb25zLnN0eWxlZC50c3giXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBYzBDIiwiZmlsZSI6IkJ1bGtBY3Rpb25zLnN0eWxlZC50c3giLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgc3R5bGVkIGZyb20gXCJAZW1vdGlvbi9zdHlsZWRcIjtcbmltcG9ydCB7IEJ1dHRvbkNvbnRhaW5lciB9IGZyb20gXCJAd2ViaW55L2FwcC1hZG1pblwiO1xuXG5leHBvcnQgY29uc3QgQnVsa0FjdGlvbnNDb250YWluZXIgPSBzdHlsZWQuZGl2YFxuICAgIHdpZHRoOiAxMDAlO1xuICAgIGhlaWdodDogNjRweDtcbiAgICBiYWNrZ3JvdW5kLWNvbG9yOiB2YXIoLS1tZGMtdGhlbWUtc3VyZmFjZSk7XG4gICAgYm9yZGVyLWJvdHRvbTogMXB4IHNvbGlkIHJnYmEoMCwgMCwgMCwgMC4xMik7XG4gICAgcG9zaXRpb246IGFic29sdXRlO1xuICAgIHRvcDogMDtcbiAgICBsZWZ0OiAwO1xuICAgIHotaW5kZXg6IDM7XG5gO1xuXG5leHBvcnQgY29uc3QgQnVsa0FjdGlvbnNJbm5lciA9IHN0eWxlZC5kaXZgXG4gICAgaGVpZ2h0OiAxMDAlO1xuICAgIGRpc3BsYXk6IGZsZXg7XG4gICAgYWxpZ24taXRlbXM6IGNlbnRlcjtcbiAgICBqdXN0aWZ5LWNvbnRlbnQ6IHNwYWNlLWJldHdlZW47XG4gICAgcGFkZGluZzogMCAxNnB4O1xuYDtcblxuZXhwb3J0IGNvbnN0IEJ1dHRvbnNDb250YWluZXIgPSBzdHlsZWQuZGl2YFxuICAgIGRpc3BsYXk6IGZsZXg7XG4gICAgYWxpZ24taXRlbXM6IGNlbnRlcjtcblxuICAgICR7QnV0dG9uQ29udGFpbmVyfSB7XG4gICAgICAgIG1hcmdpbjogMDtcbiAgICB9XG5gO1xuIl19 */",
|
|
37
37
|
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
|
38
38
|
});
|
|
39
39
|
var ButtonsContainer = exports.ButtonsContainer = /*#__PURE__*/(0, _base.default)("div", process.env.NODE_ENV === "production" ? {
|
|
@@ -41,6 +41,6 @@ var ButtonsContainer = exports.ButtonsContainer = /*#__PURE__*/(0, _base.default
|
|
|
41
41
|
} : {
|
|
42
42
|
target: "e1fy8tii0",
|
|
43
43
|
label: "ButtonsContainer"
|
|
44
|
-
})("display:flex;align-items:center;", _appAdmin.ButtonContainer, "{margin:0;}" + (process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,
|
|
44
|
+
})("display:flex;align-items:center;", _appAdmin.ButtonContainer, "{margin:0;}" + (process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIkJ1bGtBY3Rpb25zLnN0eWxlZC50c3giXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBc0IwQyIsImZpbGUiOiJCdWxrQWN0aW9ucy5zdHlsZWQudHN4Iiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHN0eWxlZCBmcm9tIFwiQGVtb3Rpb24vc3R5bGVkXCI7XG5pbXBvcnQgeyBCdXR0b25Db250YWluZXIgfSBmcm9tIFwiQHdlYmlueS9hcHAtYWRtaW5cIjtcblxuZXhwb3J0IGNvbnN0IEJ1bGtBY3Rpb25zQ29udGFpbmVyID0gc3R5bGVkLmRpdmBcbiAgICB3aWR0aDogMTAwJTtcbiAgICBoZWlnaHQ6IDY0cHg7XG4gICAgYmFja2dyb3VuZC1jb2xvcjogdmFyKC0tbWRjLXRoZW1lLXN1cmZhY2UpO1xuICAgIGJvcmRlci1ib3R0b206IDFweCBzb2xpZCByZ2JhKDAsIDAsIDAsIDAuMTIpO1xuICAgIHBvc2l0aW9uOiBhYnNvbHV0ZTtcbiAgICB0b3A6IDA7XG4gICAgbGVmdDogMDtcbiAgICB6LWluZGV4OiAzO1xuYDtcblxuZXhwb3J0IGNvbnN0IEJ1bGtBY3Rpb25zSW5uZXIgPSBzdHlsZWQuZGl2YFxuICAgIGhlaWdodDogMTAwJTtcbiAgICBkaXNwbGF5OiBmbGV4O1xuICAgIGFsaWduLWl0ZW1zOiBjZW50ZXI7XG4gICAganVzdGlmeS1jb250ZW50OiBzcGFjZS1iZXR3ZWVuO1xuICAgIHBhZGRpbmc6IDAgMTZweDtcbmA7XG5cbmV4cG9ydCBjb25zdCBCdXR0b25zQ29udGFpbmVyID0gc3R5bGVkLmRpdmBcbiAgICBkaXNwbGF5OiBmbGV4O1xuICAgIGFsaWduLWl0ZW1zOiBjZW50ZXI7XG5cbiAgICAke0J1dHRvbkNvbnRhaW5lcn0ge1xuICAgICAgICBtYXJnaW46IDA7XG4gICAgfVxuYDtcbiJdfQ== */"));
|
|
45
45
|
|
|
46
46
|
//# sourceMappingURL=BulkActions.styled.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_appAdmin","require","_EMOTION_STRINGIFIED_CSS_ERROR__","BulkActionsContainer","exports","_base","default","process","env","NODE_ENV","target","label","name","styles","map","toString","BulkActionsInner","ButtonsContainer","ButtonContainer"],"sources":["BulkActions.styled.tsx"],"sourcesContent":["import styled from \"@emotion/styled\";\nimport { ButtonContainer } from \"@webiny/app-admin\";\n\nexport const BulkActionsContainer = styled.div`\n width: 100%;\n height: 64px;\n background-color: var(--mdc-theme-surface);\n border-bottom: 1px solid rgba(0, 0, 0, 0.12);\n position: absolute;\n top: 0;\n left: 0;\n z-index:
|
|
1
|
+
{"version":3,"names":["_appAdmin","require","_EMOTION_STRINGIFIED_CSS_ERROR__","BulkActionsContainer","exports","_base","default","process","env","NODE_ENV","target","label","name","styles","map","toString","BulkActionsInner","ButtonsContainer","ButtonContainer"],"sources":["BulkActions.styled.tsx"],"sourcesContent":["import styled from \"@emotion/styled\";\nimport { ButtonContainer } from \"@webiny/app-admin\";\n\nexport const BulkActionsContainer = styled.div`\n width: 100%;\n height: 64px;\n background-color: var(--mdc-theme-surface);\n border-bottom: 1px solid rgba(0, 0, 0, 0.12);\n position: absolute;\n top: 0;\n left: 0;\n z-index: 3;\n`;\n\nexport const BulkActionsInner = styled.div`\n height: 100%;\n display: flex;\n align-items: center;\n justify-content: space-between;\n padding: 0 16px;\n`;\n\nexport const ButtonsContainer = styled.div`\n display: flex;\n align-items: center;\n\n ${ButtonContainer} {\n margin: 0;\n }\n`;\n"],"mappings":";;;;;;;;AACA,IAAAA,SAAA,GAAAC,OAAA;AAAoD,SAAAC,iCAAA;AAE7C,IAAMC,oBAAoB,GAAAC,OAAA,CAAAD,oBAAA,oBAAAE,KAAA,CAAAC,OAAA,SAAAC,OAAA,CAAAC,GAAA,CAAAC,QAAA;EAAAC,MAAA;AAAA;EAAAA,MAAA;EAAAC,KAAA;AAAA,GAAAJ,OAAA,CAAAC,GAAA,CAAAC,QAAA;EAAAG,IAAA;EAAAC,MAAA;AAAA;EAAAD,IAAA;EAAAC,MAAA;EAAAC,GAAA;EAAAC,QAAA,EAAAb;AAAA,EAShC;AAEM,IAAMc,gBAAgB,GAAAZ,OAAA,CAAAY,gBAAA,oBAAAX,KAAA,CAAAC,OAAA,SAAAC,OAAA,CAAAC,GAAA,CAAAC,QAAA;EAAAC,MAAA;AAAA;EAAAA,MAAA;EAAAC,KAAA;AAAA,GAAAJ,OAAA,CAAAC,GAAA,CAAAC,QAAA;EAAAG,IAAA;EAAAC,MAAA;AAAA;EAAAD,IAAA;EAAAC,MAAA;EAAAC,GAAA;EAAAC,QAAA,EAAAb;AAAA,EAM5B;AAEM,IAAMe,gBAAgB,GAAAb,OAAA,CAAAa,gBAAA,oBAAAZ,KAAA,CAAAC,OAAA,SAAAC,OAAA,CAAAC,GAAA,CAAAC,QAAA;EAAAC,MAAA;AAAA;EAAAA,MAAA;EAAAC,KAAA;AAAA,uCAIvBO,yBAAe,mBAAAX,OAAA,CAAAC,GAAA,CAAAC,QAAA,wqCAGpB","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_sortBy","_interopRequireDefault","require","FieldsMapper","exports","_classCallCheck2","default","_createClass2","key","value","toRaw","model","_this","modelFields","fields","filter","modelField","excluded","includes","type","map","id","fieldId","label","multipleValues","predefinedValues","undefined","settings","sortBy","concat","_toConsumableArray2","defaultFields","_defineProperty2","enabled","values"],"sources":["FieldsMapper.ts"],"sourcesContent":["import sortBy from \"lodash/sortBy\";\nimport { CmsModel } from \"@webiny/app-headless-cms-common/types\";\nimport { FieldRaw } from \"@webiny/app-aco/components/AdvancedSearch/domain\";\n\nexport class FieldsMapper {\n private static excluded: FieldRaw[\"type\"][] = [\"rich-text\", \"file\", \"object\", \"dynamicZone\"];\n private static defaultFields: FieldRaw[] = [\n {\n id: \"status\",\n type: \"text\",\n label: \"Status\",\n multipleValues: false,\n predefinedValues: {\n enabled: true,\n values: [\n {\n label: \"Draft\",\n value: \"draft\"\n },\n {\n label: \"Published\",\n value: \"published\"\n },\n {\n label: \"Unpublished\",\n value: \"unpublished\"\n }\n ]\n }\n },\n {\n id: \"createdOn\",\n type: \"datetime\",\n label: \"Created on\",\n settings: { type: \"dateTimeWithoutTimezone\" }\n },\n {\n id: \"savedOn\",\n type: \"datetime\",\n label: \"Modified on\",\n settings: { type: \"dateTimeWithoutTimezone\" }\n }\n ];\n\n static toRaw(model: CmsModel): FieldRaw[] {\n const modelFields = model.fields\n .filter(modelField => !this.excluded.includes(modelField.type))\n .map(modelField => {\n return {\n id: modelField.fieldId,\n type: modelField.type,\n label: modelField.label,\n multipleValues: modelField.multipleValues || false,\n predefinedValues: modelField?.predefinedValues || undefined,\n settings: modelField.settings\n };\n });\n\n return sortBy([...this.defaultFields, ...modelFields], [\"label\"]);\n }\n}\n"],"mappings":";;;;;;;;;;;AAAA,IAAAA,OAAA,GAAAC,sBAAA,CAAAC,OAAA;AAAmC,IAItBC,YAAY,GAAAC,OAAA,CAAAD,YAAA;EAAA,SAAAA,aAAA;IAAA,IAAAE,gBAAA,CAAAC,OAAA,QAAAH,YAAA;EAAA;EAAA,WAAAI,aAAA,CAAAD,OAAA,EAAAH,YAAA;IAAAK,GAAA;IAAAC,KAAA,EAwCrB,
|
|
1
|
+
{"version":3,"names":["_sortBy","_interopRequireDefault","require","FieldsMapper","exports","_classCallCheck2","default","_createClass2","key","value","toRaw","model","_this","modelFields","fields","filter","modelField","excluded","includes","type","map","id","fieldId","label","multipleValues","predefinedValues","undefined","settings","sortBy","concat","_toConsumableArray2","defaultFields","_defineProperty2","enabled","values"],"sources":["FieldsMapper.ts"],"sourcesContent":["import sortBy from \"lodash/sortBy\";\nimport { CmsModel } from \"@webiny/app-headless-cms-common/types\";\nimport { FieldRaw } from \"@webiny/app-aco/components/AdvancedSearch/domain\";\n\nexport class FieldsMapper {\n private static excluded: FieldRaw[\"type\"][] = [\"rich-text\", \"file\", \"object\", \"dynamicZone\"];\n private static defaultFields: FieldRaw[] = [\n {\n id: \"status\",\n type: \"text\",\n label: \"Status\",\n multipleValues: false,\n predefinedValues: {\n enabled: true,\n values: [\n {\n label: \"Draft\",\n value: \"draft\"\n },\n {\n label: \"Published\",\n value: \"published\"\n },\n {\n label: \"Unpublished\",\n value: \"unpublished\"\n }\n ]\n }\n },\n {\n id: \"createdOn\",\n type: \"datetime\",\n label: \"Created on\",\n settings: { type: \"dateTimeWithoutTimezone\" }\n },\n {\n id: \"savedOn\",\n type: \"datetime\",\n label: \"Modified on\",\n settings: { type: \"dateTimeWithoutTimezone\" }\n }\n ];\n\n static toRaw(model: CmsModel): FieldRaw[] {\n const modelFields = model.fields\n .filter(modelField => !this.excluded.includes(modelField.type))\n .map(modelField => {\n return {\n id: modelField.fieldId,\n type: modelField.type,\n label: modelField.label,\n multipleValues: modelField.multipleValues || false,\n predefinedValues: modelField?.predefinedValues || undefined,\n settings: modelField.settings\n };\n });\n\n return sortBy([...this.defaultFields, ...modelFields], [\"label\"]);\n }\n}\n"],"mappings":";;;;;;;;;;;AAAA,IAAAA,OAAA,GAAAC,sBAAA,CAAAC,OAAA;AAAmC,IAItBC,YAAY,GAAAC,OAAA,CAAAD,YAAA;EAAA,SAAAA,aAAA;IAAA,IAAAE,gBAAA,CAAAC,OAAA,QAAAH,YAAA;EAAA;EAAA,WAAAI,aAAA,CAAAD,OAAA,EAAAH,YAAA;IAAAK,GAAA;IAAAC,KAAA,EAwCrB,SAAOC,KAAKA,CAACC,KAAe,EAAc;MAAA,IAAAC,KAAA;MACtC,IAAMC,WAAW,GAAGF,KAAK,CAACG,MAAM,CAC3BC,MAAM,CAAC,UAAAC,UAAU;QAAA,OAAI,CAACJ,KAAI,CAACK,QAAQ,CAACC,QAAQ,CAACF,UAAU,CAACG,IAAI,CAAC;MAAA,EAAC,CAC9DC,GAAG,CAAC,UAAAJ,UAAU,EAAI;QACf,OAAO;UACHK,EAAE,EAAEL,UAAU,CAACM,OAAO;UACtBH,IAAI,EAAEH,UAAU,CAACG,IAAI;UACrBI,KAAK,EAAEP,UAAU,CAACO,KAAK;UACvBC,cAAc,EAAER,UAAU,CAACQ,cAAc,IAAI,KAAK;UAClDC,gBAAgB,EAAET,UAAU,EAAES,gBAAgB,IAAIC,SAAS;UAC3DC,QAAQ,EAAEX,UAAU,CAACW;QACzB,CAAC;MACL,CAAC,CAAC;MAEN,OAAO,IAAAC,eAAM,KAAAC,MAAA,KAAAC,mBAAA,CAAAxB,OAAA,EAAK,IAAI,CAACyB,aAAa,OAAAD,mBAAA,CAAAxB,OAAA,EAAKO,WAAW,IAAG,CAAC,OAAO,CAAC,CAAC;IACrE;EAAC;AAAA;AAAA,IAAAmB,gBAAA,CAAA1B,OAAA,EAvDQH,YAAY,cACyB,CAAC,WAAW,EAAE,MAAM,EAAE,QAAQ,EAAE,aAAa,CAAC;AAAA,IAAA6B,gBAAA,CAAA1B,OAAA,EADnFH,YAAY,mBAEsB,CACvC;EACIkB,EAAE,EAAE,QAAQ;EACZF,IAAI,EAAE,MAAM;EACZI,KAAK,EAAE,QAAQ;EACfC,cAAc,EAAE,KAAK;EACrBC,gBAAgB,EAAE;IACdQ,OAAO,EAAE,IAAI;IACbC,MAAM,EAAE,CACJ;MACIX,KAAK,EAAE,OAAO;MACdd,KAAK,EAAE;IACX,CAAC,EACD;MACIc,KAAK,EAAE,WAAW;MAClBd,KAAK,EAAE;IACX,CAAC,EACD;MACIc,KAAK,EAAE,aAAa;MACpBd,KAAK,EAAE;IACX,CAAC;EAET;AACJ,CAAC,EACD;EACIY,EAAE,EAAE,WAAW;EACfF,IAAI,EAAE,UAAU;EAChBI,KAAK,EAAE,YAAY;EACnBI,QAAQ,EAAE;IAAER,IAAI,EAAE;EAA0B;AAChD,CAAC,EACD;EACIE,EAAE,EAAE,SAAS;EACbF,IAAI,EAAE,UAAU;EAChBI,KAAK,EAAE,aAAa;EACpBI,QAAQ,EAAE;IAAER,IAAI,EAAE;EAA0B;AAChD,CAAC,CACJ","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","_interopRequireWildcard","require","_form","_plugins","_Select","getValidFilterValue","value","undefined","FilterByStatus","exports","bind","useBind","name","beforeChange","cb","options","useMemo","label","filterStatusPlugins","plugins","byType","forEach","plugin","push","default","createElement","Select","Object","assign","size","placeholder"],"sources":["FilterByStatus.tsx"],"sourcesContent":["import React, { useMemo } from \"react\";\n\nimport { useBind } from \"@webiny/form\";\nimport { plugins } from \"@webiny/plugins\";\nimport { Select } from \"@webiny/ui/Select\";\n\nimport { CmsEntryFilterStatusPlugin } from \"@webiny/app-headless-cms-common/types\";\n\nconst getValidFilterValue = (value: string): string | undefined => {\n if (value === \"all\" || value === \"\") {\n return undefined;\n }\n return value;\n};\n\nexport const FilterByStatus = () => {\n const bind = useBind({\n name: \"status\",\n beforeChange(value, cb) {\n cb(getValidFilterValue(value));\n }\n });\n\n const options = useMemo(() => {\n const options = [\n { label: \"All\", value: \"all\" },\n { label: \"Draft\", value: \"draft\" },\n { label: \"Published\", value: \"published\" },\n { label: \"Unpublished\", value: \"unpublished\" }\n ];\n\n const filterStatusPlugins =\n plugins.byType<CmsEntryFilterStatusPlugin>(\"cms.entry.filter.status\");\n\n filterStatusPlugins.forEach(plugin => {\n options.push({ label: plugin.label, value: plugin.value });\n });\n\n return options;\n }, []);\n\n return <Select {...bind} size={\"medium\"} placeholder={\"Filter by status\"} options={options} />;\n};\n"],"mappings":";;;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AAEA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,QAAA,GAAAF,OAAA;AACA,IAAAG,OAAA,GAAAH,OAAA;AAIA,IAAMI,mBAAmB,GAAG,SAAtBA,mBAAmBA,CAAIC,KAAa,EAAyB;EAC/D,IAAIA,KAAK,KAAK,KAAK,IAAIA,KAAK,KAAK,EAAE,EAAE;IACjC,OAAOC,SAAS;EACpB;EACA,OAAOD,KAAK;AAChB,CAAC;AAEM,IAAME,cAAc,GAAAC,OAAA,CAAAD,cAAA,GAAG,SAAjBA,cAAcA,CAAA,EAAS;EAChC,IAAME,IAAI,GAAG,IAAAC,aAAO,EAAC;IACjBC,IAAI,EAAE,QAAQ;IACdC,YAAY,
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireWildcard","require","_form","_plugins","_Select","getValidFilterValue","value","undefined","FilterByStatus","exports","bind","useBind","name","beforeChange","cb","options","useMemo","label","filterStatusPlugins","plugins","byType","forEach","plugin","push","default","createElement","Select","Object","assign","size","placeholder"],"sources":["FilterByStatus.tsx"],"sourcesContent":["import React, { useMemo } from \"react\";\n\nimport { useBind } from \"@webiny/form\";\nimport { plugins } from \"@webiny/plugins\";\nimport { Select } from \"@webiny/ui/Select\";\n\nimport { CmsEntryFilterStatusPlugin } from \"@webiny/app-headless-cms-common/types\";\n\nconst getValidFilterValue = (value: string): string | undefined => {\n if (value === \"all\" || value === \"\") {\n return undefined;\n }\n return value;\n};\n\nexport const FilterByStatus = () => {\n const bind = useBind({\n name: \"status\",\n beforeChange(value, cb) {\n cb(getValidFilterValue(value));\n }\n });\n\n const options = useMemo(() => {\n const options = [\n { label: \"All\", value: \"all\" },\n { label: \"Draft\", value: \"draft\" },\n { label: \"Published\", value: \"published\" },\n { label: \"Unpublished\", value: \"unpublished\" }\n ];\n\n const filterStatusPlugins =\n plugins.byType<CmsEntryFilterStatusPlugin>(\"cms.entry.filter.status\");\n\n filterStatusPlugins.forEach(plugin => {\n options.push({ label: plugin.label, value: plugin.value });\n });\n\n return options;\n }, []);\n\n return <Select {...bind} size={\"medium\"} placeholder={\"Filter by status\"} options={options} />;\n};\n"],"mappings":";;;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AAEA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,QAAA,GAAAF,OAAA;AACA,IAAAG,OAAA,GAAAH,OAAA;AAIA,IAAMI,mBAAmB,GAAG,SAAtBA,mBAAmBA,CAAIC,KAAa,EAAyB;EAC/D,IAAIA,KAAK,KAAK,KAAK,IAAIA,KAAK,KAAK,EAAE,EAAE;IACjC,OAAOC,SAAS;EACpB;EACA,OAAOD,KAAK;AAChB,CAAC;AAEM,IAAME,cAAc,GAAAC,OAAA,CAAAD,cAAA,GAAG,SAAjBA,cAAcA,CAAA,EAAS;EAChC,IAAME,IAAI,GAAG,IAAAC,aAAO,EAAC;IACjBC,IAAI,EAAE,QAAQ;IACdC,YAAY,WAAZA,YAAYA,CAACP,KAAK,EAAEQ,EAAE,EAAE;MACpBA,EAAE,CAACT,mBAAmB,CAACC,KAAK,CAAC,CAAC;IAClC;EACJ,CAAC,CAAC;EAEF,IAAMS,OAAO,GAAG,IAAAC,cAAO,EAAC,YAAM;IAC1B,IAAMD,OAAO,GAAG,CACZ;MAAEE,KAAK,EAAE,KAAK;MAAEX,KAAK,EAAE;IAAM,CAAC,EAC9B;MAAEW,KAAK,EAAE,OAAO;MAAEX,KAAK,EAAE;IAAQ,CAAC,EAClC;MAAEW,KAAK,EAAE,WAAW;MAAEX,KAAK,EAAE;IAAY,CAAC,EAC1C;MAAEW,KAAK,EAAE,aAAa;MAAEX,KAAK,EAAE;IAAc,CAAC,CACjD;IAED,IAAMY,mBAAmB,GACrBC,gBAAO,CAACC,MAAM,CAA6B,yBAAyB,CAAC;IAEzEF,mBAAmB,CAACG,OAAO,CAAC,UAAAC,MAAM,EAAI;MAClCP,OAAO,CAACQ,IAAI,CAAC;QAAEN,KAAK,EAAEK,MAAM,CAACL,KAAK;QAAEX,KAAK,EAAEgB,MAAM,CAAChB;MAAM,CAAC,CAAC;IAC9D,CAAC,CAAC;IAEF,OAAOS,OAAO;EAClB,CAAC,EAAE,EAAE,CAAC;EAEN,oBAAOhB,MAAA,CAAAyB,OAAA,CAAAC,aAAA,CAACrB,OAAA,CAAAsB,MAAM,EAAAC,MAAA,CAAAC,MAAA,KAAKlB,IAAI;IAAEmB,IAAI,EAAE,QAAS;IAACC,WAAW,EAAE,kBAAmB;IAACf,OAAO,EAAEA;EAAQ,EAAE,CAAC;AAClG,CAAC","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_entries","require","EntriesGraphQLGateway","exports","client","_classCallCheck2","default","_createClass2","key","value","list","modelIds","query","_await$this$client$qu","SEARCH_CONTENT_ENTRIES","variables","limit","fetchPolicy","response","data","Error","_response$searchConte","searchContentEntries","error","message","get","modelId","id","_await$this$client$qu2","GET_CONTENT_ENTRY","entry","_response$getLatestCo","getLatestContentEntry"],"sources":["EntriesGraphQLGateway.ts"],"sourcesContent":["import { ApolloClient } from \"apollo-client\";\nimport { EntriesGatewayInterface } from \"./EntriesGatewayInterface\";\nimport { GET_CONTENT_ENTRY, SEARCH_CONTENT_ENTRIES } from \"./entries.gql\";\nimport {\n GetEntryQueryVariables,\n GetEntryResponse,\n ListEntriesQueryVariables,\n ListEntriesResponse\n} from \"./entries.types\";\n\nexport class EntriesGraphQLGateway implements EntriesGatewayInterface {\n private client: ApolloClient<any>;\n\n constructor(client: ApolloClient<any>) {\n this.client = client;\n }\n\n async list(modelIds: string[], query?: string) {\n const { data: response } = await this.client.query<\n ListEntriesResponse,\n ListEntriesQueryVariables\n >({\n query: SEARCH_CONTENT_ENTRIES,\n variables: {\n modelIds,\n query,\n limit: 50\n },\n fetchPolicy: \"network-only\"\n });\n\n if (!response) {\n throw new Error(\"Network error while listing entries.\");\n }\n\n const { data, error } = response.searchContentEntries;\n\n if (!data) {\n throw new Error(error?.message || \"Could not fetch entries.\");\n }\n\n return data;\n }\n\n async get(modelId: string, id: string) {\n const { data: response } = await this.client.query<\n GetEntryResponse,\n GetEntryQueryVariables\n >({\n query: GET_CONTENT_ENTRY,\n variables: {\n entry: {\n modelId,\n id\n }\n },\n fetchPolicy: \"network-only\"\n });\n\n if (!response) {\n throw new Error(\"Network error while getting entries.\");\n }\n\n const { data, error } = response.getLatestContentEntry;\n\n if (!data) {\n throw new Error(error?.message || \"Could not fetch entry.\");\n }\n\n return data;\n }\n}\n"],"mappings":";;;;;;;;;AAEA,IAAAA,QAAA,GAAAC,OAAA;AAA0E,IAQ7DC,qBAAqB,GAAAC,OAAA,CAAAD,qBAAA;EAG9B,SAAAA,sBAAYE,MAAyB,EAAE;IAAA,IAAAC,gBAAA,CAAAC,OAAA,QAAAJ,qBAAA;IACnC,IAAI,CAACE,MAAM,GAAGA,MAAM;EACxB;EAAC,WAAAG,aAAA,CAAAD,OAAA,EAAAJ,qBAAA;IAAAM,GAAA;IAAAC,KAAA,EAED,
|
|
1
|
+
{"version":3,"names":["_entries","require","EntriesGraphQLGateway","exports","client","_classCallCheck2","default","_createClass2","key","value","list","modelIds","query","_await$this$client$qu","SEARCH_CONTENT_ENTRIES","variables","limit","fetchPolicy","response","data","Error","_response$searchConte","searchContentEntries","error","message","get","modelId","id","_await$this$client$qu2","GET_CONTENT_ENTRY","entry","_response$getLatestCo","getLatestContentEntry"],"sources":["EntriesGraphQLGateway.ts"],"sourcesContent":["import { ApolloClient } from \"apollo-client\";\nimport { EntriesGatewayInterface } from \"./EntriesGatewayInterface\";\nimport { GET_CONTENT_ENTRY, SEARCH_CONTENT_ENTRIES } from \"./entries.gql\";\nimport {\n GetEntryQueryVariables,\n GetEntryResponse,\n ListEntriesQueryVariables,\n ListEntriesResponse\n} from \"./entries.types\";\n\nexport class EntriesGraphQLGateway implements EntriesGatewayInterface {\n private client: ApolloClient<any>;\n\n constructor(client: ApolloClient<any>) {\n this.client = client;\n }\n\n async list(modelIds: string[], query?: string) {\n const { data: response } = await this.client.query<\n ListEntriesResponse,\n ListEntriesQueryVariables\n >({\n query: SEARCH_CONTENT_ENTRIES,\n variables: {\n modelIds,\n query,\n limit: 50\n },\n fetchPolicy: \"network-only\"\n });\n\n if (!response) {\n throw new Error(\"Network error while listing entries.\");\n }\n\n const { data, error } = response.searchContentEntries;\n\n if (!data) {\n throw new Error(error?.message || \"Could not fetch entries.\");\n }\n\n return data;\n }\n\n async get(modelId: string, id: string) {\n const { data: response } = await this.client.query<\n GetEntryResponse,\n GetEntryQueryVariables\n >({\n query: GET_CONTENT_ENTRY,\n variables: {\n entry: {\n modelId,\n id\n }\n },\n fetchPolicy: \"network-only\"\n });\n\n if (!response) {\n throw new Error(\"Network error while getting entries.\");\n }\n\n const { data, error } = response.getLatestContentEntry;\n\n if (!data) {\n throw new Error(error?.message || \"Could not fetch entry.\");\n }\n\n return data;\n }\n}\n"],"mappings":";;;;;;;;;AAEA,IAAAA,QAAA,GAAAC,OAAA;AAA0E,IAQ7DC,qBAAqB,GAAAC,OAAA,CAAAD,qBAAA;EAG9B,SAAAA,sBAAYE,MAAyB,EAAE;IAAA,IAAAC,gBAAA,CAAAC,OAAA,QAAAJ,qBAAA;IACnC,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AC;MAC3D;MAEA,IAAAW,qBAAA,GAAwBb,QAAQ,CAACc,qBAAqB;QAA9Cb,IAAI,GAAAY,qBAAA,CAAJZ,IAAI;QAAEI,KAAK,GAAAQ,qBAAA,CAALR,KAAK;MAEnB,IAAI,CAACJ,IAAI,EAAE;QACP,MAAM,IAAIC,KAAK,CAACG,KAAK,EAAEC,OAAO,IAAI,wBAAwB,CAAC;MAC/D;MAEA,OAAOL,IAAI;IACf;EAAC;AAAA","ignoreList":[]}
|
package/admin/components/ContentEntries/Filters/RefFieldRenderer/components/AutoComplete.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","_interopRequireDefault","require","_form","_AutoComplete","AutoComplete","exports","props","default","createElement","Bind","name","_ref","onChange","validation","label","value","vm","selected","_","selection","JSON","stringify","entryId","modelId","onInput","options","loading"],"sources":["AutoComplete.tsx"],"sourcesContent":["import React from \"react\";\nimport { Bind } from \"@webiny/form\";\nimport { AutoComplete as BaseAutocomplete } from \"@webiny/ui/AutoComplete\";\nimport { RefPresenterViewModel } from \"./RefPresenter\";\n\nexport interface AutoCompleteProps {\n vm: RefPresenterViewModel;\n name: string;\n onInput(value: string): void;\n}\n\nexport const AutoComplete = (props: AutoCompleteProps) => {\n return (\n <Bind name={props.name}>\n {({ onChange, validation }) => (\n <BaseAutocomplete\n label={\"Value\"}\n value={props.vm.selected}\n validation={validation}\n onChange={(_, selection) => {\n if (!selection) {\n return;\n }\n\n /**\n * We currently store the value of the FieldDTO as a string.\n * For REF fields, we need to save both modelId and entryId to load this back when showing pre-populated options.\n * To achieve this, we'll store them in an object and convert it into a JSON string.\n */\n onChange(\n JSON.stringify({\n entryId: selection.entryId,\n modelId: selection.modelId\n })\n );\n }}\n onInput={props.onInput}\n options={props.vm.options}\n loading={props.vm.loading}\n />\n )}\n </Bind>\n );\n};\n"],"mappings":";;;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,aAAA,GAAAF,OAAA;AASO,IAAMG,YAAY,GAAAC,OAAA,CAAAD,YAAA,GAAG,SAAfA,YAAYA,CAAIE,KAAwB,EAAK;EACtD,oBACIP,MAAA,CAAAQ,OAAA,CAAAC,aAAA,CAACN,KAAA,CAAAO,IAAI;IAACC,IAAI,EAAEJ,KAAK,CAACI;EAAK,GAClB,UAAAC,IAAA;IAAA,IAAGC,SAAQ,GAAAD,IAAA,CAARC,QAAQ;MAAEC,UAAU,GAAAF,IAAA,CAAVE,UAAU;IAAA,oBACpBd,MAAA,CAAAQ,OAAA,CAAAC,aAAA,CAACL,aAAA,CAAAC,YAAgB;MACbU,KAAK,EAAE,OAAQ;MACfC,KAAK,EAAET,KAAK,CAACU,EAAE,CAACC,QAAS;MACzBJ,UAAU,EAAEA,UAAW;MACvBD,QAAQ,EAAE,
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireDefault","require","_form","_AutoComplete","AutoComplete","exports","props","default","createElement","Bind","name","_ref","onChange","validation","label","value","vm","selected","_","selection","JSON","stringify","entryId","modelId","onInput","options","loading"],"sources":["AutoComplete.tsx"],"sourcesContent":["import React from \"react\";\nimport { Bind } from \"@webiny/form\";\nimport { AutoComplete as BaseAutocomplete } from \"@webiny/ui/AutoComplete\";\nimport { RefPresenterViewModel } from \"./RefPresenter\";\n\nexport interface AutoCompleteProps {\n vm: RefPresenterViewModel;\n name: string;\n onInput(value: string): void;\n}\n\nexport const AutoComplete = (props: AutoCompleteProps) => {\n return (\n <Bind name={props.name}>\n {({ onChange, validation }) => (\n <BaseAutocomplete\n label={\"Value\"}\n value={props.vm.selected}\n validation={validation}\n onChange={(_, selection) => {\n if (!selection) {\n return;\n }\n\n /**\n * We currently store the value of the FieldDTO as a string.\n * For REF fields, we need to save both modelId and entryId to load this back when showing pre-populated options.\n * To achieve this, we'll store them in an object and convert it into a JSON string.\n */\n onChange(\n JSON.stringify({\n entryId: selection.entryId,\n modelId: selection.modelId\n })\n );\n }}\n onInput={props.onInput}\n options={props.vm.options}\n loading={props.vm.loading}\n />\n )}\n </Bind>\n );\n};\n"],"mappings":";;;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,aAAA,GAAAF,OAAA;AASO,IAAMG,YAAY,GAAAC,OAAA,CAAAD,YAAA,GAAG,SAAfA,YAAYA,CAAIE,KAAwB,EAAK;EACtD,oBACIP,MAAA,CAAAQ,OAAA,CAAAC,aAAA,CAACN,KAAA,CAAAO,IAAI;IAACC,IAAI,EAAEJ,KAAK,CAACI;EAAK,GAClB,UAAAC,IAAA;IAAA,IAAGC,SAAQ,GAAAD,IAAA,CAARC,QAAQ;MAAEC,UAAU,GAAAF,IAAA,CAAVE,UAAU;IAAA,oBACpBd,MAAA,CAAAQ,OAAA,CAAAC,aAAA,CAACL,aAAA,CAAAC,YAAgB;MACbU,KAAK,EAAE,OAAQ;MACfC,KAAK,EAAET,KAAK,CAACU,EAAE,CAACC,QAAS;MACzBJ,UAAU,EAAEA,UAAW;MACvBD,QAAQ,EAAE,SAAVA,QAAQA,CAAGM,CAAC,EAAEC,SAAS,EAAK;QACxB,IAAI,CAACA,SAAS,EAAE;UACZ;QACJ;;QAEA;AACxB;AACA;AACA;AACA;QACwBP,SAAQ,CACJQ,IAAI,CAACC,SAAS,CAAC;UACXC,OAAO,EAAEH,SAAS,CAACG,OAAO;UAC1BC,OAAO,EAAEJ,SAAS,CAACI;QACvB,CAAC,CACL,CAAC;MACL,CAAE;MACFC,OAAO,EAAElB,KAAK,CAACkB,OAAQ;MACvBC,OAAO,EAAEnB,KAAK,CAACU,EAAE,CAACS,OAAQ;MAC1BC,OAAO,EAAEpB,KAAK,CAACU,EAAE,CAACU;IAAQ,CAC7B,CAAC;EAAA,CAEJ,CAAC;AAEf,CAAC","ignoreList":[]}
|
package/admin/components/ContentEntries/Filters/RefFieldRenderer/components/RefPresenter.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_mobx","require","RefPresenter","exports","repository","_classCallCheck2","default","_defineProperty2","makeAutoObservable","_createClass2","key","value","load","_this","_JSON$parse","JSON","parse","entryId","modelId","entry","getEntryById","runInAction","currentEntry","error","console","search","query","listEntries","get","selected","id","name","title","undefined","loading","getLoading","isLoading","options","getEntries","map"],"sources":["RefPresenter.ts"],"sourcesContent":["import { makeAutoObservable, runInAction } from \"mobx\";\nimport { EntryDTO, EntryRepository } from \"../domain\";\n\ninterface EntryOption {\n id: string;\n name: string;\n}\n\nexport interface RefPresenterViewModel {\n selected?: EntryOption;\n options: EntryOption[];\n loading: boolean;\n}\n\ninterface IRefPresenter {\n load(id?: string): Promise<void>;\n search(query: string): Promise<void>;\n get vm(): RefPresenterViewModel;\n}\n\nexport class RefPresenter implements IRefPresenter {\n private repository: EntryRepository;\n private currentEntry: EntryDTO | null = null;\n\n constructor(repository: EntryRepository) {\n this.repository = repository;\n makeAutoObservable(this);\n }\n\n async load(value?: string) {\n try {\n if (!value) {\n return;\n }\n\n /**\n * Currently, the FieldDTO `value` is stored as a string. For REF fields, we save `modelId` and `entryId` in an object and convert it into a JSON string.\n * Here, we parse the string to extract parameters, which we subsequently use to retrieve the entry from the repository.\n */\n const { entryId, modelId } = JSON.parse(value);\n\n const entry = await this.repository.getEntryById(modelId, entryId);\n\n if (!entry) {\n return;\n }\n\n runInAction(() => {\n this.currentEntry = entry;\n });\n } catch (error) {\n console.error(\"Error while loading initial value\", error);\n return;\n }\n }\n\n async search(query: string) {\n await this.repository.listEntries(query);\n }\n\n get vm() {\n return {\n selected: this.currentEntry\n ? {\n id: this.currentEntry.id,\n name: this.currentEntry.title,\n entryId: this.currentEntry.entryId,\n modelId: this.currentEntry.modelId\n }\n : undefined,\n loading: this.repository.getLoading().isLoading,\n options: this.repository.getEntries().map(entry => ({\n id: entry.id,\n name: entry.title,\n entryId: entry.entryId,\n modelId: entry.modelId\n }))\n };\n }\n}\n"],"mappings":";;;;;;;;;;AAAA,IAAAA,KAAA,GAAAC,OAAA;AAAuD,IAoB1CC,YAAY,GAAAC,OAAA,CAAAD,YAAA;EAIrB,SAAAA,aAAYE,UAA2B,EAAE;IAAA,IAAAC,gBAAA,CAAAC,OAAA,QAAAJ,YAAA;IAAA,IAAAK,gBAAA,CAAAD,OAAA,wBAFD,IAAI;IAGxC,IAAI,CAACF,UAAU,GAAGA,UAAU;IAC5B,IAAAI,wBAAkB,EAAC,IAAI,CAAC;EAC5B;EAAC,WAAAC,aAAA,CAAAH,OAAA,EAAAJ,YAAA;IAAAQ,GAAA;IAAAC,KAAA,EAED,
|
|
1
|
+
{"version":3,"names":["_mobx","require","RefPresenter","exports","repository","_classCallCheck2","default","_defineProperty2","makeAutoObservable","_createClass2","key","value","load","_this","_JSON$parse","JSON","parse","entryId","modelId","entry","getEntryById","runInAction","currentEntry","error","console","search","query","listEntries","get","selected","id","name","title","undefined","loading","getLoading","isLoading","options","getEntries","map"],"sources":["RefPresenter.ts"],"sourcesContent":["import { makeAutoObservable, runInAction } from \"mobx\";\nimport { EntryDTO, EntryRepository } from \"../domain\";\n\ninterface EntryOption {\n id: string;\n name: string;\n}\n\nexport interface RefPresenterViewModel {\n selected?: EntryOption;\n options: EntryOption[];\n loading: boolean;\n}\n\ninterface IRefPresenter {\n load(id?: string): Promise<void>;\n search(query: string): Promise<void>;\n get vm(): RefPresenterViewModel;\n}\n\nexport class RefPresenter implements IRefPresenter {\n private repository: EntryRepository;\n private currentEntry: EntryDTO | null = null;\n\n constructor(repository: EntryRepository) {\n this.repository = repository;\n makeAutoObservable(this);\n }\n\n async load(value?: string) {\n try {\n if (!value) {\n return;\n }\n\n /**\n * Currently, the FieldDTO `value` is stored as a string. For REF fields, we save `modelId` and `entryId` in an object and convert it into a JSON string.\n * Here, we parse the string to extract parameters, which we subsequently use to retrieve the entry from the repository.\n */\n const { entryId, modelId } = JSON.parse(value);\n\n const entry = await this.repository.getEntryById(modelId, entryId);\n\n if (!entry) {\n return;\n }\n\n runInAction(() => {\n this.currentEntry = entry;\n });\n } catch (error) {\n console.error(\"Error while loading initial value\", error);\n return;\n }\n }\n\n async search(query: string) {\n await this.repository.listEntries(query);\n }\n\n get vm() {\n return {\n selected: this.currentEntry\n ? {\n id: this.currentEntry.id,\n name: this.currentEntry.title,\n entryId: this.currentEntry.entryId,\n modelId: this.currentEntry.modelId\n }\n : undefined,\n loading: this.repository.getLoading().isLoading,\n options: this.repository.getEntries().map(entry => ({\n id: entry.id,\n name: entry.title,\n entryId: entry.entryId,\n modelId: entry.modelId\n }))\n };\n }\n}\n"],"mappings":";;;;;;;;;;AAAA,IAAAA,KAAA,GAAAC,OAAA;AAAuD,IAoB1CC,YAAY,GAAAC,OAAA,CAAAD,YAAA;EAIrB,SAAAA,aAAYE,UAA2B,EAAE;IAAA,IAAAC,gBAAA,CAAAC,OAAA,QAAAJ,YAAA;IAAA,IAAAK,gBAAA,CAAAD,OAAA,wBAFD,IAAI;IAGxC,IAAI,CAACF,UAAU,GAAGA,UAAU;IAC5B,IAAAI,wBAAkB,EAAC,IAAI,CAAC;EAC5B;EAAC,WAAAC,aAAA,CAAAH,OAAA,EAAAJ,YAAA;IAAAQ,GAAA;IAAAC,KAAA,EAED,eAAMC,IAAIA,CAACD,KAAc,EAAE;MAAA,IAAAE,KAAA;MACvB,IAAI;QACA,IAAI,CAACF,KAAK,EAAE;UACR;QACJ;;QAEA;AACZ;AACA;AACA;QACY,IAAAG,WAAA,GAA6BC,IAAI,CAACC,KAAK,CAACL,KAAK,CAAC;UAAtCM,OAAO,GAAAH,WAAA,CAAPG,OAAO;UAAEC,OAAO,GAAAJ,WAAA,CAAPI,OAAO;QAExB,IAAMC,KAAK,GAAG,MAAM,IAAI,CAACf,UAAU,CAACgB,YAAY,CAACF,OAAO,EAAED,OAAO,CAAC;QAElE,IAAI,CAACE,KAAK,EAAE;UACR;QACJ;QAEA,IAAAE,iBAAW,EAAC,YAAM;UACdR,KAAI,CAACS,YAAY,GAAGH,KAAK;QAC7B,CAAC,CAAC;MACN,CAAC,CAAC,OAAOI,KAAK,EAAE;QACZC,OAAO,CAACD,KAAK,CAAC,mCAAmC,EAAEA,KAAK,CAAC;QACzD;MACJ;IACJ;EAAC;IAAAb,GAAA;IAAAC,KAAA,EAED,eAAMc,MAAMA,CAACC,KAAa,EAAE;MACxB,MAAM,IAAI,CAACtB,UAAU,CAACuB,WAAW,CAACD,KAAK,CAAC;IAC5C;EAAC;IAAAhB,GAAA;IAAAkB,GAAA,EAED,SAAAA,IAAA,EAAS;MACL,OAAO;QACHC,QAAQ,EAAE,IAAI,CAACP,YAAY,GACrB;UACIQ,EAAE,EAAE,IAAI,CAACR,YAAY,CAACQ,EAAE;UACxBC,IAAI,EAAE,IAAI,CAACT,YAAY,CAACU,KAAK;UAC7Bf,OAAO,EAAE,IAAI,CAACK,YAAY,CAACL,OAAO;UAClCC,OAAO,EAAE,IAAI,CAACI,YAAY,CAACJ;QAC/B,CAAC,GACDe,SAAS;QACfC,OAAO,EAAE,IAAI,CAAC9B,UAAU,CAAC+B,UAAU,CAAC,CAAC,CAACC,SAAS;QAC/CC,OAAO,EAAE,IAAI,CAACjC,UAAU,CAACkC,UAAU,CAAC,CAAC,CAACC,GAAG,CAAC,UAAApB,KAAK;UAAA,OAAK;YAChDW,EAAE,EAAEX,KAAK,CAACW,EAAE;YACZC,IAAI,EAAEZ,KAAK,CAACa,KAAK;YACjBf,OAAO,EAAEE,KAAK,CAACF,OAAO;YACtBC,OAAO,EAAEC,KAAK,CAACD;UACnB,CAAC;QAAA,CAAC;MACN,CAAC;IACL;EAAC;AAAA","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["Entry","exports","data","_classCallCheck2","default","id","entryId","title","modelId","_createClass2","key","value","create"],"sources":["Entry.ts"],"sourcesContent":["export interface EntryReference {\n id: string;\n entryId: string;\n title: string;\n model: {\n modelId: string;\n };\n}\n\nexport interface EntryDTO {\n id: string;\n entryId: string;\n title: string;\n modelId: string;\n}\n\nexport class Entry {\n public id;\n public entryId;\n public title;\n public modelId;\n\n static create(data: EntryDTO) {\n return new Entry(data);\n }\n\n protected constructor(data: EntryDTO) {\n this.id = data.id;\n this.entryId = data.entryId;\n this.title = data.title;\n this.modelId = data.modelId;\n }\n}\n"],"mappings":";;;;;;;;;IAgBaA,KAAK,GAAAC,OAAA,CAAAD,KAAA;EAUd,SAAAA,MAAsBE,IAAc,EAAE;IAAA,IAAAC,gBAAA,CAAAC,OAAA,QAAAJ,KAAA;IAClC,IAAI,CAACK,EAAE,GAAGH,IAAI,CAACG,EAAE;IACjB,IAAI,CAACC,OAAO,GAAGJ,IAAI,CAACI,OAAO;IAC3B,IAAI,CAACC,KAAK,GAAGL,IAAI,CAACK,KAAK;IACvB,IAAI,CAACC,OAAO,GAAGN,IAAI,CAACM,OAAO;EAC/B;EAAC,WAAAC,aAAA,CAAAL,OAAA,EAAAJ,KAAA;IAAAU,GAAA;IAAAC,KAAA,EATD,
|
|
1
|
+
{"version":3,"names":["Entry","exports","data","_classCallCheck2","default","id","entryId","title","modelId","_createClass2","key","value","create"],"sources":["Entry.ts"],"sourcesContent":["export interface EntryReference {\n id: string;\n entryId: string;\n title: string;\n model: {\n modelId: string;\n };\n}\n\nexport interface EntryDTO {\n id: string;\n entryId: string;\n title: string;\n modelId: string;\n}\n\nexport class Entry {\n public id;\n public entryId;\n public title;\n public modelId;\n\n static create(data: EntryDTO) {\n return new Entry(data);\n }\n\n protected constructor(data: EntryDTO) {\n this.id = data.id;\n this.entryId = data.entryId;\n this.title = data.title;\n this.modelId = data.modelId;\n }\n}\n"],"mappings":";;;;;;;;;IAgBaA,KAAK,GAAAC,OAAA,CAAAD,KAAA;EAUd,SAAAA,MAAsBE,IAAc,EAAE;IAAA,IAAAC,gBAAA,CAAAC,OAAA,QAAAJ,KAAA;IAClC,IAAI,CAACK,EAAE,GAAGH,IAAI,CAACG,EAAE;IACjB,IAAI,CAACC,OAAO,GAAGJ,IAAI,CAACI,OAAO;IAC3B,IAAI,CAACC,KAAK,GAAGL,IAAI,CAACK,KAAK;IACvB,IAAI,CAACC,OAAO,GAAGN,IAAI,CAACM,OAAO;EAC/B;EAAC,WAAAC,aAAA,CAAAL,OAAA,EAAAJ,KAAA;IAAAU,GAAA;IAAAC,KAAA,EATD,SAAOC,MAAMA,CAACV,IAAc,EAAE;MAC1B,OAAO,IAAIF,KAAK,CAACE,IAAI,CAAC;IAC1B;EAAC;AAAA","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["EntryMapper","exports","_classCallCheck2","default","_createClass2","key","value","toDTO","entry","id","entryId","title","modelId","fromStorage","model"],"sources":["EntryMapper.ts"],"sourcesContent":["import { Entry, EntryDTO, EntryReference } from \"./Entry\";\n\nexport class EntryMapper {\n static toDTO(entry: Entry | EntryDTO): EntryDTO {\n return {\n id: entry.id,\n entryId: entry.entryId,\n title: entry.title,\n modelId: entry.modelId\n };\n }\n\n static fromStorage(entry: EntryReference): EntryDTO {\n return {\n id: entry.id,\n entryId: entry.entryId,\n title: entry.title,\n modelId: entry.model.modelId\n };\n }\n}\n"],"mappings":";;;;;;;;;IAEaA,WAAW,GAAAC,OAAA,CAAAD,WAAA;EAAA,SAAAA,YAAA;IAAA,IAAAE,gBAAA,CAAAC,OAAA,QAAAH,WAAA;EAAA;EAAA,WAAAI,aAAA,CAAAD,OAAA,EAAAH,WAAA;IAAAK,GAAA;IAAAC,KAAA,EACpB,
|
|
1
|
+
{"version":3,"names":["EntryMapper","exports","_classCallCheck2","default","_createClass2","key","value","toDTO","entry","id","entryId","title","modelId","fromStorage","model"],"sources":["EntryMapper.ts"],"sourcesContent":["import { Entry, EntryDTO, EntryReference } from \"./Entry\";\n\nexport class EntryMapper {\n static toDTO(entry: Entry | EntryDTO): EntryDTO {\n return {\n id: entry.id,\n entryId: entry.entryId,\n title: entry.title,\n modelId: entry.modelId\n };\n }\n\n static fromStorage(entry: EntryReference): EntryDTO {\n return {\n id: entry.id,\n entryId: entry.entryId,\n title: entry.title,\n modelId: entry.model.modelId\n };\n }\n}\n"],"mappings":";;;;;;;;;IAEaA,WAAW,GAAAC,OAAA,CAAAD,WAAA;EAAA,SAAAA,YAAA;IAAA,IAAAE,gBAAA,CAAAC,OAAA,QAAAH,WAAA;EAAA;EAAA,WAAAI,aAAA,CAAAD,OAAA,EAAAH,WAAA;IAAAK,GAAA;IAAAC,KAAA,EACpB,SAAOC,KAAKA,CAACC,KAAuB,EAAY;MAC5C,OAAO;QACHC,EAAE,EAAED,KAAK,CAACC,EAAE;QACZC,OAAO,EAAEF,KAAK,CAACE,OAAO;QACtBC,KAAK,EAAEH,KAAK,CAACG,KAAK;QAClBC,OAAO,EAAEJ,KAAK,CAACI;MACnB,CAAC;IACL;EAAC;IAAAP,GAAA;IAAAC,KAAA,EAED,SAAOO,WAAWA,CAACL,KAAqB,EAAY;MAChD,OAAO;QACHC,EAAE,EAAED,KAAK,CAACC,EAAE;QACZC,OAAO,EAAEF,KAAK,CAACE,OAAO;QACtBC,KAAK,EAAEH,KAAK,CAACG,KAAK;QAClBC,OAAO,EAAEJ,KAAK,CAACM,KAAK,CAACF;MACzB,CAAC;IACL;EAAC;AAAA","ignoreList":[]}
|
package/admin/components/ContentEntries/Filters/RefFieldRenderer/domain/EntryRepository.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_mobx","require","_EntryMapper","_Loading","EntryRepository","exports","gateway","modelIds","_classCallCheck2","default","_defineProperty2","loading","Loading","makeAutoObservable","_createClass2","key","value","getEntries","entries","getLoading","isLoading","listEntries","query","_this","response","runWithLoading","list","runInAction","map","entry","EntryMapper","fromStorage","getEntryById","modelId","id","_this2","entryInCache","find","get","entryDTO","concat","_toConsumableArray2","action","runCallbackWithLoading"],"sources":["EntryRepository.ts"],"sourcesContent":["import { makeAutoObservable, runInAction } from \"mobx\";\nimport { EntryDTO, EntryReference } from \"./Entry\";\nimport { EntriesGatewayInterface } from \"../adapters\";\nimport { EntryMapper } from \"./EntryMapper\";\nimport { Loading } from \"./Loading\";\n\nexport class EntryRepository {\n public readonly modelIds: string[];\n private gateway: EntriesGatewayInterface;\n private loading: Loading;\n private entries: EntryDTO[] = [];\n\n constructor(gateway: EntriesGatewayInterface, modelIds: string[]) {\n this.modelIds = modelIds;\n this.gateway = gateway;\n this.loading = new Loading();\n makeAutoObservable(this);\n }\n\n getEntries() {\n return this.entries;\n }\n\n getLoading() {\n return {\n isLoading: this.loading.isLoading\n };\n }\n\n async listEntries(query: string) {\n const response = await this.runWithLoading<EntryReference[]>(\n this.gateway.list(this.modelIds, query)\n );\n\n if (!response) {\n return;\n }\n\n runInAction(() => {\n this.entries = response.map(entry => EntryMapper.fromStorage(entry));\n });\n }\n\n async getEntryById(modelId: string, id: string) {\n const entryInCache = this.entries.find(entry => entry.id === id);\n\n if (entryInCache) {\n return entryInCache;\n }\n\n const response = await this.runWithLoading<EntryReference>(this.gateway.get(modelId, id));\n\n if (!response) {\n return;\n }\n\n const entryDTO = EntryMapper.fromStorage(response);\n runInAction(() => {\n this.entries = [entryDTO, ...this.entries];\n });\n\n return entryDTO;\n }\n\n private async runWithLoading<T>(action: Promise<T>) {\n return await this.loading.runCallbackWithLoading(action);\n }\n}\n"],"mappings":";;;;;;;;;;;AAAA,IAAAA,KAAA,GAAAC,OAAA;AAGA,IAAAC,YAAA,GAAAD,OAAA;AACA,IAAAE,QAAA,GAAAF,OAAA;AAAoC,IAEvBG,eAAe,GAAAC,OAAA,CAAAD,eAAA;EAMxB,SAAAA,gBAAYE,OAAgC,EAAEC,QAAkB,EAAE;IAAA,IAAAC,gBAAA,CAAAC,OAAA,QAAAL,eAAA;IAAA,IAAAM,gBAAA,CAAAD,OAAA,mBAFpC,EAAE;IAG5B,IAAI,CAACF,QAAQ,GAAGA,QAAQ;IACxB,IAAI,CAACD,OAAO,GAAGA,OAAO;IACtB,IAAI,CAACK,OAAO,GAAG,IAAIC,gBAAO,CAAC,CAAC;IAC5B,IAAAC,wBAAkB,EAAC,IAAI,CAAC;EAC5B;EAAC,WAAAC,aAAA,CAAAL,OAAA,EAAAL,eAAA;IAAAW,GAAA;IAAAC,KAAA,EAED,SAAAC,
|
|
1
|
+
{"version":3,"names":["_mobx","require","_EntryMapper","_Loading","EntryRepository","exports","gateway","modelIds","_classCallCheck2","default","_defineProperty2","loading","Loading","makeAutoObservable","_createClass2","key","value","getEntries","entries","getLoading","isLoading","listEntries","query","_this","response","runWithLoading","list","runInAction","map","entry","EntryMapper","fromStorage","getEntryById","modelId","id","_this2","entryInCache","find","get","entryDTO","concat","_toConsumableArray2","action","runCallbackWithLoading"],"sources":["EntryRepository.ts"],"sourcesContent":["import { makeAutoObservable, runInAction } from \"mobx\";\nimport { EntryDTO, EntryReference } from \"./Entry\";\nimport { EntriesGatewayInterface } from \"../adapters\";\nimport { EntryMapper } from \"./EntryMapper\";\nimport { Loading } from \"./Loading\";\n\nexport class EntryRepository {\n public readonly modelIds: string[];\n private gateway: EntriesGatewayInterface;\n private loading: Loading;\n private entries: EntryDTO[] = [];\n\n constructor(gateway: EntriesGatewayInterface, modelIds: string[]) {\n this.modelIds = modelIds;\n this.gateway = gateway;\n this.loading = new Loading();\n makeAutoObservable(this);\n }\n\n getEntries() {\n return this.entries;\n }\n\n getLoading() {\n return {\n isLoading: this.loading.isLoading\n };\n }\n\n async listEntries(query: string) {\n const response = await this.runWithLoading<EntryReference[]>(\n this.gateway.list(this.modelIds, query)\n );\n\n if (!response) {\n return;\n }\n\n runInAction(() => {\n this.entries = response.map(entry => EntryMapper.fromStorage(entry));\n });\n }\n\n async getEntryById(modelId: string, id: string) {\n const entryInCache = this.entries.find(entry => entry.id === id);\n\n if (entryInCache) {\n return entryInCache;\n }\n\n const response = await this.runWithLoading<EntryReference>(this.gateway.get(modelId, id));\n\n if (!response) {\n return;\n }\n\n const entryDTO = EntryMapper.fromStorage(response);\n runInAction(() => {\n this.entries = [entryDTO, ...this.entries];\n });\n\n return entryD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