-
Notifications
You must be signed in to change notification settings - Fork 43
src/app/manager-dashboard/requests/requests-table.component.ts (fixes #9327) #9328
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
src/app/manager-dashboard/requests/requests-table.component.ts (fixes #9327) #9328
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Codex Review
Here are some automated review suggestions for this pull request.
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| this.dialogsFormService.openDialogsForm( | ||
| $localize`Edit ${this.reportsService.planetTypeText(planet.doc.planetType)} Name`, | ||
| [ { 'label': $localize`Name`, 'type': 'textbox', 'name': 'name', 'placeholder': $localize`Name`, 'required': true } ], | ||
| this.fb.group({ name: [ | ||
| planet.nameDoc ? planet.nameDoc.name : planet.doc.name, | ||
| CustomValidators.required, | ||
| ac => this.validatorService.isUnique$(this.dbName, 'name', ac, { exceptions }) | ||
| ] }), | ||
| form, | ||
| { onSubmit: this.editChildName(planet).bind(this) } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pass compatible form instance to dialog service
The rename dialog now passes a typed FormGroup (form) into openDialogsForm, but DialogsFormComponent only uses the provided group directly when it is an UntypedFormGroup; otherwise it rebuilds it via fb.group (dialogs-form.component.ts:56-60). A typed form therefore gets treated as a plain config object, producing controls for FormGroup internals rather than the name control, so the dialog renders/validates incorrectly and cannot submit. Please supply an UntypedFormGroup or update the dialog to accept typed groups before opening the rename modal.
Useful? React with 👍 / 👎.
| editChildName({ doc, nameDoc }) { | ||
| return (form) => { | ||
| return (form: EditChildNameFormGroup) => { | ||
| const { name } = form.getRawValue(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix rename submit handler expecting FormGroup
The new editChildName callback now expects the FormGroup and calls form.getRawValue(), but DialogsFormComponent invokes onSubmit with the form value object as the first argument (dialogs-form.component.ts:77–80). When the rename dialog is submitted, this function receives the plain value object and throws because getRawValue is undefined, so the update request never runs. Use the mForm argument passed by the dialog or operate on the value object instead of calling FormGroup methods.
Useful? React with 👍 / 👎.
fixes #9327
Summary
Codex Task