Giter Site home page Giter Site logo

timbrandin / autoform-slingshot Goto Github PK

View Code? Open in Web Editor NEW

This project forked from ryanswrt/autoform-slingshot

9.0 9.0 12.0 38 KB

Autoform file upload directive using slingshot

License: MIT License

CoffeeScript 68.32% HTML 22.00% CSS 2.95% JavaScript 6.72%

autoform-slingshot's Introduction

autoform-slingshot's People

Contributors

jimmiebtlr avatar ryanswart avatar ryanswrt avatar timbrandin avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

autoform-slingshot's Issues

Less dependency blocks Meteor 1.2+

Meteor broke a bunch of packags when they released 1.2 because they bumped the version of less they use to 2, and then for some reason locked the versionless less to version 1. If you want to be able to update a package that relies on less, you must update the package like so: '[email protected] || 2.5.0',

I submitted a PR for this to TheAncientGoat's repo. I should do the same here?

Previous file array item clears out while adding new item.

I have following schema for my autoform.

uploads: {
        type: Array,
        label: 'Upload Files',
        optional: true
    },
    'uploads.$': {
        type: Object,
        label: 'Add file'
    },
    'uploads.$.fileType': {
        type: String,
        label: 'Select the type of file',
        autoform: {
            type: 'selectize',
            options: function () {
                return [
                    {label: "label1", value: "label1"},
                    {label: "label2", value: "label2"},
                    {label: "label3", value: "label3"}
                ];
            }
        }
    },
    'uploads.$.fileName': {
        type: String,
        label: 'Enter file name (Optional)'
    },
    'uploads.$.pictureUrl': {
      type: String,
      label: 'Upload a Photo',
      autoform: {
            type: 'slingshotFileUpload',
            afFieldInput:{
              slingshotdirective: 'uploadImages'
            }
        }
    }

But whehever, I click on adding new element in my autoform, the file upload label from of previous element gets change to upload from remove... then I had to again go to that upper element and choose file second time to upload it successfully.

Autoform autosave does not work well with this package.

The issue is that when a picture is added it is uploaded as expected automatically and saved to the collection with the new url, but when trying to replace it with a new picture it doesn't work. The old image just returns.

Turning off autosave fixes the problem.

Files removed if used in an autoform array when adding another item

I have an array in my schema where each item in the array I want to use the file uploader to pick a file (in this case, an image) to upload.

If I click the "+" button on the fields, before I start choosing files, it works correctly, but if I choose a file, then click the "+" button, the previous image disappears and is not saved. Here's a snippet of my schema, and my form

  image: {
    type: Array,
    label: "Images",
    optional: true
  },
  'image.$': {
    type: String,
    label: "Image",
    autoform: {
      type: 'slingshotFileUpload',
      afFieldInput: {
        slingshotdirective: 'imageUpload'
      }
    }
  },
<template name="insertHostForm">
  {{#autoForm collection=hostsCollection id="insertHostForm" type="insert"}}
      {{> afQuickField name="name"}}
      {{> afQuickField name="bio" type="textarea"}}
      {{> afQuickField name="image"}}
    <button type="submit" class="wdav button">Save</button>
  {{/autoForm}}
</template>

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.