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
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/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
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/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
closes https://github.com/TryGhost/Team/issues/1479
- updated post adapter to append `?newsletter_id=xyz` when passed a `newsletterId` adapterOption
- updated editor save task to pass `options.newsletterId` through as `adapterOptions.newsletterId`
- set up `post.newsletter` relationship ready for handling embedded newsletter association from the API
- explicitly deleted when serializing back to the API as it doesn't yet ignore the attribute
- updated `<GhPublishmenu>` for newsletter support
- fetches newsletters on first render so they are available in the dropdown
- sets "default" (first in the ordered list) newsletter as the initially selected newsletter
- adds newsletter dropdown to draft publish menu
- passes `newsletterId` option to editor save task when it's set
This is a minimal implementation for testing. Not included:
- correct free/paid member counts based on selected newsletter
- correct member count in confirmation modal
- indication of selected newsletter for scheduled post
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/1141
Showing canceled subscriptions provide a more complete picture of the activity of a member.
- Given there is no `member.product` object when a subscription is canceled, use the `member.subscriptions.price.product` objects instead of `member.products`.
- applied boy-scout rule for linter errors and and code formatting
- removed `multipleTiers` flag conditionals as it's now GA
- set up subscriptions as a separate mirage resource so they are easier to work with
- updated `PUT /members/:id/` endpoint to match real API's complimentary subscription behaviour
- modified mirage member serializer to match API output
Co-authored-by: Kevin Ansfield <kevin@lookingsideways.co.uk>
Co-authored-by: Peter Zimon <peter.zimon@gmail.com>
refs https://github.com/TryGhost/Team/issues/1408
- switched to `@tryghost/nql` packages to get access to latest releases
- updated `GET /members` mirage endpoint with a try/catch and explicit logging to make any errors from NQL more visible
- added "Name" filter option
- has `is`, `contains`, `does not contain`, `starts with`, `ends with` operators
- uses a plain text field for the input value
- added support for `~`, `-~`, `~^`, and `~$` operators when generating NQL queries from filter definitions
refs https://github.com/TryGhost/Admin/pull/2209
- `miragejs` has been extracted to a framework-independent library, the re-exports of `miragejs` elements in `ember-cli-mirage` have been deprecated making our test logs very noisy
- added `miragejs` as a top-level dependency
- updated all relevant imports to pull from `miragejs` instead of `ember-cli-mirage`
closes https://github.com/TryGhost/Team/issues/1029
- allows site owner to filter members on specific tier
- needs tiers beta flag enabled and site should have more than 1 paid tiers.
refs 2bf311edc8
- added missing relationship definitions for included relationships on member model
- cleaned up unnecessary forcing of `id: 99` when creating new records of some models
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
closes https://github.com/TryGhost/Team/issues/1309
closes https://github.com/TryGhost/Team/issues/1336
- the error occurred because the `<Members::FilterValue>` component detaches it's value from the passed in value it was initialized with. Due to the detached handling, after changing the filter type away from the default label filter to a text input based filter, the internal value stayed as `[]` even though the filter type's value was changed. When the blur event was triggered in that state the internal `[]` value was used to update the filter resulting in an invalid filter string
- added a quick-fix of assigning the input's value in the blur event handler meaning we get the expected `''` value
- allows for passing tests to be created ready for a deeper fix/refactor later
- added `nql` dependency and used it in the `GET /members` API mock to match members against the filter param so behaviour matches the real API
- tested increase in code size - dev build increased by ~180KB, no difference in prod
- added acceptance tests for all current filters and search
refs https://github.com/TryGhost/Team/issues/1336
refs bf9bbc3aa6
- adds basic search param handling to `GET /members` API mock
- adds acceptance tests for basic search behaviour
- contains regression check for search input not being visible when no members match
refs https://github.com/TryGhost/Team/issues/1320
- fixed event handling in `gh-file-input` for test-initiated uploads
- added `POST /members/upload/` API mock that emulates uploading a single member
- it's enough for this particular test and can be expanded as needed
- added acceptance test that does a simple 1-member, no Stripe, CSV upload with no mapping changes
refs https://github.com/TryGhost/Team/issues/1277
- renamed `<GhActivityTimeline>` to `<GhMemberActivityEventParser>` and modified so that it yields parsed events rather than directly renders them
- makes the component re-usable as it can be used to decorate raw events ready for use in context-specific templates
- switches to using a getter to yield the parsed events so that they will update automatically when the `@events` argument changes
- updated `<Dashboard::LatestMemberActivity>` to use `<GhMemberActivityEventParser>` and keep the member activity box output local to itself
- added integration tests for `<Dashboard::LatestMemberActivity>`
- added Mirage setup for member activity event models/serializers/route
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
refs https://github.com/TryGhost/Team/issues/585
- updated bulk destroy task to first use the current query params to fetch from the appropriate CSV export endpoint and trigger a download
- fetches via JS and triggers download from a blob URL link instead of an iframe so that we can be sure the download is successful before we hit the bulk delete endpoint
- works differently to user deletion download because the server is not generating an export file and saving it meaning the client has to be sure we don't delete data before it's exported
- updated copy in the confirmation modal to reflect the download behaviour
refs https://github.com/TryGhost/Team/issues/585
requires https://github.com/TryGhost/Ghost/pull/12082
When a label or status filter is selected on the members screen show a "Delete selected" option in the actions dropdown. Bulk deleted members will _not_ have any subscription data modified in Stripe, if a member should be deleted and have their subscription cancelled it's necessary to do that on a per-member basis.
- updated bulk delete handling to match API
- added link to bulk delete confirmation modal in members actions dropdown (only shown when label, status, or search is used)
- updated testing framework for members
- added label factory for easier test setup
- updated `GET /members` and `DEL /members` endpoints to work with label filters
- updated test selectors for easier reference in tests
refs https://github.com/TryGhost/Team/issues/572
- Replaced dropdown in invite-user modal with radio buttons
- Added description for each user role
- Added icon to provide more info on hover for each role
- Got rid of unused box styling
closes https://github.com/TryGhost/Team/issues/411
- adds "Create snippet" icon to the editor toolbar
- uses the same link input component design for specifying snippet titles
- snippets are loaded in the background when the editor is accessed
- snippets are listed at the bottom of the card menus of the + and / menus
- clicking a snippet inserts the snippet's contents in place of the current blank section
no issue
- fixed all `no-shadow` linter warnings
- changed `no-shadow` eslint rule from `warn` to `error` so we don't re-introduce shadowed variables in the future
refs https://github.com/TryGhost/Ghost/issues/10318
- primary change is in the settings service which is the only place we fetch the settings endpoint
- mocked APIs and fixture data updated to expect and to filter on `?group` rather than `?type`
no issue
- display a confirmation modal when bulk deleting members
- hit the `DELETE /members/?all=true` endpoint when confirming
- show counts of members deleted/skipped
- fix selection reset when leaving edit mode
no issue
- added mocked API for `/admin/members/stats/` that generates random data for the chart
- re-architected `<GhMembersChart>` to fetch data from the API rather than calculating stats from all members loaded in memory
- enabled mirage in development so that the chart can be tested before the live API is ready
no issue
- We have a need to create a member manually, this changeset solves this problem.
- Added new member button to the member's screen
- Needed to be able to perform add member action
- Fixed inconsistent `createAt` naming. All models use consistent `createdAtUTC`, fixed it up so that members model follows the same pattern. If we want to change this pattern should probably happen for all models at once
- Fixed member avatar when creating a new member. If the values are completely empty the screen ends up being filled with empty space. Added some dummy initials which are recalculated once the member enters the name or an email
- Refactored DS naming for consistency. Nowhere else in the codebase 'DS' name is ever used, made this consistent
- Added missing validations in members form
- Simplified if conditions in the member list template. When using the if/esle statements unnecessary new-line symbols were inserted which made it hard to test. Also by using computed property view is much cleaner
- Updated member's model default value for `subscribed` to "true". It is turned on by default in the model layer on the backend (ref: https://github.com/TryGhost/Ghost/blob/3.1.0/core/server/data/schema/schema.js#L330), this behavior is intended and should be the same on the frontend
closes https://github.com/TryGhost/Ghost/issues/10995
- when first loading the site preview, if private mode is enabled submit the login form in the background to get the cookie before loading the iframe
- refactors post-authentication preloading to ensure it occurs before post-authentication route hooks are called
- adds `showSuccess` attribute to `<GhTaskButton>` so that when set to `false` it can stay in the running state after "success" to avoid state change flashes whilst waiting for a transition
no issue
`ember-light-table` is falling behind Ember.js and other addon development and is increasingly causing issues with Ember deprecations and addon incompatibility.
- swaps `ember-light-table` usage for a straightforward table using `vertical-collection` for occlusion
- uses the same loading mechanism as the members screen with a slight optimisation where the initial load will fetch subscribers in batches of 200 until they are all loaded
- removes now-unused pagination mixin
- fixes duplicate subscriber validation handling