Skip to content

Commit

Permalink
Fix run filtering and apply filters to report buttons (ibutsu#528)
Browse files Browse the repository at this point in the history
* Fix result-list and run-list navigate calls

* Fix run list button to apply active filters
  • Loading branch information
mshriver authored and Fynardo committed Nov 25, 2024
1 parent dfbac97 commit 0d98808
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 5 deletions.
6 changes: 4 additions & 2 deletions frontend/src/result-list.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,13 @@ export class ResultList extends React.Component {
static propTypes = {
location: PropTypes.object,
navigate: PropTypes.func,
eventEmitter: PropTypes.object
eventEmitter: PropTypes.object,
params: PropTypes.object,
}

constructor(props) {
super(props);
// TODO just use props.params when converting to funcational component
const params = new URLSearchParams(props.location.search);
let page = 1, pageSize = 20, filters = {};
if (params.toString() !== '') {
Expand Down Expand Up @@ -299,7 +301,7 @@ export class ResultList extends React.Component {
};

applyReport = () => {
this.props.navigate('/reports?' + buildParams(this.state.filters).join('&'))
this.props.navigate('/project/' + this.props.params.project_id + '/reports?' + buildParams(this.state.filters).join('&'))
};

updateFilters(name, operator, value, callback) {
Expand Down
10 changes: 8 additions & 2 deletions frontend/src/run-list.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,8 @@ export class RunList extends React.Component {
static propTypes = {
location: PropTypes.object,
navigate: PropTypes.func,
eventEmitter: PropTypes.object
eventEmitter: PropTypes.object,
params: PropTypes.object,
}

constructor(props) {
Expand Down Expand Up @@ -143,6 +144,10 @@ export class RunList extends React.Component {
});
}

applyReport = () => {
this.props.navigate('/project/' + this.props.params.project_id + '/reports?' + buildParams(this.state.filters).join('&'))
};

onFieldToggle = () => {
this.setState({isFieldOpen: !this.state.isFieldOpen});
};
Expand Down Expand Up @@ -292,7 +297,7 @@ export class RunList extends React.Component {
let params = buildParams(this.state.filters);
params.push('page=' + this.state.page);
params.push('pageSize=' + this.state.pageSize);
this.props.navigate('/runs?' + params.join('&'))
this.props.navigate('?' + params.join('&'))
}

setPage = (_event, pageNumber) => {
Expand Down Expand Up @@ -575,6 +580,7 @@ export class RunList extends React.Component {
onApplyFilter={this.applyFilter}
onRemoveFilter={this.removeFilter}
onClearFilters={this.clearFilters}
onApplyReport={this.applyReport}
onSetPage={this.setPage}
onSetPageSize={this.setPageSize}
hideFilters={["project_id"]}
Expand Down
2 changes: 1 addition & 1 deletion scripts/ibutsu-pod.sh
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ podman run -dt \
$POSTGRES_EXTRA_ARGS \
--name ibutsu-postgres \
--rm \
postgres:15
postgres:12
echo "done."
echo -n "Adding redis to the pod: "
podman run -dt \
Expand Down

0 comments on commit 0d98808

Please sign in to comment.