Skip to content

Automatic File ordering on Ingest/Update #60

@DiegoPino

Description

@DiegoPino

What is what we want?

Related to esmero/webform_strawberryfield#12 (but here since i want this to be part of src/StrawberryfieldFilePersisterService.php

One of the most common use cases is people uploading images that already have some type of naming convention related to a given order/sequence.

This is a quick first step that requires more code to be fully compliant with esmero/webform_strawberryfield#12 (comment), basically this won't respect a manual reorder, since it will always apply and re-apply this based on given file names. Still, it solves the most common and missing need. Give images a default order based on file name uploaded.

Some ideas on how to move forward:

1.- Only do this if no previous order: Which adds the following problem. What if someone adds during an edit an new File and there is already an order? Do we simply add the new image to the end? What if the order that is there was not manually given but automatic already? How do we do that differentiation?

2.- Have a key that allows overrides. Add an extra key that defines what order was applied. like 'sequence_type': 'natural' or 'manual' ?
If manual is present, don't touch. Still the question persist on what to do when adding a new one. Simply add the highest order +1 ? And let the user then, manually decide what to do? Could be a way

3.- There are sure other ordering issues i have not considered.

To be honest, i don't totally like the idea of another key inside the as:image etc structures. So maybe we can also do the following!. In case of manual order, why don't we add a fully new structure which acts as a ToC for that list of files? That would allow any arbitrary order, but still would allow to have, always, a natural ordered sequence like the one we generate automatically.

@giancarlobi @mitchellkeaney @marlo-longley i would love your opinion, hopefully any of you can in the few days think about use cases, edge cases and UIs to deal with this. Thanks

This is also related to esmero/webform_strawberryfield#12

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions