Merge pull request #358 from hcengineering/merge-003

Signed-off-by: Andrey Platov <andrey@hardcoreeng.com>
Co-authored-by: Andrey Sobolev <haiodo@gmail.com>
This commit is contained in:
Andrey Platov 2021-11-24 13:44:29 +01:00 committed by GitHub
commit 853de9362e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 8 additions and 20 deletions

View File

@ -3,7 +3,7 @@
"version": "1.0.1",
"license": "EPL-2.0",
"scripts": {
"build": "cross-env NODE_ENV=development webpack --stats-error-details && echo 'done'",
"build": "cross-env NODE_ENV=production webpack --stats-error-details && echo 'done'",
"analyze": "cross-env NODE_ENV=production webpack --json > stats.json",
"show": "webpack-bundle-analyzer stats.json dist",
"dev": "cross-env CLIENT_TYPE=dev webpack serve --content-base public",

View File

@ -12,7 +12,6 @@
</head>
<body style="margin: 0; overflow: hidden;">
<script src='/vendors.js'></script>
<script src='/bundle.js'></script>
</body>

View File

@ -45,22 +45,6 @@ module.exports = {
chunkFilename: '[name].[id].js',
publicPath: '/'
},
optimization: {
minimize: prod,
usedExports: prod,
splitChunks: {
chunks: 'all',
maxAsyncRequests: 5,
maxInitialRequests: 3,
cacheGroups: {
vendors: {
name: 'vendors',
test: /[\\/]node_modules[\\/]/,
priority: 20
}
}
}
},
module: {
rules: [
{

View File

@ -13,6 +13,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-->
<script lang="ts">
import type { TxViewlet } from '@anticrm/activity'
import activity from '@anticrm/activity'

View File

@ -32,16 +32,20 @@
const ext = parts[parts.length - 1]
return ext.substring(0, 4).toUpperCase()
}
function openEmbedded(contentType: string) {
return contentType.includes('application/pdf') || contentType.startsWith('image/')
}
</script>
<div class="flex-row-center">
{#if value.type.includes('application/pdf')}
{#if openEmbedded(value.type)}
<div class="flex-center icon" on:click={()=> { closeTooltip(); showPopup(PDFViewer, { file: value.file }, 'right') }}>{iconLabel(value.name)}</div>
{:else}
<a class="no-line" href={getFileUrl(value.file)} download={value.name}><div class="flex-center icon">{iconLabel(value.name)}</div></a>
{/if}
<div class="flex-col info">
{#if value.type.includes('application/pdf')}
{#if openEmbedded(value.type)}
<div class="name" on:click={()=> { closeTooltip(); showPopup(PDFViewer, { file: value.file }, 'right') }}>{trimFilename(value.name)}</div>
{:else}
<div class="name"><a href={getFileUrl(value.file)} download={value.name}>{trimFilename(value.name)}</a></div>