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.
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
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/1513
- `sender_name` is now nullable with a fallback to the site title
- updated new-newsletter route
- removed default setting of site title in `senderName` of the new newsletter instance
- removed extra checks when showing unsaved changes modal as we no longer need to compare the `senderName` attribute against the site title
- updated newsletter preview so the sender name falls back to the site title
- updated sender name input placeholder to show the site title
- removed not-empty validation
- fixed the switch to "multiple newsletter" state in the background of the new-newsletter modal
- problem was `displayingDefault` getter was looking at all active newsletters rather than just the filtered ones so it was counting the new-but-unsaved newsletter even though it wasn't displayed in the list
- fixes layout glitch when the new-newsletter modal animates out after cancelling creation
no issue
The close button in the unsaved changes modal used the `@close` action directly compared to the "Stay" button which used `(fn @close false)`. The close button version without explicit arguments resulted in the first argument being a `PointerEvent` instance which if checked as a modal return value as `if (shouldClose)` would evaluate as truthy therefore matching the "Leave" behaviour instead of the "Stay" behaviour.
- changed modal to explicitly call `(fn @close false)` when the close button is clicked
- updated design settings route to have an explicit `shouldLeave === true` check so default behaviour is always "Stay"
refs https://github.com/TryGhost/Team/issues/584
refs https://github.com/TryGhost/Team/issues/1498
- updated newsletter save routine in `edit-newsletter` modal to open an email confirmation modal if the API indicates one was sent
- modal indicates that the previously set or default email will continue to be used until verified
- response from API when saving looks like `{newsletters: [{...}], meta: {sent_email_verification: ['sender_name]}}`
- added custom newsletter serializer and updated model so that the `meta` property returned in the response when saving posts is exposed
- Ember Data only exposes meta on array-response find/query methods
- https://github.com/emberjs/data/issues/2905
- added `/settings/members-email-labs/?verifyEmail=xyz` query param handling
- opens email verification modal if param is set and instantly clears the query param to avoid problems with sticky params
- when the modal opens it makes a `PUT /newsletters/verify-email/` request with the token in the body params, on the API side this works the same as a newsletter update request returning the fully updated newsletter record which is then pushed into the store
- removed unused from/reply address code from `<Settings::MembersEmailLabs>` component and controller
- setting the values now handled per-newsletter in the edit-newsletter modal
- verifying email change is handled in the members-email-labs controller
- fixed mirage not outputting pluralized root for "singular" endpoints such as POST/PUT requests to better match our API behaviour
no issue
- when displaying only the default newsletter there's no option to drag/re-order but the border was still moving on hover as it does when displaying the drag handle
- updated the class name to take `displayingDefault` into account when adding the draggable class
closes https://github.com/TryGhost/Team/issues/1483
- updated newsletters list to use `<SortableObjects>` and `<DraggableObject>`
- swapped the `filteredNewsletters` reactive getter for a tracked property because `<SortableObjects>` replaces the value with a new array when re-ordering which isn't compatible with a getter
- required explicit update of the list any time the list should change through filter swap, archive, unarchive
- required explicit update of the list via router event when leaving the "new newsletter" route so any newly added newsletter can be displayed
- added action for handling update of `sort_order` properties when a re-order occurs
- updates every newsletter setting `sort_order` of the active newsletters first based on the new order, followed by all archived newsletters following their existing order
- disabled sorting of newsletters in the archived newsletters list
- hides the grab handle and disables the resize on hover
- allowing re-order of archived newsletters would complicate the re-order+save algorithm and re-ordering archived newsletters doesn't have a use-case
closes https://github.com/TryGhost/Team/issues/1476
- added dropdown for switching between active and archived newsletters
- modified the "default" newsletter display so it's only activated when a single active newsletter is shown
- added ability to un-archive a newsletter with a switch between "archive" and "un-archive" actions based on newsletter status
- if all archived newsletters are un-archived, automatically switches to "active" filter so you're not left with an empty list
refs https://github.com/TryGhost/Team/issues/1441
- switched "leave settings" confirmation modal on members email settings screen over to modern modal pattern
- removed unused `showEmailDesignSettings` property and `closeEmailDesignSettings()` action on `<Settings::MembersEmailLabs>` component
- the used property and action live on the controller, looks like it was a copy/paste hangover when functionality was moved to a component
- added newsletter model
- includes design-related attributes which are not yet supported by the API but are due to be added
- includes `default` attribute but there is no setting for it, due to be removed from the API but it's needed for save not to error for now
- set up basic mirage model and endpoints
- added validation for main settings to match API validation
- added `EditNewsletter` modal
- separate tabs for general newsletter settings and design-related settings
- used for both creating and editing newsletters
- added `/settings/members-email/newsletters/new` and `/settings/members-email/newsletters/:id` routes
- both display the `EditNewsletter` modal on top of the members-email settings screen with the appropriate newsletter model
- updated `<Settings::MembersEmailLabs::NewsletterManagement>` component to work with real newsletter model instances and the new add/edit routes
- removed now-unused `newsletter` service that was providing mocked data for earlier design iteration
refs https://github.com/TryGhost/Team/issues/1441
- pulls newsletter-related functionality into one place to keep higher-level components from knowing about too many concepts and becoming bloated
- updated temporary newsletters service to have fully tracked objects so the `active/archivedNewsletters` properties can be closer to how they will work with full models
refs a4ca693871
- label's "for" was removed to enable more direct use of the checkbox enabling keyboard usage but the test was not updated to reflect the change
refs https://github.com/TryGhost/Team/issues/1441
- duplicated route/controller/template and component to `-labs` versions so larger changes and refactors can be made without affecting the GA code
- added redirect for `/settings/members-email -> /settings/members-email-labs` when `multipleNewsletters` flag is enabled
- cleaned up multiple-newsletters related code from the non-labs component
refs https://github.com/TryGhost/Team/issues/1447
- Added a few newsletter methods (browse, add, archive/un-archive)
- This temporary code helps the frontend implementation to be done quicker
- And helps getting a better understanding of the backend implementation (schema + api routes)
Refs https://github.com/TryGhost/Team/issues/1441
- Rearranged the page: publish-menu preview is removed because the publish flow will change.
- Email addresses setting removed because it will be set on an individual newsletter level
The tier visibility is now handled by visibility property on object, this change ensures portal preview is updated on a tier archive to show the correct Portal UI.
closes https://github.com/TryGhost/Team/issues/1381
refs 21b4b15a1c
- when the email newsletter settings was refactored, the `emailTrackOpens: reads('settings.emailTrackOpens')` was removed as it's a confusing redirection but it's usage in the toggle action was missed
refs https://github.com/TryGhost/Team/issues/1358
- added acceptance tests for members settings screen
- subscription access management
- default post access management
- free tier management
- fixed `enableLabsFlag()` test helper overwriting existing flag settings when enabling another one
- updated API mocks and fixtures
- matched product fixtures to default tiers-enabled products
- updated product API mocks to include benefit handling
no issue
- since `ember-concurrency@2.0` it's possible to use the standard imports as decorators removing the need for the extra `ember-concurrency-decorators` dependency and imports
no issue
- shows an unsplash button when no image is present, opening the full unsplash selector when clicked
- behind the `improvedOnboarding` labs flag
refs https://github.com/TryGhost/Team/issues/1310
We want to use parts of the "Brand setting" form in a separate streamlined settings screen after site setup but that wasn't possible without a lot of duplication.
- extracted individual form fields into separate components for re-use
- included minor refactors like using `uploader.registerFileInput` and `uploader.triggerFileDialog` instead of continually duplicating the same file input trigger method
- fixed accessibility issues
- changed input titles from `<div>` to `<label>` and associated with the component's input fields
- changed `<img {{on "click" upload}}>` to `<input type="image">` so they act as proper buttons and are linked to the label (required a styling change so `img` and `input[type="image"]` are treated equally)
- finished cleanup of `.description-container-labs` by renaming to `.description-container`
refs https://github.com/TryGhost/Team/issues/1071
Default content visibility for specific tiers is now stored across 2 settings - `tiers` on `default_content_visibility` and list of tier ids on `default_content_visibility_tiers` setting, which is consistent with pattern of storing visibility on posts. This change -
- updates visibility filter UI for default content visibility segment select
- cleans up common visibility segment select component to handle ids directly instead of nql segments
- updates setting model
refs https://github.com/TryGhost/Admin/pull/2238
Follow up to #2238, this should remove the existing no-implicit-this lint errors and any new violations should be flagged right away.
* run the no-implicit-this codemod
* updated todos
no issue
- This will help with the octane migration and you can still run the lint rules even when they are todos. (Checkout the docs at 158b119667/docs/todos.md) The good news is any new code will be checked against the recommended config.
- I fixed all the auto fixable things we could get in this PR as well
no issue
- ran [ember-native-class-codemod](https://github.com/ember-codemods/ember-native-class-codemod) to convert the majority of remaining EmberObject based controllers and components to native class syntax using the `@classic` decorator
- skipped older style modal components (`components/modal-*.js`) due to observed incompatibilities in some cases