ref MOM61
- Adds admin-x react app we’ll use as ActivityPub playground to the
sidebar nav behind the feature flag.
- Wired up routing to Ember
- Setup the project as `admin-x-activitypub`
---------
Co-authored-by: Ronald Langeveld <hi@ronaldlangeveld.com>
refs https://github.com/TryGhost/Product/issues/4152
---
<!-- Leave the line below if you'd like GitHub Copilot to generate a
summary from your commit -->
<!--
copilot:summary
-->
### <samp>🤖[[deprecated]](https://githubnext.com/copilot-for-prs-sunset)
Generated by Copilot at a28462f</samp>
This pull request adds a new admin-x app called `admin-x-demo`, which
demonstrates how to use the shared packages `admin-x-framework` and
`admin-x-design-system` to create a simple app that renders a button and
a modal. It also improves the development workflow, the vite
integration, the dependency management, and the type checking for the
admin-x apps and packages. It modifies some files in the
`admin-x-framework` and `admin-x-design-system` packages to make the
modals prop optional, to introduce a new type for the props from the
Ember app, to fix the z-index of the modal backdrop, and to use
consistent file extensions and module syntax.
no issue
- Follow up to
a382cd8a91
and
fb34e285fc
- The `sourcemap-postprocess` addon was ineffective because the assets
were being copied to `/ghost/core/core/built` before the addon was run,
so the changes weren't being applied in staging/production
- This change makes the required modifications to the sourcemaps before
copying them
no issue
- Follow up to https://github.com/TryGhost/Ghost/pull/18825
- Adding the sourceRoot key didn't seem to work, so I'm just removing
the `assets/` prefix from all the sources to hopefully correct the issue
no issue
- The sourcemaps generated for the admin app use relative links to the
source code files e.g. `assets/ghost.js`
- Since the sourcemaps themselves are hosted at `/assets` already, this
was leading to issues with sourcemaps in Sentry and in the browser
looking for the sources at `/assets/assets/ghost.js`
- This commit adds a `sourceRoot` key to the sourcemaps, which should
allow Sentry and the Browser to find the source code files at
`../assets/ghost.js` instead of `assets/ghost.js`
- We may need to iterate on this — not 100% sure if this is the best way
to do this without trying it in staging. If the `../` doesn't work in
all environments, we can try including the CDN url directly
no issue
- removed labs flag
- removed main editor component and all associated components
- switched usage of `<KoenigBasicHtmlInput>` and `<KoenigBasicHtmlTextarea>` over to use plain `textarea`, the only uses were in settings modals that have been replaced in AdminX
- cleaned up unused editor CSS
refs https://github.com/TryGhost/DevOps/issues/83
- this will now continue use the dev server assets if we tell it to,
or copy the dependency package files to the built folder otherwise
- removes `editor` from config API because it's no longer needed
- removes dependency on `editor.url` in tests, as this no longer exists
- edits dev script to pass dev server URL as env var
- adds `@tryghost/koenig-lexical` dependency to Admin
- this helps maintainability in the future because Admin doesn't need to
care where Core is, as we just resolve to the path where the `ghost`
package is
refs https://github.com/TryGhost/DevOps/issues/80
- as part of moving Admin-X-Setting towards GA, we want to change it from
loading the settings externally via a CDN, to bundling it in with
Admin
- the bulk of the changes here are removing the config in Ghost, setting
up the copy to the Admin assets dir, and loading the new path in Admin
- several other changes have come along the way as I've cleaned up
unneeded code
refs https://github.com/TryGhost/Product/issues/3687
- Today, in Button, Header, Email CTA cards, Portal links are used as
absolute URLs to the root, e.g. https://mysite.com/#/portal/signin. When
clicking on a Portal link, the reader is redirect to the homepage first,
loosing context of the post.
- With this change, the UX becomes smoother: clicking on a Portal link
keeps the reader in context, and open the Portal link on the same post
e.g., https://mysite.com/POST_URL/#/portal/signin
- Technically, this works by using relative URLs for Portal links.
Relative URLs work out of the box for web, but required changes on the
email side, cf. https://github.com/TryGhost/Ghost/pull/17630
closes https://github.com/TryGhost/Product/issues/3665
- added link suggestion feature to the Header card in Mobiledoc (missing
feature)
- Tips & Donations link is behind a feature flag atm, to be cleaned up
once the feature is ready to be released
closes https://github.com/TryGhost/Team/issues/3311
- added event handler to the mobiledoc editor for cut and copy operations that reads mobiledoc from the event data, converts to lexical using `@tryghost/kg-converters` and stores the converted data on the event under the `application/x-lexical-editor` mimetype ready to be pasted into a lexical editor
refs https://github.com/TryGhost/Team/issues/3199
- when content is copied from the Lexical editor the converted mobiledoc post is placed in the clipboardData's `application/x-mobiledoc-editor` mimetype
- added custom paste handling to extract that data and place it into the html content in the same format as a typical mobiledoc copy/paste so that it can then be handled internally by mobiledoc
refs TryGhost/Ghost#16048
- When attempting to embed a Youtube video that has had embedding
disabled by its owner/author, Ghost displayed a generic error message
that didn't indicate the reason for the failed emebed.
- This change updated the error message when Youtube (or any provider)
returns 401: Unauthorized to indicate that the owner of the resource has
explicitly disabled embedding.
refs https://github.com/TryGhost/Team/issues/2887
Images could sometimes be pasted into the editor (noticed especially with Google Docs) with `data:` URLs rather than typical `https:` URLs. That causes problems because data URLs are large binary blobs that get stored in the `posts` table and passed through many areas of the system that doesn't expect large binary blobs, causing knock-on effects.
- added handling to our editor's image card to detect when the card is displayed in the editor with a `data:` URL and if it was then it converts it to a file and uploads it so the image can be stored and displayed the same way as any other image
- handles uploads on both paste and opening a post in the editor that was previously saved with a `data:` URL
refs https://github.com/TryGhost/Team/issues/2680
When selecting a portion of text in KoenigBasicHtmlInput (caption input
for images, newsletter footer text input, new signup notice), and then
pasting a link, some funky things happen:
- Part of the text disappears
- The wrong part of the text is linked
The cause of this is that `KoenigBasicHtmlInput` deletes the selected
text range when pasting, even when pasting a link. so moving that part
below the code that detected a valid link, fixes the issue.
This also adds an option to not close an old style modal when pressing
the enter key (e.g. pressing enter when entering a link causes the modal
to close).
refs 7f1e970a0b
- `koenig-card-callout.hbs` was touched without fixing the lint errors or updating to todo list causing the lint todos to become out of sync
- fixed the lint error and updated the todo list
no issue
Using the slash menu it was possible to insert cards that shouldn't have been accessible based on their availability checks. This was happening because we were only hiding the visibility of the cards in the template rather than completely removing them from the slash command matching logic.
- added `{{card-menu-items}}` helper that combines the availability matching and snippet section addition to return a complete array of sections+items that match the current system state and post type
- added `@menuItems` argument set to the output of `{{card-menu-items}}` to the two card menu components so they are working against a pre-filtered list of menu items
- lets us remove duplication of code that handled pushing snippets section into the menus
- removed availability check conditionals from `<KoenigMenuContent>` as the menu items passed in are now pre-filtered
closes sentry Admin-423
- there may be times when the mousemove event handler fires when the document is not in a ready state resulting in an attempt to get a document position that doesn't exist
- should fix `Could not find parent section from element node` errors
closes Sentry ADMIN-CC8
closes Sentry ADMIN-DDM
closes Sentry ADMIN-C9F
- there are situations where the editor range when key commands are triggered does not have a head section which then throws errors due to the commands assuming there will always be a section present
- added a guard to key commands that use the head section to abort early and fall back to default Mobiledoc behaviour when the section is missing
closes https://github.com/TryGhost/Team/issues/2295
Problem:
- `<GhUploader>` is not yet converted to an Octane component so it's arguments are not read-only
- when a file is selected it sets it's `files` property which in turn updates the tracked `files` property that was passed in, and then again updates it to an empty file list when the input field is cleared
- that tracked property was never cleared once the product image was uploaded resulting in a "re-upload" attempt with an empty file list every time the product card was put back into edit mode
Fix:
- added a guard in `<GhUploader>` so it doesn't try to upload an empty file list if one is passed in as an attribute
- added a reset of the tracked `files` property in the product card once the image upload is complete
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`
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