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('AddSongComponent', () => {
beforeEach(
waitForAsync(() => {
void TestBed.configureTestingModule({
declarations: [AddSongComponent],
}).compileComponents();
imports: [AddSongComponent],
}).compileComponents();
}),
);

View File

@@ -1,18 +0,0 @@
import {NgModule} from '@angular/core';
import {CommonModule} from '@angular/common';
import {NavigationComponent} from './navigation/navigation.component';
import {RouterModule} from '@angular/router';
import {FilterComponent} from './navigation/filter/filter.component';
import {FontAwesomeModule} from '@fortawesome/angular-fontawesome';
import {LinkComponent} from './navigation/link/link.component';
import {FormsModule} from '@angular/forms';
import {RoleModule} from '../../../services/user/role.module';
import {BrandComponent} from './navigation/brand/brand.component';
@NgModule({
declarations: [NavigationComponent, FilterComponent, LinkComponent, BrandComponent],
imports: [CommonModule, RouterModule, FontAwesomeModule, FormsModule, RoleModule],
exports: [NavigationComponent],
})
export class ApplicationFrameModule {
}

View File

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

View File

@@ -1,10 +1,9 @@
import {Component} from '@angular/core';
@Component({
selector: 'app-brand',
templateUrl: './brand.component.html',
styleUrls: ['./brand.component.less'],
standalone: false,
selector: 'app-brand',
templateUrl: './brand.component.html',
styleUrls: ['./brand.component.less'],
})
export class BrandComponent {
}

View File

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

View File

@@ -1,11 +1,12 @@
import {Component} from '@angular/core';
import {ActivatedRoute, Params, Router} from '@angular/router';
import { ReactiveFormsModule, FormsModule } from '@angular/forms';
@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, FormsModule],
})
export class FilterComponent {
public value = '';

View File

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

View File

@@ -1,12 +1,18 @@
import {Component, Input} from '@angular/core';
import {IconProp} from '@fortawesome/fontawesome-svg-core';
import {faCross} from '@fortawesome/free-solid-svg-icons';
import { RouterLinkActive, RouterLink } from '@angular/router';
import { FaIconComponent } from '@fortawesome/angular-fontawesome';
@Component({
selector: 'app-link',
templateUrl: './link.component.html',
styleUrls: ['./link.component.less'],
standalone: false,
selector: 'app-link',
templateUrl: './link.component.html',
styleUrls: ['./link.component.less'],
imports: [
RouterLinkActive,
RouterLink,
FaIconComponent,
],
})
export class LinkComponent {
@Input() public text: string | null = null;

View File

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

View File

@@ -2,12 +2,25 @@ import {Component} from '@angular/core';
import {faChalkboard, faMusic, faPersonBooth, faUserCog} from '@fortawesome/free-solid-svg-icons';
import {fromEvent, Observable} from 'rxjs';
import {distinctUntilChanged, map, shareReplay, startWith} from 'rxjs/operators';
import { BrandComponent } from './brand/brand.component';
import { RouterLink } from '@angular/router';
import { RoleDirective } from '../../../../services/user/role.directive';
import { LinkComponent } from './link/link.component';
import { FilterComponent } from './filter/filter.component';
import { AsyncPipe } from '@angular/common';
@Component({
selector: 'app-navigation',
templateUrl: './navigation.component.html',
styleUrls: ['./navigation.component.less'],
standalone: false,
selector: 'app-navigation',
templateUrl: './navigation.component.html',
styleUrls: ['./navigation.component.less'],
imports: [
BrandComponent,
RouterLink,
RoleDirective,
LinkComponent,
FilterComponent,
AsyncPipe,
],
})
export class NavigationComponent {
public faSongs = faMusic;

View File

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

View File

@@ -1,10 +1,9 @@
import {Component} from '@angular/core';
@Component({
selector: 'app-button-row',
templateUrl: './button-row.component.html',
styleUrls: ['./button-row.component.less'],
standalone: false,
selector: 'app-button-row',
templateUrl: './button-row.component.html',
styleUrls: ['./button-row.component.less'],
})
export class ButtonRowComponent {
}

View File

@@ -1,11 +0,0 @@
import {NgModule} from '@angular/core';
import {CommonModule} from '@angular/common';
import {ButtonRowComponent} from './button-row.component';
@NgModule({
declarations: [ButtonRowComponent],
exports: [ButtonRowComponent],
imports: [CommonModule],
})
export class ButtonRowModule {
}

View File

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

View File

@@ -1,11 +1,18 @@
import {Component, Input} from '@angular/core';
import {IconProp} from '@fortawesome/fontawesome-svg-core';
import { MatButton } from '@angular/material/button';
import { NgIf } from '@angular/common';
import { FaIconComponent } from '@fortawesome/angular-fontawesome';
@Component({
selector: 'app-button',
templateUrl: './button.component.html',
styleUrls: ['./button.component.less'],
standalone: false,
selector: 'app-button',
templateUrl: './button.component.html',
styleUrls: ['./button.component.less'],
imports: [
MatButton,
NgIf,
FaIconComponent,
],
})
export class ButtonComponent {
@Input() public icon: IconProp | null = null;

View File

@@ -1,13 +0,0 @@
import {NgModule} from '@angular/core';
import {CommonModule} from '@angular/common';
import {ButtonComponent} from './button.component';
import {FontAwesomeModule} from '@fortawesome/angular-fontawesome';
import {MatButtonModule} from '@angular/material/button';
@NgModule({
declarations: [ButtonComponent],
exports: [ButtonComponent],
imports: [CommonModule, FontAwesomeModule, MatButtonModule],
})
export class ButtonModule {
}

View File

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

View File

@@ -1,11 +1,20 @@
import {Component, Input} from '@angular/core';
import {faTimes} from '@fortawesome/free-solid-svg-icons';
import { NgIf } from '@angular/common';
import { MatIconButton } from '@angular/material/button';
import { RouterLink } from '@angular/router';
import { FaIconComponent } from '@fortawesome/angular-fontawesome';
@Component({
selector: 'app-card',
templateUrl: './card.component.html',
styleUrls: ['./card.component.less'],
standalone: false,
selector: 'app-card',
templateUrl: './card.component.html',
styleUrls: ['./card.component.less'],
imports: [
NgIf,
MatIconButton,
RouterLink,
FaIconComponent,
],
})
export class CardComponent {
@Input() public padding = true;

View File

@@ -1,14 +0,0 @@
import {NgModule} from '@angular/core';
import {CommonModule} from '@angular/common';
import {CardComponent} from './card.component';
import {MatButtonModule} from '@angular/material/button';
import {RouterModule} from '@angular/router';
import {FontAwesomeModule} from '@fortawesome/angular-fontawesome';
@NgModule({
declarations: [CardComponent],
exports: [CardComponent],
imports: [CommonModule, MatButtonModule, RouterModule, FontAwesomeModule],
})
export class CardModule {
}

View File

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

View File

@@ -1,13 +1,24 @@
import {Component, EventEmitter, Input, Output} from '@angular/core';
import {faFilter, faPlus} from '@fortawesome/free-solid-svg-icons';
import {fade} from '../../../animations';
import { MatIconButton } from '@angular/material/button';
import { FaIconComponent } from '@fortawesome/angular-fontawesome';
import { RouterLink } from '@angular/router';
import { NgIf } from '@angular/common';
import { CardComponent } from '../card/card.component';
@Component({
selector: 'app-list-header',
templateUrl: './list-header.component.html',
styleUrls: ['./list-header.component.less'],
animations: [fade],
standalone: false,
selector: 'app-list-header',
templateUrl: './list-header.component.html',
styleUrls: ['./list-header.component.less'],
animations: [fade],
imports: [
MatIconButton,
FaIconComponent,
RouterLink,
NgIf,
CardComponent,
],
})
export class ListHeaderComponent {
public faNew = faPlus;

View File

@@ -1,15 +0,0 @@
import {NgModule} from '@angular/core';
import {CommonModule} from '@angular/common';
import {ListHeaderComponent} from './list-header.component';
import {FontAwesomeModule} from '@fortawesome/angular-fontawesome';
import {MatButtonModule} from '@angular/material/button';
import {RouterModule} from '@angular/router';
import {CardModule} from '../card/card.module';
@NgModule({
declarations: [ListHeaderComponent],
exports: [ListHeaderComponent],
imports: [CommonModule, FontAwesomeModule, MatButtonModule, RouterModule, CardModule],
})
export class ListHeaderModule {
}

View File

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

View File

@@ -1,10 +1,9 @@
import {Component} from '@angular/core';
@Component({
selector: 'app-logo',
templateUrl: './logo.component.html',
styleUrls: ['./logo.component.less'],
standalone: false,
selector: 'app-logo',
templateUrl: './logo.component.html',
styleUrls: ['./logo.component.less'],
})
export class LogoComponent {
}

View File

@@ -1,11 +0,0 @@
import {NgModule} from '@angular/core';
import {CommonModule} from '@angular/common';
import {LogoComponent} from './logo.component';
@NgModule({
declarations: [LogoComponent],
exports: [LogoComponent],
imports: [CommonModule],
})
export class LogoModule {
}

View File

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

View File

@@ -1,12 +1,14 @@
import {Component, Input} from '@angular/core';
import {IconProp} from '@fortawesome/fontawesome-svg-core';
import {faCross} from '@fortawesome/free-solid-svg-icons';
import { MatButton } from '@angular/material/button';
import { FaIconComponent } from '@fortawesome/angular-fontawesome';
@Component({
selector: 'app-menu-button',
templateUrl: './menu-button.component.html',
styleUrls: ['./menu-button.component.less'],
standalone: false,
selector: 'app-menu-button',
templateUrl: './menu-button.component.html',
styleUrls: ['./menu-button.component.less'],
imports: [MatButton, FaIconComponent],
})
export class MenuButtonComponent {
@Input() public icon: IconProp = faCross;

View File

@@ -1,13 +0,0 @@
import {NgModule} from '@angular/core';
import {CommonModule} from '@angular/common';
import {MenuButtonComponent} from './menu-button.component';
import {FontAwesomeModule} from '@fortawesome/angular-fontawesome';
import {MatButtonModule} from '@angular/material/button';
@NgModule({
declarations: [MenuButtonComponent],
exports: [MenuButtonComponent],
imports: [CommonModule, FontAwesomeModule, MatButtonModule],
})
export class MenuButtonModule {
}

View File

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

View File

@@ -1,9 +1,6 @@
import {Directive, ElementRef, Input, OnInit} from '@angular/core';
@Directive({
selector: '[appAutofocus]',
standalone: false,
})
@Directive({ selector: '[appAutofocus]', })
export class AutofocusDirective implements OnInit {
private focus = true;

View File

@@ -1,11 +0,0 @@
import {NgModule} from '@angular/core';
import {CommonModule} from '@angular/common';
import {AutofocusDirective} from './autofocus.directive';
@NgModule({
declarations: [AutofocusDirective],
exports: [AutofocusDirective],
imports: [CommonModule],
})
export class AutofocusModule {
}