Skip to content

Commit d41c34d

Browse files
authored
Merge pull request #21 from Buom01/master
Update to aldeed:autoform@6.0.0 and simpl-schema npm package
2 parents 9cb6c7f + 8a9d7db commit d41c34d

File tree

4 files changed

+16
-9
lines changed

4 files changed

+16
-9
lines changed

README.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,17 @@ Upload and manage files with autoForm via [`ostrio:files`](https://github.com/Ve
88

99
- Install `meteor add ostrio:autoform-files`
1010
- Install `meteor add ostrio:files`, *if not yet installed*
11+
- Add this config to `simpl-schema` NPM package (depending of the language that you are using):
12+
```javascript
13+
SimpleSchema.setDefaultMessages({
14+
initialLanguage: 'en',
15+
messages: {
16+
en: {
17+
uploadError: '{{value}}', //File-upload
18+
},
19+
}
20+
});
21+
```
1122
- Create your Files Collection (See [`ostrio:files`](https://github.com/VeliovGroup/Meteor-Files))
1223
```javascript
1324
var Images = new FilesCollection({
@@ -163,4 +174,4 @@ picture: {
163174
<template name="myFilePreview">
164175
<a href="{{file.link}}">{{file.original.name}}</a>
165176
</template>
166-
```
177+
```

lib/client/autoform.js

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,3 @@ AutoForm._globalHooks.onSuccess.push(function (type) {
1313
}
1414
}
1515
});
16-
17-
SimpleSchema.messages({
18-
uploadError: '[value]'
19-
});

lib/client/fileUpload.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,13 +68,13 @@ Template.afFileUpload.events({
6868
}, false);
6969

7070
upload.on('start', function () {
71-
AutoForm.getValidationContext().resetValidation();
71+
AutoForm.getValidationContext().reset();
7272
template.currentUpload.set(this);
7373
return;
7474
});
7575

7676
upload.on('error', function (error) {
77-
AutoForm.getValidationContext().resetValidation();
77+
AutoForm.getValidationContext().reset();
7878
AutoForm.getValidationContext().addInvalidKeys([{name: Template.instance().inputName, type: 'uploadError', value: error.reason}]);
7979
$(e.currentTarget).val('');
8080
return;

package.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ 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: '1.0.12',
5+
version: '2.0.1',
66
git: 'https://github.com/VeliovGroup/meteor-autoform-file.git'
77
});
88

@@ -14,7 +14,7 @@ Package.onUse(function(api) {
1414
'underscore',
1515
'reactive-var',
1616
'templating',
17-
'aldeed:autoform@5.8.1',
17+
'aldeed:autoform@6.0.0',
1818
'ostrio:files@1.7.11'
1919
]);
2020

0 commit comments

Comments
 (0)