Skip to content

Commit

Permalink
Merge pull request #660 from lsst-ts/tickets/DM-45943
Browse files Browse the repository at this point in the history
Fix ampersand being parsed to html encoding by QuillJS
  • Loading branch information
sebastian-aranda authored Aug 26, 2024
2 parents 4bfb890 + 78883a1 commit db1e663
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ Version History
v6.3.0
------

* Fix ampersand being parsed to html encoding by QuillJS `<https://github.com/lsst-ts/LOVE-frontend/pull/660>`_
* Fix ATDome Nasmyth value display `<https://github.com/lsst-ts/LOVE-frontend/pull/659>`_
* Fix GearIcon rendering on the Scheduler component `<https://github.com/lsst-ts/LOVE-frontend/pull/658>`_
* Extend size of individual log message display `<https://github.com/lsst-ts/LOVE-frontend/pull/657>`_
Expand Down
3 changes: 3 additions & 0 deletions love/src/components/OLE/Exposure/ExposureAdd.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,9 @@ class ExposureAdd extends Component {
payload['tags'] = payload['tags'].map((tag) => tag.id);
}

// Transform &amp; back to '&'. This is a workaround due to Quill editor encoding '&'.}
payload['message_text'] = payload['message_text'].replace(/&amp;/g, '&');

this.setState({ savingLog: true });
ManagerInterface.createMessageExposureLogs(payload).then((result) => {
this.setState({ savingLog: false });
Expand Down
3 changes: 3 additions & 0 deletions love/src/components/OLE/Exposure/ExposureDetail.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,9 @@ export default class ExposureDetail extends Component {
payload['tags'] = payload['tags'].map((tag) => tag.id);
}

// Transform &amp; back to '&'. This is a workaround due to Quill editor encoding '&'.}
payload['message_text'] = payload['message_text'].replace(/&amp;/g, '&');

ManagerInterface.updateMessageExposureLogs(message.id, payload).then((response) => {
if (response) {
this.setState((state) => {
Expand Down
3 changes: 3 additions & 0 deletions love/src/components/OLE/NonExposure/NonExposureEdit.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,9 @@ class NonExposureEdit extends Component {
payload['date_begin'] = beginDateISO.substring(0, beginDateISO.length - 1); // remove Zone due to backend standard
payload['date_end'] = endDateISO.substring(0, endDateISO.length - 1); // remove Zone due to backend standard

// Transform &amp; back to '&'. This is a workaround due to Quill editor encoding '&'.}
payload['message_text'] = payload['message_text'].replace(/&amp;/g, '&');

// Clean null and empty values to avoid API errors
Object.keys(payload).forEach((key) => {
if (payload[key] === null || (Array.isArray(payload[key]) && payload[key].length === 0)) {
Expand Down

0 comments on commit db1e663

Please sign in to comment.