fixes https://github.com/TryGhost/Team/issues/2302
The analytics page should not be visible for Editors (and doesn't work currently anyway). This commit removes the button that goes to the analytics page for editors and authors.
refs https://github.com/TryGhost/Team/issues/2110
- dynamically defined properties on the config service did not have
autotracking set up properly if they were accessed in any way before the
property was defined, this caused problems in a number of areas because
we have both "unauthed" and "authed" sets of config and when not logged
in we had parts of the app checking for authed config properties that
don't exist until after sign-in and subsequent config re-fetch
- renamed `config` service to `configManager` and updated to only
contain methods for fetching config data
- added a `config` instance initializer that sets up a `TrackedObject`
instance with some custom properties/methods and registers it on
`config:main`
- uses application instance initializer rather than a standard
initializer because standard initializers are only called once when
setting up the test suite so we'd end up with config leaking across
tests
- added an `@inject` decorator that when used takes the property name
and injects whatever is registered at `${propertyName}:main`, this
allows us to use dependency injection for any object rather than just
services or controllers
- using `application.inject()` in the initializer was initially used but
that only works for objects that extend from `EmberObject`, the
injections weren't available in native-class glimmer components so this
decorator keeps the injection syntax consistent
- swapped all `@service config` uses to `@inject config`
closesTryGhost/Team#2159
- Added column to email table
- Hide the feedback tab on frontend depending on the column value
Co-authored-by: Daniel Lockyer <daniellockyer@fastmail.com>
fixes https://github.com/TryGhost/Team/issues/2090
- This changes how sentiment is exposed in the API. Now it is exposed as a `sentiment` relation, directly on the model (no longer in counts). Internally we still use `count.sentiment`.
- Content API users (and themes) can include the 'sentiment' relation and order by sentiment.
- Updated Admin to use sentiment instead of count.sentiment
fixes https://github.com/TryGhost/Team/issues/2054
This change adds the sentiment and positive_feedback counts to the posts models. This change isn't really ideal because there are some problems here:
- sentiment isn't really a count
- we don't need to include the sentiment and positive_feedback as a default for posts (but the same is true for attribution)
It would make sense to move this to separate endpoints that only fetch the analytics for a given post when the analytics page is opened. But for our initial skateboard version of audience feedback this should be a good start to already see the data.
no issue
The `config` service has been a source of confusion when writing with modern Ember patterns because it's use of the deprecated `ProxyMixin` forced all property access/setting to go via `.get()` and `.set()` whereas the rest of the system has mostly (there are a few other uses of ProxyObjects remaining) eliminated the use of the non-native get/set methods.
- removed use of `ProxyMixin` in the `config` service by grabbing the API response after fetching and using `Object.defineProperty()` to add native getters/setters that pass through to a tracked object holding the API response data. Ember's autotracking automatically works across the native getters/setters so we can then use the service as if it was any other native object
- updated all code to use `config.{attrName}` directly for getting/setting instead of `.get()` and `.set()`
- removed unnecessary async around `config.availableTimezones` which wasn't making any async calls
no issue
The `settings` service has been a source of confusion when writing with modern Ember patterns because it's use of the deprecated `ProxyMixin` forced all property access/setting to go via `.get()` and `.set()` whereas the rest of the system has mostly (there are a few other uses of ProxyObjects remaining) eliminated the use of the non-native get/set methods.
- removed use of `ProxyMixin` in the `settings` service by grabbing the attributes off the setting model after fetching and using `Object.defineProperty()` to add native getters/setters that pass through to the model's getters/setters. Ember's autotracking automatically works across the native getters/setters so we can then use the service as if it was any other native object
- updated all code to use `settings.{attrName}` directly for getting/setting instead of `.get()` and `.set()`
- removed use of observer in the `customViews` service because it was being set up before the native properties had been added on the settings service meaning autotracking wasn't able to set up properly
fixes https://github.com/TryGhost/Team/issues/2009
- When an email is sent, but it failed there was no way to retry once you left the retry screen
- There was no indication that the email failed to send in the post list and editor
fixes https://github.com/TryGhost/Team/issues/2008
- New column that stores email click tracking at the time it was created
- Improved frontend side checks for when to show analytics
fixes https://github.com/TryGhost/Team/issues/1992
When you edit a post via the editor, the back button on the top of the editor should go back to the analytics page and the status at the top should be removed.
no issue
Since `ember-moment@10.0` it's not been necessary to use the `ember-cli-moment-shim` package, with `moment` instead being usable directly via `ember-auto-import`. Getting rid of the shim package is necessary for compatibility with `embroider`, Ember's new build tooling.
- dropped `ember-cli-moment-shim` dependency
- added `moment-timezone` dependency and updated all imports to reflect the different package
- worked around `ember-power-calendar` having `ember-cli-moment-shim` as a sub-dependency
- added empty in-repo-addon `ember-power-calendar-moment` to avoid `ember-power-calendar` complaining about a missing package
- added `ember-power-calendar-utils` in-repo-addon that is a copy of `ember-power-calendar-moment` but without the build-time renaming of the tree for better compatibility with embroider
closes https://github.com/TryGhost/Team/issues/1924
- updated the Post model so the relevant `mobiledoc`/`lexical` field always has a blank document by default depending on which editor is selected via the feature flag
- ensures we don't send `{mobiledoc: null, lexical: null}` inadvertently creating a mobiledoc post (API sets the default blank document in that scenario) when the lexical editor flag is enabled
no issue
- fixed API returning "Invalid mobiledoc structure" errors when `mobiledoc:null` is sent in the payload alongside `lexical: '{...}'`
- updated Admin's `posts` and `pages` adapters to always add `?formats=mobiledoc,lexical` because the API doesn't return `lexical` by default
- added `lexical` attribute to Admin's Post model
- updated `lexical-editor` controller and related components to work with `lexical` always being a JSON string rather than a parsed object
- updated `<KoenigLexicalEditor>` to pass through the lexical state string as initial state and wired up the `onChange` prop
no issue
- mobiledoc and lexical editors will co-exist for some time so we want to make using both as straight forward as possible
- posts can only have one of `lexical` or `mobiledoc` properties set so in the `edit` route for each editor we detect the opposite property being present and redirect so the right editor is loaded for each post
refs https://github.com/TryGhost/Team/issues/1596
This commit updates admin to align with the changes in the backend in https://github.com/TryGhost/Ghost/pull/14798
- `post.email_recipient_filter` option and property is renamed to `email_segment`
- `newsletter_id` option is renamed to `newsletter` (and now uses slug instead of id)
- Sending a post via email, means you need to set the `newsletter` option. The `email_segment` option is optional now and defaults to `all`. Not setting `newsletter` means not sending an email, setting `email_segment` is ignored if `newsletter` is missing.
- We can no longer use `email_recipient_filter` (now renamed to `email_segment`) to know whether a post is published/scheduled to be sent as an email. We need to rely on the newsletter relation now. The `email_segment` `none` value has been dropped and will be `all` even if no email will be sent (newsletter will be null).
- `sendEmailWhenPublished` option is no longer supported in the backend.
no issue
- the `post.willEmail` computed property was not taking into account an existing email so when re-scheduling the publish of a post that had previously been emailed the complete step showed "will be published and sent" rather than the correct "will be published"
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/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)
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
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 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
no issue
- part of ember upgrades
- removed all unnecessary usage of `.get`
- cleaned up imports where we had imports from the same module across multiple lines
- standardized on importing specific computed helpers rather than using `computed.foo`
- switched tests from using `wait()` to `settled()`
refs https://github.com/TryGhost/Team/issues/954
- The email icon is signalling there was a newsletter sent with the post and allows to identify the "email only" posts easier
refs https://github.com/TryGhost/Team/issues/954
- This is a first iteration before replacing the status with an email icon in the future. It's meant to signal visually the current status instead of leaving it completely blank
closes https://github.com/TryGhost/Team/issues/896
- Having this checkbox allows user to control posts email_only flag
- Also sets the post automatically to "public" when the email-only toggle is switched on as the access would be controlled form within email and not through the internal gatekeeping mechanism
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
refs https://github.com/TryGhost/Team/issues/801
- This reverts commit de560733c5
- brings back members segment select component to post access, which allows setting access to specific labels/products
- only works behind the alpha feature flag - `multipleProducts`
refs https://github.com/TryGhost/Team/issues/707
Placing focus in the title aligns better with typical editorial process.
- switched `autofocus` attribute from body to title for new posts
- added a default value to the `mobiledoc` attr on the Post model, without it the autosave when moving from title to editor creates a forced re-render and clears the focus whilst you're typing
refs https://github.com/TryGhost/Team/issues/771
- updated `<GhImageUploaderWithPreview>` to take an `@includeMetadata` argument that shows a basic html supporting caption field underneath (ready for toggle between caption/alt but not fully implemented)
- added feature image alt/caption properties to post model
- updated UI behind "featureImageMeta" labs flag
- added the feature image uploader to the top of `<GhKoenigEditor>` for display above the editor title
- removed feature image uploader from post settings menu
- added labs flag checkbox
refs https://github.com/TryGhost/Team/issues/581
Setting post visibility to a label results in undesirable and confusing behaviour with no good way to manage access long-term. Coupled with products being limited to a single product for now we're reverting the UI back to the "Public", "Members", and "Paid" options.
https://github.com/TryGhost/Team/issues/581
The API now supports `posts.visibility` being an NQL string as well as the special-case `'members'` and `'paid'` values so the post settings menu visibility select needs to be updated to reflect that.
- swapped visibility dropdown for two radio buttons, "Public" and "Members-only" which uses the `<GhMembersSegmentSelect>` component
- updated post model to use a `visibility-string` transform
- converts `members` and `paid` to/from the NQL equivalent for correct display in the segment select
- updated post model with two additional properties `isPublic` and `visibilitySegment`
- `isPublic` helps with the radio button display
- `visibilitySegment` allows fallback to the default content visibility setting when set to public
- added validation for `post.visibility` so we can show an error and skip saving when members-only is selected and the segment select is cleared
- deleted the now-unused `<GhPsmVisibilityInput>` component
refs https://github.com/TryGhost/Team/issues/581
requires https://github.com/TryGhost/Ghost/pull/12932
- added segment option and select to default newsletter recipients setting
- updated segment selector to fetch labels/products and show as options
- updated segment selector and count component to call an action when count changes so we can use it in the email confirmation modal
- removed usage and mapping of older `'none'`, `'all'`, `'free'`, and `'paid'` email recipient filter values
no issue
- added "Sends" and "Opens" columns to the posts list to see newsletter performance at a glance
- "Sends" will show the type of members sent to (free, paid, all) as a tooltip
- "Opens" shows open rate by default and total opens on hover
no issue
- moved `primaryTag` CP into the post model as per `primaryAuthor`
- removed all unnecessary or unused CPs in the component's backing class
- switched to using `@post` for direct argument access rather than `this.post`
refs https://github.com/TryGhost/Ghost/issues/10318
- API has been updated to still work with `active_timezone` for backwards compatibility but it makes sense for the client to match the underlying settings keys
refs 80f7e0b19e
- Added visibility input in PSM to control content access level for members
- Added default post visibility in editor. To be changed (moved to server-side) once `defaultContentVisibility` is available in settings service
- Added `visibility` property to post model & mirage