Widget should not allow to submit more members than the allowed

Created on 27 November 2024, 2 months ago

Problem/Motivation

Currently, a user can submit more members into a new thread than what is defined in "Maximum number of thread members" in the widget settings.

It is true that it will get a validation error. But ideally the user wouldn't be able to introduce more members in the input, once the limit is reached.

Steps to reproduce

  1. Go to /admin/structure/private-message/private-message-thread/form-display and set 1 in "Maximum number of thread members"
  2. Start a new thread and add two members in the "To" input field.
๐Ÿ“Œ Task
Status

Active

Version

4.0

Component

Code

Created by

๐Ÿ‡ต๐Ÿ‡นPortugal dxvargas

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

  • Issue created by @dxvargas
  • Pipeline finished with Failed
    2 months ago
    Total: 3427s
    #355171
  • Pipeline finished with Failed
    2 months ago
    Total: 480s
    #355590
  • ๐Ÿ‡ต๐Ÿ‡นPortugal dxvargas

    The approach using javascript seems valid to me.
    But there are some important lint errors in the MR that need attention. Please have a look to the result of the job.
    A test for this is also welcome.

  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia vinayakmk47

    @dxvargas Thank you for the feedback!

    I'll address the lint errors flagged in the job results.
    I'll also add a test case to ensure the widget functionality is robust and restricts submissions exceeding the allowed member count.
    Once these are resolved, Iโ€™ll update the MR for further review. Let me know if thereโ€™s anything else to consider.

  • Pipeline finished with Failed
    about 2 months ago
    Total: 355s
    #374718
  • Pipeline finished with Failed
    about 2 months ago
    Total: 256s
    #374735
  • Pipeline finished with Failed
    about 2 months ago
    Total: 350s
    #374748
  • Pipeline finished with Failed
    about 2 months ago
    Total: 298s
    #374766
  • Pipeline finished with Failed
    about 2 months ago
    Total: 252s
    #374801
  • Pipeline finished with Failed
    about 2 months ago
    Total: 259s
    #374824
  • Pipeline finished with Failed
    about 2 months ago
    Total: 249s
    #374834
  • Pipeline finished with Failed
    about 2 months ago
    Total: 255s
    #374841
  • Pipeline finished with Failed
    about 2 months ago
    Total: 269s
    #374860
  • Pipeline finished with Failed
    about 2 months ago
    Total: 400s
    #374869
  • Pipeline finished with Failed
    about 2 months ago
    Total: 261s
    #374896
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia vinayakmk47

    @dxvargas fixed the lint errors can you please review it

Production build 0.71.5 2024