diff --git a/CHANGELOG.md b/CHANGELOG.md index 776a90fd45a..be9b89dff8f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,7 @@ changes in the following format: PR #1234*** #### Features - Added new interface intended to be used for querying module data from PHP (PR #8215) - Added the NOT NULL constraint on Project Name (PR #8295) +- Added ability to display images in issue tracker tickets (PR #8346) - Migrated instrument permissions from config.xml to database and added the ability to manage instrument permissions in the frontend from the `instrument_manager` module. (PR #8302) diff --git a/modules/issue_tracker/jsx/attachments/attachmentsList.js b/modules/issue_tracker/jsx/attachments/attachmentsList.js index 60c7c5a88ba..da0725baf4d 100644 --- a/modules/issue_tracker/jsx/attachments/attachmentsList.js +++ b/modules/issue_tracker/jsx/attachments/attachmentsList.js @@ -151,6 +151,15 @@ class AttachmentsList extends Component { ); } + /** + * Sets event target src to null + * + * @param {Object} event + */ + displayNone(event) { + event.target.src = null; + } + /** * Renders the React component. * @@ -187,6 +196,7 @@ class AttachmentsList extends Component { ); let attachmentsRows = []; + let regexImg = /image/; for (const key in this.state.attachments) { if (this.state.attachments.hasOwnProperty(key)) { const item = this.state.attachments[key]; @@ -205,7 +215,26 @@ class AttachmentsList extends Component {
File:
-
{item.file_name}
+
+ {item.file_name} + {regexImg.test(item.mime_type) ? + ( + ) : + null + } +