Animation Tab Simple Upload#7905
Conversation
Tests clean up better including delete markers Use/extract helpers for versions test Remove unneeded parentheses Test replacing an animation version Give animations its own POST endpoint
Use Uuid key for cloned animations
Check app quotas on copy and handle not found case
| "react-redux": "^4.4.0", | ||
| "redux": "^3.3.1", | ||
| "redux-logger": "^2.6.1", | ||
| "redux-thunk": "^2.0.1", |
There was a problem hiding this comment.
redux-thunk allows your action-creators to return functions instead of POJOs. Those functions in turn are able to read state and dispatch additional actions. This provides a neat template for dispatching asynchronous actions, and is a recommended way to handle async work in redux.
|
Brent, PTAL - and feel free to suggest ways to break this apart into smaller PRs. I suppose I could pull all the server stuff out and merge it first. |
|
Brent, never mind, I know I need to break this up. I'd appreciate any thoughts you have on the broad approach though. |
| return <input | ||
| ref="uploader" | ||
| type="file" | ||
| style={{display: 'none'}} |
There was a problem hiding this comment.
could use commonStyles.hidden here if desired.
| this.setState({ | ||
| view: View.UPLOAD_IN_PROGRESS, | ||
| originalFileName: data.files[0].name | ||
| }); |
There was a problem hiding this comment.
In a world where we have redux, it may make sense to have a discussion about if/where we still use local state. I think it would be good if we had a clear store on when it was reasonable.
|
Gave things an initial look. My two high level concerns are (1) functions in our store/reducers and (2) When to use local state in a redux world. Let me know if there are other specific things you wanted feedback on. |
|
Opened new API changes (only) in #7911. |
Establishes the infrastructure to allow uploading PNGs to an 'animations' bucket on S3 and associate animation metadata with the project source. Uploaded images show up in the left column and can be renamed, cloned, and deleted.
This is just the first step along the road to an actual functioning Animation Tab. The next step will be using the basic metadata we have to build a
createSprite(animationLabel, x, y)command, so the curriculum team can start to build around assets imported through the animation tab. Then we'll turn our attention to integrating Piskel, which will make the animation tab functionality much more robust.This PR includes server and client changes.
Server
We've added a
v3/animationsAPI that is based on the assets and sources APIs. I manually created the S3 bucket for this API already. It handles file uploads, and also access to particular versions.Client
Added real upload functionality to the AnimationPicker, store animation metadata along as part of the versioned info going to the 'sources' API, enable adding animations via upload, deleting animations, cloning animations and renaming animations.
Note that for now, "animations" are all simple PNGs, single-frame. We'll add sprite-sheet support as things get more complicated.
Animations are given a UUID "key" independent of their name, which becomes their object key on S3. This lets the student freely rename them.
Possible Improvments
I'd appreciate some help working out what's important to do now, and what I can save for later. Again, we want to get a simple version of this to the Ed team ASAP.