Skip to content

Commit 6026f5d

Browse files
authored
Merge pull request #59 from VeliovGroup/meteor-1.9
πŸ“¦ v2.3.0 (Meteor 1.9) - ☝️ This release focused on compatibility with `meteor@1.9.*` and `node@12.*.*`; - 🀝 Compatibility with `meteor@1.9.*`; - 🀝 Compatibility with `node@12.*.*`; - πŸ‘¨β€πŸ”¬ [Demo autoform-gridfs app](https://github.com/VeliovGroup/files-gridfs-autoform-example) is updated and tested agains latest meteor/node.js releases; __Minor__: - πŸ”₯ Package version `v2.3.0` and newer is compatible __only__ with `meteor@1.9.*` and newer, due to changes in `meteor@1.9` and `node@12` __Fixed__: - 🐞 Fix issues from #57: *Default insertConfig chunksize and streams are NaN*, thanks to @jankapunkt; __Updated__: - πŸ“¦ __Remove__ `underscore` Atmosphere dependency for good; - πŸ“¦ Update `ostrio:files` Atmosphere dependency to `v1.14.0`, *was `v1.13.0`*
2 parents 668f87c + 07cd6a2 commit 6026f5d

File tree

3 files changed

+20
-10
lines changed

3 files changed

+20
-10
lines changed

β€ŽREADME.mdβ€Ž

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,19 @@
11
# Autoform File
22

33
<a href="https://www.patreon.com/bePatron?u=20396046">
4-
<img src="https://c5.patreon.com/external/logo/become_a_patron_button@2x.png" width="160">
4+
<img src="https://c5.patreon.com/external/logo/become_a_patron_button@2x.png" height="38">
5+
</a>
6+
7+
<a href="https://ostr.io/info/built-by-developers-for-developers">
8+
<img src="https://ostr.io/apple-touch-icon-60x60.png" height="38">
59
</a>
610

711
```shell
12+
# meteor@>=1.9
813
meteor add ostrio:autoform-files
14+
15+
# meteor@<1.9
16+
meteor add ostrio:autoform-files@2.2.1
917
```
1018

1119
## Description

β€Žlib/client/fileUpload.jsβ€Ž

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import { _ } from 'meteor/underscore';
21
import { Meteor } from 'meteor/meteor';
32
import { AutoForm } from 'meteor/aldeed:autoform';
43
import { Template } from 'meteor/templating';
@@ -52,15 +51,19 @@ Template.afFileUpload.onCreated(function () {
5251
this.uploadTemplate = this.data.atts.uploadTemplate || null;
5352
this.previewTemplate = this.data.atts.previewTemplate || null;
5453
this.accept = this.data.atts.accept || null;
55-
this.insertConfig = Object.assign({}, this.data.atts.insertConfig || {});
54+
this.insertConfig = Object.assign({}, defaultInsertOpts, this.data.atts.insertConfig || {});
5655
delete this.data.atts.insertConfig;
57-
this.insertConfig = Object.assign(this.insertConfig, _.pick(this.data.atts, Object.keys(defaultInsertOpts)));
5856

59-
if (!isNaN(this.insertConfig.streams) || this.insertConfig.streams !== 'dynamic') {
57+
if (!isNaN(this.insertConfig.streams)) {
6058
this.insertConfig.streams = parseInt(this.insertConfig.streams);
59+
} else if (this.insertConfig.streams !== 'dynamic') {
60+
this.insertConfig.streams = 'dynamic';
6161
}
62-
if (!isNaN(this.insertConfig.chunkSize) || this.insertConfig.chunkSize !== 'dynamic') {
62+
63+
if (!isNaN(this.insertConfig.chunkSize)) {
6364
this.insertConfig.chunkSize = parseInt(this.insertConfig.chunkSize);
65+
} else if (this.insertConfig.chunkSize !== 'dynamic') {
66+
this.insertConfig.chunkSize = 'dynamic';
6467
}
6568

6669
this.collectionName = function () {

β€Žpackage.jsβ€Ž

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,21 @@ Package.describe({
22
name: 'ostrio:autoform-files',
33
summary: 'File upload for AutoForm using ostrio:files',
44
description: 'File upload for AutoForm using ostrio:files',
5-
version: '2.2.1',
5+
version: '2.3.0',
66
git: 'https://github.com/VeliovGroup/meteor-autoform-file.git'
77
});
88

99
Package.onUse((api) => {
10-
api.versionsFrom('METEOR@1.6.1');
10+
api.versionsFrom('METEOR@1.9');
1111

1212
api.use([
1313
'check',
1414
'ecmascript',
15-
'underscore',
1615
'mongo',
1716
'reactive-var',
1817
'templating@1.3.2',
1918
'aldeed:autoform@6.3.0',
20-
'ostrio:files@1.13.0'
19+
'ostrio:files@1.14.0'
2120
], 'client');
2221

2322
api.addFiles([

0 commit comments

Comments
Β (0)