clean up and lint files

This commit is contained in:
2025-01-05 10:29:29 +01:00
parent 54ee9a5b11
commit 189478f078
137 changed files with 1096 additions and 1340 deletions

View File

@@ -6,13 +6,11 @@ describe('EditFileComponent', () => {
let component: EditFileComponent;
let fixture: ComponentFixture<EditFileComponent>;
beforeEach(
waitForAsync(() => {
void TestBed.configureTestingModule({
imports: [EditFileComponent],
}).compileComponents();
}),
);
beforeEach(waitForAsync(() => {
void TestBed.configureTestingModule({
imports: [EditFileComponent],
}).compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(EditFileComponent);

View File

@@ -6,26 +6,17 @@ 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';
import {CardComponent} from '../../../../../widget-modules/components/card/card.component';
import {AsyncPipe, NgFor, NgIf, NgStyle} 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'],
imports: [
CardComponent,
NgIf,
NgStyle,
MatIconButton,
MatIcon,
NgFor,
FileComponent,
AsyncPipe,
],
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;
@@ -33,11 +24,15 @@ export class EditFileComponent {
public songId: string | null = null;
public files$: Observable<File[]>;
public constructor(private activatedRoute: ActivatedRoute, private uploadService: UploadService, private fileService: FileDataService) {
public constructor(
private activatedRoute: ActivatedRoute,
private uploadService: UploadService,
private fileService: FileDataService
) {
this.activatedRoute.params
.pipe(
map(param => param as {songId: string}),
map(param => param.songId),
map(param => param.songId)
)
.subscribe(songId => {
this.songId = songId;
@@ -46,7 +41,7 @@ export class EditFileComponent {
this.files$ = this.activatedRoute.params.pipe(
map(param => param as {songId: string}),
map(param => param.songId),
switchMap(songId => this.fileService.read$(songId)),
switchMap(songId => this.fileService.read$(songId))
);
}

View File

@@ -6,13 +6,11 @@ describe('FileComponent', () => {
let component: FileComponent;
let fixture: ComponentFixture<FileComponent>;
beforeEach(
waitForAsync(() => {
void TestBed.configureTestingModule({
imports: [FileComponent],
}).compileComponents();
}),
);
beforeEach(waitForAsync(() => {
void TestBed.configureTestingModule({
imports: [FileComponent],
}).compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(FileComponent);

View File

@@ -3,19 +3,15 @@ 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';
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'],
imports: [
MatIconButton,
FaIconComponent,
AsyncPipe,
],
selector: 'app-file',
templateUrl: './file.component.html',
styleUrls: ['./file.component.less'],
imports: [MatIconButton, FaIconComponent, AsyncPipe],
})
export class FileComponent {
public url$: Observable<string> | null = null;
@@ -25,8 +21,7 @@ export class FileComponent {
private fileId: string | null = null;
private path: string | null = null;
public constructor(private fileService: FileService) {
}
public constructor(private fileService: FileService) {}
@Input()
public set file(file: File) {