auto migrate standalone components

This commit is contained in:
2025-01-05 10:26:35 +01:00
parent 8b8395fc3c
commit 54ee9a5b11
121 changed files with 947 additions and 685 deletions

View File

@@ -9,8 +9,8 @@ describe('FilterComponent', () => {
beforeEach(
waitForAsync(() => {
void TestBed.configureTestingModule({
declarations: [FilterComponent],
}).compileComponents();
imports: [FilterComponent],
}).compileComponents();
}),
);

View File

@@ -1,16 +1,35 @@
import {Component, Input} from '@angular/core';
import {ActivatedRoute, Router} from '@angular/router';
import {UntypedFormBuilder, UntypedFormGroup} from '@angular/forms';
import { UntypedFormBuilder, UntypedFormGroup, ReactiveFormsModule } from '@angular/forms';
import {SongService} from '../../services/song.service';
import {FilterValues} from './filter-values';
import {Song} from '../../services/song';
import {KEYS} from '../../services/key.helper';
import { MatFormField, MatLabel } from '@angular/material/form-field';
import { MatInput } from '@angular/material/input';
import { MatSelect } from '@angular/material/select';
import { MatOption } from '@angular/material/core';
import { NgFor } from '@angular/common';
import { LegalTypePipe } from '../../../../widget-modules/pipes/legal-type-translator/legal-type.pipe';
import { KeyPipe } from '../../../../widget-modules/pipes/key-translator/key.pipe';
import { SongTypePipe } from '../../../../widget-modules/pipes/song-type-translater/song-type.pipe';
@Component({
selector: 'app-filter',
templateUrl: './filter.component.html',
styleUrls: ['./filter.component.less'],
standalone: false,
selector: 'app-filter',
templateUrl: './filter.component.html',
styleUrls: ['./filter.component.less'],
imports: [
ReactiveFormsModule,
MatFormField,
MatLabel,
MatInput,
MatSelect,
MatOption,
NgFor,
LegalTypePipe,
KeyPipe,
SongTypePipe,
],
})
export class FilterComponent {
public filterFormGroup: UntypedFormGroup;

View File

@@ -18,10 +18,10 @@ describe('SongListComponent', () => {
beforeEach(
waitForAsync(() => {
void TestBed.configureTestingModule({
declarations: [SongListComponent],
providers: [{provide: SongService, useValue: mockSongService}],
schemas: [NO_ERRORS_SCHEMA],
}).compileComponents();
imports: [SongListComponent],
providers: [{ provide: SongService, useValue: mockSongService }],
schemas: [NO_ERRORS_SCHEMA],
}).compileComponents();
}),
);

View File

@@ -4,19 +4,35 @@ import {Song} from '../services/song';
import {map} from 'rxjs/operators';
import {combineLatest, Observable} from 'rxjs';
import {fade} from '../../../animations';
import {ActivatedRoute} from '@angular/router';
import { ActivatedRoute, RouterLink } from '@angular/router';
import {filterSong} from '../../../services/filter.helper';
import {FilterValues} from './filter/filter-values';
import {ScrollService} from '../../../services/scroll.service';
import {faBalanceScaleRight, faCheck, faPencilRuler} from '@fortawesome/free-solid-svg-icons';
import { NgIf, NgFor, AsyncPipe } from '@angular/common';
import { ListHeaderComponent } from '../../../widget-modules/components/list-header/list-header.component';
import { FilterComponent } from './filter/filter.component';
import { CardComponent } from '../../../widget-modules/components/card/card.component';
import { RoleDirective } from '../../../services/user/role.directive';
import { FaIconComponent } from '@fortawesome/angular-fontawesome';
@Component({
selector: 'app-songs',
templateUrl: './song-list.component.html',
styleUrls: ['./song-list.component.less'],
changeDetection: ChangeDetectionStrategy.OnPush,
animations: [fade],
standalone: false,
selector: 'app-songs',
templateUrl: './song-list.component.html',
styleUrls: ['./song-list.component.less'],
changeDetection: ChangeDetectionStrategy.OnPush,
animations: [fade],
imports: [
NgIf,
ListHeaderComponent,
FilterComponent,
CardComponent,
NgFor,
RouterLink,
RoleDirective,
FaIconComponent,
AsyncPipe,
],
})
export class SongListComponent implements OnInit, OnDestroy {
public anyFilterActive = false;

View File

@@ -1,40 +0,0 @@
import {NgModule} from '@angular/core';
import {CommonModule} from '@angular/common';
import {SongListComponent} from './song-list.component';
import {CardModule} from '../../../widget-modules/components/card/card.module';
import {RouterModule} from '@angular/router';
import {ListHeaderModule} from '../../../widget-modules/components/list-header/list-header.module';
import {MatFormFieldModule} from '@angular/material/form-field';
import {MatInputModule} from '@angular/material/input';
import {FilterComponent} from './filter/filter.component';
import {ReactiveFormsModule} from '@angular/forms';
import {MatSelectModule} from '@angular/material/select';
import {FontAwesomeModule} from '@fortawesome/angular-fontawesome';
import {MatTooltipModule} from '@angular/material/tooltip';
import {RoleModule} from '../../../services/user/role.module';
import {KeyPipe} from '../../../widget-modules/pipes/key-translator/key.pipe';
import {LegalTypePipe} from '../../../widget-modules/pipes/legal-type-translator/legal-type.pipe';
import {SongTypePipe} from '../../../widget-modules/pipes/song-type-translater/song-type.pipe';
@NgModule({
declarations: [SongListComponent, FilterComponent],
exports: [SongListComponent],
imports: [
CommonModule,
RouterModule,
CardModule,
LegalTypePipe,
ListHeaderModule,
MatFormFieldModule,
MatInputModule,
ReactiveFormsModule,
MatSelectModule,
FontAwesomeModule,
MatTooltipModule,
RoleModule,
KeyPipe,
SongTypePipe,
],
})
export class SongListModule {}

View File

@@ -9,8 +9,8 @@ describe('EditFileComponent', () => {
beforeEach(
waitForAsync(() => {
void TestBed.configureTestingModule({
declarations: [EditFileComponent],
}).compileComponents();
imports: [EditFileComponent],
}).compileComponents();
}),
);

View File

@@ -6,12 +6,26 @@ import {map, switchMap} from 'rxjs/operators';
import {FileDataService} from '../../../services/file-data.service';
import {Observable} from 'rxjs';
import {File} from '../../../services/file';
import { CardComponent } from '../../../../../widget-modules/components/card/card.component';
import { NgIf, NgStyle, NgFor, AsyncPipe } from '@angular/common';
import { MatIconButton } from '@angular/material/button';
import { MatIcon } from '@angular/material/icon';
import { FileComponent } from './file/file.component';
@Component({
selector: 'app-edit-file',
templateUrl: './edit-file.component.html',
styleUrls: ['./edit-file.component.less'],
standalone: false,
selector: 'app-edit-file',
templateUrl: './edit-file.component.html',
styleUrls: ['./edit-file.component.less'],
imports: [
CardComponent,
NgIf,
NgStyle,
MatIconButton,
MatIcon,
NgFor,
FileComponent,
AsyncPipe,
],
})
export class EditFileComponent {
public selectedFiles: FileList | null = null;

View File

@@ -9,8 +9,8 @@ describe('FileComponent', () => {
beforeEach(
waitForAsync(() => {
void TestBed.configureTestingModule({
declarations: [FileComponent],
}).compileComponents();
imports: [FileComponent],
}).compileComponents();
}),
);

View File

@@ -3,12 +3,19 @@ import {Observable} from 'rxjs';
import {File} from '../../../../services/file';
import {faTrashAlt} from '@fortawesome/free-solid-svg-icons';
import {FileService} from '../../../../services/file.service';
import { MatIconButton } from '@angular/material/button';
import { FaIconComponent } from '@fortawesome/angular-fontawesome';
import { AsyncPipe } from '@angular/common';
@Component({
selector: 'app-file',
templateUrl: './file.component.html',
styleUrls: ['./file.component.less'],
standalone: false,
selector: 'app-file',
templateUrl: './file.component.html',
styleUrls: ['./file.component.less'],
imports: [
MatIconButton,
FaIconComponent,
AsyncPipe,
],
})
export class FileComponent {
public url$: Observable<string> | null = null;

View File

@@ -9,8 +9,8 @@ describe('EditSongComponent', () => {
beforeEach(
waitForAsync(() => {
void TestBed.configureTestingModule({
declarations: [EditSongComponent],
}).compileComponents();
imports: [EditSongComponent],
}).compileComponents();
}),
);

View File

@@ -1,22 +1,64 @@
import {Component, OnInit} from '@angular/core';
import {Song} from '../../../services/song';
import {UntypedFormGroup} from '@angular/forms';
import { UntypedFormGroup, ReactiveFormsModule } from '@angular/forms';
import {ActivatedRoute, Router, RouterStateSnapshot} from '@angular/router';
import {SongService} from '../../../services/song.service';
import {EditService} from '../edit.service';
import {first, map, switchMap} from 'rxjs/operators';
import {KEYS} from '../../../services/key.helper';
import {COMMA, ENTER} from '@angular/cdk/keycodes';
import {MatChipInputEvent} from '@angular/material/chips';
import { MatChipInputEvent, MatChipGrid, MatChipRow, MatChipInput } from '@angular/material/chips';
import {faExternalLinkAlt, faSave, faTimesCircle} from '@fortawesome/free-solid-svg-icons';
import {MatDialog} from '@angular/material/dialog';
import {SaveDialogComponent} from './save-dialog/save-dialog.component';
import { NgIf, NgFor } from '@angular/common';
import { CardComponent } from '../../../../../widget-modules/components/card/card.component';
import { MatFormField, MatLabel, MatSuffix } from '@angular/material/form-field';
import { MatInput } from '@angular/material/input';
import { MatSelect } from '@angular/material/select';
import { MatOption } from '@angular/material/core';
import { CdkTextareaAutosize } from '@angular/cdk/text-field';
import { SongTextComponent } from '../../../../../widget-modules/components/song-text/song-text.component';
import { FaIconComponent } from '@fortawesome/angular-fontawesome';
import { MatTooltip } from '@angular/material/tooltip';
import { ButtonRowComponent } from '../../../../../widget-modules/components/button-row/button-row.component';
import { ButtonComponent } from '../../../../../widget-modules/components/button/button.component';
import { SongTypePipe } from '../../../../../widget-modules/pipes/song-type-translater/song-type.pipe';
import { LegalOwnerPipe } from '../../../../../widget-modules/pipes/legal-owner-translator/legal-owner.pipe';
import { LegalTypePipe } from '../../../../../widget-modules/pipes/legal-type-translator/legal-type.pipe';
import { KeyPipe } from '../../../../../widget-modules/pipes/key-translator/key.pipe';
import { StatusPipe } from '../../../../../widget-modules/pipes/status-translater/status.pipe';
@Component({
selector: 'app-edit-song',
templateUrl: './edit-song.component.html',
styleUrls: ['./edit-song.component.less'],
standalone: false,
selector: 'app-edit-song',
templateUrl: './edit-song.component.html',
styleUrls: ['./edit-song.component.less'],
imports: [
NgIf,
CardComponent,
ReactiveFormsModule,
MatFormField,
MatLabel,
MatInput,
MatSelect,
NgFor,
MatOption,
CdkTextareaAutosize,
SongTextComponent,
MatChipGrid,
MatChipRow,
FaIconComponent,
MatChipInput,
MatSuffix,
MatTooltip,
ButtonRowComponent,
ButtonComponent,
SongTypePipe,
LegalOwnerPipe,
LegalTypePipe,
KeyPipe,
StatusPipe,
],
})
export class EditSongComponent implements OnInit {
public song: Song | null = null;

View File

@@ -9,8 +9,8 @@ describe('SaveDialogComponent', () => {
beforeEach(
waitForAsync(() => {
void TestBed.configureTestingModule({
declarations: [SaveDialogComponent],
}).compileComponents();
declarations: [SaveDialogComponent],
}).compileComponents();
}),
);

View File

@@ -9,8 +9,8 @@ describe('EditComponent', () => {
beforeEach(
waitForAsync(() => {
void TestBed.configureTestingModule({
declarations: [EditComponent],
}).compileComponents();
imports: [EditComponent],
}).compileComponents();
}),
);

View File

@@ -1,11 +1,17 @@
import {Component, ViewChild} from '@angular/core';
import {EditSongComponent} from './edit-song/edit-song.component';
import { EditFileComponent } from './edit-file/edit-file.component';
import { HistoryComponent } from './history/history.component';
@Component({
selector: 'app-edit',
templateUrl: './edit.component.html',
styleUrls: ['./edit.component.less'],
standalone: false,
selector: 'app-edit',
templateUrl: './edit.component.html',
styleUrls: ['./edit.component.less'],
imports: [
EditSongComponent,
EditFileComponent,
HistoryComponent,
],
})
export class EditComponent {
@ViewChild(EditSongComponent) public editSongComponent: EditSongComponent | null = null;

View File

@@ -1,13 +1,13 @@
import {NgModule} from '@angular/core';
import {CommonModule} from '@angular/common';
import {EditComponent} from './edit.component';
import {CardModule} from '../../../../widget-modules/components/card/card.module';
import {ReactiveFormsModule} from '@angular/forms';
import {MatInputModule} from '@angular/material/input';
import {MatCheckboxModule} from '@angular/material/checkbox';
import {MatSelectModule} from '@angular/material/select';
import {MatButtonModule} from '@angular/material/button';
import {ButtonRowModule} from '../../../../widget-modules/components/button-row/button-row.module';
import {RouterModule} from '@angular/router';
import {EditSongComponent} from './edit-song/edit-song.component';
import {EditFileComponent} from './edit-file/edit-file.component';
@@ -15,7 +15,7 @@ import {MatIconModule} from '@angular/material/icon';
import {FileComponent} from './edit-file/file/file.component';
import {MatChipsModule} from '@angular/material/chips';
import {FontAwesomeModule} from '@fortawesome/angular-fontawesome';
import {ButtonModule} from '../../../../widget-modules/components/button/button.module';
import {MatTooltipModule} from '@angular/material/tooltip';
import {SaveDialogComponent} from './edit-song/save-dialog/save-dialog.component';
import {MatDialogModule} from '@angular/material/dialog';
@@ -28,22 +28,18 @@ import {SongTypePipe} from '../../../../widget-modules/pipes/song-type-translate
import {StatusPipe} from '../../../../widget-modules/pipes/status-translater/status.pipe';
@NgModule({
declarations: [EditComponent, EditSongComponent, EditFileComponent, FileComponent, SaveDialogComponent, HistoryComponent],
exports: [EditComponent],
bootstrap: [SaveDialogComponent],
imports: [
declarations: [SaveDialogComponent],
exports: [EditComponent],
bootstrap: [SaveDialogComponent],
imports: [
CommonModule,
CardModule,
SongTypePipe,
ReactiveFormsModule,
RouterModule,
MatInputModule,
MatButtonModule,
MatCheckboxModule,
MatSelectModule,
ButtonRowModule,
MatIconModule,
LegalOwnerPipe,
LegalTypePipe,
@@ -51,10 +47,10 @@ import {StatusPipe} from '../../../../widget-modules/pipes/status-translater/sta
MatChipsModule,
FontAwesomeModule,
StatusPipe,
ButtonModule,
MatTooltipModule,
MatDialogModule,
SongTextComponent,
],
EditComponent, EditSongComponent, EditFileComponent, FileComponent, HistoryComponent,
],
})
export class EditModule {}

View File

@@ -9,8 +9,8 @@ describe('HistoryComponent', () => {
beforeEach(
waitForAsync(() => {
void TestBed.configureTestingModule({
declarations: [HistoryComponent],
}).compileComponents();
imports: [HistoryComponent],
}).compileComponents();
}),
);

View File

@@ -3,12 +3,19 @@ import {first, map, switchMap} from 'rxjs/operators';
import {ActivatedRoute} from '@angular/router';
import {SongService} from '../../../services/song.service';
import {Song} from '../../../services/song';
import { NgIf, NgFor, DatePipe } from '@angular/common';
import { CardComponent } from '../../../../../widget-modules/components/card/card.component';
@Component({
selector: 'app-history',
templateUrl: './history.component.html',
styleUrls: ['./history.component.less'],
standalone: false,
selector: 'app-history',
templateUrl: './history.component.html',
styleUrls: ['./history.component.less'],
imports: [
NgIf,
CardComponent,
NgFor,
DatePipe,
],
})
export class HistoryComponent implements OnInit {
public song: Song | null = null;

View File

@@ -9,8 +9,8 @@ describe('FileComponent', () => {
beforeEach(
waitForAsync(() => {
void TestBed.configureTestingModule({
declarations: [FileComponent],
}).compileComponents();
imports: [FileComponent],
}).compileComponents();
}),
);

View File

@@ -2,12 +2,13 @@ import {Component, Input} from '@angular/core';
import {File} from '../../services/file';
import {AngularFireStorage} from '@angular/fire/compat/storage';
import {Observable} from 'rxjs';
import { AsyncPipe } from '@angular/common';
@Component({
selector: 'app-file',
templateUrl: './file.component.html',
styleUrls: ['./file.component.less'],
standalone: false,
selector: 'app-file',
templateUrl: './file.component.html',
styleUrls: ['./file.component.less'],
imports: [AsyncPipe],
})
export class FileComponent {
public url$: Observable<string> | null = null;

View File

@@ -9,8 +9,8 @@ describe('NewComponent', () => {
beforeEach(
waitForAsync(() => {
void TestBed.configureTestingModule({
declarations: [NewComponent],
}).compileComponents();
imports: [NewComponent],
}).compileComponents();
}),
);

View File

@@ -1,16 +1,29 @@
import {Component, OnDestroy, OnInit} from '@angular/core';
import {faSave} from '@fortawesome/free-solid-svg-icons';
import {UntypedFormControl, UntypedFormGroup, Validators} from '@angular/forms';
import { UntypedFormControl, UntypedFormGroup, Validators, ReactiveFormsModule } from '@angular/forms';
import {SongService} from '../../services/song.service';
import {Song} from '../../services/song';
import {Router} from '@angular/router';
import {Subscription} from 'rxjs';
import { CardComponent } from '../../../../widget-modules/components/card/card.component';
import { MatFormField, MatLabel } from '@angular/material/form-field';
import { MatInput } from '@angular/material/input';
import { ButtonRowComponent } from '../../../../widget-modules/components/button-row/button-row.component';
import { ButtonComponent } from '../../../../widget-modules/components/button/button.component';
@Component({
selector: 'app-new',
templateUrl: './new.component.html',
styleUrls: ['./new.component.less'],
standalone: false,
selector: 'app-new',
templateUrl: './new.component.html',
styleUrls: ['./new.component.less'],
imports: [
CardComponent,
ReactiveFormsModule,
MatFormField,
MatLabel,
MatInput,
ButtonRowComponent,
ButtonComponent,
],
})
export class NewComponent implements OnInit, OnDestroy {
public faSave = faSave;

View File

@@ -1,17 +0,0 @@
import {NgModule} from '@angular/core';
import {CommonModule} from '@angular/common';
import {NewComponent} from './new.component';
import {CardModule} from '../../../../widget-modules/components/card/card.module';
import {ReactiveFormsModule} from '@angular/forms';
import {MatFormFieldModule} from '@angular/material/form-field';
import {MatInputModule} from '@angular/material/input';
import {ButtonRowModule} from '../../../../widget-modules/components/button-row/button-row.module';
import {ButtonModule} from '../../../../widget-modules/components/button/button.module';
import {AutofocusModule} from '../../../../widget-modules/directives/autofocus/autofocus.module';
@NgModule({
declarations: [NewComponent],
imports: [CommonModule, CardModule, ReactiveFormsModule, MatFormFieldModule, MatInputModule, ButtonRowModule, ButtonModule, AutofocusModule],
})
export class NewModule {
}

View File

@@ -15,9 +15,9 @@ describe('SongComponent', () => {
beforeEach(
waitForAsync(() => {
void TestBed.configureTestingModule({
declarations: [SongComponent],
providers: [{provide: ActivatedRoute, useValue: mockActivatedRoute}],
}).compileComponents();
imports: [SongComponent],
providers: [{ provide: ActivatedRoute, useValue: mockActivatedRoute }],
}).compileComponents();
}),
);

View File

@@ -1,5 +1,5 @@
import {Component, OnInit} from '@angular/core';
import {ActivatedRoute, Router} from '@angular/router';
import { ActivatedRoute, Router, RouterLink } from '@angular/router';
import {SongService} from '../services/song.service';
import {distinctUntilChanged, map, switchMap} from 'rxjs/operators';
import {Song} from '../services/song';
@@ -12,12 +12,45 @@ import {faEdit, faFileCirclePlus, faTrash} from '@fortawesome/free-solid-svg-ico
import {ShowService} from '../../shows/services/show.service';
import {Show} from '../../shows/services/show';
import {ShowSongService} from '../../shows/services/show-song.service';
import { NgIf, NgFor, AsyncPipe, DatePipe } from '@angular/common';
import { CardComponent } from '../../../widget-modules/components/card/card.component';
import { RoleDirective } from '../../../services/user/role.directive';
import { SongTextComponent } from '../../../widget-modules/components/song-text/song-text.component';
import { MatChipListbox, MatChipOption } from '@angular/material/chips';
import { ButtonRowComponent } from '../../../widget-modules/components/button-row/button-row.component';
import { ButtonComponent } from '../../../widget-modules/components/button/button.component';
import { MatMenuTrigger, MatMenu } from '@angular/material/menu';
import { FileComponent } from './file/file.component';
import { SongTypePipe } from '../../../widget-modules/pipes/song-type-translater/song-type.pipe';
import { LegalOwnerPipe } from '../../../widget-modules/pipes/legal-owner-translator/legal-owner.pipe';
import { StatusPipe } from '../../../widget-modules/pipes/status-translater/status.pipe';
import { ShowTypePipe } from '../../../widget-modules/pipes/show-type-translater/show-type.pipe';
@Component({
selector: 'app-song',
templateUrl: './song.component.html',
styleUrls: ['./song.component.less'],
standalone: false,
selector: 'app-song',
templateUrl: './song.component.html',
styleUrls: ['./song.component.less'],
imports: [
NgIf,
CardComponent,
RoleDirective,
SongTextComponent,
MatChipListbox,
NgFor,
MatChipOption,
ButtonRowComponent,
ButtonComponent,
RouterLink,
MatMenuTrigger,
MatMenu,
FileComponent,
AsyncPipe,
DatePipe,
SongTypePipe,
LegalOwnerPipe,
StatusPipe,
ShowTypePipe,
],
})
export class SongComponent implements OnInit {
public song$: Observable<Song | null> | null = null;

View File

@@ -1,40 +0,0 @@
import {NgModule} from '@angular/core';
import {CommonModule} from '@angular/common';
import {SongComponent} from './song.component';
import {CardModule} from '../../../widget-modules/components/card/card.module';
import {MatButtonModule} from '@angular/material/button';
import {ButtonRowModule} from '../../../widget-modules/components/button-row/button-row.module';
import {RouterModule} from '@angular/router';
import {MatChipsModule} from '@angular/material/chips';
import {RoleModule} from '../../../services/user/role.module';
import {ButtonModule} from '../../../widget-modules/components/button/button.module';
import {FileComponent} from './file/file.component';
import {MatMenuModule} from '@angular/material/menu';
import {SongTextComponent} from '../../../widget-modules/components/song-text/song-text.component';
import {LegalOwnerPipe} from '../../../widget-modules/pipes/legal-owner-translator/legal-owner.pipe';
import {ShowTypePipe} from '../../../widget-modules/pipes/show-type-translater/show-type.pipe';
import {SongTypePipe} from '../../../widget-modules/pipes/song-type-translater/song-type.pipe';
import {StatusPipe} from '../../../widget-modules/pipes/status-translater/status.pipe';
@NgModule({
declarations: [SongComponent, FileComponent],
exports: [SongComponent],
imports: [
CommonModule,
CardModule,
RouterModule,
SongTypePipe,
MatButtonModule,
ButtonRowModule,
LegalOwnerPipe,
SongTextComponent,
MatChipsModule,
RoleModule,
StatusPipe,
ButtonModule,
MatMenuModule,
ShowTypePipe,
],
})
export class SongModule {}

View File

@@ -2,14 +2,14 @@ import {NgModule} from '@angular/core';
import {CommonModule} from '@angular/common';
import {SongsRoutingModule} from './songs-routing.module';
import {SongListModule} from './song-list/song-list.module';
import {SongModule} from './song/song.module';
import {EditModule} from './song/edit/edit.module';
import {NewModule} from './song/new/new.module';
@NgModule({
declarations: [],
imports: [CommonModule, SongsRoutingModule, SongListModule, SongModule, EditModule, NewModule],
imports: [CommonModule, SongsRoutingModule, EditModule],
})
export class SongsModule {
}