Skip to content

Commit 928203f

Browse files
authored
Merge pull request #282 from iteratec/bugfix/loadResultSelectionAfterUrlChanges
Bugfix: Load result selection after url changes
2 parents 6e7b734 + d7114e9 commit 928203f

File tree

2 files changed

+11
-9
lines changed

2 files changed

+11
-9
lines changed

frontend/src/app/modules/result-selection/models/result-selection-command.model.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
export interface ResultSelectionCommandDTO {
2-
from: Date;
3-
to: Date;
2+
from?: Date;
3+
to?: Date;
44
caller?: Caller;
55
jobGroupIds?: number[];
66
pageIds?: number[];
@@ -11,8 +11,8 @@ export interface ResultSelectionCommandDTO {
1111
}
1212

1313
export class ResultSelectionCommand implements ResultSelectionCommandDTO {
14-
from: Date;
15-
to: Date;
14+
from?: Date;
15+
to?: Date;
1616
caller?: Caller;
1717
jobGroupIds?: number[];
1818
pageIds?: number[];

frontend/src/app/modules/result-selection/services/result-selection.store.ts

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,8 @@ export class ResultSelectionStore {
6969
};
7070

7171
constructor(private resultSelectionService: ResultSelectionService, route: ActivatedRoute, private router: Router) {
72+
this._resultSelectionCommand$ = new BehaviorSubject<ResultSelectionCommand>({});
73+
this._remainingResultSelection$ = new BehaviorSubject<RemainingResultSelection>({});
7274
route.queryParams.subscribe((params: Params) => {
7375
if (params) {
7476
params = this.renameParamKeys(this.oldToNewChartKeyMap, params);
@@ -95,8 +97,8 @@ export class ResultSelectionStore {
9597
...(params.performanceAspectTypes && {performanceAspectTypes: [].concat(params.performanceAspectTypes)})
9698
};
9799

98-
this._resultSelectionCommand$ = new BehaviorSubject<ResultSelectionCommand>(resultSelectionCommand);
99-
this._remainingResultSelection$ = new BehaviorSubject(remainingResultSelection);
100+
this._resultSelectionCommand$.next(resultSelectionCommand);
101+
this._remainingResultSelection$.next(remainingResultSelection);
100102
}
101103
});
102104

@@ -105,12 +107,12 @@ export class ResultSelectionStore {
105107
let defaultTo = new Date();
106108
defaultFrom.setDate(defaultTo.getDate() - 3);
107109

108-
this._resultSelectionCommand$ = new BehaviorSubject({
110+
const resultSelectionCommand: ResultSelectionCommand = {
109111
from: defaultFrom,
110112
to: defaultTo,
111113
caller: Caller.EventResult
112-
});
113-
this._remainingResultSelection$ = new BehaviorSubject({});
114+
};
115+
this._resultSelectionCommand$.next(resultSelectionCommand);
114116
}
115117
}
116118

0 commit comments

Comments
 (0)