clean up and lint files
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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))
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -11,7 +11,7 @@ export class EditSongGuard {
|
||||
component: EditComponent,
|
||||
currentRoute: ActivatedRouteSnapshot,
|
||||
currentState: RouterStateSnapshot,
|
||||
nextState: RouterStateSnapshot,
|
||||
nextState: RouterStateSnapshot
|
||||
): Observable<boolean | UrlTree> | Promise<boolean | UrlTree> | boolean | UrlTree {
|
||||
return component.editSongComponent ? component.editSongComponent.askForSave(nextState) : true;
|
||||
}
|
||||
|
||||
@@ -6,13 +6,11 @@ describe('EditSongComponent', () => {
|
||||
let component: EditSongComponent;
|
||||
let fixture: ComponentFixture<EditSongComponent>;
|
||||
|
||||
beforeEach(
|
||||
waitForAsync(() => {
|
||||
void TestBed.configureTestingModule({
|
||||
imports: [EditSongComponent],
|
||||
}).compileComponents();
|
||||
}),
|
||||
);
|
||||
beforeEach(waitForAsync(() => {
|
||||
void TestBed.configureTestingModule({
|
||||
imports: [EditSongComponent],
|
||||
}).compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
fixture = TestBed.createComponent(EditSongComponent);
|
||||
|
||||
@@ -1,64 +1,64 @@
|
||||
import {Component, OnInit} from '@angular/core';
|
||||
import {Song} from '../../../services/song';
|
||||
import { UntypedFormGroup, ReactiveFormsModule } from '@angular/forms';
|
||||
import {ReactiveFormsModule, UntypedFormGroup} 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, MatChipGrid, MatChipRow, MatChipInput } from '@angular/material/chips';
|
||||
import {MatChipGrid, MatChipInput, MatChipInputEvent, MatChipRow} 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';
|
||||
import {NgFor, NgIf} 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'],
|
||||
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,
|
||||
],
|
||||
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;
|
||||
@@ -80,9 +80,8 @@ export class EditSongComponent implements OnInit {
|
||||
private songService: SongService,
|
||||
private editService: EditService,
|
||||
private router: Router,
|
||||
public dialog: MatDialog,
|
||||
) {
|
||||
}
|
||||
public dialog: MatDialog
|
||||
) {}
|
||||
|
||||
public ngOnInit(): void {
|
||||
this.activatedRoute.params
|
||||
@@ -90,7 +89,7 @@ export class EditSongComponent implements OnInit {
|
||||
map(param => param as {songId: string}),
|
||||
map(param => param.songId),
|
||||
switchMap(songId => this.songService.read$(songId)),
|
||||
first(),
|
||||
first()
|
||||
)
|
||||
.subscribe(song => {
|
||||
this.song = song;
|
||||
|
||||
@@ -6,13 +6,11 @@ describe('SaveDialogComponent', () => {
|
||||
let component: SaveDialogComponent;
|
||||
let fixture: ComponentFixture<SaveDialogComponent>;
|
||||
|
||||
beforeEach(
|
||||
waitForAsync(() => {
|
||||
void TestBed.configureTestingModule({
|
||||
declarations: [SaveDialogComponent],
|
||||
}).compileComponents();
|
||||
}),
|
||||
);
|
||||
beforeEach(waitForAsync(() => {
|
||||
void TestBed.configureTestingModule({
|
||||
declarations: [SaveDialogComponent],
|
||||
}).compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
fixture = TestBed.createComponent(SaveDialogComponent);
|
||||
|
||||
@@ -4,7 +4,5 @@ import {Component} from '@angular/core';
|
||||
selector: 'app-save-dialog',
|
||||
templateUrl: './save-dialog.component.html',
|
||||
styleUrls: ['./save-dialog.component.less'],
|
||||
standalone: false,
|
||||
})
|
||||
export class SaveDialogComponent {
|
||||
}
|
||||
export class SaveDialogComponent {}
|
||||
|
||||
@@ -6,13 +6,11 @@ describe('EditComponent', () => {
|
||||
let component: EditComponent;
|
||||
let fixture: ComponentFixture<EditComponent>;
|
||||
|
||||
beforeEach(
|
||||
waitForAsync(() => {
|
||||
void TestBed.configureTestingModule({
|
||||
imports: [EditComponent],
|
||||
}).compileComponents();
|
||||
}),
|
||||
);
|
||||
beforeEach(waitForAsync(() => {
|
||||
void TestBed.configureTestingModule({
|
||||
imports: [EditComponent],
|
||||
}).compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
fixture = TestBed.createComponent(EditComponent);
|
||||
|
||||
@@ -1,17 +1,13 @@
|
||||
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';
|
||||
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'],
|
||||
imports: [
|
||||
EditSongComponent,
|
||||
EditFileComponent,
|
||||
HistoryComponent,
|
||||
],
|
||||
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;
|
||||
|
||||
@@ -28,10 +28,10 @@ import {SongTypePipe} from '../../../../widget-modules/pipes/song-type-translate
|
||||
import {StatusPipe} from '../../../../widget-modules/pipes/status-translater/status.pipe';
|
||||
|
||||
@NgModule({
|
||||
declarations: [SaveDialogComponent],
|
||||
exports: [EditComponent],
|
||||
bootstrap: [SaveDialogComponent],
|
||||
imports: [
|
||||
declarations: [SaveDialogComponent],
|
||||
exports: [EditComponent],
|
||||
bootstrap: [SaveDialogComponent],
|
||||
imports: [
|
||||
CommonModule,
|
||||
SongTypePipe,
|
||||
ReactiveFormsModule,
|
||||
@@ -50,7 +50,11 @@ import {StatusPipe} from '../../../../widget-modules/pipes/status-translater/sta
|
||||
MatTooltipModule,
|
||||
MatDialogModule,
|
||||
SongTextComponent,
|
||||
EditComponent, EditSongComponent, EditFileComponent, FileComponent, HistoryComponent,
|
||||
],
|
||||
EditComponent,
|
||||
EditSongComponent,
|
||||
EditFileComponent,
|
||||
FileComponent,
|
||||
HistoryComponent,
|
||||
],
|
||||
})
|
||||
export class EditModule {}
|
||||
|
||||
@@ -6,13 +6,11 @@ describe('HistoryComponent', () => {
|
||||
let component: HistoryComponent;
|
||||
let fixture: ComponentFixture<HistoryComponent>;
|
||||
|
||||
beforeEach(
|
||||
waitForAsync(() => {
|
||||
void TestBed.configureTestingModule({
|
||||
imports: [HistoryComponent],
|
||||
}).compileComponents();
|
||||
}),
|
||||
);
|
||||
beforeEach(waitForAsync(() => {
|
||||
void TestBed.configureTestingModule({
|
||||
imports: [HistoryComponent],
|
||||
}).compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
fixture = TestBed.createComponent(HistoryComponent);
|
||||
|
||||
@@ -3,25 +3,22 @@ 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';
|
||||
import {DatePipe, NgFor, NgIf} from '@angular/common';
|
||||
import {CardComponent} from '../../../../../widget-modules/components/card/card.component';
|
||||
|
||||
@Component({
|
||||
selector: 'app-history',
|
||||
templateUrl: './history.component.html',
|
||||
styleUrls: ['./history.component.less'],
|
||||
imports: [
|
||||
NgIf,
|
||||
CardComponent,
|
||||
NgFor,
|
||||
DatePipe,
|
||||
],
|
||||
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;
|
||||
|
||||
public constructor(private activatedRoute: ActivatedRoute, private songService: SongService) {
|
||||
}
|
||||
public constructor(
|
||||
private activatedRoute: ActivatedRoute,
|
||||
private songService: SongService
|
||||
) {}
|
||||
|
||||
public ngOnInit(): void {
|
||||
this.activatedRoute.params
|
||||
@@ -29,7 +26,7 @@ export class HistoryComponent implements OnInit {
|
||||
map(param => param as {songId: string}),
|
||||
map(param => param.songId),
|
||||
switchMap(songId => this.songService.read$(songId)),
|
||||
first(),
|
||||
first()
|
||||
)
|
||||
.subscribe(song => {
|
||||
this.song = song;
|
||||
|
||||
Reference in New Issue
Block a user