Prettied, Linted and updated angular.json according to the latest schematic of Angular CLI.

Now all that is needed is to make it ready for strict compiling.
Removed eslint-plugin-prettier as it is not recommended and causes errors for both eslint and prettier

Bumped to v8.0.0
This commit is contained in:
2020-10-10 08:45:05 +05:30
parent 438a98334d
commit 5ea09df272
320 changed files with 2233 additions and 2268 deletions
@@ -2,17 +2,20 @@ import { Component, OnInit } from '@angular/core';
import { FormArray, FormBuilder, FormGroup } from '@angular/forms';
import { MatDialog } from '@angular/material/dialog';
import { ActivatedRoute, Router } from '@angular/router';
import { BehaviorSubject, Observable } from 'rxjs';
import { IncentiveDataSource } from './incentive-datasource';
import { Account } from '../core/account';
import { VoucherService } from '../core/voucher.service';
import { Incentive, Voucher } from '../core/voucher';
import * as moment from 'moment';
import { AuthService } from '../auth/auth.service';
import { ConfirmDialogComponent } from '../shared/confirm-dialog/confirm-dialog.component';
import { ToasterService } from '../core/toaster.service';
import { BehaviorSubject, Observable } from 'rxjs';
import { map } from 'rxjs/operators';
import { AuthService } from '../auth/auth.service';
import { Account } from '../core/account';
import { Incentive } from '../core/incentive';
import { ToasterService } from '../core/toaster.service';
import { Voucher } from '../core/voucher';
import { VoucherService } from '../core/voucher.service';
import { ConfirmDialogComponent } from '../shared/confirm-dialog/confirm-dialog.component';
import { IncentiveDataSource } from './incentive-datasource';
@Component({
selector: 'app-incentive',
templateUrl: './incentive.component.html',
@@ -36,7 +39,7 @@ export class IncentiveComponent implements OnInit {
private fb: FormBuilder,
private dialog: MatDialog,
private toaster: ToasterService,
private auth: AuthService,
public auth: AuthService,
private ser: VoucherService,
) {
this.createForm();
@@ -83,17 +86,14 @@ export class IncentiveComponent implements OnInit {
this.loadVoucher(voucher);
});
}
return '';
});
}
totalPoints() {
return this.voucher.incentives
.map((item) => {
return item.daysWorked * item.points;
})
.reduce((sum, item) => {
return sum + item;
});
.map((item) => item.daysWorked * item.points)
.reduce((sum, item) => sum + item);
}
pointValue() {
@@ -105,28 +105,25 @@ export class IncentiveComponent implements OnInit {
row.points -= 1;
this.form
.get('incentives')
.get('' + i)
.setValue({ points: '' + row.points });
.get(`${i}`)
.setValue({ points: `${row.points}` });
}
}
change(row: Incentive, i: number) {
row.points = +this.form
.get('incentives')
.get('' + i)
.get('points').value;
row.points = +this.form.get('incentives').get(`${i}`).get('points').value;
this.form
.get('incentives')
.get('' + i)
.setValue({ points: '' + row.points });
.get(`${i}`)
.setValue({ points: `${row.points}` });
}
more(row: Incentive, i: number) {
row.points += 1;
this.form
.get('incentives')
.get('' + i)
.setValue({ points: '' + row.points });
.get(`${i}`)
.setValue({ points: `${row.points}` });
}
amount(row) {
@@ -136,14 +133,14 @@ export class IncentiveComponent implements OnInit {
canSave() {
if (!this.voucher.id) {
return true;
} else if (this.voucher.posted && this.auth.user.perms.indexOf('edit-posted-vouchers') !== -1) {
return true;
} else {
return (
this.voucher.user.id === this.auth.user.id ||
this.auth.user.perms.indexOf("edit-other-user's-vouchers") !== -1
);
}
if (this.voucher.posted && this.auth.user.perms.indexOf('edit-posted-vouchers') !== -1) {
return true;
}
return (
this.voucher.user.id === this.auth.user.id ||
this.auth.user.perms.indexOf("edit-other-user's-vouchers") !== -1
);
}
post() {
@@ -186,7 +183,7 @@ export class IncentiveComponent implements OnInit {
delete() {
this.ser.delete(this.voucher.id).subscribe(
(result) => {
() => {
this.toaster.show('Success', '');
this.router.navigate(['/incentive'], { replaceUrl: true });
},