no issue
- upgrade `ember-ajax` to 3.0.0
- `ember-ajax` [now passes the payload through directly](https://github.com/ember-cli/ember-ajax/releases/tag/v3.0.0) rather than trying to normalize it so all our error handling needed to be updated
closes https://github.com/TryGhost/Ghost/issues/8969
Collision detection errors were appearing incorrectly because the save routines in the post settings menu bypass the sequential saves in the main editor controller and so are prone to having stale data if a previous save is still in progress.
- added a new `savePost` task that is part of the `saveTasks` group so that all post saves are sequential
- pass the `savePost` task to the `{{gh-post-settings-menu}}` component
- use `savePost` task in `gh-post-settings-menu` instead of calling `save()` directly on the model instance
closesTryGhost/Ghost#9119, refs TryGhost/Ghost#8483
- Apps - AMP
- Added `leave-settings-modal` component to Settings - Apps - AMP
- Apps - Slack
- Added `leave-settings-modal` component to Settings - Apps - Slack
- Added a `triggerDirtyState` action that will uses a new Array with the input data to trigger the dirty state on the parent settings model
- Apps - Unsplash
- Added `leave-settings-modal` component to Settings - Apps - Unsplash
- Used manual tracking of changes with using a custom `dirtyAttributes` property and a `rollbackValue` to manually rollback the `isActive` attribute on the model
- Code injection
- Added `leave-settings-modal` component to Settings - Code injection
- Design
- Added `leave-settings-modal` component to Settings - Design (only for navigation model)
- Used manual tracking of changes with using a custom `dirtyAttributes`
- Added an additional `updateLabel` action to underlying `gh-navitem` component which gets fired on the `focusOut` event, to detect changes on the label
- Team - User
- Added `leave-settings-modal` component to Team - User
- Used manual tracking of changes with using a custom `dirtyAttributes` to track changes in slug and role properties
closes https://github.com/TryGhost/Ghost/issues/6458
- swap `ember-sortable` for `ember-drag-drop` in navigation UI
- extract PSM tag input into new `{{gh-psm-tags-input}}`
- add new `{{gh-token-input}}` that wraps `ember-power-select` and `ember-drag-drop` to replicate the previous selectize based tags input
- enhance `{{gh-psm-tags-input}}` behaviour to highlight selected primary tag and show "primary/internal" in selected tag titles
- 🔥 remove `selectize`
- 🔥 remove `jquery-ui`
- 🔥 remove unused `{{gh-navigation}}` component
no issue
Automated tools, code generators, and editor integrations are increasingly standardising on the import style used in `ember-modules-codemod`. Our import style differed a little with regards to service/controller injection imports which meant we were starting to see inconsistent naming.
refs TryGhost/Ghost#9150
- added a new validator for password validations that will take care of the rules client side
- Passwort rules added:
- Disallow obviously bad passwords: 1234567890, qwertyuiop, asdfghjkl; and asdfghjklm
- Disallow passwords that contain the words "password" or "ghost"
- Disallow passwords that match the user's email address
- Disallow passwords that match the blog domain or blog title
- Disallow passwords that include 50% or more of the same characters: 'aaaaaaaaaa', '1111111111' and 'ababababab' for example.
- When changing the own password, the old password is not affected by the new validations
- Validation are running on
- setup
- signup
- password change in Team - User (only new passwords are validated)
- passwort reset
refs TryGhost/Ghost#9150
- Increase the password length in validators for signups, pw resets, and password changes for users to 10 instead of 8
- Update tests
no issue
- `controller.content` will no longer be an alias to `controller.model`
- split relationships and `attrs` in Post model, add missing transforms
- fix unknown `error` field in payload warning when `/users/me` returns 404 during tests
- fix unsafe style binding warnings
no issue
- ember/ember-data/ember-cli@2.16
- bump all outdated dependencies that do not require additional work or more extensive tests
- bump sub-dependencies in yarn.lock
- use `broccoli-uglify-sourcemap` (same dep as already used in `ember-cli-uglify`) instead of a separate `broccoli-uglify-js` package for building production codemirror assets
- add `/concat-stats-for` to `.gitignore` so that filesize stats from `CONCAT_STATS=true ember build` don't end up in the repo
refs https://github.com/TryGhost/Ghost/issues/9060
- add `{{gh-psm-template-select}}` component
- allows selection of a custom template for a post if the active theme has custom templates
- loads themes on render, only hitting the server if not already in the store
- disables select if post slug matches a `post-*.hbs` or `page-*.hbs` template
- adds `customTemplate` attr to `Post` model
- adds `templates` attr to `Theme` model with CPs to pull out custom vs post/page override templates
- add `.gh-select.disabled` styles to make disabled selects look visually disabled
no issue
- nested lists can become very cramped in post previews, this matches the top margin of the list to what would normally be used in-between list items
refs https://github.com/TryGhost/Ghost/issues/9001
- show private feed url if private blogging is enabled
- added a `.avoid-break-out` CSS utility class to prevent layout issues caused by non-breaking text such as long links
closesTryGhost/Ghost#8483
- Added a new modal component that gets rendered when leaving general/settings after changes have been done but not saved
- Removed independent saving logic for social URL for consistent UX
closes https://github.com/TryGhost/Ghost/issues/9075
- ensure we re-focus the input element after closing the dropdown so that it's not necessary to click on the search input again after using backspace
- removes unnecessary use of `run.scheduleOnce`
- this was causing the error in TryGhost/Ghost#9075 because search was happening out of sync with the open/close of the dropdown in turn causing `ember-basic-dropdown` to try measuring non-existent elements
- alternative fix would be to wrap each open/close, focus, and search call in separate `run.scheduleOnce('afterRender', ...)` calls
- remove use of `invokeAction`, it's not been necessary in Ember for a while now and we should be calling methods directly where possible for easier debugging
closes https://github.com/TryGhost/Ghost/issues/9074
- remove unused pagination route attrs that were interfering with routing service - these were a pre-1.0 hangover from when the tags screen had infinite scroll
- change `Posts` to `Stories` in the search dropdown for consistency
- add general fix for `adapter returned an array for the primary data of a 'queryRecord' response` deprecations by ensuring that `normalizeResponse` in our application serializer transforms the array we get from the server into a "single" JSON-API response
- this deprecation was being triggered when loading a tag route directly
- fix `defaultValue` complex object deprecations raised from `Setting.unsplash` attr
closes https://github.com/TryGhost/Ghost/issues/9072
- the checks when leaving the editor were detecting that the autosave tasks were running and so forcing an immediate autosave even though the autosave tasks wouldn't do anything
- exit early from autosave tasks if autosave isn't allowed
closesTryGhost/Ghost#8959
- Treated the search input as a literal string rather than `RegExp` to allow characters that need escaping in `RegExp` and disable `RegExp` characterslike `|`.
- Replaced any non-word characters in `highlighted-text` fn with escaped characters, so they're working with `RegExp`.
no issue
We weren't being consistent in our use of Mirage's `normalizedRequestAttrs()` method which meant that in certain cases Mirage's internal database had duplicated attrs, the original set being `camelCase` and the new/updated set being `underscore_case` which was not only confusing but can lead to errors or unexpected behaviour in tests.
- updated Mirage config to always normalize where necessary
- updated tests to always use `camelCase` attrs
- added `HEAD` route handler for gravatar to avoid unknown route noise in tests
closesTryGhost/Ghost#8962
- fix inability to close menu after clicking "more" in mobile quick-nav (credit @nithindavid)
- fix stories list header padding at iPhone 6S sizes
- fix horizontal scroll when menu is open
closes https://github.com/TryGhost/Ghost/issues/8660
- detect a `413` when uploading an import and show the appropriate message
- refactor `{{gh-file-upload}}` to use closure actions
- add test selectors to import errors HTML
- note: doesn't include tests because `{{gh-file-upload}}` doesn't rely on the file input's `change` event (as used by our other uploader components to facilitate testing) and browsers don't allow us to artificially set and submit files
closesTryGhost/Ghost#9028
- add upload/download UI to labs screen
- displays success/failure state in the button for 5 secs after uploading
- minor refactor to remove redundant `{{#if}}` conditionals in general settings screen
- minor naming refactor of `onUploadFail` -> `onUploadFailure` for `{{gh-uploader}}`'s closure action
closes https://github.com/TryGhost/Ghost/issues/9031
- add a default value `unsplash` value to the `setting` model so that Unsplash is activated when the server doesn't return an `unsplash` setting
- update the `unsplash-settings` transform to always deserialize or serialize to `{isActive: true}` when the value is blank or not parsable
- add acceptance regression test covering API not returning an `unplash` setting
- add unit tests for the `unsplash-settings` transform
no issue
- adds a link to the existing stories count in the tags list that when clicked will transition to the stories screen showing all stories with that tag
no issue
- Unsplash integration is enabled by default for all users
- it's no longer necessary to create your own Unsplash application and configure your application ID
closes https://github.com/TryGhost/Ghost/issues/8891
- set the `center` option as well as the `selected` option for `{{power-datepicker}}` inside `{{gh-date-time-picker}}` to force the month view to jump to the correct date when the selection changes
closesTryGhost/Ghost#8996
Fixes a bug, where properties in a nested component where not available and resulted in not rendering the users' profile images and 'last seen' dates on the team page.
no issue
- the upcoming Module Unification re-organisation in Ember will no longer support nested components
- this PR pre-emptively moves our usage of nested components into a flat file structure
closes https://github.com/TryGhost/Ghost/issues/8958
- `markdown-it-named-headers` pulled in `String.js` despite it not being used which added a lot of String.prototype extensions and caused Ember deprecation notices
- moves the short `markdown-it-named-headers` functionality directly into our app code without using `String.js`
No issue
The uservoice wishlist has been pretty inactive and neglected for quite a long time now. Removing links to it from Ghost is the first step toward retiring it. We're still listening to user feedback in order to determine the Ghost roadmap, but simplifying the process around it.
refs TryGhost/Ghost#8896
- PSM code injection editors were suffering from the same issue as the Code Injection screen
- apply the same fix for the PSM editors as was used in #838
refs https://github.com/TryGhost/Ghost/issues/8958
- Ghost OAuth isn't coming back, time for the code to disappear and simply all the things
- fixes the `Usage of router is deprecated` notices that flood the console/test logs when testing
no issue
- align Travis config more closely to default ember-cli setup
- run Chrome in headless mode in CI (Travis + `ember test`, `ember test --server` is "dev" mode)
- install yarn via install script rather than npm
- remove broccoli cache from Travis cache (not sure it ever worked?)
- remove forced node-sass install (no longer needed)
- add `testem` as a top-level dep to force the latest version (ember-data is pinned at 1.15)
no issue
- bumped `ember`, `ember-cli`, `ember-data` and related dependencies
- bumped yarn.lock sub-dependencies
- use new public `router` service in place of the private `-routing` service
no issue
On the apps index screen there were conditionals for each app so that active apps show "Active" instead of "Configure" when they are activated - the conditionals weren't working because the properties they check for weren't available in the template's context.
- add a new `settings/apps/index` controller that imports the `settings` service
- updates template conditionals to check for properties on the `settings` service
closesTryGhost/Ghost#8896
- remove `margin-right: 30px` and forced `overflow: scroll` styles for CodeMirror's "Scroll" element in the code injection editors
refs TryGhost/Ghost#8943
- Tag model has an observer watching the `isNew` and `name` properties so that it can set the `visibility: "internal"` property for new tags based on their name starting with a `#`
- PSM creates tags using `store.createRecord('tag', {name: tagName})` which means that the tag is instantiated with the `isNew` and `name` properties already set (unlike the tags screen where an empty tag is first created before the name is set via UI) - because the properties are there before at instantiation the observer never fires because it's only watching for changes
- adds the `.on('init')` modifier to the `setVisibilityOnNew` observer so that it's run for the watched properties during instantiation as well as on change
no issue
We've seen an issue where after an import a user record had `tour: ""` which meant they were unable to log in due to JSON parsing of the empty string failing.
- add a guard so that an empty string is transformed to `null` before parsing
- changed `serialised` to `serialized` to match spelling in all other serializers
closesTryGhost/Ghost#8764
- when adding a new nav item in the `design` controller, use jQuery to give focus to the name field of the last navigation item
no issue
- the `updateSlug` task never returned a value if there was no change needed, this meant that giving the slug field focus then blurring it again caused the "Save" button to become red with "Retry" text
- always return true from `updateSlug` - this stops the button from showing "Retry" and will instead show "Saved" which is a little less confusing
no issue
- add eslint-plugin-ember, configure no-old-shims rule
- run `eslint --fix` on `app`, `lib`, `mirage`, and `tests` to move imports to the new module imports
- further cleanup of Ember globals usage
- remove event-dispatcher initializer now that `canDispatchToEventManager` is deprecated
closesTryGhost/Ghost#8835
- adds `type="button"` attribute to the file dialog trigger button, the default type for buttons is "submit" which will be triggered by pressing `<enter>` in a form field
refs https://github.com/TryGhost/Ghost/issues/8744
- adjust padding of `.apps-card-meta` at mobile sizes
- adjust title font-size of `.apps-card-title` at mobile sizes
- adjust wrapping behaviour of actions and status badge of invites on team screen
closes TryGhost/Ghost #8876
- Changed arrow styles to enable correct positioning. The sort arrow displayed below the `th` label; this CSS change fixes it.
- Capitalization change: opinionated, but changing capitalization of “Address” to match “Subscription Date”.
no issue
- the `config` injection in `gh-image-uploader` was missing so the Unsplash button was only being displayed for the length of the session after visiting the Unsplash app screen (creates in-memory settings record based on config) or more permanently by saving the Unsplash settings (in which case the image uploader component reads the settings from the DB rather than config)
no issue
- an earlier dependency update resulted in production builds failing due to `cssnano`'s `postcss-merge-idents` dependency failing with a `Maximum call stack size exceeded` error
- bump `cssnano` to the 4.0.0 RC which includes a fix for this issue
- bump other `postcss` dependencies for good measure
closes https://github.com/TryGhost/Ghost/issues/8859, requires https://github.com/TryGhost/Ghost/pull/8895
- adds Unsplash app to app settings
- enable/disable toggle
- validation and testing of Unsplash App ID
- Unsplash App ID field hidden if provided via Ghost config
- adds `fetchPrivate` method to `config` service to pull config that requires authentication and updates authentication routines to fetch private config
- adds Unsplash buttons to editor toolbar and `{{gh-image-uploader}}`
- only present when Unsplash app is enabled
- opens Unsplash image selector when clicked
- `{{gh-image-uploader}}` has a new `allowUnsplash` attribute to control display of the unsplash button on a per-uploader basis
- adds Unsplash image selector (`{{gh-unsplash}}`)
- uses new `unsplash` service to handle API requests and maintain state
- search
- infinite scroll
- zoom image
- insert image
- download image
- adds `{{gh-scroll-trigger}}` that will fire an event when the component is rendered into or enters the visible screen area via scrolling
- updates `ui` service
- adds `isFullscreen` property and updates `gh-editor` so that it gets set/unset when toggling editor fullscreen mode
- adds `hasSideNav` and `isSideNavHidden` properties
- updates `media-queries` service so that it fires an event each time a breakpoint is entered/exited
- removes the need for observers in certain circumstances
no issue
- Atom and other editors have csscomb integrations that will look in the project root for configuration
- if you open Ghost-Admin (or Ghost/core/client) as a project then the custom config will be used which can be more convenient than maintaining a global config
no issue
- a jQuery ajax prefilter was used to add our own `Authorization` header to all requests that go through jQuery
- if a request had a different `Authrorization` header (eg, when accessing an 3rd party API) then the prefilter replaced it breaking the request
- it's no longer necessary because all Ghost API requests go through our `ajax` service which adds the necessary headers
no issue
- moves general UI state control such as menu display, autonav, settings menu, etc into a `ui` service for easier use within components
- no longer required to jump through hoops passing state and actions down from application controller into components
- removes indirect "route" actions in favour of calling actions/methods directly on the `ui` service
closes https://github.com/TryGhost/Ghost/issues/8203
- rename `version-mismatch-test.js` to the more generic `error-handling-test.js`
- add tests to simulate receiving HTML errors (eg, the type of error received from CloudFlare for a gateway timeout)
closesTryGhost/Ghost#8530
- Changed the wording for activation and uploading a theme to separate between error and warnings in the title and the body text for the modal
- Changed the wording of "Activated successful with warnings/errors" to "Activation successful with (warnings || errors)"
- Remove gh-tab* components
- The PSM was the only place where the `gh-tabs-manager`, `gh-tab`, and `gh-tab-pane` components were being used. These were very old components and did not work well with newer Ember versions and best practices.
- 🔥 remove `gh-tab*` components
- 💄 fix indents in `gh-post-settings-menu` template
- 🎨 add support for named subviews ready for additional PSM panes
- Added per-post code injection fields to PSM
- add "Code Injection" pane to the PSM
- implement `codeinjectionHead` and `codeinjectionFoot` attributes on `Post` model and save values from PSM
- use CodeMirror for the PSM code injection fields
refs TryGhost/Ghost#8793
- add `customExcerpt` attr to Post model + reorder attrs to be alphabetical
- add "Excerpt" field to PSM
- add validation for `customExcerpt` length (max 300 chars)
- add style adjustments for custom excerpt UI
closes https://github.com/TryGhost/Ghost/issues/8622 by inadvertent knock-on effect.
People were having trouble with automatically entering password verification in blog title field. This re-orders the form to a more "normal" flow where password field is the last item on the page, so no risk of double-typing it.
no issue
- bump core `ember`, `ember-data` and `ember-cli` related dependencies
- remove deprecated `MODEL_FACTORY_INJECTIONS` flag
- update files to better match `ember-cli new` output for easier diffs during upgrades
no issue
- default component tag of `<div>` forced the download count to appear
on it's own line, setting `tagName: ''` returns the desired inline
behaviour
no issue
- fixes bug where multiple posts were created starting with one char and growing until the new->edit transition completed, e.g. posts with content such as `a`, `ab`, `abcd` were created in quick succession
- moves old `_savePromise` body into the `save` task
- call the `save` task instead of the old `_savePromise` so that concurrency is handled properly
- fixes odd behaviour with the "Are you sure you want to leave?" modal appearing too often - it's now aware of on-going or scheduled saves and will wait for those to complete before transitioning
- move all transition abort/save/retry handling into `toggleLeaveEditorModal` method
- check for a running save, wait for it to finish then retry the transition
- check for a scheduled autosave, cancel it if present and perform an immediate autosave then retry the transition
- don't attempt new->edit transition on successful save of new post if we're already waiting for a different transition
- once the new->edit transition has completed, if the post body content has changed schedule an autosave manually so that the user doesn't need to type something again to save what they assume is already saved
- remove debounced slug generation/save on type of title field in favour of generation and save on focus out which plays a lot nicer with the new transition autosave behaviour
refs TryGhost/Ghost#8723
- #795 contained a regression where the body focus was lost during the new->edit transition because at that point `model.isNew` is false
- returns `shouldFocusEditor` code that was removed in #768 (it was assumed the body should _always_ have focus in that PR)
- instant-save if body is edited and the post is new - fixes issue where you could keep typing without any save when body had autofocus
- don't show preview link for new posts - fixes issue where it links directly to the admin endpoint so it would force a refresh
closes https://github.com/TryGhost/Ghost/issues/8729, closes https://github.com/TryGhost/Ghost/issues/8728
- remove the duplicated `max-height` rules for different parts of the power select dropdowns - they were interacting with each other and causing a large part of the lists to be unreachable
- bump the `bufferSize` so that enough dropdown items are rendered to fill the dropdown list
- filter the temporary tags that are created when using the PSM tags input so duplicates aren't visible in the tags dropdown filter