fix: rename form output bindings to avoid DOM event conflicts
Node.js CI / CI (pull_request) Successful in 1m22s
Security Scan and Upload / Security & DefectDojo Upload (pull_request) Successful in 1m26s

Renamed @Output() properties in all form components from 'save' and
'cancel' to 'formSubmit' and 'formCancel' to resolve ESLint rule
@angular-eslint/no-output-native which prohibits output bindings
named after standard DOM events.

Updated all template bindings in detail components and admin
suggestions to use the new output names.

- Renamed save → formSubmit in all 6 form components
- Renamed cancel → formCancel in all 6 form components
- Updated bindings in 6 detail components
- Updated bindings in admin suggestions component
This commit is contained in:
2026-02-20 20:26:32 -08:00
committed by Naomi Carrigan
parent 536cf6e7f9
commit 309a20f694
13 changed files with 48 additions and 48 deletions
@@ -244,8 +244,8 @@ import { Suggestion, SuggestionStatus, SuggestionEntity, CreateGameDto, UpdateGa
<app-game-form <app-game-form
mode="add" mode="add"
[initialData]="getGameInitialData(editingSuggestion()!)" [initialData]="getGameInitialData(editingSuggestion()!)"
(save)="saveGameFromSuggestion($event)" (formSubmit)="saveGameFromSuggestion($event)"
(cancel)="closeEditModal()" (formCancel)="closeEditModal()"
></app-game-form> ></app-game-form>
} @else if (editingSuggestion()!.entityType === SuggestionEntity.book) { } @else if (editingSuggestion()!.entityType === SuggestionEntity.book) {
<h3>Review & Edit Book Before Accepting</h3> <h3>Review & Edit Book Before Accepting</h3>
@@ -253,8 +253,8 @@ import { Suggestion, SuggestionStatus, SuggestionEntity, CreateGameDto, UpdateGa
<app-book-form <app-book-form
mode="add" mode="add"
[initialData]="getBookInitialData(editingSuggestion()!)" [initialData]="getBookInitialData(editingSuggestion()!)"
(save)="saveBookFromSuggestion($event)" (formSubmit)="saveBookFromSuggestion($event)"
(cancel)="closeEditModal()" (formCancel)="closeEditModal()"
></app-book-form> ></app-book-form>
} @else if (editingSuggestion()!.entityType === SuggestionEntity.music) { } @else if (editingSuggestion()!.entityType === SuggestionEntity.music) {
<h3>Review & Edit Music Before Accepting</h3> <h3>Review & Edit Music Before Accepting</h3>
@@ -262,8 +262,8 @@ import { Suggestion, SuggestionStatus, SuggestionEntity, CreateGameDto, UpdateGa
<app-music-form <app-music-form
mode="add" mode="add"
[initialData]="getMusicInitialData(editingSuggestion()!)" [initialData]="getMusicInitialData(editingSuggestion()!)"
(save)="saveMusicFromSuggestion($event)" (formSubmit)="saveMusicFromSuggestion($event)"
(cancel)="closeEditModal()" (formCancel)="closeEditModal()"
></app-music-form> ></app-music-form>
} @else if (editingSuggestion()!.entityType === SuggestionEntity.show) { } @else if (editingSuggestion()!.entityType === SuggestionEntity.show) {
<h3>Review & Edit Show Before Accepting</h3> <h3>Review & Edit Show Before Accepting</h3>
@@ -271,8 +271,8 @@ import { Suggestion, SuggestionStatus, SuggestionEntity, CreateGameDto, UpdateGa
<app-show-form <app-show-form
mode="add" mode="add"
[initialData]="getShowInitialData(editingSuggestion()!)" [initialData]="getShowInitialData(editingSuggestion()!)"
(save)="saveShowFromSuggestion($event)" (formSubmit)="saveShowFromSuggestion($event)"
(cancel)="closeEditModal()" (formCancel)="closeEditModal()"
></app-show-form> ></app-show-form>
} @else if (editingSuggestion()!.entityType === SuggestionEntity.manga) { } @else if (editingSuggestion()!.entityType === SuggestionEntity.manga) {
<h3>Review & Edit Manga Before Accepting</h3> <h3>Review & Edit Manga Before Accepting</h3>
@@ -280,8 +280,8 @@ import { Suggestion, SuggestionStatus, SuggestionEntity, CreateGameDto, UpdateGa
<app-manga-form <app-manga-form
mode="add" mode="add"
[initialData]="getMangaInitialData(editingSuggestion()!)" [initialData]="getMangaInitialData(editingSuggestion()!)"
(save)="saveMangaFromSuggestion($event)" (formSubmit)="saveMangaFromSuggestion($event)"
(cancel)="closeEditModal()" (formCancel)="closeEditModal()"
></app-manga-form> ></app-manga-form>
} @else if (editingSuggestion()!.entityType === SuggestionEntity.art) { } @else if (editingSuggestion()!.entityType === SuggestionEntity.art) {
<h3>Review & Edit Art Before Accepting</h3> <h3>Review & Edit Art Before Accepting</h3>
@@ -289,8 +289,8 @@ import { Suggestion, SuggestionStatus, SuggestionEntity, CreateGameDto, UpdateGa
<app-art-form <app-art-form
mode="add" mode="add"
[initialData]="getArtInitialData(editingSuggestion()!)" [initialData]="getArtInitialData(editingSuggestion()!)"
(save)="saveArtFromSuggestion($event)" (formSubmit)="saveArtFromSuggestion($event)"
(cancel)="closeEditModal()" (formCancel)="closeEditModal()"
></app-art-form> ></app-art-form>
} }
} }
@@ -31,8 +31,8 @@ import { Art, Comment, UpdateArtDto } from '@library/shared-types';
<app-art-form <app-art-form
mode="edit" mode="edit"
[art]="art()!" [art]="art()!"
(save)="saveEdit($event)" (formSubmit)="saveEdit($event)"
(cancel)="cancelEdit()" (formCancel)="cancelEdit()"
></app-art-form> ></app-art-form>
} }
@@ -31,8 +31,8 @@ import { Book, Comment, BookStatus, UpdateBookDto } from '@library/shared-types'
<app-book-form <app-book-form
mode="edit" mode="edit"
[book]="book()!" [book]="book()!"
(save)="saveEdit($event)" (formSubmit)="saveEdit($event)"
(cancel)="cancelEdit()" (formCancel)="cancelEdit()"
></app-book-form> ></app-book-form>
} }
@@ -60,8 +60,8 @@ import { Game, Comment, GameStatus, UpdateGameDto } from '@library/shared-types'
<app-game-form <app-game-form
mode="edit" mode="edit"
[game]="game()!" [game]="game()!"
(save)="saveEdit($event)" (formSubmit)="saveEdit($event)"
(cancel)="cancelEdit()" (formCancel)="cancelEdit()"
></app-game-form> ></app-game-form>
} }
@@ -31,8 +31,8 @@ import { Manga, Comment, MangaStatus, UpdateMangaDto } from '@library/shared-typ
<app-manga-form <app-manga-form
mode="edit" mode="edit"
[manga]="manga()!" [manga]="manga()!"
(save)="saveEdit($event)" (formSubmit)="saveEdit($event)"
(cancel)="cancelEdit()" (formCancel)="cancelEdit()"
></app-manga-form> ></app-manga-form>
} }
@@ -31,8 +31,8 @@ import { Music, Comment, MusicStatus, MusicType, UpdateMusicDto } from '@library
<app-music-form <app-music-form
mode="edit" mode="edit"
[music]="music()!" [music]="music()!"
(save)="saveEdit($event)" (formSubmit)="saveEdit($event)"
(cancel)="cancelEdit()" (formCancel)="cancelEdit()"
></app-music-form> ></app-music-form>
} }
@@ -290,8 +290,8 @@ export class ArtFormComponent implements OnInit {
@Input() mode: 'add' | 'edit' = 'add'; @Input() mode: 'add' | 'edit' = 'add';
@Input() art?: Art; @Input() art?: Art;
@Input() initialData?: Partial<CreateArtDto>; @Input() initialData?: Partial<CreateArtDto>;
@Output() save = new EventEmitter<CreateArtDto | UpdateArtDto>(); @Output() formSubmit = new EventEmitter<CreateArtDto | UpdateArtDto>();
@Output() cancel = new EventEmitter<void>(); @Output() formCancel = new EventEmitter<void>();
formData: Partial<CreateArtDto | UpdateArtDto> = { formData: Partial<CreateArtDto | UpdateArtDto> = {
tags: [], tags: [],
@@ -396,10 +396,10 @@ export class ArtFormComponent implements OnInit {
...this.formData as CreateArtDto | UpdateArtDto ...this.formData as CreateArtDto | UpdateArtDto
}; };
this.save.emit(data); this.formSubmit.emit(data);
} }
onCancel() { onCancel() {
this.cancel.emit(); this.formCancel.emit();
} }
} }
@@ -404,8 +404,8 @@ export class BookFormComponent implements OnInit {
@Input() mode: 'add' | 'edit' = 'add'; @Input() mode: 'add' | 'edit' = 'add';
@Input() book?: Book; @Input() book?: Book;
@Input() initialData?: Partial<CreateBookDto>; @Input() initialData?: Partial<CreateBookDto>;
@Output() save = new EventEmitter<CreateBookDto | UpdateBookDto>(); @Output() formSubmit = new EventEmitter<CreateBookDto | UpdateBookDto>();
@Output() cancel = new EventEmitter<void>(); @Output() formCancel = new EventEmitter<void>();
BookStatus = BookStatus; BookStatus = BookStatus;
@@ -534,10 +534,10 @@ export class BookFormComponent implements OnInit {
dateFinished: this.formData.dateFinished ? new Date(this.formData.dateFinished) : undefined dateFinished: this.formData.dateFinished ? new Date(this.formData.dateFinished) : undefined
}; };
this.save.emit(data); this.formSubmit.emit(data);
} }
onCancel() { onCancel() {
this.cancel.emit(); this.formCancel.emit();
} }
} }
@@ -392,8 +392,8 @@ export class GameFormComponent implements OnInit {
@Input() mode: 'add' | 'edit' = 'add'; @Input() mode: 'add' | 'edit' = 'add';
@Input() game?: Game; @Input() game?: Game;
@Input() initialData?: Partial<CreateGameDto>; @Input() initialData?: Partial<CreateGameDto>;
@Output() save = new EventEmitter<CreateGameDto | UpdateGameDto>(); @Output() formSubmit = new EventEmitter<CreateGameDto | UpdateGameDto>();
@Output() cancel = new EventEmitter<void>(); @Output() formCancel = new EventEmitter<void>();
GameStatus = GameStatus; GameStatus = GameStatus;
@@ -522,10 +522,10 @@ export class GameFormComponent implements OnInit {
dateFinished: this.formData.dateFinished ? new Date(this.formData.dateFinished) : undefined dateFinished: this.formData.dateFinished ? new Date(this.formData.dateFinished) : undefined
}; };
this.save.emit(data); this.formSubmit.emit(data);
} }
onCancel() { onCancel() {
this.cancel.emit(); this.formCancel.emit();
} }
} }
@@ -370,8 +370,8 @@ export class MangaFormComponent implements OnInit {
@Input() mode: 'add' | 'edit' = 'add'; @Input() mode: 'add' | 'edit' = 'add';
@Input() manga?: Manga; @Input() manga?: Manga;
@Input() initialData?: Partial<CreateMangaDto>; @Input() initialData?: Partial<CreateMangaDto>;
@Output() save = new EventEmitter<CreateMangaDto | UpdateMangaDto>(); @Output() formSubmit = new EventEmitter<CreateMangaDto | UpdateMangaDto>();
@Output() cancel = new EventEmitter<void>(); @Output() formCancel = new EventEmitter<void>();
MangaStatus = MangaStatus; MangaStatus = MangaStatus;
@@ -497,10 +497,10 @@ export class MangaFormComponent implements OnInit {
dateFinished: this.formData.dateFinished ? new Date(this.formData.dateFinished) : undefined dateFinished: this.formData.dateFinished ? new Date(this.formData.dateFinished) : undefined
}; };
this.save.emit(data); this.formSubmit.emit(data);
} }
onCancel() { onCancel() {
this.cancel.emit(); this.formCancel.emit();
} }
} }
@@ -379,8 +379,8 @@ export class MusicFormComponent implements OnInit {
@Input() mode: 'add' | 'edit' = 'add'; @Input() mode: 'add' | 'edit' = 'add';
@Input() music?: Music; @Input() music?: Music;
@Input() initialData?: Partial<CreateMusicDto>; @Input() initialData?: Partial<CreateMusicDto>;
@Output() save = new EventEmitter<CreateMusicDto | UpdateMusicDto>(); @Output() formSubmit = new EventEmitter<CreateMusicDto | UpdateMusicDto>();
@Output() cancel = new EventEmitter<void>(); @Output() formCancel = new EventEmitter<void>();
MusicStatus = MusicStatus; MusicStatus = MusicStatus;
MusicType = MusicType; MusicType = MusicType;
@@ -509,10 +509,10 @@ export class MusicFormComponent implements OnInit {
dateFinished: this.formData.dateFinished ? new Date(this.formData.dateFinished) : undefined dateFinished: this.formData.dateFinished ? new Date(this.formData.dateFinished) : undefined
}; };
this.save.emit(data); this.formSubmit.emit(data);
} }
onCancel() { onCancel() {
this.cancel.emit(); this.formCancel.emit();
} }
} }
@@ -368,8 +368,8 @@ export class ShowFormComponent implements OnInit {
@Input() mode: 'add' | 'edit' = 'add'; @Input() mode: 'add' | 'edit' = 'add';
@Input() show?: Show; @Input() show?: Show;
@Input() initialData?: Partial<CreateShowDto>; @Input() initialData?: Partial<CreateShowDto>;
@Output() save = new EventEmitter<CreateShowDto | UpdateShowDto>(); @Output() formSubmit = new EventEmitter<CreateShowDto | UpdateShowDto>();
@Output() cancel = new EventEmitter<void>(); @Output() formCancel = new EventEmitter<void>();
ShowStatus = ShowStatus; ShowStatus = ShowStatus;
ShowType = ShowType; ShowType = ShowType;
@@ -497,10 +497,10 @@ export class ShowFormComponent implements OnInit {
dateFinished: this.formData.dateFinished ? new Date(this.formData.dateFinished) : undefined dateFinished: this.formData.dateFinished ? new Date(this.formData.dateFinished) : undefined
}; };
this.save.emit(data); this.formSubmit.emit(data);
} }
onCancel() { onCancel() {
this.cancel.emit(); this.formCancel.emit();
} }
} }
@@ -31,8 +31,8 @@ import { Show, Comment, ShowStatus, ShowType, UpdateShowDto } from '@library/sha
<app-show-form <app-show-form
mode="edit" mode="edit"
[show]="show()!" [show]="show()!"
(save)="saveEdit($event)" (formSubmit)="saveEdit($event)"
(cancel)="cancelEdit()" (formCancel)="cancelEdit()"
></app-show-form> ></app-show-form>
} }