@webiny/app-headless-cms 0.0.0-mt-1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +18 -0
- package/admin/components/ContentEntryForm/ContentEntryForm.d.ts +8 -0
- package/admin/components/ContentEntryForm/ContentEntryForm.js +68 -0
- package/admin/components/ContentEntryForm/ContentEntryFormPreview.d.ts +7 -0
- package/admin/components/ContentEntryForm/ContentEntryFormPreview.js +43 -0
- package/admin/components/ContentEntryForm/Fields.d.ts +12 -0
- package/admin/components/ContentEntryForm/Fields.js +33 -0
- package/admin/components/ContentEntryForm/Label.d.ts +5 -0
- package/admin/components/ContentEntryForm/Label.js +20 -0
- package/admin/components/ContentEntryForm/RenderFieldElement.d.ts +8 -0
- package/admin/components/ContentEntryForm/RenderFieldElement.js +40 -0
- package/admin/components/ContentEntryForm/functions/createValidators.d.ts +1 -0
- package/admin/components/ContentEntryForm/functions/createValidators.js +58 -0
- package/admin/components/ContentEntryForm/functions/getValue.d.ts +5 -0
- package/admin/components/ContentEntryForm/functions/getValue.js +20 -0
- package/admin/components/ContentEntryForm/functions/setValue.d.ts +6 -0
- package/admin/components/ContentEntryForm/functions/setValue.js +20 -0
- package/admin/components/ContentEntryForm/useBind.d.ts +10 -0
- package/admin/components/ContentEntryForm/useBind.js +76 -0
- package/admin/components/ContentEntryForm/useContentEntryForm.d.ts +22 -0
- package/admin/components/ContentEntryForm/useContentEntryForm.js +338 -0
- package/admin/components/ContentEntryForm/useRenderPlugins.d.ts +2 -0
- package/admin/components/ContentEntryForm/useRenderPlugins.js +7 -0
- package/admin/components/ContentModelEditor/Context.d.ts +23 -0
- package/admin/components/ContentModelEditor/Context.js +218 -0
- package/admin/components/ContentModelEditor/Editor.d.ts +3 -0
- package/admin/components/ContentModelEditor/Editor.js +138 -0
- package/admin/components/ContentModelEditor/FieldsSidebar.d.ts +4 -0
- package/admin/components/ContentModelEditor/FieldsSidebar.js +91 -0
- package/admin/components/ContentModelEditor/Header.d.ts +2 -0
- package/admin/components/ContentModelEditor/Header.js +24 -0
- package/admin/components/ContentModelEditor/PreviewTab.d.ts +2 -0
- package/admin/components/ContentModelEditor/PreviewTab.js +36 -0
- package/admin/components/ContentModelEditor/icons/round-assignment-24px.svg +4 -0
- package/admin/components/ContentModelEditor/icons/round-drag_indicator-24px.svg +4 -0
- package/admin/components/ContentModelEditor/useContentModelEditor.d.ts +1 -0
- package/admin/components/ContentModelEditor/useContentModelEditor.js +11 -0
- package/admin/components/DragPreview.d.ts +2 -0
- package/admin/components/DragPreview.js +98 -0
- package/admin/components/Draggable.d.ts +14 -0
- package/admin/components/Draggable.js +49 -0
- package/admin/components/DropZone/Center.d.ts +12 -0
- package/admin/components/DropZone/Center.js +60 -0
- package/admin/components/DropZone/Horizontal.d.ts +9 -0
- package/admin/components/DropZone/Horizontal.js +83 -0
- package/admin/components/DropZone/Vertical.d.ts +10 -0
- package/admin/components/DropZone/Vertical.js +79 -0
- package/admin/components/DropZone/index.d.ts +4 -0
- package/admin/components/DropZone/index.js +4 -0
- package/admin/components/Droppable.d.ts +23 -0
- package/admin/components/Droppable.js +45 -0
- package/admin/components/FieldEditor/EditFieldDialog/AppearanceTab.d.ts +3 -0
- package/admin/components/FieldEditor/EditFieldDialog/AppearanceTab.js +83 -0
- package/admin/components/FieldEditor/EditFieldDialog/GeneralTab.d.ts +10 -0
- package/admin/components/FieldEditor/EditFieldDialog/GeneralTab.js +120 -0
- package/admin/components/FieldEditor/EditFieldDialog/PredefinedValues.d.ts +5 -0
- package/admin/components/FieldEditor/EditFieldDialog/PredefinedValues.js +55 -0
- package/admin/components/FieldEditor/EditFieldDialog/ValidatorsTab.d.ts +10 -0
- package/admin/components/FieldEditor/EditFieldDialog/ValidatorsTab.js +121 -0
- package/admin/components/FieldEditor/EditFieldDialog/functions/getValue.d.ts +6 -0
- package/admin/components/FieldEditor/EditFieldDialog/functions/getValue.js +16 -0
- package/admin/components/FieldEditor/EditFieldDialog/functions/setValue.d.ts +7 -0
- package/admin/components/FieldEditor/EditFieldDialog/functions/setValue.js +21 -0
- package/admin/components/FieldEditor/EditFieldDialog.d.ts +9 -0
- package/admin/components/FieldEditor/EditFieldDialog.js +231 -0
- package/admin/components/FieldEditor/Field.d.ts +3 -0
- package/admin/components/FieldEditor/Field.js +179 -0
- package/admin/components/FieldEditor/FieldEditor.d.ts +12 -0
- package/admin/components/FieldEditor/FieldEditor.js +166 -0
- package/admin/components/FieldEditor/FieldEditorContext.d.ts +53 -0
- package/admin/components/FieldEditor/FieldEditorContext.js +330 -0
- package/admin/components/FieldEditor/Styled.d.ts +6 -0
- package/admin/components/FieldEditor/Styled.js +54 -0
- package/admin/components/FieldEditor/index.d.ts +2 -0
- package/admin/components/FieldEditor/index.js +2 -0
- package/admin/components/FieldEditor/useFieldEditor.d.ts +1 -0
- package/admin/components/FieldEditor/useFieldEditor.js +5 -0
- package/admin/components/FieldEditor/utils/deleteField.d.ts +10 -0
- package/admin/components/FieldEditor/utils/deleteField.js +34 -0
- package/admin/components/FieldEditor/utils/getFieldPosition.d.ts +6 -0
- package/admin/components/FieldEditor/utils/getFieldPosition.js +20 -0
- package/admin/components/FieldEditor/utils/index.d.ts +4 -0
- package/admin/components/FieldEditor/utils/index.js +4 -0
- package/admin/components/FieldEditor/utils/moveField.d.ts +7 -0
- package/admin/components/FieldEditor/utils/moveField.js +51 -0
- package/admin/components/FieldEditor/utils/moveRow.d.ts +9 -0
- package/admin/components/FieldEditor/utils/moveRow.js +10 -0
- package/admin/constants/statusLabels.d.ts +8 -0
- package/admin/constants/statusLabels.js +13 -0
- package/admin/contexts/Cms/NetworkError.d.ts +2 -0
- package/admin/contexts/Cms/NetworkError.js +7 -0
- package/admin/contexts/Cms/index.d.ts +16 -0
- package/admin/contexts/Cms/index.js +43 -0
- package/admin/elements/ContentGroupMenuElement.d.ts +3 -0
- package/admin/elements/ContentGroupMenuElement.js +17 -0
- package/admin/elements/ContentModelMenuElement.d.ts +3 -0
- package/admin/elements/ContentModelMenuElement.js +17 -0
- package/admin/elements/NothingToShowElement.d.ts +15 -0
- package/admin/elements/NothingToShowElement.js +88 -0
- package/admin/graphql/contentEntries.d.ts +12 -0
- package/admin/graphql/contentEntries.js +68 -0
- package/admin/graphql/contentModels.d.ts +4 -0
- package/admin/graphql/contentModels.js +9 -0
- package/admin/graphql/createFieldsList.d.ts +2 -0
- package/admin/graphql/createFieldsList.js +21 -0
- package/admin/hooks/index.d.ts +5 -0
- package/admin/hooks/index.js +5 -0
- package/admin/hooks/useApolloClient.d.ts +2 -0
- package/admin/hooks/useApolloClient.js +10 -0
- package/admin/hooks/useCms.d.ts +3 -0
- package/admin/hooks/useCms.js +14 -0
- package/admin/hooks/useLazyQuery.d.ts +2 -0
- package/admin/hooks/useLazyQuery.js +16 -0
- package/admin/hooks/useMutation.d.ts +2 -0
- package/admin/hooks/useMutation.js +16 -0
- package/admin/hooks/usePermission.d.ts +27 -0
- package/admin/hooks/usePermission.js +218 -0
- package/admin/hooks/useQuery.d.ts +2 -0
- package/admin/hooks/useQuery.js +17 -0
- package/admin/icons/add.svg +5 -0
- package/admin/icons/arrow_forward-24px.svg +1 -0
- package/admin/icons/baseline-autorenew-24px.svg +4 -0
- package/admin/icons/beenhere.svg +1 -0
- package/admin/icons/call_split-24px.svg +4 -0
- package/admin/icons/close.svg +13 -0
- package/admin/icons/delete.svg +12 -0
- package/admin/icons/devices_other-black-24px.svg +1 -0
- package/admin/icons/done-24px.svg +1 -0
- package/admin/icons/edit.svg +17 -0
- package/admin/icons/emoji_people-24px.svg +1 -0
- package/admin/icons/gesture.svg +1 -0
- package/admin/icons/help_outline.svg +1 -0
- package/admin/icons/how_to_vote-24px.svg +4 -0
- package/admin/icons/info.svg +1 -0
- package/admin/icons/lock.svg +1 -0
- package/admin/icons/more_vert.svg +12 -0
- package/admin/icons/publish.svg +1 -0
- package/admin/icons/round-arrow_drop_down-24px.svg +12 -0
- package/admin/icons/round-drag_indicator-24px.svg +4 -0
- package/admin/icons/round-translate-24px.svg +4 -0
- package/admin/icons/rule-24px.svg +1 -0
- package/admin/icons/title-24px.svg +1 -0
- package/admin/icons/unpublish.svg +4 -0
- package/admin/icons/view_list.svg +1 -0
- package/admin/icons/visibility.svg +16 -0
- package/admin/plugins/apiInformation/index.d.ts +3 -0
- package/admin/plugins/apiInformation/index.js +59 -0
- package/admin/plugins/apiInformation/placeholder.manage.graphql +18 -0
- package/admin/plugins/apiInformation/placeholder.preview.graphql +15 -0
- package/admin/plugins/apiInformation/placeholder.read.graphql +16 -0
- package/admin/plugins/definitions/CmsEditorFieldValidatorFileTypePlugin.d.ts +21 -0
- package/admin/plugins/definitions/CmsEditorFieldValidatorFileTypePlugin.js +61 -0
- package/admin/plugins/definitions/CmsFieldValidatorFileTypePlugin.d.ts +10 -0
- package/admin/plugins/definitions/CmsFieldValidatorFileTypePlugin.js +36 -0
- package/admin/plugins/editor/defaultBar/BackButton.d.ts +3 -0
- package/admin/plugins/editor/defaultBar/BackButton.js +21 -0
- package/admin/plugins/editor/defaultBar/CreateContentButton.d.ts +3 -0
- package/admin/plugins/editor/defaultBar/CreateContentButton.js +46 -0
- package/admin/plugins/editor/defaultBar/Divider.d.ts +3 -0
- package/admin/plugins/editor/defaultBar/Divider.js +11 -0
- package/admin/plugins/editor/defaultBar/FormSettings/FormSettings.d.ts +6 -0
- package/admin/plugins/editor/defaultBar/FormSettings/FormSettings.js +90 -0
- package/admin/plugins/editor/defaultBar/FormSettings/FormSettingsButton.d.ts +3 -0
- package/admin/plugins/editor/defaultBar/FormSettings/FormSettingsButton.js +27 -0
- package/admin/plugins/editor/defaultBar/FormSettings/FormSettingsStyled.d.ts +6 -0
- package/admin/plugins/editor/defaultBar/FormSettings/FormSettingsStyled.js +42 -0
- package/admin/plugins/editor/defaultBar/FormSettings/index.d.ts +1 -0
- package/admin/plugins/editor/defaultBar/FormSettings/index.js +1 -0
- package/admin/plugins/editor/defaultBar/Name/Name.d.ts +7 -0
- package/admin/plugins/editor/defaultBar/Name/Name.js +80 -0
- package/admin/plugins/editor/defaultBar/Name/NameStyled.d.ts +5 -0
- package/admin/plugins/editor/defaultBar/Name/NameStyled.js +48 -0
- package/admin/plugins/editor/defaultBar/Name/index.d.ts +1 -0
- package/admin/plugins/editor/defaultBar/Name/index.js +1 -0
- package/admin/plugins/editor/defaultBar/SaveContentModelButton.d.ts +3 -0
- package/admin/plugins/editor/defaultBar/SaveContentModelButton.js +63 -0
- package/admin/plugins/editor/defaultBar/icons/more_vert.svg +12 -0
- package/admin/plugins/editor/defaultBar/icons/round-arrow_back-24px.svg +13 -0
- package/admin/plugins/editor/defaultBar/icons/round-arrow_drop_down-24px.svg +12 -0
- package/admin/plugins/editor/defaultBar/icons/settings.svg +25 -0
- package/admin/plugins/editor/defaultBar/index.d.ts +7 -0
- package/admin/plugins/editor/defaultBar/index.js +44 -0
- package/admin/plugins/editor/formSettings/components/GeneralSettings.d.ts +7 -0
- package/admin/plugins/editor/formSettings/components/GeneralSettings.js +37 -0
- package/admin/plugins/editor/formSettings/components/GroupSelect.d.ts +3 -0
- package/admin/plugins/editor/formSettings/components/GroupSelect.js +30 -0
- package/admin/plugins/editor/formSettings/icons/round-settings-24px.svg +1 -0
- package/admin/plugins/editor/formSettings/index.d.ts +3 -0
- package/admin/plugins/editor/formSettings/index.js +14 -0
- package/admin/plugins/fieldRenderers/Accordion.d.ts +10 -0
- package/admin/plugins/fieldRenderers/Accordion.js +125 -0
- package/admin/plugins/fieldRenderers/DynamicSection.d.ts +14 -0
- package/admin/plugins/fieldRenderers/DynamicSection.js +103 -0
- package/admin/plugins/fieldRenderers/boolean/booleanSwitch.d.ts +3 -0
- package/admin/plugins/fieldRenderers/boolean/booleanSwitch.js +34 -0
- package/admin/plugins/fieldRenderers/boolean/index.d.ts +2 -0
- package/admin/plugins/fieldRenderers/boolean/index.js +2 -0
- package/admin/plugins/fieldRenderers/checkboxes.d.ts +3 -0
- package/admin/plugins/fieldRenderers/checkboxes.js +45 -0
- package/admin/plugins/fieldRenderers/dateTime/DateTimeWithTimezone.d.ts +9 -0
- package/admin/plugins/fieldRenderers/dateTime/DateTimeWithTimezone.js +148 -0
- package/admin/plugins/fieldRenderers/dateTime/DateTimeWithoutTimezone.d.ts +8 -0
- package/admin/plugins/fieldRenderers/dateTime/DateTimeWithoutTimezone.js +115 -0
- package/admin/plugins/fieldRenderers/dateTime/Input.d.ts +16 -0
- package/admin/plugins/fieldRenderers/dateTime/Input.js +26 -0
- package/admin/plugins/fieldRenderers/dateTime/Select.d.ts +3 -0
- package/admin/plugins/fieldRenderers/dateTime/Select.js +13 -0
- package/admin/plugins/fieldRenderers/dateTime/Time.d.ts +3 -0
- package/admin/plugins/fieldRenderers/dateTime/Time.js +13 -0
- package/admin/plugins/fieldRenderers/dateTime/dateTimeField.d.ts +3 -0
- package/admin/plugins/fieldRenderers/dateTime/dateTimeField.js +59 -0
- package/admin/plugins/fieldRenderers/dateTime/dateTimeFields.d.ts +3 -0
- package/admin/plugins/fieldRenderers/dateTime/dateTimeFields.js +84 -0
- package/admin/plugins/fieldRenderers/dateTime/index.d.ts +2 -0
- package/admin/plugins/fieldRenderers/dateTime/index.js +3 -0
- package/admin/plugins/fieldRenderers/dateTime/utils.d.ts +15 -0
- package/admin/plugins/fieldRenderers/dateTime/utils.js +153 -0
- package/admin/plugins/fieldRenderers/file/File.d.ts +15 -0
- package/admin/plugins/fieldRenderers/file/File.js +79 -0
- package/admin/plugins/fieldRenderers/file/fileField.d.ts +3 -0
- package/admin/plugins/fieldRenderers/file/fileField.js +64 -0
- package/admin/plugins/fieldRenderers/file/fileFields.d.ts +3 -0
- package/admin/plugins/fieldRenderers/file/fileFields.js +125 -0
- package/admin/plugins/fieldRenderers/file/index.d.ts +2 -0
- package/admin/plugins/fieldRenderers/file/index.js +3 -0
- package/admin/plugins/fieldRenderers/file/utils.d.ts +7 -0
- package/admin/plugins/fieldRenderers/file/utils.js +51 -0
- package/admin/plugins/fieldRenderers/longText/index.d.ts +2 -0
- package/admin/plugins/fieldRenderers/longText/index.js +3 -0
- package/admin/plugins/fieldRenderers/longText/longText.d.ts +3 -0
- package/admin/plugins/fieldRenderers/longText/longText.js +36 -0
- package/admin/plugins/fieldRenderers/longText/longTexts.d.ts +3 -0
- package/admin/plugins/fieldRenderers/longText/longTexts.js +43 -0
- package/admin/plugins/fieldRenderers/number/index.d.ts +2 -0
- package/admin/plugins/fieldRenderers/number/index.js +3 -0
- package/admin/plugins/fieldRenderers/number/numberInput.d.ts +3 -0
- package/admin/plugins/fieldRenderers/number/numberInput.js +39 -0
- package/admin/plugins/fieldRenderers/number/numberInputs.d.ts +3 -0
- package/admin/plugins/fieldRenderers/number/numberInputs.js +50 -0
- package/admin/plugins/fieldRenderers/object/StyledComponents.d.ts +4 -0
- package/admin/plugins/fieldRenderers/object/StyledComponents.js +5 -0
- package/admin/plugins/fieldRenderers/object/index.d.ts +2 -0
- package/admin/plugins/fieldRenderers/object/index.js +3 -0
- package/admin/plugins/fieldRenderers/object/multipleObjects.d.ts +3 -0
- package/admin/plugins/fieldRenderers/object/multipleObjects.js +72 -0
- package/admin/plugins/fieldRenderers/object/singleObject.d.ts +3 -0
- package/admin/plugins/fieldRenderers/object/singleObject.js +45 -0
- package/admin/plugins/fieldRenderers/radioButtons.d.ts +3 -0
- package/admin/plugins/fieldRenderers/radioButtons.js +45 -0
- package/admin/plugins/fieldRenderers/ref/components/ContentEntriesAutocomplete.d.ts +6 -0
- package/admin/plugins/fieldRenderers/ref/components/ContentEntriesAutocomplete.js +54 -0
- package/admin/plugins/fieldRenderers/ref/components/ContentEntriesMultiAutoComplete.d.ts +6 -0
- package/admin/plugins/fieldRenderers/ref/components/ContentEntriesMultiAutoComplete.js +65 -0
- package/admin/plugins/fieldRenderers/ref/components/getOptions.d.ts +1 -0
- package/admin/plugins/fieldRenderers/ref/components/getOptions.js +21 -0
- package/admin/plugins/fieldRenderers/ref/components/graphql.d.ts +4 -0
- package/admin/plugins/fieldRenderers/ref/components/graphql.js +10 -0
- package/admin/plugins/fieldRenderers/ref/components/renderItem.d.ts +2 -0
- package/admin/plugins/fieldRenderers/ref/components/renderItem.js +14 -0
- package/admin/plugins/fieldRenderers/ref/components/useReference.d.ts +22 -0
- package/admin/plugins/fieldRenderers/ref/components/useReference.js +240 -0
- package/admin/plugins/fieldRenderers/ref/components/useReferences.d.ts +19 -0
- package/admin/plugins/fieldRenderers/ref/components/useReferences.js +180 -0
- package/admin/plugins/fieldRenderers/ref/index.d.ts +2 -0
- package/admin/plugins/fieldRenderers/ref/index.js +3 -0
- package/admin/plugins/fieldRenderers/ref/refInput.d.ts +3 -0
- package/admin/plugins/fieldRenderers/ref/refInput.js +30 -0
- package/admin/plugins/fieldRenderers/ref/refInputs.d.ts +3 -0
- package/admin/plugins/fieldRenderers/ref/refInputs.js +37 -0
- package/admin/plugins/fieldRenderers/richText/index.d.ts +2 -0
- package/admin/plugins/fieldRenderers/richText/index.js +3 -0
- package/admin/plugins/fieldRenderers/richText/richTextInput.d.ts +3 -0
- package/admin/plugins/fieldRenderers/richText/richTextInput.js +50 -0
- package/admin/plugins/fieldRenderers/richText/richTextInputs.d.ts +3 -0
- package/admin/plugins/fieldRenderers/richText/richTextInputs.js +79 -0
- package/admin/plugins/fieldRenderers/select.d.ts +3 -0
- package/admin/plugins/fieldRenderers/select.js +34 -0
- package/admin/plugins/fieldRenderers/text/index.d.ts +2 -0
- package/admin/plugins/fieldRenderers/text/index.js +3 -0
- package/admin/plugins/fieldRenderers/text/textInput.d.ts +3 -0
- package/admin/plugins/fieldRenderers/text/textInput.js +35 -0
- package/admin/plugins/fieldRenderers/text/textInputs.d.ts +3 -0
- package/admin/plugins/fieldRenderers/text/textInputs.js +46 -0
- package/admin/plugins/fieldValidators/date/availableValidators.d.ts +1 -0
- package/admin/plugins/fieldValidators/date/availableValidators.js +11 -0
- package/admin/plugins/fieldValidators/date/createDateInputField.d.ts +3 -0
- package/admin/plugins/fieldValidators/date/createDateInputField.js +33 -0
- package/admin/plugins/fieldValidators/dateGte.d.ts +3 -0
- package/admin/plugins/fieldValidators/dateGte.js +40 -0
- package/admin/plugins/fieldValidators/dateLte.d.ts +3 -0
- package/admin/plugins/fieldValidators/dateLte.js +40 -0
- package/admin/plugins/fieldValidators/gte.d.ts +3 -0
- package/admin/plugins/fieldValidators/gte.js +27 -0
- package/admin/plugins/fieldValidators/in.d.ts +3 -0
- package/admin/plugins/fieldValidators/in.js +26 -0
- package/admin/plugins/fieldValidators/lte.d.ts +3 -0
- package/admin/plugins/fieldValidators/lte.js +27 -0
- package/admin/plugins/fieldValidators/maxLength.d.ts +3 -0
- package/admin/plugins/fieldValidators/maxLength.js +27 -0
- package/admin/plugins/fieldValidators/minLength.d.ts +3 -0
- package/admin/plugins/fieldValidators/minLength.js +27 -0
- package/admin/plugins/fieldValidators/pattern.d.ts +3 -0
- package/admin/plugins/fieldValidators/pattern.js +74 -0
- package/admin/plugins/fieldValidators/patternPlugins/email.d.ts +3 -0
- package/admin/plugins/fieldValidators/patternPlugins/email.js +9 -0
- package/admin/plugins/fieldValidators/patternPlugins/lowerCase.d.ts +3 -0
- package/admin/plugins/fieldValidators/patternPlugins/lowerCase.js +9 -0
- package/admin/plugins/fieldValidators/patternPlugins/upperCase.d.ts +3 -0
- package/admin/plugins/fieldValidators/patternPlugins/upperCase.js +9 -0
- package/admin/plugins/fieldValidators/patternPlugins/url.d.ts +3 -0
- package/admin/plugins/fieldValidators/patternPlugins/url.js +9 -0
- package/admin/plugins/fieldValidators/required.d.ts +3 -0
- package/admin/plugins/fieldValidators/required.js +10 -0
- package/admin/plugins/fields/PredefinedValuesDynamicFieldset.d.ts +6 -0
- package/admin/plugins/fields/PredefinedValuesDynamicFieldset.js +108 -0
- package/admin/plugins/fields/boolean.d.ts +3 -0
- package/admin/plugins/fields/boolean.js +31 -0
- package/admin/plugins/fields/dateTime.d.ts +3 -0
- package/admin/plugins/fields/dateTime.js +77 -0
- package/admin/plugins/fields/file.d.ts +3 -0
- package/admin/plugins/fields/file.js +46 -0
- package/admin/plugins/fields/icons/ballot_black_24dp.svg +1 -0
- package/admin/plugins/fields/icons/dropdown-icon.svg +16 -0
- package/admin/plugins/fields/icons/notes-black-24px.svg +1 -0
- package/admin/plugins/fields/icons/round-check_box-24px.svg +4 -0
- package/admin/plugins/fields/icons/round-link-24px.svg +1 -0
- package/admin/plugins/fields/icons/round-looks_3-24px.svg +4 -0
- package/admin/plugins/fields/icons/round-notes.svg +1 -0
- package/admin/plugins/fields/icons/round-radio_button_checked-24px.svg +5 -0
- package/admin/plugins/fields/icons/round-short_text.svg +1 -0
- package/admin/plugins/fields/icons/round-subject.svg +1 -0
- package/admin/plugins/fields/icons/round-text_fields-24px.svg +4 -0
- package/admin/plugins/fields/icons/round-visibility_off-24px.svg +4 -0
- package/admin/plugins/fields/icons/round_insert_drive_file-24px.svg +1 -0
- package/admin/plugins/fields/icons/schedule-black-24px.svg +1 -0
- package/admin/plugins/fields/icons/title-black-24px.svg +1 -0
- package/admin/plugins/fields/icons/toggle_on-black-24px.svg +1 -0
- package/admin/plugins/fields/longText.d.ts +3 -0
- package/admin/plugins/fields/longText.js +46 -0
- package/admin/plugins/fields/number.d.ts +3 -0
- package/admin/plugins/fields/number.js +63 -0
- package/admin/plugins/fields/object/ObjectFields.d.ts +4 -0
- package/admin/plugins/fields/object/ObjectFields.js +32 -0
- package/admin/plugins/fields/object.d.ts +3 -0
- package/admin/plugins/fields/object.js +46 -0
- package/admin/plugins/fields/ref.d.ts +3 -0
- package/admin/plugins/fields/ref.js +144 -0
- package/admin/plugins/fields/richText.d.ts +3 -0
- package/admin/plugins/fields/richText.js +45 -0
- package/admin/plugins/fields/text.d.ts +3 -0
- package/admin/plugins/fields/text.js +51 -0
- package/admin/plugins/getObjectId.d.ts +3 -0
- package/admin/plugins/getObjectId.js +13 -0
- package/admin/plugins/icons.d.ts +3 -0
- package/admin/plugins/icons.js +40 -0
- package/admin/plugins/index.d.ts +13 -0
- package/admin/plugins/index.js +14 -0
- package/admin/plugins/install.d.ts +3 -0
- package/admin/plugins/install.js +127 -0
- package/admin/plugins/menus/CmsMenuLoader.d.ts +7 -0
- package/admin/plugins/menus/CmsMenuLoader.js +76 -0
- package/admin/plugins/menus/ContentGroupsMenuItems.d.ts +6 -0
- package/admin/plugins/menus/ContentGroupsMenuItems.js +154 -0
- package/admin/plugins/menus/GlobalSearchPlugins.d.ts +8 -0
- package/admin/plugins/menus/GlobalSearchPlugins.js +53 -0
- package/admin/plugins/menus.d.ts +4 -0
- package/admin/plugins/menus.js +19 -0
- package/admin/plugins/permissionRenderer/CmsPermissions.d.ts +5 -0
- package/admin/plugins/permissionRenderer/CmsPermissions.js +340 -0
- package/admin/plugins/permissionRenderer/components/ContentEntryPermission.d.ts +8 -0
- package/admin/plugins/permissionRenderer/components/ContentEntryPermission.js +117 -0
- package/admin/plugins/permissionRenderer/components/ContentModelGroupPermission.d.ts +9 -0
- package/admin/plugins/permissionRenderer/components/ContentModelGroupPermission.js +77 -0
- package/admin/plugins/permissionRenderer/components/ContentModelList.d.ts +7 -0
- package/admin/plugins/permissionRenderer/components/ContentModelList.js +53 -0
- package/admin/plugins/permissionRenderer/components/ContentModelPermission.d.ts +10 -0
- package/admin/plugins/permissionRenderer/components/ContentModelPermission.js +104 -0
- package/admin/plugins/permissionRenderer/components/PermissionRendererWrapper.d.ts +5 -0
- package/admin/plugins/permissionRenderer/components/PermissionRendererWrapper.js +28 -0
- package/admin/plugins/permissionRenderer/components/PermissionSelector.d.ts +34 -0
- package/admin/plugins/permissionRenderer/components/PermissionSelector.js +66 -0
- package/admin/plugins/permissionRenderer/components/StyledComponents.d.ts +2 -0
- package/admin/plugins/permissionRenderer/components/StyledComponents.js +10 -0
- package/admin/plugins/permissionRenderer/components/useCmsData.d.ts +1 -0
- package/admin/plugins/permissionRenderer/components/useCmsData.js +79 -0
- package/admin/plugins/permissionRenderer/index.d.ts +3 -0
- package/admin/plugins/permissionRenderer/index.js +16 -0
- package/admin/plugins/routes.d.ts +3 -0
- package/admin/plugins/routes.js +88 -0
- package/admin/plugins/transformers/dateTransformer.d.ts +3 -0
- package/admin/plugins/transformers/dateTransformer.js +44 -0
- package/admin/plugins/transformers/index.d.ts +3 -0
- package/admin/plugins/transformers/index.js +5 -0
- package/admin/plugins/transformers/numberTransformer.d.ts +3 -0
- package/admin/plugins/transformers/numberTransformer.js +14 -0
- package/admin/plugins/upgrades/v5.0.0.d.ts +5 -0
- package/admin/plugins/upgrades/v5.0.0.js +85 -0
- package/admin/plugins/upgrades/v5.5.0.d.ts +5 -0
- package/admin/plugins/upgrades/v5.5.0.js +85 -0
- package/admin/plugins/upgrades/v5.8.0.d.ts +5 -0
- package/admin/plugins/upgrades/v5.8.0.js +85 -0
- package/admin/plugins/validators/dateGte.d.ts +3 -0
- package/admin/plugins/validators/dateGte.js +23 -0
- package/admin/plugins/validators/dateLte.d.ts +3 -0
- package/admin/plugins/validators/dateLte.js +23 -0
- package/admin/plugins/validators/gte.d.ts +3 -0
- package/admin/plugins/validators/gte.js +15 -0
- package/admin/plugins/validators/in.d.ts +3 -0
- package/admin/plugins/validators/in.js +15 -0
- package/admin/plugins/validators/lte.d.ts +3 -0
- package/admin/plugins/validators/lte.js +15 -0
- package/admin/plugins/validators/maxLength.d.ts +3 -0
- package/admin/plugins/validators/maxLength.js +15 -0
- package/admin/plugins/validators/minLength.d.ts +3 -0
- package/admin/plugins/validators/minLength.js +15 -0
- package/admin/plugins/validators/pattern.d.ts +9 -0
- package/admin/plugins/validators/pattern.js +34 -0
- package/admin/plugins/validators/patternPlugins/email.d.ts +10 -0
- package/admin/plugins/validators/patternPlugins/email.js +9 -0
- package/admin/plugins/validators/patternPlugins/lowerCase.d.ts +10 -0
- package/admin/plugins/validators/patternPlugins/lowerCase.js +9 -0
- package/admin/plugins/validators/patternPlugins/upperCase.d.ts +10 -0
- package/admin/plugins/validators/patternPlugins/upperCase.js +9 -0
- package/admin/plugins/validators/patternPlugins/url.d.ts +10 -0
- package/admin/plugins/validators/patternPlugins/url.js +9 -0
- package/admin/plugins/validators/required.d.ts +3 -0
- package/admin/plugins/validators/required.js +11 -0
- package/admin/plugins/validators/timeGte.d.ts +3 -0
- package/admin/plugins/validators/timeGte.js +19 -0
- package/admin/plugins/validators/timeLte.d.ts +3 -0
- package/admin/plugins/validators/timeLte.js +19 -0
- package/admin/plugins/welcomeScreenWidget.d.ts +3 -0
- package/admin/plugins/welcomeScreenWidget.js +29 -0
- package/admin/views/contentEntries/ContentEntries.d.ts +3 -0
- package/admin/views/contentEntries/ContentEntries.js +73 -0
- package/admin/views/contentEntries/ContentEntriesContext.d.ts +24 -0
- package/admin/views/contentEntries/ContentEntriesContext.js +78 -0
- package/admin/views/contentEntries/ContentEntriesList.d.ts +3 -0
- package/admin/views/contentEntries/ContentEntriesList.js +180 -0
- package/admin/views/contentEntries/ContentEntry/ContentEntryContext.d.ts +28 -0
- package/admin/views/contentEntries/ContentEntry/ContentEntryContext.js +113 -0
- package/admin/views/contentEntries/ContentEntry/RevisionListItem.d.ts +7 -0
- package/admin/views/contentEntries/ContentEntry/RevisionListItem.js +152 -0
- package/admin/views/contentEntries/ContentEntry/RevisionsList.d.ts +3 -0
- package/admin/views/contentEntries/ContentEntry/RevisionsList.js +59 -0
- package/admin/views/contentEntries/ContentEntry/cache.d.ts +7 -0
- package/admin/views/contentEntries/ContentEntry/cache.js +183 -0
- package/admin/views/contentEntries/ContentEntry/header/Header.d.ts +3 -0
- package/admin/views/contentEntries/ContentEntry/header/Header.js +32 -0
- package/admin/views/contentEntries/ContentEntry/header/contentFormOptionsMenu/ContentFormOptionsMenu.d.ts +3 -0
- package/admin/views/contentEntries/ContentEntry/header/contentFormOptionsMenu/ContentFormOptionsMenu.js +141 -0
- package/admin/views/contentEntries/ContentEntry/header/index.d.ts +3 -0
- package/admin/views/contentEntries/ContentEntry/header/index.js +45 -0
- package/admin/views/contentEntries/ContentEntry/header/requestChanges/RequestChanges.d.ts +3 -0
- package/admin/views/contentEntries/ContentEntry/header/requestChanges/RequestChanges.js +67 -0
- package/admin/views/contentEntries/ContentEntry/header/requestChanges/rule-24px.svg +1 -0
- package/admin/views/contentEntries/ContentEntry/header/requestReview/RequestReview.d.ts +3 -0
- package/admin/views/contentEntries/ContentEntry/header/requestReview/RequestReview.js +69 -0
- package/admin/views/contentEntries/ContentEntry/header/requestReview/emoji_people-24px.svg +1 -0
- package/admin/views/contentEntries/ContentEntry/header/revisionSelector/RevisionSelector.d.ts +3 -0
- package/admin/views/contentEntries/ContentEntry/header/revisionSelector/RevisionSelector.js +75 -0
- package/admin/views/contentEntries/ContentEntry/header/saveAndPublishContent/SaveAndPublishContent.d.ts +3 -0
- package/admin/views/contentEntries/ContentEntry/header/saveAndPublishContent/SaveAndPublishContent.js +84 -0
- package/admin/views/contentEntries/ContentEntry/header/saveContent/SaveContent.d.ts +3 -0
- package/admin/views/contentEntries/ContentEntry/header/saveContent/SaveContent.js +32 -0
- package/admin/views/contentEntries/ContentEntry/prepareFormData.d.ts +2 -0
- package/admin/views/contentEntries/ContentEntry/prepareFormData.js +79 -0
- package/admin/views/contentEntries/ContentEntry/useRevision.d.ts +13 -0
- package/admin/views/contentEntries/ContentEntry/useRevision.js +335 -0
- package/admin/views/contentEntries/ContentEntry.d.ts +12 -0
- package/admin/views/contentEntries/ContentEntry.js +99 -0
- package/admin/views/contentEntries/hooks/useContentEntries.d.ts +1 -0
- package/admin/views/contentEntries/hooks/useContentEntries.js +5 -0
- package/admin/views/contentEntries/hooks/useContentEntriesList.d.ts +21 -0
- package/admin/views/contentEntries/hooks/useContentEntriesList.js +152 -0
- package/admin/views/contentEntries/hooks/useContentEntry.d.ts +1 -0
- package/admin/views/contentEntries/hooks/useContentEntry.js +5 -0
- package/admin/views/contentModelGroups/ContentModelGroups.d.ts +3 -0
- package/admin/views/contentModelGroups/ContentModelGroups.js +35 -0
- package/admin/views/contentModelGroups/ContentModelGroupsDataList.d.ts +6 -0
- package/admin/views/contentModelGroups/ContentModelGroupsDataList.js +242 -0
- package/admin/views/contentModelGroups/ContentModelGroupsForm.d.ts +6 -0
- package/admin/views/contentModelGroups/ContentModelGroupsForm.js +231 -0
- package/admin/views/contentModelGroups/DelayedOnChange.d.ts +25 -0
- package/admin/views/contentModelGroups/DelayedOnChange.js +134 -0
- package/admin/views/contentModelGroups/IconPicker.d.ts +7 -0
- package/admin/views/contentModelGroups/IconPicker.js +204 -0
- package/admin/views/contentModelGroups/graphql.d.ts +5 -0
- package/admin/views/contentModelGroups/graphql.js +11 -0
- package/admin/views/contentModels/ContentModelEditor.d.ts +2 -0
- package/admin/views/contentModels/ContentModelEditor.js +35 -0
- package/admin/views/contentModels/ContentModels.d.ts +3 -0
- package/admin/views/contentModels/ContentModels.js +82 -0
- package/admin/views/contentModels/ContentModelsDataList.d.ts +7 -0
- package/admin/views/contentModels/ContentModelsDataList.js +281 -0
- package/admin/views/contentModels/NewContentModelDialog.d.ts +8 -0
- package/admin/views/contentModels/NewContentModelDialog.js +196 -0
- package/admin/views/contentModels/cache.d.ts +5 -0
- package/admin/views/contentModels/cache.js +68 -0
- package/admin/views/utils.d.ts +2 -0
- package/admin/views/utils.js +27 -0
- package/admin/viewsGraphql.d.ts +4 -0
- package/admin/viewsGraphql.js +12 -0
- package/package.json +109 -0
- package/types.d.ts +484 -0
- package/types.js +1 -0
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
|
2
|
+
|
|
3
|
+
var _templateObject;
|
|
4
|
+
|
|
5
|
+
import React from "react";
|
|
6
|
+
import { css } from "emotion";
|
|
7
|
+
import { List } from "@webiny/ui/List";
|
|
8
|
+
import { Elevation } from "@webiny/ui/Elevation";
|
|
9
|
+
import { CircularProgress } from "@webiny/ui/Progress";
|
|
10
|
+
import { i18n } from "@webiny/app/i18n";
|
|
11
|
+
import RevisionListItem from "./RevisionListItem";
|
|
12
|
+
import { useContentEntry } from "../hooks/useContentEntry";
|
|
13
|
+
var t = i18n.ns("app-headless-cms/admin/plugins/content-details/content-revisions");
|
|
14
|
+
var style = {
|
|
15
|
+
list: /*#__PURE__*/css({
|
|
16
|
+
position: "relative",
|
|
17
|
+
margin: 25,
|
|
18
|
+
display: "flex",
|
|
19
|
+
flexDirection: "column",
|
|
20
|
+
overflow: "auto",
|
|
21
|
+
maxHeight: "calc(100vh - 160px)",
|
|
22
|
+
".mdc-list .mdc-list-item": {
|
|
23
|
+
borderBottom: "1px solid var(--mdc-theme-on-background)"
|
|
24
|
+
},
|
|
25
|
+
".mdc-list .mdc-list-item:last-child": {
|
|
26
|
+
borderBottom: "none"
|
|
27
|
+
}
|
|
28
|
+
}, "label:list;"),
|
|
29
|
+
nothingToShow: /*#__PURE__*/css({
|
|
30
|
+
padding: 20,
|
|
31
|
+
margin: 25,
|
|
32
|
+
textAlign: "center"
|
|
33
|
+
}, "label:nothingToShow;")
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
var RevisionsList = function RevisionsList() {
|
|
37
|
+
var _useContentEntry = useContentEntry(),
|
|
38
|
+
entry = _useContentEntry.entry,
|
|
39
|
+
revisions = _useContentEntry.revisions,
|
|
40
|
+
loading = _useContentEntry.loading;
|
|
41
|
+
|
|
42
|
+
return /*#__PURE__*/React.createElement(Elevation, {
|
|
43
|
+
className: style.list,
|
|
44
|
+
z: 2
|
|
45
|
+
}, loading && /*#__PURE__*/React.createElement(CircularProgress, null), entry.id && revisions.length ? /*#__PURE__*/React.createElement(List, {
|
|
46
|
+
nonInteractive: true,
|
|
47
|
+
twoLine: true,
|
|
48
|
+
"data-testid": "cms.content-form.revisions"
|
|
49
|
+
}, revisions.map(function (revision) {
|
|
50
|
+
return /*#__PURE__*/React.createElement(RevisionListItem, {
|
|
51
|
+
revision: revision,
|
|
52
|
+
key: revision.id
|
|
53
|
+
});
|
|
54
|
+
})) : /*#__PURE__*/React.createElement("div", {
|
|
55
|
+
className: style.nothingToShow
|
|
56
|
+
}, t(_templateObject || (_templateObject = _taggedTemplateLiteral(["No revisions to show."])))));
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
export default RevisionsList;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { CmsEditorContentEntry } from "../../../../types";
|
|
2
|
+
export declare const addEntryToListCache: (model: any, cache: any, entry: CmsEditorContentEntry, variables: any) => void;
|
|
3
|
+
export declare const updateLatestRevisionInListCache: (model: any, cache: any, revision: any, variables: any) => void;
|
|
4
|
+
export declare const removeEntryFromListCache: (model: any, cache: any, revision: any, variables: any) => void;
|
|
5
|
+
export declare const removeRevisionFromEntryCache: (model: any, cache: any, revision: any) => any;
|
|
6
|
+
export declare const addRevisionToRevisionsCache: (model: any, cache: any, revision: any) => void;
|
|
7
|
+
export declare const unpublishPreviouslyPublishedRevision: (model: any, cache: any, publishedId: any) => void;
|
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
|
|
2
|
+
import _objectSpread from "@babel/runtime/helpers/objectSpread2";
|
|
3
|
+
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
4
|
+
import dotProp from "dot-prop-immutable";
|
|
5
|
+
import orderBy from "lodash/orderBy";
|
|
6
|
+
import * as GQL from "../../../graphql/contentEntries";
|
|
7
|
+
/*
|
|
8
|
+
* We need to preserve the order of entries with new entry addition
|
|
9
|
+
* because we're not re-fetching the list but updating it directly inside cache.
|
|
10
|
+
* */
|
|
11
|
+
|
|
12
|
+
var sortEntries = function sortEntries(list, sort) {
|
|
13
|
+
if (!sort || typeof sort !== "string") {
|
|
14
|
+
return list;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
var _sort$split = sort.split("_"),
|
|
18
|
+
_sort$split2 = _slicedToArray(_sort$split, 2),
|
|
19
|
+
key = _sort$split2[0],
|
|
20
|
+
value = _sort$split2[1];
|
|
21
|
+
|
|
22
|
+
var order = value.toLowerCase();
|
|
23
|
+
return orderBy(list, [key], [order]);
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
export var addEntryToListCache = function addEntryToListCache(model, cache, entry, variables) {
|
|
27
|
+
var gqlParams = {
|
|
28
|
+
query: GQL.createListQuery(model),
|
|
29
|
+
variables: variables
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
var _cache$readQuery = cache.readQuery(gqlParams),
|
|
33
|
+
content = _cache$readQuery.content;
|
|
34
|
+
|
|
35
|
+
if (!content || !content.data) {
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
cache.writeQuery(_objectSpread(_objectSpread({}, gqlParams), {}, {
|
|
40
|
+
data: {
|
|
41
|
+
content: _objectSpread(_objectSpread({}, content), {}, {
|
|
42
|
+
data: sortEntries([entry].concat(_toConsumableArray(content.data)), variables.sort)
|
|
43
|
+
})
|
|
44
|
+
}
|
|
45
|
+
}));
|
|
46
|
+
};
|
|
47
|
+
export var updateLatestRevisionInListCache = function updateLatestRevisionInListCache(model, cache, revision, variables) {
|
|
48
|
+
var gqlParams = {
|
|
49
|
+
query: GQL.createListQuery(model),
|
|
50
|
+
variables: variables
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
var _revision$id$split = revision.id.split("#"),
|
|
54
|
+
_revision$id$split2 = _slicedToArray(_revision$id$split, 1),
|
|
55
|
+
uniqueId = _revision$id$split2[0];
|
|
56
|
+
|
|
57
|
+
var _cache$readQuery2 = cache.readQuery(gqlParams),
|
|
58
|
+
content = _cache$readQuery2.content;
|
|
59
|
+
|
|
60
|
+
if (!content || !content.data) {
|
|
61
|
+
return;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
var index = content.data.findIndex(function (item) {
|
|
65
|
+
return item.id.startsWith(uniqueId);
|
|
66
|
+
});
|
|
67
|
+
|
|
68
|
+
if (index === -1) {
|
|
69
|
+
return;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
cache.writeQuery(_objectSpread(_objectSpread({}, gqlParams), {}, {
|
|
73
|
+
data: {
|
|
74
|
+
content: dotProp.set(content, "data.".concat(index), revision)
|
|
75
|
+
}
|
|
76
|
+
}));
|
|
77
|
+
};
|
|
78
|
+
export var removeEntryFromListCache = function removeEntryFromListCache(model, cache, revision, variables) {
|
|
79
|
+
// Delete the item from list cache
|
|
80
|
+
var gqlParams = {
|
|
81
|
+
query: GQL.createListQuery(model),
|
|
82
|
+
variables: variables
|
|
83
|
+
};
|
|
84
|
+
|
|
85
|
+
var _cache$readQuery3 = cache.readQuery(gqlParams),
|
|
86
|
+
content = _cache$readQuery3.content;
|
|
87
|
+
|
|
88
|
+
if (!content || !content.data) {
|
|
89
|
+
return;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
var entryId = revision.id.split("#")[0];
|
|
93
|
+
var index = content.data.findIndex(function (item) {
|
|
94
|
+
return item.id.startsWith(entryId);
|
|
95
|
+
});
|
|
96
|
+
|
|
97
|
+
if (index === -1) {
|
|
98
|
+
return;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
cache.writeQuery(_objectSpread(_objectSpread({}, gqlParams), {}, {
|
|
102
|
+
data: {
|
|
103
|
+
content: dotProp.delete(content, "data.".concat(index))
|
|
104
|
+
}
|
|
105
|
+
}));
|
|
106
|
+
};
|
|
107
|
+
export var removeRevisionFromEntryCache = function removeRevisionFromEntryCache(model, cache, revision) {
|
|
108
|
+
var gqlParams = {
|
|
109
|
+
query: GQL.createRevisionsQuery(model),
|
|
110
|
+
variables: {
|
|
111
|
+
id: revision.id.split("#")[0]
|
|
112
|
+
}
|
|
113
|
+
};
|
|
114
|
+
|
|
115
|
+
var _cache$readQuery4 = cache.readQuery(gqlParams),
|
|
116
|
+
revisions = _cache$readQuery4.revisions;
|
|
117
|
+
|
|
118
|
+
if (!revisions || !revisions.data) {
|
|
119
|
+
return;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
var index = revisions.data.findIndex(function (item) {
|
|
123
|
+
return item.id === revision.id;
|
|
124
|
+
});
|
|
125
|
+
var newRevisions = dotProp.delete(revisions, "data.".concat(index));
|
|
126
|
+
cache.writeQuery(_objectSpread(_objectSpread({}, gqlParams), {}, {
|
|
127
|
+
data: {
|
|
128
|
+
revisions: newRevisions
|
|
129
|
+
}
|
|
130
|
+
})); // Return new revisions
|
|
131
|
+
|
|
132
|
+
return newRevisions.data;
|
|
133
|
+
};
|
|
134
|
+
export var addRevisionToRevisionsCache = function addRevisionToRevisionsCache(model, cache, revision) {
|
|
135
|
+
var gqlParams = {
|
|
136
|
+
query: GQL.createRevisionsQuery(model),
|
|
137
|
+
variables: {
|
|
138
|
+
id: revision.id.split("#")[0]
|
|
139
|
+
}
|
|
140
|
+
};
|
|
141
|
+
|
|
142
|
+
var _cache$readQuery5 = cache.readQuery(gqlParams),
|
|
143
|
+
revisions = _cache$readQuery5.revisions;
|
|
144
|
+
|
|
145
|
+
if (!revisions || !revisions.data) {
|
|
146
|
+
return;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
cache.writeQuery(_objectSpread(_objectSpread({}, gqlParams), {}, {
|
|
150
|
+
data: {
|
|
151
|
+
revisions: dotProp.set(revisions, "data", [revision].concat(_toConsumableArray(revisions.data)))
|
|
152
|
+
}
|
|
153
|
+
}));
|
|
154
|
+
};
|
|
155
|
+
export var unpublishPreviouslyPublishedRevision = function unpublishPreviouslyPublishedRevision(model, cache, publishedId) {
|
|
156
|
+
var gqlParams = {
|
|
157
|
+
query: GQL.createRevisionsQuery(model),
|
|
158
|
+
variables: {
|
|
159
|
+
id: publishedId.split("#")[0]
|
|
160
|
+
}
|
|
161
|
+
};
|
|
162
|
+
|
|
163
|
+
var _cache$readQuery6 = cache.readQuery(gqlParams),
|
|
164
|
+
revisions = _cache$readQuery6.revisions;
|
|
165
|
+
|
|
166
|
+
if (!revisions || !revisions.data) {
|
|
167
|
+
return;
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
var prevPublished = revisions.data.findIndex(function (item) {
|
|
171
|
+
return item.id !== publishedId && item.meta.status === "published";
|
|
172
|
+
});
|
|
173
|
+
|
|
174
|
+
if (prevPublished === -1) {
|
|
175
|
+
return;
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
cache.writeQuery(_objectSpread(_objectSpread({}, gqlParams), {}, {
|
|
179
|
+
data: {
|
|
180
|
+
revisions: dotProp.set(revisions, "data.".concat(prevPublished, ".meta.status"), "unpublished")
|
|
181
|
+
}
|
|
182
|
+
}));
|
|
183
|
+
};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { css } from "emotion";
|
|
3
|
+
import { renderPlugins } from "@webiny/app/plugins";
|
|
4
|
+
import { Grid, Cell } from "@webiny/ui/Grid";
|
|
5
|
+
import classNames from "classnames";
|
|
6
|
+
var toolbarGrid = /*#__PURE__*/css({
|
|
7
|
+
borderBottom: "1px solid var(--mdc-theme-on-background)"
|
|
8
|
+
}, "label:toolbarGrid;");
|
|
9
|
+
var headerActions = /*#__PURE__*/css({
|
|
10
|
+
display: "flex",
|
|
11
|
+
alignItems: "center"
|
|
12
|
+
}, "label:headerActions;");
|
|
13
|
+
var headerActionsLeft = /*#__PURE__*/css({
|
|
14
|
+
justifyContent: "flex-end"
|
|
15
|
+
}, "label:headerActionsLeft;");
|
|
16
|
+
var headerActionsRight = /*#__PURE__*/css({
|
|
17
|
+
justifyContent: "flex-start"
|
|
18
|
+
}, "label:headerActionsRight;");
|
|
19
|
+
|
|
20
|
+
var Header = function Header(props) {
|
|
21
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Grid, {
|
|
22
|
+
className: toolbarGrid
|
|
23
|
+
}, /*#__PURE__*/React.createElement(Cell, {
|
|
24
|
+
span: 4,
|
|
25
|
+
className: classNames(headerActions, headerActionsRight)
|
|
26
|
+
}, renderPlugins("cms-content-details-header-left", props)), /*#__PURE__*/React.createElement(Cell, {
|
|
27
|
+
span: 8,
|
|
28
|
+
className: classNames(headerActions, headerActionsLeft)
|
|
29
|
+
}, renderPlugins("cms-content-details-header-right", props))));
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
export default Header;
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
|
2
|
+
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
|
3
|
+
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
4
|
+
|
|
5
|
+
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5;
|
|
6
|
+
|
|
7
|
+
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
8
|
+
import React, { useCallback, useMemo } from "react";
|
|
9
|
+
import { css } from "emotion";
|
|
10
|
+
import get from "lodash/get";
|
|
11
|
+
import { IconButton } from "@webiny/ui/Button";
|
|
12
|
+
import { Menu, MenuItem } from "@webiny/ui/Menu";
|
|
13
|
+
import { ListItemGraphic } from "@webiny/ui/List";
|
|
14
|
+
import { Icon } from "@webiny/ui/Icon";
|
|
15
|
+
import { useRouter } from "@webiny/react-router";
|
|
16
|
+
import { useSnackbar } from "@webiny/app-admin/hooks/useSnackbar";
|
|
17
|
+
import { useDialog } from "@webiny/app-admin/hooks/useDialog";
|
|
18
|
+
import { useConfirmationDialog } from "@webiny/app-admin/hooks/useConfirmationDialog";
|
|
19
|
+
import { i18n } from "@webiny/app/i18n";
|
|
20
|
+
import { createDeleteMutation } from "../../../../../graphql/contentEntries";
|
|
21
|
+
import usePermission from "../../../../../hooks/usePermission";
|
|
22
|
+
import { ReactComponent as MoreVerticalIcon } from "@svgr/webpack!../../../../../icons/more_vert.svg";
|
|
23
|
+
import { ReactComponent as DeleteIcon } from "@svgr/webpack!../../../../../icons/delete.svg";
|
|
24
|
+
import { removeEntryFromListCache } from "../../cache";
|
|
25
|
+
import { useMutation } from "../../../../../hooks";
|
|
26
|
+
import { useContentEntry } from "../../../hooks/useContentEntry";
|
|
27
|
+
var t = i18n.ns("app-headless-cms/admin/plugins/content-details/header/content-form-options-menu");
|
|
28
|
+
var menuStyles = /*#__PURE__*/css({
|
|
29
|
+
width: 250,
|
|
30
|
+
right: -105,
|
|
31
|
+
left: "auto !important",
|
|
32
|
+
".disabled": {
|
|
33
|
+
opacity: 0.5,
|
|
34
|
+
pointerEvents: "none"
|
|
35
|
+
}
|
|
36
|
+
}, "label:menuStyles;");
|
|
37
|
+
|
|
38
|
+
var ContentFormOptionsMenu = function ContentFormOptionsMenu() {
|
|
39
|
+
var _useContentEntry = useContentEntry(),
|
|
40
|
+
contentModel = _useContentEntry.contentModel,
|
|
41
|
+
entry = _useContentEntry.entry,
|
|
42
|
+
loading = _useContentEntry.loading,
|
|
43
|
+
setLoading = _useContentEntry.setLoading,
|
|
44
|
+
listQueryVariables = _useContentEntry.listQueryVariables;
|
|
45
|
+
|
|
46
|
+
var _useSnackbar = useSnackbar(),
|
|
47
|
+
showSnackbar = _useSnackbar.showSnackbar;
|
|
48
|
+
|
|
49
|
+
var _useRouter = useRouter(),
|
|
50
|
+
history = _useRouter.history;
|
|
51
|
+
|
|
52
|
+
var _useDialog = useDialog(),
|
|
53
|
+
showDialog = _useDialog.showDialog;
|
|
54
|
+
|
|
55
|
+
var _usePermission = usePermission(),
|
|
56
|
+
canDelete = _usePermission.canDelete;
|
|
57
|
+
|
|
58
|
+
var DELETE_CONTENT = useMemo(function () {
|
|
59
|
+
return createDeleteMutation(contentModel);
|
|
60
|
+
}, [contentModel.modelId]);
|
|
61
|
+
|
|
62
|
+
var _useMutation = useMutation(DELETE_CONTENT),
|
|
63
|
+
_useMutation2 = _slicedToArray(_useMutation, 1),
|
|
64
|
+
deleteContentMutation = _useMutation2[0];
|
|
65
|
+
|
|
66
|
+
var title = get(entry, "meta.title");
|
|
67
|
+
|
|
68
|
+
var _useConfirmationDialo = useConfirmationDialog({
|
|
69
|
+
title: t(_templateObject || (_templateObject = _taggedTemplateLiteral(["Delete content entry"]))),
|
|
70
|
+
message: /*#__PURE__*/React.createElement("p", null, t(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["You are about to delete this content entry and all of its revisions!"]))), /*#__PURE__*/React.createElement("br", null), t(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["Are you sure you want to permanently delete {title}?"])))({
|
|
71
|
+
title: /*#__PURE__*/React.createElement("strong", null, title)
|
|
72
|
+
})),
|
|
73
|
+
dataTestId: "cms.content-form.header.delete-dialog"
|
|
74
|
+
}),
|
|
75
|
+
showConfirmation = _useConfirmationDialo.showConfirmation;
|
|
76
|
+
|
|
77
|
+
var confirmDelete = useCallback(function () {
|
|
78
|
+
showConfirmation( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
|
|
79
|
+
var _entry$id$split, _entry$id$split2, uniqueId;
|
|
80
|
+
|
|
81
|
+
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
82
|
+
while (1) {
|
|
83
|
+
switch (_context.prev = _context.next) {
|
|
84
|
+
case 0:
|
|
85
|
+
setLoading(true);
|
|
86
|
+
_entry$id$split = entry.id.split("#"), _entry$id$split2 = _slicedToArray(_entry$id$split, 1), uniqueId = _entry$id$split2[0];
|
|
87
|
+
_context.next = 4;
|
|
88
|
+
return deleteContentMutation({
|
|
89
|
+
variables: {
|
|
90
|
+
revision: uniqueId
|
|
91
|
+
},
|
|
92
|
+
update: function update(cache, _ref2) {
|
|
93
|
+
var data = _ref2.data;
|
|
94
|
+
var error = data.content.error;
|
|
95
|
+
|
|
96
|
+
if (error) {
|
|
97
|
+
return showDialog(error.message, {
|
|
98
|
+
title: t(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["Could not delete content"])))
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
removeEntryFromListCache(contentModel, cache, entry, listQueryVariables);
|
|
103
|
+
showSnackbar(t(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["{title} was deleted successfully!"])))({
|
|
104
|
+
title: /*#__PURE__*/React.createElement("strong", null, title)
|
|
105
|
+
}));
|
|
106
|
+
history.push("/cms/content-entries/".concat(contentModel.modelId));
|
|
107
|
+
}
|
|
108
|
+
});
|
|
109
|
+
|
|
110
|
+
case 4:
|
|
111
|
+
setLoading(false);
|
|
112
|
+
|
|
113
|
+
case 5:
|
|
114
|
+
case "end":
|
|
115
|
+
return _context.stop();
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
}, _callee);
|
|
119
|
+
})));
|
|
120
|
+
}, null);
|
|
121
|
+
|
|
122
|
+
if (!canDelete(entry, "cms.contentEntry")) {
|
|
123
|
+
return null;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
return /*#__PURE__*/React.createElement(Menu, {
|
|
127
|
+
className: menuStyles,
|
|
128
|
+
handle: /*#__PURE__*/React.createElement(IconButton, {
|
|
129
|
+
icon: /*#__PURE__*/React.createElement(MoreVerticalIcon, null),
|
|
130
|
+
"data-testid": "cms.content-form.header.more-options"
|
|
131
|
+
})
|
|
132
|
+
}, /*#__PURE__*/React.createElement(MenuItem, {
|
|
133
|
+
onClick: confirmDelete,
|
|
134
|
+
disabled: !entry.id || loading,
|
|
135
|
+
"data-testid": "cms.content-form.header.delete"
|
|
136
|
+
}, /*#__PURE__*/React.createElement(ListItemGraphic, null, /*#__PURE__*/React.createElement(Icon, {
|
|
137
|
+
icon: /*#__PURE__*/React.createElement(DeleteIcon, null)
|
|
138
|
+
})), "Delete"));
|
|
139
|
+
};
|
|
140
|
+
|
|
141
|
+
export default ContentFormOptionsMenu;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import RevisionSelector from "./revisionSelector/RevisionSelector";
|
|
3
|
+
import RequestReview from "./requestReview/RequestReview";
|
|
4
|
+
import RequestChanges from "./requestChanges/RequestChanges";
|
|
5
|
+
import SaveContentButton from "./saveContent/SaveContent";
|
|
6
|
+
import SaveAndPublishButton from "./saveAndPublishContent/SaveAndPublishContent";
|
|
7
|
+
import ContentFormOptionsMenu from "./contentFormOptionsMenu/ContentFormOptionsMenu";
|
|
8
|
+
var plugins = [{
|
|
9
|
+
name: "cms-content-details-revision-selector",
|
|
10
|
+
type: "cms-content-details-header-left",
|
|
11
|
+
render: function render(props) {
|
|
12
|
+
return /*#__PURE__*/React.createElement(RevisionSelector, props);
|
|
13
|
+
}
|
|
14
|
+
}, {
|
|
15
|
+
name: "cms-content-details-header-request-review",
|
|
16
|
+
type: "cms-content-details-header-right",
|
|
17
|
+
render: function render(props) {
|
|
18
|
+
return /*#__PURE__*/React.createElement(RequestReview, props);
|
|
19
|
+
}
|
|
20
|
+
}, {
|
|
21
|
+
name: "cms-content-details-header-request-changes",
|
|
22
|
+
type: "cms-content-details-header-right",
|
|
23
|
+
render: function render(props) {
|
|
24
|
+
return /*#__PURE__*/React.createElement(RequestChanges, props);
|
|
25
|
+
}
|
|
26
|
+
}, {
|
|
27
|
+
name: "cms-content-details-header-save",
|
|
28
|
+
type: "cms-content-details-header-right",
|
|
29
|
+
render: function render(props) {
|
|
30
|
+
return /*#__PURE__*/React.createElement(SaveContentButton, props);
|
|
31
|
+
}
|
|
32
|
+
}, {
|
|
33
|
+
name: "cms-content-details-header-save-and-publish",
|
|
34
|
+
type: "cms-content-details-header-right",
|
|
35
|
+
render: function render(props) {
|
|
36
|
+
return /*#__PURE__*/React.createElement(SaveAndPublishButton, props);
|
|
37
|
+
}
|
|
38
|
+
}, {
|
|
39
|
+
name: "cms-content-details-header-option-menu",
|
|
40
|
+
type: "cms-content-details-header-right",
|
|
41
|
+
render: function render(props) {
|
|
42
|
+
return /*#__PURE__*/React.createElement(ContentFormOptionsMenu, props);
|
|
43
|
+
}
|
|
44
|
+
}];
|
|
45
|
+
export default plugins;
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
|
2
|
+
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
|
3
|
+
|
|
4
|
+
var _templateObject, _templateObject2, _templateObject3;
|
|
5
|
+
|
|
6
|
+
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
7
|
+
import React from "react";
|
|
8
|
+
import { IconButton } from "@webiny/ui/Button";
|
|
9
|
+
import { Tooltip } from "@webiny/ui/Tooltip";
|
|
10
|
+
import { useConfirmationDialog } from "@webiny/app-admin/hooks/useConfirmationDialog";
|
|
11
|
+
import { i18n } from "@webiny/app/i18n";
|
|
12
|
+
import { ReactComponent as RequestChangesIcon } from "@svgr/webpack!./rule-24px.svg";
|
|
13
|
+
import usePermission from "../../../../../hooks/usePermission";
|
|
14
|
+
import { useRevision } from "../../useRevision";
|
|
15
|
+
import { useContentEntry } from "../../../hooks/useContentEntry";
|
|
16
|
+
var t = i18n.ns("app-headless-cms/admin/content-details/header/request-review");
|
|
17
|
+
|
|
18
|
+
var RequestChanges = function RequestChanges() {
|
|
19
|
+
var _useContentEntry = useContentEntry(),
|
|
20
|
+
entry = _useContentEntry.entry;
|
|
21
|
+
|
|
22
|
+
var _useRevision = useRevision({
|
|
23
|
+
revision: entry
|
|
24
|
+
}),
|
|
25
|
+
requestChanges = _useRevision.requestChanges;
|
|
26
|
+
|
|
27
|
+
var _usePermission = usePermission(),
|
|
28
|
+
canRequestChange = _usePermission.canRequestChange;
|
|
29
|
+
|
|
30
|
+
var _useConfirmationDialo = useConfirmationDialog({
|
|
31
|
+
title: t(_templateObject || (_templateObject = _taggedTemplateLiteral(["Request Changes"]))),
|
|
32
|
+
message: /*#__PURE__*/React.createElement("p", null, t(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["You are about to request changes on this content entry. Are you sure you want to continue?"]))))
|
|
33
|
+
}),
|
|
34
|
+
showConfirmation = _useConfirmationDialo.showConfirmation;
|
|
35
|
+
|
|
36
|
+
if (!canRequestChange("cms.contentEntry")) {
|
|
37
|
+
return null;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
var buttonEnabled = entry.id && (entry.meta.status === "draft" || entry.meta.status === "reviewRequested");
|
|
41
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Tooltip, {
|
|
42
|
+
content: t(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["Request Changes"]))),
|
|
43
|
+
placement: "top"
|
|
44
|
+
}, /*#__PURE__*/React.createElement(IconButton, {
|
|
45
|
+
disabled: !buttonEnabled,
|
|
46
|
+
icon: /*#__PURE__*/React.createElement(RequestChangesIcon, null),
|
|
47
|
+
onClick: function onClick() {
|
|
48
|
+
return showConfirmation( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
|
|
49
|
+
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
50
|
+
while (1) {
|
|
51
|
+
switch (_context.prev = _context.next) {
|
|
52
|
+
case 0:
|
|
53
|
+
_context.next = 2;
|
|
54
|
+
return requestChanges(entry.id);
|
|
55
|
+
|
|
56
|
+
case 2:
|
|
57
|
+
case "end":
|
|
58
|
+
return _context.stop();
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
}, _callee);
|
|
62
|
+
})));
|
|
63
|
+
}
|
|
64
|
+
})));
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
export default RequestChanges;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" enable-background="new 0 0 24 24" height="24" viewBox="0 0 24 24" width="24"><g><rect fill="none" height="24" width="24"/><path d="M15.83,10.29l-2.12-2.12c-0.39-0.39-0.39-1.02,0-1.41l0,0c0.39-0.39,1.02-0.39,1.41,0l1.41,1.41l3.54-3.54 c0.39-0.39,1.02-0.39,1.41,0l0,0c0.39,0.39,0.39,1.02,0,1.41l-4.24,4.24C16.85,10.68,16.22,10.68,15.83,10.29z M10,7H3 C2.45,7,2,7.45,2,8v0c0,0.55,0.45,1,1,1h7c0.55,0,1-0.45,1-1v0C11,7.45,10.55,7,10,7z M20.29,12.71L20.29,12.71 c-0.39-0.39-1.02-0.39-1.41,0L17,14.59l-1.88-1.88c-0.39-0.39-1.02-0.39-1.41,0l0,0c-0.39,0.39-0.39,1.02,0,1.41L15.59,16 l-1.88,1.88c-0.39,0.39-0.39,1.02,0,1.41l0,0c0.39,0.39,1.02,0.39,1.41,0L17,17.41l1.88,1.88c0.39,0.39,1.02,0.39,1.41,0l0,0 c0.39-0.39,0.39-1.02,0-1.41L18.41,16l1.88-1.88C20.68,13.73,20.68,13.1,20.29,12.71z M10,15H3c-0.55,0-1,0.45-1,1v0 c0,0.55,0.45,1,1,1h7c0.55,0,1-0.45,1-1v0C11,15.45,10.55,15,10,15z"/></g></svg>
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
|
2
|
+
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
|
3
|
+
|
|
4
|
+
var _templateObject, _templateObject2, _templateObject3;
|
|
5
|
+
|
|
6
|
+
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
7
|
+
import React, { useCallback } from "react";
|
|
8
|
+
import { IconButton } from "@webiny/ui/Button";
|
|
9
|
+
import { Tooltip } from "@webiny/ui/Tooltip";
|
|
10
|
+
import { useConfirmationDialog } from "@webiny/app-admin/hooks/useConfirmationDialog";
|
|
11
|
+
import { i18n } from "@webiny/app/i18n";
|
|
12
|
+
import { ReactComponent as RequestReviewIcon } from "@svgr/webpack!./emoji_people-24px.svg";
|
|
13
|
+
import { useRevision } from "../../useRevision";
|
|
14
|
+
import usePermission from "../../../../../hooks/usePermission";
|
|
15
|
+
import { useContentEntry } from "../../../hooks/useContentEntry";
|
|
16
|
+
var t = i18n.ns("app-headless-cms/admin/content-details/header/request-review");
|
|
17
|
+
|
|
18
|
+
var RequestReview = function RequestReview() {
|
|
19
|
+
var _useContentEntry = useContentEntry(),
|
|
20
|
+
entry = _useContentEntry.entry;
|
|
21
|
+
|
|
22
|
+
var _useRevision = useRevision({
|
|
23
|
+
revision: entry
|
|
24
|
+
}),
|
|
25
|
+
requestReview = _useRevision.requestReview;
|
|
26
|
+
|
|
27
|
+
var _usePermission = usePermission(),
|
|
28
|
+
canRequestReview = _usePermission.canRequestReview;
|
|
29
|
+
|
|
30
|
+
var _useConfirmationDialo = useConfirmationDialog({
|
|
31
|
+
title: t(_templateObject || (_templateObject = _taggedTemplateLiteral(["Request Review"]))),
|
|
32
|
+
message: /*#__PURE__*/React.createElement("p", null, t(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["You are about to request a review of this content entry. Are you sure you want to continue?"]))))
|
|
33
|
+
}),
|
|
34
|
+
showConfirmation = _useConfirmationDialo.showConfirmation;
|
|
35
|
+
|
|
36
|
+
var onClick = useCallback(function () {
|
|
37
|
+
showConfirmation( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
|
|
38
|
+
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
39
|
+
while (1) {
|
|
40
|
+
switch (_context.prev = _context.next) {
|
|
41
|
+
case 0:
|
|
42
|
+
_context.next = 2;
|
|
43
|
+
return requestReview(entry.id);
|
|
44
|
+
|
|
45
|
+
case 2:
|
|
46
|
+
case "end":
|
|
47
|
+
return _context.stop();
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
}, _callee);
|
|
51
|
+
})));
|
|
52
|
+
}, [entry.id]);
|
|
53
|
+
|
|
54
|
+
if (!canRequestReview("cms.contentEntry")) {
|
|
55
|
+
return null;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
var buttonEnabled = entry.id && (entry.meta.status === "draft" || entry.meta.status === "changesRequested");
|
|
59
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Tooltip, {
|
|
60
|
+
content: t(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["Request Review"]))),
|
|
61
|
+
placement: "top"
|
|
62
|
+
}, /*#__PURE__*/React.createElement(IconButton, {
|
|
63
|
+
disabled: !buttonEnabled,
|
|
64
|
+
icon: /*#__PURE__*/React.createElement(RequestReviewIcon, null),
|
|
65
|
+
onClick: onClick
|
|
66
|
+
})));
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
export default RequestReview;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" enable-background="new 0 0 24 24" height="24" viewBox="0 0 24 24" width="24"><g><rect fill="none" height="24" width="24"/><rect fill="none" height="24" width="24"/></g><g><g/><g><circle cx="12" cy="4" r="2"/><path d="M15.89,8.11C15.5,7.72,14.83,7,13.53,7c-0.21,0-1.42,0-2.54,0C8.53,6.99,6.48,5.2,6.07,2.85C5.99,2.36,5.58,2,5.09,2h0 c-0.61,0-1.09,0.54-1,1.14C4.53,5.8,6.47,7.95,9,8.71V21c0,0.55,0.45,1,1,1h0c0.55,0,1-0.45,1-1v-5h2v5c0,0.55,0.45,1,1,1h0 c0.55,0,1-0.45,1-1V10.05l3.24,3.24c0.39,0.39,1.02,0.39,1.41,0v0c0.39-0.39,0.39-1.02,0-1.41L15.89,8.11z"/></g></g></svg>
|