-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Conversation
3c4276b
to
dd59d3e
Compare
69f2f01
to
52acf2c
Compare
@acburdine would be good to get a second pair of eyes on these changes: 111bc33 I've had to introduce a global event bus in order to have parent->child component communication. I tried doing this by registering the child with the parent but that ran into problems because:
|
Possible alternatives that spring to mind:
|
@kevinansfield 👍 will look in a bit |
Third option: don't swap out the upload component but instead change the style to I think for now I'm going to go with the first alternative option of modifying the uploader component to accept a file attribute - I think that's the simplest option for now without introducing additional concepts such as the event bus (although I do think the event bus concept would be useful, e.g. for handling global keyboard shortcuts inside components, and avoiding some of the complexity involved in getting save buttons to spin when saving is happening outside of it's own promise). However I think my main takeaway is that the uploader components are currently encapsulating too much behaviour, things like this would be a lot easier if they were split into more composable components, e.g.:
|
509821e
to
82cafce
Compare
no issue - upload components will now trigger a passed-in `fileSelected` action upon file selection - useful when users of the components want to utilise the file object without supplying a custom validation action
82cafce
to
92137ae
Compare
refs TryGhost/Ghost#7204, requires TryGhost/Ghost#7209 - replaces theme dropdown with a table - adds theme upload modal - validates theme mime type - prevents upload of `casper.zip` (default Casper theme can't be overwritten) - warns if an upload will overwrite an existing theme - gives option of immediately activating the uploaded theme or closing after successful upload - adds theme activation link/action - adds theme download link/action - adds theme deletion modal - warns about no undo possibility - offers possibility to download theme - modifies mirage config to handle theme changes
92137ae
to
5581c6b
Compare
I've squashed ready for merge + release testing. Outstanding TODOs:
Note that due to time constraints I've left the event bus system discussed above in place for now. I have some refactoring planned for the upload components so I can look at removing the event bus service at that point if it doesn't prove useful in any other circumstances. |
refs TryGhost#210 - adds missing acceptance tests for theme deletion - adds theme deletion endpoint to mirage config - fixes mirage settings update endpoint (was previously removing config that the client didn't send and also losing the `type` key for all entries preventing the `GET` request from working properly)
refs TryGhost#210 - removes unused `activeTheme` property on `gh-theme-table` - updates label generation in `gh-theme-table` to add folder names when there are duplicate package.json name+version combos
refs TryGhost/Ghost#7204, requires TryGhost/Ghost#7209
casper.zip
(default Casper theme can't be overwritten)TODO: