no issue
- fixed typo in the install-theme modal that meant we weren't correctly identifying Casper as the default theme meaning an attempt to install it was made instead of activating it
refs https://github.com/TryGhost/Team/issues/1121
Double-clicking the delete button in the confirmation modal could trigger a second attempt to delete the post/page when it had already been deleted resulting in an ugly/incomprehensible error bubbling up.
- added `{drop:true}` to the task instance so it can't be called again whilst it's currently running
- added a guard for `isDeleted` so we don't attempt to destroy an already deleted record
- added a `true` return so the button indicates a successful state rather than an error state whilst the modal is closing
refs https://github.com/TryGhost/Team/issues/1217
- tenor API config is now an object that lives at `config.tenor`
- updated gifs card gating to use the new config object
- added passthrough of `contentfilter` param from config when making Tenor API requests
Refs https://github.com/TryGhost/Team/issues/1206
- Replaced background and swatch colors to semi-transparent so that it works with light and dark mode
- Updated emoji-picker dark mode
- Removed text contrast adjustment for accent background
refs https://github.com/TryGhost/Team/issues/1206
- Re-use the saved emoji as the default for future callout cards
- Introduced a localstorage util that ignores errors. Ignoring errors avoids issues with browsers that don't support localstorage
no issue
- the front-end only supports white text on accent color backgrounds so we shouldn't have any auto contrast selection for text in Admin for consistency and to give a hint that a chosen accent color is too light
closes https://github.com/TryGhost/Team/issues/1223
It's possible to disable the Unsplash integration from the integration settings but when disabled the image selector was still available for post feature images and as an editor embed option.
- adds `isAvailable` property to card definitions, if it's set it should be a string that matches a config/setting that determines the card's availability
- unsplash card updated to use `'settings.unsplash'` as it's `isAvailable` property
- adds conditional to `<GhEditorFeatureImage>` so the Unsplash selector is only shown when enabled to bring it inline with the `<GhImageUploader>` component that was used previously for post feature images
refs https://github.com/TryGhost/Team/issues/1220
- there's no options for individual gifs like there are with Unsplash images and there's no real need to zoom for gifs that are already fairly small so the extra zoom step is unnecessary
refs https://github.com/TryGhost/Team/issues/1220
- added resize observer and cut-off widths for number of columns to auto-adjust based on the size of the selector's container
- fixed error when tenor service is unavailable due to missing `retry` action
refs https://github.com/TryGhost/Team/issues/1219
- added optional `adjustOnResize` argument to `{{movable}}` modifier
- when the movable element's size changes (based on a `ResizeObserver` event) the passed in action is called with the element and the current x/y position
- having this handled via the `{{movable}}` modifier is needed because that's what knows about any CSS translations that are present and allows the drag position to remain in sync with any resize-related adjustments
- return value of the action is expected to be a new `{x, y}` tuple
- used `adjustOnResize` in the `<KoenigSettingsPanel>` component so that any time the settings panel grows and causes part of it to be off-screen we re-position so that the whole panel is kept on-screen
refs https://github.com/TryGhost/Team/issues/1217
- adds `tenor` service that acts as a coordinator for the Tenor API similar to the `unsplash` service
- adds `<GhTenor>` component that renders an image search and select modal using the `tenor` service
- swapped the gifs card over to use the `tenor` image selector so it opens the tenor modal instead of the unsplash modal
refs https://github.com/TryGhost/Team/issues/1219
- added `dropdown.closeDropdowns()` to the `{{movable}}` modifier when dragging starts
- updated ember-power-select derived inputs to close their dropdowns when the dropdown service triggers it's `'close'` event
no issue
When we were given a source+ref we were using that to find a theme object from the built-in list of marketplace themes and if it wasn't found redirecting to the change-theme screen. That redirect didn't need to happen because we only need the `ref` and can determine the theme name from that.
- passed `ref` through to the install modal as a data argument
- updated install modal to get theme name from passed in theme or extracted from passed in `ref` when theme is not known
- adjusted "isDefaultTheme" so it always checks against Casper rather than using the `ref: 'default'` value from the list of marketplace themes
refs https://github.com/TryGhost/Team/issues/1209
- adds new `KoenigHtmlTextarea` component for entering multi line html in cards
- updates accordion card to use html text area component
refs https://github.com/TryGhost/Team/issues/1164
- removed conditional logic for links on settings index now that the old theme settings routes do not exist
- updated error handling test to use new design settings screens
- modified templates' test attributes to work with new design
- fixed `enableLabsFlag()` test helper error when fixtures have already been loaded
no refs
- access to membership settings is restricted to owners and admins as contributors/authors cannot perform any actions on the page
- redirects non owners/admins back to site when trying to access membership settings via URL
refs https://github.com/TryGhost/Team/issues/1164
- the dashboard was still linking to the old theme setting routes but those have now been disabled to allow for the theme install redirect route to live in the same place
- removed the old links as they are scheduled for removal as part of the `customThemeSettings` labs flag cleanup anyway
no issue
The marketplace still uses the `/settings/theme/install` route but that was removed as part of the redesign for design settings.
- added `settings.design.change-theme.install` route that uses the newer theme install modal
- requires backing controller for query param support despite no template being rendered
- uses the `change-theme` controller's official theme list to fetch theme details based on query param `ref`
- added `settings.change-theme` route that lives on the old `/settings/theme/install` path and redirects to the new install route
- commented out the old theme settings routes ready for full cleanup/removal
no issue
- if the automatic private site login fails during post-auth setup, don't fully error because that will block Admin from loading properly
- the automatic login is a nice-to-have and making it look like it worked won't break anything that wouldn't already be broken when the browser is blocking x-domain requests
refs https://github.com/TryGhost/Team/issues/609
There's a 3 second timeout before a background save is triggered after the last edit, if the preview modal is opened in that timeframe it would show outdated content.
- added a task that is triggered when the preview modal is opened
- if a save task is already running it will wait for it to finish
- otherwise if the post is a draft and the editor has dirty attributes it will trigger a save
- modal shows a loading spinner whilst waiting for the save to finish so the preview contents always match the latest editor changes
no issue
- when switching from the user-specific `feature.launchComplete` flag to the global `settings.editorIsLaunchComplete` there was a missed replacement of `feature`->`settings` in the dashboard logic for showing the members activity feed
no issue
- updating the preview is done asynchronously in the background as it's not essential to the theme activation process being complete, however it was kicked off before we had waited for the custom theme settings to be re-fetched from the API. The front-end _has_ successfully swapped themes and settings at this point but when we preview we send a full set of custom settings meaning we were sending settings for the previous theme rather than the current theme because the local settings cache in Admin hadn't finished updating
refs https://github.com/TryGhost/Team/issues/1208
- removing the click event listener in the same event loop as the `dragEnd` event is triggered meant Chrome still allowed the `click` event to trigger causing the card to become deselected and the movable panel closed when a drag ends outside of the central editor canvas
- adding a 1ms timeout means the event loop where the dragEnd is triggered fully completes before the next tick begins where the click handler is finally removed
closes https://github.com/TryGhost/Team/issues/1208
- clear and disable selection when drag starts
- ensure click-cancel event handler is removed when destroying (FF could trigger destroy without triggering drag end leaving you with nothing clickable)
no issue
- if the automatic private site login fails during post-auth setup, don't fully error because that will block Admin from loading properly
- the automatic login is a nice-to-have and making it look like it worked won't break anything that wouldn't already be broken when the browser is blocking x-domain requests
refs https://github.com/TryGhost/Team/issues/609
There's a 3 second timeout before a background save is triggered after the last edit, if the preview modal is opened in that timeframe it would show outdated content.
- added a task that is triggered when the preview modal is opened
- if a save task is already running it will wait for it to finish
- otherwise if the post is a draft and the editor has dirty attributes it will trigger a save
- modal shows a loading spinner whilst waiting for the save to finish so the preview contents always match the latest editor changes
no issue
- when switching from the user-specific `feature.launchComplete` flag to the global `settings.editorIsLaunchComplete` there was a missed replacement of `feature`->`settings` in the dashboard logic for showing "start creating content" CTA, resulting in it being always shown
- removes `launchComplete` feature flag setup on user which was used earlier for launch complete behavior
no issue
- when switching from the user-specific `feature.launchComplete` flag to the global `settings.editorIsLaunchComplete` there was a missed replacement of `feature`->`settings` in the dashboard logic for showing the members activity feed
refs https://github.com/TryGhost/Team/issues/1121
- adds error reporting for `notifications.showAlert()` in addition to `notifications.showAPIError()` because the former is used for some handled errors but will still show the undesired red error bar
- adds `shown_to_user` tag to all reported errors. Only errors that result in the red error bar will be reported with the tag as `true`, there may still be cases where we display errors outside of the red error bar but those wouldn't make it to Sentry either, we'll need a full audit of Admin source to find those situations and handle the reporting manually
- adds `ghost` context to errors that are shown in the red bar
- `ghost_error_code` - code returned from the API or passed manually through the `notifications.showAPIError()` options argument. Will be filled in once the error message has been audited+approved
- `displayed_message` - the full error message displayed to the user. Admin combines multiple attributes from the error details so it's useful to see what we actually show
- `full_error` - the actual API error response or a client-side generated error object
- `source` - whether the red bar came from `.showAlert()` or `.showAPIError()`, useful for tracking down where errors originated
no issue
- updating the preview is done asynchronously in the background as it's not essential to the theme activation process being complete, however it was kicked off before we had waited for the custom theme settings to be re-fetched from the API. The front-end _has_ successfully swapped themes and settings at this point but when we preview we send a full set of custom settings meaning we were sending settings for the previous theme rather than the current theme because the local settings cache in Admin hadn't finished updating
no issue
- added a `yield` to the fetch theme settings request when activating a theme so that settings are loaded before we switch back to the design index screen. Previously the load would happen async and the design menu didn't collapse because at the time of transition it looked like no custom settings were present
no issue
- moved lifecycle hooks to top of file as they are framework-provided and control creation/destruction
- changed code order for `dragStart()`, `drag()`, `dragEnd()` so they follow the modifiers expected event cycle
no issue
- stops drag from being initiated from any element that matches `input` or `.ember-basic-dropdown-trigger` so that text can still be selected from inputs whilst dragging and we don't get left with orphaned dropdowns from dragging a dropdown-inducing element
no issue
- added a movement threshold for click+drag so we don't make the drag fully active until there's been a few pixels of movement whilst the mouse is held down, fixes issues where a slight bit of movement when clicking on elements would make drag active blocking the click from working
refs https://github.com/TryGhost/Team/issues/807
refs https://github.com/TryGhost/Ghost/pull/13703
The launch wizard completed flag was previously stored at per user level in accessibility column of user table, so an administrator still got the option to complete the launch wizard even if the owner had completed it previously, which is not expected pattern. This change moves the launch complete flag to be stored in new global setting for site.
no issue
- moves disabling of scroll and pointer events into the `drag` handler so we don't inadvertently stop genuine clicks on elements inside the movable container
- adds a timeout for re-enabling pointer-events and clicks when drag finishes so we can still capture the unwanted events that would otherwise fire on mouseup
- uses a `click` event handler as that event is still fired even though we're preventing `mouseup`, fixes problems where the `pointer-events: none` on the movable container lets events through to the element behind it which could cause the movable container to be removed (eg, click event on the editor background moving a card out of edit mode)
no issue
- if the right button was pressed on the movable element it would start "drag" but also show the right-click menu meaning that once you clicked to close the menu the movable element was stuck to your pointer without the left button being held down
no issue
- adds `{{movable}}` render modifier that sets up basic mouse/touch event handlers that adjust the element's `translate` style when click/touched+dragged so it can be moved around the screen
refs https://github.com/TryGhost/Team/issues/1115
This removes all the usages of the Offers labs flag which do not modify routing.
The routing changes have been left for @peterzimon
no issue
- added the edit toolbar icon back to the email-cta card
- switched back to displaying the non-editable version of the card when not in edit mode
- removed unused `showSettingsPanel` property from `<KoenigCard>` component, cards can now control display of settings panel using `@isEditing`
- removed unused `@visible` argument for `<KoenigSettingsPanel>` component