Fix various linter errors in dashboard
This commit is contained in:
parent
cd0dd73c1c
commit
4731ed9a22
1 changed files with 12 additions and 12 deletions
|
@ -44,11 +44,11 @@ export class DashboardComponent implements OnInit {
|
||||||
constructor(
|
constructor(
|
||||||
private http: Http,
|
private http: Http,
|
||||||
private api: ApiService,
|
private api: ApiService,
|
||||||
) {
|
) {
|
||||||
this.shuffle = this.shuffledArray;
|
this.shuffle = this.shuffledArray;
|
||||||
this.api.graph_data(undefined)
|
this.api.graph_data(undefined)
|
||||||
.subscribe(
|
.subscribe(
|
||||||
result => {
|
result => {
|
||||||
console.log(result);
|
console.log(result);
|
||||||
// Return what data to show 4 of
|
// Return what data to show 4 of
|
||||||
this.showGraph = result.elementstoshow.graphs;
|
this.showGraph = result.elementstoshow.graphs;
|
||||||
|
@ -91,16 +91,16 @@ export class DashboardComponent implements OnInit {
|
||||||
),
|
),
|
||||||
this.api.breadcrumb_data(undefined)
|
this.api.breadcrumb_data(undefined)
|
||||||
.subscribe(
|
.subscribe(
|
||||||
result => {
|
result => {
|
||||||
console.log(result);
|
console.log(result);
|
||||||
this.customersThisMonth = result.customersthismonth;
|
this.customersThisMonth = result.customersthismonth;
|
||||||
this.moneySpentThisMonth = result.moneyspentthismonth;
|
this.moneySpentThisMonth = result.moneyspentthismonth;
|
||||||
this.pointsTotal = result.pointstotal;
|
this.pointsTotal = result.pointstotal;
|
||||||
this.averageTransactionToday = result.averagetransactiontoday;
|
this.averageTransactionToday = result.averagetransactiontoday;
|
||||||
}
|
}
|
||||||
)
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Fisher-Yates shuffle function
|
// Fisher-Yates shuffle function
|
||||||
public shuffle(array) {
|
public shuffle(array) {
|
||||||
return new Promise(resolve => {
|
return new Promise(resolve => {
|
||||||
|
@ -109,13 +109,13 @@ export class DashboardComponent implements OnInit {
|
||||||
// While there are elements in the array
|
// While there are elements in the array
|
||||||
while (counter > 0) {
|
while (counter > 0) {
|
||||||
// Pick a random index
|
// Pick a random index
|
||||||
let index = Math.floor(Math.random() * counter);
|
const index = Math.floor(Math.random() * counter);
|
||||||
|
|
||||||
// Decrease counter by 1
|
// Decrease counter by 1
|
||||||
counter--;
|
counter--;
|
||||||
|
|
||||||
// And swap the last element with it
|
// And swap the last element with it
|
||||||
let temp = array[counter];
|
const temp = array[counter];
|
||||||
array[counter] = array[index];
|
array[counter] = array[index];
|
||||||
array[index] = temp;
|
array[index] = temp;
|
||||||
}
|
}
|
||||||
|
@ -124,7 +124,7 @@ export class DashboardComponent implements OnInit {
|
||||||
resolve(true);
|
resolve(true);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public brandPrimary = '#20a8d8';
|
public brandPrimary = '#20a8d8';
|
||||||
public brandSuccess = '#4dbd74';
|
public brandSuccess = '#4dbd74';
|
||||||
public brandInfo = '#63c2de';
|
public brandInfo = '#63c2de';
|
||||||
|
@ -263,7 +263,7 @@ export class DashboardComponent implements OnInit {
|
||||||
];
|
];
|
||||||
public lineChart4Legend = false;
|
public lineChart4Legend = false;
|
||||||
public lineChart4Type = 'line';
|
public lineChart4Type = 'line';
|
||||||
|
|
||||||
// lineChart6
|
// lineChart6
|
||||||
public lineChart6Data: Array<any> = [
|
public lineChart6Data: Array<any> = [
|
||||||
{
|
{
|
||||||
|
@ -316,7 +316,7 @@ export class DashboardComponent implements OnInit {
|
||||||
];
|
];
|
||||||
public lineChart6Legend = false;
|
public lineChart6Legend = false;
|
||||||
public lineChart6Type = 'line';
|
public lineChart6Type = 'line';
|
||||||
|
|
||||||
// lineChart7
|
// lineChart7
|
||||||
public lineChart7Data: Array<any> = [
|
public lineChart7Data: Array<any> = [
|
||||||
{
|
{
|
||||||
|
@ -357,7 +357,7 @@ export class DashboardComponent implements OnInit {
|
||||||
];
|
];
|
||||||
public lineChart7Legend = false;
|
public lineChart7Legend = false;
|
||||||
public lineChart7Type = 'line';
|
public lineChart7Type = 'line';
|
||||||
|
|
||||||
// lineChart8
|
// lineChart8
|
||||||
public lineChart8Data: Array<any> = [
|
public lineChart8Data: Array<any> = [
|
||||||
{
|
{
|
||||||
|
@ -410,7 +410,7 @@ export class DashboardComponent implements OnInit {
|
||||||
];
|
];
|
||||||
public lineChart8Legend = false;
|
public lineChart8Legend = false;
|
||||||
public lineChart8Type = 'line';
|
public lineChart8Type = 'line';
|
||||||
|
|
||||||
// lineChart5
|
// lineChart5
|
||||||
public lineChart5Data: Array<any> = [
|
public lineChart5Data: Array<any> = [
|
||||||
{
|
{
|
||||||
|
|
Reference in a new issue