mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
various code quality fixes (#5792)
* various code quality fixes * reduce duplicated code * add safety check
This commit is contained in:
@@ -120,8 +120,8 @@ export class AnalyticsGeneratorComponent implements OnChanges {
|
||||
return this.showDetails;
|
||||
}
|
||||
|
||||
isCurrent(position: number) {
|
||||
return position === this.currentChartPosition ? true : false;
|
||||
isCurrent(position: number): boolean {
|
||||
return position === this.currentChartPosition;
|
||||
}
|
||||
|
||||
selectCurrent(position: number) {
|
||||
|
@@ -85,10 +85,10 @@ export class AnalyticsReportHeatMapComponent implements OnInit {
|
||||
});
|
||||
}
|
||||
|
||||
hasMetric() {
|
||||
return (this.report.totalCountsPercentages ||
|
||||
this.report.totalTimePercentages ||
|
||||
this.report.avgTimePercentages) ? true : false;
|
||||
hasMetric(): boolean {
|
||||
return !!(this.report.totalCountsPercentages ||
|
||||
this.report.totalTimePercentages ||
|
||||
this.report.avgTimePercentages);
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -171,15 +171,15 @@ export class AnalyticsReportListComponent implements OnInit {
|
||||
this.selectFirst = false;
|
||||
}
|
||||
|
||||
isSelected(report: any) {
|
||||
return this.currentReport === report ? true : false;
|
||||
isSelected(report: any): boolean {
|
||||
return this.currentReport === report;
|
||||
}
|
||||
|
||||
isList() {
|
||||
isList(): boolean {
|
||||
return this.layoutType === AnalyticsReportListComponent.LAYOUT_LIST;
|
||||
}
|
||||
|
||||
isGrid() {
|
||||
isGrid(): boolean {
|
||||
return this.layoutType === AnalyticsReportListComponent.LAYOUT_GRID;
|
||||
}
|
||||
}
|
||||
|
@@ -35,8 +35,8 @@ export class WidgetComponent implements OnChanges {
|
||||
}
|
||||
}
|
||||
|
||||
hasField() {
|
||||
return this.field ? true : false;
|
||||
hasField(): boolean {
|
||||
return !!this.field;
|
||||
}
|
||||
|
||||
hasValue(): boolean {
|
||||
|
@@ -101,7 +101,7 @@ export class BarChart extends Chart {
|
||||
};
|
||||
};
|
||||
|
||||
hasDatasets() {
|
||||
return this.datasets && this.datasets.length > 0 ? true : false;
|
||||
hasDatasets(): boolean {
|
||||
return this.datasets && this.datasets.length > 0;
|
||||
}
|
||||
}
|
||||
|
@@ -28,7 +28,7 @@ export class DetailsTableChart extends TableChart {
|
||||
}
|
||||
}
|
||||
|
||||
hasDetailsTable() {
|
||||
return this.detailsTable ? true : false;
|
||||
hasDetailsTable(): boolean {
|
||||
return !!this.detailsTable;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user