clean up code

pull/37/head
HardiReady 2018-06-17 16:03:25 +02:00
parent 162453c894
commit d1f53f78c9
4 changed files with 18 additions and 18 deletions

View File

@ -51,7 +51,6 @@ export class AwardUserComponent implements OnInit {
.subscribe(id => this.userId = id);
}
toggleDecoPreview(descriptionField, decorationId, image) {
if (decorationId !== '0') {
this.decoPreviewDisplay = 'flex'; // visible & keep same height for all children
@ -72,10 +71,10 @@ export class AwardUserComponent implements OnInit {
const reason = reasonField.value;
if (decorationId && reason.length > 0) {
const award = {
'userId': this.userId,
'decorationId': decorationId,
'reason': reason,
'date': Date.now()
userId: this.userId,
decorationId: decorationId,
reason: reason,
date: Date.now()
};
this.awardingService.addAwarding(award).subscribe(() => {
this.awardingService.getUserAwardings(this.userId)

View File

@ -53,10 +53,12 @@ export class EditUserComponent implements OnInit {
user.squadId = '0';
this.ranksDisplay = 'none';
} else {
this.rankService.findRanks('', user.squadId.fraction).subscribe(ranks => {
this.ranks = ranks;
this.ranksDisplay = 'block';
});
this.rankService
.findRanks('', user.squadId.fraction)
.subscribe(ranks => {
this.ranks = ranks;
this.ranksDisplay = 'block';
});
}
this.user = user;
});
@ -68,12 +70,14 @@ export class EditUserComponent implements OnInit {
toggleRanks() {
if (this.user.squadId !== '0') {
this.rankService.findRanks('', this.user.squadId.fraction).subscribe(
ranks => {
this.ranks = ranks;
this.ranksDisplay = 'block';
}
);
this.rankService
.findRanks('', this.user.squadId.fraction)
.subscribe(
ranks => {
this.ranks = ranks;
this.ranksDisplay = 'block';
}
);
} else {
this.ranksDisplay = 'none';
}

View File

@ -34,6 +34,5 @@ export class UserItemComponent {
delete() {
this.userDelete.emit(this.user);
}
}

View File

@ -41,7 +41,6 @@ export class UserListComponent implements OnInit {
}
ngOnInit() {
this.users$ = this.userService.users$;
const paramsStream = this.route.queryParams
@ -106,5 +105,4 @@ export class UserListComponent implements OnInit {
this.location.replaceState(absoluteUrl, queryPart);
}
}