You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Member Settings page allows user to add multiple subsequent member without a fail.
Changes Made
Earlier Member Settings page allows user to add 1 new member, adding a subsequent member led to form failure with the error "Form is Invalid. model_usage_restriction is a required field."
Now user can add multiple subsequent user without any error.
How to Test
Go to Settings page
Click on 'Admin On'
Click on 'Member Settings'
Click on 'Add Members'
Select 'Native' for type
Enter a user id
Enter a name
Enter a phone number
Click on 'Save'
Repeat steps 4 through 9 using distinct values for user id, name, and phone number
User doesn't get error while adding multiple subsequent members.
Member Settings page allows user to add multiple subsequent member without a fail.
Changes Made
Earlier Member Settings page allows user to add 1 new member, adding a subsequent member led to form failure with the error "Form is Invalid. model_usage_restriction is a required field."
Now user can add multiple subsequent user without any error.
How to Test
Go to Settings page
Click on 'Admin On'
Click on 'Member Settings'
Click on 'Add Members'
Select 'Native' for type
Enter a user id
Enter a name
Enter a phone number
Click on 'Save'
Repeat steps 4 through 9 using distinct values for user id, name, and phone number
User doesn't get error while adding multiple subsequent members.
Assigning the string "null" as a fallback for model_usage_restriction may not match the form schema or expected type and could trigger validation errors. Consider using null (without quotes) or an empty string if that's acceptable.
model_usage_restriction: user?.model_usage_restriction??'null',// always set default for new user
Replace the string 'null' with the actual null literal to ensure the form field's type remains nullable instead of a string, preventing potential type errors downstream.
-model_usage_restriction: user?.model_usage_restriction ?? 'null', // always set default for new user+model_usage_restriction: user?.model_usage_restriction ?? null, // always set default for new user
Suggestion importance[1-10]: 7
__
Why: The suggestion ensures the model_usage_restriction field’s type remains nullable rather than a string, preventing downstream type errors.
-model_usage_restriction: user?.model_usage_restriction ?? 'null', // always set default for new user+model_usage_restriction: user?.model_usage_restriction ?? null, // always set default for new user
Suggestion importance[1-10]: 8
__
Why: Changing the default from a string "null" to null prevents a type mismatch for model_usage_restriction and avoids potential form errors.
Medium
General
Add reset to deps
Add reset to the dependency array so the effect reruns if the reset function identity changes, satisfying exhaustive-deps lint rules.
Why: Including reset in the dependency array adheres to exhaustive-deps lint rules but has minimal impact on functionality since reset identity rarely changes.
Enable adding multiple members in Member Settings without form errors.
to commit the new content to the CHANGELOG.md file, please type:
'/update_changelog --pr_update_changelog.push_changelog_changes=true'
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Member Settings page allows user to add multiple subsequent member without a fail.
Changes Made
Earlier Member Settings page allows user to add 1 new member, adding a subsequent member led to form failure with the error "Form is Invalid. model_usage_restriction is a required field."
Now user can add multiple subsequent user without any error.
How to Test