Skip to content

Commit

Permalink
Fix of an issue with switching between detailed/non-detailed view on …
Browse files Browse the repository at this point in the history
…the dashboard (#122)

Co-authored-by: d.bogatko <[email protected]>
  • Loading branch information
DmitryBogatko and d.bogatko authored Jan 19, 2021
1 parent a081423 commit cbc9f0a
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 11 deletions.
5 changes: 4 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# CHANGELOG

## 1.2.1 (2020-12-16)
## 1.2.2 (2021-01-19)
- Fix of an issue with switching between detailed/non-detailed view on the dashboard

## 1.2.1 (2021-01-17)
- Fix [[BUG] on a dashboard page cannot delete a dashboard](https://github.com/aquality-automation/aquality-tracking/issues/130)

## 1.2.0 (2020-12-15)
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "aquality-tracking-ui",
"version": "1.2.1",
"version": "1.2.2",
"scripts": {
"ng": "ng",
"start": "ng serve",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,10 @@
color: var(--light);
}

::ng-deep .mat-slide-toggle {
color: #ffffff;
}

.autoRefresh {
margin-top: 10px;
margin-bottom: 10px;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import { TestRunService } from 'src/app/services/testrun/testrun.service';
import { TestSuite, SuiteDashboard } from 'src/app/shared/models/test-suite';
import { colors } from 'src/app/shared/colors.service';
import { TestRunStat } from 'src/app/shared/models/testrun-stats';
import { MatSlideToggleChange } from '@angular/material/slide-toggle';

@Component({
selector: 'app-suite-dashboard',
Expand Down Expand Up @@ -48,7 +49,7 @@ export class SuiteDashboardComponent implements OnInit, OnDestroy {
private testSuiteService: TestSuiteService,
private testrunService: TestRunService,
private route: ActivatedRoute
) {}
) { }

@ViewChildren(BaseChartDirective) charts: QueryList<BaseChartDirective>;

Expand Down Expand Up @@ -94,8 +95,8 @@ export class SuiteDashboardComponent implements OnInit, OnDestroy {
});
}

async generateChartsData(detailed: boolean | number) {
this.detailed = detailed;
async generateChartsData(detailed: boolean | number | MatSlideToggleChange) {
this.detailed = (detailed instanceof MatSlideToggleChange) ? detailed.checked : detailed;
this.suite_stats = await this.getSuiteStats();
this.detailed
? this.generateDetailedData(this.suite_stats)
Expand Down Expand Up @@ -153,13 +154,12 @@ export class SuiteDashboardComponent implements OnInit, OnDestroy {
`Passed | ${suite.stat.passed}`,
`Application Issues | ${suite.stat.app_issue}`,
`Test Issues | ${suite.stat.warning +
suite.stat.not_assigned +
suite.stat.other}`,
suite.stat.not_assigned +
suite.stat.other}`,
`Total | ${suite.stat.total}`
];
const options = JSON.parse(JSON.stringify(this.chartOptions));
options.id = suite.id;
suite['options'] = options;

this.addChartOptionsToSuite(suite);
}
}
return suites;
Expand Down Expand Up @@ -223,11 +223,19 @@ export class SuiteDashboardComponent implements OnInit, OnDestroy {
`Other | ${suite.stat.other}`,
`Total | ${suite.stat.total}`
];

this.addChartOptionsToSuite(suite);
}
}
return suites;
}

addChartOptionsToSuite(suite: any) {
const options = JSON.parse(JSON.stringify(this.chartOptions));
options.id = suite.id;
suite['options'] = options;
}

getDuration(testrunStat: TestRunStat): string {
return this.testrunService.calculateDuration(testrunStat);
}
Expand Down Expand Up @@ -284,7 +292,7 @@ export class SuiteDashboardComponent implements OnInit, OnDestroy {
isDashboardNameValid(): boolean {
const isAlreadyExists = this.dashboards
? this.dashboards.find(x => x.name === this.newDashboardName) !==
undefined
undefined
: true;
return (
this.newDashboardName &&
Expand Down

0 comments on commit cbc9f0a

Please sign in to comment.