Commit Graph

188 Commits

Author SHA1 Message Date
Kevin Ansfield 1f36c94109 deps: ember-light-table@1.4.2 (#307)
no issue

- update `ember-light-table` to 1.4.2
- remove `gh-light-table` override component as scrolling has been fixed
- disable the infinite scroll acceptance test for now because Chrome has issues detecting the position of the scroll trigger when the app is rendered into the zoomed container during testing
2016-10-07 13:58:53 +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 87e1c5afa5 use ember-ajax in place of ember-data's networking (#283)
closes #7014
- uses the `AjaxServiceSupport` mixin from `ember-ajax` to replace Ember Data's internal `ajax` method with our own ajax service
- normalizes all error handling to use `ember-ajax` style errors
- default to the `application/vnd.api+json` content-type so that we don't have a mix of urlencoded and plain JSON content
- fix `normalizeErrorResponse` in our `ajax` service so that it doesn't add an empty `errors` array to payloads
2016-09-26 11:59:04 -05:00
Kevin Ansfield 3afc43e2d2 replace gh-select-native with one-way-select (#286)
no issue
- removes `gh-select-native` component as ember-one-way-control's `one-way-select` component offers the same one-way-binding but also allows element attributes to be set
2016-09-26 11:39:43 -05: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
Ryan McCarvill c34e0161ff Mobile-Doc based editor (#291)
refs TryGhost/Ghost#7429, requires TryGhost/Ghost#7437

Added Ghost-Editor (based on mobiled doc).
-------------------
- Added mobiledoc editor
- Fixed problems with workflow and auto saves
- Integrated basic toolbar
- Removed all editor related tests, everything bar the most basic acceptance tests will be in the ghost-editor repository.
- Commented out tests which relied on Ember Helpers that are not compatable with mobile-doc, workarounds are inbound shortly.

This is the first integration of ghost-editor. It's styled enough to work, however it is not anywhere approaching something that looks remotely like what the finished thing will be.

Early ALPHA, development build. Tread cautiously.
2016-09-26 15:04:20 +02:00
Kenneth Ashley 54e41b2f78 Safari doesn't show dragged-over state for file uploads (#288)
closes TryGhost/Ghost#7310
- Removes double dashes from modifier classes as safari won’t allow this.
2016-09-24 11:10:08 +02:00
Kevin Ansfield 1ee787ed42 display warnings after theme upload (#262)
refs TryGhost/Ghost#7362, requires TryGhost/Ghost#7367
- display any gscan warnings we get back from a successful upload to cater for the downgrade of missing `{{asset}}` helpers from an error to a warning
2016-09-14 18:34:07 +01:00
Austin Burdine a13502972c remove mime-type validations in favor of extension validation (#256)
refs TryGhost/Ghost#7292
- remove accept mime type validations
- validate on file extension only
- fix tests
2016-09-14 09:54:16 +01:00
Kevin Ansfield 195bca322a 🐛 fix duplicate server alerts + default alert bg color (#242)
closes https://github.com/TryGhost/Ghost/issues/7305

The `location` property of server-side notifications was being ignored by the client and so wasn't being used to de-duplicate alerts.

- adds `key` attribute to `Notification` model
- adds a serializer for notifications that renames the `location` key sent by the server to `key`
- set the default background color of alerts to white so that alerts with no `type` set do not inherit the background color (useful in Ghost Desktop which has a transparent background color set)
2016-09-01 11:01:54 -05:00
Kevin Ansfield a9f17cbfb6 detailed theme validation errors (#226)
no issue
- display the detailed validation errors that we get back from gscan so that users know how to fix their themes
2016-08-24 20:22:20 +02:00
Kevin Ansfield e543392137 🐛 fix highlighted number of posts when deleting a user (#144)
closes https://github.com/TryGhost/Ghost/issues/7136
- pass user into the modal when displaying
- fix the user->model alias in the modal component
- update mirage user endpoints to respect `?include=count.posts` param
2016-08-24 07:26:29 -06:00
Kevin Ansfield eb0db3fafe indicate folder names to tell duplicate themes apart
refs https://github.com/TryGhost/Ghost-Admin/pull/210
- removes unused `activeTheme` property on `gh-theme-table`
- updates label generation in `gh-theme-table` to add folder names when there are duplicate package.json name+version combos
2016-08-23 16:55:32 +01:00
Kevin Ansfield 69c51940af add final theme management acceptance tests
refs https://github.com/TryGhost/Ghost-Admin/pull/210
- adds missing acceptance tests for theme deletion
- adds theme deletion endpoint to mirage config
- fixes mirage settings update endpoint (was previously removing config that the client didn't send and also losing the `type` key for all entries preventing the `GET` request from working properly)
2016-08-23 15:27:46 +01:00
Kevin Ansfield 5581c6ba5a theme management UI
refs https://github.com/TryGhost/Ghost/issues/7204, requires https://github.com/TryGhost/Ghost/pull/7209

- replaces theme dropdown with a table
- adds theme upload modal
    - validates theme mime type
    - prevents upload of `casper.zip` (default Casper theme can't be overwritten)
    - warns if an upload will overwrite an existing theme
    - gives option of immediately activating the uploaded theme or closing after successful upload
- adds theme activation link/action
- adds theme download link/action
- adds theme deletion modal
    - warns about no undo possibility
    - offers possibility to download theme
- modifies mirage config to handle theme changes
2016-08-23 12:42:38 +01:00
Kevin Ansfield 5735b98a4c add fileSelected action to upload components
no issue
- upload components will now trigger a passed-in `fileSelected` action upon file selection - useful when users of the components want to utilise the file object without supplying a custom validation action
2016-08-23 12:32:11 +01:00
Kevin Ansfield 4d59fdb8fb validate file uploads against "accept" mime-type before uploading (#214)
closes https://github.com/TryGhost/Ghost/issues/7144
- allow the `accept` attr of `gh-file-uploader` and `gh-image-uploader` to be specified
- allows a `validate` action to be passed into `gh-image-uploader` and `gh-file-uploader` components that runs after a file is selected and before the upload starts
- adds a default `validate` action to `gh-image-uploader` and `gh-file-uploader` that triggers the normal `UnsupportedFileType` error when the selected file's mime-type does not match the `accept` attribute
- adds mime type validation to labs importer (basic implementation, should be replaced with uploader components once they have been refactored)
2016-08-22 05:45:33 -06:00
Austin Burdine e772430bd6 Introducing Concurrency (#147)
* deps: ember-concurrency@0.7.8

* initial conversion of post & user actions to e-concurrency tasks

- add task button which handles auto-spinning of e-concurrency tasks
- fix tests
2016-08-11 07:58:38 +01:00
Austin Burdine fbafb754ed remove test-loader asset from test html file (#188) 2016-08-07 08:29:37 +02:00
Austin Burdine a3a00bfd34 fix cross-browser support (#164)
closes https://github.com/TryGhost/Ghost/issues/7149
- fix tests in Safari
- fix template tag issue in IE and edge
- various IE css fixes
2016-08-06 09:04:06 +02:00
Greenkeeper 51af60af93 Update ember-cli to version 2.7.0 🚀 (#148)
* chore(package): update ember-cli to version 2.7.0

https://greenkeeper.io/

* update app from ember-cli blueprint

* deps: ember-cli-test-loader@1.1.0
2016-07-31 20:47:19 +01:00
Kevin Ansfield 96f2d4088f Handle automatic timezone override
refs https://github.com/TryGhost/Ghost/pull/7142, https://github.com/TryGhost/Ghost/pull/7143
- moves timezone selection template and logic into a component
- detect if the current `activeTimezone` is not in our pre-defined list of timezones, if it isn't:
  - add a line indicating that there has been an override with the current `activeTimezone` value
  - add a blank option to the timezone select list
2016-07-26 11:50:24 +01:00
Austin Burdine 7fc02c1007 fix image uploader text handling (again) (#140)
closes TryGhost/Ghost#7127
- image uploader now handles "text" and "alt text" differently
2016-07-24 10:19:49 +01:00
Kevin Ansfield 198b7e9517 Fix blank signup screen (#135)
closes https://github.com/TryGhost/Ghost/issues/7117
- adds guard to `sanitizeInput` method of `gh-trim-focus-input` for null/undefined values
- adds acceptance test for successful signup screen flow
- removes unneeded validation/update handling for a non-editable email field
- adds "At least 8 characters" placeholder to password field
- fixes enter key not submitting the form when name or password field has focus
2016-07-22 07:36:50 -06:00
Austin Burdine 4beb52f713 ensure validation errors are shown on post save (#136)
closes TryGhost/Ghost#7120
- fix error handling in editor-base-controller
- adds failing test fixed by this change
2016-07-22 10:14:32 +01:00
Kevin Ansfield ab14b78282 Fix editor error handling (#128)
closes https://github.com/TryGhost/Ghost/issues/7099
- update editor base controller's `showErrorAlert` method to handle `AdapterError` or `AjaxError` objects
- update PSM's error handling so that we don't pass an error object wrapped in an array to `showAPIError`
- add missing title attribute to Mirage's Post factory
- remove some leftover `console.log`s
2016-07-18 17:23:43 -06:00
Vijay Kandy 96f1b6342d Added upgrade notification component to About page. (#102)
- Picked some fixes https://github.com/TryGhost/Ghost/pull/5670/files
- Destructured Ember properties
- Removed unused imports and fixed unit test errors.
2016-07-15 16:58:35 -06:00
Austin Burdine a82181fdd6 fix image component displaying alt text in uploader (#105)
closes TryGhost/Ghost#7064
- pull alt text from parsed markdown
- move text to image uploader component proper
2016-07-14 13:27:18 +01:00
Kevin Ansfield 690dc9dffb Refactor error handling
closes https://github.com/TryGhost/Ghost/issues/6974
- update "change password" fields/process to use inline validations
- remove `notifications.showErrors` and update all uses of it to `showAPIError`
- display multiple API errors as alerts rather than toaster notifications
- refactor `notifications.showAPIError`
  - remove `notifications.showErrors`, use a loop in `showAPIError` instead
  - properly determine the message from `AjaxError` or `AdapterError` objects
  - determine a unique key if possible so that we don't lose multiple different alerts
- add `ServerUnreachable` error for when we get a status code of 0 (eg, when the ghost service has been shut down)
- simplify error messages for our custom ajax errors
2016-07-08 15:16:54 +01:00
Kevin Ansfield e4c0aaf7b9 "400 Version Mismatch" error handling
refs https://github.com/TryGhost/Ghost/issues/6949

Handle version mismatch errors by:
- displaying an alert asking the user to copy any data and refresh
- disabling navigation so that unsaved data is not accidentally lost

Detailed changes:
- add `error` action to application route for global route-based error handling
- remove 404-handler mixin, move logic into app route error handler
- update `.catch` in validation-engine so that promises are rejected with the
  original error objects
- add `VersionMismatchError` and `isVersionMismatchError` to ajax service
- add `upgrade-status` service
  - has a method to trigger the alert and toggle the "upgrade required" mode
  - is injected into all routes by default so that it can be checked before
    transitioning
- add `Route` override
  - updates the `willTransition` hook to check the `upgrade-status` service
    and abort the transition if we're in "upgrade required" mode
- update notifications `showAPIError` method to handle version mismatch errors
- update any areas where we were catching ajax errors manually so that the
  version mismatch error handling is obeyed
- fix redirect tests in editor acceptance test
- fix mirage's handling of 404s for unknown posts in get post requests
- adjust alert z-index to to appear above modal backgrounds
2016-07-08 14:56:26 +01:00
Austin Burdine 666a3e7f1a lazy-load codemirror on code injection screen (#99)
refs TryGhost/Ghost#6149
- concats codemirror.js and css on build, keeping them out of vendor.js
- add lazy-loader service to enable loading of external scripts
2016-07-05 17:30:14 +01:00
Kevin Ansfield 078f85ef76 Revert to ember-wormhole@0.3.6 (#108)
closes https://github.com/TryGhost/Ghost/issues/7073
- reverts `ember-wormhole` to 0.3.6
- adds working test that was broken under `ember-wormhole` 0.4.0
2016-07-05 08:29:05 -06:00
Austin Burdine a9ce94de9f convert ember imports to ember-cli-shim imports where possible (#95) 2016-06-30 11:21:47 +01:00
Kevin Ansfield 9fd82f06da Fix un-bound HTML attributes for `gh-trim-focus-input`
no issue
- updates `gh-trim-focus-input` to extend from `gh-input`/`one-way-input` to get the auto-binding attribute behaviour for passed-in HTML attributes
- renames `focus` property to `shouldFocus` so that we're not overriding default DOM functions
- fixes signin page issues with missing placeholders and no autofocus
2016-06-20 15:20:25 +01:00
Austin Burdine c1367dac34 convert inputs to one-way inputs
no issue
- moves all inputs to use the data-down-actions-up component paradigm
2016-06-18 07:44:23 -04:00
Aileen Nowak dd8d3507f0 Renaming date properties to contain `UTC`
closes TryGhost/Ghost#6985

- renames all date properties to end with `UTC`:
	- `publishedAt` in `post` model
	- `createdAt` in `post`, `role`, `subscriber`, `tag` and `user` model
	- `updatedAt` in `post`, `role`, `subscriber`, `tag` and `user` model
	- `unsubscribedAt` in `subscriber` model
	- `lastLogin` in `user` model
- adds `attrs` transforms in matching serializers `post`, `tag` and `user`
- new serializers files for `subscribers` and `role` to add `attr` transforms
- adds unit tests for all serializers
- use two variables in `post-settings-menu` controller to handle blog-timezone adjusted date as well as UTC date
2016-06-17 11:09:21 +02:00
Aileen Nowak 6ce7e14fd7 Scheduler UI
refs TryGhost/Ghost#6413 and TryGhost/Ghost#6870

needs TryGhost/Ghost#6861

- **Post Settings Menu (PSM)**:'Publish Date' input accepts a date from now, min. 2 minutes to allow scheduler processing on the server. Also, there will always be some delay between typing the date and clicking on the 'Schedule Post' button. If the user types a future date for an already published post, the date will be reseted and he sees the message, that the post needs to be unpublished first. Once, the date is accepted, the label will change to 'Scheduled Date'.

- adds a CP 'timeScheduled' to post model, which will return `true` if the publish time is currently in the future.

- **Changes to the button flow in editor**:
- if the the CP `timeScheduled` returns true, a different drop-down-menu will be shown: 'Schedule Post' replaces 'Publish Now' and 'Unschedule' replaces 'Unpublish'.

- Covering the _edge cases_, especially when a scheduled post is about to be published, while the user is in the editor.
	- First, a new CP `scheduleCountdown` will return the remaining time, when the estimated publish time is 15 minutes from now. A notification with this live-ticker is shown next to the save button. Once, we reach a 2 minutes limit, another CP `statusFreeze` will return true and causes the save button to only show `Unschedule` in a red state, until we reach the publish time
	- Once the publish time is reached, a CP `scheduledWillPublish` causes the buttons and the existing code to pretend we're already dealing with a publish post. At the moment, there's no way to make a background-fetch of the now serverside-scheduled post model from the server, so Ember doesn't know about the changed state at that time.
	- Changes in the editor, which are done during this 'status freeze'-process will be saved back correctly, once the user hits 'Update Post' after the buttons changed back. A click on 'Unpublish' will change the status back to a draft.
	- The user will get a regular 'toaster' notification that the post has been published.

- adds CP `isScheduled` for scheduled posts
- adds CP `offset` to component `gh-posts-list-item` and helper `gh-format-time-scheduled` to show schedule date in content overview.
- sets timeout in `gh-spin-button` to 10ms for `Ember.testing`
- changes error message in `gh-editor-base-controller` to be in one line, seperated with a `:`

TODOs:
- [x] new sort order for posts (1. scheduled, 2. draft, 3. published) (refs TryGhost/Ghost#6932)
- [ ] Move posts sorting from posts controller to model and refactor to use `Ember.comparable` mixin
- [x] Flows for draft -> scheduled -> published like described in TryGhost/Ghost#6870 incl. edge cases and button behaviour
- [x] Tests
- [x] new PSM behaviour for time/date in future
- [x] display publishedAt date with timezone offset on posts overview
2016-06-13 17:01:42 +02:00
Austin Burdine 7d693c1f96 internal tags feature
refs TryGhost/Ghost#6165
- change behavior to use 'visibility' property
- add tests
2016-06-13 08:21:41 -06:00
Hannah Wolfe e704d5f41a Merge pull request #63 from kevinansfield/add-ghost-desktop-update-tests
Fix and add tests for Ghost Desktop manual update notification
2016-06-13 14:10:20 +01:00
Kevin Ansfield 37ff17b738 Fix and add tests for Ghost Desktop manual update notification
closes #51
- move the check into the `afterModel` hook so that it's always performed on app load (previously it would only be displayed after going through the sign-in process)
- change the alert type to `warn` so that it matches our existing types (success, warn, error)
- don't rely on the `.htmlSafe()` prototype extension
- add basic tests for the upgrade alert display
2016-06-13 13:40:41 +01:00
Kevin Ansfield fb88dda5a8 Merge pull request #61 from acburdine/jscs-update
Update grunt-jscs and ember-suave to 3.0.0
2016-06-13 08:49:11 +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
Aileen Nowak 31d14c35f2 Add UTC timezone as default in settings model
no issue

- Changes the default timezone from 'Europe/Dublin' to 'Etc/UTC' in setting model
- Updates acceptance test for settings general to expect more timezones in list and different default
- adds mirage fixtures values
2016-06-11 12:24:04 +02:00
greenkeeperio-bot 0137269b97 chore(package): update ember-cli to version 2.6.0
https://greenkeeper.io/
2016-06-10 09:41:13 +01:00
Kevin Ansfield 1d5e410fdd deps: ember@2.6.0
no issue
- bugfix & cleanup release https://github.com/emberjs/ember.js/releases/tag/v2.6.0
- fix tests that were relying on not having the `rootURL` prefixed in `href`s
2016-06-09 16:58:09 +01:00
Kevin Ansfield af1f383ff8 Rename "offset" to "blogTimezone"
refs https://github.com/TryGhost/Ghost/pull/6941#issuecomment-224553575
- `blogTimezone` and `timezone` better reflect their values (a string representing a timezone in the format `Europe/Dublin`) than `offset` which suggests a fixed value
2016-06-08 12:09:19 +01:00
Kevin Ansfield bf8c05a990 deps: ember-ajax@2.4.1
no issue
- update ember-ajax
- update error handling to match recommended approach
- update error normalization for handling a returned array of strings
2016-06-06 11:54:15 +01: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
Aileen Nowak be8b31ec85 Timezones: Always use the timezone of blog setting
closes TryGhost/Ghost#6406

follow-up PR of #2

- adds a `timeZone` Service to provide the offset (=timezone reg. moment-timezone) of the users blog settings
- `gh-datetime-input` will read the offset of the timezone now and adjust the `publishedAt` date with it. This is the date which will be shown in the PSM 'Publish Date' field. When the user writes a new date/time, the offset is considered and will be deducted again before saving it to the model. This way, we always work with a UTC publish date except for this input field.
- gets `availableTimezones` from `configuration/timezones` API endpoint
- adds a `moment-utc` transform on all date attr (`createdAt`, `updatedAt`, `publishedAt`, `unsubscribedAt` and `lastLogin`) to only work with UTC times on serverside
- when switching the timezone in the select box, the user will be shown the local time of the selected timezone
- `createdAt`-property in `gh-user-invited` returns now `moment(createdAt).fromNow()` as `createdAt` is a moment date already
- added clock service to show actual time ticking below select box
- default timezone is '(GMT) Greenwich Mean Time : Dublin, Edinburgh, London'
- if no timezone is saved in the settings yet, the default value will be used
- shows the local time in 'Publish Date'  in PSM by default, until user overwrites it
- adds dependency `moment-timezone 0.5.4` to `bower.json`

---------

**Tests:**

- sets except for clock service in test env
- adds fixtures to mirage
- adds `service.ajax` and `service:ghostPaths` to navigation-test.js
- adds unit test for `gh-format-timeago` helper
- updates acceptance test `general-setting`
- adds acceptance test for `editor`
- adds integration tests for `services/config` and `services/time-zone`

---------

**Todos:**

- [ ] Integration tests: ~~`services/config`~~, ~~`services/time-zone`~~, `components/gh-datetime-input`
- [x] Acceptance test: `editor`
- [ ] Unit tests: `utils/date-formatting`
- [ ] write issue for renaming date properties (e. g. `createdAt` to `createdAtUTC`) and translate those for server side with serializers
2016-06-03 16:23:39 +02:00