punchcard-cms / input-plugin-file Goto Github PK
View Code? Open in Web Editor NEWFile input plugin
License: Apache License 2.0
File input plugin
License: Apache License 2.0
When files are uploaded and processed with something like [connect-multiparty(https://github.com/expressjs/connect-multiparty) a more complicated object is created than what the validation is actually testing against.
We already have an example of what this should look like in the files fixtures in punchcard.
I'd like to be able to preview previously uploaded files. Previewing files as they're uploaded is slightly more complicated so I'd like to keep that as a separate story. In addition, Shared Tests will need to be updated in order to ignore value
for file
fields. This is especially true as the value for a file is going to be an object including it's name, path, and MIME type.
Feature: Preview
As a content creator
I want to preview uploaded content
So that I know content I've uploaded
Scenario: Image
Given that I have previously uploaded an image
When I load a form that includes the uploaded file
Then I should see the image in a small preview above the file upload button
And the file's name should be the alt text of the image
And the image should link to the full version of the image
And to the right of the image should be the file's name
And to the file's name should link to the full version of the image
Scenario: Audio
Given that I have previously uploaded an audio file
When I load a form that includes the uploaded file
Then I should see the audio loaded as a preview above the file upload button
And I should be able to play the audio if the browser supports that audio file
And under the audio player should be the file's name
And the file's name should link to the audio file
Scenario: Video
Given that I have previously uploaded an video file
When I load a form that includes the uploaded file
Then I should see the video loaded as a preview above the file upload button
And I should be able to play the video if the browser supports that video file
And under the video player should be the file's name
And the file's name should link to the video file
Scenario: File
Given that I have previously uploaded file
And that file is not an image
And that file is not audio
And that file is not video
When I load a form that includes the uploaded file
Then I should see name of the file above the file upload button
And the file's name should link to the file
Preview
@scottnath commented on Thu Aug 04 2016
We need file uploads. The core idea is the same for both images and files.
Feature: File uploads
As a content creator
I want to upload files during content entry
So that I may have files as content.
Scenario: File selection
Given that my content type requires me to add a file as data
When I am entering content in said type
Then I need to be able to include a file as content
And I should be able to select a file to upload from my device
And I should know what file I have selected because it's name is visible after selection.
Scenario: File types
Given that my content type requires me to add a file as data
And that the requirement may be limited to specific file types
When I am entering content in said type
Then I should be limited to only allow selection of the file type or types specified by said type.
And I should not be able to select files which are not that type or types
Scenario: Upload one file
Given that my content type limits me to adding only one file as data
When I am filling in content with a limit to only one file
Then the file upload input should limit selection to only one file
Scenario: Validation
Given that my content type requires me to add a file as data
And that the requirement is limited to text files
When I submit a form containing files I'm trying to upload
Then the validation should check what I have submitted for file uploads
And it should return an error if any file is not a text file
@scottnath commented on Wed Sep 28 2016
blocked by research story: #460
should build upon #155
@scottnath commented on Tue Oct 11 2016
research story complete. Un-blocking
@Snugug commented on Mon Oct 31 2016
Would like a file input plugin in order to work through #492 so tackling this first
To see what happens to your code in Node.js 10, Greenkeeper has created a branch with the following changes:
.travis.yml
.nvmrc
with the new onepackage.json
files was updated to the new Node.js versionIf you’re interested in upgrading this repo to Node.js 10, you can open a PR with these changes. Please note that this issue is just intended as a friendly reminder and the PR as a possible starting point for getting your code running on Node.js 10.
Greenkeeper has checked the engines
key in any package.json
file, the .nvmrc
file, and the .travis.yml
file, if present.
engines
was only updated if it defined a single version, not a range..nvmrc
was updated to Node.js 10.travis.yml
was only changed if there was a root-level node_js
that didn’t already include Node.js 10, such as node
or lts/*
. In this case, the new version was appended to the list. We didn’t touch job or matrix configurations because these tend to be quite specific and complex, and it’s difficult to infer what the intentions were.For many simpler .travis.yml
configurations, this PR should suffice as-is, but depending on what you’re doing it may require additional work or may not be applicable at all. We’re also aware that you may have good reasons to not update to Node.js 10, which is why this was sent as an issue and not a pull request. Feel free to delete it without comment, I’m a humble robot and won’t feel rejected 🤖
There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.
Your Greenkeeper Bot 🌴
LONG_DESCRIPTION
Feature: Multiple
As a content creator
I want to upload multiple files at once during content entry
So that I can reduce the amount of content entry I need to do.
Scenario: Upload
Given that my content type requires me to add multiple files as data
And that a file upload input should allow for multiple files to be selected
When I am filling in content with a requirement for multiple files on one input
Then the file upload input should allow selection of multiple files
Scenario: Validate
Given that I have uploaded multiple files
When my uploads are being validated
Then the each file should be validated separately
Multiple
I want to be able to signal to a back-end processor a file that's been uploaded should be deleted
Definitions
Feature: Delete
As a Content Creator
I want to be delete an uploaded file
So that I can not include a previously included file
Scenario: Signal
Given I have uploaded a file
When I want to delete that file
Then I can check a box that will will allow me delete the unwanted file
And if the file has a preview, that preview will be removed
And if I uncheck the box without having uploaded a new file, the preview will return
Delete
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.