diff --git a/client/client/src/sample/create/index.html b/client/client/src/sample/create/index.html index 8fdcce50c5..744ef02f1e 100644 --- a/client/client/src/sample/create/index.html +++ b/client/client/src/sample/create/index.html @@ -14,7 +14,7 @@ vn-id="sampleType" field="$ctrl.clientSample.typeFk" model="ClientSample.typeFk" - select-fields="['id','description','code','hasCompany']" + select-fields="['code','hasCompany']" url="/client/api/Samples" show-field="description" value-field="id" diff --git a/services/mailer/application/router.js b/services/mailer/application/router.js index 1612718200..c8e32b5644 100644 --- a/services/mailer/application/router.js +++ b/services/mailer/application/router.js @@ -20,11 +20,30 @@ router.use('/static/:template/:image', function(request, response) { return response.json({message: 'Image not found'}); let readStream = fs.createReadStream(imagePath); - + readStream.on('open', function() { + let contentType = getContentType(imagePath); + + if (contentType) + response.setHeader('Content-type', getContentType(imagePath)); + readStream.pipe(response); }); }); }); +function getContentType(path) { + let types = { + png: 'image/png', + svg: 'image/svg+xml', + gif: 'image/gif', + jpeg: 'image/jpeg', + jpg: 'image/jpeg' + }; + + let extension = path.split('.')[1]; + + return types[extension]; +} + module.exports = router; diff --git a/services/mailer/static/css/component.css b/services/mailer/static/css/component.css index b4c018d79b..2621048c32 100644 --- a/services/mailer/static/css/component.css +++ b/services/mailer/static/css/component.css @@ -7,10 +7,6 @@ img { margin: 0 } -p { - text-align: justify -} - .wrapper { background-color: #EEE }