diff --git a/client/src/app-components/ticket-event.js b/client/src/app-components/ticket-event.js
index bdcd9b2e..719f417d 100644
--- a/client/src/app-components/ticket-event.js
+++ b/client/src/app-components/ticket-event.js
@@ -2,6 +2,7 @@ import React from 'react';
import classNames from 'classnames';
import i18n from 'lib-app/i18n';
+import API from 'lib-app/api-call';
import DateTransformer from 'lib-core/date-transformer';
import Icon from 'core-components/icon';
@@ -161,7 +162,7 @@ class TicketEvent extends React.Component {
}
return (
-
+
{node}
)
@@ -222,9 +223,26 @@ class TicketEvent extends React.Component {
const fileName = filePath.replace(/^.*[\\\/]/, '');
return (
-
{fileName}
+
{fileName}
)
}
+
+ onFileClick(filePath) {
+ API.call({
+ path: '/system/download',
+ plain: true,
+ data: {
+ file: filePath
+ }
+ }).then((result) => {
+ let contentType = 'application/octet-stream';
+ let link = document.createElement('a');
+ let blob = new Blob([result], {'type': contentType});
+ link.href = window.URL.createObjectURL(blob);
+ link.download = filePath;
+ link.click();
+ });
+ }
}
export default TicketEvent;
diff --git a/client/src/app-components/ticket-event.scss b/client/src/app-components/ticket-event.scss
index 50105bbe..328d16e1 100644
--- a/client/src/app-components/ticket-event.scss
+++ b/client/src/app-components/ticket-event.scss
@@ -91,6 +91,14 @@
}
}
+ &__file {
+ background-color: $very-light-grey;
+ cursor: pointer;
+ text-align: right;
+ padding: 5px 10px;
+ font-size: 12px;
+ }
+
&_staff {
.ticket-event__icon {
background-color: $primary-blue;
diff --git a/client/src/app-components/ticket-viewer.js b/client/src/app-components/ticket-viewer.js
index 6b6f1362..c00b875a 100644
--- a/client/src/app-components/ticket-viewer.js
+++ b/client/src/app-components/ticket-viewer.js
@@ -190,6 +190,7 @@ class TicketViewer extends React.Component {
@@ -234,10 +235,12 @@ class TicketViewer extends React.Component {
loading: this.state.loading,
onChange: (formState) => {this.setState({
commentValue: formState.content,
+ commentFile: formState.file,
commentEdited: true
})},
values: {
- 'content': this.state.commentValue
+ 'content': this.state.commentValue,
+ 'file': this.state.commentFile
}
};
}
diff --git a/client/src/app-components/ticket-viewer.scss b/client/src/app-components/ticket-viewer.scss
index 9f03fbf7..2a6658ed 100644
--- a/client/src/app-components/ticket-viewer.scss
+++ b/client/src/app-components/ticket-viewer.scss
@@ -48,13 +48,6 @@
margin-top: 10px;
}
- &__file {
- background-color: $very-light-grey;
- text-align: right;
- padding: 5px 10px;
- font-size: 12px;
- }
-
&__comments {
position: relative;
}
diff --git a/client/src/app/main/dashboard/dashboard-create-ticket/create-ticket-form.js b/client/src/app/main/dashboard/dashboard-create-ticket/create-ticket-form.js
index 83b012bc..f8898b8f 100644
--- a/client/src/app/main/dashboard/dashboard-create-ticket/create-ticket-form.js
+++ b/client/src/app/main/dashboard/dashboard-create-ticket/create-ticket-form.js
@@ -56,6 +56,9 @@ class CreateTicketForm extends React.Component {
}}/>