Skip to content

Commit

Permalink
[bvl_feedback] Update summary in real time (#8966)
Browse files Browse the repository at this point in the history
This fixes the bvl_feedback module to update the summary in real time after opening or closing feedbacks. The PR also fixes a Unexpected end to json input react error when opening and closing feedbacks by changing the success response to a json response.

Resolves #4984
  • Loading branch information
CamilleBeau authored Dec 1, 2023
1 parent bf24590 commit 9928c54
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 11 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ changes in the following format: PR #1234***
#### Features
- Add OpenID Connect authorization support to LORIS (PR #8255)

#### Bug Fixes
- bvl_feedback updates in real-time (PR #8966)

## LORIS 25.0 (Release Date: ????-??-??)
### Core
#### Features
Expand Down
5 changes: 4 additions & 1 deletion modules/bvl_feedback/ajax/open_bvl_feedback_thread.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@
exit;
}

header("HTTP/1.1 204 No Content");
header("Content-Type: application/json");
print json_encode(
['status' => 'success']
);
exit;

16 changes: 6 additions & 10 deletions modules/bvl_feedback/jsx/react.behavioural_feedback_panel.js
Original file line number Diff line number Diff line change
Expand Up @@ -900,11 +900,9 @@ class FeedbackPanel extends Component {
console.error(response.status + ': ' + response.statusText);
return;
}

response.json().then(() => {
this.setState({threads: threads});
this.loadSummaryServerData();
});
this.setState({threads: threads});
this.loadSummaryServerData();
this.loadThreadServerState();
}).catch((error) => {
console.error(error);
});
Expand Down Expand Up @@ -936,11 +934,9 @@ class FeedbackPanel extends Component {
console.error(response.status + ': ' + response.statusText);
return;
}

response.json().then(() => {
this.setState({threads: threads});
this.loadSummaryServerData();
});
this.setState({threads: threads});
this.loadSummaryServerData();
this.loadThreadServerState();
}).catch((error) => {
console.error(error);
});
Expand Down

0 comments on commit 9928c54

Please sign in to comment.