Commit Graph

14 Commits

Author SHA1 Message Date
Chris Raible
b8ad03b0f3
Added PostHog to admin-x-settings trackEvent function (#20013)
ref https://linear.app/tryghost/issue/PA-53/add-posthog-tracking-to-trackevent-in-admin-x-settings-and-lexical

- There was a pre-existing `trackEvent` function in `admin-x-settings`
that was using Plausible for tracking events.
- This PR adds PostHog to the same function, any calls to `trackEvent`
will send the event name and properties to PostHog as well.
2024-04-11 19:35:30 -07:00
Ronald Langeveld
19da5c6af4
Extracted Unsplash Selector from AdminX (#19849)
no issue

- Adds the unsplash selector as a standalone typescript package inside
the Koenig monorepo.
- Currently we have 3 versions of the Unsplash Selector. One in
Koenig-Lexical, one in AdminX and the original Ember version.
- We can now start phasing out the application coupled version of the
selector and replace it with the reusable version.
- We can now import it via npm to any React application.
- This commit removes the Unsplash components from AdminX and imports it
instead.

This is the second commit for this as the previous commit broke styles
due to normalise styles leaking into the Ember app. Disabling preflight
(https://github.com/TryGhost/Koenig/pull/1169) in Tailwind fixed it.
2024-03-12 22:40:33 +02:00
Ronald Langeveld
36f11a65a0
Revert "Extracted Unsplash Selector from AdminX (#19838)" (#19844)
no issue

- caused a styling regression, making changes then will merge again.
2024-03-12 15:35:09 +00:00
Ronald Langeveld
6719bcf46e
Extracted Unsplash Selector from AdminX (#19838)
no issue

- Adds the unsplash selector as a standalone typescript package inside
the Koenig monorepo.
- Currently we have 3 versions of the Unsplash Selector. One in
Koenig-Lexical, one in AdminX and the original Ember version.
- We can now start phasing out the application coupled version of the
selector and replace it with the reusable version.
- We can now import it via npm to any React application.
- This commit removes the Unsplash components from AdminX and imports it
instead.
2024-03-12 11:06:57 +00:00
Jono M
f19f32b132
Moved AdminX test config to framework package (#19096)
refs https://github.com/TryGhost/Product/issues/4180
2023-11-22 13:39:32 +00:00
Ronald Langeveld
a9ad08cf89
Fixed API Query permissions in User Settings (#18680)
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.
2023-10-18 17:04:59 +07:00
Ronald Langeveld
7d493d61db
Cleaned up Unsplash component in Admin (#18603)
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.
2023-10-13 14:15:14 +07:00
Ronald Langeveld
f4a36ecba4
Fixed link to release in About modal (#18588)
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.
2023-10-12 08:37:56 +07:00
Ronald Langeveld
f9478f5489
Added unit test for Embed Code Generator - AdminX (#18445)
no issue

Add unit tests for `generateEmbedCode` utility function. The tests
verify the HTML output for various options and parameters that affect
the appearance and behaviour of the generated embed script's output.
2023-10-04 08:43:02 +07:00
Michael Barrett
043c9bb35d
Port custom theme setting visibility to admin-x (#18367)
refs https://github.com/TryGhost/Product/issues/3962

Port custom theme setting visibility to admin-x based on previous
implementation in the Ghost admin:
https://github.com/TryGhost/Ghost/pull/17920
2023-10-02 15:54:14 +01:00
Sag
b1e4ead01c
Fixed uniqueness validation of Recommendation URL (#18383)
refs https://github.com/TryGhost/Product/issues/3818

- added a check to compare hostname and pathnames of URLs. Different
subdomain or different pathname = different URLs, but protocol, www,
query parameters and hash fragments are ignored.
2023-10-02 10:34:59 -03:00
Ronald Langeveld
9339364dce
Added Unsplash selector to AdminX (#18216)
no issue

- Copied over the Unsplash Component from Koenig to AdminX and converted
it to Typescript.
- Changed the business logic to follow a bit of dependency injection to
make it more testable and easier to maintain.
- Ideally we move this out of Admin X Settings and perhaps into it's own
library so we don't need to deal with a duplicate code between Koenig
and Admin X.

---

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

This pull request adds support for selecting images from Unsplash in the
admin settings UI. It introduces a new `UnsplashService` class that
handles the Unsplash API requests and a new `MasonryService` class that
handles the masonry layout of the images. It also adds several new
custom components, such as `UnsplashButton`, `UnsplashGallery`,
`UnsplashImage`, `UnsplashSelector`, `UnsplashZoomed`, and
`UnsplashSearchModal`, that render the Unsplash modal and its elements.
It modifies the existing `ImageUpload`, `App`, `ServicesProvider`, and
`BrandSettings` components to integrate the Unsplash feature and pass
the necessary props. It also adds some new types, constants, and assets
related to the Unsplash data and UI. Finally, it adds some unit tests
for the `UnsplashService` and `MasonryService` classes.
2023-09-21 02:23:45 +00:00
Sag
8515bdf587
Updated uniqueness validation for the Recommendations URL (#18253)
closes https://github.com/TryGhost/Product/issues/3818

- instead of fetching all recommendations and matching URLs on the frontend, we now query the database directly to find an existing Recommendation by URL. When comparing URLs, we don't take into account the protocol, www, query parameters nor hash fragments
2023-09-20 16:53:10 +00:00
Sag
6e68c43f78
Added uniqueness validation for the recommendation URL (#18163)
closes https://github.com/TryGhost/Product/issues/3818

- in Admin, when adding a recommendation, the URL is compared against all existing ones. If the URL is already recommended, the publisher is shown an error: "A recommendation with this URL already exists.". Protocol, www, query parameters and hash fragments are ignored during the URL comparison.
- on the backend, there is another uniqueness validation for the recommendation URL. This check is redundant when adding a recommendation from Admin, but helps to keep data integrity when recommendations are added through other paths (e.g. via the API)
2023-09-15 13:14:47 +00:00