diff --git a/CHANGELOG.md b/CHANGELOG.md index 58b08f7c39..5a53d552e2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,9 @@ except as part of the admin UI bundle which depends on it. For use with external front ends such as [apostrophe-astro](https://github.com/apostrophecms/apostrophe-astro). Thanks to Michelin for contributing this feature. +### Fixes +* Do not show widget editor tabs when the developer hasn't created any groups. + ### Changes * Improves `debounce` function to handle async properly (waiting for previous async call to finish before to trigger new one). @@ -21,6 +24,7 @@ Thanks to Michelin for contributing this feature. * Autocrop image attachments for referenced documents when replacing an image in the Media Manager. * Fixes modals in transition, as well as slider transition on overlay opacity. +* Changing the aspect ratio multiple times in the image cropper modal no longer makes the stencil smaller and smaller. ## 4.2.1 (2024-04-29) diff --git a/modules/@apostrophecms/image/ui/apos/components/AposImageCropper.vue b/modules/@apostrophecms/image/ui/apos/components/AposImageCropper.vue index d0524a723e..78a536f929 100644 --- a/modules/@apostrophecms/image/ui/apos/components/AposImageCropper.vue +++ b/modules/@apostrophecms/image/ui/apos/components/AposImageCropper.vue @@ -105,6 +105,7 @@ export default { }, aspectRatio: { handler(newVal) { + this.$refs.cropper.reset(); this.stencilProps.aspectRatio = newVal; this.$refs.cropper.refresh(); } diff --git a/modules/@apostrophecms/modal/ui/apos/components/AposModalTabs.vue b/modules/@apostrophecms/modal/ui/apos/components/AposModalTabs.vue index ac0a0f1cf5..162095c2d1 100644 --- a/modules/@apostrophecms/modal/ui/apos/components/AposModalTabs.vue +++ b/modules/@apostrophecms/modal/ui/apos/components/AposModalTabs.vue @@ -1,8 +1,8 @@ @@ -55,39 +40,9 @@ export default { default() { return {}; } - }, - orientation: { - type: String, - default: 'vertical' } }, emits: [ 'select-tab' ], - data() { - const visibleTabs = []; - const hiddenTabs = []; - - for (let i = 0; i < this.tabs.length; i++) { - // Shallow clone is sufficient to make mutating - // a top-level property safe - const tab = { ...this.tabs[i] }; - tab.action = tab.name; - if (i < 5) { - visibleTabs.push(tab); - } else { - hiddenTabs.push(tab); - } - } - - return { - visibleTabs, - hiddenTabs, - moreMenuButton: { - icon: 'dots-vertical-icon', - iconOnly: true, - type: 'subtle' - } - }; - }, computed: { tabErrors() { const errors = {}; @@ -114,15 +69,6 @@ export default { const tab = e.target; const id = tab.id; this.$emit('select-tab', id); - }, - moreMenuHandler(item) { - const lastVisibleTab = this.visibleTabs[this.visibleTabs.length - 1]; - const selectedItem = this.hiddenTabs.find((tab) => tab.name === item); - - this.hiddenTabs.splice(this.hiddenTabs.indexOf(selectedItem), 1, lastVisibleTab); - this.visibleTabs.splice(this.visibleTabs.length - 1, 1, selectedItem); - - this.$emit('select-tab', item); } } }; diff --git a/modules/@apostrophecms/modal/ui/apos/components/AposWidgetModalTabs.vue b/modules/@apostrophecms/modal/ui/apos/components/AposWidgetModalTabs.vue new file mode 100644 index 0000000000..6d223fe3eb --- /dev/null +++ b/modules/@apostrophecms/modal/ui/apos/components/AposWidgetModalTabs.vue @@ -0,0 +1,282 @@ + + + + + diff --git a/modules/@apostrophecms/widget-type/ui/apos/components/AposWidgetEditor.vue b/modules/@apostrophecms/widget-type/ui/apos/components/AposWidgetEditor.vue index 61474184a5..96f6531689 100644 --- a/modules/@apostrophecms/widget-type/ui/apos/components/AposWidgetEditor.vue +++ b/modules/@apostrophecms/widget-type/ui/apos/components/AposWidgetEditor.vue @@ -10,8 +10,8 @@ >