Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix run filtering and apply filters to report buttons #528

Merged
merged 2 commits into from
Nov 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading