Commit Graph

9607 Commits

Author SHA1 Message Date
Kevin Ansfield
bbf7e8ed7a Cleaned up react component rendering
no issue

- switched from needing to extend from `ReactComponent` to using a `{{react-render}}` modifier
  - modifiers are modern idiomatic Ember for handing "did-insert" hooks and associated lifecycle
- moved code from `<ReactMobiledocEditor>` into `<KoenigReactEditor>`
  - no need for the extra layering of components and need to remember two places to modify when adding passthrough args/props
2022-07-28 15:52:50 +01:00
Kevin Ansfield
bd194f4ccc Fixed loading of react editor in production
no issue

- replaced use of `GhostAdmin` global when it doesn't exist in production by using the `Ember` global and picking the correct namespace
2022-07-28 13:37:20 +01:00
Kevin Ansfield
fd0398d5e2 Fixed unsupported .cleanup() calls on react editor
no issue

- `react-editor` controller has much of the same code as the normal editor controller but not all of the editor-instance methods are supported in the react editor yet
- commented out the remaining `.cleanup()` calls that are intended to remove empty cards because the method does not exist and was throwing errors when leaving the react-editor route
2022-07-27 14:14:12 +01:00
Kevin Ansfield
7a9435d524 Hooked up editor registration in react editor experiment
no issue

- use the `didCreateEditor` hook to register the editor instance as we do with our Ember version of Koenig
- allows for initial handling of focus control for moving cursor between title and body inputs
- disabled card cleanup call because the react editor does not yet have cards or the custom `cleanup()` method
2022-07-27 14:14:12 +01:00
Kevin Ansfield
a4a4136c2f Fixed hooks not being usable inside of react components
no issue

- switched to using the `window.ReactDOM` instance that is created when importing the react/react-dom libraries
  - React stores state/component references inside of the ReactDOM instance when rendering so we need to make sure all renders use the same instance otherwise it loses track of which component a hook belongs to
- cleaned up unnecessary vendor shims and `prop-types` import
  - `react` and `react-dom` vendor shims are unused when using the globals instead of imports
  - `prop-types` import+shim is not required as it's part of the `@tryghost/koenig-react` build unlike the earlier direct import of `react-mobiledoc-editor`
2022-07-27 14:14:12 +01:00
Aileen Nowak
b1e44dd2f2 Added explore alpha feature flag 2022-07-27 13:14:40 +01:00
Peter Elmers
26e6d459cb Put plus menu button on the screen on mobile (#2417)
Fix the right positioning and size of the icon for mobile display
Addresses https://github.com/TryGhost/Ghost/issues/14948
2022-07-27 11:29:33 +02:00
Peter Zimon
6ae1cce9c8 Fixed browser preview site title word wrap bug 2022-07-27 10:42:36 +02:00
Rishabh Garg
47fa59ea72 Added flag for newsletter paywall feature (#2430)
refs https://github.com/TryGhost/Team/issues/1680
2022-07-26 21:30:21 +05:30
Kevin Ansfield
b5b88e7c5e Added mobiledoc change handling to react-editor experiment
no issue

- passed through the `onChange` event handler so that changes to the content are updated in Ember and autosave etc is triggered
2022-07-26 14:42:59 +01:00
Kevin Ansfield
873a2ff8e3 Updated <ReactMobiledocEditor> to work with single-component export from koenig-react
no issue

- top-level export from `@tryghost/koenig-react` is a single component and the UMD module is loaded onto `window.koenigEditor`
2022-07-26 14:34:14 +01:00
Daniel Lockyer
5f311946b5 v5.5.0 2022-07-26 08:23:55 +01:00
Peter Zimon
e5bcc52dfc Updated new site creation typography 2022-07-25 11:26:07 +02:00
Simon Backx
c9a3211032 Updated comment events to use parent instead of parent_id 2022-07-22 14:34:43 +02:00
Simon Backx
0963da7a2e Added support for comment activity feed events
refs https://github.com/TryGhost/Team/issues/1709

- Hides comment events if lab flag is disabled
- Hides comment events if comments are disabled
2022-07-22 11:52:11 +02:00
James Morris
b46a6fb83e Added in a new comments icon for the activity feed
refs https://github.com/TryGhost/Team/issues/1709
2022-07-22 10:08:00 +01:00
Peter Zimon
05789e4466 Fixed typography glitches
- fixed letter spacing for titles using Inter font
2022-07-21 10:24:10 +02:00
Peter Zimon
b7a5f4f266 Switching default font to Inter (#2429)
This PR switches the default font for Inter to provide a much more reliable typography across various OS's and for better integration with the Ghost brand.
2022-07-21 09:58:22 +02:00
Djordje Vlaisavljevic
29b47d9556 Added z-index for post settings panes 2022-07-19 17:19:41 +02:00
Daniel Lockyer
69cc21992d Merged v5.4.1 into main
v5.4.1
2022-07-19 16:00:35 +02:00
Daniel Lockyer
2d405513b3 v5.4.1 2022-07-19 14:57:42 +01:00
Kevin Ansfield
f00bdbf43c Changed url for react editor module to use Ghost/config-provided url (#2428)
reqs https://github.com/TryGhost/Ghost/pull/15045

- accesses the Ember registry via the `GhostAdmin` global to grab the editor component url that Admin fetches from the config endpoint
- `ember-auto-import` does not allow dynamic imports unless it can see it's an absolute URL, to work around that we strip the `https://` part of the provided URL and manually include it in the template string so it's detectable as an absolute URL when building
- added redirect to posts screen if no editor url is provided in config
2022-07-19 14:24:07 +01:00
Kevin Ansfield
896cd4888f Switched to dynamically loaded external react-mobiledoc-editor package
no issue

- dropped the bundled `react-mobiledoc-editor` package
- updated `<ReactMobiledocEditor>` component to pull in editor components dynamically
  - added a resource function to dynamically import the external module
  - added `Container` and `Editor` components that read from the resource function and wrap components of the same name from the external module
  - added `<Suspense>` around the `Container` and `Editor` components so that React will show a loading state whilst the external components are still being fetched
  - added `<ErrorHandler>` so we can show an error state if loading fails
2022-07-19 12:48:53 +01:00
Kevin Ansfield
d991da399c Added support for building/rendering react components
no issue

- updated ember-cli-build and eslint config to support jsx
- added `react` and `react-dom` libraries
  - included them in the build so the `React` and `ReactDom` globals are available for use by third party components
  - added vendor shims so we can do things like `import * from 'react'` where the imports are referenced directly to the already imported modules
- added `<ReactComponent>` component
  - designed to be extended from in specific react component classes
  - renders a div and calls `renderComponent()` action once inserted - this should be replaced in any extended classes in order to render a react component
  - handles react rendering and teardown
- added `<ReactMobiledocEditor>` react component that renders an editor composed of components provided by the `react-mobiledoc-editor` package
- added `<KoenigReactEditor>` ember component that renders `<ReactMobiledocEditor>` and handles pass-through of Ember arguments and handling of actions
- updated `<GhKoenigEditorReact>` to render `<KoenigReactEditor>` in place of `<KoenigEditor>`
2022-07-19 12:48:53 +01:00
Kevin Ansfield
81f3718867 Duplicated <GhKoenigEditor> to <GhKoenigEditorReact>
no issue

- the component wraps the title and editor canvas components, we only want to replace the canvas component with a react experiment so we need a duplicate for use in the `react-editor` experiment templates
2022-07-18 11:11:19 +01:00
Kevin Ansfield
a76132bda3 Re-generated .lint-todo file
refs https://github.com/TryGhost/Ghost/issues/14101

- compacted file and reset warning/error times
2022-07-18 10:54:10 +01:00
Kevin Ansfield
8d65303268 Fixed linter error for use of {{action}} in editor-loading controller
refs https://github.com/TryGhost/Ghost/issues/14101

- `{{action}}` is deprecated and should be replaced with `{{on}}` and `{{fn}}` with direct use of methods
- switched to calling `ui.setMainClass` action directly
2022-07-18 10:50:03 +01:00
Kevin Ansfield
a77388159c Duplicated editor screens to react-editor
no issue

- initial set up ready for testing use of react components (specifically an editor component for this experiment) inside of Admin
- added `react-editor` route
- duplicated all editor screen files and updated route references where necessary
2022-07-18 10:43:29 +01:00
Daniel Lockyer
40240d6b7a v5.4.0 2022-07-15 16:00:33 +01:00
Djordje Vlaisavljevic
067ebeab7b Made it easier to tell primary and other authors apart in post settings 2022-07-15 15:28:03 +02:00
Simon Backx
9e7727752c Updated support email address confirmation flow (#2426)
refs https://github.com/TryGhost/Team/issues/584

- No longer uses a API URL + redirect inside verification emails. This is replaced by a new route (`/settings/members/?verifyEmail=token`) that does the API request and shows a modal.
- Removed update button when changing support email address in the Portal settings
- Added `_meta` attribute to settings (uses same pattern as newsletters model)
- When updating the `membersSupportAddress` setting (via the normal edit endpoint), the `sent_email_verification` meta property will get set by the API. When this new property is present, we'll show a warning that the support address requires verification.
2022-07-15 14:44:26 +02:00
Djordje Vlaisavljevic
5d827ad1a9 Made it easier to tell internal and public tags apart in post settings 2022-07-15 11:19:40 +02:00
Daniel Lockyer
1d6fee8aa0 Fixed date zero-padding in table views
- when you have a date column in a table, dates with 2 digits vs 1
  digit cause the vertical alignment to be all over the place
- this commit fixes the date formatting for those entries to be zero-padded
2022-07-15 09:45:42 +01:00
Kevin Ansfield
242106d596 Migrated code card to Octane syntax
refs https://github.com/TryGhost/Ghost/issues/14101

- applying boyscout rule and upgrading/cleaning up when touching files
- nothing out of the ordinary to report with this migration
2022-07-14 17:32:44 +01:00
Kevin Ansfield
aab02f0f4c 🐛 Fixed code card not correctly saving language when changing
closes https://github.com/TryGhost/Team/issues/1662

- the on-blur action for the language input was modifying the language property in the payload object directly which meant that the mobiledoc `save` call was missing and all the associated editor behaviour for serializing and saving the update was lost
- switched to modern action syntax and a proper action on the backing component so we're saving the change correctly
2022-07-14 17:30:05 +01:00
James Morris
587ae505f0 Added in hover states for the members list so it matches other lists
no issue
2022-07-14 16:29:02 +01:00
James Morris
db0929d07a Improved the strange resizing issues for the main chart on new Dashboard 2022-07-14 16:00:17 +01:00
Sanne de Vries
8aeb5c181e Updated .lint-todo 2022-07-14 15:32:21 +01:00
Sanne de Vries
a4d5d14ba6 Updated internal tag style in user deletion modal 2022-07-14 15:11:43 +01:00
Sanne de Vries
09794a7c05 Updated theme upload modal in Casper error state
No ref

- Updated modal default state to make it look more clickable
- Updated the Casper upload error state design
- Changed the 'try again' button to directly open the finder rather than only resetting the modal
2022-07-14 15:07:08 +01:00
jp
214ad1d57c 🎨 Added link to GitHub release for current version (#2349) 2022-07-14 15:07:24 +02:00
James Morris
415dfa97b3 Refactored and cleared out some unneeded Dashboard CSS
no issue
2022-07-14 10:37:10 +01:00
James Morris
551db84966 Small fix for email newsletter setting arrow placement
no issue
2022-07-14 09:52:26 +01:00
Djordje Vlaisavljevic
048b0470da Updated lint-todo 2022-07-13 18:25:54 +02:00
Djordje Vlaisavljevic
5ad99f79a9 Added unique aria-labels to form elements 2022-07-13 18:25:46 +02:00
Djordje Vlaisavljevic
a710dd3c06 Removed option to close the modal by clicking behind it 2022-07-13 17:28:29 +02:00
Djordje Vlaisavljevic
82808d69f5 Made the "back" buttons have unique aria-label attributes 2022-07-13 17:27:24 +02:00
Djordje Vlaisavljevic
6e0bd66063 Updated lint-todo 2022-07-13 17:26:35 +02:00
Kevin Ansfield
cb6e1679e9 Fixed modalOptions.ignoreBackdropClick not always being picked up
no issue

- the modal instance on `this.top` inside the background click handler is not always a direct instance so we need to check both `.options` and `._options` when looking for the desired click ignore behaviour
2022-07-13 16:02:34 +01:00
Djordje Vlaisavljevic
1158555084 Set canonical post placeholder value to post URL 2022-07-13 16:59:28 +02:00