refs https://github.com/TryGhost/Product/issues/3832
---
### <samp>🤖 Generated by Copilot at 7a91ba3</samp>
This pull request enables data synchronization between the Ember app and
the React app for the settings module. It passes `onUpdate` and
`onInvalidate` functions as props from the Ember app to the React app
through the `ReactApp` component and the `ServicesContext`. It also
removes unused code and adds some debugging logs in the `setting`
serializer and the `settings` service.
no issue
`show_title_and_feature_image` leads to more intuitive logic in themes and we can use `posts` rather than `posts_meta` as there are no longer row-length issues with MySQL 8.
- removed original add-column migration that was never in a release
- added new add-column migration that puts
`show_title_and_feature_image` column with a default of `true` on the `posts` table
- renamed property and default value everywhere
- bumped `@tryghost/admin-api-schema` to allow the new property through at the API level
closes https://github.com/TryGhost/Team/issues/3387
- adds syncing of mobiledoc->lexical formats for snippets when opening the beta editor
- this is a one-way sync
- new snippets or changes made to snippets inside the beta will not be available in the old editor
- creating or changing snippets in the old editor will sync to (and potentially overwrite snippets) in the beta editor
- fixed incorrect saving of doubly-escaped JSON when creating snippets in the beta editor
We no longer need a reference to the previous version, instead we can use the
latest revision, this makes it easier to compare "off table" data such as the
feature image caption stored in posts_meta.
no issue
- post_revisions will now be included in any request to the /posts
endpoint
- updated admin models to include post_revisions
- post revisions can now be accessed in the modal-portal-history via
this.post.post_revisions
no issue
- the Ember Data `Model` class has an `errors` property by default that
is set to a `DS.Errors` instance but the Theme model was overriding that
with an `errors` attr
- it hasn't been an issue so far but causes problems in Ember/Ember Data
3.28.x because that tries to use the `DS.Errors` interface on the
overridden attr property which then throws errors because the `errors`
attr doesn't have the right methods
closes: https://github.com/TryGhost/Ghost/issues/15470
- When multiple browser tabs are open, each manipulate a different copy of ember data model, changes to the model in one tab are not reflected in the model of the other tab.
- When updating some settings, all current settings were sent to the API.
- As a result, when updating two different categories of settings (navigation/code inspection) in different tabs, the second update was overriding the first one.
- From a user perspective, this is not a natural behaviour. Only settings visible on-screen when clicking save should be modified.
Co-authored-by: Kevin Ansfield <kevin@lookingsideways.co.uk>
closes https://github.com/TryGhost/Team/issues/1715
refs https://github.com/TryGhost/Members/pull/407
- when comped boolean was brought back for backwards compatibility, it accidentally opened a path from admin to set comped stripe subscriptions on members on save, as Admin always sends back `comped` value
- since we don't allow stripe comped subscriptions anymore, this caused weird behavior with assigning the default tier on comped stripe subscription.
- this change removes the `json.comped` value to be sent up from Admin to avoid any weird comped changes to the member
refs https://github.com/TryGhost/Team/issues/584
- No longer uses a API URL + redirect inside verification emails. This is replaced by a new route (`/settings/members/?verifyEmail=token`) that does the API request and shows a modal.
- Removed update button when changing support email address in the Portal settings
- Added `_meta` attribute to settings (uses same pattern as newsletters model)
- When updating the `membersSupportAddress` setting (via the normal edit endpoint), the `sent_email_verification` meta property will get set by the API. When this new property is present, we'll show a warning that the support address requires verification.
closes https://github.com/TryGhost/Team/issues/1647
- sending the embedded `email` record back to the API when saving could trigger "Request entity too large" errors for very large posts that were sent as email because it doubles up on the request size
- `post.email` is a read-only property and is ignored by the API so there's no point serializing it and making request bodies larger than they need to be
no issue
- the relationship is no longer used (it was a temporary solution whilst we built full member events) and was never fully set up resulting in warning output in test runs
- dropped remaining vestiges of the relationship
refs https://github.com/TryGhost/Team/issues/1575
- Update usage of Tier to read monthly & yearly price & currency from top level
- Updated usage of Tier to read benefit name from benefits[n], not from benefits[n].name
Co-authored-by: Fabien "egg" O'Carroll <fabien@allou.is>
refs: https://github.com/TryGhost/Team/issues/1145
- this should allow us to remove the /products endpoint in v5
It avoids:
- `kg-product-card`, that really is meant to say product
- `product-cadence` on offers
Co-authored-by: Rishabh <zrishabhgarg@gmail.com>
refs https://github.com/TryGhost/Team/issues/1492
Allows site owners to manage member's newsletter preference directly in Admin.
- also adds `visibility` property for newsletter model
- updates members test model to include `visibility`
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
closes https://github.com/TryGhost/Team/issues/1319
Due to how JS implements numbers, it's possible that when we multiple a number with 2 decimal places by 100 that we do not end up with an integer e.g. 9.95 * 100 = 994.999...
This is not a valid price for the API and so we must round it to the nearest integer. We round off prices both at source as well as in ties serializer to make sure we never send non integer prices to API.
refs https://github.com/TryGhost/Team/issues/1393
- This prevents the `last_seen_at` from being sent to the API
- In the future the API will accept this property, this is a temporary fix
closes https://github.com/TryGhost/Team/issues/1388
- added `lastSeenAtUTC` property to member model
- added `last_seen_at` filter column handling to `<GhMembersListItemColumn>`
- uses same format as the "Created" column showing the date only and a "days ago" string
no issue
- our API always returns an array whether we're performing a browse or find request but Ember Data expects explicit find requests to return a single object and throws deprecations when it sees an array
- https://deprecations.emberjs.com/ember-data/v2.x/#toc_store-queryrecord-array-response-with-restserializer
- we previously had `normalizeSingleResponse` overrides in specific models that we use with `queryRecord` but we've since introduced `queryRecord` usage on more models but the associated "fix" was not duplicated in the serializers for those models leading to many deprecation warnings logged to the console in development and when testing
- moved the fix to the application serializer so it applies to all models
- explicitly excluded `setting` model because that's a special-case and has it's own array-into-object serialization to represent multiple settings records as a single model instance
refs https://github.com/TryGhost/Admin/pull/2227
A continuation of #2227 that runs the native classes codemod against app/serializers.
Most of the serializers that are trying to be transformed are failing with the same issue:
```
Validation errors:
[attrs]: Transform not supported - value is of type object. For more details: eslint-plugin-ember/avoid-leaking-state-in-ember-objects
2022-02-02T05:54:58.571Z [warn] [app/serializers/role.js]: FAILURE
```
refs TryGhost/Team#1071
Specific tier visibility for a post was previously stored in `visibility` column directly, which had a limitation of 50 charts. Going forward, for the specific tiers visibility of post/page, we use `tiers` array in API that contains list of tiers with access for post. This change -
- replaces `filter` type to `tiers` for visibility
- adds new visibility filter segment component in post settings menu which stores array of tiers instead of nql string for visibility
- updates serializer and model for post/page
- updates tests
refs https://github.com/TryGhost/Team/issues/1070
- adds a `customThemeSettings` service that handles overall setting loading and saving to avoid components having to know any of the intricacies of the model setup
- adds `custom-theme-setting-list` model so that we can save multiple setting records as embedded relations
- custom adapter ensures requests go to the `/custom_theme_settings` base route as a `PUT` request
- custom serializer drops the default `models: []` wrapper in the save request data so the format matches the `PUT /settings` endpoint, then converts the response to look like a `custom-theme-setting-list` response
refs https://github.com/TryGhost/Team/issues/998
- posts have a new `email_only` property for an alpha feature but that is not a valid property for pages
- our pages model and serializers currently inherit from the post model/serializer so when saving the new property is triggering a "no additional properties" validation error
- updating the pages serializer to remove the new property means the pages add/edit API requests are valid again
refs https://github.com/TryGhost/Team/issues/849
Multiple products alpha feature brings back segmented post access using products. The new visibility filter based on segments is returned in a separate `visibility_filter` property on post/page API
no issue
- `email_recipient` records are embedded alongside member data when fetching individual members so the member activity feed can be generated
- full email details are included for each email so that previews can be generated which can result in a large payload
- by default Ember Data will push all embedded records back to the server when saving which resulted in `Request entity too large` errors in some environments when a member has received many emails
closes https://github.com/TryGhost/Ghost/issues/12461
Design changes:
- added activity feed to member details page
- rearranged Stripe info to display on the right
- added toggle buttons for Stripe subscription and customer info
- added box to display activity feed for received and opened emails
Functionality changes:
- added `queryRecord()` to member adapter so `queryRecord('member', {id: x})` will hit `/members/:id/?query` instead of `/members/?id=x&query`
- updated member route to query member with `?include=email_recipients`
- added `EmailRecipient` model for access to event timestamps and email relationship setup
- added `<GhMemberActivityFeed>` component that accepts an `EmailRecipient` array and converts that into an activity list
- added support for `@model=emailInstance` to the email preview modal
- fixed a timing issue with email preview that could result in it showing blank content until the mobile/desktop toggle is used
- fixed sometimes blank member location
Co-authored-by: Kevin Ansfield <kevin@lookingsideways.co.uk>
no issue
- added `geolocation` attribute to member model with json-string transform
- prevent geolocation from being sent back to the API in member serializer
- add "Location" column to members list
- if country is "US" then display "{State}, US" otherwise show full country name such as "United Kingdom"
- displays "-" if no geolocation data has been collected for the member
no issue
refs TryGhost/Ghost#11538
* Added members label handling v1
* Added members label dropdown in list screen
* Updated selected labels and member list UI refactor
* Added v1 label add/delete modal
* Added add label modal v1
* Fixed disabled check for new label save
* First stab at member filters layout
* Updated member detail screen design
* Member detail refinements
* Added basic editing for member labels
* Fixed label deletion from members list
* Updated filtered list header
* Refinements for dropdown and empty filter state
* Refined label modal
* Updated member labels fetch logic
* Added custom dropdown component for labels
* Refined style for dropdown
* Refined dropdown button
* Restructure and refine members dropdown styles
* Added selected indication to dropdown
* Fixed dropdown footer style
* Removed member label placeholder
* Removed add label from member list actions
* New label refinements
* Added confirmation modal for label delete
* Added duplicate validation check for labels
* Updated validation check with slug
* Updated copy
* Updated actions dropdown copy
* Fixed visual glitch of dropdown on FF
* Hide scrollbar for labels dropdown
Co-authored-by: Peter Zimon <peter.zimon@gmail.com>
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
refs 5fd2b7fed1
- sends `?send_email_when_published=true` query param when scheduling/publishing a post with the toggle turned on
- adds support to the posts adapter for handling the `adapterOptions` option
- updates the editor `save` task to pass through the required adapter option when a post is being published or scheduled with the toggle checked
- moves state for the email toggle into the publish menu so that we don't try to toggle the model attribute which should only be fetched from the API
- prevent `post.send_email_when_published` being sent to the API via the serializer as it's now a read-only attribute