update angular

This commit is contained in:
2025-01-02 15:01:59 +01:00
parent 73d3ecfd42
commit 802c309679
199 changed files with 13745 additions and 11691 deletions

View File

@@ -8,8 +8,9 @@
></ngx-mat-select-search>
</mat-option>
<mat-option *ngFor="let song of filteredSongs()" [value]="song.id">{{
song.title
}}</mat-option>
song.title
}}
</mat-option>
</mat-select>
</mat-form-field>
</div>

View File

@@ -11,7 +11,7 @@ describe('AddSongComponent', () => {
void TestBed.configureTestingModule({
declarations: [AddSongComponent],
}).compileComponents();
})
}),
);
beforeEach(() => {

View File

@@ -13,6 +13,7 @@ import {ShowService} from '../../../modules/shows/services/show.service';
templateUrl: './add-song.component.html',
styleUrls: ['./add-song.component.less'],
changeDetection: ChangeDetectionStrategy.OnPush,
standalone: false,
})
export class AddSongComponent {
@Input() public songs: Song[] | null = null;
@@ -21,7 +22,8 @@ export class AddSongComponent {
@Input() public addedLive = false;
public filteredSongsControl = new UntypedFormControl();
public constructor(private showSongService: ShowSongService, private showService: ShowService) {}
public constructor(private showSongService: ShowSongService, private showService: ShowService) {
}
public filteredSongs(): Song[] {
if (!this.songs) return [];

View File

@@ -11,4 +11,5 @@ import {ReactiveFormsModule} from '@angular/forms';
exports: [AddSongComponent],
imports: [CommonModule, MatFormFieldModule, MatSelectModule, NgxMatSelectSearchModule, ReactiveFormsModule],
})
export class AddSongModule {}
export class AddSongModule {
}

View File

@@ -14,4 +14,5 @@ import {BrandComponent} from './navigation/brand/brand.component';
imports: [CommonModule, RouterModule, FontAwesomeModule, FormsModule, RoleModule],
exports: [NavigationComponent],
})
export class ApplicationFrameModule {}
export class ApplicationFrameModule {
}

View File

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

View File

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

View File

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

View File

@@ -5,6 +5,7 @@ import {ActivatedRoute, Params, Router} from '@angular/router';
selector: 'app-filter',
templateUrl: './filter.component.html',
styleUrls: ['./filter.component.less'],
standalone: false,
})
export class FilterComponent {
public value = '';

View File

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

View File

@@ -6,6 +6,7 @@ import {faCross} from '@fortawesome/free-solid-svg-icons';
selector: 'app-link',
templateUrl: './link.component.html',
styleUrls: ['./link.component.less'],
standalone: false,
})
export class LinkComponent {
@Input() public text: string | null = null;

View File

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

View File

@@ -7,6 +7,7 @@ import {distinctUntilChanged, map, shareReplay, startWith} from 'rxjs/operators'
selector: 'app-navigation',
templateUrl: './navigation.component.html',
styleUrls: ['./navigation.component.less'],
standalone: false,
})
export class NavigationComponent {
public faSongs = faMusic;
@@ -18,7 +19,7 @@ export class NavigationComponent {
map(() => window.scrollY),
startWith(0),
distinctUntilChanged(),
shareReplay(1)
shareReplay(1),
);
public isNavigationHidden = (scroll: number | null): boolean => (scroll ?? 0) > 60;

View File

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

View File

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

View File

@@ -7,4 +7,5 @@ import {ButtonRowComponent} from './button-row.component';
exports: [ButtonRowComponent],
imports: [CommonModule],
})
export class ButtonRowModule {}
export class ButtonRowModule {
}

View File

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

View File

@@ -5,6 +5,7 @@ import {IconProp} from '@fortawesome/fontawesome-svg-core';
selector: 'app-button',
templateUrl: './button.component.html',
styleUrls: ['./button.component.less'],
standalone: false,
})
export class ButtonComponent {
@Input() public icon: IconProp | null = null;

View File

@@ -9,4 +9,5 @@ import {MatButtonModule} from '@angular/material/button';
exports: [ButtonComponent],
imports: [CommonModule, FontAwesomeModule, MatButtonModule],
})
export class ButtonModule {}
export class ButtonModule {
}

View File

@@ -47,6 +47,7 @@
padding-left: 20px;
padding-top: 20px;
}
.subheading {
font-size: 14px;
font-weight: bold;

View File

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

View File

@@ -5,6 +5,7 @@ import {faTimes} from '@fortawesome/free-solid-svg-icons';
selector: 'app-card',
templateUrl: './card.component.html',
styleUrls: ['./card.component.less'],
standalone: false,
})
export class CardComponent {
@Input() public padding = true;

View File

@@ -10,4 +10,5 @@ import {FontAwesomeModule} from '@fortawesome/angular-fontawesome';
exports: [CardComponent],
imports: [CommonModule, MatButtonModule, RouterModule, FontAwesomeModule],
})
export class CardModule {}
export class CardModule {
}

View File

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

View File

@@ -7,6 +7,7 @@ import {fade} from '../../../animations';
templateUrl: './list-header.component.html',
styleUrls: ['./list-header.component.less'],
animations: [fade],
standalone: false,
})
export class ListHeaderComponent {
public faNew = faPlus;

View File

@@ -11,4 +11,5 @@ import {CardModule} from '../card/card.module';
exports: [ListHeaderComponent],
imports: [CommonModule, FontAwesomeModule, MatButtonModule, RouterModule, CardModule],
})
export class ListHeaderModule {}
export class ListHeaderModule {
}

View File

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

View File

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

View File

@@ -7,4 +7,5 @@ import {LogoComponent} from './logo.component';
exports: [LogoComponent],
imports: [CommonModule],
})
export class LogoModule {}
export class LogoModule {
}

View File

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

View File

@@ -6,6 +6,7 @@ import {faCross} from '@fortawesome/free-solid-svg-icons';
selector: 'app-menu-button',
templateUrl: './menu-button.component.html',
styleUrls: ['./menu-button.component.less'],
standalone: false,
})
export class MenuButtonComponent {
@Input() public icon: IconProp = faCross;

View File

@@ -9,4 +9,5 @@ import {MatButtonModule} from '@angular/material/button';
exports: [MenuButtonComponent],
imports: [CommonModule, FontAwesomeModule, MatButtonModule],
})
export class MenuButtonModule {}
export class MenuButtonModule {
}

View File

@@ -25,9 +25,10 @@
[class.chord]="line.type === 0"
[class.disabled]="checkDisabled(i)"
class="line"
>{{ line.text }}</div>
>{{ line.text }}
</div>
</div>
<div class="error" *ngIf="sections.length===0">
<div *ngIf="sections.length===0" class="error">
Es wurden keine Liedabschnitte gefunden! Bitte mindestens einen Abschnitt festlegen!
</div>
</div>
@@ -52,7 +53,7 @@
</button>
<div [class.offset]="fullscreen" [style.top.px]="offset + 50">
<h1 *ngIf="header">{{header}}</h1>
<h1 *ngIf="header">{{ header }}</h1>
<div
#section
*ngFor="let section of sections; let i = index"
@@ -64,7 +65,8 @@
[class.chord]="line.type === 0"
[class.disabled]="checkDisabled(i)"
class="line"
>{{ line.text.trim() }}</div>
>{{ line.text.trim() }}
</div>
</div>
</div>

View File

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

View File

@@ -1,4 +1,14 @@
import {ChangeDetectorRef, Component, ElementRef, EventEmitter, Input, OnInit, Output, QueryList, ViewChildren} from '@angular/core';
import {
ChangeDetectorRef,
Component,
ElementRef,
EventEmitter,
Input,
OnInit,
Output,
QueryList,
ViewChildren,
} from '@angular/core';
import {TextRenderingService} from '../../../modules/songs/services/text-rendering.service';
import {faGripLines} from '@fortawesome/free-solid-svg-icons';
import {songSwitch} from './animation';
@@ -15,6 +25,7 @@ export type ChordMode = 'show' | 'hide' | 'onlyFirst';
templateUrl: './song-text.component.html',
styleUrls: ['./song-text.component.less'],
animations: [songSwitch],
standalone: false,
})
export class SongTextComponent implements OnInit {
public sections: Section[] = [];
@@ -30,7 +41,8 @@ export class SongTextComponent implements OnInit {
private iText = '';
private iTranspose: TransposeMode | null = null;
public constructor(private textRenderingService: TextRenderingService, private elRef: ElementRef<HTMLElement>, private cRef: ChangeDetectorRef) {}
public constructor(private textRenderingService: TextRenderingService, private elRef: ElementRef<HTMLElement>, private cRef: ChangeDetectorRef) {
}
@Input()
public set chordMode(value: ChordMode) {
@@ -61,20 +73,6 @@ export class SongTextComponent implements OnInit {
}, 100);
}
private render() {
this.offset = 0;
this.sections = [];
if (this.fullscreen) {
setTimeout(() => {
this.sections = this.textRenderingService.parse(this.iText, this.iTranspose);
this.cRef.markForCheck();
}, 100);
} else {
this.sections = this.textRenderingService.parse(this.iText, this.iTranspose); //.sort((a, b) => a.type - b.type);
this.cRef.markForCheck();
}
}
public getLines(section: Section): Line[] {
return section.lines.filter(_ => {
if (_.type !== LineType.chord) {
@@ -108,6 +106,20 @@ export class SongTextComponent implements OnInit {
return this.index !== -1 && this.index !== i;
}
private render() {
this.offset = 0;
this.sections = [];
if (this.fullscreen) {
setTimeout(() => {
this.sections = this.textRenderingService.parse(this.iText, this.iTranspose);
this.cRef.markForCheck();
}, 100);
} else {
this.sections = this.textRenderingService.parse(this.iText, this.iTranspose); //.sort((a, b) => a.type - b.type);
this.cRef.markForCheck();
}
}
private getNextChordMode(): ChordMode {
switch (this.iChordMode) {
case 'show':

View File

@@ -9,4 +9,5 @@ import {MatButtonModule} from '@angular/material/button';
exports: [SongTextComponent],
imports: [CommonModule, FontAwesomeModule, MatButtonModule],
})
export class SongTextModule {}
export class SongTextModule {
}