serve static assets on urls with file extension #538

Merged
bones7242 merged 19 commits from 515-showlite-serves-asset into master 2018-07-20 18:57:12 +02:00
2 changed files with 8 additions and 8 deletions
Showing only changes of commit 004770587a - Show all commits

View file

@ -19,10 +19,10 @@ var AssetPreview = function AssetPreview(_ref) {
fileExt = _ref$claimData.fileExt,
contentType = _ref$claimData.contentType,
thumbnail = _ref$claimData.thumbnail;
var directSourceLink = "asset/".concat(name, "/").concat(claimId);
var showUrlLink = "/".concat(claimId, "/").concat(name);
var embedUrl = "/".concat(claimId, "/").concat(name, ".").concat(fileExt);
var showUrl = "/".concat(claimId, "/").concat(name);
return _react.default.createElement(_reactRouterDom.Link, {
to: showUrlLink
to: showUrl
}, function () {
switch (contentType) {
case 'image/jpeg':
@ -31,7 +31,7 @@ var AssetPreview = function AssetPreview(_ref) {
case 'image/gif':
return _react.default.createElement("img", {
className: 'asset-preview-image',
src: directSourceLink,
src: embedUrl,
alt: name
});

View file

@ -2,10 +2,10 @@ import React from 'react';
import { Link } from 'react-router-dom';
const AssetPreview = ({ defaultThumbnail, claimData: { name, claimId, fileExt, contentType, thumbnail } }) => {
const directSourceLink = `asset/${name}/${claimId}`;
const showUrlLink = `/${claimId}/${name}`;
const embedUrl = `/${claimId}/${name}.${fileExt}`;
const showUrl = `/${claimId}/${name}`;
return (
<Link to={showUrlLink} >
<Link to={showUrl} >
{(() => {
switch (contentType) {
case 'image/jpeg':
@ -15,7 +15,7 @@ const AssetPreview = ({ defaultThumbnail, claimData: { name, claimId, fileExt, c
return (
<img
className={'asset-preview-image'}
src={directSourceLink}
src={embedUrl}
alt={name}
/>
);