refs https://github.com/TryGhost/Team/issues/1576
This change was required to avoid showing 'all members' or 'all paid members', when it was in fact 'all paid subscribers of newsletter X'. The newsletter name is only shown when multiple newsletters are activated on a site.
refs https://github.com/TryGhost/Team/issues/1598
- added `<GhPostBookmark>` card for displaying a bookmark card style representation of a post
- updated designsandbox route to include it for easier styling without needing to constantly go through the publish flow to see changes whilst styling
- updated publish flow complete step to render a bookmark card if a post/page was published
- added `{{post-author-names}}` helper so the author name concatenation logic can be re-used across the posts list and bookmark component
refs https://github.com/TryGhost/Team/issues/1576
- Recipient counts in scheduled post status at top of editor fixed for selected newsletter
- Added `fullRecipientFilter` getter on post model which includes the newsletter's recipientFilter
- Updated scheduled notification (used in old publishing flow or via preview)
refs https://github.com/TryGhost/Team/issues/1598
- pre-fetch post count when reaching the confirm step so it's available once save is complete
- updated copy on complete step to reflect the action that occurred, including the number of published posts when a post was published
- added `{{is-moment-today someDate}}` helper so we can switch between "today" and another date format
no issue
- `@publishOptions.willEmail` is derived state that changes when the model status changes, this was causing the text to momentarily change when confirming because saving requires the post status to be changed from `draft` to `published/scheduled`
- added static `willPublish` and `willEmail` properties to the confirm step component's backing class that are set from the data passed in during construction so we don't end up with changing copy due to underlying model updates
refs 713e2b5ecc
- added a timeout to wait for the modal animation to finish before changing the post status and saving so we're not causing copy changes whilst the modal is still visible
no issue
- we were comparing the wrong `publishType` value
- we were accessing `this.willEmail` _after_ setting model properties that would change it's value so we grab the value before making any changes
refs https://github.com/TryGhost/Team/issues/1597
- disabled automatic reset of the `<GhTaskButton>` used for saving so we don't have conflicting timeouts (button state auto reset is 2.5sec, display of save button before it's removed is 3sec)
no issue
When reverting a post/page to a draft we were applying the model changes, saving, then closing the modal. This had the unwanted effect of updating the modal's copy whilst the save was in progress because it's all derived state and we're changing that state.
- changed revert button behaviour to instantly close the modal with a return value that lets the publish management know to run the revert task once the modal has closed
- added a popup notification to confirm successful revert
refs 756f5094b4
- `saveTask` was renamed to `publishTask` then repurposed as a general `saveTask` but the `revertToDraftTask` wasn't updated to reflect the rename
refs https://github.com/TryGhost/Team/issues/1597
- added "Save" button to editor for scheduled and published posts when any edits have been made
- shows "Saving..." then "Saved" for 3 seconds before disappearing
- replaces "Saving..." indicator shown in status bar on the left
- added `showIcon` argument to `<GhTaskButton>` so it can be used for text style buttons
- changed editor status behaviour to only show "Scheduled" by default with the full text shown on hover
no issue
- in the update flow we were always using `post.email.emailCount` but scheduled posts won't yet have a `post.email` record
- switched to showing a count of members based on the post's newsletter slug and `emailRecipientFilter`
no issue
- `this.willEmail` was changed to include the post status as we only allow sending an email for draft posts but that meant the order of operations in the save task was wrong because we checked `willEmail` _after_ changing the status on a post meaning the newsletter/recipient filter query params were never attached when publishing
- Admin used a helper to generate Gravatar URLs for members
- This change switches to using the `avatar_image` returned by the Member API
- The helper predates the existence of `member.avatar_image`, and is no longer required
refs https://github.com/TryGhost/Ghost/issues/14101
- we have ~1000 linter warnings from historic code that is awaiting transforms as part of the Ember Octane migration
- the warning delay time of 30 days is too short, we keep hitting it because work on the migration has stalled
- keeping the linting errors in place is useful because the rules are useful for new code and the todo file helps track migration progress
- increased the ignore->warn decay time to 120 days, with a warn->fail time of 60 days after that giving us some time to clear up any remaining issues or add them back to the ignore list before builds start failing
no issue
- button text changed to include the post type and time of publish
- the button text has become more complex than a static string so the logic was moved into a getter on the confirm component backing class
refs https://ghost.slack.com/archives/C02G9E68C/p1651773627838629?thread_ts=1651771893.729649&cid=C02G9E68C
The chart was not reloading when the fake data toggle was changed. This code is only used when using mocked data. So if you loaded the page without mocked data, everything was working fine and the chart did show the right data. If you then enabled fake data, the chart just won’t reload and would keep showing the initial data (so it wasn’t always showing mocked data, just the initial data).
refs https://github.com/TryGhost/Team/issues/1582
- The draggable object container was too small and didn't include the drag handle
- Increased the size of the draggable object to include the drag handle by adding a container div
- The drag handle now doesn't require you to hover the card before becoming visible
- Fixed a bug where some newsletters would show the drag handle even when they were not hovered when you were dragging a different newsletter. When dragging, now only the dragged newsletter will show the drag handle, so it is more clear where you are dragging to.
- Fixed fading animation of the drag handle (visibilty animation needed step-start and step-end added)
- Fixed jumpiness when dragging or moving the last newsletter card, due to animated margin updates after a drag
- Fixed padding issue for newsletter cards on smaller devices (padding did increase) breaking the animation
no issue
- highlight all/free/paid/specific in the recipient overview wording in the options and confirmation stages of the publish flow
- fix "change settings" button on confirm step closing instead of going back to the options stage
closes https://github.com/TryGhost/Team/issues/1593
- swapped `recipientFilter` for `selectedRecipientFilter` tracked property with a default value of `undefined`
- added `defaultRecipientFilter` getter that uses settings and post attributes to return a filter string that matches the defined default recipient settings
- added `recipientFilter` getter to replace the previous tracked property, this checks `selectedRecipientFilter` being `undefined` and will return `defaultRecipientFilter` instead
- changing the filter updates `selectedRecipientFilter` acting as an override of the default
- keeping `recipientFilter` naming means the options part of the flow requires no changes
refs https://github.com/TryGhost/Team/issues/1576
- Passes the selected newsletter to the recipient selector
- Added a `recipientFilter` getter to the newsletter model to make changes easier in the future
- Updates the `fullRecipientFilter` in the new publishing flow to use the newsletter's recipientFilter
- Already takes future paid only newsletters into account
- The counts in the status message after publishing is not updated yet (requires https://github.com/TryGhost/Team/issues/1569)
- The counts in the scheduled notification is not updated yet (requires https://github.com/TryGhost/Team/issues/1569)
refs 8fb0d6ebb2
- logic for showing the "sent to x" wording on the published update flow was incorrect meaning it was showing for published posts/pages when nothing had been emailed
closes https://github.com/TryGhost/Team/issues/1589
closes https://github.com/TryGhost/Team/issues/1590
When a post is already scheduled or published the "Publish" button changes to "Update" and when clicked shows details about the last publish / upcoming schedule along with buttons to save any changes or revert to a draft.
- added separate `update-flow` modal with the save/revert options to keep the main `publish-flow` cleaner and focused just on the draft->publish flow
refs: https://github.com/TryGhost/Team/issues/1531
- any triple column collapses down to one and sits underneath each other
- the mini charts' legends disappear and they also then go full width underneath each other
- the resources module loses it's thumbnail at smaller widths
- the 2/3 resources column goes to 1/2
- everything worth having has truncation that is only seen at very small sizes
no issue
We still had some old components and templates from the `members-email` settings that were only were used when the (now GA) `multipleNewsletters` flag was disabled. I’ve removed them and renamed all routes and components from `members-email` and `members-email-labs` to just `newsletters` because it was sometimes hard to understand if a given components was still used or not when fixing issues.
closes https://github.com/TryGhost/Team/issues/1585
- adds newsletter select, free/paid checkboxes, and specific label select to the email recipients area in publish flow
- updated `PublishOptions`
- `willEmail` getter now takes into account the recipient filter so when free+paid+specific are all unchecked the flow corresponds to email not being sent
- save task passes through the real recipient filter
- added `fullRecipientFilter` for use in count fetchers so the selected newsletter is taken into account whilst we use `recipientFilter` as the main filter value
- fixed issues with dropdowns being cut off
- `{{liquid-if}}` uses `overflow: hidden` to make it's animation work, this means any popups that are larger than the expanded option size are cut off
- switched away from rendering the selects inline so they aren't limited by parent container size
- fixed `z-index` issues to they appear on top of the modal
no issue
In the new publish flow we use `{{members-count-fetcher}}` to show member counts as needed in the template without needing to worry about manually fetching counts in the backing classes. However, when switching between states in the flow the count would be re-requested resulting in some glitchy looking async count rendering. By changing `{{members-count-fetcher}}` to use our `members-count-cache` service internally we reduce the likelihood of an async count being triggered when switching between publish flow states.
- updated `members-count-cache` service methods to work with filter strings or full query objects
- switched `members-count-fetcher` resource to use `members-count-cache` in place of directly querying the store
refs: https://github.com/TryGhost/Team/issues/1531
- we've had to use a 99% width hack to ensure ChartJS is responsive
- this introduces a small negative margin to fix the container whilst keeping hack
refs: https://github.com/TryGhost/Team/issues/1531
- fixed up the hover states for staff picks and what's new
- matched padding and text baseline alignment for both boxes
- added in some truncation to stop breakage
refs: https://github.com/TryGhost/Team/issues/1531
- made whole row clickable
- added in hover state based on posts table style
- added in event icons for activity
- increased row spacing
- other subtle tweaks based on feedback
refs https://github.com/TryGhost/Team/issues/1542
- extracted before/after save routines in the editor controller into separate actions
- allows saving to occur in the publish flow without it needing any editor-specific knowledge
- allows for easier cleanup of email related logic from the editor save tasks later on
- added `saveTask` to `PublishOptions`
- applies the selected options to the post model where they correspond to model attributes and keeps the previous values in memory so the changes can be undone on failure - this keeps the local model state in sync because if a publish fails we want the editor to continue showing the draft state, non-scheduled publish time, and not have an unexpected email-only state
- saves the post model directly passing `adapterOptions` so the save request query params match the chosen publish options
- added a `saveTask` to the `<PublishManagement>` component
- passed through to the `publish-flow` modal and is triggered by the confirm button on the confirmation screen
- runs the before/afterSave arguments passed in from the editor
- runs the `saveTask` on `PublishOptions` which handles everything needed to change status and send emails
- polls the post after saving to wait for the attached email to switch to submitted/failed which lets us show a failure message and retry button as required (message + retry not yet implemented)
- adds "complete" state to publish flow once save has finished
- confirms what just happened based on saved post data rather than chosen publish options
- has a link to the view the post
refs https://github.com/TryGhost/Team/issues/1563
- Check if we have multiple newsletters in the members-events-fetcher
- Pass the resulting value to the `parse-member-event` helper
- Pass the value to the activity feed table and table-row components
The exit clause of the mergeDates function should return an array rather
than an object, to ensure that an array is always returned. Because we
are using the concat method when recursing, this continues to work for
longer lists.
We want to return an empty array if list is empty, this protects against
returning [undefined]
refs https://github.com/TryGhost/Team/issues/1572
When fetching the newsletters, other resources were included. Now we filter
on the newsletter tag so we only include newsletter and not normal resources.
refs https://github.com/TryGhost/Team/issues/1542
- added `willPublish` and `willEmail` convenience getters to `PublishOptions`
- added confirmation step that is switched to when clicking the Continue button in the publish flow
- separated options and confirmation steps into discrete components used by the `publish-flow` modal
refs https://github.com/TryGhost/Team/issues/1542
- assigning the result of `peekAll('newsletter').filter()` to `newsletters` doesn't work because the live peekAll array gets transformed to a static array so it was always blank
- assigned result of `peekAll('newsletter')` to `allNewsletters` and replaced `newsletters` property with a getter that uses `allNewsletters` to return an array of filtered and sorted newsletters
- fixed incorrect sort order for `defaultNewsletter`
- assigned default newsletter to tracked `newsletter` property as part of setup once newsletters have been fetched
- updated publish-flow template to show a real count and newsletter name
refs https://github.com/TryGhost/Toolbox/issues/308
- this endpoint is being switched to return a 204 with no body upon success
- if we don't change this code, the button will get stuck in a red Retry
state because it reads the `undefined` body and thinks it's an error
- this commit makes sure we return true if the POST is successful
refs https://github.com/TryGhost/Toolbox/issues/308
- we have a pattern of splitting words via an underscore in the API, so
v5 splits apart `passwordreset` to `password_reset`
- I'll follow up whether we want to fixup the `passwordreset` body
object
refs https://github.com/TryGhost/Toolbox/issues/308
- we have a pattern of using plurals for endpoints but `email_preview`
was implemented without it
- in v5, we're fixing that so we need to update Admin to take that into
account
refs https://github.com/TryGhost/Team/issues/1477
- Very basic test only
- Includes some extra test attributes in the components
- Commented out a test that was not yet fininished
refs https://github.com/TryGhost/Team/issues/1542
- moved publish-flow modal into `components/editor-labs/modals/publish-flow` as we have enough editor-related components to keep them in one place
- updated publish flow design to use expanding blocks in place of dropdowns
- added `openSection` property in publish-flow modal and associated action for toggling sections
- moved "publish at" option into a separate component to keep publish-flow modal cleaner (keeps option-specific actions out of the main modal component)
- used `{{liquid-if}}` to animate the expanding blocks
- added schedule time properties to `PublishOptions`
- kept "is scheduled" and "scheduled at" separate so it's possible to keep the selected schedule time across selecting/deselecting the option to schedule
- ensures schedule date is kept to the minimum 5-minute in the future across option changes
- updated publish-management to reset the scheduled option to "Right now" when the publish-flow modal is opened if a schedule time was previously set but is now in the past
refs: https://github.com/TryGhost/Team/issues/1531
- charts now have basic working loading states, could be improved though
- trying out staff picks description and layout tweaks
- lots of small design tweaks based on feedback
refs https://github.com/TryGhost/Team/issues/1512
Adds the new endpoint `/stats/subscriptions/` which provides data for
the paid mix and paid breakdown charts.
Made the filledMissingDates function more generic by passing in a
`copyData` function which is used to populate a date from the previous
days data, if the data for that date is missing.
refs: https://github.com/TryGhost/Team/issues/1531
- investigated how to make the layout not break on resize
- using a width 99% hack to make chartjs react properly
- redid the markup for the minicharts for more stable loading
- added in a subtle gradient for the mrr minichart
no issue
If you scheduled a post to a specific newsletter it was no longer visible in the scheduled state of the publish menu making it difficult to know the behaviour when coming back to a scheduled post.
- duplicated the newsletter dropdown from the draft to the scheduled state components and disabled it the same as the other recipient options
- added temporary workaround for missing newsletter embed for the posts endpoint in the API
- adds `newsletterId` attribute to the post model
- uses `post.newsletterId` to find the matching newsletter model from the available newsletters list
no issue
The full edit newsletter form with all the settings, design options, and preview felt quite overwhelming when the only piece of data that's required to create a newsletter is the name.
- re-organised the newsletter modal components by renaming `modals/edit-newlsetter` to `modals/newsletters` to better represent the full suite of modals that are used in newsletter management
- added a `modals/newsletters/new` component containing a minimal form with name/description/opt-in-existing fields
- switched the `new-newsletter` route to open the new modal rather than the previous dual-purpose edit modal
- moved message about newsletter creation into the create modal and dropped the separate create confirmation modal
- dropped unnecessary unsaved-changes confirmation
- removed the now-unused opt-in-existing behaviour from the edit newsletter modal
Co-authored-by: Peter Zimon <peter.zimon@gmail.com>
refs https://github.com/TryGhost/Team/issues/1469
- default newsletters were set for new members added on members list except "add yourself" feature
- updates default newsletters for new member added via "Add yourself" button
- without the multiple newsletter UI flag, a site can have only one newsletter
- updates the heading for newsletter management UI to singular in that case
refs https://github.com/TryGhost/Team/issues/1554
With multiple newsletters, the subscribed property on a member is replaced by newsletter(s) [] which defines member's subscription instead. This change -
- updates the existing subscription toggle for member on detail screen to work with new backend
- shows the new multiple newsletter subscription UI only if site has more than 1 newsletters
no issue
Also moves some reused test methods to the test helpers folder (wasn't able to move it to the fixtures because too many tests were failing):
- enableNewsletters helper
- enableStripe helper
- enableMailgun helper
refs: https://github.com/TryGhost/Team/issues/1556
- working implementation of all the parts of the dashboard
- now includes the what's new section again
- has dynamic, yet basic, newsletters
refs https://github.com/TryGhost/Team/issues/1542
- adds a `PublishOptions` class
- an instance of this class provides everything the UI needs to display and set the publish options relevant to the current post object and overall system state
- the `publish-flow` modal is passed a `PublishOptions` instance when it opens
- as part of the constructor it triggers a background load of any additional data it requires to control available options such as member counts, email limits, and newsletters
- adds a `{{publish-options}}` resource
- sets up and returns `PublishOptions` instance
- passes through service dependencies which are not available directly in the `PublishOptions` class as it's a custom native class outside of Ember's DI management
- used to ensure we can get a clean `PublishOptions` instance any time the passed in `post` object is replaced meaning we don't have to rely on observers and manual teardown/setup
- updated `<PublishManagement>` component
- sets up `publishOptions` property using `@use` and the `{{publish-options}}` resource so reactivity for changing post objects is handled automatically
- uses the `publishOptions.isLoading` property to disable the publish flow trigger button until all of the data required to manage the flow is available
- updated `publish-flow` modal to use some of the initially available `publishOptions` data
refs: https://github.com/TryGhost/Team/issues/1548
- this moves from a secondary dropdown to it being the main title one
- includes a few style fixes including fixing resources box in dark mode
refs: https://github.com/TryGhost/Team/issues/1531
- css grid was good when the layout was more complex but it's less needed now
- tried out some subtle gradients for the resource box
- tidied and cleaned up some css that wasn't needed anymore
refs: https://github.com/TryGhost/Team/issues/1547
- moved to horizontal bar chart
- made the tooltips work differently for this
- added in a simple legend for the cadence chart
- style issues remain but wanted to get functionality in there first
* Subtle tweaks to the recent posts
refs: https://github.com/TryGhost/Team/issues/1531
* Combining Recent Posts and Members Activity together and other layout tweaks
refs: https://github.com/TryGhost/Team/issues/1531
- attempting to combine recent posts and members activity together
- various layout tweaks to make this work better
- tons of tiny style tweaks
Enables splitting of multiple newsletters backend and ability to add newsletters behind different flags. This allows release and testing of all the new backend behavior for multiple newsletters to work with the default newsletter, and later allow sites to create multiple newsletters.
refs 5d839a4725
- `top.options` is not guaranteed to exist, put optional chaining in place so we aren't attempting to read `ignoreBackdropClick` from `undefined`
no issue
- depending on when the newsletter settings route is accessed we would sometimes show an empty newsletter list
- the problem stems from the use of a non-reactive fixed list of displayed newsletters where we manually update the list when we know the list should change. On initial load we were using `await store.findAll('newsletter')` then updating the displayed list, however the default behaviour for `store.findAll()` is to immediately return a live array - this doesn't work for our use-case because we'd then potentially update our displayed list from incomplete data
- added the `{reload: true}` option to the `findAll()` call to force a wait for the API request to finish before updating the displayed list of newsletters
refs https://github.com/TryGhost/Team/issues/1542
With the old publish menu flow the `Ctrl/Cmd+Shift+P` would immediately publish without showing any of the publish options which isn't ideal. For the redesign we'd like to try showing the publish flow modal instead.
- added key handler for the shortcut to the publish-flow triggering button
- added `ignoreBackdropClick` option to the publish flow modal and support for it in our modal backdrop click handler
- the shortcut simulates a click on the button which when the modal is open equates to a backdrop click meaning repeated presses of the Cmd+Shift+P shortcut resulted in glitchy modal open/close behaviour
refs https://github.com/TryGhost/Team/issues/1542
- adds `<EditorLabs::PublishManagement>` component that displays the relevant button for triggering publishing flows and will eventually store publish options for the editing session duration and manage the saving flow
- displays a "Publish" button that triggers the publish flow modal
- adds `editor-labs/publish-flow` full-screen modal containing a static mockup of the desired sentence-structure publish options design
refs https://github.com/TryGhost/Team/issues/1532
- added `showHeaderName` attribute to newsletter model
- added attribute toggle to the newsletter design settings form
- updated newsletter preview behaviour
- if both title and name are on, show name as a subtitle
- if title is off but name is on, show name as main title
- adjusted higher-level "show header" and "show header title" conditionals to account for the new setting
refs: https://github.com/TryGhost/Team/issues/1531
- broke apart the combined chart
- added back in the paid mix chart
- separated out the mini charts into separate components
- made top chart work with total, paid and free
- added in an overview section back at the top for total, paid, free
- made metric labels and values larger and easier to parse
Co-authored-by: Simon Backx <simon@ghost.org>
refs 50c762e222
- the count should only include members that are subscribed to active newsletters
- the filter change was accidentally included in a previous commit (50c762e222)
- removed the unnecessary `{{concat}}` usage
closes https://github.com/TryGhost/Team/issues/1537
- added conditional around the create confirmation modal display so it's only shown when attempting to save a new newsletter record
closes https://github.com/TryGhost/Team/issues/1530
- added confirmation modal that uses passed in archive task when confirming to provide feedback on progress
- switched archive link from immediately triggering the archive task to an action that launches the confirm modal
no issue
When multiple newsletters existed, the actions dropdown menus were all rendered on top of each other but hidden with CSS. This resulted in clicks that you expected to open an actions menu immediately triggering actions on a newsletter higher up in the list.
- switched from `<GhDropdown>` to `<GhBasicDropdown>` which adds/removes the dropdown content elements rather than rendering everything and hiding with CSS
- updated styling to match previous implementation
- added `.anim-fade-in-scale` classes for use with `{{css-transition}}` so we can keep the open/close animation
- `ember-basic-dropdown` does have support for transitioning in/out CSS classes but they are only triggered on the first open/close for each menu which resulted in oddly inconsistent behaviour with multiple menus in a list
- close animation doesn't actually work because the outer elements are removed by `ember-basic-dropdown` preventing `css-transitions` from performing it's animation
refs https://github.com/TryGhost/Team/issues/1528
- used the already-loaded newsletters list to pass the slugs of active newsletters to the confirm modal, this allows use of the `{{members-count-fetcher}}` resource with the query `/members/?filter=newsletters:[...slugs]` to fetch a member and full count metadata
- added inclusion of `{{join}}` helper from `ember-composable-helpers` addon
refs 8e120a74d6
- we use `data-test-state` inside of some modals which also use `<GhTaskButton>` which caused unrelated tests to start failing due to a change in matching element counts
refs 502fcaba3c
- the conditional for `isFailure` was wrong meaning we were showing the idle state unintentionally
- fixed the conditional so it checks for the return value rather than a `null` error
- updated the template with test selectors so it's easier to determine state where class names are not sufficient to differentiate
refs https://github.com/TryGhost/Team/issues/1528
- adds "opt-in existing" toggle to newsletter modal that's only shown when creating a newsletter
- defaults to true
- updated newsletter save flow to show confirmation before creation
- alters message to reflect auto-subscribe selection
- count of existing subscribed members is not implemented as it's not yet supported by the API
- updated newsletter adapter and save flow to use auto opt-in selection
- when option is checked the save URL is changed to `POST /members/?opt_in_existing=true`
- modified task button component to ignore a task return value of `canceled` so when it's received the buttons returns to the idle state instead of showing a saved or failed state
- used by save routine when the "Back to edit" button is clicked in the create confirmation modal
no issue
- member records are not re-fetched when navigating from the members list to the member details screen, instead the already loaded member object is passed through to the route directly to provide a faster navigation experience
- however, the objects used in the member list are proxy objects in order to support the lazy-loading infinite scroll. Proxy objects require the use of `get()` so errors were thrown when the newsletter subscription toggles were used
refs https://github.com/TryGhost/Ghost/pull/14491
- API endpoint used when completing verification of a newsletter email change has moved to `PUT /newsletters/verifications/` to follow our API patterns
refs https://github.com/TryGhost/Toolbox/issues/267
- Node 12 is EOL as of April 30th so we're going to be dropping support
for it in Ghost too
- the only change in Admin is to update the Node engines range