Skip to content

Conversation

@Saby-Bishops
Copy link
Member

fixes #9327

Summary

  • replace the untyped form builder with typed non-nullable controls for the rename dialog
  • add a typed interface for the dialog form value and use the strongly typed raw value when saving
  • ensure async validators receive typed controls

Codex Task

@Saby-Bishops Saby-Bishops marked this pull request as ready for review November 21, 2025 20:33
Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a 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".

Comment on lines 222 to 226
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) }

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge 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 👍 / 👎.

Comment on lines 231 to +233
editChildName({ doc, nameDoc }) {
return (form) => {
return (form: EditChildNameFormGroup) => {
const { name } = form.getRawValue();

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge 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 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

src/app/manager-dashboard/requests/requests-table.component.ts

2 participants