silverstripe / silverstripe-campaign-admin

Campaign and publishing admin interface for Silverstripe
BSD 3-Clause "New" or "Revised" License
2 stars 16 forks source link

NEW Make use of ViewModeToggle component. #109

Closed raissanorth closed 6 years ago

raissanorth commented 6 years ago

Allows users to toggle between edit, preview, and split mode in the CMS.

Introduces dependencies on react-resize-aware library and Enzyme testing utility. The former is used to retrieve the screen width and determine if split mode should be enabled based on it. The latter is used to shallow render CampaignAdminList in the unit tests, as we don't want to test the child components ViewModeToggle and Preview. These components are now provided via Injector.

Removed media queries in favour of rendering preview and/or edit based on the state stored in ViewModeToggle's store.

Refactored CampaignAdminList's render method, to make it more readable. Moved the logic to render the detail/edit view into its own method - renderCampaignAdminListDetail

raissanorth commented 6 years ago

Note that this is dependant on https://github.com/silverstripe/silverstripe-admin/pull/560

flamerohr commented 6 years ago

@robbieaverill make sure to bump the version dependency in the package.json as well

also, I'm not sure why tests are failing for react-apollo

robbieaverill commented 6 years ago

also, I'm not sure why tests are failing for react-apollo

@flamerohr FYI this was because the admin module npm dependencies weren't installed. I reproduced this on the latest 1 branch for campaign-admin in Travis, we've pushed a fix for it which is stolen from asset-admin

robbieaverill commented 6 years ago

Merge on green (except behat)

flamerohr commented 6 years ago

oh I see cringe lol