Skip to content

Commit

Permalink
added fix of dashboards creation and deletion by converting UI suite …
Browse files Browse the repository at this point in the history
…to required DTO (#121)

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

## 1.2.1 (2020-12-16)
- 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)
- Fix [Test result view is empty if it was opened by shared link or by opening in new tab] (https://github.com/aquality-automation/aquality-tracking/issues/126)
- Fix [Select items on the page] (https://github.com/aquality-automation/aquality-tracking/issues/127)
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.0",
"version": "1.2.1",
"scripts": {
"ng": "ng",
"start": "ng serve",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -270,9 +270,10 @@ export class SuiteDashboardComponent implements OnInit, OnDestroy {
}

async saveDashboard() {
let suites = TestSuite.getCreateDashboardDtos(this.suitesToShow);
await this.testSuiteService.createSuiteDashboard({
name: this.newDashboardName,
suites: this.suitesToShow,
suites: suites,
detailed: this.detailed === true || this.detailed === 1 ? 1 : 0,
project_id: this.route.snapshot.params['projectId']
});
Expand Down
14 changes: 13 additions & 1 deletion src/app/shared/models/test-suite.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,18 @@ export class TestSuite {
id?: number;
project_id?: number;
tests?: Test[];

static getCreateDashboardDtos(suites: TestSuite[]): TestSuite[] {
let suiteDtos: TestSuite[] = [];
suites.forEach(suite => {
suiteDtos.push(TestSuite.getCreateDashboardDto(suite));
});
return suiteDtos;
}

static getCreateDashboardDto(suite: TestSuite): TestSuite {
return { id: suite.id, name: suite.name, project_id: suite.project_id };
}
}

export class TestSuiteStat {
Expand All @@ -22,7 +34,7 @@ export class TestSuiteStat {
export class SuiteDashboard {
id?: number;
project_id?: number;
detailed: boolean|number;
detailed: boolean | number;
name: string;
suites: TestSuite[];
notDeletable?: boolean;
Expand Down

0 comments on commit a081423

Please sign in to comment.