no issue
- preparation for using `ember-pikaday` that utilizes `ember-cli-moment-shim`
- removes usage of `moment` global
- removes custom imports of `moment` and `moment-timezone` libraries
no issue
- our custom validation engine makes extensive use of `DS.Errors` which fills the console and especially the test logs with a ton of warnings, this change adds a handler to skip the warnings that we don't care about at the moment
- should be removed when we merge the validations refactor
closes https://github.com/TryGhost/Ghost/issues/8269
- swaps the usage of our custom `gh-dropdown` component in the user menu dropdown for the `ember-wormhole` based `ember-basic-dropdown` that is used elsewhere in the app and will fully replace `gh-dropdown` in the future
- adds `gh-basic-dropdown` component that extends from `ember-basic-dropdown` and hooks into our `dropdown` service so that we can programatically close dropdowns from disparate areas of the app
- modifies the `body-event-listener` mixin to pass the click event through to it's consumers
- modifies the `bodyClick` handler in the `dropdown` service to check if the click actually originated from an ember-basic-dropdown element - this body click handler will go away once we've fully switched to `gh-basic-dropdown`
- adds `ember-native-dom-helpers` to provide consistency between acceptance and integration tests (this is the start of another refactor, eventually this addon will disappear as part of ember's [grand testing unification project](https://github.com/rwjblue/rfcs/blob/42/text/0000-grand-testing-unification.md))
no issue
- `gh-popover` and `gh-popover-button` are no longer used in the codebase
- removing them seems prudent as we are moving towards a different approach for dropdowns/popovers/tethers etc
closes https://github.com/TryGhost/Ghost/issues/8270
- add `.jpeg` to the list of asset extensions that get fingerprinted
- remove the use of the `{{gh-path "asset" ...}}` helper - since switching to hash-location URLs all assets can now be referenced relatively and removing usage of the helper prevents it getting in the way of ember-cli's asset fingerprinting/rewriting mechanism
closes https://github.com/TryGhost/Ghost/issues/8213
- quick-fix by not adding the `.min` to the production `ghost-dark.css` file, the asset rename breaks the asset rewriting resulting in the lazy loader attempting to load a non-fingerprinted file
* deps: ember-cli-node-assets@0.2.2
* fix tests when run via http://localhost:4200/tests
no issue
- `blogUrl` in the mocked config was hardcoded, switching to using the current origin fixed the navigation tests
- we were only pulling jquery drag simulator library in on test builds but we also need it added to `test-support.js` in development builds
- lazy loading is disabled in the test env which previously worked fine as all of the codemirror assets are bundled into the test build, now that we also run tests using the development build we needed to update the config to import codemirror assets into the `test-support.js` file - this ensures that we have normal lazy-loading behaviour when developing locally and that accessing via http://localhost:4200/tests doesn't die horribly due to missing dependencies
Refs: https://github.com/TryGhost/Ghost/issues/8191
Refs: https://github.com/TryGhost/Ghost/issues/8194
Changes the selection behaviour of mobiledoc-cards:
If you navigate to a card with a keyboard or click on the new editor toolbar it "hard selects".
If you click into the body of a card to edit it it "soft selects".
When a card is "hard selected" you can navigate out of the card and to the previous or following blocks within the mobiledoc with the keyboard, you can delete the current card with the backspace or delete button, and you can create a new block following the card with the enter key.
When a card is soft selected it is simply displayed as selected and allows the user to edit content within the card.
New card toolbar:
Allows a user to delete the card, save the card, and "hard select" a card.
New title behaviour:
Pressing the enter key within the title "splits" the title at the cursor point, if multiple characters are selected they are first deleted, and creates a new paragraph at the top of the document with the trailing characters after the split.
gh-cm-editor updates:
Adds an on-focus event to gh-cm-editor
refs https://github.com/TryGhost/Ghost/issues/8161, requires tbd
- updates the `ember:watch` grunt task to use `ember serve`, passing in the required `--live-reload-base-url` parameter
- forces live reload port to `4201` for now as there's a [bug on touchbar macs](https://github.com/ember-cli/ember-cli/issues/6513)
- removes the unused `ember-cli-content-security-policy` dependency to remove console log noise from x-domain warnings
With this and the required Ghost PR, when using `grunt dev` the admin screen will refresh any time a file is changed. It will also allow tests to be run simultaneously by visiting http://localhost:4200/tests
no issue
- Adds a few improvements for link insertion.
- Sanitises links
- Toggles a link so that if there are existing links in the selected text it removes them.
refs https://github.com/TryGhost/Ghost/issues/7754
The title is now a contenteditable div which stretches and wraps to behave like the editor.
It also tries to seemlessly move the cursor between the editor and title to make one coherent editing experience.
closes https://github.com/TryGhost/Ghost/issues/8196
The default state of both the '/' and '+' card menus is a selection of -1, this ensure that the active tool prompt isn't shown until the user presses an arrow key for keyboard selection. However -1 isn't a valid tool id so when pressing enter without selecting a tool the user will cause an error.
This update ensures that the selected tool is the first tool available even if the selection is in fact -1.
closes https://github.com/TryGhost/Ghost/issues/8195
When the toolbar is toggled into link mode the link input field should always focus, however this only happens on the first time which leads to issues with mobiledoc having focus but not the range.
This fix means that the toolbar always focuses.
no issue
- adds `settings` service that acts as a proxy to the singular settings model with methods to fetch and reload, also prevents accidentally loading only some settings types which has caused problems in the past
- updates app boot, signin, and signup processes to fetch settings ensuring that any part of the app can grab settings synchronously if needed
- removes `timeZone` service, it's no longer needed as we can grab `settings.activeTimezone` directly
- replaces all store queries for the settings model with appropriate `settings` methods
- refactors `apps/*` routes/controllers, they had become a little convoluted with the way they were dealing with settings and the new service helped to clean that up
closes: https://github.com/TryGhost/Ghost/issues/8106
- Fixes the keyboard selection problems of the '+' menu.
- Makes the active state of the keyboard selection blank until a key is pressed.
- Fixes it so that the '+' menu executes the tool on Enter.
closes: https://github.com/TryGhost/Ghost/issues/8153
Previously when selecting text in the editor the screen will jump as it tries to scroll so that the cursor is always on it.
This update means it will no longer happen when selecting the text with either the mouse or in a mobile browser. Unfortunately when selecting text with the keyboard the editor will no longer scroll with the cursor.
closes: https://github.com/TryGhost/Ghost/issues/8179
- previously all cards just had a `__mobiledoc-card` class on them, this update replaces them with a class `kg-card` and adds an additional class of `kg-{{card_name}}`
refs TryGhost/Ghost#8140
refs TryGhost/Ghost#8184
- now that the admin index page is just html, we don't need handlebars anymore
- this changes the template be called .html to reflect this
Closes#8164
- When a user clicks on a card within a '/' menu it now executes that tool.
- If a user engages a card with the / menu the content of the paragraph is now inserted into the card.
refs https://github.com/TryGhost/Ghost/issues/8106
When a user clicks on the plus button it opens the card menu, when they click on it twice the card menu input field loses focus and the card menu closes, because the Range object of the document is no longer within the editor the '+' button also disappears. This has the effect of making the '+' button disapear when double clicking.
Now when the input field to search cards loses focus the card menu disapears but the '+' button remains, we rely on the cursorDidChange event to also hide the button.
closes https://github.com/TryGhost/Ghost/issues/8163
Previously when you created a link the toolbar component would re-render and dissapear.
This update ensures that the logic that must happen on first render does not happen on subsequent renders.
refs https://github.com/TryGhost/Ghost/issues/8157
Currently mobiledoc-kit doesn't allow the inserting or replacing of a list item with a card.
There is a solution that works toggling the section to a `p` then replacing the section, however there are issues with the mobiledoc range object becoming out of sync and the workarounds for that are too hacky.
We need to update mobiledoc to deal with this usecase (although the way that ranges are handled during undo might also be an option worth exploring), but for now we'll simply insert a card at the bottom of the list which is unfortunately different behaviour from any other block.
refs ##8131
- "posts per page" is now a theme-level concern
- UI has already been removed, this finishes the cleanup by removing `settings.postsPerPage` and related validation/test support
refs #8140🎨 remove usage of ghost's {{asset}} helper in built index.html files
requires https://github.com/TryGhost/Ghost/pull/8142
- switch to hash-location rather than history-location
- remove usage of Ghost's `{{asset}}` helper in index.html
- add `content-for` helpers to `asset-delivery` addon that switch asset urls in index.html to `.min` files in production
- update the `asset-delivery` addon to copy the production `index.min.html` to `default-prod.hbs` so Ghost can serve production assets when in production mode
- change template output path to `core/server/admin/views/`
- enable asset fingerprinting
- remove `ember-cli-sri` dependency - we weren't using it but now that ember is handling assets it was used automatically and could potentially create issues if users have proxy servers that attempt to compress or otherwise modify asset files
✨ redirect to setup if server says setup isn't finished
refs https://github.com/TryGhost/Ghost/issues/8140
- now we're using hash-location the server no longer knows if we're hitting the /setup route so it's not able to redirect for us
- extends the default ESA `UnauthenticatedRouteMixin` to add a check against the `/authentication/setup` API endpoint and redirects to `/#/setup/one` if setup isn't complete - this works for all routes because the default behaviour when hitting an authenticated route without the right credentials is to force a logout and redirect to `/#/signin` which utilises the `UnauthenticatedRouteMixin`
deps: ember-cli-inject-live-reload@1.6.1
closes https://github.com/TryGhost/Ghost/issues/8127
- update theme activation to manually set other themes to `active: false` in the store now that we only the active theme back from `/themes/:name/activate` endpoint
- move theme warning list item rendering into `{{gh-theme-error-li error=x}}`
- add `theme-warnings` modal that accepts a warnings list, title, and optional message
- after activating a theme, check if the theme has any warnings or errors and display an appropriate modal informing the user