Skip to content

Commit

Permalink
update planet tag
Browse files Browse the repository at this point in the history
  • Loading branch information
RheuX committed Nov 14, 2024
1 parent a1f970e commit f00c79b
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/app/shared/forms/planet-tag-input-dialog.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,7 @@ export class PlanetTagInputDialogComponent {
this.data.initTags();
this.deleteDialog.close();
this.planetMessageService.showMessage($localize`Tag deleted: ${tag.name}`);
this.resetValidationAndCheck(this.addTagForm);
},
onError: (error) => this.planetMessageService.showAlert($localize`There was a problem deleting this tag.`)
};
Expand Down Expand Up @@ -230,6 +231,15 @@ export class PlanetTagInputDialogComponent {
);
}

resetValidationAndCheck(form: FormGroup) {
Object.keys(form.controls).forEach(key => {
const control = form.get(key);
control?.clearValidators();
control?.markAsUntouched();
control?.updateValueAndValidity();
});
}

toggleSubcollection(event, tagId) {
event.stopPropagation();
const newState = !this.subcollectionIsOpen.get(tagId);
Expand Down

0 comments on commit f00c79b

Please sign in to comment.