Commit Graph

64 Commits

Author SHA1 Message Date
Fabien O'Carroll 81bf6a1f44 Fixed sanitization of user invited emails for notification message (#1060) (1.x backport)
no issue

- Escaped email ids string sent to notification message during blog setup

Credits: Antony Garand
2018-11-06 10:43:55 +00:00
Kevin Ansfield 87bbf924a4 Remove more `import Ember` via module imports
refs https://github.com/TryGhost/Ghost/issues/8927
- removes usage of `Ember.testing`
- removes usage of `Ember.uuid`
- removes usage of `Ember.Debug.registerWarnHandler`
2018-05-03 17:52:39 +01: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 ac16e6504c ESLint: Consistent ember property/method ordering
no issue
- https://github.com/ember-cli/eslint-plugin-ember/blob/master/docs/rules/order-in-components.md
- https://github.com/ember-cli/eslint-plugin-ember/blob/master/docs/rules/order-in-controllers.md
- https://github.com/ember-cli/eslint-plugin-ember/blob/master/docs/rules/order-in-routes.md
2018-01-12 12:17:56 +00:00
Kevin Ansfield 050f4d99b6 ESLint: Alias model in controllers
no issue
- https://github.com/ember-cli/eslint-plugin-ember/blob/HEAD/docs/rules/alias-model-in-controller.md
- replace `model` with a meaningful property name everywhere possible
- refactor `design` and `general` settings controllers to use a directly injected settings service rather than passing it in as a "model" to be more explicit
2018-01-12 12:17:56 +00:00
Kevin Ansfield 7afb88a0c2 Switch to eslint-plugin-ghost extending plugin:ghost/ember
no issue
- fix lint errors in lib/gh-koenig
- fix ghost:base eslint errors
- update ember plugin refs, remove ember-suave plugin refs
- remove old jshint refs
- add `lint:js` script
- switch to `eslint-plugin-ghost` extending `plugin:ghost/ember`
2018-01-12 12:17:56 +00:00
Kevin Ansfield ddc7b857b5
Bump ember-ajax dependency (#902)
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
2017-11-03 22:59:39 +00:00
Kevin Ansfield 238983a5df Match service/controller import to ember-modules-codemod style for consistency
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.
2017-10-30 09:38:01 +00:00
Kevin Ansfield d4faa15f46 Upgrade eslint dependencies (#855)
no issue

- bump ember-cli-eslint and eslint-plugin-ember
- fix indentation & "unnecessary escape chars" lint errors
2017-09-11 14:56:11 +07:00
Kevin Ansfield 6cb04e4c41 Removed defunct Ghost OAuth code (#848)
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
2017-09-04 21:17:04 +02:00
Kevin Ansfield 88449ed639 Switched from ember-cli-shims to new module imports (#779)
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
2017-08-22 14:53:26 +07:00
Kevin Ansfield 852b9eec05 Remove usage of jquery-file-upload (#815)
closes https://github.com/TryGhost/Ghost/issues/6661
- refactor `gh-profile-image` component to use native browser functionality
- remove `jquery-file-upload` bower dependency
2017-08-18 10:27:42 +07:00
Kevin Ansfield 1e3191b811 Unsplash integration
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
2017-08-15 16:01:12 +01:00
Kevin Ansfield 6113b1a743 🐛 fix guard for inviting owner in setup/three (#786)
refs https://github.com/TryGhost/Ghost/issues/8692

- fixes the guard on setup/three against inviting the owner user set up
on setup/two (we were sending invites for every e-mail in the list
rather than only valid e-mails)
- adds a check to see if we get any invalid errors from the server and
will show those separately to the `x emails failed to send` alert
2017-07-20 12:08:34 +02:00
Kevin Ansfield 7e5317ba0b 📖 update all support.ghost.org links to docs/help.ghost.org (#740)
no issue
- support.ghost.org has gone away, we now have self-host/dev
documentation on https://docs.ghost.org and user documentation at
https://help.ghost.org
2017-06-15 18:19:12 +01:00
Kevin Ansfield 7eefbba69f 💄🐷 sort-imports eslint rule (#712)
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.
2017-05-29 20:50:03 +02:00
Katharina Irrgang 7169a14568 🔥 Adapt image property changes (#661)
refs https://github.com/TryGhost/Ghost/issues/8348, requires https://github.com/TryGhost/Ghost/pull/8364
- rename all image properties
- e.g. author.image --> author.profile_image
- test all image functionality
2017-04-24 18:22:39 +01:00
Kevin Ansfield 0d385df8b2 🐛 fix setup/signup avatar uploads (#667)
closes https://github.com/TryGhost/Ghost/issues/8375

- `jQuery.ajax` has removed the `.success` and `.error` methods, replacing them with `.done` and `.fail`
2017-04-24 11:28:30 +02:00
Kevin Ansfield c1a9726f1b 💄 refactor setup screens to use ember-concurrency (#644)
refs TryGhost/Ghost#7865

💄 refactor signup to use ember-concurrency

refs https://github.com/TryGhost/Ghost/issues/7865
- moves authentication actions from `signup` route to controller
- refactors authentication and signup logic into EC tasks
- replaces use of `gh-spin-button` with `gh-task-button` in signup template

💄 refactor setup screens to use ember-concurrency

refs https://github.com/TryGhost/Ghost/issues/7865
- moves authentication actions from `setup/two` route to controller
- refactors authentication and setup logic into EC tasks
- replaces use of `gh-spin-button` with `gh-task-button`
- fixes some styling issues with the new SVG icons
- adds `app/styles/patterns/icons.css` back to contain per-icon overrides and animations (some SVGs use fills and others use strokes so we sometimes have conflicting styles)
2017-04-19 12:27:32 +02:00
Kevin Ansfield 2f56152dbf 🎨 synchronous settings service
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
2017-03-20 07:43:49 -05:00
Kevin Ansfield 503e8d8263 Update styles for content screen, buttons, and app frame
* Updates styling on content management screen, replaces button styles, tweaks application frame style
2017-02-16 19:50:05 +00:00
Kevin Ansfield 4a604ce64f Update code to match eslint rules
no issue
- switch `jscs` and `jshint` inline config to `eslint` config
- fix eslint errors, predominantly in tests where the config now the main app config more closely
2016-11-14 13:26:00 +00:00
Kevin Ansfield 03096936f5 deps: ember@2.8.2 2016-10-07 17:32:30 +01:00
Kevin Ansfield 0a163d7333 Ghost.org OAuth support (#278)
issue TryGhost/Ghost#7452, requires TryGhost/Ghost#7451
- use a `ghostOAuth` config flag to switch between the old-style per-install auth and centralized OAuth auth based on config provided by the server
- add OAuth flows for:
  - setup
  - sign-in
  - sign-up
  - re-authenticate
- add custom `oauth-ghost` authenticator to support our custom data structure
- add test helpers to stub successful/failed oauth authentication
- hide change password form if using OAuth (temporary - a way to change password via oauth provider will be added later)
2016-09-30 13:43:40 +02:00
Kevin Ansfield 5913827646 Separate invites and users (#277)
closes https://github.com/TryGhost/Ghost/issues/7420, requires https://github.com/TryGhost/Ghost/pull/7422
- adds a new `Invite` model with associated serializer and test setup
- updates team screen to use invites rather than existing users with the "invited" property
- updates signup process to work with new invite model
- updates setup process to create invites instead of users
- swaps usage of `gh-select-native` for `one-way-select` in the invite modal so that attributes can be set on the `select` element
- updates resend invite process to account for server returning a new model
- rewrites the invite management tests and fixes mirage mocks for invite endpoints
- sorts invites by email address to avoid jumping invites when re-sending
2016-09-26 18:03:53 +02:00
Kevin Ansfield 1797a6c066 deps: ember-ajax@2.5.1 (#282)
no issue
- update ember-ajax to 2.5.1
- replace custom error checking in setup/two with ember-ajax's `isInvalidError`
- update error normalisation and associated parsing tests to ensure all error types result in the same object structure
2016-09-26 08:07:18 -05:00
Austin Burdine 1fd879343f more shimming of controllers (#110)
refs #101, #95
- shim controllers that were missed initially
2016-07-06 20:47:30 +01:00
Austin Burdine ed2c5f328d deps: grunt-jscs,ember-suave@3.0.0
replaces #41, #60
- update ember-suave and grunt-jscs to 3.0
- standardize Ember global de-structuring rules across app & tests
2016-06-11 13:39:31 -06:00
Kevin Ansfield 604fda4348 Update package.json details, rename module to `ghost-admin`
no issue
- updates `package.json` details to better reflect the separation from the `Ghost` package
- update ember config and all import statements to reflect the new `ghost-admin` module name in `package.json`
2016-06-03 16:12:54 +01:00
Austin Burdine b2c91dd3be cleanup usage of Ember.inject 2016-01-19 07:03:27 -06:00
Austin Burdine e24e85d94a deps: ember-ajax@0.7.1 2016-01-18 09:37:14 -06:00
Kevin Ansfield 97bb577496 Refactor modals
refs #5798, closes #5018
- adds new `gh-fullscreen-modal` component - modals are now specified in-context so that they can have deeper interaction with their surrounding components/controller/route, i.e. a modal component can be a thin confirm/deny wrapper over the underlying controller action keeping all context-sensitive logic in one place
- adds spin-buttons to all modals with async behaviour
- adds/improves behaviour of inline-validation in modals
- improves re-authenticate modal to properly handle validation and authentication errors
2016-01-12 20:53:08 +00:00
Kevin Ansfield ef0be5024b Transition after setup step 3 submission even if invite takes a long time
refs #5779
- adds a timeout of 4 seconds to step 3 submission so that we transition even if we haven't heard back from the server yet. Notification alerts will be displayed asynchronously once all server requests have returned.
- adds a message to check e-mail configuration to step 3 invitation failure alert
2016-01-08 17:06:41 +00:00
Austin Burdine 9b8a149bdc fix authentication error if setup/two is re-submitted
closes #6226
- adds calls to oauth middleware on PUT /authentication/setup/
- prevent setup/two from trying to log in again if user is already logged in
2015-12-18 12:18:13 -07:00
Kevin Ansfield 7ce3726589 Use es6 across client and add ember-suave to enforce rules
no issue
- add ember-suave dependency
- upgrade grunt-jscs dependency
- add a new .jscsrc for the client's tests directory that extends from client's base .jscsrc
- separate client tests in Gruntfile jscs task so they pick up the test's .jscsrc
- standardize es6 usage across client
2015-11-30 10:41:01 +00:00
Kevin Ansfield 21fc4662ff Display error message on setup if origin doesn't match config.js url
refs #6106
- add error handler for authentication step of blog setup
- move setup acceptance test out of 'settings' folder
2015-11-26 11:22:16 +00:00
Nazar Gargol 3d6f4d15ba Adds debounced email validation and gravatar loading on second setup/signup screen
closes #5797
- adds debounced email validation as user types
- adds debounced gravatar loading for valid email
2015-10-28 09:40:40 +00:00
Austin Burdine 031a129f0b deps: ember-simple-auth@1.0.0
closes #5951
- update to esa 1.0
2015-10-18 13:17:02 -05:00
Kevin Ansfield 55840eb57f Avoid duplicate alerts, clear alerts on successful retry or sign-in
closes #5903, refs #5409
- switch alert/notification component tests from unit to integration where appropriate
- rename `notifications.closeAll` to `notifications.clearAll` to better represent it's behaviour
- add concept of a "key" to alerts/notifications and ability to close only specified keys through notifications service
- close duplicate alerts/notifications before showing a new one
- specify a key for all existing alerts
- close failure alerts on successful retries
- clear all currently displayed alerts on successful sign-in
2015-10-12 19:21:30 +01:00
Kevin Ansfield fbb92476f0 Ember-cli, Ember, & Ember Data 1.13.x upgrades
closes #5630
- upgrade ember-cli to latest version
- upgrade ember to latest 1.13.x release
- upgrade ember data to latest 1.13.x release
    - update custom adapters and serialisers for new internal JSON-API compatible formats [(docs)][1]
    - update all store queries to use new standardised query methods [(docs)][2]
    - add ember-data-filter addon ready for store.filter removal in ember-data 2.0 [(docs)][3]
- remove use of prototype extensions for computed properties and observers
- consolidate pagination into a single route mixin and simplify configuration

[1]: http://emberjs.com/blog/2015/06/18/ember-data-1-13-released.html#toc_transition-to-the-new-jsonserializer-and-restserializer-apis
[2]: http://emberjs.com/blog/2015/06/18/ember-data-1-13-released.html#toc_simplified-find-methods
[3]: http://emberjs.com/blog/2015/06/18/ember-data-1-13-released.html#toc_ds-store-filter-moved-to-an-addon
2015-10-06 16:09:05 +01:00
Hannah Wolfe f9e6bf9835 Form field icons load in default 'grey' state
ref #5652

- validations can be in default, success or error state
- adds check for 'hasValidated' if the validations haven't fired yet, the field is in the default state
- hasValidated is an Ember.Array which tracks the state for each field
2015-09-01 13:02:27 +01:00
cobbspur 24179cf9a8 No validations on setup for empty fields
refs #5652

 - new action on focusOut which only calls validate if the fields has a value
2015-08-28 18:55:37 +01:00
Hannah Wolfe d5dece86cb Merge pull request #5754 from cobbspur/flowstep3
Prevent setup loop on step 3
2015-08-28 17:38:23 +01:00
Kevin Ansfield ac2caa34df Fix auth token refresh failing on app-boot with expired access_token
issue #5751
- moves `makeRequest` override of simple-auth's OAuth authenticator into our own custom authenticator (previously our override was not taking effect until after ember-simple-auth's initial authentication routines, hence why it was working for post-login token refreshes but failing on app-boot)
2015-08-28 16:00:34 +01:00
cobbspur 8a0bb1707f Prevent setup loop on step 3
closes #5747

- change transition event to regardless of user invite success/failure
2015-08-28 12:35:40 +01:00
cobbspur 0e42258319 Fix wording for failed invitations alert
refs #5652

- Use conditional string for single/plural failed invitations
2015-08-27 18:17:13 +01:00
Kevin Ansfield 34ae2f8c99 Fix invite user validation issues in signup
refs #5652
- wrap emails input in `{{gh-form-group}}` component to give element success/error classes
- pull validation messages into submit button
- clean up validation related aspects of step three controller
2015-08-27 14:05:52 +01:00
Hannah Wolfe 7bc3462200 Don't clear password field until setup is complete
ref #5652

- resolves issues with setup flow for the time being
- password is cleared on deactivate, rather than during step 2
- using transitionToRoute instead of transitionTo to remove deprecation warning
2015-08-25 13:16:39 +01:00
cobbspur 1549f6dc69 Fix errors for setup and signup
refs #5635

- adds enter action to signup fields
- adds validation text errors
2015-08-10 22:24:10 +01:00
Austin Burdine 3c0bd3e8b2 add spin-button component & implement it
closes #3928
- adds spin-button component & styles
- implements spin-button in places where buttons trigger async tasks
2015-08-10 09:43:50 -06:00