Skip to content

Commit 5349206

Browse files
authored
Merge branch 'develop' into dependabot/npm_and_yarn/frontend/lodash-4.17.15
2 parents a9ed1d6 + 0ce1b45 commit 5349206

File tree

101 files changed

+2447
-1259
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

101 files changed

+2447
-1259
lines changed

frontend/src/app/enums/url.enum.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ export enum URL {
88
USER_TIMINGS = '/resultSelection/getUserTimings',
99
HERO_TIMINGS = '/resultSelection/getHeroTimings',
1010
RESULT_COUNT = '/resultSelection/getResultCount',
11-
AGGREGATION_BARCHART_DATA = "/aggregation/getBarchartData",
12-
EVENT_RESULT_DASHBOARD_LINECHART_DATA = "/eventResultDashboard/getLinechartData",
13-
DISTRIBUTION_VIOLINCHART_DATA = "/distributionChart/getViolinchartData"
11+
AGGREGATION_BARCHART_DATA = '/aggregation/getBarchartData',
12+
EVENT_RESULT_DASHBOARD_LINECHART_DATA = '/eventResultDashboard/getLinechartData',
13+
DISTRIBUTION_VIOLINCHART_DATA = '/distributionChart/getViolinchartData'
1414
}

frontend/src/app/modules/aggregation/aggregation.component.spec.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
import {async, ComponentFixture, TestBed} from '@angular/core/testing';
22
import {AggregationComponent} from './aggregation.component';
3-
import {SharedMocksModule} from "../../testing/shared-mocks.module";
4-
import {ResultSelectionModule} from "../result-selection/result-selection.module";
5-
import {BarchartDataService} from "./services/barchart-data.service";
6-
import {OsmLangService} from "../../services/osm-lang.service";
7-
import {GrailsBridgeService} from "../../services/grails-bridge.service";
8-
import {AggregationChartDataService} from "./services/aggregation-chart-data.service";
9-
import {AggregationChartComponent} from "./components/aggregation-chart/aggregation-chart.component";
3+
import {SharedMocksModule} from '../../testing/shared-mocks.module';
4+
import {ResultSelectionModule} from '../result-selection/result-selection.module';
5+
import {BarchartDataService} from './services/barchart-data.service';
6+
import {OsmLangService} from '../../services/osm-lang.service';
7+
import {GrailsBridgeService} from '../../services/grails-bridge.service';
8+
import {AggregationChartDataService} from './services/aggregation-chart-data.service';
9+
import {AggregationChartComponent} from './components/aggregation-chart/aggregation-chart.component';
1010
import {SharedModule} from '../shared/shared.module';
1111

1212
describe('AggregationComponent', () => {
@@ -15,7 +15,7 @@ describe('AggregationComponent', () => {
1515

1616
beforeEach(async(() => {
1717
TestBed.configureTestingModule({
18-
declarations: [ AggregationComponent, AggregationChartComponent ],
18+
declarations: [AggregationComponent, AggregationChartComponent],
1919
imports: [
2020
SharedModule,
2121
SharedMocksModule,
@@ -28,7 +28,7 @@ describe('AggregationComponent', () => {
2828
AggregationChartDataService
2929
]
3030
})
31-
.compileComponents();
31+
.compileComponents();
3232
}));
3333

3434
beforeEach(() => {

frontend/src/app/modules/aggregation/aggregation.component.ts

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import {Component, OnInit} from '@angular/core';
2-
import {BarchartDataService} from "./services/barchart-data.service";
3-
import {ResultSelectionStore} from "../result-selection/services/result-selection.store";
4-
import {BehaviorSubject} from "rxjs";
5-
import {AggregationChartDataService} from "./services/aggregation-chart-data.service";
2+
import {BarchartDataService} from './services/barchart-data.service';
3+
import {ResultSelectionStore} from '../result-selection/services/result-selection.store';
4+
import {BehaviorSubject} from 'rxjs';
5+
import {AggregationChartDataService} from './services/aggregation-chart-data.service';
66

77
@Component({
88
selector: 'osm-aggregation',
@@ -13,9 +13,13 @@ export class AggregationComponent implements OnInit {
1313

1414
barchartAverageData$: BehaviorSubject<any> = new BehaviorSubject<any>([]);
1515
barchartMedianData$: BehaviorSubject<any> = new BehaviorSubject<any>([]);
16-
showChart: boolean = false;
16+
showChart = false;
1717

18-
constructor(private barchartDataService: BarchartDataService, private resultSelectionStore: ResultSelectionStore, private aggregationChartDataService: AggregationChartDataService) {
18+
constructor(
19+
private barchartDataService: BarchartDataService,
20+
private resultSelectionStore: ResultSelectionStore,
21+
private aggregationChartDataService: AggregationChartDataService
22+
) {
1923
this.aggregationChartDataService.barchartAverageData$.subscribe((data) => {
2024
this.barchartAverageData$.next(data);
2125
});
@@ -36,6 +40,9 @@ export class AggregationComponent implements OnInit {
3640

3741
getBarchartData(): void {
3842
this.showChart = true;
39-
this.aggregationChartDataService.getBarchartData(this.resultSelectionStore.resultSelectionCommand, this.resultSelectionStore.remainingResultSelection);
43+
this.aggregationChartDataService.getBarchartData(
44+
this.resultSelectionStore.resultSelectionCommand,
45+
this.resultSelectionStore.remainingResultSelection
46+
);
4047
}
4148
}

frontend/src/app/modules/aggregation/aggregation.module.ts

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
import {NgModule} from '@angular/core';
22
import {CommonModule} from '@angular/common';
3-
import {RouterModule, Routes} from "@angular/router";
4-
import {SharedModule} from "../shared/shared.module";
3+
import {RouterModule, Routes} from '@angular/router';
4+
import {SharedModule} from '../shared/shared.module';
55
import {AggregationComponent} from './aggregation.component';
6-
import {ResultSelectionModule} from "../result-selection/result-selection.module";
6+
import {ResultSelectionModule} from '../result-selection/result-selection.module';
77
import {AggregationChartComponent} from './components/aggregation-chart/aggregation-chart.component';
8-
import {BarchartDataService} from "./services/barchart-data.service";
9-
import {AggregationChartDataService} from "./services/aggregation-chart-data.service";
10-
import {FormsModule} from "@angular/forms";
8+
import {BarchartDataService} from './services/barchart-data.service';
9+
import {AggregationChartDataService} from './services/aggregation-chart-data.service';
10+
import {FormsModule} from '@angular/forms';
1111

1212
const AggregationRoutes: Routes = [
1313
{path: 'show', component: AggregationComponent},
@@ -27,4 +27,5 @@ const AggregationRoutes: Routes = [
2727
AggregationChartDataService
2828
]
2929
})
30-
export class AggregationModule { }
30+
export class AggregationModule {
31+
}

frontend/src/app/modules/aggregation/components/aggregation-chart/aggregation-chart.component.html

Lines changed: 52 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -2,79 +2,93 @@
22
<div class="aggregation-chart">
33
<osm-spinner [spinnerId]="'aggregation-chart-spinner'"></osm-spinner>
44
<div class="filter-dropdown-group">
5-
<div class="btn-group pull-left perc-element" data-toggle="buttons" id="stack-bars-switch" *ngIf="!isHidden">
6-
<label class="btn btn-sm btn-default" id="switch-beside-button"
7-
[class.active]="!aggregationChartDataService.stackBars" (click)="changeStackBars(beside.value); redraw()">
8-
<input #beside type="radio" name="stackBars" [value]="false">
9-
Beside
10-
</label>
11-
<label class="btn btn-sm btn-default" id="switch-infront-button"
12-
[class.active]="aggregationChartDataService.stackBars" (click)="changeStackBars(inFront.value); redraw()">
13-
<input #inFront type="radio" name="stackBars" [value]="true">
14-
In Front
15-
</label>
5+
<div *ngIf="showDiagramTypeSwitch" class="btn-group pull-left perc-element" data-toggle="buttons"
6+
id="stack-bars-switch">
7+
<button (click)="selectDiagramType('grouped')" [class.active]="!aggregationChartDataService.stackBars"
8+
class="btn btn-sm btn-default"
9+
id="switch-beside-button">
10+
{{'frontend.de.iteratec.osm.barchart.settings.beside' | translate }}
11+
</button>
12+
<button (click)="selectDiagramType('stacked')" [class.active]="aggregationChartDataService.stackBars"
13+
class="btn btn-sm btn-default"
14+
id="switch-infront-button">
15+
{{'frontend.de.iteratec.osm.barchart.settings.inFront' | translate }}
16+
</button>
1617
</div>
17-
<div class="btn-group pull-left perc-element" data-toggle="buttons" id="aggregation-value-switch">
18-
<label class="btn btn-sm btn-default" id="aggregation-average-button"
19-
[class.active]="aggregationChartDataService.aggregationType === 'avg'"
20-
(click)="aggregationChartDataService.aggregationType = average.value; redraw()">
21-
<input #average type="radio" name="aggregationValue" value="avg" checked>
22-
Average
23-
</label>
24-
<label class="btn btn-sm btn-default" id="aggregation-percentile-button"
25-
[class.active]="aggregationChartDataService.aggregationType === 'percentile'"
26-
(click)="aggregationChartDataService.aggregationType = percentile.value; redraw()">
27-
<input #percentile type="radio" name="aggregationValue" value="percentile">
28-
Percentile
29-
</label>
18+
<div class="btn-group pull-left perc-element" data-toggle="buttons" id="aggregation-type-switch">
19+
<button (click)="selectAggregationType('avg')"
20+
[class.active]="aggregationChartDataService.aggregationType === 'avg'"
21+
class="btn btn-sm btn-default" id="aggregation-average-button">
22+
{{'frontend.de.iteratec.osm.barchart.settings.average' | translate }}
23+
</button>
24+
<button (click)="selectAggregationType('percentile')"
25+
[class.active]="aggregationChartDataService.aggregationType === 'percentile'"
26+
[disabled]="!enoughPercentileValues()"
27+
class="btn btn-sm btn-default" id="aggregation-percentile-button"
28+
title="{{!enoughPercentileValues() ? ('frontend.de.iteratec.osm.barchart.settings.notEnoughData' | translate) : ''}}">
29+
{{'frontend.de.iteratec.osm.barchart.settings.percentile' | translate }}
30+
</button>
31+
3032
</div>
3133

32-
<input class="btn btn-sm btn-default perc-element" id="percentage-field" type="number" placeholder="%"
33-
[(ngModel)]="percentileValue" (ngModelChange)="reloadPercentile()" min="1" max="100" style="max-width: 5em;" [disabled]="aggregationChartDataService.aggregationType === 'avg'"/>
34-
<input class="form-control perc-element perc-slider" id="percentage-slider" type="range"
35-
[(ngModel)]="percentileValue" (mouseup)="reloadPercentile()" min="5" max="100" step="5" [disabled]="aggregationChartDataService.aggregationType === 'avg'"/>
34+
<input (ngModelChange)="reloadPercentile()" *ngIf="enoughPercentileValues()"
35+
[(ngModel)]="aggregationChartDataService.percentileValue"
36+
[disabled]="aggregationChartDataService.aggregationType === 'avg'"
37+
class="btn btn-sm btn-default perc-element" id="percentage-field" max="100" min="1"
38+
placeholder="%" style="max-width: 5em;"
39+
type="number"/>
40+
<input (mouseup)="reloadPercentile()" *ngIf="enoughPercentileValues()"
41+
[(ngModel)]="aggregationChartDataService.percentileValue"
42+
[disabled]="aggregationChartDataService.aggregationType === 'avg'"
43+
class="form-control perc-element perc-slider" id="percentage-slider" max="100" min="5"
44+
step="5"
45+
type="range"/>
3646

37-
<button id="filter-dropdown" type="button" class="btn btn-default btn-sm dropdown-toggle perc-element"
47+
<button aria-expanded="false" aria-haspopup="true" class="btn btn-default btn-sm dropdown-toggle perc-element"
3848
data-toggle="dropdown"
39-
aria-haspopup="true" aria-expanded="false">Filter <span class="caret"></span>
49+
id="filter-dropdown" type="button">{{'frontend.de.iteratec.osm.barchart.filter' | translate }} <span
50+
class="caret"></span>
4051
</button>
4152
<ul class="dropdown-menu pull-right">
42-
<li id="all-bars-header" class="dropdown-header">
53+
<li class="dropdown-header" id="all-bars-header">
4354
{{'frontend.de.iteratec.osm.barchart.filter.noFilterHeader' | translate }}
4455
</li>
4556
<li>
46-
<a class="chart-filter" (click)="selectFilter('desc')"><i [ngClass]="aggregationChartDataService.descSelected ? 'fas fa-check' : 'fas fa-check filter-inactive'"></i>
57+
<a (click)="selectFilter('desc')" class="chart-filter"><i
58+
[ngClass]="aggregationChartDataService.descSelected ? 'fas fa-check' : 'fas fa-check filter-inactive'"></i>
4759
{{'frontend.de.iteratec.osm.barchart.filter.noFilterDesc' | translate }}
4860
</a>
4961
</li>
5062
<li>
51-
<a class="chart-filter" (click)="selectFilter('asc')"><i [ngClass]="aggregationChartDataService.ascSelected ? 'fas fa-check' : 'fas fa-check filter-inactive'"></i>
63+
<a (click)="selectFilter('asc')" class="chart-filter"><i
64+
[ngClass]="aggregationChartDataService.ascSelected ? 'fas fa-check' : 'fas fa-check filter-inactive'"></i>
5265
{{'frontend.de.iteratec.osm.barchart.filter.noFilterAsc' | translate }}
5366
</a>
5467
</li>
5568
<ng-container *ngIf="hasFilterRules">
56-
<li id="customer-journey-header" class="dropdown-header">
69+
<li class="dropdown-header" id="customer-journey-header">
5770
{{'frontend.de.iteratec.osm.barchart.filter.customerJourneyHeader' | translate}}
5871
</li>
5972
<li *ngFor="let filterRule of filterRules | keyvalue">
60-
<a class="chart-filter" (click)="selectFilter(filterRule.key)">
61-
<i [ngClass]="filterRule.value.selected ? 'fas fa-check' : 'fas fa-check filter-inactive'" ></i>
73+
<a (click)="selectFilter(filterRule.key)" class="chart-filter">
74+
<i [ngClass]="filterRule.value.selected ? 'fas fa-check' : 'fas fa-check filter-inactive'"></i>
6275
{{filterRule.key}}
6376
</a>
6477
</li>
6578
</ng-container>
6679
</ul>
6780

6881
<div class="in-chart-buttons">
69-
<a data-toggle="modal" role="button" title="Download as PNG">
82+
<a data-toggle="modal" role="button" title="{{'frontend.de.iteratec.osm.barchart.download.png' | translate}}">
7083
<i class="fas fa-download"></i>
7184
</a>
7285
</div>
7386

7487
</div>
7588

7689
<div class="svg-container">
77-
<svg #svg id="aggregation-chart-svg" class="aggregation-chart-svg" xmlns="http://www.w3.org/1999/html" (window:resize)="redraw()"></svg>
90+
<svg #svg (window:resize)="redraw()" class="aggregation-chart-svg" id="aggregation-chart-svg"
91+
xmlns="http://www.w3.org/1999/html"></svg>
7892
</div>
7993
</div>
8094
</div>

frontend/src/app/modules/aggregation/components/aggregation-chart/aggregation-chart.component.spec.ts

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
1-
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
1+
import {async, ComponentFixture, TestBed} from '@angular/core/testing';
22

3-
import { AggregationChartComponent } from './aggregation-chart.component';
4-
import {BarchartDataService} from "../../services/barchart-data.service";
5-
import {AggregationChartDataService} from "../../services/aggregation-chart-data.service";
6-
import {SharedMocksModule} from "../../../../testing/shared-mocks.module";
7-
import {ResultSelectionStore} from "../../../result-selection/services/result-selection.store";
8-
import {ResultSelectionService} from "../../../result-selection/services/result-selection.service";
9-
import {SharedModule} from "../../../shared/shared.module";
3+
import {AggregationChartComponent} from './aggregation-chart.component';
4+
import {BarchartDataService} from '../../services/barchart-data.service';
5+
import {AggregationChartDataService} from '../../services/aggregation-chart-data.service';
6+
import {SharedMocksModule} from '../../../../testing/shared-mocks.module';
7+
import {ResultSelectionStore} from '../../../result-selection/services/result-selection.store';
8+
import {ResultSelectionService} from '../../../result-selection/services/result-selection.service';
9+
import {SharedModule} from '../../../shared/shared.module';
1010

1111
describe('AggregationChartComponent', () => {
1212
let component: AggregationChartComponent;
1313
let fixture: ComponentFixture<AggregationChartComponent>;
1414

1515
beforeEach(async(() => {
1616
TestBed.configureTestingModule({
17-
declarations: [ AggregationChartComponent ],
17+
declarations: [AggregationChartComponent],
1818
providers: [
1919
BarchartDataService,
2020
AggregationChartDataService,
@@ -23,7 +23,7 @@ describe('AggregationChartComponent', () => {
2323
],
2424
imports: [SharedMocksModule, SharedModule]
2525
})
26-
.compileComponents();
26+
.compileComponents();
2727
}));
2828

2929
beforeEach(() => {

0 commit comments

Comments
 (0)