Skip to content
This repository has been archived by the owner on Mar 25, 2020. It is now read-only.

Update form #26

Open
aj07mm opened this issue Jan 29, 2015 · 16 comments
Open

Update form #26

aj07mm opened this issue Jan 29, 2015 · 16 comments

Comments

@aj07mm
Copy link

aj07mm commented Jan 29, 2015

The update is still on todo?

@aldeed
Copy link
Owner

aldeed commented Jan 29, 2015

I think @dpankros may be working on it?

@dpankros
Copy link
Collaborator

I am, but due to some issues, like the reactivity issue we discussed, and demands on my time, it’s taking longer than anticipated.
On January 29, 2015 at 4:51:21 PM, Eric Dobbertin (notifications@github.com) wrote:

I think @dpankros may be working on it?


Reply to this email directly or view it on GitHub.

@ndee
Copy link

ndee commented Feb 1, 2015

@dpankros: How will the upload work for multi-file fields? Will it be possible to add and remove previously uploaded files or will the update just replace files?
For my app the first approach would be very useful. If you implement just the replace I would like to add the "add&remove" feature. What do you think?

@dpankros
Copy link
Collaborator

dpankros commented Feb 3, 2015

@ndee I will do my best to make the updates granular so you don't have to replace all the files in a batch, unless you want to. I'm going to get to that side of it soon but I have other work to complete before I can get back to it.

Right now, the single-file version allows adding, removing and updating. I wouldn't expect it to be too much more difficult to make the multiple-file version mirror that behavior. Of course, it's possible that I run into a showstopper when I get into the code, but I hope not.

Just a warning that the new version will likely require AutoForm 5.

@ndee
Copy link

ndee commented Feb 3, 2015

@dpankros Sounds promising! Handling of multiple files in insert and update forms will be a core feature in my app. So, I'm motivated to support you. :-)
Usage of AutoForm 5 will be no problem for me.

What recently came into my mind: How will the update work when I specify an array which contains items with file references. Like in the following example.

Will the update remove the file when I remove an array item containing a file reference?

ImageSchema = new SimpleSchema({
    name: {
        type: String,
        label: 'Comment'
    },
    fileId: {
        type: String,
        autoform: {
            afFieldInput: {
                type: 'cfs-file',
                collection: 'images'
            }
        }
    }
});

MySchema = new SimpleSchema(        {
    name: {
        type: String,
        label: "Name"
    },
    files: {
        type: [ImageSchema],
        label: 'Images',
        optional: true
    }
});

@dpankros
Copy link
Collaborator

dpankros commented Feb 3, 2015

"Delete on remove" is an option that you can specify in the new preferences object. If you want them to be removed, set it to true. Otherwise it will be up to you to handle the orphaned files (such as archiving them).

@ndee
Copy link

ndee commented Feb 3, 2015

Very cool!

@Neobii
Copy link
Contributor

Neobii commented Feb 5, 2015

#27 I didn't get it to attach to the right issue. This is a pretty quick fix as I just copied the insert hooks to the update hooks but instead of the update I added the changes to the $set object.

This doesn't work for multiple files, however.

@tcastelli
Copy link

Sounds really cool, "Delete on remove" could be active by default. Any update on this part @dpankros?
:)

@dpankros
Copy link
Collaborator

dpankros commented Apr 2, 2015

@tcastelli "Delete on Remove" is in my fork (not merged back into the main yet). I think the default behavior should be off, however, because I do not want to be the cause of data being lost accidentally. If a delete is performed, it should be a conscious decision by the developer of the app, not the package. It is simple to enable, however. E.g:

CfsAutoForm.prefs.set('deleteOnRemove', true);

This code is for the new, unreleased version. It will not work with the current version.

@tcastelli
Copy link

I see, seems reasonable for anyone who is considering restoring/versioning after updates. Which is the quickest way to import your fork in a project? I would like to test it since i don't need multiple updates (i guess i have to clone your repo in the package folder and add through package add right?)

@dpankros
Copy link
Collaborator

dpankros commented Apr 2, 2015

@tcastelli Yes. That's correct. I also have a test app, if you want to try it separately or use it an example.

I feel compelled to reiterate that you should consider this alpha/beta type code and it should NOT be used in production yet. It is not fully debugged.

@tcastelli
Copy link

Thanks for the test app link, even if in beta stage, I don't mind trying it out and discussing about possible bugs :)

@petermikitsh
Copy link

+1 for getting this PR'ed...

@kpbird
Copy link

kpbird commented Sep 28, 2015

@dpankros test app (https://github.com/dpankros/cfs-autoform-test) is not working when I remove insecure and autopublish packages

@dpankros
Copy link
Collaborator

dpankros commented Oct 2, 2015

The code hasn't been worked on in some time, mainly because it never not the testing it needed beyond what I and a few others had done. Because of the continued changes autoform and cfs-autoform, and not in my fork, I'm considering it all abandoned. Sorry. I don't think anyone is using it anyway.

If it's just insecure and autopublish that cause issues, have you checked the basic causes? E.g. failure to publish a collection.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants