Skip to content

Commit

Permalink
fix all suggestions by @coderabbitai.
Browse files Browse the repository at this point in the history
  • Loading branch information
samuelmbabhazi committed Nov 15, 2024
1 parent 3df0fd1 commit ba20d53
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -205,13 +205,11 @@ export class TeamTaskDialogComponent extends TranslationBaseComponent implements
(this.selectedTeams || []).map((id) => this.teams.find((e) => e.id === id)).filter((e) => !!e)
);

this.form
.get('modules')
.setValue(
(this.selectedModules || [])
.map((id) => this.availableModules.find((e) => e.id === id))
.filter((e) => !!e)
);
const selectedModules = this.selectedModules || [];
const mappedModules = selectedModules
.map((id) => this.availableModules?.find((e) => e?.id === id))
.filter(Boolean);
this.form.get('modules')?.setValue(mappedModules);
this.form.get('status').setValue(this.form.get('taskStatus').value?.name);
this.form.get('priority').setValue(this.form.get('taskPriority').value?.name);
this.form.get('size').setValue(this.form.get('taskSize').value?.name);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -224,13 +224,11 @@ export class AddTaskDialogComponent extends TranslationBaseComponent implements
);
}

this.form
.get('modules')
.setValue(
(this.selectedModules || [])
.map((id) => this.availableModules.find((e) => e.id === id))
.filter((e) => !!e)
);
const selectedModules = this.selectedModules || [];
const mappedModules = selectedModules
.map((id) => this.availableModules?.find((e) => e?.id === id))
.filter(Boolean);
this.form.get('modules')?.setValue(mappedModules);

this.form.get('status').setValue(this.form.get('taskStatus').value?.name);
this.form.get('priority').setValue(this.form.get('taskPriority').value?.name);
Expand Down

0 comments on commit ba20d53

Please sign in to comment.