Commit Graph

328 Commits

Author SHA1 Message Date
Elena Baidakova
8e897ffdd4
Wired announcement settings admin UI to API (#16692)
refs TryGhost/Team#3094
2023-04-21 12:49:29 +04:00
Rishabh Garg
d3c6d8ad13
Added Pintura integration page in Admin (#16686)
refs https://github.com/TryGhost/Team/issues/3034

- adds new integration page for Pintura in Admin
- allows site owners to enable/disable the image editor integration
- allows self-hosters to upload the files for enabling Pintura image
editor

---------

Co-authored-by: Sodbileg Gansukh <sodbileg.gansukh@gmail.com>
2023-04-20 21:20:07 +05:30
Elena Baidakova
ecb42a3680
Wired announcement api to admin ui (#16678)
refs TryGhost/Team#3052


<!-- Leave the line below if you'd like GitHub Copilot to generate a
summary from your commit -->
<!--
copilot:summary
-->
### <samp>🤖 Generated by Copilot at 7173288</samp>

This pull request adds new components and settings for the announcement
bar feature, which allows the user to customize the content, background,
and visibility of a banner that appears on the site.
2023-04-19 19:45:34 +04:00
Ronald Langeveld
30535eb8f5
Added post revision sidebar list (#16666)
no issue

<!-- Leave the line below if you'd like GitHub Copilot to generate a
summary from your commit -->
copilot:summary
2023-04-18 16:10:41 +01:00
Chris Raible
af367a2a18
Added post_revisions as a default include for posts (#16660)
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
2023-04-18 11:12:35 +01:00
Elena Baidakova
2236d2ef24
Wired lexical snippets to Ghost (#16647)
refs TryGhost/Team#2904

<!-- Leave the line below if you'd like GitHub Copilot to generate a
summary from your commit -->
<!--
copilot:summary
-->
### <samp>🤖 Generated by Copilot at 2ba5e2a</samp>

This pull request adds the lexical editor feature to the Ghost admin
app, which allows users to create and edit snippets in a natural
language format. It modifies the `snippet` model, adapter, and
controller, and the `lexical-editor` template and component to support
the new feature.
2023-04-17 17:39:04 +04:00
Simon Backx
e13f052af8
Added Portal signup terms settings and migration (#16545)
fixes https://github.com/TryGhost/Team/issues/2885 
fixes https://github.com/TryGhost/Team/issues/2896 
fixes https://github.com/TryGhost/Team/issues/2877

This change adds the new portal_signup_terms_html setting and
portal_signup_checkbox_required setting and the corresponding migration.
2023-04-04 10:04:12 +02:00
Simon Backx
986aa38903 Implemented basic color picker in newsletter settings
refs https://github.com/TryGhost/Team/issues/2830

Allows to change the colors, but not yet allows to select custom colors.
2023-03-28 14:24:04 +02:00
Aileen Nowak
b374bd4b94 Added user notification toggle for Milestone emails
refs https://www.notion.so/ghost/Marketing-Milestone-email-campaigns-1d2c9dee3cfa4029863edb16092ad5c4?pvs=4

- Added a toggle to disable and enable receiving Milestone emails behind a feature flag
2023-03-21 15:41:32 +02:00
Simon Backx
f38d799ae2 Wired up showLatestPosts in admin
fixes https://github.com/TryGhost/Team/issues/2766

Edit showLatestPosts column via admin.
2023-03-20 11:26:19 +01:00
Simon Backx
a5ac2bd470 Added showSubscriptionDetails toggle in admin
refs https://github.com/TryGhost/Team/issues/2737
2023-03-15 14:44:37 +01:00
Simon Backx
56cbb15e37 Wired up showCommentCTA in admin
fixes https://github.com/TryGhost/Team/issues/2726

This makes sure the toggle actually saves to the database, and that the toggle is only shown when comments is enabled.
2023-03-14 16:35:23 +01:00
Simon Backx
1e435fb328
Implemented showPostTitleSection (#16404)
fixes https://github.com/TryGhost/Team/issues/2705

- Added showPostTitleSection to newsletter model in admin
- Wired up UI to admin model so it saves to the database
- Implemented showPostTitleSection in newsletter preview and added some
minor temporary css styling
- Implemented showPostTitleSection in newsletter template in backend,
and added some extra CSS styling to fix spacing
2023-03-14 11:29:43 +01:00
Kevin Ansfield
26d05aecd8
Fixed Theme.errors clash with Ember Data Model's errors property (#16106)
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
2023-02-28 13:28:32 +00:00
Ronald Langeveld
76640d9b7e
Added page resources to emails (#16315)
refs https://github.com/TryGhost/Team/issues/2572

- Passes post resource data to emails.
- Updated email templates accordingly.
- Added snapshot e2e tests.
2023-02-22 21:02:15 +08:00
Ronald Langeveld
ce567b9816
Added Mentions email notification settings (#16245)
closes https://github.com/TryGhost/Team/issues/2526

- Mention emails can now be toggled inside staff user' profiles, if they
have the webmention flag enabled on their Ghost site.
- Removed the flag dedicated to webmention email notifications and is
now handled by the `webmention` flag.
- Does not send email notification if `webmention` flag is not enabled.
- Updated tests.

---------

Co-authored-by: Fabien "egg" O'Carroll <fabien@allou.is>
2023-02-09 17:03:03 +08:00
Fabien "egg" O'Carroll
e5d31e2900 Added resource data to Mentions Admin API
refs https://github.com/TryGhost/Team/issues/2503

This is in the MentionController atm as it's considered a presentation
concern. We might want to consider moving this into the MentionsAPI in
future so that we can simplify the controller and even remove it
completely in favour of putting the data-mapping in the endpoint definition.
2023-02-02 16:13:49 +07:00
Simon Backx
e879406659
Added outbound link tagging setting (#16146)
fixes https://github.com/TryGhost/Team/issues/2432
    
Adds outbound_link_tagging setting (enabled by default and behind
feature flag). If the feature flag is enabled, and the setting is
disabled, we won't add ?ref to links in emails.
    
This includes new E2E tests for email click tracking, which were also
extended to check outbound link tagging (for both MEGA and the new email
stability flow).

Also fixes a test fixture for the comments_enabled setting.
2023-01-20 13:41:36 +01:00
Djordje Vlaisavljevic
62d4746469 Added missing properties
refs https://github.com/TryGhost/Team/issues/2434
2023-01-19 12:50:57 +00:00
Ronald Langeveld
57bc14e00f
Added Mentions endpoint to Admin (#16136)
ref https://github.com/TryGhost/Team/issues/2421

- added the Mentions API endpoint to Admin
- setup initial mention model in the Ember Store to be able to dev with the endpoint
- added basic routing to access the `/mentions` page that is currently behind feature flags
- Setup basic testing with a mirage mock endpoint.
2023-01-17 20:16:18 +08:00
Simon Backx
7b3712a15b
Added visible theme errors in admin (#16081)
refs https://github.com/TryGhost/Team/issues/2393

- During boot and loading the active theme, we now cache the result of
the gscan validation. Cache configuration can happen in
`adapters.cache.gscan`
- We now also return non-fatal errors when activating or adding a theme.
- When the `themeErrorsNotification` feature flag is on, we fetch the
active theme (which includes the validation information) when loading
admin
- If the currently active theme has errors, we show an error
notification that can open the error modal
- Added a new endpoint: `/ghost/api/admin/themes/active/` that returns
the result of the last gscan validation of the active theme. If no cache
is available, it will run a new gscan validation.
- Added new permissions for the active action/endpoint (author, editor,
administrator)
2023-01-06 13:44:27 +01:00
Simon Backx
58ba154ed7 🐛 Hid the analtyics page for editors
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.
2022-12-06 11:10:58 +01:00
Elena Baidakova
696cdea4d9
Add member's email status on member page (#15844)
closes TryGhost/Team#2270
- Show emails status depending on the reason email was blocked
(spam/fail)
2022-11-18 15:55:21 +04:00
Kevin Ansfield
9bdb25d184
Fixed hosting management screen not loading after sign-in process (#15763)
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`
2022-11-03 11:14:36 +00:00
Simon Backx
2e517b6744 Fixed membersTrackSources not hiding attribution analytics 2022-10-27 20:35:34 +02:00
Rishabh
9503ca1c7b Wired new analytics settings for tracking email and sources
refs https://github.com/TryGhost/Team/issues/2168

- wires new source tracking setting for members to UI
- splits the new analytics page settings to its own component, cleaned up the files and wired up the settings upstream
2022-10-27 17:29:33 +05:30
Elena Baidakova
e3ab868b83
Added email feedback column (#15698)
closes TryGhost/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>
2022-10-27 11:22:50 +04:00
Simon Backx
6380b82793
Added sentiment ordering and include for posts (#15657)
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
2022-10-19 16:50:58 +02:00
Elena Baidakova
67b65538cf
Added toggle to enable/disable audience feedback in admin (#15601)
closes TryGhost/Team#2043
- Added ability to enable like/dislike buttons for each newsletter.
- Buttons color calculated from accent color.
2022-10-13 10:24:46 +04:00
Simon Backx
68bdc1afea
Added post sentiment (#15592)
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.
2022-10-11 17:52:14 +02:00
Kevin Ansfield
7b443d4b63 Removed need for .get() with config service
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
2022-10-07 16:14:57 +01:00
Kevin Ansfield
060d791a63 Removed need for .get() with settings service
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
2022-10-07 16:14:57 +01:00
Simon Backx
aaabf4b103
🎨 Improved email failure handling and retrying (#15504)
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
2022-10-06 11:12:11 +02:00
Kevin Ansfield
524b23c182
Migrated staff user screen to Ember Octane patterns (#15532)
refs https://github.com/TryGhost/Ghost/issues/14101

- migrated staff user controller to native class syntax
- removed use of `{{action}}` helper
- moved from custom components to native `<input>` and `<textarea>` for form fields
  - added `{{select-on-click}}` modifier to cover the `<GhTextingInput @selectOnClick>` option behaviour for any input element
- added `submitForm()` test helper that finds closest `form` element and trigger's a `submit` event on it simulating <kbd>Enter</kbd> being pressed whilst a field has focus
2022-10-05 12:05:31 +01:00
Simon Backx
0cd0fc838d
Added email track clicks column and cleaned up frontend checks (#15501)
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
2022-09-29 16:42:45 +02:00
Simon Backx
1a5ff8d53d
Added back button from editor to analytics (#15493)
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.
2022-09-29 14:34:01 +02:00
Rishabh
d63f4548c0 Removed attribution sources from UI if site is invite-only
refs https://github.com/TryGhost/Team/issues/1986

- removes attribution section from dashboard and post analytics if site is invite only
2022-09-28 17:26:38 +05:30
Kevin Ansfield
fa84808048 Dropped ember-cli-moment-shim dependency
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
2022-09-24 13:28:23 +02:00
Simon Backx
383edc293f Added protection for missing count in clickRate
refs https://ghost.slack.com/archives/C02G9E68C/p1663751415397159?thread_ts=1663748981.221509&cid=C02G9E68C
2022-09-21 11:11:06 +02:00
Simon Backx
63103c2251
Added click counts to posts admin API (#15435)
closes https://github.com/TryGhost/Team/issues/1928
2022-09-20 10:05:41 +02:00
Kevin Ansfield
226f45fd83 Fixed "cannot save both mobiledoc and lexical" error when tabbing from title field to lexical editor
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
2022-09-19 12:06:05 +01:00
Simon Backx
699e67f4e4
Added email_track_clicks setting (#15409)
fixes https://github.com/TryGhost/Team/issues/1900
refs https://github.com/TryGhost/Team/issues/1901

- Defaults to the same value as the current email_track_opens setting for existing installations, otherwise defaults to true
- Had to use a custom migration because the `addSetting` helper doesn't support using an existing setting as current value
- Added a minimal UI to change the setting, but this still needs some design magic 🪄
- Link replacement is disabled if `email_track_clicks` is disabled. In the future we might consider to still do parial additions, such as source attribution and maybe redirects (to discuss).
2022-09-15 15:48:22 +02:00
Kevin Ansfield
a7c4991af5 Wired up lexical editor saving
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
2022-09-13 21:01:53 +01:00
Kevin Ansfield
2d9dd4639d Added redirect between mobiledoc/lexical editors
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
2022-09-13 18:55:39 +01:00
Fabien "egg" O'Carroll
11cbfcb0b6 Removed unused parent property from tag model
The Posts API does not strip unknown properties when dealing with relations,
which meant that tags were being sent up with a `parent` property which would
always cause the model to be considered "changed". This resulted in the update
methods being called, and leading to unexpected behaviour.

Whilst this change does fix things for the History feature, the correct fix is
to update the admin-api-schema, or the input serializers such that they only
allow through known and allowed properties.
2022-09-07 22:33:17 +01:00
Rishabh Garg
da62355e18
Wired email alert settings for staff users on admin (#15313)
refs TryGhost/Team#1826

- allows staff users to manage their email alert settings behind the flag
- only owner and admin users are able to toggle their email alerts
2022-08-25 15:47:14 +05:30
Simon Backx
0943daad72
Added member attribution to member details page (#15266)
refs https://github.com/TryGhost/Team/issues/1817

Co-authored-by: James Morris <moreofmorris@users.noreply.github.com>
2022-08-19 16:39:18 -04:00
Fabien "egg" O'Carroll
dd0097e68f Added signup & conversion counts to post index page
refs https://github.com/TryGhost/Team/issues/1818

This is all hidden behind the alpha flag, and is missing the links to filtered
members as that has not been implemented yet.
2022-08-18 19:24:54 -04:00
Rishabh
ce80d250bf Handled null trial days on tiers
refs e26c977c66

- handles null trial days in admin and API, sets trial days as 0 for null values
2022-08-09 14:14:22 +05:30
Rishabh
6ce3e8efd6 Wired trial days to tiers UI in Admin
refs https://github.com/TryGhost/Team/issues/1724

- allows site owners to add trial days to tiers (behind feature flag)
2022-08-05 17:23:40 +05:30