Skip to content

Commit

Permalink
Minor improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
martinboulais committed Dec 16, 2024
1 parent 6702603 commit ab2db87
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 4 deletions.
15 changes: 15 additions & 0 deletions lib/public/components/Filters/common/FilterModel.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,4 +65,19 @@ export class FilterModel extends Observable {
get visualChange$() {
return this._visualChange$;
}

/**
* Utility function to register a filter model as sub-filter model
*
* TODO for now this function simply propagate observable notifications, in the future this should register submodels with a key and allow
* automated normalization (recursive filter model)
*
* @param {object} subModel the submodel to register
* @return {void}
* @protected
*/
_addSubmodel(subModel) {
subModel.bubbleTo(this);
subModel?.visualChange$.bubbleTo(this._visualChange$);

Check warning on line 81 in lib/public/components/Filters/common/FilterModel.js

View check run for this annotation

Codecov / codecov/patch

lib/public/components/Filters/common/FilterModel.js#L79-L81

Added lines #L79 - L81 were not covered by tests
}
}
5 changes: 2 additions & 3 deletions lib/public/components/Filters/common/TagFilterModel.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,10 @@ export class TagFilterModel extends FilterModel {
constructor(operators) {
super();
this._selectionModel = new TagSelectionDropdownModel({ includeArchived: true });
this._selectionModel.bubbleTo(this);
this._selectionModel.visualChange$.bubbleTo(this.visualChange$);
this._addSubmodel(this._selectionModel);

Check warning on line 30 in lib/public/components/Filters/common/TagFilterModel.js

View check run for this annotation

Codecov / codecov/patch

lib/public/components/Filters/common/TagFilterModel.js#L30

Added line #L30 was not covered by tests

this._combinationOperatorModel = new CombinationOperatorChoiceModel(operators);
this._combinationOperatorModel.bubbleTo(this);
this._addSubmodel(this._combinationOperatorModel);

Check warning on line 33 in lib/public/components/Filters/common/TagFilterModel.js

View check run for this annotation

Codecov / codecov/patch

lib/public/components/Filters/common/TagFilterModel.js#L33

Added line #L33 was not covered by tests
}

// eslint-disable-next-line valid-jsdoc
Expand Down
3 changes: 2 additions & 1 deletion lib/public/views/Runs/ActiveColumns/runsActiveColumns.js
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,8 @@ export const runsActiveColumns = {
exportFormat: (tags) => tags?.length ? tags.map(({ text }) => text).join('-') : '-',

/**
* Tag filter component
* Tags filter component
*
* @param {RunsOverviewModel} runModel the runs overview model
* @return {Component} the filter component
*/
Expand Down

0 comments on commit ab2db87

Please sign in to comment.