fix(web): forms open as new, not touched from the last time
Opening a drawer form refilled its model only, so a field touched the time before came back showing its errors. They reset the form state now (touched and dirty) along with the values. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -792,7 +792,7 @@ export class BoardPage {
|
|||||||
);
|
);
|
||||||
if (this.project.workflow().requiresReason(to)) {
|
if (this.project.workflow().requiresReason(to)) {
|
||||||
this.pendingMove = { issueId, to };
|
this.pendingMove = { issueId, to };
|
||||||
this.reasonModel.set({ text: '' });
|
this.reason().reset({ text: '' });
|
||||||
this.drawer.open(`Mover a «${this.statusLabel(to)}»`, this.reasonForm());
|
this.drawer.open(`Mover a «${this.statusLabel(to)}»`, this.reasonForm());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -886,7 +886,7 @@ export class BoardPage {
|
|||||||
const types = this.typeOptions();
|
const types = this.typeOptions();
|
||||||
if (!types.some((t) => t.value === this.newType()))
|
if (!types.some((t) => t.value === this.newType()))
|
||||||
this.newType.set(types[0]?.value ?? '');
|
this.newType.set(types[0]?.value ?? '');
|
||||||
this.model.set({
|
this.f().reset({
|
||||||
title: '',
|
title: '',
|
||||||
description: '',
|
description: '',
|
||||||
figmaUrl: '',
|
figmaUrl: '',
|
||||||
|
|||||||
@@ -1369,7 +1369,7 @@ export class IssuePage {
|
|||||||
protected move(to: string): void {
|
protected move(to: string): void {
|
||||||
if (this.project.workflow().requiresReason(to)) {
|
if (this.project.workflow().requiresReason(to)) {
|
||||||
this.pendingStatus = to;
|
this.pendingStatus = to;
|
||||||
this.reasonModel.set({ text: '' });
|
this.reason().reset({ text: '' });
|
||||||
this.drawer.open(`Mover a «${this.statusLabel(to)}»`, this.reasonForm());
|
this.drawer.open(`Mover a «${this.statusLabel(to)}»`, this.reasonForm());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -1547,7 +1547,7 @@ export class IssuePage {
|
|||||||
|
|
||||||
protected openEditComment(comment: Comment): void {
|
protected openEditComment(comment: Comment): void {
|
||||||
this.editingComment = comment.id;
|
this.editingComment = comment.id;
|
||||||
this.commentEditModel.set({ body: comment.body });
|
this.commentEdit().reset({ body: comment.body });
|
||||||
this.trackEditing(
|
this.trackEditing(
|
||||||
this.drawer.open('Editar comentario', this.commentEditForm()),
|
this.drawer.open('Editar comentario', this.commentEditForm()),
|
||||||
);
|
);
|
||||||
@@ -1567,7 +1567,7 @@ export class IssuePage {
|
|||||||
protected openEdit(): void {
|
protected openEdit(): void {
|
||||||
const issue = this.facade.issue();
|
const issue = this.facade.issue();
|
||||||
if (!issue) return;
|
if (!issue) return;
|
||||||
this.editModel.set({
|
this.edit().reset({
|
||||||
title: issue.title,
|
title: issue.title,
|
||||||
description: issue.description ?? '',
|
description: issue.description ?? '',
|
||||||
labels: issue.labels.join(', '),
|
labels: issue.labels.join(', '),
|
||||||
|
|||||||
@@ -385,7 +385,7 @@ export class ProjectsPage implements OnInit {
|
|||||||
}
|
}
|
||||||
|
|
||||||
protected openCreate(): void {
|
protected openCreate(): void {
|
||||||
this.model.set({
|
this.f().reset({
|
||||||
key: '',
|
key: '',
|
||||||
name: '',
|
name: '',
|
||||||
description: '',
|
description: '',
|
||||||
|
|||||||
@@ -422,7 +422,7 @@ export class ReleasesPage {
|
|||||||
protected readonly when = releaseWhen;
|
protected readonly when = releaseWhen;
|
||||||
|
|
||||||
protected openCreate(): void {
|
protected openCreate(): void {
|
||||||
this.model.set({ name: '', description: '', targetDate: '' });
|
this.f().reset({ name: '', description: '', targetDate: '' });
|
||||||
this.drawer.open('Nueva release', this.createForm());
|
this.drawer.open('Nueva release', this.createForm());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user