2
1
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2023-12-13 21:00:40 +01:00
Commit graph

36487 commits

Author SHA1 Message Date
Peter Zimon
dff8c38547
AdminX UI fixes (#18110)
refs. https://github.com/TryGhost/Product/issues/3349

- fix tiers save & close bug
- show trial days on tier card
- removed 0's from monthly and yearly tier prices
- added color to learn more link in tier modal
- set background to white in newsletter preview
- fixed newsletter default sender data
- removed underline in "View in browser" link in newsletter preview
- updated copy in newsletters
- added Integrations' active indicator
- scrolling menu under searchbar to give search more prominance
- updated Portal modal buttons to be consistent with design settings
- fixed bug in AdminX loading Orb so that it actually starts auto-playing
2023-09-14 12:04:31 +02:00
Ronald Langeveld
d7835ad5ed
Bumped Admin X to 0.0.18 (#18135)
no issue

---

<!-- Leave the line below if you'd like GitHub Copilot to generate a
summary from your commit -->
copilot:summary
2023-09-14 09:44:53 +00:00
Ronald Langeveld
34db31a2a6
Changed staff token to fetch on request (#18132)
no issue

- Solves an issue where it didn't fetch the updated staff token after
saving and still used the cached one which is invalidated.
---

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

Improved staff token handling in `UserDetailModal` component. This
component fetches and displays a staff token for a user in the general
settings, and prevents editing or errors.
2023-09-14 15:03:35 +07:00
Jono M
00e598b365
Updated AdminX features for different roles (#18131)
refs https://github.com/TryGhost/Product/issues/3832

---

This pull request introduces a new `MainContent` component that handles
the role-based access and rendering of the settings page and the
sidebar. It also refactors and improves the UI and logic of the
`UserDetailModal` and the `Users` components, and updates the footer
component to use the new settings page and profile modal for editors.
Additionally, it removes unused code and adds new helper functions for
checking the user's roles and permissions.
2023-09-14 07:48:07 +00:00
Michael Barrett
a1f056ee86
🐛 Fixed portal showing incorrect expiry date for comped subscription (#18120)
refs https://github.com/TryGhost/Product/issues/3875

When a member had a comped subscription, the portal was showing an
incorrect expiry date. This was because the `expiry_date` was being set
to the `created_at` date of the subscription, rather than the
`expiry_date` of the comped subscription
2023-09-14 08:46:23 +01:00
Ronald Langeveld
fd4c3d1e53
Fixed flaky announcement test for Admin X (#18130)
no issue

- Attempts to resolve a flaky test.
---

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

Refactor announcement bar preview test to use a helper function for
checking text in iframes. This improves code quality and readability.
2023-09-14 14:28:05 +07:00
Jono M
a9f9f6121a
Updated AdminX scroll margin to work consistently on different screens (#18127)
refs https://github.com/TryGhost/Product/issues/3832
2023-09-14 06:31:38 +00:00
Naz
cb532ea819 Fixed tag.deleted event mapping
https://github.com/TryGhost/Arch/issues/90

- When a tag.deleted event is emitted the original 'data' object does not contain an 'id' property. The logic in collections service assumes the id would be present to update the collections efficiently.
2023-09-14 14:31:23 +08:00
Naz
11624e48ca Fixed filtering posts by empty collections error
https://github.com/TryGhost/Arch/issues/90

- Ghost produced an error when a collection filter was applied over Posts API and that collection contained no posts.
2023-09-14 14:31:23 +08:00
Naz
1d7bb44a94 Fixed post.deleted event mapping
https://github.com/TryGhost/Arch/issues/90

- When a post.deleted event is emitted the original 'data' object does not contain an 'id' property. The logic in collections service assumes the id would be present to update the collections efficiently.
2023-09-14 14:31:23 +08:00
Ronald Langeveld
430671d12a
Added Staff Token copy and generation to Admin X (#18123)
refs
https://www.notion.so/ghost/Staff-access-token-is-missing-from-user-detail-screen-0336ea3e586c4b88ad7dae266a95429c?pvs=4

- Added API routes to retrieve and regenrate Staff Token keys.
- Wired up UI

---

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

This pull request introduces a new feature for staff access tokens,
which enable users to access the Ghost Admin API securely and
conveniently. It adds a new `staffToken.ts` module for the API logic and
a new `StaffToken` component for the UI. It also integrates the feature
into the user profile and settings in the `general` page.
2023-09-14 12:51:42 +07:00
Sodbileg Gansukh
7a49183bc8
Custom theme settings improvements (#18101)
no issues

- removed (default) label from the custom theme settings
- the label was redundant especially when multiple select settings are next to each other
- instead, the default value should always be the first option in the select fields
- more consistent spacing between settings with/without description
- less spacing between boolean settings
2023-09-14 10:27:33 +08:00
renovate[bot]
2146d07d86 Update dependency lib0 to v0.2.85 2023-09-13 21:49:35 +02:00
Kevin Ansfield
f06f83c45b
Updated collection card post fetching to use Content API (#18121)
closes https://github.com/TryGhost/Product/issues/3874

- fetch Content API key if we don't already have it
- use the `frontend` service to fetch posts via the Content API
  - uses same ordering and published-only filtering as default front-end requests
2023-09-13 16:51:00 +00:00
Kevin Ansfield
12621d8157
Added core content API integration fixture (#18114)
refs https://github.com/TryGhost/Product/issues/3874

- the new collections card needs to access the Content API rather than the Admin API in order to show the card as it will appear on the front-end but we don't have a default integration that can be fetched via the Admin API for Admin to use when fetching from the Content API
- adds a new "Ghost Core Content API" integration with the `core` type so that it can be read via the `/admin/integrations/` endpoint and used in Admin to make Content API requests
2023-09-13 17:04:49 +01:00
Djordje Vlaisavljevic
b5ab3af8a6
Removed success toast on 1-click subscribe (#18119)
refs https://github.com/TryGhost/Product/issues/3880
2023-09-13 15:25:17 +00:00
Simon Backx
e888a4e820
Added recommendation events tables (#18084)
fixes https://github.com/TryGhost/Product/issues/3852

Tech spec:
https://www.notion.so/ghost/Recommentions-Tech-Spec-598f09e4109f4eef8d9e32db7245a90c?pvs=4#d30e0081613a4f51860acd40169a4d68
2023-09-13 17:18:40 +02:00
Simon Backx
5d696d0d0a
Updated recommendation creation to use excerpt by default (#18118)
fixes https://github.com/TryGhost/Product/issues/3869
2023-09-13 14:23:52 +00:00
Djordje Vlaisavljevic
e9af2c86c1 Added inline success message after 1-click subscribe
refs https://github.com/TryGhost/Product/issues/3880
2023-09-13 14:50:55 +01:00
Daniel Lockyer
acb182c785 Dropped Node 16 from CI matrix tests
refs https://github.com/TryGhost/DevOps/issues/75

- Node 16 has gone EOL so we can from support for it from our matrix
  tests
- dropping support in some other tests and in general will come in
  future commits
2023-09-13 15:47:56 +02:00
Simon Backx
0559c8ba64
Fixed loading 0th page of recommendations (#18116)
no issue

When the total numbers of pages was 0, the pagination hook would try to
load the 0th page which would cause an API error.
2023-09-13 15:46:18 +02:00
Simon Backx
908e02c016
Added recommedation add/remove toasts (#18113)
fixes https://github.com/TryGhost/Product/issues/3844
2023-09-13 15:31:29 +02:00
Jono M
cb6a8ff6df
Removed redirect for editors accessing AdminX (#18111)
refs https://github.com/TryGhost/Product/issues/3832

Removed redundant code from `settings-x.js` since we now display the
settings page correctly for editors.
2023-09-13 14:04:58 +01:00
Jono M
7462ad2be6
Updated AdminX search to also hide sidebar items (#18109)
refs https://github.com/TryGhost/Product/issues/3832
2023-09-13 13:47:05 +01:00
Sanne de Vries
dbc93bf1c7
Added collection card frontend CSS (#18107)
Refs https://github.com/TryGhost/Product/issues/3630
2023-09-13 11:54:41 +00:00
Jono M
7cc9d959fc
Updated AdminX scroll handling to work more consistently (#18106)
refs https://github.com/TryGhost/Product/issues/3832

---

Refactored the scrolling logic for the settings page into a custom hook
and context. This improves the navigation and user experience of the
settings page and simplifies the code. Added the file
`useScrollSection.tsx` and updated the files `SettingGroup.tsx`,
`SettingNavItem.tsx`, `RoutingProvider.tsx`, and `useRouting.tsx`
accordingly.
2023-09-13 11:52:00 +01:00
Ronald Langeveld
279ce77226
Wired Pintura Editor to Admin X (#18100)
no issue

This pull request adds the Pintura image editor as an optional feature
for image settings in the admin-x. 
It introduces a `usePinturaEditor` hook that handles the loading and
management of the Pintura editor instance, and a custom edit button for
the `ImageUpload` component that can open the editor. 
It also modifies the `BrandSettings` and `UserDetailModel` component to use the hook and the button.

---------

Co-authored-by: Peter Zimon <peter.zimon@gmail.com>
2023-09-13 17:28:05 +07:00
Daniel Lockyer
f48b732ef1 Removed GitHub PR auto-assign workflow
- we no longer need this because Renovate should be automerging a lot
  more, and it causes less noise for me
2023-09-13 11:45:01 +02:00
Jono M
9bf40795d6
Added staff filtering to AdminX history view (#18104)
refs https://github.com/TryGhost/Product/issues/3832

---

This pull request adds a new feature to filter and view the history of
actions performed by staff users in the admin settings. It introduces a
new route and a MultiSelect component for the history modal, and updates
the UserDetailModal component to link to the history modal with the user
parameter.
2023-09-13 07:42:58 +00:00
Michael Barrett
46897bdb3a
Ensure hidden settings return falsy when used with the @custom helper (#17920)
no refs

When a theme setting is hidden, it should return a falsy value when used
2023-09-13 08:38:31 +01:00
renovate[bot]
212eacf4b9 Update dependency @tanstack/react-query to v4.35.3 2023-09-13 07:23:03 +00:00
Fabien 'egg' O'Carroll
9dde39b2a4
Handled CollectionPost relations manually (#18081)
refs https://github.com/TryGhost/Arch/issues/86

bookshelf-relations was generating tonnes of select queries from the
posts table in order to update the relations. We've instead implemented
this ourselves, so as to avoid the superfluous fetches. Working closer to
the db like this is nice, and makes you think more about performance.

This logic could be pulled out into a util (not bookshelf plugin) where
it could be used explicitly, but with the complexity hidden, we'll see ig.
2023-09-13 14:16:22 +07:00
Jono M
9b2387a364
Fixed bugs in AdminX portal and theme settings (#18099)
refs https://github.com/TryGhost/Product/issues/3832

- Fixed portal preview when no tiers are enabled
- Fixed portal preview not respecting access setting
- Disabled portal customisation when nobody can sign up
- Fixed custom theme settings not updated when theme is changed
- Added publication icon setting in newsletters
- Added extremely rudimentary editor role display
- Fixed drag overlay position in modals
2023-09-13 07:10:33 +00:00
renovate[bot]
ed57df7ec6 Update dependency lib0 to v0.2.84 2023-09-13 07:58:24 +02:00
Naz
ce10d34e5e Allowed optionally enabling collections through a flag
refs https://github.com/TryGhost/Ghost/pull/18028

- The previous conditional meant that if the "host settings" collections enabled flag was set, we couldn't disable collections. The referenced pull request would also disable the collections across all of the hosted environment instances. The updated logic optionally takes into account the "labs" flag, as it should have from the very beginning.
2023-09-13 13:56:56 +08:00
Naz
bbb5b64ec5 Cleaned up member's neswletter test suite
refs https://github.com/TryGhost/Arch/issues/87

- We just introduce member's newsletters serialization, so removed the comments reminding to do so.
2023-09-13 13:18:43 +08:00
Naz
282de7f0b4 Added newsletter payload serializer
refs https://github.com/TryGhost/Arch/issues/87

- The newsletters in members payload have leaked internal properties from Public Members API. The code skipped the output serialization step, which is now in place.
- The newsletter resource returned from the API consistently returns these properties:
id,
name,
description,
sort_order
2023-09-13 13:18:43 +08:00
Naz
a284e8275d Added a test for Public member data endpoint
refs https://github.com/TryGhost/Arch/issues/87

- There was no test whatsoever! Adding a super basic test to have some certainty the output doesn't change after a refactor
2023-09-13 13:18:43 +08:00
Naz
e73b16979f Trimmed down Members Admin API response data
refs https://github.com/TryGhost/Arch/issues/87

- The Members Admin API and members.* webhooks were returning too many fields in the nested `newsletters` objects. There was no "allowlist" serializer for the newsletter object, which meant every time we add a new field to the database we would unintentionally return extra fields without a second thought.
- With this change only following fields will be returned with `members[x].newsletters[x]`:
'id',
'name',
'description',
'status'
2023-09-13 13:18:43 +08:00
Naz
2e84cdca36 Added specific newsletters and attribution tests
refs https://github.com/TryGhost/Arch/issues/87

- Round 2 for the previous commit. Removes use of `anyArray` for all
- Using `anyArray` in snapshot test is an anti-pattern which leads to leaking output fields unintentionally when the API changes.
- Adding these fixes is fundamental work before changing the output of 'member.newsletters' property
2023-09-13 13:18:43 +08:00
Naz
4999523289 Added specific newsletters and attribution tests
refs https://github.com/TryGhost/Arch/issues/87

- Using `anyArray` in snapshot test is an anti-pattern which leads to leaking output fields unintentionally when the API changes.
- Adding these fixes is fundamental work before changing the output of 'member.newsletters' property
2023-09-13 13:18:43 +08:00
Ronald Langeveld
2554c0df31
Added createable selector to embed in AdminX (#18094)
no issue

Added the ability to create new labels for the embed signup form in the
admin-x-settings app. This involved importing a new component and adding
a prop to the `MultiSelect` component, and enabling the prop in the
`EmbedSignupSidebar` component.
2023-09-13 10:32:55 +07:00
Jono M
60b69f510c
Bumped AdminX settings to 0.0.17 (#18093)
no issue
2023-09-12 18:47:02 +00:00
Kevin Ansfield
ff0426fd86
🐛 Fixed incorrect order of author/publisher in bookmarks cards created with beta editor (#18085)
no issue

- bumps Koenig packages
- `@tryghost/kg-default-nodes` contains fix for swapped author/publisher in bookmark renderer
- all packages contain bumped Lexical dependencies
2023-09-12 16:29:07 +00:00
Peter Zimon
be32b23295
AdminX copy updates (#18092)
refs. https://github.com/TryGhost/Product/issues/3349

- couple of copy had to be updated in AdminX
2023-09-12 17:15:42 +02:00
Peter Zimon
dbe1c0fa2e
AdminX various UI fixes (#18089)
refs. https://github.com/TryGhost/Product/issues/3349

- some of the UI components' scrollbar was visible where it wasn't necessary
- metadata preview was shown in view mode too
- social accounts value was shown even if it was empty
- user detail modal was missing field descriptions
- it was not possible to reopen the Zapier modal after closing it the "Close" button
- copy had to be updated for analytics export to make it clear what is going to be exported
- invite modal had to be closed after successful invitation
- toggle component was only active on the text itself, instead of the whole row
2023-09-12 16:11:12 +02:00
renovate[bot]
e8b175c574 Update peter-evans/create-or-update-comment digest to 223779b 2023-09-12 15:53:02 +02:00
Djordje Vlaisavljevic
3995713551 Added static design for recommendation stats
refs https://github.com/TryGhost/Product/issues/3864
2023-09-12 14:44:52 +01:00
Daniel Lockyer
64388072ee Updated i18n translations
- these needed updating after Portal was changed
2023-09-12 14:59:14 +02:00
renovate[bot]
a276335b66 Update dependency @types/common-tags to v1.8.2 2023-09-12 14:36:23 +02:00