angular update 14.1.2

This commit is contained in:
2022-08-14 23:09:05 +02:00
parent 01fb6ab144
commit 829786cbed
22 changed files with 10448 additions and 10835 deletions

View File

@@ -1,6 +1,6 @@
import {Component, Input} from '@angular/core';
import {ActivatedRoute, Router} from '@angular/router';
import {FormBuilder, FormGroup} from '@angular/forms';
import {UntypedFormBuilder, UntypedFormGroup} from '@angular/forms';
import {SongService} from '../../services/song.service';
import {FilterValues} from './filter-values';
import {Song} from '../../services/song';
@@ -12,14 +12,14 @@ import {KEYS} from '../../services/key.helper';
styleUrls: ['./filter.component.less'],
})
export class FilterComponent {
public filterFormGroup: FormGroup;
public filterFormGroup: UntypedFormGroup;
@Input() public route = '/';
@Input() public songs: Song[] = [];
public types = SongService.TYPES;
public legalType = SongService.LEGAL_TYPE;
public keys = KEYS;
public constructor(private router: Router, activatedRoute: ActivatedRoute, fb: FormBuilder) {
public constructor(private router: Router, activatedRoute: ActivatedRoute, fb: UntypedFormBuilder) {
this.filterFormGroup = fb.group({
q: '',
type: '',

View File

@@ -1,6 +1,6 @@
import {Component, OnInit} from '@angular/core';
import {Song} from '../../../services/song';
import {FormGroup} from '@angular/forms';
import {UntypedFormGroup} from '@angular/forms';
import {ActivatedRoute, Router, RouterStateSnapshot} from '@angular/router';
import {SongService} from '../../../services/song.service';
import {EditService} from '../edit.service';
@@ -19,7 +19,7 @@ import {SaveDialogComponent} from './save-dialog/save-dialog.component';
})
export class EditSongComponent implements OnInit {
public song: Song | null = null;
public form: FormGroup = new FormGroup({});
public form: UntypedFormGroup = new UntypedFormGroup({});
public keys = KEYS;
public types = SongService.TYPES;
public status = SongService.STATUS;

View File

@@ -1,30 +1,30 @@
import {Injectable} from '@angular/core';
import {Song} from '../../services/song';
import {FormControl, FormGroup} from '@angular/forms';
import {UntypedFormControl, UntypedFormGroup} from '@angular/forms';
@Injectable({
providedIn: 'root',
})
export class EditService {
public createSongForm(song: Song): FormGroup {
return new FormGroup({
text: new FormControl(song.text),
title: new FormControl(song.title),
comment: new FormControl(song.comment),
flags: new FormControl(song.flags),
key: new FormControl(song.key),
tempo: new FormControl(song.tempo),
type: new FormControl(song.type),
status: new FormControl(song.status ?? 'draft'),
public createSongForm(song: Song): UntypedFormGroup {
return new UntypedFormGroup({
text: new UntypedFormControl(song.text),
title: new UntypedFormControl(song.title),
comment: new UntypedFormControl(song.comment),
flags: new UntypedFormControl(song.flags),
key: new UntypedFormControl(song.key),
tempo: new UntypedFormControl(song.tempo),
type: new UntypedFormControl(song.type),
status: new UntypedFormControl(song.status ?? 'draft'),
legalType: new FormControl(song.legalType),
legalOwner: new FormControl(song.legalOwner),
legalOwnerId: new FormControl(song.legalOwnerId),
legalType: new UntypedFormControl(song.legalType),
legalOwner: new UntypedFormControl(song.legalOwner),
legalOwnerId: new UntypedFormControl(song.legalOwnerId),
artist: new FormControl(song.artist),
label: new FormControl(song.label),
termsOfUse: new FormControl(song.termsOfUse),
origin: new FormControl(song.origin),
artist: new UntypedFormControl(song.artist),
label: new UntypedFormControl(song.label),
termsOfUse: new UntypedFormControl(song.termsOfUse),
origin: new UntypedFormControl(song.origin),
});
}
}

View File

@@ -1,6 +1,6 @@
import {Component, OnDestroy, OnInit} from '@angular/core';
import {faSave} from '@fortawesome/free-solid-svg-icons';
import {FormControl, FormGroup, Validators} from '@angular/forms';
import {UntypedFormControl, UntypedFormGroup, Validators} from '@angular/forms';
import {SongService} from '../../services/song.service';
import {Song} from '../../services/song';
import {Router} from '@angular/router';
@@ -13,9 +13,9 @@ import {Subscription} from 'rxjs';
})
export class NewComponent implements OnInit, OnDestroy {
public faSave = faSave;
public form: FormGroup = new FormGroup({
number: new FormControl(null, Validators.required),
title: new FormControl(null, Validators.required),
public form: UntypedFormGroup = new UntypedFormGroup({
number: new UntypedFormControl(null, Validators.required),
title: new UntypedFormControl(null, Validators.required),
});
public constructor(private songService: SongService, private router: Router) {}