apostrophecms / apostrophe

A full-featured, open-source content management framework built with Node.js that empowers organizations by combining in-context editing and headless architecture in a full-stack JS environment.
https://apostrophecms.com
MIT License
4.34k stars 592 forks source link

max widgets allowed in the area isn't working when expanded:true #4737

Closed kbusim-icims closed 1 day ago

kbusim-icims commented 5 days ago

Running ^4.5.4 version of Apostrophe

To Reproduce

Step by step instructions to reproduce the behavior:

Expected behavior

When configuring an area's options, 'max' field sets the maximum number of widgets allowed in the area. https://docs.apostrophecms.org/reference/field-types/area.html#max

Describe the bug

The max limit (number of widgets) allowed in the area is not working when expanded is set to true. It works perfectly fine when expanded is set to false, or never set.

Details

Code: columnFooterLayout: { label: 'apostrophe:columnFooterLayout', type: 'area', options: { max: 2, columns: 2, expanded: true, widgets: { 'footer-l-regular-width': {}, 'footer-l-half-and-half': {}, 'footer-l-two-thirds-one': {}, 'footer-l-one-third-two': {}, 'footer-l-thirds': {}, 'footer-l-quarters': {}, }, }, if: { footerType: basicFooter, }, }

Version of Node.js: 20.11.0

Server Operating System: Ubuntu WSL1 (Windows Subsystem for Linux)

boutell commented 5 days ago

Thanks. I see that you are a customer, that makes this a warranty issue, please do open a Zendesk ticket to make sure that we give you timely support on this.

THOMAS BOUTELL | CHIEF TECHNOLOGY OFFICER APOSTROPHECMS | apostrophecms.com | he/him/his

On Thu, Sep 26, 2024 at 11:43 AM kbusim-icims @.***> wrote:

Running ^4.5.4 version of Apostrophe To Reproduce

Step by step instructions to reproduce the behavior:

  • For any given widget whose type is area.
  • Case1: set the expanded: true and max: 2
  • Case2: set the expanded: false or better remove expanded field, and max:2
  • Observe that in case1, max:2 doesn't work, it shouldn't let you add widget after second time.

Expected behavior

When configuring an area's options, 'max' field sets the maximum number of widgets allowed in the area. https://docs.apostrophecms.org/reference/field-types/area.html#max

Describe the bug

The max limit (number of widgets) allowed in the area is not working when expanded is set to true. It works perfectly fine when expanded is set to false, or never set.

Details

Code: columnFooterLayout: { label: 'apostrophe:columnFooterLayout', type: 'area', options: { max: 2, columns: 2, expanded: true, widgets: { 'footer-l-regular-width': {}, 'footer-l-half-and-half': {}, 'footer-l-two-thirds-one': {}, 'footer-l-one-third-two': {}, 'footer-l-thirds': {}, 'footer-l-quarters': {}, }, }, if: { footerType: basicFooter, }, }

Version of Node.js: 20.11.0

Server Operating System: Ubuntu WSL1 (Windows Subsystem for Linux)

— Reply to this email directly, view it on GitHub https://github.com/apostrophecms/apostrophe/issues/4737, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAAH27IDHDQWNGXPGLWQEHDZYQTRDAVCNFSM6AAAAABO5KDCXGVHI2DSMVQWIX3LMV43ASLTON2WKOZSGU2TAOJVHAZTKMA . You are receiving this because you are subscribed to this thread.Message ID: @.***>

kbusim-icims commented 4 days ago

https://support.apostrophecms.com/hc/en-us/requests/1014 @boutell I've created the zendesk ticket. pls do the needful. Thanks!

boutell commented 1 day ago

Appreciate that.