Commit Graph

1680 Commits

Author SHA1 Message Date
Kevin Ansfield
8db9bc9f2e Fixed upgrade button not closing modal when attempting theme upload
no issue

- the upgrade button is a link rather than a button so was not triggering the modal's close behaviour
- added an `{{on "click" @close}}` handler to the link. `@close` does not preventDefault so the link's transition will still occur
2021-12-07 14:20:16 +00:00
Kevin Ansfield
93002be21d Fixed incorrect notification wording for scheduled email-only posts
refs https://github.com/TryGhost/Team/issues/1169

- we were incorrectly saying "Will be published and sent" instead of "Will be sent" for scheduled email-only posts
2021-12-07 10:57:21 +00:00
Kevin Ansfield
98b5506d64 🎨 Added confirmation dialog any time a post/page will be published
refs https://github.com/TryGhost/Team/issues/1169

Previously we were only showing a confirmation dialog if a publish action would trigger an email which was inconsistent and did not instil confidence when publishing.

- replaced old `modal-confirm-email-send` modal with the newer-style `modals/editor/confirm-publish` component
  - updated to handle standard publish in addition to email publish
  - updated copy
  - added "error" state when attempting to send email-only post to no members
- updated publish menu `save` task to open the confirm modal when going from `draft` to `published` or `scheduled`
  - underlying save with email polling moved to `_saveTask` so it can be re-used across `save` task (when not publishing) and when confirming from the modal
2021-12-07 00:18:24 +00:00
Fabien 'egg' O'Carroll
b3d2fb8b96 Allowed popups from email preview to escape sandbox (#2168)
refs https://github.com/TryGhost/Team/issues/1001

Our email newsletter preview is rendered inside of an iframe with
javascript disabled. When opening links from the preview, the new
window/tab inherits this property - which breaks links to twitter.
2021-12-06 18:48:04 +02:00
Kevin Ansfield
84b8d1be3b Moved cmd+shift+p shortcut handling into <GhPublishmenu>
refs https://github.com/TryGhost/Team/issues/1169

We want all publish actions to trigger a confirmation modal. Currently that confirmation modal is controlled by `<GhPublishmenu>` which made it difficult to use from the route-induced publish shortcut.

- removed old shortcut mixin approach from the editor route
- added modern keyboard handler to a hidden element that is rendered any time the publish menu is present
2021-12-01 11:51:10 +00:00
Rishabh
1b4c556837 Extended uploader component to take custom request method
no refs

By default, the uploader component was always using the `post` method to make upload calls for the files. Since some usecases like uploading media thumbnails need a different request method like `put`, this change allows overriding the request method used in upload.
2021-12-01 14:34:40 +05:30
Kevin Ansfield
aa9a9c9598 Removed unused tenor components from earlier iterations
refs https://github.com/TryGhost/Team/issues/1225

- iterations of earlier approaches (modal-image-selector, and kg-media-selector) for the gif selector were kept around whilst we narrowed down the interaction patterns, we've settled on the inline-image-selector pattern introduced in 3f3b66b668 meaning the others are no longer needed
2021-11-29 18:28:19 +00:00
Peter Zimon
591d5442e5 GIF browser refinements 2021-11-23 16:03:53 +01:00
Kevin Ansfield
3a4d1ecf60 Fixed error when searching tenor
no issue

- when removing zoom support from the tenor connector a call to `closeZoom()` when searching was missed
2021-11-19 17:31:35 +00:00
Peter Zimon
b3f74c1d88 GIF card refinements 2021-11-18 19:08:01 +01:00
Kevin Ansfield
0c4f9c8c6a 🐛 Fixed Casper not being installable from themes list
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
2021-11-17 22:49:00 +00:00
Kevin Ansfield
5f7c79d04e Fixed "Attempted to handle event deleteRecord on <page:x> .." error
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
2021-11-16 17:59:59 +00:00
Kevin Ansfield
4ca14b8eee 🐛 Fixed Unsplash image selector being available in editor when disabled
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
2021-11-15 16:38:57 +00:00
Kevin Ansfield
7c70211afe Fixed linter error 2021-11-15 14:30:21 +00:00
Kevin Ansfield
601727e50c Removed "zoom" in gif selector in favor of instant-insert
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
2021-11-15 14:27:22 +00:00
Kevin Ansfield
a9ae15b1a5 Added responsive column count to gif selector
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
2021-11-15 14:27:22 +00:00
Kevin Ansfield
6853b964f8 First iteration of gifs image selector + card
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
2021-11-12 16:10:26 +00:00
Kevin Ansfield
c128998d86 Fixed dropdown elements staying open/fixed when moving settings panel
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
2021-11-12 15:27:08 +00:00
Kevin Ansfield
e289b391f1 🐛 Fixed install of free themes from the marketplace that aren't in the built-in list
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
2021-11-12 12:57:25 +00:00
Kevin Ansfield
f253e2523d Fixed tests expecting old theme settings screen
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
2021-11-10 12:45:26 +00:00
Kevin Ansfield
35bcab00fe 🐛 Fixed preview modal showing outdated content if opened before autosave is triggered
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
2021-11-10 08:55:34 +00:00
Peter Zimon
e5b6db173c Removed obsolete integration files
- removed unused integration files (was restructured under Settings / integrations)
- removed unused routes
2021-11-05 13:42:38 +01:00
Rishabh Garg
208b4948ff Moved launch complete flag to new editor setting (#2135)
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.
2021-11-04 18:04:39 +05:30
Peter Zimon
9568f703c3 Fixed staff tests
- fixed all staff related tests after Admin route restructure
2021-11-04 09:40:24 +01:00
Peter Zimon
9a09fe5192 Fixed staff route and bio character count
- Removed "offers" feature flag for staff user route
- Updated "Bio" character count UI in staff user detail screen
2021-11-04 08:58:55 +01:00
Fabien 'egg' O'Carroll
6bd93a88ef Removed Offers related usage of labs flag (#2134)
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
2021-11-03 16:55:45 +02:00
Kevin Ansfield
396b99ecb0 Fixed upgrade modal not showing when theme uploads are not allowed
closes https://github.com/TryGhost/Team/issues/1193

- there was a typo in the limits modal component name that is shown when the limits service check fails when opening the upload theme modal
- added acceptance test with associated fix of modal name test selector in the template
2021-11-01 18:35:21 +00:00
Kevin Ansfield
7251b1acac Added acceptance tests for new design screen
no issue

- moved navigation settings tests from old settings/design tests to a separate file and unskipped them
- added happy-path acceptance tests for
  - rendering design screen
  - installing an official theme from the themes list
  - uploading a custom theme
2021-11-01 17:48:49 +00:00
Kevin Ansfield
f6ec42959a Ensured preview iframes always include doctype and html attributes
closes https://github.com/TryGhost/Ghost/issues/13684
refs 7eda410dc3

- ensures any `<DOCTYPE html>` (or equivalent) served when fetching preview html is passed through when replacing iframe contents
- replicates across all previews the fix for missing attributes on the `<html>` element that was put in for the design settings preview - using `documentElement.outerHTML` in place of `documentElement.innerHTML`
2021-10-28 14:53:40 +01:00
Rishabh Garg
65495b528f 🐛 Fixed settings previews not working in private site mode (#2128)
closes https://github.com/TryGhost/Team/issues/1161

- when a site is in private mode, design previews, the portal previews on membership, customize portal and offer pages were unable to load. 
- For design and theme previews, the request to fetch preview data was failing due to cors and cookie not attached when admin and frontend have split urls. 
- For portal and offer previews, there was no authentication done on private site before load, so if user opened the pages directly on them it failed to load the site.
- this change adds a new service that authenticates private site from admin as soon as user session is loaded, so previews on settings will always find the authenticated session for private sites and load correctly.
- it also updates fetch method for previews to include credentials so they are always able to fetch the site data after login
- removes authentication from site route since that was done as its now centrally taken care of by the frontend service
2021-10-28 18:29:41 +05:30
Sanne de Vries
829fc138a2 Made design settings sidenav footer sticky 2021-10-27 16:16:26 +02:00
Aileen Nowak
688e1a5fd8 Manually disable forceUpgrade when active subscription detected 2021-10-26 14:43:20 +02:00
Aileen Nowak
8f8809996c Restructured gh-billing-iframe 2021-10-26 14:06:25 +02:00
Kevin Ansfield
b7fee9a7bb Fixed editor status showing draft for sent email-only posts
closes https://github.com/TryGhost/Team/issues/1155

- added handling to `<GhEditorPostStatus>` for posts with status `'sent'`, it now shows "Sent to x members" instead of "Draft - saved"
2021-10-25 15:17:02 +01:00
Peter Zimon
f76174c4df Fixed redirect of archiving offers 2021-10-22 16:19:58 +02:00
Kevin Ansfield
cb13b7de1e Added automatic open of brand settings form when no custom theme settings exist
no issue

When no custom theme settings exist it's nice to have the brand settings form automatically visible when opening the design settings menu to avoid an extra click and let users make actions immediately. We don't want that behaviour when custom theme settings exist because it would hide useful context and result in extra scroll+clicks to get to the section you're interested in.

- when first rendering the menu, set the open section to `brand` if we're on the design settings index screen
- add an event handler to the router that re-sets the open section to `brand` each time we navigate back to the design settings index screen (leaving the index screen closes all open sections)
2021-10-22 12:02:59 +01:00
Aileen Nowak
b63a396423 Added handling for forceUpgrade state (#2116)
no issue

- Lapsed trials and subscriptions will set the site's hosting config to `forceUpgrade` in which case a Ghost(Pro) site does not have a valid subscription or trial
- In this state we need to redirect all routes for all staff users to `/#/pro` to ensure the subscription can be put back into an active state
- This commit tackles
    - Route update on startup on the application route level
    - Catching and redirecting all transition (utils routes)
    - Fetching the owner user to pass this information to the Ghost(Pro) app for better communication to non-owner staff users
    - Allowing non-owner users in the force upgrade state to transition to the `/#/pro` route
2021-10-22 12:29:55 +02:00
Kevin Ansfield
505ae7493e Optimized loading of custom theme setting in design screens
no issue

We want to automatically show brand settings expanded in the design menu when the active theme has no custom theme settings, in order to do that without causing visual noise/jank we need to ensure that we have all the data we need up-front before the design menu is rendered.

- optimized `customThemeSettings` loading behaviour
  - `.load()` will now only perform a fetch if settings have not previously been loaded so it can be called without causing unnecessary waits
  - `.reload()` will force a clear+refetch of the settings - called by `themeManagement.activate()` after successfully changing a theme
- moved fetching of theme settings from the design menu constructor to the `settings.design` route's `model()` hook
  - means the app will wait for loading to finish before showing any of the design settings screen so we can guarantee the data we need is available
- moved update of preview html from the design menu constructor to the design settings route as it's a more appropriate place to find screen setup/loading behaviour
2021-10-22 10:49:13 +01:00
Peter Zimon
2026a94cdb Fixed main nav menu bug for Offers alpha flag 2021-10-21 17:08:48 +02:00
Sanne de Vries
ee0646ce68 Updated design settings sidebar hover states 2021-10-21 16:44:46 +02:00
Kevin Ansfield
f66c992ad8 Fixed design preview remembering scroll position when changing page
refs https://github.com/TryGhost/Team/issues/1149

- added a `@pageId` argument to `<GhHtmlIframe>`, if that value is different at the point of swapping iframes after re-rendering it will reset the scroll position instead of copying it from the to-be-hidden iframe
- assigned `themeManagement.previewType` to `@pageId` so that it changes when switching between homepage and post previews
2021-10-21 13:37:38 +01:00
Kevin Ansfield
b474e00cf8 🐛 Fixed inconsistent publish/send messaging in publish menu
no issue

- fixes the "publish/send" dropdown showing when mail is not allowed by tying it to the `canSendEmail` property rather than always showing when editing a draft post
  - was previously showing when mailgun is not configured and when default email recipients is set to "disabled", in both cases the recipient selection was never available so the dropdown was confusing and lead to invalid states
  - removed the unnecessary property`showEmailOnlyInput` - replaced with `@canSendEmail`
  - removed the unnecessary property `nextActionName` - it always resulted in "publish" because it was only being shown for pages and pages can't be sent by email
- removed the logic for setting the initial selected option in `<GhDistributionActionSelect>` because it meant the select was not directly tied to the real distribution action value leading to mixed states across components. Switched to using the passed in `@distributionAction` value directly.
- fixed the publish button incorrectly showing "Publish & send" when no send would be occurring for a post
  - if "Publish & Send" is selected, the button will now show "Publish" when no recipients are selected
- fixed the publish button incorrectly showing "Publish & send" for pages
- fixed the now/schedule radio texts not changing when publish type was set to "Send" - the conditionals were incorrectly looking at `this.args.post.emailOnly` which is incorrect syntax would only update _after_ saving, switched to the menu's internal `@emailOnly` argument instead
2021-10-21 13:08:08 +01:00
Peter Zimon
328a59466c Making archive offer button less scary 2021-10-21 13:56:30 +02:00
Peter Zimon
cdbff1eb99 Fixed list right arrow position 2021-10-21 13:51:57 +02:00
Peter Zimon
6166c83c5d Refined member detail screen for offers 2021-10-21 13:43:12 +02:00
Rishabh
e69ac92967 Added offer details in member detail subscription box
refs https://github.com/TryGhost/Team/issues/1087

- associates a member with their offer redemptions by highlighting offer used for their subscription
2021-10-21 12:56:43 +05:30
Sanne de Vries
2c648fda34 Added dropdown arrow to custom settings select component 2021-10-20 16:57:37 +02:00
Sanne de Vries
3f642eeb7c Updated design settings page
- Changed modal copy
- Increased menu transition speed
- Updated sidenav tabs visually
2021-10-20 16:44:54 +02:00
Rishabh
ff4d0b8ce0 Removed Offer from sidebar when stripe is disconnected
closes https://github.com/TryGhost/Team/issues/1158

Offer feature doesn't make sense when paid memberships are disabled on a site, this change removes the Offer option from sidebar if Stripe is disconnected (no paid memberships)
2021-10-20 18:02:14 +05:30
Kevin Ansfield
8710f5f532 Added animation of sidebar between main and contextual menus
refs https://github.com/TryGhost/Team/issues/1149

- added `ember-css-transitions` library that provides a modifier that adds/removes classes used for animating elements in and out, automatically creating a clone for destroyed elements
- added a wrapper class around the `main` and `design` nav menu contents so they could be individually animated
- used the new `{{css-transition}}` modifier to animate the sidebar menus in/out
- ensured main menu doesn't animate on first render of the parent `<GhNavMenu>` component so there's no animation when Admin is loaded
2021-10-20 13:04:05 +01:00