refs
https://www.notion.so/ghost/Cannot-fetch-invites-error-shown-for-authors-edc00af822d844e7add114fd834fc8fc
- the problem is that certain users don't have permissions to make
certain API calls.
- This adds a new hook that validates the current user against
permissions before a query can be made.
---
<!-- Leave the line below if you'd like GitHub Copilot to generate a
summary from your commit -->
<!--
copilot:summary
-->
### <samp>🤖 Generated by Copilot at 9d9cc07</samp>
Added a `usePermission` hook and a `permissions` option for custom API
queries to implement role-based permissions in the admin settings app.
refs https://github.com/TryGhost/Product/issues/3832
Hopefully the scrolling finally works consistently
- Fixed a bug where clicking the navigated section wouldn't scroll to it
- Fixed a bug where the first click after opening settings wouldn't
animate the scroll
- Fixed a bug where the sidebar would always animate scroll even on the
initial page load
---
<!-- Leave the line below if you'd like GitHub Copilot to generate a
summary from your commit -->
<!--
copilot:summary
-->
### <samp>🤖 Generated by Copilot at 0996b8b</samp>
This pull request improves the scrolling and navigation functionality of
the settings page by using a custom hook and a context provider. It
refactors the `RoutingProvider` and the `useScrollSection` hook to
handle the route and sidebar changes more efficiently, and simplifies
the code by removing unnecessary components and state. It also adds new
functions to the scroll section context data to update and scroll to the
desired section.
no issue
- the default theme (currently Source) showed Activate despite being
active already, which may lead to confusion.
- This fix checks whether it's already to more accurately display the
wording of the button
---
<!-- Leave the line below if you'd like GitHub Copilot to generate a
summary from your commit -->
<!--
copilot:summary
-->
### <samp>🤖 Generated by Copilot at 4fd443c</samp>
Fix theme preview button label for default theme. Hide the activate
button for the default theme if it is already active in
`ThemePreview.tsx`.
refs https://github.com/TryGhost/Product/issues/3832
---
<!-- Leave the line below if you'd like GitHub Copilot to generate a
summary from your commit -->
<!--
copilot:summary
-->
### <samp>🤖 Generated by Copilot at 8ad5f58</samp>
This pull request enhances the portal modal component in the admin
settings for membership. It improves how it handles errors, saves
changes, and communicates with the user.
### Why this PR?
This PR adds back the current theme version in Design Settings screen
![image](https://github.com/TryGhost/Ghost/assets/8493007/88f475f6-9bba-4dda-8db7-0bddd2fee8a3)
- [x] There's a clear use-case for this code change, explained above
- [x] Commit message has a short title & references relevant issues
- [x] The build will pass (run `yarn test:all` and `yarn lint`)
---
<!-- Leave the line below if you'd like GitHub Copilot to generate a
summary from your commit -->
<!--
copilot:summary
-->
### <samp>🤖 Generated by Copilot at 2796daf</samp>
This pull request improves the code quality and user interface of the
design modal component for site settings. It applies code formatting
rules and shows the active theme version on the save button.
refs https://github.com/TryGhost/Product/issues/4018
---
### <samp>🤖 Generated by Copilot at 5c51ade</samp>
Fix modal scrolling bug in Safari by blurring active element and
delaying close. Affect `Modal.tsx` component.
no issue
- Fixed a bug where the Unsplash button in site design didn't hide if
the integration was disabled.
- Cleaned up Unsplash in preparation for moving it to it's own package
in future.
---
<!-- Leave the line below if you'd like GitHub Copilot to generate a
summary from your commit -->
<!--
copilot:summary
-->
### <samp>🤖 Generated by Copilot at 4da5d12</samp>
Refactored and improved the Unsplash integration feature in the admin
settings app. Moved all files related to Unsplash to a separate
`unsplash` folder and renamed some classes and interfaces to avoid
confusion. Added a feature flag for Unsplash in the brand settings
component and a prop to customize the portal container for the Unsplash
search modal. Created a new class `PhotoUseCases` to handle the logic
for fetching, searching, and downloading photos from Unsplash.
no issue
- the link to the release has `-moya` added to it, which breaks the link
to the github release. This ensures it gets removed should it be there
to avoid broken links.
---
<!-- Leave the line below if you'd like GitHub Copilot to generate a
summary from your commit -->
<!--
copilot:summary
-->
### <samp>🤖 Generated by Copilot at f13886c</samp>
Refactored the `About.tsx` component to extract some utility functions
to separate modules. Added unit tests for the extracted functions in the
`test/unit/utils` folder. The refactoring improves code organization and
reusability, and the tests increase the code coverage and reliability.
refs https://github.com/TryGhost/Product/issues/3999
Refactored the theme demo functionality to remove the hard-coded
reference to the source theme and enable the functionality for any
theme.
refs https://github.com/TryGhost/Product/issues/3832
---
<!-- Leave the line below if you'd like GitHub Copilot to generate a
summary from your commit -->
<!--
copilot:summary
-->
### <samp>🤖 Generated by Copilot at 8a40cbc</samp>
This pull request adds a feature to verify the sender email address for
a newsletter in the admin settings app. It implements a UI component, a
custom hook, and a server-side service to handle the verification
process. It also fixes a minor typo and a navigation issue in the
newsletters module.
refs https://github.com/TryGhost/Product/issues/3832
---
<!-- Leave the line below if you'd like GitHub Copilot to generate a
summary from your commit -->
<!--
copilot:summary
-->
### <samp>🤖 Generated by Copilot at babb461</samp>
This pull request enhances the popover component in the
`admin-x-settings` app. It fixes a bug with the alignment of the popover
and refactors the style object for better readability and
maintainability.
fixes https://github.com/TryGhost/Product/issues/4005
We no longer use the 'reason' of a recommendation, but allow a flexible
description instead. Because this is a breaking change in the API, we do
this before making this feature GA.
- Added new database utils for renaming a column
- Added new migration to rename the column
- Updated all references in code
refs https://ghost.slack.com/archives/C0568LN2CGJ/p1696844453572279
- we renamed the access route to members route and never updated the
link.
- This adds the correct link in the newsletter sending setting.
---
<!-- Leave the line below if you'd like GitHub Copilot to generate a
summary from your commit -->
<!--
copilot:summary
-->
### <samp>🤖 Generated by Copilot at a62962d</samp>
Fixed a navigation bug in the email settings UI and refactored the
settings UI for better usability. Updated the `onClick` handler of the
`Banner` button in `EnableNewsletters.tsx` and other related files.
refs
https://www.notion.so/ghost/AdminX-feedback-27fc7f549bbf4a53bfa2e7b6e5643963?p=d8bb2da9a6534494ad5baf840bbfd785&pm=s
- The error state remains visible after navigating away from settings
- this fix resets the toast on initial load to ensure it doesn't persist
if not needed
---
<!-- Leave the line below if you'd like GitHub Copilot to generate a
summary from your commit -->
<!--
copilot:summary
-->
### <samp>🤖 Generated by Copilot at 5c91fe7</samp>
Improved notifications on settings page using `toast` function. Cleared
old notifications on initial load to avoid confusion.
- quite funny because it's such a sneaky thing to discover
- this code actually results in looping over
`'xxxxx<,t,e,s,t,f,o,o,t,>'` and not an array of characters
- adding brackets fixes that
---
<!-- Leave the line below if you'd like GitHub Copilot to generate a
summary from your commit -->
<!--
copilot:summary
-->
### <samp>🤖 Generated by Copilot at 584ab6c</samp>
Fix a bug in the code injection test case for the admin settings app.
Ensure that the test code is properly padded and split by using
parentheses in the string concatenations.
---------
Co-authored-by: Jono Mingard <reason.koan@gmail.com>
refs https://github.com/TryGhost/Product/issues/3998
Refactored the theme demo functionality to remove the hard-coded
reference to the source theme and enable the functionality for any
theme. This also ensures the demo images are correctly referenced in
pro.
refs
https://www.notion.so/ghost/AdminX-feedback-27fc7f549bbf4a53bfa2e7b6e5643963?p=39e45d28cd2643888b82d5e9cc0901a3&pm=s
- The logic was correct, but the string value from the API passed in
null when
empty instead of an empty string.
- this takes a potential null into account to be able to make the
condition comparison more reliable.
---
<!-- Leave the line below if you'd like GitHub Copilot to generate a
summary from your commit -->
<!--
copilot:summary
-->
### <samp>🤖 Generated by Copilot at eac36f4</samp>
Fixed some issues with the state management and input handling of the
`AmpModal` and `FirstPromoterModal` components in the admin settings
app. These changes prevent errors and warnings when the integrations are
null, disabled, or unconfigured.