0" heading="Anhänge">
-
+
+ 0" heading="Anhänge">
+
diff --git a/src/app/modules/songs/song/song.component.spec.ts b/src/app/modules/songs/song/song.component.spec.ts
index b75072b..97d3b27 100644
--- a/src/app/modules/songs/song/song.component.spec.ts
+++ b/src/app/modules/songs/song/song.component.spec.ts
@@ -9,18 +9,17 @@ describe('SongComponent', () => {
let fixture: ComponentFixture;
const mockActivatedRoute = {
- params: of({songId: '4711'})
+ params: of({songId: '4711'}),
};
- beforeEach(waitForAsync(() => {
- TestBed.configureTestingModule({
- declarations: [SongComponent],
- providers: [
- {provide: ActivatedRoute, useValue: mockActivatedRoute}
- ]
+ beforeEach(
+ waitForAsync(() => {
+ void TestBed.configureTestingModule({
+ declarations: [SongComponent],
+ providers: [{provide: ActivatedRoute, useValue: mockActivatedRoute}],
+ }).compileComponents();
})
- .compileComponents();
- }));
+ );
beforeEach(() => {
fixture = TestBed.createComponent(SongComponent);
@@ -29,7 +28,6 @@ describe('SongComponent', () => {
});
it('should create', () => {
- expect(component).toBeTruthy();
+ void expect(component).toBeTruthy();
});
-
});
diff --git a/src/app/modules/songs/song/song.component.ts b/src/app/modules/songs/song/song.component.ts
index 327d34f..0c8b4b4 100644
--- a/src/app/modules/songs/song/song.component.ts
+++ b/src/app/modules/songs/song/song.component.ts
@@ -14,7 +14,7 @@ import {faTrash} from '@fortawesome/free-solid-svg-icons/faTrash';
@Component({
selector: 'app-song',
templateUrl: './song.component.html',
- styleUrls: ['./song.component.less']
+ styleUrls: ['./song.component.less'],
})
export class SongComponent implements OnInit {
public song$: Observable;
@@ -23,24 +23,18 @@ export class SongComponent implements OnInit {
public faEdit = faEdit;
public faDelete = faTrash;
- constructor(
- private activatedRoute: ActivatedRoute,
- private songService: SongService,
- private fileService: FileDataService,
- private userService: UserService,
- private router: Router,
- ) {
+ public constructor(private activatedRoute: ActivatedRoute, private songService: SongService, private fileService: FileDataService, private userService: UserService, private router: Router) {
this.user$ = userService.user$;
}
public ngOnInit(): void {
this.song$ = this.activatedRoute.params.pipe(
- map(param => param.songId),
+ map((param: {songId: string}) => param.songId),
switchMap(songId => this.songService.read$(songId))
);
this.files$ = this.activatedRoute.params.pipe(
- map(param => param.songId),
+ map((param: {songId: string}) => param.songId),
switchMap(songId => this.fileService.read$(songId))
);
}
@@ -50,7 +44,7 @@ export class SongComponent implements OnInit {
return [];
}
return flags.split(';').filter(_ => !!_);
- }
+ };
public async onDelete(songId: string): Promise {
await this.songService.delete(songId);
diff --git a/src/app/modules/songs/song/song.module.ts b/src/app/modules/songs/song/song.module.ts
index 3c10b30..bc390bd 100644
--- a/src/app/modules/songs/song/song.module.ts
+++ b/src/app/modules/songs/song/song.module.ts
@@ -14,7 +14,6 @@ import {StatusTranslaterModule} from '../../../widget-modules/pipes/status-trans
import {ButtonModule} from '../../../widget-modules/components/button/button.module';
import {FileComponent} from './file/file.component';
-
@NgModule({
declarations: [SongComponent, FileComponent],
exports: [SongComponent],
@@ -32,7 +31,6 @@ import {FileComponent} from './file/file.component';
RoleModule,
StatusTranslaterModule,
ButtonModule,
- ]
+ ],
})
-export class SongModule {
-}
+export class SongModule {}
diff --git a/src/app/modules/songs/songs-routing.module.ts b/src/app/modules/songs/songs-routing.module.ts
index 3a79a44..30dc1cf 100644
--- a/src/app/modules/songs/songs-routing.module.ts
+++ b/src/app/modules/songs/songs-routing.module.ts
@@ -6,31 +6,29 @@ import {EditComponent} from './song/edit/edit.component';
import {NewComponent} from './song/new/new.component';
import {EditSongGuard} from './song/edit/edit-song.guard';
-
const routes: Routes = [
{
path: '',
component: SongListComponent,
- pathMatch: 'full'
+ pathMatch: 'full',
},
{
path: 'new',
- component: NewComponent
+ component: NewComponent,
},
{
path: ':songId/edit',
component: EditComponent,
- canDeactivate: [EditSongGuard]
+ canDeactivate: [EditSongGuard],
},
{
path: ':songId',
- component: SongComponent
- }
+ component: SongComponent,
+ },
];
@NgModule({
imports: [RouterModule.forChild(routes)],
- exports: [RouterModule]
+ exports: [RouterModule],
})
-export class SongsRoutingModule {
-}
+export class SongsRoutingModule {}
diff --git a/src/app/modules/songs/songs.module.ts b/src/app/modules/songs/songs.module.ts
index bbcb972..a508261 100644
--- a/src/app/modules/songs/songs.module.ts
+++ b/src/app/modules/songs/songs.module.ts
@@ -9,14 +9,6 @@ import {NewModule} from './song/new/new.module';
@NgModule({
declarations: [],
- imports: [
- CommonModule,
- SongsRoutingModule,
- SongListModule,
- SongModule,
- EditModule,
- NewModule,
- ]
+ imports: [CommonModule, SongsRoutingModule, SongListModule, SongModule, EditModule, NewModule],
})
-export class SongsModule {
-}
+export class SongsModule {}
diff --git a/src/app/modules/user/info/info.component.html b/src/app/modules/user/info/info.component.html
index 542fb91..2c0d376 100644
--- a/src/app/modules/user/info/info.component.html
+++ b/src/app/modules/user/info/info.component.html
@@ -1,18 +1,29 @@
-
+
- Es wurden noch keine Berechtigungen zugeteilt, bitte wende Dich an den Administrator!
- {{transdormUserRoles(user.role)}}
+ Es wurden noch keine Berechtigungen zugeteilt, bitte wende Dich an den
+ Administrator!
+ {{ transdormUserRoles(user.role) }}
bevorzugte Anzeige der Akkorde
-
+
nur den Liedtext anzeigen
- in Strophen die Akkorde nur für die erste anzeigen
+ in Strophen die Akkorde nur für die erste anzeigen
+
alle anzeigen
- Das ist nur die Voreinstellung, die Anzeige kann für jedes Lied geändert werden.
+ Das ist nur die Voreinstellung, die Anzeige kann für jedes Lied geändert
+ werden.
+
@@ -20,5 +31,4 @@
-
diff --git a/src/app/modules/user/info/info.component.spec.ts b/src/app/modules/user/info/info.component.spec.ts
index 5d9b6b3..7f25f3c 100644
--- a/src/app/modules/user/info/info.component.spec.ts
+++ b/src/app/modules/user/info/info.component.spec.ts
@@ -6,12 +6,13 @@ describe('InfoComponent', () => {
let component: InfoComponent;
let fixture: ComponentFixture;
- beforeEach(waitForAsync(() => {
- TestBed.configureTestingModule({
- declarations: [InfoComponent]
+ beforeEach(
+ waitForAsync(() => {
+ void TestBed.configureTestingModule({
+ declarations: [InfoComponent],
+ }).compileComponents();
})
- .compileComponents();
- }));
+ );
beforeEach(() => {
fixture = TestBed.createComponent(InfoComponent);
@@ -20,6 +21,6 @@ describe('InfoComponent', () => {
});
it('should create', () => {
- expect(component).toBeTruthy();
+ void expect(component).toBeTruthy();
});
});
diff --git a/src/app/modules/user/info/info.component.ts b/src/app/modules/user/info/info.component.ts
index 6549f82..db9ae53 100644
--- a/src/app/modules/user/info/info.component.ts
+++ b/src/app/modules/user/info/info.component.ts
@@ -8,16 +8,15 @@ import {faSignOutAlt} from '@fortawesome/free-solid-svg-icons/faSignOutAlt';
@Component({
selector: 'app-info',
templateUrl: './info.component.html',
- styleUrls: ['./info.component.less']
+ styleUrls: ['./info.component.less'],
})
export class InfoComponent implements OnInit {
public user$: Observable;
public faSignOut = faSignOutAlt;
- constructor(private userService: UserService) {
- }
+ public constructor(private userService: UserService) {}
- ngOnInit() {
+ public ngOnInit(): void {
this.user$ = this.userService.user$;
}
@@ -27,5 +26,4 @@ export class InfoComponent implements OnInit {
public getUserRoles = (roles: string): string[] => roles?.split(';') ?? [];
public transdormUserRoles = (roles: string): string => this.getUserRoles(roles).join(', ');
-
}
diff --git a/src/app/modules/user/info/role.pipe.spec.ts b/src/app/modules/user/info/role.pipe.spec.ts
index 65acaa2..7505aab 100644
--- a/src/app/modules/user/info/role.pipe.spec.ts
+++ b/src/app/modules/user/info/role.pipe.spec.ts
@@ -3,6 +3,6 @@ import {RolePipe} from './role.pipe';
describe('RolePipe', () => {
it('create an instance', () => {
const pipe = new RolePipe();
- expect(pipe).toBeTruthy();
+ void expect(pipe).toBeTruthy();
});
});
diff --git a/src/app/modules/user/info/role.pipe.ts b/src/app/modules/user/info/role.pipe.ts
index 13e9688..80c9c4e 100644
--- a/src/app/modules/user/info/role.pipe.ts
+++ b/src/app/modules/user/info/role.pipe.ts
@@ -1,12 +1,10 @@
import {Pipe, PipeTransform} from '@angular/core';
-
@Pipe({
- name: 'role'
+ name: 'role',
})
export class RolePipe implements PipeTransform {
-
- transform(role: string): string {
+ public transform(role: string): string {
switch (role) {
case 'contributor':
return 'Mitarbeiter';
@@ -20,8 +18,6 @@ export class RolePipe implements PipeTransform {
return 'Lobpreisleiter';
case 'presenter':
return 'Präsentator';
-
}
}
-
}
diff --git a/src/app/modules/user/info/users/user/user.component.html b/src/app/modules/user/info/users/user/user.component.html
index 2ef5efa..7b64d79 100644
--- a/src/app/modules/user/info/users/user/user.component.html
+++ b/src/app/modules/user/info/users/user/user.component.html
@@ -1,22 +1,30 @@
Name
-
+
Rolle
-
- {{role | role}}
+
+ {{
+ role | role
+ }}
-
+
-
-
{{name}}
-
{{role|role}},
+
+ {{ name }}
+ {{ role | role }},
diff --git a/src/app/modules/user/info/users/user/user.component.spec.ts b/src/app/modules/user/info/users/user/user.component.spec.ts
index 52165bf..28b8c8e 100644
--- a/src/app/modules/user/info/users/user/user.component.spec.ts
+++ b/src/app/modules/user/info/users/user/user.component.spec.ts
@@ -6,12 +6,13 @@ describe('UserComponent', () => {
let component: UserComponent;
let fixture: ComponentFixture
;
- beforeEach(waitForAsync(() => {
- TestBed.configureTestingModule({
- declarations: [UserComponent]
+ beforeEach(
+ waitForAsync(() => {
+ void TestBed.configureTestingModule({
+ declarations: [UserComponent],
+ }).compileComponents();
})
- .compileComponents();
- }));
+ );
beforeEach(() => {
fixture = TestBed.createComponent(UserComponent);
@@ -20,6 +21,6 @@ describe('UserComponent', () => {
});
it('should create', () => {
- expect(component).toBeTruthy();
+ void expect(component).toBeTruthy();
});
});
diff --git a/src/app/modules/user/info/users/user/user.component.ts b/src/app/modules/user/info/users/user/user.component.ts
index 80b40bf..003a9ab 100644
--- a/src/app/modules/user/info/users/user/user.component.ts
+++ b/src/app/modules/user/info/users/user/user.component.ts
@@ -7,7 +7,7 @@ import {faTimes} from '@fortawesome/free-solid-svg-icons/faTimes';
@Component({
selector: 'app-user',
templateUrl: './user.component.html',
- styleUrls: ['./user.component.less']
+ styleUrls: ['./user.component.less'],
})
export class UserComponent {
public id: string;
@@ -17,10 +17,10 @@ export class UserComponent {
public edit = false;
public faClose = faTimes;
- constructor(private userService: UserService) {
- }
+ public constructor(private userService: UserService) {}
- @Input() set user(value: User) {
+ @Input()
+ public set user(value: User) {
this.id = value.id;
this.name = value.name;
this.roles = this.getRoleArray(value.role);
@@ -31,12 +31,12 @@ export class UserComponent {
await this.userService.update$(id, {role});
}
- public async onNameChanged(id: string, name: any): Promise {
- await this.userService.update$(id, {name: name.target.value});
+ public async onNameChanged(id: string, name: Event): Promise {
+ const target = name.target as HTMLInputElement;
+ await this.userService.update$(id, {name: target.value});
}
- public getRoleArray(role): string[] {
+ public getRoleArray(role: string): string[] {
return role ? role.split(';') : [];
}
-
}
diff --git a/src/app/modules/user/info/users/users.component.html b/src/app/modules/user/info/users/users.component.html
index 53beace..cc56766 100644
--- a/src/app/modules/user/info/users/users.component.html
+++ b/src/app/modules/user/info/users/users.component.html
@@ -1,3 +1,3 @@
-
+
diff --git a/src/app/modules/user/info/users/users.component.spec.ts b/src/app/modules/user/info/users/users.component.spec.ts
index 87a3508..3047559 100644
--- a/src/app/modules/user/info/users/users.component.spec.ts
+++ b/src/app/modules/user/info/users/users.component.spec.ts
@@ -6,12 +6,13 @@ describe('UsersComponent', () => {
let component: UsersComponent;
let fixture: ComponentFixture;
- beforeEach(waitForAsync(() => {
- TestBed.configureTestingModule({
- declarations: [UsersComponent]
+ beforeEach(
+ waitForAsync(() => {
+ void TestBed.configureTestingModule({
+ declarations: [UsersComponent],
+ }).compileComponents();
})
- .compileComponents();
- }));
+ );
beforeEach(() => {
fixture = TestBed.createComponent(UsersComponent);
@@ -20,6 +21,6 @@ describe('UsersComponent', () => {
});
it('should create', () => {
- expect(component).toBeTruthy();
+ void expect(component).toBeTruthy();
});
});
diff --git a/src/app/modules/user/info/users/users.component.ts b/src/app/modules/user/info/users/users.component.ts
index 1d478dc..7438036 100644
--- a/src/app/modules/user/info/users/users.component.ts
+++ b/src/app/modules/user/info/users/users.component.ts
@@ -6,12 +6,12 @@ import {User} from '../../../../services/user/user';
@Component({
selector: 'app-users',
templateUrl: './users.component.html',
- styleUrls: ['./users.component.less']
+ styleUrls: ['./users.component.less'],
})
export class UsersComponent {
public users$: Observable;
- constructor(private userService: UserService) {
+ public constructor(private userService: UserService) {
this.users$ = userService.list$();
}
}
diff --git a/src/app/modules/user/login/auth-message.pipe.spec.ts b/src/app/modules/user/login/auth-message.pipe.spec.ts
index 09981a7..86be436 100644
--- a/src/app/modules/user/login/auth-message.pipe.spec.ts
+++ b/src/app/modules/user/login/auth-message.pipe.spec.ts
@@ -3,6 +3,6 @@ import {AuthMessagePipe} from './auth-message.pipe';
describe('AuthMessagePipe', () => {
it('create an instance', () => {
const pipe = new AuthMessagePipe();
- expect(pipe).toBeTruthy();
+ void expect(pipe).toBeTruthy();
});
});
diff --git a/src/app/modules/user/login/auth-message.pipe.ts b/src/app/modules/user/login/auth-message.pipe.ts
index 3bc1f46..95a3afc 100644
--- a/src/app/modules/user/login/auth-message.pipe.ts
+++ b/src/app/modules/user/login/auth-message.pipe.ts
@@ -1,19 +1,17 @@
import {Pipe, PipeTransform} from '@angular/core';
@Pipe({
- name: 'authMessage'
+ name: 'authMessage',
})
export class AuthMessagePipe implements PipeTransform {
-
- transform(code: string): string {
+ public transform(code: string): string {
switch (code) {
case 'auth/user-not-found':
return 'Benutzer wurde nicht gefunden';
case 'auth/wrong-password':
return 'Passwort ist falsch';
- default :
+ default:
return code;
}
}
-
}
diff --git a/src/app/modules/user/login/login.component.html b/src/app/modules/user/login/login.component.html
index 9b0d6a8..50f1e5c 100644
--- a/src/app/modules/user/login/login.component.html
+++ b/src/app/modules/user/login/login.component.html
@@ -1,44 +1,40 @@
-
-
diff --git a/src/app/modules/user/login/login.component.spec.ts b/src/app/modules/user/login/login.component.spec.ts
index beaad1e..a0f9993 100644
--- a/src/app/modules/user/login/login.component.spec.ts
+++ b/src/app/modules/user/login/login.component.spec.ts
@@ -6,12 +6,13 @@ describe('LoginComponent', () => {
let component: LoginComponent;
let fixture: ComponentFixture;
- beforeEach(waitForAsync(() => {
- TestBed.configureTestingModule({
- declarations: [LoginComponent]
+ beforeEach(
+ waitForAsync(() => {
+ void TestBed.configureTestingModule({
+ declarations: [LoginComponent],
+ }).compileComponents();
})
- .compileComponents();
- }));
+ );
beforeEach(() => {
fixture = TestBed.createComponent(LoginComponent);
@@ -20,6 +21,6 @@ describe('LoginComponent', () => {
});
it('should create', () => {
- expect(component).toBeTruthy();
+ void expect(component).toBeTruthy();
});
});
diff --git a/src/app/modules/user/login/login.component.ts b/src/app/modules/user/login/login.component.ts
index 9ca8ddc..04d5cd6 100644
--- a/src/app/modules/user/login/login.component.ts
+++ b/src/app/modules/user/login/login.component.ts
@@ -3,39 +3,37 @@ import {FormControl, FormGroup, Validators} from '@angular/forms';
import {Router} from '@angular/router';
import {UserService} from '../../../services/user/user.service';
import {faSignInAlt} from '@fortawesome/free-solid-svg-icons/faSignInAlt';
-import {faWindowRestore} from '@fortawesome/free-solid-svg-icons/faWindowRestore';
import {faUserPlus} from '@fortawesome/free-solid-svg-icons/faUserPlus';
@Component({
selector: 'app-login',
templateUrl: './login.component.html',
- styleUrls: ['./login.component.less']
+ styleUrls: ['./login.component.less'],
})
export class LoginComponent implements OnInit {
public form: FormGroup;
public errorMessage: string;
public faSignIn = faSignInAlt;
- public faNewPassword = faWindowRestore;
public faNewUser = faUserPlus;
- constructor(private userService: UserService, private router: Router) {
- }
+ public constructor(private userService: UserService, private router: Router) {}
- ngOnInit() {
+ public ngOnInit(): void {
this.form = new FormGroup({
user: new FormControl(null, [Validators.required, Validators.email]),
pass: new FormControl(null, [Validators.required]),
});
}
- public async onLogin() {
+ public async onLogin(): Promise {
this.form.updateValueAndValidity();
if (this.form.valid) {
try {
- await this.userService.login(this.form.value.user, this.form.value.pass);
+ const value = this.form.value as {user: string; pass: string};
+ await this.userService.login(value.user, value.pass);
await this.router.navigateByUrl('/');
- } catch (ex) {
- this.errorMessage = ex.code;
+ } catch ({code}) {
+ this.errorMessage = code as string;
}
}
}
diff --git a/src/app/modules/user/logout/logout.component.spec.ts b/src/app/modules/user/logout/logout.component.spec.ts
index 3cf8c2d..dfd15cb 100644
--- a/src/app/modules/user/logout/logout.component.spec.ts
+++ b/src/app/modules/user/logout/logout.component.spec.ts
@@ -6,12 +6,13 @@ describe('LogoutComponent', () => {
let component: LogoutComponent;
let fixture: ComponentFixture;
- beforeEach(waitForAsync(() => {
- TestBed.configureTestingModule({
- declarations: [LogoutComponent]
+ beforeEach(
+ waitForAsync(() => {
+ void TestBed.configureTestingModule({
+ declarations: [LogoutComponent],
+ }).compileComponents();
})
- .compileComponents();
- }));
+ );
beforeEach(() => {
fixture = TestBed.createComponent(LogoutComponent);
@@ -20,6 +21,6 @@ describe('LogoutComponent', () => {
});
it('should create', () => {
- expect(component).toBeTruthy();
+ void expect(component).toBeTruthy();
});
});
diff --git a/src/app/modules/user/logout/logout.component.ts b/src/app/modules/user/logout/logout.component.ts
index b02e6c7..2cbe3cf 100644
--- a/src/app/modules/user/logout/logout.component.ts
+++ b/src/app/modules/user/logout/logout.component.ts
@@ -5,13 +5,12 @@ import {UserService} from '../../../services/user/user.service';
@Component({
selector: 'app-logout',
templateUrl: './logout.component.html',
- styleUrls: ['./logout.component.less']
+ styleUrls: ['./logout.component.less'],
})
export class LogoutComponent implements AfterViewInit {
- constructor(private userService: UserService, private router: Router) {
- }
+ public constructor(private userService: UserService, private router: Router) {}
- public async ngAfterViewInit() {
+ public async ngAfterViewInit(): Promise {
await this.userService.logout();
await this.router.navigateByUrl('/');
}
diff --git a/src/app/modules/user/new/new.component.html b/src/app/modules/user/new/new.component.html
index 41985ed..faa3da5 100644
--- a/src/app/modules/user/new/new.component.html
+++ b/src/app/modules/user/new/new.component.html
@@ -1,18 +1,20 @@
Name
-
+
E-Mail Adresse
-
+
Passwort
-
+
- Benutzer anlegen
+ Benutzer anlegen
+
diff --git a/src/app/modules/user/new/new.component.spec.ts b/src/app/modules/user/new/new.component.spec.ts
index 22a386c..2756000 100644
--- a/src/app/modules/user/new/new.component.spec.ts
+++ b/src/app/modules/user/new/new.component.spec.ts
@@ -6,12 +6,13 @@ describe('NewComponent', () => {
let component: NewComponent;
let fixture: ComponentFixture;
- beforeEach(waitForAsync(() => {
- TestBed.configureTestingModule({
- declarations: [NewComponent]
+ beforeEach(
+ waitForAsync(() => {
+ void TestBed.configureTestingModule({
+ declarations: [NewComponent],
+ }).compileComponents();
})
- .compileComponents();
- }));
+ );
beforeEach(() => {
fixture = TestBed.createComponent(NewComponent);
@@ -20,6 +21,6 @@ describe('NewComponent', () => {
});
it('should create', () => {
- expect(component).toBeTruthy();
+ void expect(component).toBeTruthy();
});
});
diff --git a/src/app/modules/user/new/new.component.ts b/src/app/modules/user/new/new.component.ts
index 749a746..bd1145c 100644
--- a/src/app/modules/user/new/new.component.ts
+++ b/src/app/modules/user/new/new.component.ts
@@ -6,16 +6,15 @@ import {faUserPlus} from '@fortawesome/free-solid-svg-icons/faUserPlus';
@Component({
selector: 'app-new',
templateUrl: './new.component.html',
- styleUrls: ['./new.component.less']
+ styleUrls: ['./new.component.less'],
})
export class NewComponent implements OnInit {
public form: FormGroup;
public faNewUser = faUserPlus;
- constructor(private fb: FormBuilder, private userService: UserService) {
- }
+ public constructor(private fb: FormBuilder, private userService: UserService) {}
- ngOnInit(): void {
+ public ngOnInit(): void {
this.form = this.fb.group({
email: new FormControl(null, [Validators.required, Validators.email]),
name: new FormControl(null, [Validators.required]),
@@ -27,7 +26,12 @@ export class NewComponent implements OnInit {
this.form.updateValueAndValidity();
if (this.form.valid) {
try {
- await this.userService.createNewUser(this.form.value.email, this.form.value.name, this.form.value.password);
+ const value = this.form.value as {
+ email: string;
+ name: string;
+ password: string;
+ };
+ await this.userService.createNewUser(value.email, value.name, value.password);
} catch (ex) {
console.error(ex);
}
diff --git a/src/app/modules/user/password-send/password-send.component.html b/src/app/modules/user/password-send/password-send.component.html
index 3a80618..51c8411 100644
--- a/src/app/modules/user/password-send/password-send.component.html
+++ b/src/app/modules/user/password-send/password-send.component.html
@@ -1,4 +1,4 @@
- Eine E-Mail mit dem neuen Passwort wurde gesendet.
- Darin ist der link enthalten, über den das neue Passwort eingegeben werden kann.
+ Eine E-Mail mit dem neuen Passwort wurde gesendet. Darin ist der link
+ enthalten, über den das neue Passwort eingegeben werden kann.
diff --git a/src/app/modules/user/password-send/password-send.component.spec.ts b/src/app/modules/user/password-send/password-send.component.spec.ts
index 33a55c8..bf01786 100644
--- a/src/app/modules/user/password-send/password-send.component.spec.ts
+++ b/src/app/modules/user/password-send/password-send.component.spec.ts
@@ -6,12 +6,13 @@ describe('PasswordSendComponent', () => {
let component: PasswordSendComponent;
let fixture: ComponentFixture;
- beforeEach(waitForAsync(() => {
- TestBed.configureTestingModule({
- declarations: [PasswordSendComponent]
+ beforeEach(
+ waitForAsync(() => {
+ void TestBed.configureTestingModule({
+ declarations: [PasswordSendComponent],
+ }).compileComponents();
})
- .compileComponents();
- }));
+ );
beforeEach(() => {
fixture = TestBed.createComponent(PasswordSendComponent);
@@ -20,6 +21,6 @@ describe('PasswordSendComponent', () => {
});
it('should create', () => {
- expect(component).toBeTruthy();
+ void expect(component).toBeTruthy();
});
});
diff --git a/src/app/modules/user/password-send/password-send.component.ts b/src/app/modules/user/password-send/password-send.component.ts
index 8742a6c..475f737 100644
--- a/src/app/modules/user/password-send/password-send.component.ts
+++ b/src/app/modules/user/password-send/password-send.component.ts
@@ -1,16 +1,8 @@
-import {Component, OnInit} from '@angular/core';
+import {Component} from '@angular/core';
@Component({
selector: 'app-password-send',
templateUrl: './password-send.component.html',
- styleUrls: ['./password-send.component.less']
+ styleUrls: ['./password-send.component.less'],
})
-export class PasswordSendComponent implements OnInit {
-
- constructor() {
- }
-
- ngOnInit(): void {
- }
-
-}
+export class PasswordSendComponent {}
diff --git a/src/app/modules/user/password/password.component.html b/src/app/modules/user/password/password.component.html
index 01129ab..bc77401 100644
--- a/src/app/modules/user/password/password.component.html
+++ b/src/app/modules/user/password/password.component.html
@@ -2,14 +2,18 @@
-
diff --git a/src/app/modules/user/password/password.component.spec.ts b/src/app/modules/user/password/password.component.spec.ts
index fc5218c..fcfed91 100644
--- a/src/app/modules/user/password/password.component.spec.ts
+++ b/src/app/modules/user/password/password.component.spec.ts
@@ -6,12 +6,13 @@ describe('PasswordComponent', () => {
let component: PasswordComponent;
let fixture: ComponentFixture;
- beforeEach(waitForAsync(() => {
- TestBed.configureTestingModule({
- declarations: [PasswordComponent]
+ beforeEach(
+ waitForAsync(() => {
+ void TestBed.configureTestingModule({
+ declarations: [PasswordComponent],
+ }).compileComponents();
})
- .compileComponents();
- }));
+ );
beforeEach(() => {
fixture = TestBed.createComponent(PasswordComponent);
@@ -20,6 +21,6 @@ describe('PasswordComponent', () => {
});
it('should create', () => {
- expect(component).toBeTruthy();
+ void expect(component).toBeTruthy();
});
});
diff --git a/src/app/modules/user/password/password.component.ts b/src/app/modules/user/password/password.component.ts
index 4be802d..13a141a 100644
--- a/src/app/modules/user/password/password.component.ts
+++ b/src/app/modules/user/password/password.component.ts
@@ -1,5 +1,5 @@
import {Component, OnInit} from '@angular/core';
-import {FormControl, FormGroup, Validators} from '@angular/forms';
+import {AbstractControl, FormControl, FormGroup, Validators} from '@angular/forms';
import {Router} from '@angular/router';
import {UserService} from '../../../services/user/user.service';
import {faWindowRestore} from '@fortawesome/free-solid-svg-icons/faWindowRestore';
@@ -7,32 +7,33 @@ import {faWindowRestore} from '@fortawesome/free-solid-svg-icons/faWindowRestore
@Component({
selector: 'app-password',
templateUrl: './password.component.html',
- styleUrls: ['./password.component.less']
+ styleUrls: ['./password.component.less'],
})
export class PasswordComponent implements OnInit {
public form: FormGroup;
public errorMessage: string;
public faNewPassword = faWindowRestore;
- constructor(public userService: UserService, private router: Router) {
- }
+ public constructor(public userService: UserService, private router: Router) {}
public ngOnInit(): void {
+ const required = (c: AbstractControl) => Validators.required(c);
+ const email = Validators.email;
this.form = new FormGroup({
- user: new FormControl(null, [Validators.required, Validators.email])
+ user: new FormControl(null, [required, email]),
});
}
- public async onResetPassword() {
+ public async onResetPassword(): Promise {
this.form.updateValueAndValidity();
if (this.form.valid) {
try {
- await this.userService.changePassword(this.form.value.user);
+ const value = this.form.value as {user: string};
+ await this.userService.changePassword(value.user);
await this.router.navigateByUrl('/user/password-send');
- } catch (ex) {
- this.errorMessage = ex.code;
+ } catch ({code}) {
+ this.errorMessage = code as string;
}
}
}
-
}
diff --git a/src/app/modules/user/user-routing.module.ts b/src/app/modules/user/user-routing.module.ts
index 47bfa4f..ef08b9c 100644
--- a/src/app/modules/user/user-routing.module.ts
+++ b/src/app/modules/user/user-routing.module.ts
@@ -8,44 +8,42 @@ import {PasswordComponent} from './password/password.component';
import {PasswordSendComponent} from './password-send/password-send.component';
import {NewComponent} from './new/new.component';
-
const routes: Routes = [
{
path: '',
redirectTo: 'info',
- pathMatch: 'full'
+ pathMatch: 'full',
},
{
path: 'login',
- component: LoginComponent
+ component: LoginComponent,
},
{
path: 'logout',
- component: LogoutComponent
+ component: LogoutComponent,
},
{
path: 'password',
- component: PasswordComponent
+ component: PasswordComponent,
},
{
path: 'new',
- component: NewComponent
+ component: NewComponent,
},
{
path: 'password-send',
- component: PasswordSendComponent
+ component: PasswordSendComponent,
},
{
path: 'info',
component: InfoComponent,
canActivate: [AngularFireAuthGuard],
- data: {authGuardPipe: () => redirectUnauthorizedTo(['user', 'login'])}
+ data: {authGuardPipe: () => redirectUnauthorizedTo(['user', 'login'])},
},
];
@NgModule({
imports: [RouterModule.forChild(routes)],
- exports: [RouterModule]
+ exports: [RouterModule],
})
-export class UserRoutingModule {
-}
+export class UserRoutingModule {}
diff --git a/src/app/modules/user/user.module.ts b/src/app/modules/user/user.module.ts
index 79f35ec..e572c88 100644
--- a/src/app/modules/user/user.module.ts
+++ b/src/app/modules/user/user.module.ts
@@ -23,7 +23,6 @@ import {ButtonModule} from '../../widget-modules/components/button/button.module
import {LogoModule} from '../../widget-modules/components/logo/logo.module';
import {FontAwesomeModule} from '@fortawesome/angular-fontawesome';
-
@NgModule({
declarations: [LoginComponent, AuthMessagePipe, InfoComponent, LogoutComponent, RolePipe, PasswordComponent, PasswordSendComponent, UsersComponent, UserComponent, NewComponent],
imports: [
@@ -41,9 +40,6 @@ import {FontAwesomeModule} from '@fortawesome/angular-fontawesome';
ButtonModule,
LogoModule,
FontAwesomeModule,
-
-
- ]
+ ],
})
-export class UserModule {
-}
+export class UserModule {}
diff --git a/src/app/services/config.service.spec.ts b/src/app/services/config.service.spec.ts
index 2264bb7..ae1c2f1 100644
--- a/src/app/services/config.service.spec.ts
+++ b/src/app/services/config.service.spec.ts
@@ -6,11 +6,11 @@ describe('ConfigService', () => {
let service: ConfigService;
beforeEach(() => {
- TestBed.configureTestingModule({});
+ void TestBed.configureTestingModule({});
service = TestBed.inject(ConfigService);
});
it('should be created', () => {
- expect(service).toBeTruthy();
+ void expect(service).toBeTruthy();
});
});
diff --git a/src/app/services/config.service.ts b/src/app/services/config.service.ts
index 0a9a0ce..7c8e31d 100644
--- a/src/app/services/config.service.ts
+++ b/src/app/services/config.service.ts
@@ -5,11 +5,10 @@ import {Config} from './config';
import {first} from 'rxjs/operators';
@Injectable({
- providedIn: 'root'
+ providedIn: 'root',
})
export class ConfigService {
- constructor(private db: DbService) {
- }
+ public constructor(private db: DbService) {}
public get get$(): Observable {
return this.db.doc$('global/config');
diff --git a/src/app/services/db.service.spec.ts b/src/app/services/db.service.spec.ts
index e7412cf..741beb2 100644
--- a/src/app/services/db.service.spec.ts
+++ b/src/app/services/db.service.spec.ts
@@ -3,10 +3,10 @@ import {TestBed} from '@angular/core/testing';
import {DbService} from './db.service';
describe('DbService', () => {
- beforeEach(() => TestBed.configureTestingModule({}));
+ beforeEach(() => void TestBed.configureTestingModule({}));
it('should be created', () => {
- const service: DbService = TestBed.get(DbService);
- expect(service).toBeTruthy();
+ const service: DbService = TestBed.inject(DbService);
+ void expect(service).toBeTruthy();
});
});
diff --git a/src/app/services/db.service.ts b/src/app/services/db.service.ts
index ba574e5..a684c37 100644
--- a/src/app/services/db.service.ts
+++ b/src/app/services/db.service.ts
@@ -1,19 +1,18 @@
import {Injectable} from '@angular/core';
import {AngularFirestore, AngularFirestoreCollection, AngularFirestoreDocument} from '@angular/fire/firestore';
import {Observable} from 'rxjs';
+import {QueryFn} from '@angular/fire/firestore/interfaces';
type CollectionPredicate = string | AngularFirestoreCollection;
type DocumentPredicate = string | AngularFirestoreDocument;
@Injectable({
- providedIn: 'root'
+ providedIn: 'root',
})
export class DbService {
+ public constructor(private afs: AngularFirestore) {}
- constructor(private afs: AngularFirestore) {
- }
-
- public col(ref: CollectionPredicate, queryFn?): AngularFirestoreCollection {
+ public col(ref: CollectionPredicate, queryFn?: QueryFn): AngularFirestoreCollection {
return typeof ref === 'string' ? this.afs.collection(ref, queryFn) : ref;
}
@@ -23,10 +22,9 @@ export class DbService {
public doc$(ref: DocumentPredicate): Observable {
return this.doc(ref).valueChanges({idField: 'id'});
-
}
- public col$(ref: CollectionPredicate, queryFn?): Observable {
+ public col$(ref: CollectionPredicate, queryFn?: QueryFn): Observable {
return this.col(ref, queryFn).valueChanges({idField: 'id'});
}
}
diff --git a/src/app/services/delay.ts b/src/app/services/delay.ts
index c345e6c..0ab9dab 100644
--- a/src/app/services/delay.ts
+++ b/src/app/services/delay.ts
@@ -1 +1 @@
-export const delay = (ms: number): Promise => new Promise(resolve => setTimeout(resolve, ms));
+export const delay = (ms: number): Promise => new Promise(resolve => setTimeout(resolve, ms));
diff --git a/src/app/services/global-settings.service.spec.ts b/src/app/services/global-settings.service.spec.ts
index d99e398..d2a7c94 100644
--- a/src/app/services/global-settings.service.spec.ts
+++ b/src/app/services/global-settings.service.spec.ts
@@ -6,11 +6,11 @@ describe('GlobalSettingsService', () => {
let service: GlobalSettingsService;
beforeEach(() => {
- TestBed.configureTestingModule({});
+ void TestBed.configureTestingModule({});
service = TestBed.inject(GlobalSettingsService);
});
it('should be created', () => {
- expect(service).toBeTruthy();
+ void expect(service).toBeTruthy();
});
});
diff --git a/src/app/services/global-settings.service.ts b/src/app/services/global-settings.service.ts
index 8a23015..04f5189 100644
--- a/src/app/services/global-settings.service.ts
+++ b/src/app/services/global-settings.service.ts
@@ -4,18 +4,16 @@ import {GlobalSettings} from './global-settings';
import {Observable} from 'rxjs';
@Injectable({
- providedIn: 'root'
+ providedIn: 'root',
})
export class GlobalSettingsService {
- constructor(private db: DbService) {
- }
+ public constructor(private db: DbService) {}
public get get$(): Observable {
return this.db.doc$('global/static');
}
- public async set(data: Partial) {
+ public async set(data: Partial): Promise {
await this.db.doc('global/static').update(data);
}
-
}
diff --git a/src/app/services/scroll.service.spec.ts b/src/app/services/scroll.service.spec.ts
index d372776..76f52b6 100644
--- a/src/app/services/scroll.service.spec.ts
+++ b/src/app/services/scroll.service.spec.ts
@@ -6,11 +6,11 @@ describe('ScrollService', () => {
let service: ScrollService;
beforeEach(() => {
- TestBed.configureTestingModule({});
+ void TestBed.configureTestingModule({});
service = TestBed.inject(ScrollService);
});
it('should be created', () => {
- expect(service).toBeTruthy();
+ void expect(service).toBeTruthy();
});
});
diff --git a/src/app/services/scroll.service.ts b/src/app/services/scroll.service.ts
index 748928c..56dc702 100644
--- a/src/app/services/scroll.service.ts
+++ b/src/app/services/scroll.service.ts
@@ -2,24 +2,24 @@ import {Injectable} from '@angular/core';
import {BehaviorSubject} from 'rxjs';
@Injectable({
- providedIn: 'root'
+ providedIn: 'root',
})
export class ScrollService {
private scrollPosition: number;
- private scrollSlots = {};
- private _restoreScrollPosition$ = new BehaviorSubject(0);
- public restoreScrollPosition$ = this._restoreScrollPosition$.asObservable();
+ private scrollSlots: {[key: string]: number} = {};
+ private iRestoreScrollPosition$ = new BehaviorSubject(0);
+ public restoreScrollPosition$ = this.iRestoreScrollPosition$.asObservable();
- public saveScrollPosition(pos: number) {
+ public saveScrollPosition(pos: number): void {
this.scrollPosition = pos;
}
- public storeScrollPositionFor(slot: string) {
+ public storeScrollPositionFor(slot: string): void {
this.scrollSlots[slot] = this.scrollPosition;
}
- public restoreScrollPositionFor(slot: string) {
+ public restoreScrollPositionFor(slot: string): void {
const pos = this.scrollSlots[slot];
- this._restoreScrollPosition$.next(pos);
+ this.iRestoreScrollPosition$.next(pos);
}
}
diff --git a/src/app/services/user/owner.directive.ts b/src/app/services/user/owner.directive.ts
index 3efd99d..4372c30 100644
--- a/src/app/services/user/owner.directive.ts
+++ b/src/app/services/user/owner.directive.ts
@@ -2,27 +2,21 @@ import {Directive, ElementRef, Input, OnInit, TemplateRef, ViewContainerRef} fro
import {UserService} from './user.service';
@Directive({
- selector: '[appOwner]'
+ selector: '[appOwner]',
})
export class OwnerDirective implements OnInit {
private currentUserId: string;
- private _appOwner: string;
+ private iAppOwner: string;
- @Input() set appOwner(value: string) {
- this._appOwner = value;
+ public constructor(private element: ElementRef, private templateRef: TemplateRef, private viewContainer: ViewContainerRef, private userService: UserService) {}
+
+ @Input()
+ public set appOwner(value: string) {
+ this.iAppOwner = value;
this.updateView();
}
- constructor(
- private element: ElementRef,
- private templateRef: TemplateRef,
- private viewContainer: ViewContainerRef,
- private userService: UserService
- ) {
-
- }
-
public ngOnInit(): void {
this.userService.userId$.subscribe(user => {
this.currentUserId = user;
@@ -33,9 +27,8 @@ export class OwnerDirective implements OnInit {
private updateView() {
this.viewContainer.clear();
- if (this.currentUserId === this._appOwner) {
+ if (this.currentUserId === this.iAppOwner) {
this.viewContainer.createEmbeddedView(this.templateRef);
}
}
-
}
diff --git a/src/app/services/user/owner.module.ts b/src/app/services/user/owner.module.ts
index 3d764dc..116d532 100644
--- a/src/app/services/user/owner.module.ts
+++ b/src/app/services/user/owner.module.ts
@@ -5,9 +5,6 @@ import {CommonModule} from '@angular/common';
@NgModule({
declarations: [OwnerDirective],
exports: [OwnerDirective],
- imports: [
- CommonModule
- ]
+ imports: [CommonModule],
})
-export class OwnerModule {
-}
+export class OwnerModule {}
diff --git a/src/app/services/user/role.directive.ts b/src/app/services/user/role.directive.ts
index 4aacf13..07d2ec4 100644
--- a/src/app/services/user/role.directive.ts
+++ b/src/app/services/user/role.directive.ts
@@ -4,21 +4,14 @@ import {UserService} from './user.service';
import {User} from './user';
@Directive({
- selector: '[appRole]'
+ selector: '[appRole]',
})
export class RoleDirective implements OnInit {
- @Input() appRole: roles[] = [];
+ @Input() public appRole: roles[] = [];
private currentUser: User;
private loggedIn: boolean;
- constructor(
- private element: ElementRef,
- private templateRef: TemplateRef,
- private viewContainer: ViewContainerRef,
- private userService: UserService
- ) {
-
- }
+ public constructor(private element: ElementRef, private templateRef: TemplateRef, private viewContainer: ViewContainerRef, private userService: UserService) {}
public ngOnInit(): void {
this.userService.user$.subscribe(user => {
@@ -53,6 +46,4 @@ export class RoleDirective implements OnInit {
return false;
}
-
-
}
diff --git a/src/app/services/user/role.module.ts b/src/app/services/user/role.module.ts
index db0b9f7..73500f3 100644
--- a/src/app/services/user/role.module.ts
+++ b/src/app/services/user/role.module.ts
@@ -5,9 +5,6 @@ import {RoleDirective} from './role.directive';
@NgModule({
declarations: [RoleDirective],
exports: [RoleDirective],
- imports: [
- CommonModule
- ]
+ imports: [CommonModule],
})
-export class RoleModule {
-}
+export class RoleModule {}
diff --git a/src/app/services/user/user-name/user-name.component.html b/src/app/services/user/user-name/user-name.component.html
index 0014401..8faa666 100644
--- a/src/app/services/user/user-name/user-name.component.html
+++ b/src/app/services/user/user-name/user-name.component.html
@@ -1 +1 @@
-{{name$|async}}
+{{ name$ | async }}
diff --git a/src/app/services/user/user-name/user-name.component.spec.ts b/src/app/services/user/user-name/user-name.component.spec.ts
index 27b1e5f..f7d8270 100644
--- a/src/app/services/user/user-name/user-name.component.spec.ts
+++ b/src/app/services/user/user-name/user-name.component.spec.ts
@@ -6,12 +6,13 @@ describe('UserNameComponent', () => {
let component: UserNameComponent;
let fixture: ComponentFixture;
- beforeEach(waitForAsync(() => {
- TestBed.configureTestingModule({
- declarations: [UserNameComponent]
+ beforeEach(
+ waitForAsync(() => {
+ void TestBed.configureTestingModule({
+ declarations: [UserNameComponent],
+ }).compileComponents();
})
- .compileComponents();
- }));
+ );
beforeEach(() => {
fixture = TestBed.createComponent(UserNameComponent);
@@ -20,6 +21,6 @@ describe('UserNameComponent', () => {
});
it('should create', () => {
- expect(component).toBeTruthy();
+ void expect(component).toBeTruthy();
});
});
diff --git a/src/app/services/user/user-name/user-name.component.ts b/src/app/services/user/user-name/user-name.component.ts
index 15156a6..e49d31a 100644
--- a/src/app/services/user/user-name/user-name.component.ts
+++ b/src/app/services/user/user-name/user-name.component.ts
@@ -6,18 +6,15 @@ import {Observable} from 'rxjs';
@Component({
selector: 'app-user-name',
templateUrl: './user-name.component.html',
- styleUrls: ['./user-name.component.less']
+ styleUrls: ['./user-name.component.less'],
})
export class UserNameComponent {
public name$: Observable;
- constructor(
- private userService: UserService
- ) {
- }
+ public constructor(private userService: UserService) {}
- @Input() set userId(id: string) {
+ @Input()
+ public set userId(id: string) {
this.name$ = this.userService.getUserbyId$(id).pipe(map(_ => _.name));
}
-
}
diff --git a/src/app/services/user/user-name/user-name.module.ts b/src/app/services/user/user-name/user-name.module.ts
index 18cd0e3..d312229 100644
--- a/src/app/services/user/user-name/user-name.module.ts
+++ b/src/app/services/user/user-name/user-name.module.ts
@@ -5,7 +5,6 @@ import {UserNameComponent} from './user-name.component';
@NgModule({
declarations: [UserNameComponent],
exports: [UserNameComponent],
- imports: [CommonModule]
+ imports: [CommonModule],
})
-export class UserNameModule {
-}
+export class UserNameModule {}
diff --git a/src/app/services/user/user.service.spec.ts b/src/app/services/user/user.service.spec.ts
index e927575..f97391f 100644
--- a/src/app/services/user/user.service.spec.ts
+++ b/src/app/services/user/user.service.spec.ts
@@ -3,10 +3,10 @@ import {TestBed} from '@angular/core/testing';
import {UserService} from './user.service';
describe('UserService', () => {
- beforeEach(() => TestBed.configureTestingModule({}));
+ beforeEach(() => void TestBed.configureTestingModule({}));
it('should be created', () => {
- const service: UserService = TestBed.get(UserService);
- expect(service).toBeTruthy();
+ const service: UserService = TestBed.inject(UserService);
+ void expect(service).toBeTruthy();
});
});
diff --git a/src/app/services/user/user.service.ts b/src/app/services/user/user.service.ts
index eba5714..067e38b 100644
--- a/src/app/services/user/user.service.ts
+++ b/src/app/services/user/user.service.ts
@@ -8,27 +8,28 @@ import {environment} from '../../../environments/environment';
import {Router} from '@angular/router';
@Injectable({
- providedIn: 'root'
+ providedIn: 'root',
})
export class UserService {
- constructor(private afAuth: AngularFireAuth, private db: DbService, private router: Router) {
- this.afAuth.authState.pipe(
- filter(_ => !!_),
- tap(auth => this._userId$.next(auth.uid)),
- switchMap(auth => this.readUser$(auth.uid)),
- ).subscribe(_ => this._user$.next(_));
- }
+ private iUserId$ = new BehaviorSubject(null);
+ private iUser$ = new BehaviorSubject(null);
- private _userId$ = new BehaviorSubject(null);
+ public constructor(private afAuth: AngularFireAuth, private db: DbService, private router: Router) {
+ this.afAuth.authState
+ .pipe(
+ filter(_ => !!_),
+ tap(auth => this.iUserId$.next(auth.uid)),
+ switchMap(auth => this.readUser$(auth.uid))
+ )
+ .subscribe(_ => this.iUser$.next(_));
+ }
public get userId$(): Observable {
- return this._userId$.asObservable();
+ return this.iUserId$.asObservable();
}
- private _user$ = new BehaviorSubject(null);
-
public get user$(): Observable {
- return this._user$.pipe(filter(_ => !!_));
+ return this.iUser$.pipe(filter(_ => !!_));
}
public async currentUser(): Promise {
@@ -43,44 +44,42 @@ export class UserService {
return this.db.doc$('users/' + userId);
}
- public async login(user: string, password: string): Promise {
+ public async login(user: string, password: string): Promise {
const aUser = await this.afAuth.signInWithEmailAndPassword(user, password);
const dUser = await this.readUser(aUser.user.uid);
- this._user$.next(dUser);
- this._userId$.next(aUser.user.uid);
+ this.iUser$.next(dUser);
+ this.iUserId$.next(aUser.user.uid);
+ return aUser.user.uid;
}
- public loggedIn$ = () => this.afAuth.authState;
+ public loggedIn$: () => Observable = () => this.afAuth.authState;
- public list$ = (): Observable => this.db.col$('users');
+ public list$: () => Observable = (): Observable => this.db.col$('users');
- public async logout(): Promise {
+ public async logout(): Promise {
await this.afAuth.signOut();
- this._user$.next(null);
- this._userId$.next(null);
+ this.iUser$.next(null);
+ this.iUserId$.next(null);
}
public async update$(uid: string, data: Partial): Promise {
await this.db.doc('users/' + uid).update(data);
}
- public async changePassword(user: string): Promise {
+ public async changePassword(user: string): Promise {
const url = environment.url;
await this.afAuth.sendPasswordResetEmail(user, {url});
}
- public async createNewUser(user: string, name: string, password: string): Promise {
+ public async createNewUser(user: string, name: string, password: string): Promise {
const aUser = await this.afAuth.createUserWithEmailAndPassword(user, password);
const userId = aUser.user.uid;
await this.db.doc('users/' + userId).set({name, chordMode: 'onlyFirst'});
const dUser = await this.readUser(aUser.user.uid);
- this._user$.next(dUser);
+ this.iUser$.next(dUser);
await this.router.navigateByUrl('/brand/new-user');
}
- private readUser$ = (uid) => this.db.doc$('users/' + uid);
-
- private async readUser(uid): Promise {
- return await this.readUser$(uid).pipe(first()).toPromise();
- }
+ private readUser$ = (uid: string) => this.db.doc$('users/' + uid);
+ private readUser = async (uid: string): Promise => await this.readUser$(uid).pipe(first()).toPromise();
}
diff --git a/src/app/widget-modules/components/add-song/add-song.component.html b/src/app/widget-modules/components/add-song/add-song.component.html
index def72e6..220d8bd 100644
--- a/src/app/widget-modules/components/add-song/add-song.component.html
+++ b/src/app/widget-modules/components/add-song/add-song.component.html
@@ -3,9 +3,13 @@
Lied hinzufügen...
-
+
- {{song.title}}
+ {{
+ song.title
+ }}
diff --git a/src/app/widget-modules/components/add-song/add-song.component.spec.ts b/src/app/widget-modules/components/add-song/add-song.component.spec.ts
index dc41b7b..f239d51 100644
--- a/src/app/widget-modules/components/add-song/add-song.component.spec.ts
+++ b/src/app/widget-modules/components/add-song/add-song.component.spec.ts
@@ -6,12 +6,13 @@ describe('AddSongComponent', () => {
let component: AddSongComponent;
let fixture: ComponentFixture;
- beforeEach(waitForAsync(() => {
- TestBed.configureTestingModule({
- declarations: [AddSongComponent]
+ beforeEach(
+ waitForAsync(() => {
+ void TestBed.configureTestingModule({
+ declarations: [AddSongComponent],
+ }).compileComponents();
})
- .compileComponents();
- }));
+ );
beforeEach(() => {
fixture = TestBed.createComponent(AddSongComponent);
@@ -20,6 +21,6 @@ describe('AddSongComponent', () => {
});
it('should create', () => {
- expect(component).toBeTruthy();
+ void expect(component).toBeTruthy();
});
});
diff --git a/src/app/widget-modules/components/add-song/add-song.component.ts b/src/app/widget-modules/components/add-song/add-song.component.ts
index 757a9dc..1a8a8f4 100644
--- a/src/app/widget-modules/components/add-song/add-song.component.ts
+++ b/src/app/widget-modules/components/add-song/add-song.component.ts
@@ -9,7 +9,7 @@ import {ShowSongService} from '../../../modules/shows/services/show-song.service
@Component({
selector: 'app-add-song',
templateUrl: './add-song.component.html',
- styleUrls: ['./add-song.component.less']
+ styleUrls: ['./add-song.component.less'],
})
export class AddSongComponent {
@Input() public songs: Song[];
@@ -18,10 +18,9 @@ export class AddSongComponent {
@Input() public addedLive = false;
public filteredSongsControl = new FormControl();
- constructor(private showSongService: ShowSongService) {
- }
+ public constructor(private showSongService: ShowSongService) {}
- filteredSongs() {
+ public filteredSongs(): Song[] {
const songs = this.songs
.filter(_ => !!_)
.filter(_ => !!_.title)
@@ -37,14 +36,13 @@ export class AddSongComponent {
return 0;
});
- const filterValue = this.filteredSongsControl.value;
+ const filterValue = this.filteredSongsControl.value as string;
return filterValue ? songs.filter(_ => filterSong(_, filterValue)) : songs;
}
- public async onAddSongSelectionChanged(event: MatSelectChange) {
+ public async onAddSongSelectionChanged(event: MatSelectChange): Promise {
const order = this.showSongs.reduce((oa, u) => Math.max(oa, u.order), 0) + 1;
await this.showSongService.new$(this.showId, event.value, order, this.addedLive);
event.source.value = null;
}
-
}
diff --git a/src/app/widget-modules/components/add-song/add-song.module.ts b/src/app/widget-modules/components/add-song/add-song.module.ts
index 62a167a..5b5984f 100644
--- a/src/app/widget-modules/components/add-song/add-song.module.ts
+++ b/src/app/widget-modules/components/add-song/add-song.module.ts
@@ -6,19 +6,9 @@ import {MatSelectModule} from '@angular/material/select';
import {NgxMatSelectSearchModule} from 'ngx-mat-select-search';
import {ReactiveFormsModule} from '@angular/forms';
-
@NgModule({
declarations: [AddSongComponent],
- exports: [
- AddSongComponent
- ],
- imports: [
- CommonModule,
- MatFormFieldModule,
- MatSelectModule,
- NgxMatSelectSearchModule,
- ReactiveFormsModule
- ]
+ exports: [AddSongComponent],
+ imports: [CommonModule, MatFormFieldModule, MatSelectModule, NgxMatSelectSearchModule, ReactiveFormsModule],
})
-export class AddSongModule {
-}
+export class AddSongModule {}
diff --git a/src/app/widget-modules/components/application-frame/application-frame.module.ts b/src/app/widget-modules/components/application-frame/application-frame.module.ts
index 3301a7a..db3477b 100644
--- a/src/app/widget-modules/components/application-frame/application-frame.module.ts
+++ b/src/app/widget-modules/components/application-frame/application-frame.module.ts
@@ -10,22 +10,8 @@ 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
- ]
+ declarations: [NavigationComponent, FilterComponent, LinkComponent, BrandComponent],
+ imports: [CommonModule, RouterModule, FontAwesomeModule, FormsModule, RoleModule],
+ exports: [NavigationComponent],
})
-export class ApplicationFrameModule {
-}
+export class ApplicationFrameModule {}
diff --git a/src/app/widget-modules/components/application-frame/navigation/brand/brand.component.html b/src/app/widget-modules/components/application-frame/navigation/brand/brand.component.html
index da9a16e..fae16ca 100644
--- a/src/app/widget-modules/components/application-frame/navigation/brand/brand.component.html
+++ b/src/app/widget-modules/components/application-frame/navigation/brand/brand.component.html
@@ -2,18 +2,24 @@
-
+
+ style="
+ fill: #ffffff;
+ fill-opacity: 1;
+ stroke: none;
+ stroke-width: 1;
+ stroke-miterlimit: 4;
+ stroke-dasharray: none;
+ "
+ transform="scale(0.26458333)"
+ />