@webiny/app-headless-cms 6.5.0-beta.1 → 6.5.0-beta.10
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/ContentEntriesModule.js +14 -2
- package/ContentEntriesModule.js.map +1 -1
- package/admin/components/ContentEntries/BulkActions/ActionDelete.d.ts +2 -2
- package/admin/components/ContentEntries/BulkActions/ActionDelete.js.map +1 -1
- package/admin/components/ContentEntries/BulkActions/ActionMove.d.ts +2 -2
- package/admin/components/ContentEntries/BulkActions/ActionMove.js.map +1 -1
- package/admin/components/ContentEntries/BulkActions/ActionPublish.d.ts +2 -2
- package/admin/components/ContentEntries/BulkActions/ActionPublish.js.map +1 -1
- package/admin/components/ContentEntries/BulkActions/ActionUnpublish.d.ts +2 -2
- package/admin/components/ContentEntries/BulkActions/ActionUnpublish.js.map +1 -1
- package/admin/components/ContentEntries/Filters/RefFieldRenderer.d.ts +2 -0
- package/admin/components/ContentEntries/Filters/RefFieldRenderer.js +84 -0
- package/admin/components/ContentEntries/Filters/RefFieldRenderer.js.map +1 -0
- package/admin/components/ContentEntries/Table/Actions/DuplicateEntry.d.ts +2 -0
- package/admin/components/ContentEntries/Table/Actions/DuplicateEntry.js +34 -0
- package/admin/components/ContentEntries/Table/Actions/DuplicateEntry.js.map +1 -0
- package/admin/components/ContentEntries/Table/Actions/index.d.ts +1 -0
- package/admin/components/ContentEntries/Table/Actions/index.js +1 -0
- package/admin/components/ContentModelEditor/ContentModelEditor.js +1 -1
- package/admin/components/ContentModelEditor/ContentModelEditor.js.map +1 -1
- package/admin/components/Dialogs/DuplicateEntryConfirmDialog.d.ts +2 -0
- package/admin/components/Dialogs/DuplicateEntryConfirmDialog.js +22 -0
- package/admin/components/Dialogs/DuplicateEntryConfirmDialog.js.map +1 -0
- package/admin/components/FieldEditor/EditFieldDialog.d.ts +2 -2
- package/admin/components/FieldEditor/Field.js +4 -4
- package/admin/components/FieldEditor/Field.js.map +1 -1
- package/features/contentEntry/CmsEntryError.d.ts +10 -0
- package/features/contentEntry/CmsEntryError.js +11 -0
- package/features/contentEntry/CmsEntryError.js.map +1 -0
- package/features/contentEntry/createEntry/CreateEntryGateway.d.ts +0 -1
- package/features/contentEntry/createEntry/CreateEntryGateway.js +3 -10
- package/features/contentEntry/createEntry/CreateEntryGateway.js.map +1 -1
- package/features/contentEntry/createRevisionFrom/CreateRevisionFromGateway.d.ts +3 -1
- package/features/contentEntry/createRevisionFrom/CreateRevisionFromGateway.js +8 -3
- package/features/contentEntry/createRevisionFrom/CreateRevisionFromGateway.js.map +1 -1
- package/features/contentEntry/duplicateEntry/DuplicateEntryGateway.d.ts +14 -0
- package/features/contentEntry/duplicateEntry/DuplicateEntryGateway.js +43 -0
- package/features/contentEntry/duplicateEntry/DuplicateEntryGateway.js.map +1 -0
- package/features/contentEntry/duplicateEntry/DuplicateEntryRepository.d.ts +15 -0
- package/features/contentEntry/duplicateEntry/DuplicateEntryRepository.js +34 -0
- package/features/contentEntry/duplicateEntry/DuplicateEntryRepository.js.map +1 -0
- package/features/contentEntry/duplicateEntry/DuplicateEntryUseCase.d.ts +11 -0
- package/features/contentEntry/duplicateEntry/DuplicateEntryUseCase.js +18 -0
- package/features/contentEntry/duplicateEntry/DuplicateEntryUseCase.js.map +1 -0
- package/features/contentEntry/duplicateEntry/abstractions.d.ts +26 -0
- package/features/contentEntry/duplicateEntry/abstractions.js +7 -0
- package/features/contentEntry/duplicateEntry/abstractions.js.map +1 -0
- package/features/contentEntry/duplicateEntry/feature.d.ts +3 -0
- package/features/contentEntry/duplicateEntry/feature.js +21 -0
- package/features/contentEntry/duplicateEntry/feature.js.map +1 -0
- package/features/contentEntry/entryValueGateways.test.d.ts +1 -0
- package/features/contentEntry/entryValueGateways.test.js +106 -0
- package/features/contentEntry/entryValueGateways.test.js.map +1 -0
- package/features/contentEntry/feature.js +2 -0
- package/features/contentEntry/feature.js.map +1 -1
- package/features/contentEntry/singletonEntry/UpdateSingletonEntryGateway.d.ts +0 -1
- package/features/contentEntry/singletonEntry/UpdateSingletonEntryGateway.js +3 -10
- package/features/contentEntry/singletonEntry/UpdateSingletonEntryGateway.js.map +1 -1
- package/features/contentEntry/updateEntry/UpdateEntryGateway.d.ts +0 -1
- package/features/contentEntry/updateEntry/UpdateEntryGateway.js +3 -10
- package/features/contentEntry/updateEntry/UpdateEntryGateway.js.map +1 -1
- package/features/contentEntry/valueTransformers/EntryDataPreparer.d.ts +9 -0
- package/features/contentEntry/valueTransformers/EntryDataPreparer.js +8 -0
- package/features/contentEntry/valueTransformers/EntryDataPreparer.js.map +1 -1
- package/features/contentEntry/valueTransformers/EntryDataPreparer.test.d.ts +1 -0
- package/features/contentEntry/valueTransformers/EntryDataPreparer.test.js +113 -0
- package/features/contentEntry/valueTransformers/EntryDataPreparer.test.js.map +1 -0
- package/features/contentEntry/valueTransformers/entryValueFixtures.d.ts +146 -0
- package/features/contentEntry/valueTransformers/entryValueFixtures.js +171 -0
- package/features/contentEntry/valueTransformers/entryValueFixtures.js.map +1 -0
- package/features/formModel/CmsFormModelBuilder.d.ts +9 -1
- package/features/formModel/CmsFormModelBuilder.js +26 -15
- package/features/formModel/CmsFormModelBuilder.js.map +1 -1
- package/features/formModel/CmsFormModelBuilder.test.d.ts +1 -0
- package/features/formModel/CmsFormModelBuilder.test.js +252 -0
- package/features/formModel/CmsFormModelBuilder.test.js.map +1 -0
- package/features/formModel/CmsLayoutMapper.d.ts +8 -1
- package/features/formModel/CmsLayoutMapper.js +23 -1
- package/features/formModel/CmsLayoutMapper.js.map +1 -1
- package/features/formModel/mappers/DynamicZoneFieldMapper.js +4 -0
- package/features/formModel/mappers/DynamicZoneFieldMapper.js.map +1 -1
- package/features/formModel/mappers/ObjectFieldMapper.js +11 -6
- package/features/formModel/mappers/ObjectFieldMapper.js.map +1 -1
- package/features/model/exportModels/ExportModelsGateway.d.ts +1 -1
- package/features/model/exportModels/ExportModelsGateway.js.map +1 -1
- package/features/model/exportModels/ExportModelsUseCase.js +7 -1
- package/features/model/exportModels/ExportModelsUseCase.js.map +1 -1
- package/features/model/exportModels/abstractions.d.ts +8 -2
- package/features/model/exportModels/abstractions.js.map +1 -1
- package/package.json +26 -26
- package/presentation/contentEntries/form/ContentEntryFormPresenter.js +34 -29
- package/presentation/contentEntries/form/ContentEntryFormPresenter.js.map +1 -1
- package/presentation/contentEntries/form/ContentEntryFormPresenter.test.d.ts +1 -0
- package/presentation/contentEntries/form/ContentEntryFormPresenter.test.js +210 -0
- package/presentation/contentEntries/form/ContentEntryFormPresenter.test.js.map +1 -0
- package/presentation/contentEntries/form/toFormErrors.d.ts +7 -0
- package/presentation/contentEntries/form/toFormErrors.js +49 -0
- package/presentation/contentEntries/form/toFormErrors.js.map +1 -0
- package/presentation/contentEntries/form/toFormErrors.test.d.ts +1 -0
- package/presentation/contentEntries/form/toFormErrors.test.js +175 -0
- package/presentation/contentEntries/form/toFormErrors.test.js.map +1 -0
- package/presentation/contentEntries/list/ContentEntriesPresenter.d.ts +6 -2
- package/presentation/contentEntries/list/ContentEntriesPresenter.js +27 -2
- package/presentation/contentEntries/list/ContentEntriesPresenter.js.map +1 -1
- package/presentation/contentEntries/list/ContentEntriesPresenter.test.js +58 -1
- package/presentation/contentEntries/list/ContentEntriesPresenter.test.js.map +1 -1
- package/presentation/contentEntries/list/abstractions.d.ts +12 -0
- package/presentation/contentEntries/list/abstractions.js.map +1 -1
- package/presentation/contentEntries/preview/LivePreviewPresenter.d.ts +12 -1
- package/presentation/contentEntries/preview/LivePreviewPresenter.js +48 -5
- package/presentation/contentEntries/preview/LivePreviewPresenter.js.map +1 -1
- package/presentation/contentEntries/preview/LivePreviewPresenter.test.d.ts +1 -0
- package/presentation/contentEntries/preview/LivePreviewPresenter.test.js +81 -0
- package/presentation/contentEntries/preview/LivePreviewPresenter.test.js.map +1 -0
- package/presentation/contentEntries/preview/ModelEditorComponentDiscovery.js +1 -1
- package/presentation/contentEntries/preview/ModelEditorComponentDiscovery.js.map +1 -1
- package/presentation/contentEntries/preview/PreviewDecorator.js +25 -6
- package/presentation/contentEntries/preview/PreviewDecorator.js.map +1 -1
- package/presentation/contentEntries/preview/PreviewDomainStatus.d.ts +10 -0
- package/presentation/contentEntries/preview/PreviewDomainStatus.js +19 -0
- package/presentation/contentEntries/preview/PreviewDomainStatus.js.map +1 -0
- package/presentation/contentEntries/preview/PreviewPane.d.ts +10 -1
- package/presentation/contentEntries/preview/PreviewPane.js +81 -45
- package/presentation/contentEntries/preview/PreviewPane.js.map +1 -1
- package/presentation/contentEntries/preview/abstractions.d.ts +8 -0
- package/presentation/contentEntries/preview/abstractions.js.map +1 -1
- package/presentation/contentEntries/preview/resolvePreviewUrl.d.ts +21 -0
- package/presentation/contentEntries/preview/resolvePreviewUrl.js +50 -1
- package/presentation/contentEntries/preview/resolvePreviewUrl.js.map +1 -1
- package/presentation/contentEntries/preview/resolvePreviewUrl.test.d.ts +1 -0
- package/presentation/contentEntries/preview/resolvePreviewUrl.test.js +127 -0
- package/presentation/contentEntries/preview/resolvePreviewUrl.test.js.map +1 -0
- package/presentation/contentEntries/singleEntry/SingleEntryPresenter.js +9 -4
- package/presentation/contentEntries/singleEntry/SingleEntryPresenter.js.map +1 -1
- package/presentation/contentEntries/singleEntry/SingleEntryPresenter.test.d.ts +1 -0
- package/presentation/contentEntries/singleEntry/SingleEntryPresenter.test.js +122 -0
- package/presentation/contentEntries/singleEntry/SingleEntryPresenter.test.js.map +1 -0
- package/presentation/contentEntries/trashBin/CmsTrashBin.d.ts +2 -2
- package/presentation/contentEntries/views/CmsAdvancedSearch.d.ts +2 -2
- package/presentation/contentEntries/views/ContentEntriesListLayout.d.ts +2 -2
- package/presentation/contentEntries/views/ContentEntryFormView.d.ts +2 -2
- package/presentation/contentEntries/views/OlderRevisionAlert.d.ts +2 -2
- package/presentation/contentEntries/views/RevisionDrawer.d.ts +2 -2
- package/presentation/contentEntries/views/RevisionsList.d.ts +2 -2
- package/presentation/contentEntries/views/SingleEntryLayout.d.ts +2 -2
- package/presentation/contentEntries/views/Table/Table.d.ts +2 -2
- package/presentation/contentEntries/views/actions/CreateNewRevisionButton.d.ts +2 -2
- package/presentation/contentEntries/views/actions/DeleteEntryMenuItem.d.ts +2 -2
- package/presentation/contentEntries/views/actions/PublishOnlyButton.d.ts +2 -2
- package/presentation/contentEntries/views/actions/RevisionSelector.d.ts +2 -2
- package/presentation/contentEntries/views/actions/SaveAndPublishButton.d.ts +2 -2
- package/presentation/contentEntries/views/actions/SaveContentButton.d.ts +2 -2
- package/presentation/contentEntries/views/actions/ShowRevisionListMenuItem.d.ts +2 -2
- package/presentation/contentEntries/views/layout/ContentEntryForm.d.ts +12 -12
- package/presentation/contentModels/ContentModelsPresenter.d.ts +5 -5
- package/presentation/contentModels/ContentModelsPresenter.js +1 -1
- package/presentation/contentModels/ContentModelsPresenter.js.map +1 -1
- package/presentation/contentModels/abstractions.d.ts +7 -2
- package/presentation/contentModels/abstractions.js.map +1 -1
- package/presentation/contentModels/components/CloneContentModelDialog.d.ts +2 -2
- package/presentation/contentModels/components/ContentModels.d.ts +2 -2
- package/presentation/contentModels/components/ContentModelsDataList.d.ts +2 -2
- package/presentation/contentModels/components/ContentModelsDataList.js +6 -5
- package/presentation/contentModels/components/ContentModelsDataList.js.map +1 -1
- package/presentation/contentModels/components/NewContentModelDialog.d.ts +2 -2
- package/presentation/contentModels/components/fullDelete/dialog/Content.js +2 -2
- package/presentation/contentModels/components/fullDelete/dialog/Content.js.map +1 -1
- package/presentation/contentModels/components/fullDelete/types.js.map +1 -1
- package/presentation/fieldRenderers/ref/autocomplete/RefAutocompletePresenters.test.d.ts +1 -0
- package/presentation/fieldRenderers/ref/autocomplete/RefAutocompletePresenters.test.js +133 -0
- package/presentation/fieldRenderers/ref/autocomplete/RefAutocompletePresenters.test.js.map +1 -0
- package/presentation/fieldRenderers/ref/autocomplete/multi/RefMultiAutocompletePresenter.js +1 -1
- package/presentation/fieldRenderers/ref/autocomplete/multi/RefMultiAutocompletePresenter.js.map +1 -1
- package/presentation/fieldRenderers/ref/autocomplete/single/RefSingleAutocompletePresenter.js +1 -1
- package/presentation/fieldRenderers/ref/autocomplete/single/RefSingleAutocompletePresenter.js.map +1 -1
- package/presentation/fieldRenderers/ref/components/RefFieldOptions.d.ts +2 -2
- package/presentation/fieldRenderers/ref/components/RefFieldOptions.js +3 -2
- package/presentation/fieldRenderers/ref/components/RefFieldOptions.js.map +1 -1
- package/presentation/importContentModels/ImportContentModelsDialog.d.ts +2 -2
- package/presentation/importContentModels/ImportContentModelsPresenter.js +1 -1
- package/presentation/importContentModels/ImportContentModelsPresenter.js.map +1 -1
- package/presentation/importContentModels/components/DataList.d.ts +2 -2
- package/presentation/importContentModels/components/FileUpload.d.ts +2 -2
- package/presentation/importContentModels/components/FileUpload.js +1 -1
- package/presentation/importContentModels/components/FileUpload.js.map +1 -1
- package/presentation/importContentModels/components/Model/DataListModelItem.js +3 -3
- package/presentation/importContentModels/components/Model/DataListModelItem.js.map +1 -1
- package/presentation/importContentModels/components/Model/DataListModelItemInfo.js +2 -2
- package/presentation/importContentModels/components/Model/DataListModelItemInfo.js.map +1 -1
- package/presentation/importContentModels/components/Model/DataListModels.d.ts +2 -2
- package/presentation/menus/ContentGroupsMenuItems.d.ts +2 -2
- package/presentation/modelGroup/ModelGroupPresenter.js +1 -2
- package/presentation/modelGroup/ModelGroupPresenter.js.map +1 -1
- package/presentation/modelGroup/components/ContentModelGroups.d.ts +2 -2
- package/presentation/modelGroup/components/ContentModelGroupsDataList.d.ts +6 -2
- package/presentation/modelGroup/components/ContentModelGroupsForm.d.ts +8 -2
- package/utils/normalizeIcon.d.ts +4 -0
- package/utils/normalizeIcon.js +9 -6
- package/utils/normalizeIcon.js.map +1 -1
package/ContentEntriesModule.js
CHANGED
|
@@ -3,16 +3,18 @@ import { AdminConfig } from "@webiny/app-admin";
|
|
|
3
3
|
import { AdvancedSearchConfigs } from "@webiny/app-aco/components/AdvancedSearch/AdvancedSearchConfigs";
|
|
4
4
|
import { InternalContentEntryEditorConfig, InternalContentEntryListConfig } from "./admin/config/contentEntries/index.js";
|
|
5
5
|
import { ActionDelete, ActionMove, ActionPublish, ActionUnpublish } from "./admin/components/ContentEntries/BulkActions/index.js";
|
|
6
|
-
import { PUBLISH_ENTRY_DIALOG, TRASH_ENTRY_DIALOG, UNPUBLISH_ENTRY_DIALOG } from "./presentation/contentEntries/list/ContentEntriesPresenter.js";
|
|
6
|
+
import { DUPLICATE_ENTRY_DIALOG, PUBLISH_ENTRY_DIALOG, TRASH_ENTRY_DIALOG, UNPUBLISH_ENTRY_DIALOG } from "./presentation/contentEntries/list/ContentEntriesPresenter.js";
|
|
7
7
|
import { DeleteFolder, EditFolder, SetFolderPermissions } from "@webiny/app-aco";
|
|
8
|
-
import { ChangeEntryStatus, DeleteEntry, EditEntry, MoveEntry } from "./admin/components/ContentEntries/Table/Actions/index.js";
|
|
8
|
+
import { ChangeEntryStatus, DeleteEntry, DuplicateEntry, EditEntry, MoveEntry } from "./admin/components/ContentEntries/Table/Actions/index.js";
|
|
9
9
|
import { CellActions, CellAuthor, CellCreated, CellLive, CellModified, CellName, CellStatus } from "./admin/components/ContentEntries/Table/Cells/index.js";
|
|
10
10
|
import { IsModelPublishable } from "./admin/components/IsModelPublishable.js";
|
|
11
11
|
import { FilterByStatus } from "./admin/components/ContentEntries/FilterByStatus.js";
|
|
12
|
+
import { Ref } from "./admin/components/ContentEntries/Filters/RefFieldRenderer.js";
|
|
12
13
|
import { CmsTrashBin } from "./presentation/contentEntries/trashBin/CmsTrashBin.js";
|
|
13
14
|
import { TrashEntryConfirmDialog } from "./admin/components/Dialogs/TrashEntryConfirmDialog.js";
|
|
14
15
|
import { PublishEntryConfirmDialog } from "./admin/components/Dialogs/PublishEntryConfirmDialog.js";
|
|
15
16
|
import { UnpublishEntryConfirmDialog } from "./admin/components/Dialogs/UnpublishEntryConfirmDialog.js";
|
|
17
|
+
import { DuplicateEntryConfirmDialog } from "./admin/components/Dialogs/DuplicateEntryConfirmDialog.js";
|
|
16
18
|
import { DeleteRevisionConfirmDialog } from "./admin/components/Dialogs/DeleteRevisionConfirmDialog.js";
|
|
17
19
|
import { EditRevisionNoteDialog } from "./admin/components/Dialogs/EditRevisionNoteDialog.js";
|
|
18
20
|
import { DELETE_REVISION_DIALOG, EDIT_REVISION_NOTE_DIALOG } from "./presentation/contentEntries/revisionsList/RevisionsListPresenter.js";
|
|
@@ -35,6 +37,9 @@ const ContentEntriesModule = ()=>/*#__PURE__*/ react.createElement(react.Fragmen
|
|
|
35
37
|
}), /*#__PURE__*/ react.createElement(AdminConfig.Dialog, {
|
|
36
38
|
name: UNPUBLISH_ENTRY_DIALOG,
|
|
37
39
|
element: /*#__PURE__*/ react.createElement(UnpublishEntryConfirmDialog, null)
|
|
40
|
+
}), /*#__PURE__*/ react.createElement(AdminConfig.Dialog, {
|
|
41
|
+
name: DUPLICATE_ENTRY_DIALOG,
|
|
42
|
+
element: /*#__PURE__*/ react.createElement(DuplicateEntryConfirmDialog, null)
|
|
38
43
|
}), /*#__PURE__*/ react.createElement(AdminConfig.Dialog, {
|
|
39
44
|
name: DELETE_REVISION_DIALOG,
|
|
40
45
|
element: /*#__PURE__*/ react.createElement(DeleteRevisionConfirmDialog, null)
|
|
@@ -77,6 +82,9 @@ const ContentEntriesModule = ()=>/*#__PURE__*/ react.createElement(react.Fragmen
|
|
|
77
82
|
})), /*#__PURE__*/ react.createElement(Browser.Entry.Action, {
|
|
78
83
|
name: "move",
|
|
79
84
|
element: /*#__PURE__*/ react.createElement(MoveEntry, null)
|
|
85
|
+
}), /*#__PURE__*/ react.createElement(Browser.Entry.Action, {
|
|
86
|
+
name: "duplicate",
|
|
87
|
+
element: /*#__PURE__*/ react.createElement(DuplicateEntry, null)
|
|
80
88
|
}), /*#__PURE__*/ react.createElement(Browser.Entry.Action, {
|
|
81
89
|
name: "delete",
|
|
82
90
|
element: /*#__PURE__*/ react.createElement(DeleteEntry, null),
|
|
@@ -122,6 +130,10 @@ const ContentEntriesModule = ()=>/*#__PURE__*/ react.createElement(react.Fragmen
|
|
|
122
130
|
hideable: false,
|
|
123
131
|
truncate: false,
|
|
124
132
|
className: "flex justify-center"
|
|
133
|
+
}), /*#__PURE__*/ react.createElement(Browser.AdvancedSearch.FieldRenderer, {
|
|
134
|
+
name: "ref",
|
|
135
|
+
type: Browser.AdvancedSearch.FieldRenderer.FieldType.REF,
|
|
136
|
+
element: /*#__PURE__*/ react.createElement(Ref, null)
|
|
125
137
|
})), /*#__PURE__*/ react.createElement(InternalContentEntryEditorConfig, null, /*#__PURE__*/ react.createElement(IsModelPublishable, null, /*#__PURE__*/ react.createElement(Actions.ButtonAction, {
|
|
126
138
|
name: "revisionSelector",
|
|
127
139
|
element: /*#__PURE__*/ react.createElement(RevisionSelector, null)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ContentEntriesModule.js","sources":["../src/ContentEntriesModule.tsx"],"sourcesContent":["import React from \"react\";\nimport { AdminConfig } from \"@webiny/app-admin\";\nimport { AdvancedSearchConfigs } from \"@webiny/app-aco/components/AdvancedSearch/AdvancedSearchConfigs\";\nimport {\n InternalContentEntryEditorConfig,\n InternalContentEntryListConfig\n} from \"~/admin/config/contentEntries/index.js\";\n\nimport {\n ActionDelete,\n ActionMove,\n ActionPublish,\n ActionUnpublish\n} from \"~/admin/components/ContentEntries/BulkActions/index.js\";\n\nimport {\n TRASH_ENTRY_DIALOG,\n PUBLISH_ENTRY_DIALOG,\n UNPUBLISH_ENTRY_DIALOG\n} from \"~/presentation/contentEntries/list/ContentEntriesPresenter.js\";\nimport { DeleteFolder, EditFolder, SetFolderPermissions } from \"@webiny/app-aco\";\nimport {\n ChangeEntryStatus,\n DeleteEntry,\n EditEntry,\n MoveEntry\n} from \"~/admin/components/ContentEntries/Table/Actions/index.js\";\nimport {\n CellActions,\n CellAuthor,\n CellCreated,\n CellLive,\n CellModified,\n CellName,\n CellStatus\n} from \"~/admin/components/ContentEntries/Table/Cells/index.js\";\nimport { IsModelPublishable } from \"~/admin/components/IsModelPublishable.js\";\nimport { FilterByStatus } from \"~/admin/components/ContentEntries/FilterByStatus.js\";\nimport { CmsTrashBin } from \"~/presentation/contentEntries/trashBin/CmsTrashBin.js\";\nimport { TrashEntryConfirmDialog } from \"~/admin/components/Dialogs/TrashEntryConfirmDialog.js\";\nimport { PublishEntryConfirmDialog } from \"~/admin/components/Dialogs/PublishEntryConfirmDialog.js\";\nimport { UnpublishEntryConfirmDialog } from \"~/admin/components/Dialogs/UnpublishEntryConfirmDialog.js\";\nimport { DeleteRevisionConfirmDialog } from \"~/admin/components/Dialogs/DeleteRevisionConfirmDialog.js\";\nimport { EditRevisionNoteDialog } from \"~/admin/components/Dialogs/EditRevisionNoteDialog.js\";\nimport {\n DELETE_REVISION_DIALOG,\n EDIT_REVISION_NOTE_DIALOG\n} from \"~/presentation/contentEntries/revisionsList/RevisionsListPresenter.js\";\nimport { RevisionSelector } from \"~/presentation/contentEntries/views/actions/RevisionSelector.js\";\nimport { ContentFormOptionsMenu } from \"~/presentation/contentEntries/views/actions/ContentFormOptionsMenu.js\";\nimport { SaveContentButton } from \"~/presentation/contentEntries/views/actions/SaveContentButton.js\";\nimport { SaveAndPublishButton } from \"~/presentation/contentEntries/views/actions/SaveAndPublishButton.js\";\nimport { DeleteEntryMenuItem } from \"~/presentation/contentEntries/views/actions/DeleteEntryMenuItem.js\";\nimport { ShowRevisionListMenuItem } from \"~/presentation/contentEntries/views/actions/ShowRevisionListMenuItem.js\";\nimport { CreateNewRevisionButton } from \"~/presentation/contentEntries/views/actions/CreateNewRevisionButton.js\";\nimport { PublishOnlyButton } from \"~/presentation/contentEntries/views/actions/PublishOnlyButton.js\";\n\nconst { Browser } = InternalContentEntryListConfig;\nconst { Actions } = InternalContentEntryEditorConfig;\n\nexport const ContentEntriesModule = () => {\n return (\n <>\n <AdminConfig>\n <AdminConfig.Dialog\n name={TRASH_ENTRY_DIALOG}\n element={<TrashEntryConfirmDialog />}\n />\n <AdminConfig.Dialog\n name={PUBLISH_ENTRY_DIALOG}\n element={<PublishEntryConfirmDialog />}\n />\n <AdminConfig.Dialog\n name={UNPUBLISH_ENTRY_DIALOG}\n element={<UnpublishEntryConfirmDialog />}\n />\n <AdminConfig.Dialog\n name={DELETE_REVISION_DIALOG}\n element={<DeleteRevisionConfirmDialog />}\n />\n <AdminConfig.Dialog\n name={EDIT_REVISION_NOTE_DIALOG}\n element={<EditRevisionNoteDialog />}\n />\n </AdminConfig>\n <InternalContentEntryListConfig>\n <AdvancedSearchConfigs />\n <IsModelPublishable>\n <Browser.Filter name={\"status\"} element={<FilterByStatus />} />\n <Browser.BulkAction name={\"publish\"} element={<ActionPublish />} />\n <Browser.BulkAction name={\"unpublish\"} element={<ActionUnpublish />} />\n </IsModelPublishable>\n <Browser.Sidebar.Footer name={\"trashBin\"} element={<CmsTrashBin />} />\n <Browser.BulkAction name={\"move\"} element={<ActionMove />} />\n <Browser.BulkAction name={\"delete\"} element={<ActionDelete />} />\n <Browser.Folder.Action name={\"edit\"} element={<EditFolder />} />\n <Browser.Folder.Action name={\"permissions\"} element={<SetFolderPermissions />} />\n <Browser.Folder.Action name={\"delete\"} element={<DeleteFolder />} />\n <Browser.Entry.Action name={\"edit\"} element={<EditEntry />} />\n <IsModelPublishable>\n <Browser.Entry.Action name={\"status\"} element={<ChangeEntryStatus />} />\n </IsModelPublishable>\n <Browser.Entry.Action name={\"move\"} element={<MoveEntry />} />\n <Browser.Entry.Action name={\"delete\"} element={<DeleteEntry />} after={\"$last\"} />\n <Browser.Table.Column\n name={\"name\"}\n header={\"Name\"}\n cell={<CellName />}\n sortable={true}\n hideable={false}\n size={200}\n />\n <Browser.Table.Column name={\"createdBy\"} header={\"Author\"} cell={<CellAuthor />} />\n <Browser.Table.Column\n name={\"createdOn\"}\n header={\"Created\"}\n cell={<CellCreated />}\n sortable={true}\n />\n <Browser.Table.Column\n name={\"savedOn\"}\n header={\"Modified\"}\n cell={<CellModified />}\n sortable={true}\n />\n <IsModelPublishable>\n <Browser.Table.Column\n name={\"status\"}\n header={\"Status\"}\n cell={<CellStatus />}\n truncate={false}\n />\n <Browser.Table.Column\n name={\"live\"}\n header={\"Live\"}\n truncate={false}\n sortable={true}\n cell={<CellLive />}\n />\n </IsModelPublishable>\n <Browser.Table.Column\n name={\"actions\"}\n header={\"\"}\n cell={<CellActions />}\n size={56}\n resizable={false}\n hideable={false}\n truncate={false}\n className={\"flex justify-center\"}\n />\n </InternalContentEntryListConfig>\n <InternalContentEntryEditorConfig>\n <IsModelPublishable>\n <Actions.ButtonAction\n name={\"revisionSelector\"}\n element={<RevisionSelector />}\n />\n </IsModelPublishable>\n <Actions.ButtonAction name={\"optionsMenu\"} element={<ContentFormOptionsMenu />} />\n <Actions.ButtonAction name={\"save\"} element={<SaveContentButton />} />\n <IsModelPublishable>\n <Actions.ButtonAction\n name={\"cms/createNewRevision\"}\n element={<CreateNewRevisionButton />}\n />\n <Actions.ButtonAction name={\"publish\"} element={<SaveAndPublishButton />} />\n <Actions.ButtonAction name={\"publishOnly\"} element={<PublishOnlyButton />} />\n </IsModelPublishable>\n <Actions.MenuItemAction\n name={\"delete\"}\n element={<DeleteEntryMenuItem />}\n after={\"$last\"}\n />\n <IsModelPublishable>\n <Actions.MenuItemAction\n name={\"showRevisionsList\"}\n element={<ShowRevisionListMenuItem />}\n />\n </IsModelPublishable>\n </InternalContentEntryEditorConfig>\n </>\n );\n};\n"],"names":["Browser","InternalContentEntryListConfig","Actions","InternalContentEntryEditorConfig","ContentEntriesModule","AdminConfig","TRASH_ENTRY_DIALOG","TrashEntryConfirmDialog","PUBLISH_ENTRY_DIALOG","PublishEntryConfirmDialog","UNPUBLISH_ENTRY_DIALOG","UnpublishEntryConfirmDialog","DELETE_REVISION_DIALOG","DeleteRevisionConfirmDialog","EDIT_REVISION_NOTE_DIALOG","EditRevisionNoteDialog","AdvancedSearchConfigs","IsModelPublishable","FilterByStatus","ActionPublish","ActionUnpublish","CmsTrashBin","ActionMove","ActionDelete","EditFolder","SetFolderPermissions","DeleteFolder","EditEntry","ChangeEntryStatus","MoveEntry","DeleteEntry","CellName","CellAuthor","CellCreated","CellModified","CellStatus","CellLive","CellActions","RevisionSelector","ContentFormOptionsMenu","SaveContentButton","CreateNewRevisionButton","SaveAndPublishButton","PublishOnlyButton","DeleteEntryMenuItem","ShowRevisionListMenuItem"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAyDA,MAAM,EAAEA,SAAAA,OAAO,EAAE,GAAGC;AACpB,MAAM,EAAEC,SAAAA,OAAO,EAAE,GAAGC;AAEb,MAAMC,uBAAuB,IACzB,WAAP,GACI,wDACI,oBAACC,aAAWA,MAAAA,WAAAA,GACR,oBAACA,YAAY,MAAM;QACf,MAAMC;QACN,uBAAS,oBAACC,yBAAuBA;sBAErC,oBAACF,YAAY,MAAM;QACf,MAAMG;QACN,uBAAS,oBAACC,2BAAyBA;sBAEvC,oBAACJ,YAAY,MAAM;QACf,MAAMK;QACN,uBAAS,oBAACC,6BAA2BA;sBAEzC,oBAACN,YAAY,MAAM;QACf,MAAMO;QACN,uBAAS,oBAACC,6BAA2BA;sBAEzC,oBAACR,YAAY,MAAM;QACf,MAAMS;QACN,uBAAS,oBAACC,wBAAsBA;uBAGxC,oBAACd,gCAA8BA,MAAAA,WAAAA,GAC3B,oBAACe,uBAAqBA,OAAAA,WAAAA,GACtB,oBAACC,oBAAkBA,MAAAA,WAAAA,GACf,oBAACjB,QAAQ,MAAM;QAAC,MAAM;QAAU,uBAAS,oBAACkB,gBAAcA;sBACxD,oBAAClB,QAAQ,UAAU;QAAC,MAAM;QAAW,uBAAS,oBAACmB,eAAaA;sBAC5D,oBAACnB,QAAQ,UAAU;QAAC,MAAM;QAAa,uBAAS,oBAACoB,iBAAeA;uBAEpE,oBAACpB,QAAQ,OAAO,CAAC,MAAM;QAAC,MAAM;QAAY,uBAAS,oBAACqB,aAAWA;sBAC/D,oBAACrB,QAAQ,UAAU;QAAC,MAAM;QAAQ,uBAAS,oBAACsB,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jB,MAAM;QACN,QAAQ;QACR,oBAAM,oBAACmC,YAAUA;QACjB,UAAU;sBAEd,oBAACnC,QAAQ,KAAK,CAAC,MAAM;QACjB,MAAM;QACN,QAAQ;QACR,UAAU;QACV,UAAU;QACV,oBAAM,oBAACoC,UAAQA;uBAGvB,oBAACpC,QAAQ,KAAK,CAAC,MAAM;QACjB,MAAM;QACN,QAAQ;QACR,oBAAM,oBAACqC,aAAWA;QAClB,MAAM;QACN,WAAW;QACX,UAAU;QACV,UAAU;QACV,WAAW;uBAGnB,oBAAClC,kCAAgCA,MAAAA,WAAAA,GAC7B,oBAACc,oBAAkBA,MAAAA,WAAAA,GACf,oBAACf,QAAQ,YAAY;QACjB,MAAM;QACN,uBAAS,oBAACoC,kBAAgBA;uBAGlC,oBAACpC,QAAQ,YAAY;QAAC,MAAM;QAAe,uBAAS,oBAACqC,wBAAsBA;sBAC3E,oBAACrC,QAAQ,YAAY;QAAC,MAAM;QAAQ,uBAAS,oBAACsC,mBAAiBA;sBAC/D,oBAACvB,oBAAkBA,MAAAA,WAAAA,GACf,oBAACf,QAAQ,YAAY;QACjB,MAAM;QACN,uBAAS,oBAACuC,yBAAuBA;sBAErC,oBAACvC,QAAQ,YAAY;QAAC,MAAM;QAAW,uBAAS,oBAACwC,sBAAoBA;sBACrE,oBAACxC,QAAQ,YAAY;QAAC,MAAM;QAAe,uBAAS,oBAACyC,mBAAiBA;uBAE1E,oBAACzC,QAAQ,cAAc;QACnB,MAAM;QACN,uBAAS,oBAAC0C,qBAAmBA;QAC7B,OAAO;sBAEX,oBAAC3B,oBAAkBA,MAAAA,WAAAA,GACf,oBAACf,QAAQ,cAAc;QACnB,MAAM;QACN,uBAAS,oBAAC2C,0BAAwBA"}
|
|
1
|
+
{"version":3,"file":"ContentEntriesModule.js","sources":["../src/ContentEntriesModule.tsx"],"sourcesContent":["import React from \"react\";\nimport { AdminConfig } from \"@webiny/app-admin\";\nimport { AdvancedSearchConfigs } from \"@webiny/app-aco/components/AdvancedSearch/AdvancedSearchConfigs\";\nimport {\n InternalContentEntryEditorConfig,\n InternalContentEntryListConfig\n} from \"~/admin/config/contentEntries/index.js\";\n\nimport {\n ActionDelete,\n ActionMove,\n ActionPublish,\n ActionUnpublish\n} from \"~/admin/components/ContentEntries/BulkActions/index.js\";\n\nimport {\n TRASH_ENTRY_DIALOG,\n PUBLISH_ENTRY_DIALOG,\n UNPUBLISH_ENTRY_DIALOG,\n DUPLICATE_ENTRY_DIALOG\n} from \"~/presentation/contentEntries/list/ContentEntriesPresenter.js\";\nimport { DeleteFolder, EditFolder, SetFolderPermissions } from \"@webiny/app-aco\";\nimport {\n ChangeEntryStatus,\n DeleteEntry,\n DuplicateEntry,\n EditEntry,\n MoveEntry\n} from \"~/admin/components/ContentEntries/Table/Actions/index.js\";\nimport {\n CellActions,\n CellAuthor,\n CellCreated,\n CellLive,\n CellModified,\n CellName,\n CellStatus\n} from \"~/admin/components/ContentEntries/Table/Cells/index.js\";\nimport { IsModelPublishable } from \"~/admin/components/IsModelPublishable.js\";\nimport { FilterByStatus } from \"~/admin/components/ContentEntries/FilterByStatus.js\";\nimport { Ref } from \"~/admin/components/ContentEntries/Filters/RefFieldRenderer.js\";\nimport { CmsTrashBin } from \"~/presentation/contentEntries/trashBin/CmsTrashBin.js\";\nimport { TrashEntryConfirmDialog } from \"~/admin/components/Dialogs/TrashEntryConfirmDialog.js\";\nimport { PublishEntryConfirmDialog } from \"~/admin/components/Dialogs/PublishEntryConfirmDialog.js\";\nimport { UnpublishEntryConfirmDialog } from \"~/admin/components/Dialogs/UnpublishEntryConfirmDialog.js\";\nimport { DuplicateEntryConfirmDialog } from \"~/admin/components/Dialogs/DuplicateEntryConfirmDialog.js\";\nimport { DeleteRevisionConfirmDialog } from \"~/admin/components/Dialogs/DeleteRevisionConfirmDialog.js\";\nimport { EditRevisionNoteDialog } from \"~/admin/components/Dialogs/EditRevisionNoteDialog.js\";\nimport {\n DELETE_REVISION_DIALOG,\n EDIT_REVISION_NOTE_DIALOG\n} from \"~/presentation/contentEntries/revisionsList/RevisionsListPresenter.js\";\nimport { RevisionSelector } from \"~/presentation/contentEntries/views/actions/RevisionSelector.js\";\nimport { ContentFormOptionsMenu } from \"~/presentation/contentEntries/views/actions/ContentFormOptionsMenu.js\";\nimport { SaveContentButton } from \"~/presentation/contentEntries/views/actions/SaveContentButton.js\";\nimport { SaveAndPublishButton } from \"~/presentation/contentEntries/views/actions/SaveAndPublishButton.js\";\nimport { DeleteEntryMenuItem } from \"~/presentation/contentEntries/views/actions/DeleteEntryMenuItem.js\";\nimport { ShowRevisionListMenuItem } from \"~/presentation/contentEntries/views/actions/ShowRevisionListMenuItem.js\";\nimport { CreateNewRevisionButton } from \"~/presentation/contentEntries/views/actions/CreateNewRevisionButton.js\";\nimport { PublishOnlyButton } from \"~/presentation/contentEntries/views/actions/PublishOnlyButton.js\";\n\nconst { Browser } = InternalContentEntryListConfig;\nconst { Actions } = InternalContentEntryEditorConfig;\n\nexport const ContentEntriesModule = () => {\n return (\n <>\n <AdminConfig>\n <AdminConfig.Dialog\n name={TRASH_ENTRY_DIALOG}\n element={<TrashEntryConfirmDialog />}\n />\n <AdminConfig.Dialog\n name={PUBLISH_ENTRY_DIALOG}\n element={<PublishEntryConfirmDialog />}\n />\n <AdminConfig.Dialog\n name={UNPUBLISH_ENTRY_DIALOG}\n element={<UnpublishEntryConfirmDialog />}\n />\n <AdminConfig.Dialog\n name={DUPLICATE_ENTRY_DIALOG}\n element={<DuplicateEntryConfirmDialog />}\n />\n <AdminConfig.Dialog\n name={DELETE_REVISION_DIALOG}\n element={<DeleteRevisionConfirmDialog />}\n />\n <AdminConfig.Dialog\n name={EDIT_REVISION_NOTE_DIALOG}\n element={<EditRevisionNoteDialog />}\n />\n </AdminConfig>\n <InternalContentEntryListConfig>\n <AdvancedSearchConfigs />\n <IsModelPublishable>\n <Browser.Filter name={\"status\"} element={<FilterByStatus />} />\n <Browser.BulkAction name={\"publish\"} element={<ActionPublish />} />\n <Browser.BulkAction name={\"unpublish\"} element={<ActionUnpublish />} />\n </IsModelPublishable>\n <Browser.Sidebar.Footer name={\"trashBin\"} element={<CmsTrashBin />} />\n <Browser.BulkAction name={\"move\"} element={<ActionMove />} />\n <Browser.BulkAction name={\"delete\"} element={<ActionDelete />} />\n <Browser.Folder.Action name={\"edit\"} element={<EditFolder />} />\n <Browser.Folder.Action name={\"permissions\"} element={<SetFolderPermissions />} />\n <Browser.Folder.Action name={\"delete\"} element={<DeleteFolder />} />\n <Browser.Entry.Action name={\"edit\"} element={<EditEntry />} />\n <IsModelPublishable>\n <Browser.Entry.Action name={\"status\"} element={<ChangeEntryStatus />} />\n </IsModelPublishable>\n <Browser.Entry.Action name={\"move\"} element={<MoveEntry />} />\n <Browser.Entry.Action name={\"duplicate\"} element={<DuplicateEntry />} />\n <Browser.Entry.Action name={\"delete\"} element={<DeleteEntry />} after={\"$last\"} />\n <Browser.Table.Column\n name={\"name\"}\n header={\"Name\"}\n cell={<CellName />}\n sortable={true}\n hideable={false}\n size={200}\n />\n <Browser.Table.Column name={\"createdBy\"} header={\"Author\"} cell={<CellAuthor />} />\n <Browser.Table.Column\n name={\"createdOn\"}\n header={\"Created\"}\n cell={<CellCreated />}\n sortable={true}\n />\n <Browser.Table.Column\n name={\"savedOn\"}\n header={\"Modified\"}\n cell={<CellModified />}\n sortable={true}\n />\n <IsModelPublishable>\n <Browser.Table.Column\n name={\"status\"}\n header={\"Status\"}\n cell={<CellStatus />}\n truncate={false}\n />\n <Browser.Table.Column\n name={\"live\"}\n header={\"Live\"}\n truncate={false}\n sortable={true}\n cell={<CellLive />}\n />\n </IsModelPublishable>\n <Browser.Table.Column\n name={\"actions\"}\n header={\"\"}\n cell={<CellActions />}\n size={56}\n resizable={false}\n hideable={false}\n truncate={false}\n className={\"flex justify-center\"}\n />\n <Browser.AdvancedSearch.FieldRenderer\n name={\"ref\"}\n type={Browser.AdvancedSearch.FieldRenderer.FieldType.REF}\n element={<Ref />}\n />\n </InternalContentEntryListConfig>\n <InternalContentEntryEditorConfig>\n <IsModelPublishable>\n <Actions.ButtonAction\n name={\"revisionSelector\"}\n element={<RevisionSelector />}\n />\n </IsModelPublishable>\n <Actions.ButtonAction name={\"optionsMenu\"} element={<ContentFormOptionsMenu />} />\n <Actions.ButtonAction name={\"save\"} element={<SaveContentButton />} />\n <IsModelPublishable>\n <Actions.ButtonAction\n name={\"cms/createNewRevision\"}\n element={<CreateNewRevisionButton />}\n />\n <Actions.ButtonAction name={\"publish\"} element={<SaveAndPublishButton />} />\n <Actions.ButtonAction name={\"publishOnly\"} element={<PublishOnlyButton />} />\n </IsModelPublishable>\n <Actions.MenuItemAction\n name={\"delete\"}\n element={<DeleteEntryMenuItem />}\n after={\"$last\"}\n />\n <IsModelPublishable>\n <Actions.MenuItemAction\n name={\"showRevisionsList\"}\n element={<ShowRevisionListMenuItem />}\n />\n </IsModelPublishable>\n </InternalContentEntryEditorConfig>\n </>\n );\n};\n"],"names":["Browser","InternalContentEntryListConfig","Actions","InternalContentEntryEditorConfig","ContentEntriesModule","AdminConfig","TRASH_ENTRY_DIALOG","TrashEntryConfirmDialog","PUBLISH_ENTRY_DIALOG","PublishEntryConfirmDialog","UNPUBLISH_ENTRY_DIALOG","UnpublishEntryConfirmDialog","DUPLICATE_ENTRY_DIALOG","DuplicateEntryConfirmDialog","DELETE_REVISION_DIALOG","DeleteRevisionConfirmDialog","EDIT_REVISION_NOTE_DIALOG","EditRevisionNoteDialog","AdvancedSearchConfigs","IsModelPublishable","FilterByStatus","ActionPublish","ActionUnpublish","CmsTrashBin","ActionMove","ActionDelete","EditFolder","SetFolderPermissions","DeleteFolder","EditEntry","ChangeEntryStatus","MoveEntry","DuplicateEntry","DeleteEntry","CellName","CellAuthor","CellCreated","CellModified","CellStatus","CellLive","CellActions","Ref","RevisionSelector","ContentFormOptionsMenu","SaveContentButton","CreateNewRevisionButton","SaveAndPublishButton","PublishOnlyButton","DeleteEntryMenuItem","ShowRevisionListMenuItem"],"mappings":";;;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ete.js","sources":["../../../../../src/admin/components/ContentEntries/BulkActions/ActionDelete.tsx"],"sourcesContent":["import React from \"react\";\nimport { observer } from \"mobx-react-lite\";\nimport { ReactComponent as DeleteIcon } from \"@webiny/icons/delete.svg\";\nimport { useToast } from \"@webiny/admin-ui\";\nimport { useFeature } from \"@webiny/app\";\nimport { BulkDeleteFeature } from \"~/presentation/contentEntries/bulkActions/feature.js\";\nimport {\n BulkActionButton,\n useBulkActionDialog\n} from \"@webiny/app-admin/components/BulkActions/index.js\";\nimport { useContentEntriesPresenter } from \"~/presentation/contentEntries/list/useContentEntriesPresenter.js\";\n\nexport const ActionDelete = observer(() => {\n const toast = useToast();\n const presenter = useContentEntriesPresenter();\n const { showConfirmationDialog, showResultsDialog } = useBulkActionDialog();\n const { presenter: bulkDelete } = useFeature(BulkDeleteFeature);\n\n const selection = presenter.list.vm.selection;\n const selectedItems = presenter.list.vm.rows.filter(row => {\n return selection.selectedIds.has(row.id);\n });\n\n const openDeleteEntriesDialog = () =>\n showConfirmationDialog({\n title: \"Trash entries\",\n message: `You are about to move ${selection.label} to trash. Are you sure you want to continue?`,\n loadingLabel: `Processing ${selection.label}`,\n execute: async () => {\n await bulkDelete.execute(selectedItems, selection.allSelected);\n presenter.list.actions.selection.deselectAll();\n\n if (selection.allSelected) {\n toast.showSuccessToast({\n title: \"Entries will be trashed in the background\",\n description:\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 dismissible: true,\n duration: Infinity\n });\n return;\n }\n\n showResultsDialog({\n results: bulkDelete.vm.results,\n title: \"Trash entries\",\n message: \"Finished moving entries to trash! See full report below:\"\n });\n }\n });\n\n return (\n <BulkActionButton\n text=\"Trash\"\n tooltipContent={`Trash ${selection.label}`}\n icon={<DeleteIcon />}\n onClick={openDeleteEntriesDialog}\n />\n );\n});\n"],"names":["ActionDelete","observer","toast","useToast","presenter","useContentEntriesPresenter","showConfirmationDialog","showResultsDialog","useBulkActionDialog","bulkDelete","useFeature","BulkDeleteFeature","selection","selectedItems","row","openDeleteEntriesDialog","Infinity","BulkActionButton","DeleteIcon"],"mappings":";;;;;;;;AAYO,MAAMA,eAAeC,SAAS;IACjC,MAAMC,QAAQC;IACd,MAAMC,YAAYC;IAClB,MAAM,EAAEC,sBAAsB,EAAEC,iBAAiB,EAAE,GAAGC;IACtD,MAAM,EAAE,WAAWC,UAAU,EAAE,GAAGC,WAAWC;IAE7C,MAAMC,YAAYR,UAAU,IAAI,CAAC,EAAE,CAAC,SAAS;IAC7C,MAAMS,gBAAgBT,UAAU,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,MAAM,CAACU,CAAAA,MACzCF,UAAU,WAAW,CAAC,GAAG,CAACE,IAAI,EAAE;IAG3C,MAAMC,0BAA0B,IAC5BT,uBAAuB;YACnB,OAAO;YACP,SAAS,CAAC,sBAAsB,EAAEM,UAAU,KAAK,CAAC,6CAA6C,CAAC;YAChG,cAAc,CAAC,WAAW,EAAEA,UAAU,KAAK,EAAE;YAC7C,SAAS;gBACL,MAAMH,WAAW,OAAO,CAACI,eAAeD,UAAU,WAAW;gBAC7DR,UAAU,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,WAAW;gBAE5C,IAAIQ,UAAU,WAAW,EAAE,YACvBV,MAAM,gBAAgB,CAAC;oBACnB,OAAO;oBACP,aACI;oBACJ,aAAa;oBACb,UAAUc;
|
|
1
|
+
{"version":3,"file":"admin/components/ContentEntries/BulkActions/ActionDelete.js","sources":["../../../../../src/admin/components/ContentEntries/BulkActions/ActionDelete.tsx"],"sourcesContent":["import React from \"react\";\nimport { observer } from \"mobx-react-lite\";\nimport { ReactComponent as DeleteIcon } from \"@webiny/icons/delete.svg\";\nimport { useToast } from \"@webiny/admin-ui\";\nimport { useFeature } from \"@webiny/app\";\nimport { BulkDeleteFeature } from \"~/presentation/contentEntries/bulkActions/feature.js\";\nimport {\n BulkActionButton,\n useBulkActionDialog\n} from \"@webiny/app-admin/components/BulkActions/index.js\";\nimport { useContentEntriesPresenter } from \"~/presentation/contentEntries/list/useContentEntriesPresenter.js\";\n\nexport const ActionDelete = observer(() => {\n const toast = useToast();\n const presenter = useContentEntriesPresenter();\n const { showConfirmationDialog, showResultsDialog } = useBulkActionDialog();\n const { presenter: bulkDelete } = useFeature(BulkDeleteFeature);\n\n const selection = presenter.list.vm.selection;\n const selectedItems = presenter.list.vm.rows.filter(row => {\n return selection.selectedIds.has(row.id);\n });\n\n const openDeleteEntriesDialog = () =>\n showConfirmationDialog({\n title: \"Trash entries\",\n message: `You are about to move ${selection.label} to trash. Are you sure you want to continue?`,\n loadingLabel: `Processing ${selection.label}`,\n execute: async () => {\n await bulkDelete.execute(selectedItems, selection.allSelected);\n presenter.list.actions.selection.deselectAll();\n\n if (selection.allSelected) {\n toast.showSuccessToast({\n title: \"Entries will be trashed in the background\",\n description:\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 dismissible: true,\n duration: Infinity\n });\n return;\n }\n\n showResultsDialog({\n results: bulkDelete.vm.results,\n title: \"Trash entries\",\n message: \"Finished moving entries to trash! See full report below:\"\n });\n }\n });\n\n return (\n <BulkActionButton\n text=\"Trash\"\n tooltipContent={`Trash ${selection.label}`}\n icon={<DeleteIcon />}\n onClick={openDeleteEntriesDialog}\n />\n );\n});\n"],"names":["ActionDelete","observer","toast","useToast","presenter","useContentEntriesPresenter","showConfirmationDialog","showResultsDialog","useBulkActionDialog","bulkDelete","useFeature","BulkDeleteFeature","selection","selectedItems","row","openDeleteEntriesDialog","Infinity","BulkActionButton","DeleteIcon"],"mappings":";;;;;;;;AAYO,MAAMA,eAAeC,SAAS;IACjC,MAAMC,QAAQC;IACd,MAAMC,YAAYC;IAClB,MAAM,EAAEC,sBAAsB,EAAEC,iBAAiB,EAAE,GAAGC;IACtD,MAAM,EAAE,WAAWC,UAAU,EAAE,GAAGC,WAAWC;IAE7C,MAAMC,YAAYR,UAAU,IAAI,CAAC,EAAE,CAAC,SAAS;IAC7C,MAAMS,gBAAgBT,UAAU,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,MAAM,CAACU,CAAAA,MACzCF,UAAU,WAAW,CAAC,GAAG,CAACE,IAAI,EAAE;IAG3C,MAAMC,0BAA0B,IAC5BT,uBAAuB;YACnB,OAAO;YACP,SAAS,CAAC,sBAAsB,EAAEM,UAAU,KAAK,CAAC,6CAA6C,CAAC;YAChG,cAAc,CAAC,WAAW,EAAEA,UAAU,KAAK,EAAE;YAC7C,SAAS;gBACL,MAAMH,WAAW,OAAO,CAACI,eAAeD,UAAU,WAAW;gBAC7DR,UAAU,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,WAAW;gBAE5C,IAAIQ,UAAU,WAAW,EAAE,YACvBV,MAAM,gBAAgB,CAAC;oBACnB,OAAO;oBACP,aACI;oBACJ,aAAa;oBACb,UAAUc,KAAQ;gBACtB;gBAIJT,kBAAkB;oBACd,SAASE,WAAW,EAAE,CAAC,OAAO;oBAC9B,OAAO;oBACP,SAAS;gBACb;YACJ;QACJ;IAEJ,OAAO,WAAP,GACI,oBAACQ,kBAAgBA;QACb,MAAK;QACL,gBAAgB,CAAC,MAAM,EAAEL,UAAU,KAAK,EAAE;QAC1C,oBAAM,oBAACM,gBAAUA;QACjB,SAASH;;AAGrB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"admin/components/ContentEntries/BulkActions/ActionMove.js","sources":["../../../../../src/admin/components/ContentEntries/BulkActions/ActionMove.tsx"],"sourcesContent":["import React, { useCallback } from \"react\";\nimport { observer } from \"mobx-react-lite\";\nimport { ReactComponent as MoveIcon } from \"@webiny/icons/exit_to_app.svg\";\nimport { useMoveToFolderDialog } from \"@webiny/app-aco\";\nimport type { NodeDto } from \"@webiny/admin-ui\";\nimport { useToast } from \"@webiny/admin-ui\";\nimport { useFeature } from \"@webiny/app\";\nimport {\n BulkActionButton,\n useBulkActionDialog\n} from \"@webiny/app-admin/components/BulkActions/index.js\";\nimport { ROOT_FOLDER } from \"~/admin/constants.js\";\nimport { BulkMoveFeature } from \"~/presentation/contentEntries/bulkActions/feature.js\";\nimport { useContentEntriesPresenter } from \"~/presentation/contentEntries/list/useContentEntriesPresenter.js\";\n\nexport const ActionMove = observer(() => {\n const presenter = useContentEntriesPresenter();\n const { presenter: bulkMove } = useFeature(BulkMoveFeature);\n const toast = useToast();\n const { showConfirmationDialog, showResultsDialog } = useBulkActionDialog();\n const { showDialog: showMoveDialog } = useMoveToFolderDialog();\n\n const selection = presenter.list.vm.selection;\n const currentFolderId = presenter.folders.vm.currentFolderId;\n const selectedItems = presenter.list.vm.rows.filter(row => {\n return selection.selectedIds.has(row.id);\n });\n\n const openWorkerDialog = useCallback(\n (folder: NodeDto) => {\n showConfirmationDialog({\n title: \"Move entries\",\n message: `You are about to move ${selection.label} to ${folder.label}. Are you sure you want to continue?`,\n loadingLabel: `Processing ${selection.label}`,\n execute: async () => {\n await bulkMove.execute(selectedItems, selection.allSelected, folder.id);\n presenter.list.actions.selection.deselectAll();\n\n if (selection.allSelected) {\n toast.showSuccessToast({\n title: \"Entries will be moved in the background\",\n description: `All entries will be moved to ${folder.label}. 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 dismissible: true,\n duration: Infinity\n });\n\n return;\n }\n\n showResultsDialog({\n results: bulkMove.vm.results,\n title: \"Move entries\",\n message: \"Finished moving entries! See full report below:\"\n });\n }\n });\n },\n [selection.label, selection.allSelected, selectedItems]\n );\n\n const openMoveEntriesDialog = () =>\n showMoveDialog({\n title: \"Select folder\",\n message: \"Select a new location for selected entries:\",\n loadingLabel: `Processing ${selection.label}`,\n acceptLabel: \"Move\",\n focusedFolderId: currentFolderId || ROOT_FOLDER,\n async onAccept({ folder }) {\n openWorkerDialog(folder);\n }\n });\n\n return (\n <BulkActionButton\n text=\"Move\"\n tooltipContent={`Move ${selection.label}`}\n icon={<MoveIcon />}\n onClick={openMoveEntriesDialog}\n />\n );\n});\n"],"names":["ActionMove","observer","presenter","useContentEntriesPresenter","bulkMove","useFeature","BulkMoveFeature","toast","useToast","showConfirmationDialog","showResultsDialog","useBulkActionDialog","showMoveDialog","useMoveToFolderDialog","selection","currentFolderId","selectedItems","row","openWorkerDialog","useCallback","folder","Infinity","openMoveEntriesDialog","ROOT_FOLDER","BulkActionButton","MoveIcon"],"mappings":";;;;;;;;;;AAeO,MAAMA,aAAaC,SAAS;IAC/B,MAAMC,YAAYC;IAClB,MAAM,EAAE,WAAWC,QAAQ,EAAE,GAAGC,WAAWC;IAC3C,MAAMC,QAAQC;IACd,MAAM,EAAEC,sBAAsB,EAAEC,iBAAiB,EAAE,GAAGC;IACtD,MAAM,EAAE,YAAYC,cAAc,EAAE,GAAGC;IAEvC,MAAMC,YAAYZ,UAAU,IAAI,CAAC,EAAE,CAAC,SAAS;IAC7C,MAAMa,kBAAkBb,UAAU,OAAO,CAAC,EAAE,CAAC,eAAe;IAC5D,MAAMc,gBAAgBd,UAAU,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,MAAM,CAACe,CAAAA,MACzCH,UAAU,WAAW,CAAC,GAAG,CAACG,IAAI,EAAE;IAG3C,MAAMC,mBAAmBC,YACrB,CAACC;QACGX,uBAAuB;YACnB,OAAO;YACP,SAAS,CAAC,sBAAsB,EAAEK,UAAU,KAAK,CAAC,IAAI,EAAEM,OAAO,KAAK,CAAC,oCAAoC,CAAC;YAC1G,cAAc,CAAC,WAAW,EAAEN,UAAU,KAAK,EAAE;YAC7C,SAAS;gBACL,MAAMV,SAAS,OAAO,CAACY,eAAeF,UAAU,WAAW,EAAEM,OAAO,EAAE;gBACtElB,UAAU,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,WAAW;gBAE5C,IAAIY,UAAU,WAAW,EAAE,YACvBP,MAAM,gBAAgB,CAAC;oBACnB,OAAO;oBACP,aAAa,CAAC,6BAA6B,EAAEa,OAAO,KAAK,CAAC,sJAAsJ,CAAC;oBACjN,aAAa;oBACb,UAAUC;
|
|
1
|
+
{"version":3,"file":"admin/components/ContentEntries/BulkActions/ActionMove.js","sources":["../../../../../src/admin/components/ContentEntries/BulkActions/ActionMove.tsx"],"sourcesContent":["import React, { useCallback } from \"react\";\nimport { observer } from \"mobx-react-lite\";\nimport { ReactComponent as MoveIcon } from \"@webiny/icons/exit_to_app.svg\";\nimport { useMoveToFolderDialog } from \"@webiny/app-aco\";\nimport type { NodeDto } from \"@webiny/admin-ui\";\nimport { useToast } from \"@webiny/admin-ui\";\nimport { useFeature } from \"@webiny/app\";\nimport {\n BulkActionButton,\n useBulkActionDialog\n} from \"@webiny/app-admin/components/BulkActions/index.js\";\nimport { ROOT_FOLDER } from \"~/admin/constants.js\";\nimport { BulkMoveFeature } from \"~/presentation/contentEntries/bulkActions/feature.js\";\nimport { useContentEntriesPresenter } from \"~/presentation/contentEntries/list/useContentEntriesPresenter.js\";\n\nexport const ActionMove = observer(() => {\n const presenter = useContentEntriesPresenter();\n const { presenter: bulkMove } = useFeature(BulkMoveFeature);\n const toast = useToast();\n const { showConfirmationDialog, showResultsDialog } = useBulkActionDialog();\n const { showDialog: showMoveDialog } = useMoveToFolderDialog();\n\n const selection = presenter.list.vm.selection;\n const currentFolderId = presenter.folders.vm.currentFolderId;\n const selectedItems = presenter.list.vm.rows.filter(row => {\n return selection.selectedIds.has(row.id);\n });\n\n const openWorkerDialog = useCallback(\n (folder: NodeDto) => {\n showConfirmationDialog({\n title: \"Move entries\",\n message: `You are about to move ${selection.label} to ${folder.label}. Are you sure you want to continue?`,\n loadingLabel: `Processing ${selection.label}`,\n execute: async () => {\n await bulkMove.execute(selectedItems, selection.allSelected, folder.id);\n presenter.list.actions.selection.deselectAll();\n\n if (selection.allSelected) {\n toast.showSuccessToast({\n title: \"Entries will be moved in the background\",\n description: `All entries will be moved to ${folder.label}. 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 dismissible: true,\n duration: Infinity\n });\n\n return;\n }\n\n showResultsDialog({\n results: bulkMove.vm.results,\n title: \"Move entries\",\n message: \"Finished moving entries! See full report below:\"\n });\n }\n });\n },\n [selection.label, selection.allSelected, selectedItems]\n );\n\n const openMoveEntriesDialog = () =>\n showMoveDialog({\n title: \"Select folder\",\n message: \"Select a new location for selected entries:\",\n loadingLabel: `Processing ${selection.label}`,\n acceptLabel: \"Move\",\n focusedFolderId: currentFolderId || ROOT_FOLDER,\n async onAccept({ folder }) {\n openWorkerDialog(folder);\n }\n });\n\n return (\n <BulkActionButton\n text=\"Move\"\n tooltipContent={`Move ${selection.label}`}\n icon={<MoveIcon />}\n onClick={openMoveEntriesDialog}\n />\n );\n});\n"],"names":["ActionMove","observer","presenter","useContentEntriesPresenter","bulkMove","useFeature","BulkMoveFeature","toast","useToast","showConfirmationDialog","showResultsDialog","useBulkActionDialog","showMoveDialog","useMoveToFolderDialog","selection","currentFolderId","selectedItems","row","openWorkerDialog","useCallback","folder","Infinity","openMoveEntriesDialog","ROOT_FOLDER","BulkActionButton","MoveIcon"],"mappings":";;;;;;;;;;AAeO,MAAMA,aAAaC,SAAS;IAC/B,MAAMC,YAAYC;IAClB,MAAM,EAAE,WAAWC,QAAQ,EAAE,GAAGC,WAAWC;IAC3C,MAAMC,QAAQC;IACd,MAAM,EAAEC,sBAAsB,EAAEC,iBAAiB,EAAE,GAAGC;IACtD,MAAM,EAAE,YAAYC,cAAc,EAAE,GAAGC;IAEvC,MAAMC,YAAYZ,UAAU,IAAI,CAAC,EAAE,CAAC,SAAS;IAC7C,MAAMa,kBAAkBb,UAAU,OAAO,CAAC,EAAE,CAAC,eAAe;IAC5D,MAAMc,gBAAgBd,UAAU,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,MAAM,CAACe,CAAAA,MACzCH,UAAU,WAAW,CAAC,GAAG,CAACG,IAAI,EAAE;IAG3C,MAAMC,mBAAmBC,YACrB,CAACC;QACGX,uBAAuB;YACnB,OAAO;YACP,SAAS,CAAC,sBAAsB,EAAEK,UAAU,KAAK,CAAC,IAAI,EAAEM,OAAO,KAAK,CAAC,oCAAoC,CAAC;YAC1G,cAAc,CAAC,WAAW,EAAEN,UAAU,KAAK,EAAE;YAC7C,SAAS;gBACL,MAAMV,SAAS,OAAO,CAACY,eAAeF,UAAU,WAAW,EAAEM,OAAO,EAAE;gBACtElB,UAAU,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,WAAW;gBAE5C,IAAIY,UAAU,WAAW,EAAE,YACvBP,MAAM,gBAAgB,CAAC;oBACnB,OAAO;oBACP,aAAa,CAAC,6BAA6B,EAAEa,OAAO,KAAK,CAAC,sJAAsJ,CAAC;oBACjN,aAAa;oBACb,UAAUC,KAAQ;gBACtB;gBAKJX,kBAAkB;oBACd,SAASN,SAAS,EAAE,CAAC,OAAO;oBAC5B,OAAO;oBACP,SAAS;gBACb;YACJ;QACJ;IACJ,GACA;QAACU,UAAU,KAAK;QAAEA,UAAU,WAAW;QAAEE;KAAc;IAG3D,MAAMM,wBAAwB,IAC1BV,eAAe;YACX,OAAO;YACP,SAAS;YACT,cAAc,CAAC,WAAW,EAAEE,UAAU,KAAK,EAAE;YAC7C,aAAa;YACb,iBAAiBC,mBAAmBQ;YACpC,MAAM,UAAS,EAAEH,MAAM,EAAE;gBACrBF,iBAAiBE;YACrB;QACJ;IAEJ,OAAO,WAAP,GACI,oBAACI,kBAAgBA;QACb,MAAK;QACL,gBAAgB,CAAC,KAAK,EAAEV,UAAU,KAAK,EAAE;QACzC,oBAAM,oBAACW,gBAAQA;QACf,SAASH;;AAGrB"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
export declare const ActionPublish: (() => React.JSX.Element | null) & {
|
|
3
|
-
|
|
2
|
+
export declare const ActionPublish: (() => React.JSX.Element | null) & React.NamedExoticComponent<unknown> & {
|
|
3
|
+
readonly type: () => React.JSX.Element | null;
|
|
4
4
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"admin/components/ContentEntries/BulkActions/ActionPublish.js","sources":["../../../../../src/admin/components/ContentEntries/BulkActions/ActionPublish.tsx"],"sourcesContent":["import React from \"react\";\nimport { observer } from \"mobx-react-lite\";\nimport { useToast } from \"@webiny/admin-ui\";\nimport { useFeature } from \"@webiny/app\";\nimport { ReactComponent as PublishIcon } from \"@webiny/icons/visibility.svg\";\nimport {\n BulkActionButton,\n useBulkActionDialog\n} from \"@webiny/app-admin/components/BulkActions/index.js\";\nimport { usePermission } from \"~/admin/hooks/index.js\";\nimport { BulkPublishFeature } from \"~/presentation/contentEntries/bulkActions/feature.js\";\nimport { useContentEntriesPresenter } from \"~/presentation/contentEntries/list/useContentEntriesPresenter.js\";\n\nexport const ActionPublish = observer(() => {\n const { canPublish } = usePermission();\n const presenter = useContentEntriesPresenter();\n const toast = useToast();\n const { showConfirmationDialog, showResultsDialog } = useBulkActionDialog();\n const { presenter: bulkPublish } = useFeature(BulkPublishFeature);\n\n const selection = presenter.list.vm.selection;\n const selectedItems = presenter.list.vm.rows.filter(row => {\n return selection.selectedIds.has(row.id);\n });\n\n const openPublishEntriesDialog = () =>\n showConfirmationDialog({\n title: \"Publish entries\",\n message: `You are about to publish ${selection.label}. Are you sure you want to continue?`,\n loadingLabel: `Processing ${selection.label}`,\n execute: async () => {\n await bulkPublish.execute(selectedItems, selection.allSelected);\n presenter.list.actions.selection.deselectAll();\n\n if (selection.allSelected) {\n toast.showSuccessToast({\n title: \"Publishing of entries started in the background\",\n description:\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 dismissible: true,\n duration: Infinity\n });\n return;\n }\n\n showResultsDialog({\n results: bulkPublish.vm.results,\n title: \"Publish entries\",\n message: \"Finished publishing entries! See full report below:\"\n });\n }\n });\n\n if (!canPublish(\"cms.contentEntry\")) {\n return null;\n }\n\n return (\n <BulkActionButton\n text=\"Publish\"\n tooltipContent={`Publish ${selection.label}`}\n icon={<PublishIcon />}\n onClick={openPublishEntriesDialog}\n />\n );\n});\n"],"names":["ActionPublish","observer","canPublish","usePermission","presenter","useContentEntriesPresenter","toast","useToast","showConfirmationDialog","showResultsDialog","useBulkActionDialog","bulkPublish","useFeature","BulkPublishFeature","selection","selectedItems","row","openPublishEntriesDialog","Infinity","BulkActionButton","PublishIcon"],"mappings":";;;;;;;;;AAaO,MAAMA,gBAAgBC,SAAS;IAClC,MAAM,EAAEC,UAAU,EAAE,GAAGC;IACvB,MAAMC,YAAYC;IAClB,MAAMC,QAAQC;IACd,MAAM,EAAEC,sBAAsB,EAAEC,iBAAiB,EAAE,GAAGC;IACtD,MAAM,EAAE,WAAWC,WAAW,EAAE,GAAGC,WAAWC;IAE9C,MAAMC,YAAYV,UAAU,IAAI,CAAC,EAAE,CAAC,SAAS;IAC7C,MAAMW,gBAAgBX,UAAU,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,MAAM,CAACY,CAAAA,MACzCF,UAAU,WAAW,CAAC,GAAG,CAACE,IAAI,EAAE;IAG3C,MAAMC,2BAA2B,IAC7BT,uBAAuB;YACnB,OAAO;YACP,SAAS,CAAC,yBAAyB,EAAEM,UAAU,KAAK,CAAC,oCAAoC,CAAC;YAC1F,cAAc,CAAC,WAAW,EAAEA,UAAU,KAAK,EAAE;YAC7C,SAAS;gBACL,MAAMH,YAAY,OAAO,CAACI,eAAeD,UAAU,WAAW;gBAC9DV,UAAU,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,WAAW;gBAE5C,IAAIU,UAAU,WAAW,EAAE,YACvBR,MAAM,gBAAgB,CAAC;oBACnB,OAAO;oBACP,aACI;oBACJ,aAAa;oBACb,UAAUY;
|
|
1
|
+
{"version":3,"file":"admin/components/ContentEntries/BulkActions/ActionPublish.js","sources":["../../../../../src/admin/components/ContentEntries/BulkActions/ActionPublish.tsx"],"sourcesContent":["import React from \"react\";\nimport { observer } from \"mobx-react-lite\";\nimport { useToast } from \"@webiny/admin-ui\";\nimport { useFeature } from \"@webiny/app\";\nimport { ReactComponent as PublishIcon } from \"@webiny/icons/visibility.svg\";\nimport {\n BulkActionButton,\n useBulkActionDialog\n} from \"@webiny/app-admin/components/BulkActions/index.js\";\nimport { usePermission } from \"~/admin/hooks/index.js\";\nimport { BulkPublishFeature } from \"~/presentation/contentEntries/bulkActions/feature.js\";\nimport { useContentEntriesPresenter } from \"~/presentation/contentEntries/list/useContentEntriesPresenter.js\";\n\nexport const ActionPublish = observer(() => {\n const { canPublish } = usePermission();\n const presenter = useContentEntriesPresenter();\n const toast = useToast();\n const { showConfirmationDialog, showResultsDialog } = useBulkActionDialog();\n const { presenter: bulkPublish } = useFeature(BulkPublishFeature);\n\n const selection = presenter.list.vm.selection;\n const selectedItems = presenter.list.vm.rows.filter(row => {\n return selection.selectedIds.has(row.id);\n });\n\n const openPublishEntriesDialog = () =>\n showConfirmationDialog({\n title: \"Publish entries\",\n message: `You are about to publish ${selection.label}. Are you sure you want to continue?`,\n loadingLabel: `Processing ${selection.label}`,\n execute: async () => {\n await bulkPublish.execute(selectedItems, selection.allSelected);\n presenter.list.actions.selection.deselectAll();\n\n if (selection.allSelected) {\n toast.showSuccessToast({\n title: \"Publishing of entries started in the background\",\n description:\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 dismissible: true,\n duration: Infinity\n });\n return;\n }\n\n showResultsDialog({\n results: bulkPublish.vm.results,\n title: \"Publish entries\",\n message: \"Finished publishing entries! See full report below:\"\n });\n }\n });\n\n if (!canPublish(\"cms.contentEntry\")) {\n return null;\n }\n\n return (\n <BulkActionButton\n text=\"Publish\"\n tooltipContent={`Publish ${selection.label}`}\n icon={<PublishIcon />}\n onClick={openPublishEntriesDialog}\n />\n );\n});\n"],"names":["ActionPublish","observer","canPublish","usePermission","presenter","useContentEntriesPresenter","toast","useToast","showConfirmationDialog","showResultsDialog","useBulkActionDialog","bulkPublish","useFeature","BulkPublishFeature","selection","selectedItems","row","openPublishEntriesDialog","Infinity","BulkActionButton","PublishIcon"],"mappings":";;;;;;;;;AAaO,MAAMA,gBAAgBC,SAAS;IAClC,MAAM,EAAEC,UAAU,EAAE,GAAGC;IACvB,MAAMC,YAAYC;IAClB,MAAMC,QAAQC;IACd,MAAM,EAAEC,sBAAsB,EAAEC,iBAAiB,EAAE,GAAGC;IACtD,MAAM,EAAE,WAAWC,WAAW,EAAE,GAAGC,WAAWC;IAE9C,MAAMC,YAAYV,UAAU,IAAI,CAAC,EAAE,CAAC,SAAS;IAC7C,MAAMW,gBAAgBX,UAAU,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,MAAM,CAACY,CAAAA,MACzCF,UAAU,WAAW,CAAC,GAAG,CAACE,IAAI,EAAE;IAG3C,MAAMC,2BAA2B,IAC7BT,uBAAuB;YACnB,OAAO;YACP,SAAS,CAAC,yBAAyB,EAAEM,UAAU,KAAK,CAAC,oCAAoC,CAAC;YAC1F,cAAc,CAAC,WAAW,EAAEA,UAAU,KAAK,EAAE;YAC7C,SAAS;gBACL,MAAMH,YAAY,OAAO,CAACI,eAAeD,UAAU,WAAW;gBAC9DV,UAAU,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,WAAW;gBAE5C,IAAIU,UAAU,WAAW,EAAE,YACvBR,MAAM,gBAAgB,CAAC;oBACnB,OAAO;oBACP,aACI;oBACJ,aAAa;oBACb,UAAUY,KAAQ;gBACtB;gBAIJT,kBAAkB;oBACd,SAASE,YAAY,EAAE,CAAC,OAAO;oBAC/B,OAAO;oBACP,SAAS;gBACb;YACJ;QACJ;IAEJ,IAAI,CAACT,WAAW,qBACZ,OAAO;IAGX,OAAO,WAAP,GACI,oBAACiB,kBAAgBA;QACb,MAAK;QACL,gBAAgB,CAAC,QAAQ,EAAEL,UAAU,KAAK,EAAE;QAC5C,oBAAM,oBAACM,gBAAWA;QAClB,SAASH;;AAGrB"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
export declare const ActionUnpublish: (() => React.JSX.Element | null) & {
|
|
3
|
-
|
|
2
|
+
export declare const ActionUnpublish: (() => React.JSX.Element | null) & React.NamedExoticComponent<unknown> & {
|
|
3
|
+
readonly type: () => React.JSX.Element | null;
|
|
4
4
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"admin/components/ContentEntries/BulkActions/ActionUnpublish.js","sources":["../../../../../src/admin/components/ContentEntries/BulkActions/ActionUnpublish.tsx"],"sourcesContent":["import React from \"react\";\nimport { observer } from \"mobx-react-lite\";\nimport { ReactComponent as UnpublishIcon } from \"@webiny/icons/visibility_off.svg\";\nimport { useToast } from \"@webiny/admin-ui\";\nimport { useFeature } from \"@webiny/app\";\nimport {\n BulkActionButton,\n useBulkActionDialog\n} from \"@webiny/app-admin/components/BulkActions/index.js\";\nimport { usePermission } from \"~/admin/hooks/index.js\";\nimport { BulkUnpublishFeature } from \"~/presentation/contentEntries/bulkActions/feature.js\";\nimport { useContentEntriesPresenter } from \"~/presentation/contentEntries/list/useContentEntriesPresenter.js\";\n\nexport const ActionUnpublish = observer(() => {\n const { canUnpublish } = usePermission();\n const presenter = useContentEntriesPresenter();\n const { presenter: bulkUnpublish } = useFeature(BulkUnpublishFeature);\n const toast = useToast();\n const { showConfirmationDialog, showResultsDialog } = useBulkActionDialog();\n\n const selection = presenter.list.vm.selection;\n const selectedItems = presenter.list.vm.rows.filter(row => {\n return selection.selectedIds.has(row.id);\n });\n\n const openUnpublishEntriesDialog = () => {\n showConfirmationDialog({\n title: \"Unpublish entries\",\n message: `You are about to unpublish ${selection.label}. Are you sure you want to continue?`,\n loadingLabel: `Processing ${selection.label}`,\n execute: async () => {\n await bulkUnpublish.execute(selectedItems, selection.allSelected);\n presenter.list.actions.selection.deselectAll();\n\n if (selection.allSelected) {\n toast.showSuccessToast({\n title: \"Entries will be unpublished in the background\",\n description:\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 dismissible: true,\n duration: Infinity\n });\n\n return;\n }\n\n showResultsDialog({\n results: bulkUnpublish.vm.results,\n title: \"Unpublish entries\",\n message: \"Finished unpublishing entries! See full report below:\"\n });\n }\n });\n };\n\n if (!canUnpublish(\"cms.contentEntry\")) {\n return null;\n }\n\n return (\n <BulkActionButton\n text=\"Unpublish\"\n tooltipContent={`Unpublish ${selection.label}`}\n icon={<UnpublishIcon />}\n onClick={openUnpublishEntriesDialog}\n />\n );\n});\n"],"names":["ActionUnpublish","observer","canUnpublish","usePermission","presenter","useContentEntriesPresenter","bulkUnpublish","useFeature","BulkUnpublishFeature","toast","useToast","showConfirmationDialog","showResultsDialog","useBulkActionDialog","selection","selectedItems","row","openUnpublishEntriesDialog","Infinity","BulkActionButton","UnpublishIcon"],"mappings":";;;;;;;;;AAaO,MAAMA,kBAAkBC,SAAS;IACpC,MAAM,EAAEC,YAAY,EAAE,GAAGC;IACzB,MAAMC,YAAYC;IAClB,MAAM,EAAE,WAAWC,aAAa,EAAE,GAAGC,WAAWC;IAChD,MAAMC,QAAQC;IACd,MAAM,EAAEC,sBAAsB,EAAEC,iBAAiB,EAAE,GAAGC;IAEtD,MAAMC,YAAYV,UAAU,IAAI,CAAC,EAAE,CAAC,SAAS;IAC7C,MAAMW,gBAAgBX,UAAU,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,MAAM,CAACY,CAAAA,MACzCF,UAAU,WAAW,CAAC,GAAG,CAACE,IAAI,EAAE;IAG3C,MAAMC,6BAA6B;QAC/BN,uBAAuB;YACnB,OAAO;YACP,SAAS,CAAC,2BAA2B,EAAEG,UAAU,KAAK,CAAC,oCAAoC,CAAC;YAC5F,cAAc,CAAC,WAAW,EAAEA,UAAU,KAAK,EAAE;YAC7C,SAAS;gBACL,MAAMR,cAAc,OAAO,CAACS,eAAeD,UAAU,WAAW;gBAChEV,UAAU,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,WAAW;gBAE5C,IAAIU,UAAU,WAAW,EAAE,YACvBL,MAAM,gBAAgB,CAAC;oBACnB,OAAO;oBACP,aACI;oBACJ,aAAa;oBACb,UAAUS;
|
|
1
|
+
{"version":3,"file":"admin/components/ContentEntries/BulkActions/ActionUnpublish.js","sources":["../../../../../src/admin/components/ContentEntries/BulkActions/ActionUnpublish.tsx"],"sourcesContent":["import React from \"react\";\nimport { observer } from \"mobx-react-lite\";\nimport { ReactComponent as UnpublishIcon } from \"@webiny/icons/visibility_off.svg\";\nimport { useToast } from \"@webiny/admin-ui\";\nimport { useFeature } from \"@webiny/app\";\nimport {\n BulkActionButton,\n useBulkActionDialog\n} from \"@webiny/app-admin/components/BulkActions/index.js\";\nimport { usePermission } from \"~/admin/hooks/index.js\";\nimport { BulkUnpublishFeature } from \"~/presentation/contentEntries/bulkActions/feature.js\";\nimport { useContentEntriesPresenter } from \"~/presentation/contentEntries/list/useContentEntriesPresenter.js\";\n\nexport const ActionUnpublish = observer(() => {\n const { canUnpublish } = usePermission();\n const presenter = useContentEntriesPresenter();\n const { presenter: bulkUnpublish } = useFeature(BulkUnpublishFeature);\n const toast = useToast();\n const { showConfirmationDialog, showResultsDialog } = useBulkActionDialog();\n\n const selection = presenter.list.vm.selection;\n const selectedItems = presenter.list.vm.rows.filter(row => {\n return selection.selectedIds.has(row.id);\n });\n\n const openUnpublishEntriesDialog = () => {\n showConfirmationDialog({\n title: \"Unpublish entries\",\n message: `You are about to unpublish ${selection.label}. Are you sure you want to continue?`,\n loadingLabel: `Processing ${selection.label}`,\n execute: async () => {\n await bulkUnpublish.execute(selectedItems, selection.allSelected);\n presenter.list.actions.selection.deselectAll();\n\n if (selection.allSelected) {\n toast.showSuccessToast({\n title: \"Entries will be unpublished in the background\",\n description:\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 dismissible: true,\n duration: Infinity\n });\n\n return;\n }\n\n showResultsDialog({\n results: bulkUnpublish.vm.results,\n title: \"Unpublish entries\",\n message: \"Finished unpublishing entries! See full report below:\"\n });\n }\n });\n };\n\n if (!canUnpublish(\"cms.contentEntry\")) {\n return null;\n }\n\n return (\n <BulkActionButton\n text=\"Unpublish\"\n tooltipContent={`Unpublish ${selection.label}`}\n icon={<UnpublishIcon />}\n onClick={openUnpublishEntriesDialog}\n />\n );\n});\n"],"names":["ActionUnpublish","observer","canUnpublish","usePermission","presenter","useContentEntriesPresenter","bulkUnpublish","useFeature","BulkUnpublishFeature","toast","useToast","showConfirmationDialog","showResultsDialog","useBulkActionDialog","selection","selectedItems","row","openUnpublishEntriesDialog","Infinity","BulkActionButton","UnpublishIcon"],"mappings":";;;;;;;;;AAaO,MAAMA,kBAAkBC,SAAS;IACpC,MAAM,EAAEC,YAAY,EAAE,GAAGC;IACzB,MAAMC,YAAYC;IAClB,MAAM,EAAE,WAAWC,aAAa,EAAE,GAAGC,WAAWC;IAChD,MAAMC,QAAQC;IACd,MAAM,EAAEC,sBAAsB,EAAEC,iBAAiB,EAAE,GAAGC;IAEtD,MAAMC,YAAYV,UAAU,IAAI,CAAC,EAAE,CAAC,SAAS;IAC7C,MAAMW,gBAAgBX,UAAU,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,MAAM,CAACY,CAAAA,MACzCF,UAAU,WAAW,CAAC,GAAG,CAACE,IAAI,EAAE;IAG3C,MAAMC,6BAA6B;QAC/BN,uBAAuB;YACnB,OAAO;YACP,SAAS,CAAC,2BAA2B,EAAEG,UAAU,KAAK,CAAC,oCAAoC,CAAC;YAC5F,cAAc,CAAC,WAAW,EAAEA,UAAU,KAAK,EAAE;YAC7C,SAAS;gBACL,MAAMR,cAAc,OAAO,CAACS,eAAeD,UAAU,WAAW;gBAChEV,UAAU,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,WAAW;gBAE5C,IAAIU,UAAU,WAAW,EAAE,YACvBL,MAAM,gBAAgB,CAAC;oBACnB,OAAO;oBACP,aACI;oBACJ,aAAa;oBACb,UAAUS,KAAQ;gBACtB;gBAKJN,kBAAkB;oBACd,SAASN,cAAc,EAAE,CAAC,OAAO;oBACjC,OAAO;oBACP,SAAS;gBACb;YACJ;QACJ;IACJ;IAEA,IAAI,CAACJ,aAAa,qBACd,OAAO;IAGX,OAAO,WAAP,GACI,oBAACiB,kBAAgBA;QACb,MAAK;QACL,gBAAgB,CAAC,UAAU,EAAEL,UAAU,KAAK,EAAE;QAC9C,oBAAM,oBAACM,gBAAaA;QACpB,SAASH;;AAGrB"}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import react, { useEffect, useMemo } from "react";
|
|
2
|
+
import { observer } from "mobx-react-lite";
|
|
3
|
+
import { Bind } from "@webiny/form";
|
|
4
|
+
import { AutoComplete } from "@webiny/admin-ui";
|
|
5
|
+
import { DiContainerProvider, useContainer, useFeature } from "@webiny/app";
|
|
6
|
+
import { ContentEntryListConfig } from "../../../config/contentEntries/index.js";
|
|
7
|
+
import { RefSingleAutocompletePresenterFeature } from "../../../../presentation/fieldRenderers/ref/autocomplete/single/feature.js";
|
|
8
|
+
const { useInputField: useInputField } = ContentEntryListConfig.Browser.AdvancedSearch.FieldRenderer;
|
|
9
|
+
const parseValue = (value)=>{
|
|
10
|
+
if ("string" != typeof value || !value) return null;
|
|
11
|
+
try {
|
|
12
|
+
const parsed = JSON.parse(value);
|
|
13
|
+
if (!parsed?.entryId || !parsed?.modelId) return null;
|
|
14
|
+
return {
|
|
15
|
+
entryId: parsed.entryId,
|
|
16
|
+
modelId: parsed.modelId
|
|
17
|
+
};
|
|
18
|
+
} catch {
|
|
19
|
+
return null;
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
const Ref = ()=>{
|
|
23
|
+
const { name, field } = useInputField();
|
|
24
|
+
const parentContainer = useContainer();
|
|
25
|
+
const scopedContainer = useMemo(()=>{
|
|
26
|
+
const child = parentContainer.createChildContainer();
|
|
27
|
+
RefSingleAutocompletePresenterFeature.register(child);
|
|
28
|
+
return child;
|
|
29
|
+
}, [
|
|
30
|
+
field.value
|
|
31
|
+
]);
|
|
32
|
+
return /*#__PURE__*/ react.createElement(DiContainerProvider, {
|
|
33
|
+
container: scopedContainer,
|
|
34
|
+
key: field.value
|
|
35
|
+
}, /*#__PURE__*/ react.createElement(Bind, {
|
|
36
|
+
name: name
|
|
37
|
+
}, (bind)=>/*#__PURE__*/ react.createElement(RefInner, {
|
|
38
|
+
bind: bind,
|
|
39
|
+
modelIds: field.settings.modelIds
|
|
40
|
+
})));
|
|
41
|
+
};
|
|
42
|
+
const RefInner = observer(({ bind, modelIds })=>{
|
|
43
|
+
const { presenter } = useFeature(RefSingleAutocompletePresenterFeature);
|
|
44
|
+
useEffect(()=>{
|
|
45
|
+
const value = parseValue(bind.value);
|
|
46
|
+
presenter.init({
|
|
47
|
+
modelIds,
|
|
48
|
+
value: value ? {
|
|
49
|
+
id: value.entryId,
|
|
50
|
+
modelId: value.modelId
|
|
51
|
+
} : null
|
|
52
|
+
});
|
|
53
|
+
}, []);
|
|
54
|
+
const vm = presenter.vm;
|
|
55
|
+
return /*#__PURE__*/ react.createElement(AutoComplete, {
|
|
56
|
+
label: "Value",
|
|
57
|
+
size: "lg",
|
|
58
|
+
loading: vm.loading,
|
|
59
|
+
value: vm.value,
|
|
60
|
+
options: vm.options,
|
|
61
|
+
validation: bind.validation,
|
|
62
|
+
onValueSearch: (query)=>presenter.search(query),
|
|
63
|
+
onValueChange: (entryId)=>{
|
|
64
|
+
if (!entryId) {
|
|
65
|
+
presenter.clear();
|
|
66
|
+
bind.onChange("");
|
|
67
|
+
return;
|
|
68
|
+
}
|
|
69
|
+
const ref = presenter.select(entryId);
|
|
70
|
+
if (ref) bind.onChange(JSON.stringify({
|
|
71
|
+
entryId,
|
|
72
|
+
modelId: ref.modelId
|
|
73
|
+
}));
|
|
74
|
+
},
|
|
75
|
+
onValueReset: ()=>{
|
|
76
|
+
presenter.clear();
|
|
77
|
+
bind.onChange("");
|
|
78
|
+
},
|
|
79
|
+
displayResetAction: vm.canReset
|
|
80
|
+
});
|
|
81
|
+
});
|
|
82
|
+
export { Ref };
|
|
83
|
+
|
|
84
|
+
//# sourceMappingURL=RefFieldRenderer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"admin/components/ContentEntries/Filters/RefFieldRenderer.js","sources":["../../../../../src/admin/components/ContentEntries/Filters/RefFieldRenderer.tsx"],"sourcesContent":["import React, { useEffect, useMemo } from \"react\";\nimport { observer } from \"mobx-react-lite\";\nimport { Bind } from \"@webiny/form\";\nimport type { BindComponentRenderProp } from \"@webiny/form\";\nimport { AutoComplete } from \"@webiny/admin-ui\";\nimport { DiContainerProvider, useContainer, useFeature } from \"@webiny/app\";\nimport { ContentEntryListConfig } from \"~/admin/config/contentEntries/index.js\";\nimport { RefSingleAutocompletePresenterFeature } from \"~/presentation/fieldRenderers/ref/autocomplete/single/feature.js\";\n\nconst { useInputField } = ContentEntryListConfig.Browser.AdvancedSearch.FieldRenderer;\n\n/**\n * The advanced search filter stores the selected reference as a JSON string\n * `{ entryId, modelId }`. `GraphQLInputMapper` reads `entryId` from it to build the\n * `<fieldId>.entryId` where condition, and `modelId` is used to load the label back\n * when a saved filter is opened.\n */\ninterface RefFilterValue {\n entryId: string;\n modelId: string;\n}\n\nconst parseValue = (value: unknown): RefFilterValue | null => {\n if (typeof value !== \"string\" || !value) {\n return null;\n }\n try {\n const parsed = JSON.parse(value);\n if (!parsed?.entryId || !parsed?.modelId) {\n return null;\n }\n return { entryId: parsed.entryId, modelId: parsed.modelId };\n } catch {\n return null;\n }\n};\n\nexport const Ref = () => {\n const { name, field } = useInputField();\n const parentContainer = useContainer();\n\n const scopedContainer = useMemo(() => {\n const child = parentContainer.createChildContainer();\n RefSingleAutocompletePresenterFeature.register(child);\n return child;\n }, [field.value]);\n\n return (\n <DiContainerProvider container={scopedContainer} key={field.value}>\n <Bind name={name}>\n {bind => <RefInner bind={bind} modelIds={field.settings.modelIds} />}\n </Bind>\n </DiContainerProvider>\n );\n};\n\ninterface RefInnerProps {\n bind: BindComponentRenderProp;\n modelIds: string[];\n}\n\nconst RefInner = observer(({ bind, modelIds }: RefInnerProps) => {\n const { presenter } = useFeature(RefSingleAutocompletePresenterFeature);\n\n useEffect(() => {\n const value = parseValue(bind.value);\n presenter.init({\n modelIds,\n value: value ? { id: value.entryId, modelId: value.modelId } : null\n });\n }, []);\n\n const vm = presenter.vm;\n\n return (\n <AutoComplete\n label={\"Value\"}\n size={\"lg\"}\n loading={vm.loading}\n value={vm.value}\n options={vm.options}\n validation={bind.validation}\n onValueSearch={query => presenter.search(query)}\n onValueChange={entryId => {\n if (!entryId) {\n presenter.clear();\n bind.onChange(\"\");\n return;\n }\n const ref = presenter.select(entryId);\n if (ref) {\n bind.onChange(JSON.stringify({ entryId, modelId: ref.modelId }));\n }\n }}\n onValueReset={() => {\n presenter.clear();\n bind.onChange(\"\");\n }}\n displayResetAction={vm.canReset}\n />\n );\n});\n"],"names":["useInputField","ContentEntryListConfig","parseValue","value","parsed","JSON","Ref","name","field","parentContainer","useContainer","scopedContainer","useMemo","child","RefSingleAutocompletePresenterFeature","DiContainerProvider","Bind","bind","RefInner","observer","modelIds","presenter","useFeature","useEffect","vm","AutoComplete","query","entryId","ref"],"mappings":";;;;;;;AASA,MAAM,EAAEA,eAAAA,aAAa,EAAE,GAAGC,uBAAuB,OAAO,CAAC,cAAc,CAAC,aAAa;AAarF,MAAMC,aAAa,CAACC;IAChB,IAAI,AAAiB,YAAjB,OAAOA,SAAsB,CAACA,OAC9B,OAAO;IAEX,IAAI;QACA,MAAMC,SAASC,KAAK,KAAK,CAACF;QAC1B,IAAI,CAACC,QAAQ,WAAW,CAACA,QAAQ,SAC7B,OAAO;QAEX,OAAO;YAAE,SAASA,OAAO,OAAO;YAAE,SAASA,OAAO,OAAO;QAAC;IAC9D,EAAE,OAAM;QACJ,OAAO;IACX;AACJ;AAEO,MAAME,MAAM;IACf,MAAM,EAAEC,IAAI,EAAEC,KAAK,EAAE,GAAGR;IACxB,MAAMS,kBAAkBC;IAExB,MAAMC,kBAAkBC,QAAQ;QAC5B,MAAMC,QAAQJ,gBAAgB,oBAAoB;QAClDK,sCAAsC,QAAQ,CAACD;QAC/C,OAAOA;IACX,GAAG;QAACL,MAA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
+
import { useToast } from "@webiny/admin-ui";
|
|
4
|
+
import { ContentEntryListConfig } from "../../../../config/contentEntries/index.js";
|
|
5
|
+
import { useEntry, usePermission } from "../../../../hooks/index.js";
|
|
6
|
+
import { useContentEntriesPresenter } from "../../../../../presentation/contentEntries/list/useContentEntriesPresenter.js";
|
|
7
|
+
const DuplicateEntry = ()=>{
|
|
8
|
+
const { entry } = useEntry();
|
|
9
|
+
const toast = useToast();
|
|
10
|
+
const { canCreate } = usePermission();
|
|
11
|
+
const presenter = useContentEntriesPresenter();
|
|
12
|
+
const { OptionsMenuItem } = ContentEntryListConfig.Browser.Entry.Action;
|
|
13
|
+
const handleDuplicate = async ()=>{
|
|
14
|
+
const result = await presenter.duplicateEntry(entry);
|
|
15
|
+
if (!result) return;
|
|
16
|
+
if (result.error) return void toast.showWarningToast({
|
|
17
|
+
title: `Could not duplicate ${entry.meta.title}.`,
|
|
18
|
+
description: result.error.message
|
|
19
|
+
});
|
|
20
|
+
toast.showSuccessToast({
|
|
21
|
+
title: `${entry.meta.title} was duplicated successfully!`
|
|
22
|
+
});
|
|
23
|
+
};
|
|
24
|
+
if (!canCreate("cms.contentEntry")) return null;
|
|
25
|
+
return /*#__PURE__*/ react.createElement(OptionsMenuItem, {
|
|
26
|
+
icon: /*#__PURE__*/ react.createElement(ReactComponent, null),
|
|
27
|
+
label: "Duplicate",
|
|
28
|
+
onAction: handleDuplicate,
|
|
29
|
+
"data-testid": "aco.actions.entry.duplicate"
|
|
30
|
+
});
|
|
31
|
+
};
|
|
32
|
+
export { DuplicateEntry };
|
|
33
|
+
|
|
34
|
+
//# sourceMappingURL=DuplicateEntry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"admin/components/ContentEntries/Table/Actions/DuplicateEntry.js","sources":["../../../../../../src/admin/components/ContentEntries/Table/Actions/DuplicateEntry.tsx"],"sourcesContent":["import React from \"react\";\nimport { ReactComponent as DuplicateIcon } from \"@webiny/icons/library_add.svg\";\nimport { useToast } from \"@webiny/admin-ui\";\nimport { ContentEntryListConfig } from \"~/admin/config/contentEntries/index.js\";\nimport { useEntry, usePermission } from \"~/admin/hooks/index.js\";\nimport { useContentEntriesPresenter } from \"~/presentation/contentEntries/list/useContentEntriesPresenter.js\";\n\nexport const DuplicateEntry = () => {\n const { entry } = useEntry();\n const toast = useToast();\n const { canCreate } = usePermission();\n const presenter = useContentEntriesPresenter();\n const { OptionsMenuItem } = ContentEntryListConfig.Browser.Entry.Action;\n\n const handleDuplicate = async () => {\n const result = await presenter.duplicateEntry(entry);\n if (!result) {\n return;\n }\n if (result.error) {\n toast.showWarningToast({\n title: `Could not duplicate ${entry.meta.title}.`,\n description: result.error.message\n });\n return;\n }\n toast.showSuccessToast({\n title: `${entry.meta.title} was duplicated successfully!`\n });\n };\n\n if (!canCreate(\"cms.contentEntry\")) {\n return null;\n }\n\n return (\n <OptionsMenuItem\n icon={<DuplicateIcon />}\n label={\"Duplicate\"}\n onAction={handleDuplicate}\n data-testid={\"aco.actions.entry.duplicate\"}\n />\n );\n};\n"],"names":["DuplicateEntry","entry","useEntry","toast","useToast","canCreate","usePermission","presenter","useContentEntriesPresenter","OptionsMenuItem","ContentEntryListConfig","handleDuplicate","result","DuplicateIcon"],"mappings":";;;;;;AAOO,MAAMA,iBAAiB;IAC1B,MAAM,EAAEC,KAAK,EAAE,GAAGC;IAClB,MAAMC,QAAQC;IACd,MAAM,EAAEC,SAAS,EAAE,GAAGC;IACtB,MAAMC,YAAYC;IAClB,MAAM,EAAEC,eAAe,EAAE,GAAGC,uBAAuB,OAAO,CAAC,KAAK,CAAC,MAAM;IAEvE,MAAMC,kBAAkB;QACpB,MAAMC,SAAS,MAAML,UAAU,cAAc,CAACN;QAC9C,IAAI,CAACW,QACD;QAEJ,IAAIA,OAAO,KAAK,EAAE,YACdT,MAAM,gBAAgB,CAAC;YACnB,OAAO,CAAC,oBAAoB,EAAEF,MAAM,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC;YACjD,aAAaW,OAAO,KAAK,CAAC,OAAO;QACrC;QAGJT,MAAM,gBAAgB,CAAC;YACnB,OAAO,GAAGF,MAAM,IAAI,CAAC,KAAK,CAAC,6BAA6B,CAAC;QAC7D;IACJ;IAEA,IAAI,CAACI,UAAU,qBACX,OAAO;IAGX,OAAO,WAAP,GACI,oBAACI,iBAAAA;QACG,oBAAM,oBAACI,gBAAaA;QACpB,OAAO;QACP,UAAUF;QACV,eAAa;;AAGzB"}
|
|
@@ -68,7 +68,7 @@ const ContentModelEditor = makeDecoratable("ContentModelEditor", ()=>{
|
|
|
68
68
|
if (!data) return /*#__PURE__*/ react.createElement(OverlayLoader, {
|
|
69
69
|
text: "Loading content model..."
|
|
70
70
|
});
|
|
71
|
-
if (data.isBeingDeleted) return /*#__PURE__*/ react.createElement(ModelIsBeingDeletedError, {
|
|
71
|
+
else if (data.isBeingDeleted) return /*#__PURE__*/ react.createElement(ModelIsBeingDeletedError, {
|
|
72
72
|
model: data
|
|
73
73
|
});
|
|
74
74
|
return /*#__PURE__*/ react.createElement("div", {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"admin/components/ContentModelEditor/ContentModelEditor.js","sources":["../../../../src/admin/components/ContentModelEditor/ContentModelEditor.tsx"],"sourcesContent":["import React, { useState, useEffect } from \"react\";\nimport { makeDecoratable, useDialogs } from \"@webiny/app-admin\";\nimport { useRouter } from \"@webiny/app\";\nimport { i18n } from \"@webiny/app/i18n/index.js\";\nimport { IconButton, OverlayLoader, SegmentedControlPrimitive, Tag, Text } from \"@webiny/admin-ui\";\nimport { ReactComponent as ExpandSidebarIcon } from \"@webiny/icons/left_panel_open.svg\";\nimport { ReactComponent as ViewCompactAltIcon } from \"@webiny/icons/view_compact_alt.svg\";\nimport { ReactComponent as ViewDayIcon } from \"@webiny/icons/view_day.svg\";\nimport { FieldsSidebar } from \"./FieldsSidebar.js\";\n\nconst VIEW_ITEMS = [\n { id: \"compact\", value: \"compact\", label: \"\", icon: <ViewCompactAltIcon /> },\n { id: \"full\", value: \"full\", label: \"\", icon: <ViewDayIcon /> }\n];\nimport { FieldEditor } from \"../FieldEditor/index.js\";\nimport { PreviewTab } from \"./PreviewTab.js\";\nimport Header from \"./Header.js\";\nimport DragPreview from \"../DragPreview.js\";\nimport { useModelEditor } from \"./useModelEditor.js\";\nimport type { CmsEditorFieldsLayout, CmsModelField } from \"~/types.js\";\nimport { ContentEntryEditorWithConfig } from \"~/admin/config/contentEntries/index.js\";\nimport { ModelIsBeingDeletedError } from \"~/admin/components/ContentModelEditor/ModelIsBeingDeletedError/index.js\";\n\nconst t = i18n.ns(\"app-headless-cms/admin/editor\");\n\nconst prompt = t`There are some unsaved changes! Are you sure you want to navigate away and discard all changes?`;\n\ninterface OnChangeParams {\n fields: CmsModelField[];\n layout: CmsEditorFieldsLayout;\n}\n\nexport const ContentModelEditor = makeDecoratable(\"ContentModelEditor\", () => {\n const { data, setData, isPristine } = useModelEditor();\n const router = useRouter();\n const dialogs = useDialogs();\n\n // Add a class to <body> to trigger global styles while this component is active\n useEffect(() => {\n document.body.classList.add(\"overflow-hidden\");\n\n return () => {\n document.body.classList.remove(\"overflow-hidden\");\n };\n }, []);\n\n const isPristineRef = React.useRef(isPristine);\n isPristineRef.current = isPristine;\n\n useEffect(() => {\n return router.addTransitionGuard({\n guard: () => !isPristineRef.current,\n onBlocked: () => {\n dialogs.showDialog({\n title: \"Confirm Navigation\",\n content: prompt,\n acceptLabel: \"Yes!\",\n cancelLabel: \"No, stay here.\",\n onAccept: () => router.confirmTransition(),\n onClose: () => router.cancelTransition()\n });\n }\n });\n }, []);\n\n const [activeTab, setActiveTab] = useState<string>(\"edit\");\n const [isSidebarOpen, setIsSidebarOpen] = useState(true);\n const [activeView, setActiveView] = useState(\"compact\");\n\n const onChange = ({ fields, layout }: OnChangeParams) => {\n setData(data => ({ ...data, fields, layout }));\n };\n\n if (!data) {\n return <OverlayLoader text={\"Loading content model...\"} />;\n } else if (data.isBeingDeleted) {\n return <ModelIsBeingDeletedError model={data} />;\n }\n\n return (\n <div className={\"content-model-editor flex-1\"}>\n <Header activeTab={activeTab} onTabChange={setActiveTab} />\n <div className={\"w-full overflow-y-auto h-main-content\"}>\n <div className={\"flex h-full\"}>\n <div\n className={\n \"shrink-0 bg-neutral-base border-r border-neutral-dimmed overflow-hidden h-main-content relative transition-[width] duration-200 ease-in-out\"\n }\n style={{ width: isSidebarOpen ? 200 : 45 }}\n >\n {/* Expanded content */}\n <div\n className={\n \"transition-opacity duration-150 \" +\n (isSidebarOpen\n ? \"opacity-100 delay-75\"\n : \"opacity-0 pointer-events-none\")\n }\n >\n <FieldsSidebar\n onFieldDragStart={() => setActiveTab(\"edit\")}\n onCollapse={() => setIsSidebarOpen(false)}\n />\n </div>\n {/* Collapsed strip */}\n <div\n className={\n \"absolute inset-0 flex flex-col items-center pt-md gap-md transition-opacity duration-150 \" +\n (!isSidebarOpen\n ? \"opacity-100 delay-75\"\n : \"opacity-0 pointer-events-none\")\n }\n >\n <IconButton\n variant={\"ghost\"}\n size={\"xs\"}\n icon={<ExpandSidebarIcon />}\n onClick={() => setIsSidebarOpen(true)}\n />\n <span\n className={\n \"text-sm font-semibold text-neutral-strong [writing-mode:vertical-rl]\"\n }\n >\n Fields\n </span>\n </div>\n </div>\n <div\n className={\n \"flex-1 overflow-y-scroll h-main-content \" +\n (activeTab === \"edit\" ? \"fill-grid\" : \"bg-neutral-subtle\")\n }\n >\n <div\n className={\n \"sticky top-0 left-0 z-10 p-md flex items-center justify-between\"\n }\n >\n <div>\n {activeTab === \"edit\" && (\n <Text\n as=\"div\"\n size={\"sm\"}\n className={\"font-semibold text-neutral-primary\"}\n >\n Model editor\n </Text>\n )}\n {activeTab === \"preview\" && (\n <Tag content={\"Preview\"} variant={\"warning\"} />\n )}\n </div>\n <SegmentedControlPrimitive\n variant={\"light\"}\n value={activeView}\n onChange={setActiveView}\n items={VIEW_ITEMS}\n />\n </div>\n <div className={\"pb-lg\"}>\n <div\n className={\" transition-[width] duration-200 ease-in-out\"}\n style={{\n width: activeView === \"compact\" ? \"704px\" : \"90%\",\n marginLeft: \"auto\",\n marginRight: \"auto\"\n }}\n >\n {activeTab === \"edit\" && (\n <div className={\"relative\"} data-testid={\"cms.editor.tab.edit\"}>\n <FieldEditor\n fields={data.fields}\n layout={data.layout || []}\n onChange={onChange}\n />\n </div>\n )}\n {activeTab === \"preview\" && (\n <div\n className={\"px-xxl py-lg\"}\n data-testid={\"cms.editor.tab.preview\"}\n >\n <ContentEntryEditorWithConfig>\n <PreviewTab\n activeTab={true}\n onSwitchToEdit={() => setActiveTab(\"edit\")}\n />\n </ContentEntryEditorWithConfig>\n </div>\n )}\n </div>\n </div>\n </div>\n </div>\n <DragPreview />\n </div>\n </div>\n );\n});\n"],"names":["VIEW_ITEMS","ViewCompactAltIcon","ViewDayIcon","t","i18n","prompt","ContentModelEditor","makeDecoratable","data","setData","isPristine","useModelEditor","router","useRouter","dialogs","useDialogs","useEffect","document","isPristineRef","React","activeTab","setActiveTab","useState","isSidebarOpen","setIsSidebarOpen","activeView","setActiveView","onChange","fields","layout","OverlayLoader","ModelIsBeingDeletedError","Header","FieldsSidebar","IconButton","ExpandSidebarIcon","Text","Tag","SegmentedControlPrimitive","FieldEditor","ContentEntryEditorWithConfig","PreviewTab","DragPreview"],"mappings":";;;;;;;;;;;;;;;;AAUA,MAAMA,aAAa;IACf;QAAE,IAAI;QAAW,OAAO;QAAW,OAAO;QAAI,MAAM,WAAN,GAAM,oBAACC,qCAAkBA;IAAI;IAC3E;QAAE,IAAI;QAAQ,OAAO;QAAQ,OAAO;QAAI,MAAM,WAAN,GAAM,oBAACC,6BAAWA;IAAI;CACjE;AAUD,MAAMC,IAAIC,KAAK,EAAE,CAAC;AAElB,MAAMC,4BAASF,CAAC,CAAC,+FAA+F,CAAC;AAO1G,MAAMG,qBAAqBC,gBAAgB,sBAAsB;IACpE,MAAM,EAAEC,IAAI,EAAEC,OAAO,EAAEC,UAAU,EAAE,GAAGC;IACtC,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BAGxC,oBAACU,eAAaA;QACV,kBAAkB,IAAMZ,aAAa;QACrC,YAAY,IAAMG,iBAAiB;uBAI3C,oBAAC;QACG,WACI,8FACC,CAACD,gBAEI,kCADA,sBAC8B;qBAGxC,oBAACW,YAAUA;QACP,SAAS;QACT,MAAM;QACN,oBAAM,oBAACC,gBAAiBA;QACxB,SAAS,IAAMX,iBAAiB;sBAEpC,oBAAC;QACG,WACI;OAEP,2BAKT,oBAAC;QACG,WACI,6CACCJ,CAAAA,AAAc,WAAdA,YAAuB,cAAc,mBAAkB;qBAG5D,oBAAC;QACG,WACI;qBAGJ,oBAAC,aACIA,AAAc,WAAdA,aAAwB,WAAV,GACX,oBAACgB,MAAIA;QACD,IAAG;QACH,MAAM;QACN,WAAW;OACd,iBAIJhB,AAAc,cAAdA,aAA2B,WAAb,GACX,oBAACiB,KAAGA;QAAC,SAAS;QAAW,SAAS;uBAG1C,oBAACC,2BAAyBA;QACtB,SAAS;QACT,OAAOb;QACP,UAAUC;QACV,OAAO1B;uBAGf,oBAAC;QAAI,WAAW;qBACZ,oBAAC;QACG,WAAW;QACX,OAAO;YACH,OAAOyB,AAAe,cAAfA,aAA2B,UAAU;YAC5C,YAAY;YACZ,aAAa;QACjB;OAECL,AAAc,WAAdA,aAAwB,WAAV,GACX,oBAAC;QAAI,WAAW;QAAY,eAAa;qBACrC,oBAACmB,aAAWA;QACR,QAAQ/B,KAAK,MAAM;QACnB,QAAQA,KAAK,MAAM,IAAI,EAAE;QACzB,UAAUmB;SAIrBP,AAAc,cAAdA,aAA2B,WAAb,GACX,oBAAC;QACG,WAAW;QACX,eAAa;qBAEb,oBAACoB,8BAA4BA,MAAAA,WAAAA,GACzB,oBAACC,YAAUA;QACP,WAAW;QACX,gBAAgB,IAAMpB,aAAa;4BASnE,oBAACqB,aAAWA;AAI5B"}
|
|
1
|
+
{"version":3,"file":"admin/components/ContentModelEditor/ContentModelEditor.js","sources":["../../../../src/admin/components/ContentModelEditor/ContentModelEditor.tsx"],"sourcesContent":["import React, { useState, useEffect } from \"react\";\nimport { makeDecoratable, useDialogs } from \"@webiny/app-admin\";\nimport { useRouter } from \"@webiny/app\";\nimport { i18n } from \"@webiny/app/i18n/index.js\";\nimport { IconButton, OverlayLoader, SegmentedControlPrimitive, Tag, Text } from \"@webiny/admin-ui\";\nimport { ReactComponent as ExpandSidebarIcon } from \"@webiny/icons/left_panel_open.svg\";\nimport { ReactComponent as ViewCompactAltIcon } from \"@webiny/icons/view_compact_alt.svg\";\nimport { ReactComponent as ViewDayIcon } from \"@webiny/icons/view_day.svg\";\nimport { FieldsSidebar } from \"./FieldsSidebar.js\";\n\nconst VIEW_ITEMS = [\n { id: \"compact\", value: \"compact\", label: \"\", icon: <ViewCompactAltIcon /> },\n { id: \"full\", value: \"full\", label: \"\", icon: <ViewDayIcon /> }\n];\nimport { FieldEditor } from \"../FieldEditor/index.js\";\nimport { PreviewTab } from \"./PreviewTab.js\";\nimport Header from \"./Header.js\";\nimport DragPreview from \"../DragPreview.js\";\nimport { useModelEditor } from \"./useModelEditor.js\";\nimport type { CmsEditorFieldsLayout, CmsModelField } from \"~/types.js\";\nimport { ContentEntryEditorWithConfig } from \"~/admin/config/contentEntries/index.js\";\nimport { ModelIsBeingDeletedError } from \"~/admin/components/ContentModelEditor/ModelIsBeingDeletedError/index.js\";\n\nconst t = i18n.ns(\"app-headless-cms/admin/editor\");\n\nconst prompt = t`There are some unsaved changes! Are you sure you want to navigate away and discard all changes?`;\n\ninterface OnChangeParams {\n fields: CmsModelField[];\n layout: CmsEditorFieldsLayout;\n}\n\nexport const ContentModelEditor = makeDecoratable(\"ContentModelEditor\", () => {\n const { data, setData, isPristine } = useModelEditor();\n const router = useRouter();\n const dialogs = useDialogs();\n\n // Add a class to <body> to trigger global styles while this component is active\n useEffect(() => {\n document.body.classList.add(\"overflow-hidden\");\n\n return () => {\n document.body.classList.remove(\"overflow-hidden\");\n };\n }, []);\n\n const isPristineRef = React.useRef(isPristine);\n isPristineRef.current = isPristine;\n\n useEffect(() => {\n return router.addTransitionGuard({\n guard: () => !isPristineRef.current,\n onBlocked: () => {\n dialogs.showDialog({\n title: \"Confirm Navigation\",\n content: prompt,\n acceptLabel: \"Yes!\",\n cancelLabel: \"No, stay here.\",\n onAccept: () => router.confirmTransition(),\n onClose: () => router.cancelTransition()\n });\n }\n });\n }, []);\n\n const [activeTab, setActiveTab] = useState<string>(\"edit\");\n const [isSidebarOpen, setIsSidebarOpen] = useState(true);\n const [activeView, setActiveView] = useState(\"compact\");\n\n const onChange = ({ fields, layout }: OnChangeParams) => {\n setData(data => ({ ...data, fields, layout }));\n };\n\n if (!data) {\n return <OverlayLoader text={\"Loading content model...\"} />;\n } else if (data.isBeingDeleted) {\n return <ModelIsBeingDeletedError model={data} />;\n }\n\n return (\n <div className={\"content-model-editor flex-1\"}>\n <Header activeTab={activeTab} onTabChange={setActiveTab} />\n <div className={\"w-full overflow-y-auto h-main-content\"}>\n <div className={\"flex h-full\"}>\n <div\n className={\n \"shrink-0 bg-neutral-base border-r border-neutral-dimmed overflow-hidden h-main-content relative transition-[width] duration-200 ease-in-out\"\n }\n style={{ width: isSidebarOpen ? 200 : 45 }}\n >\n {/* Expanded content */}\n <div\n className={\n \"transition-opacity duration-150 \" +\n (isSidebarOpen\n ? \"opacity-100 delay-75\"\n : \"opacity-0 pointer-events-none\")\n }\n >\n <FieldsSidebar\n onFieldDragStart={() => setActiveTab(\"edit\")}\n onCollapse={() => setIsSidebarOpen(false)}\n />\n </div>\n {/* Collapsed strip */}\n <div\n className={\n \"absolute inset-0 flex flex-col items-center pt-md gap-md transition-opacity duration-150 \" +\n (!isSidebarOpen\n ? \"opacity-100 delay-75\"\n : \"opacity-0 pointer-events-none\")\n }\n >\n <IconButton\n variant={\"ghost\"}\n size={\"xs\"}\n icon={<ExpandSidebarIcon />}\n onClick={() => setIsSidebarOpen(true)}\n />\n <span\n className={\n \"text-sm font-semibold text-neutral-strong [writing-mode:vertical-rl]\"\n }\n >\n Fields\n </span>\n </div>\n </div>\n <div\n className={\n \"flex-1 overflow-y-scroll h-main-content \" +\n (activeTab === \"edit\" ? \"fill-grid\" : \"bg-neutral-subtle\")\n }\n >\n <div\n className={\n \"sticky top-0 left-0 z-10 p-md flex items-center justify-between\"\n }\n >\n <div>\n {activeTab === \"edit\" && (\n <Text\n as=\"div\"\n size={\"sm\"}\n className={\"font-semibold text-neutral-primary\"}\n >\n Model editor\n </Text>\n )}\n {activeTab === \"preview\" && (\n <Tag content={\"Preview\"} variant={\"warning\"} />\n )}\n </div>\n <SegmentedControlPrimitive\n variant={\"light\"}\n value={activeView}\n onChange={setActiveView}\n items={VIEW_ITEMS}\n />\n </div>\n <div className={\"pb-lg\"}>\n <div\n className={\" transition-[width] duration-200 ease-in-out\"}\n style={{\n width: activeView === \"compact\" ? \"704px\" : \"90%\",\n marginLeft: \"auto\",\n marginRight: \"auto\"\n }}\n >\n {activeTab === \"edit\" && (\n <div className={\"relative\"} data-testid={\"cms.editor.tab.edit\"}>\n <FieldEditor\n fields={data.fields}\n layout={data.layout || []}\n onChange={onChange}\n />\n </div>\n )}\n {activeTab === \"preview\" && (\n <div\n className={\"px-xxl py-lg\"}\n data-testid={\"cms.editor.tab.preview\"}\n >\n <ContentEntryEditorWithConfig>\n <PreviewTab\n activeTab={true}\n onSwitchToEdit={() => setActiveTab(\"edit\")}\n />\n </ContentEntryEditorWithConfig>\n </div>\n )}\n </div>\n </div>\n </div>\n </div>\n <DragPreview />\n </div>\n </div>\n );\n});\n"],"names":["VIEW_ITEMS","ViewCompactAltIcon","ViewDayIcon","t","i18n","prompt","ContentModelEditor","makeDecoratable","data","setData","isPristine","useModelEditor","router","useRouter","dialogs","useDialogs","useEffect","document","isPristineRef","React","activeTab","setActiveTab","useState","isSidebarOpen","setIsSidebarOpen","activeView","setActiveView","onChange","fields","layout","OverlayLoader","ModelIsBeingDeletedError","Header","FieldsSidebar","IconButton","ExpandSidebarIcon","Text","Tag","SegmentedControlPrimitive","FieldEditor","ContentEntry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AdA,aAAwB,WAAV,GACX,oBAAC;QAAI,WAAW;QAAY,eAAa;qBACrC,oBAACmB,aAAWA;QACR,QAAQ/B,KAAK,MAAM;QACnB,QAAQA,KAAK,MAAM,IAAI,EAAE;QACzB,UAAUmB;SAIrBP,AAAc,cAAdA,aAA2B,WAAb,GACX,oBAAC;QACG,WAAW;QACX,eAAa;qBAEb,oBAACoB,8BAA4BA,MAAAA,WAAAA,GACzB,oBAACC,YAAUA;QACP,WAAW;QACX,gBAAgB,IAAMpB,aAAa;4BASnE,oBAACqB,aAAWA;AAI5B"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import react from "react";
|
|
2
|
+
import { ConfirmationDialog } from "@webiny/app-admin/components/ConfirmationDialog/index.js";
|
|
3
|
+
import { useNamedConfirmationDialog } from "@webiny/app-admin";
|
|
4
|
+
const DuplicateEntryConfirmDialog = ()=>{
|
|
5
|
+
const { onConfirm, onCancel, closeDialog, params } = useNamedConfirmationDialog();
|
|
6
|
+
return /*#__PURE__*/ react.createElement(ConfirmationDialog, {
|
|
7
|
+
title: "Duplicate entry",
|
|
8
|
+
confirmLabel: "Yes, duplicate!",
|
|
9
|
+
loadingLabel: "Duplicating...",
|
|
10
|
+
onConfirm: async ()=>{
|
|
11
|
+
await onConfirm();
|
|
12
|
+
closeDialog();
|
|
13
|
+
},
|
|
14
|
+
onCancel: ()=>{
|
|
15
|
+
onCancel();
|
|
16
|
+
closeDialog();
|
|
17
|
+
}
|
|
18
|
+
}, /*#__PURE__*/ react.createElement("p", null, "You are about to duplicate ", /*#__PURE__*/ react.createElement("strong", null, params.entry.meta.title), ". The copy will be created as a new draft entry. Are you sure you want to continue?"));
|
|
19
|
+
};
|
|
20
|
+
export { DuplicateEntryConfirmDialog };
|
|
21
|
+
|
|
22
|
+
//# sourceMappingURL=DuplicateEntryConfirmDialog.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"admin/components/Dialogs/DuplicateEntryConfirmDialog.js","sources":["../../../../src/admin/components/Dialogs/DuplicateEntryConfirmDialog.tsx"],"sourcesContent":["import React from \"react\";\nimport { ConfirmationDialog } from \"@webiny/app-admin/components/ConfirmationDialog/index.js\";\nimport { useNamedConfirmationDialog } from \"@webiny/app-admin\";\nimport type { CmsContentEntry } from \"@webiny/app-headless-cms-common/types/index.js\";\n\nexport const DuplicateEntryConfirmDialog = () => {\n const { onConfirm, onCancel, closeDialog, params } = useNamedConfirmationDialog<{\n entry: CmsContentEntry;\n }>();\n\n return (\n <ConfirmationDialog\n title=\"Duplicate entry\"\n confirmLabel=\"Yes, duplicate!\"\n loadingLabel=\"Duplicating...\"\n onConfirm={async () => {\n await onConfirm();\n closeDialog();\n }}\n onCancel={() => {\n onCancel();\n closeDialog();\n }}\n >\n <p>\n You are about to duplicate <strong>{params.entry.meta.title}</strong>. The copy will\n be created as a new draft entry. Are you sure you want to continue?\n </p>\n </ConfirmationDialog>\n );\n};\n"],"names":["DuplicateEntryConfirmDialog","onConfirm","onCancel","closeDialog","params","useNamedConfirmationDialog","ConfirmationDialog"],"mappings":";;;AAKO,MAAMA,8BAA8B;IACvC,MAAM,EAAEC,SAAS,EAAEC,QAAQ,EAAEC,WAAW,EAAEC,MAAM,EAAE,GAAGC;IAIrD,OAAO,WAAP,GACI,oBAACC,oBAAkBA;QACf,OAAM;QACN,cAAa;QACb,cAAa;QACb,WAAW;YACP,MAAML;YACNE;QACJ;QACA,UAAU;YACND;YACAC;QACJ;qBAEA,oBAAC,WAAE,6CAC4B,oBAAC,gBAAQC,OAAO,KAAK,CAAC,IAAI,CAAC,KAAK,GAAU;AAKrF"}
|
|
@@ -4,7 +4,7 @@ interface EditFieldDialogProps {
|
|
|
4
4
|
onClose: () => void;
|
|
5
5
|
onSubmit: (data: CmsModelField) => void;
|
|
6
6
|
}
|
|
7
|
-
declare const EditFieldDialog: ((props: EditFieldDialogProps) => React.JSX.Element) & {
|
|
8
|
-
|
|
7
|
+
declare const EditFieldDialog: ((props: EditFieldDialogProps) => React.JSX.Element) & React.NamedExoticComponent<EditFieldDialogProps> & {
|
|
8
|
+
readonly type: (props: EditFieldDialogProps) => React.JSX.Element;
|
|
9
9
|
};
|
|
10
10
|
export default EditFieldDialog;
|
|
@@ -17,18 +17,18 @@ const allowedTitleFieldTypes = [
|
|
|
17
17
|
];
|
|
18
18
|
const isFieldAllowedToBeTitle = (model, field, parent)=>{
|
|
19
19
|
if (field.list || parent) return false;
|
|
20
|
-
if (false === allowedTitleFieldTypes.includes(field.type)) return false;
|
|
21
|
-
if (model.titleFieldId === field.fieldId) return false;
|
|
20
|
+
else if (false === allowedTitleFieldTypes.includes(field.type)) return false;
|
|
21
|
+
else if (model.titleFieldId === field.fieldId) return false;
|
|
22
22
|
return true;
|
|
23
23
|
};
|
|
24
24
|
const isFieldAllowedToBeDescription = (model, field, parent)=>{
|
|
25
25
|
if (field.list || parent) return false;
|
|
26
|
-
if (model.descriptionFieldId === field.fieldId) return false;
|
|
26
|
+
else if (model.descriptionFieldId === field.fieldId) return false;
|
|
27
27
|
return "long-text" === field.type;
|
|
28
28
|
};
|
|
29
29
|
const isFieldAllowedToBeImage = (model, field, parent)=>{
|
|
30
30
|
if (field.list || parent) return false;
|
|
31
|
-
if (model.imageFieldId === field.fieldId) return false;
|
|
31
|
+
else if (model.imageFieldId === field.fieldId) return false;
|
|
32
32
|
return "file" === field.type && field.settings?.imagesOnly;
|
|
33
33
|
};
|
|
34
34
|
const getFieldTypeName = (model, field, parent)=>{
|