closes https://github.com/TryGhost/Ghost/issues/9373
- using an `<a>` element to parse a URL does not behave as expected when the URL has special characters because the `host` attribute will show the Puny URL version. Eg. `exämple.com` will become `xn--exmple-cua.com`
- `{{gh-navitem-url-input}}` was failing to manipulate the URL value because of the difference between the Puny URL encoded URL and the raw configured URL with unicode chars
- uses the `URI` module that's bundled with the imported version of `google-caja` to parse the URL via regexes rather than relying on native browser parsing
refs https://github.com/TryGhost/Ghost/issues/8805
- `{{vertical-collection}}` causes async issues and random failures in our tests
- we can't upgrade to the latest version which includes a test wait helper because it's buggy in Firefox
- skip the tests for now
closes https://github.com/TryGhost/Ghost/issues/9160
- simplified FB validation to allow any valid FB url (autocomplete of raw usernames and facebook-like URLs is still in place)
- fixed a bug with sticky Twitter validation message, if you entered an invalid URL then changed it to an invalid username you still saw the invalid URL message (surfaced through new test helpers for validating facebook/twitter fields)
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
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
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
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
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
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#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
- 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
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
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
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
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
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.
closesTryGhost/Ghost#8696
- Changes the `gh-save-button` component to allow a custom `runningText` which would be rendered in the button when the current task is running.
- Adds a `runningText` CP to `gh-publishmenu` component, which will render (depending of post status and desired save type) 'Unpublishing', 'Publishing', 'Scheduling', 'Updating', 'Unpublishing', 'Rescheduling', and 'Unscheduling'.
no issue
With GScan sending error details now, the modal was a bit overloaded.
This PR adds a toggle for each error rule which - when clicked - shows the details and the affected files.
refs TryGhost/Ghost#8525
- fix `saveTitle` action
- don't abort title save when we have an empty title
- force a "dirty" state so that the save actually happens
- add acceptance test for title blur behaviour
- extract multiple instances `"(Untitled)"` into a const
refs https://github.com/TryGhost/Ghost/issues/8616
- only refresh tokens on boot if we last refreshed more than 24hrs ago - this should prevent rapidly changing access/refresh tokens when opening new admin tabs or refreshing whilst other tabs are open
- fix token refresh test which was testing it's own behaviour instead of the applications 🙈
This may not be the full solution to the session issues but it closes one potential culprit and should at least reduce token churn which can only help track down the real cause.
closes https://github.com/TryGhost/Ghost/issues/8540
- use `{{vertical-collection}}` in the tags dropdown filter list, opening the dropdown is now virtually instant as it's not attempting to immediately render components for every tag in the list
- remove pagination/infinite scroll from tags screen
- load all tags when accessing the tags screen
- will pause to show spinner if no tags have previously been loaded
- if tags exist in the ember data store, show the list immediately and load/update list in the background
- use `{{vertical-collection}}` to render enough tags to fill the scrollable area with a small buffer and use occlusion and element re-use to swap tags in whilst scrolling (suuuuper fast no matter number of tags loaded)
- scroll tags into view when they are selected (keyboard nav now makes a lot more sense)
- tested with 875 tags and 2x/5x CPU throttling with no major slowdowns 🎉
refs TryGhost/Ghost#8530
This PR takes care that the modals for theme activation gets the same treatment as theme upload modal:
- differentiate between normal and fatal errors
- list headings for each error type (fatal, normal or warning)
- update test
closesTryGhost/Ghost#8222
- there are fatal and normal errors
- fatal === can't activate a theme
- the normal errors are only returned in development mode (!)
- Separate between `fatal` and normal errors and group them
refs https://github.com/TryGhost/Ghost/issues/8464
- fix padding on user actions button
- match user screen heading to other screens
- match app screen headers to other screens, update form styles
- change header link colour to match non-link colour
- fix team acceptance test
- fix canvas top padding so header elements always align
- reduce header font size
no issue
- adds `eslint-plugin-sort-imports-es6-autofix` dependency
- implements ESLint's base `sort-imports` rule but has a distinction in that `import {foo} from 'bar';` is considered `multiple` rather than `single`
- fixes ESLint's autofix behaviour so `eslint --fix` will actually fix the sort order
- updates all unordered import rules by using `eslint --fix`
With the increased number of `import` statements since Ember+ecosystem started moving towards es6 modules I've found it frustrating at times trying to search through randomly ordered import statements. Recently I've been sorting imports manually when I've added new code or touched old code so I thought I'd add an ESLint rule to codify it.
refs TryGhost/Ghost#8455
- ensure `uploadUrls` and `errors` are cleared in `gh-uploader` when new uploads are started
- yield `isUploading` in `gh-uploader` component
- replace image upload modals in settings/general with in-page uploads
closesTryGhost/Ghost#8443
- Fixes a bug where the keyboard shortcut `cmd+s` would cause a `Maximum call stack size` error and not save.
- Wherever there is a `save` button, the keyboard shortcut to save works now.
closesTryGhost/Ghost#7134
Overhaul of the user settings page to make it more consistent with other settings panels.
The hardly readable validation for user "Full Name" is redundant as well, as the input field for it now has the same styles as the other input fields.