Commit Graph

1264 Commits

Author SHA1 Message Date
Kevin Ansfield 80c010d223 Remove ember application template wrapper
no issue
- Ember will not output the application template wrapper div in the future but it's possible to optionally enable that feature now
- fixes test harness render so that all elements are constrained to the application wrapper rather than breaking out with `position: fixed` and covering the test results
2018-05-01 10:57:20 +01:00
Kevin Ansfield 93bd1ce9d7 Remove usage of `ember-element-resize-detector`
no issue
- fixes babel deprecation warning coming from `ember-element-resize-detector`
- re-created basic `resize-detector` service to wrap `element-resize-detector`
    - import `element-resize-detector` directly from `npm` (includes bump to latest version)
    - drop usage of jQuery selectors
2018-04-30 17:03:29 +01:00
Kevin Ansfield 8c23d5acef Removed used of `ember-data-filter`
closes https://github.com/TryGhost/Ghost/issues/9591
- swapped use of `store.filter` for a combination `store.peekAll` and CPs to filter the result set
2018-04-30 13:54:09 +01:00
Kevin Ansfield 51bc0c9914 Fixed "Route#router intimate API" deprecation notices
closes https://github.com/TryGhost/Ghost/issues/9603
- don't add a `setTitle` method on the router and instead call `window.document.title` directly so that we don't have to access  `Route#router` (throws deprecation) or `Route#_router` (private and may break without notice)
2018-04-30 13:07:37 +01:00
Kevin Ansfield 317c30981e Fixed duplicate tokens in app titles
no issue
- the `Settings - Apps` part of the title is already set via the `settings` route
2018-04-30 12:49:14 +01:00
Kevin Ansfield 61031c35a3 🐛 Fixed admin URL not updating when changing tag slug
closes https://github.com/TryGhost/Ghost/issues/9571
- uses `window.replaceState` to update the URL when a tag is saved with a new URL
    - ensures back button doesn't result in 404
    - use `windowProxy` util so that behaviour can be tested
2018-04-30 12:29:43 +01:00
Kevin Ansfield 9d02c6f433 🐛 Fixed 404 handling in admin
refs https://github.com/TryGhost/Ghost/issues/9571
- use `replaceWith` rather than `transitionTo` so that the back button still works and doesn't immediately throw you back to the 404 page
- use the new `router` service to avoid deprecation notices
- update the regex replacements to work with `#` urls
2018-04-30 12:09:30 +01:00
Kevin Ansfield 01052c053f Koenig - Fix spaces in markdown card editor
refs https://github.com/TryGhost/Ghost/issues/9505
- without `white-space: pre-wrap` any trailing spaces will be ignored by the browser which messes with CodeMirror's cursor positioning
2018-04-25 14:57:57 +01:00
Zimo 3fc0841647 Koenig - Plus menu positioning and container card style
refs https://github.com/TryGhost/Ghost/issues/9505
2018-04-25 14:28:52 +01:00
Zimo f78467091d Koenig - Tweaked container card styles
refs https://github.com/TryGhost/Ghost/issues/9505
2018-04-25 14:28:37 +01:00
Zimo df50c9c51c Koenig - Styled HTML card edit mode
refs https://github.com/TryGhost/Ghost/issues/9505
2018-04-25 14:27:53 +01:00
Kevin Ansfield a4feb4d18d Koenig - Enable line-wrapping for HTML card's CodeMirror instance
refs https://github.com/TryGhost/Ghost/issues/9505
- pass `lineWrapping` option through to CodeMirror in `{{gh-cm-editor}}`
- add cascade overrides for the `pre` line-wrapping styles needed by CodeMirror
2018-04-25 12:06:01 +01:00
Kevin Ansfield 1345582340
Koenig - Card menu and (+) button styles (#1010)
refs https://github.com/TryGhost/Ghost/issues/9505
- apply styles to card menu and replace icons
- apply styles for (+) button
2018-04-25 10:11:48 +01:00
Kevin Ansfield aaf40bc483 Koenig - Keep MD card formatting toolbar visible when possible
refs https://github.com/TryGhost/Ghost/issues/9505
- use `{{gh-scroll-trigger}}` components at top and bottom of the markdown card when in edit mode so that styles can be applied to the `.editor-toolbar` element to keep the toolbar fixed at the bottom of the screen whilst scrolling
2018-04-24 13:10:20 +01:00
Peter Zimon f88c2e1706 Koenig - Improve styles (#1008)
refs https://github.com/TryGhost/Ghost/issues/9505
- Tweaking UI of link input
- Tweaking toolbar menu
- Tweaking image toolbar style
- Applying image width styles
- Tweaking list typography
- Fixing empty post placeholder
2018-04-24 10:15:54 +01:00
Kevin Ansfield d380753fd3 🐛 Fixed tag/author removal in post settings removing multiple tags/authors
closes https://github.com/TryGhost/Ghost/issues/9575
- in 38b138d759 an `onmouseover` event handler was added for the close button in token input options which resulted in double firing in some circumstances where our code fired then the ember-power-select removal event handler also fired
2018-04-23 14:25:59 +01:00
Kevin Ansfield 93f1712036
Bump dependencies (#1003)
no issue
- bump deps with no major breaking changes
- bump yarn.lock sub-dependencies
- resolve deprecation warnings for removal of Authorizers in ember-simple-auth
2018-04-23 11:53:42 +01:00
Zimo 9eb0019628 Koenig - Fixing editing styles for HTML card 2018-04-20 17:51:33 +02:00
Zimo b331cbfd97 Koenig - Fixing Markdown card styling in edit mode 2018-04-20 17:20:15 +02:00
Kevin Ansfield 4a1273d388 Koenig - Use our full markdown editor in markdown card
no issue
- remove jQuery usage in `{{gh-markdown-editor}}` (general cleanup)
- switch `koenig-card-markdown` to use `{{gh-markdown-editor}}`
- update markdown editor styles to fit within the card interface
- add `{{gh-editor}}` for handling image uploads and drag/drop
2018-04-20 15:43:44 +01:00
Kevin Ansfield 284dd057a9 Allow certain toolbar buttons to be disabled in {{gh-markdown-editor}}
no issue
- pre-requisite for using `{{gh-markdown-editor}}` inside a Koenig card
- adds `enablePreview`, `enableSideBySide`, and `enableHemingway` params that can be set to `false` to disable the related toolbar buttons and shortcuts
2018-04-20 15:43:44 +01:00
Kevin Ansfield f6ec2f23f5 Move mobiledoc knowledge out of {{gh-markdown-editor}}
no issue
- pre-requisite for using `{{gh-markdown-editor}}` inside a Koenig card
- switch to passing markdown into `{{gh-markdown-editor}}`
- move markdown->mobiledoc logic into the `editor` controller
2018-04-20 15:43:44 +01:00
Peter Zimon 92d1454a41 Koenig - Basic styles for editor content (#1006)
refs https://github.com/TryGhost/Ghost/issues/9505
- paragraph and heading styles and vert rhythm
- blockquote and link styles
- list styles
- card styles
- markdown card styles
2018-04-20 15:43:20 +01:00
Kevin Ansfield 351c7adf89 Fixed post autosave for changes to nested objects in mobiledoc
no issue
- fixes a problem that appeared after the first save of a post; refs for nested objects in the `mobiledoc` object didn't change so any time they were updated in the `scratch` object they were also updated in the `mobiledoc` object which broke our dirty attributes tracking
- by creating a deep copy during save we ensure `scratch` and `mobiledoc` are kept separate without causing unnecessary copying (saves occur much less frequently than scratch updates)
2018-04-19 17:29:01 +01:00
Aileen Nowak ec178590f0 Replaced config routeKeyword with hardcoded one (#1004)
refs TryGhost/Ghost#9561

- used the hardcoded routeKeyword for `preview`
- removed `routeKeywords` from mirage configurations API fixtures
2018-04-17 09:52:41 +01:00
Kevin Ansfield 6a9bede003 Fixed multiple 401s caused by token revocation requests
no issue
- disabled Ember Simple Auth's default token revocation
    - we trigger session invalidation on a 401 which means our token isn't valid so the revoke requests will also fail
- renamed application route's `invalidateSession` to `logout` in order to distinguish it from any ESA methods
    - added the token revocation requests to this action, we can be fairly sure at this point that the current tokens will be valid so the requests will succeed
- added check to `ajax.handleResponse` so that we don't invalidate the session for requests to external services
- removed pointless assertion from the ajax integration test
2018-04-16 17:55:21 +01:00
Kevin Ansfield 28509c6bf6 Koenig - First pass at image width styles
refs https://github.com/TryGhost/Ghost/issues/9505
- add image style buttons to the image card context menu
- still requires Spirit styles for image classes to work correctly
2018-04-10 18:39:30 +01:00
Kevin Ansfield 426e5a872d 🐛 Fixed `plaintext` field not being updated when modifying a post
refs https://github.com/TryGhost/Ghost/issues/9512
- if values for auto-generated fields are passed to Ghost via the API then those values will override any auto-generated value and be saved to the database
- add `plaintext` attribute to list of attributes we strip when serialising to avoid the issue until Ghost has appropriate protections in place
2018-04-09 14:58:33 +01:00
Kevin Ansfield 2615e13bf5 Fixed missed `color()` to `color-mod()` rename
closes https://github.com/TryGhost/Ghost/issues/9557
- https://github.com/TryGhost/Ghost-Admin/pull/985's global search&replace missed multiple `color()` calls on the same line
2018-04-09 14:37:48 +01:00
Kevin Ansfield 2c48cd6139
🐛 Fixed `j` and `k` keys not working in editor after visiting Tags screen (#1002)
closes https://github.com/TryGhost/Ghost/issues/9543
- https://github.com/TryGhost/Ghost-Admin/pull/972 moved `keymaster` from Bower to NPM but version 1.6.3 is not published to NPM and it contains fixes for unbinding multiple keys (eg, `'down, j': 'moveDown'`). Switched to fetching directly from github to ensure we have the latest version
- removed the "has registered shortcuts" guard added in https://github.com/TryGhost/Ghost-Admin/pull/976 - it was working around the buggy keymaster version but was also buggy itself because it meant shortcuts could only be registered the first time a route was loaded even though we unregister all of the shortcuts when leaving the route
2018-04-09 13:41:23 +01:00
Kevin Ansfield f0fe23d50b Koenig - Link creation/editing via formatting toolbar
refs https://github.com/TryGhost/Ghost/issues/9505
- wire up the link button in the toolbar to set a `linkRange` property on `{{koenig-editor}}`
- add `{{koenig-link-input}}` that is shown when `{{koenig-editor}}` has a `linkRange` set
    - <kbd>Escape</kbd> will cancel the link input
    - clicking outside the input will cancel the link input
    - previously selected text will be re-selected on cancel
    - if an existing link was selected (or partially selected) then pre-fill the link input with the `href`
    - `X` is shown when there's a href value and clicking will clear the input
    - <kbd>Enter</kbd> *with* a href value will remove all links from text that is touched by the selection and create a new link across only the selected text
    - <kbd>Enter</kbd> *with no* href value will remove all links touched by the selection
- fixed toolbar tick positioning that was 8px off after change to Spirit classes
2018-04-06 17:49:16 +01:00
Kevin Ansfield 7fa52be861 Don't send `created_by` and `updated_by` attrs in API requests
refs https://github.com/TryGhost/Ghost/issues/9548
- refactor serialisers to use `serialize` rather than `serializeToHash` to avoid code duplication
- strip `created_by` and `updated_by` attrs when serializing - Ghost will set these automatically based on the currently logged in user
2018-04-05 11:54:36 +01:00
Kevin Ansfield c338896793 Koenig - Switch card context menu to Spirit classes
refs https://github.com/TryGhost/Ghost/issues/9505
- use Spirit classes for card context menu
- add button and icon class options for context menu items
- add ability to have icon+text for context menu items
- add "Edit" context menu item to markdown and html cards
2018-04-03 18:34:01 +01:00
Kevin Ansfield 19e3af6365 Koenig - Quick-fix for broken styles
no issue
- our custom `.kg-card-selected` and `.kg-media-placeholder` classes were removed in https://github.com/TryGhost/Ghost-Admin/pull/985
- add them back in our 🛎🛎🛎 **shame** file until they make their way into Spirit
2018-04-03 17:28:52 +01:00
Kevin Ansfield 3ec2e87a6c Koenig - Update toolbar to use Spirit classes
refs https://github.com/TryGhost/Ghost/issues/9505
- switch `{{koenig-toolbar}}` to use Spirit classes and icons
- wrap the toolbar `<ul>` in an absolutely positioned `<div>` rather than positioning the toolbar directly to improve animation behaviour
- remove old/unused Koenig SVG icons
2018-04-03 16:52:00 +01:00
CriticalRespawn b96c6b96ee 🐛 Fixed missing default user image on setup screens (#996)
no issue
- changed image location to be assigned to a variable so the asset rewriter recognises it
2018-04-03 11:59:33 +01:00
Kevin Ansfield a28eb92c12
Switch to packaged version of Spirit (#985)
no issue
- remove the manually copied Spirit CSS files
- remove the manually copied Spirit helpers
- install `ember-cli-ghost-spirit` addon
- remove manual postcss configuration
- update all `color()` functions in CSS to `color-mod()`
- fixed invalid `color-mod()` usage in `power-calendar.css`
- bump sub-dependencies
2018-04-03 11:52:18 +01:00
CriticalRespawn 9f46299097 🐛 Fixed missing image and "last seen" date for suspended users (#997)
no issue
- added missing `component` attribute to `{{gh-user-list}}` in suspended users list
2018-04-02 19:19:40 +01:00
Hannah Wolfe a07a262597 Slack -> Forum Take 2
- replacing references to slack with forum
2018-04-02 17:17:13 +01:00
Kevin Ansfield 6103bb430d Fix broken help link
closes https://github.com/TryGhost/Ghost/issues/9536
2018-03-27 21:01:07 +01:00
Kevin Ansfield 1229509033
Fixed authors filter for posts with multiple authors (#993)
no issue
- we need `?filter=authors:foo` to match all posts where `foo` is an author, the previous `?filter=author:foo` will only match posts where `foo` is the primary author
2018-03-27 20:57:59 +01:00
Kevin Ansfield d6169c38ef Fixed publishmenu re-rending side-effects breaking tests
no issue
- we currently rely on a side-effect of the individual publish menu components calling `setSaveType` when they are rendered
- in tests sometimes the timing was not what we expected and the menu would swap components mid-save which then updated the save type and caused further problems
- added a guard so that we never swap the publish menu components whilst a save is in progress
2018-03-27 18:50:52 +01:00
Kevin Ansfield 38b138d759 Use token input to allow selection of multiple authors in PSM
requires https://github.com/TryGhost/Ghost/pull/9426
- fixed default token component display in {{gh-token-input}}
    - if no `tokenComponent` is passed to `{{gh-token-input}}` then it should default to the ember-drag-drop `draggable-object` component but instead it didn't output anything
    - put `draggable-object` in quotes because `{{component}}` needs a component name rather than an object
    - rename `option` attribute to `content` to match the default `{{draggable-object}}` interface
- add embedded `authors` attr to the Post model
    - ensure authors is populated when starting new post
    - add validation for empty authors list
- swap author dropdown for a token input in PSM
- show all post authors in posts list
- update tests for `authors`
  - always provide through an authors array
  - fix mirage serialisation for paginated responses (embedded records were not being serialised)
- unify tags and author inputs design
  - remove highlight of primary tags
  - highlight internal tags
  - remove unnecessary/redundant title attributes on tags
  - use SVG icon for "remove option" button in token inputs
2018-03-27 18:50:52 +01:00
Kevin Ansfield d361aa4b36 Fetch deep-nested embedded relationships
refs https://github.com/TryGhost/Ghost/pull/9426/files
- when using `?include=foo` for a related model that itself normally has embedded relationships we need to add the nested relationship to the `include` param
- eg. `/posts?include=authors,authors.roles`
- this is necessary to ensure we don't introduce partial models into the Ember Data store by missing the embedded relationships on some requests
2018-03-27 18:50:52 +01:00
Austin Burdine 7bd38066f7 Remove ember-invoke-action (#978)
closes TryGhost/Ghost#9477
- remove ember-invoke-action in favor of straight function calls
2018-03-20 14:57:59 +00:00
Kevin Ansfield 5e54b62241
Fixed validator error when saving posts with no code injection footer
no issue
- `validator.js` throws an error if it's `length` method is passed a non-string value
- default to passing an empty string if `post.codeInjectionFoot` is falsy (missed in https://github.com/TryGhost/Ghost-Admin/pull/972)
2018-03-20 11:30:22 +00:00
Kevin Ansfield 6843eb45fc
Prevent keymaster bindings from causing failed tests (#976)
no issue
- keymaster bindings could be kept around between tests with references to objects that should have been deleted. This was manifesting itself with a Tags acceptance test failing because one of the key binding tests triggered two actions, one on the route under test and another on a route that was kept around from a previous Error Handling acceptance test (previous test intentionally had an aborted transition so the action in the current test was complaining about the first transition not being complete)
- add guard to ensure that shortcuts can't be registered multiple times on an object
- remove all `default` scope keymaster bindings when destroying a test app instance
2018-03-19 18:39:17 +00:00
Austin Burdine fd6f2551bb Bower => NPM (#972)
no issue

- Convert validator to an npm dependency
  - clean up validator imports
  - fix validator function imports
  - remove unused validator extensions
- Convert devicejs to an npm dependency
- Convert remaining used bower deps to npm deps
- 🔥 Remove bower & unused bower dependencies
- remove globals imports in favor of direct module imports where possible
2018-03-19 17:56:09 +00:00
Kevin Ansfield cbcf09e4fc Fixed asset rewriting for default user images
no issue
- ember-cli's asset rewriting was not picking up the asset URLs when they were directly embedded in a template string, fix is to ensure the image location is unambiguous by assigning it to a variable first
2018-03-19 15:31:35 +00:00
Kevin Ansfield e648de4e7e ESLint fixes for latest eslint-plugin-ember
no issue
2018-03-19 13:05:02 +00:00