Commit Graph

9 Commits

Author SHA1 Message Date
Kevin Ansfield
1650069bcb deps: codemirror@5.16.0 as npm module 2016-06-29 11:28:53 +01:00
Aileen Nowak
24e71ffdaa 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
Kevin Ansfield
ed1d6c98b3 Drop XRegExp dependency
closes #6102
- removes the `xregexp` dependency
- pulls in the non-alphnumeric unicode list directly from the XRegExp library to ensure the word count helper still takes into account unicode strings

The XRegExp dependency was breaking as new browsers add more es6 support as evidenced in #6102. Upgrading to version 3.1.0 fixed the Chrome "experimental JS" issue but was still broken in Safari Technology Preview.

We only use one feature of `XRegExp` in a single place for a relatively non-critical feature: calculating the word count. As such I figured it may be better to drop the 63KB minified dependency and simply copy the result of the compiled regex directly until such time as XRegExp has native support in our supported browsers.
2016-03-30 19:45:20 +01:00
Kevin Ansfield
053839df4c Include babel polyfill when compiling client
no issue
- fixes issues when using `phantomjs` or other browsers that are not fully es6 compatible
2016-02-04 12:49:53 +00:00
Kevin Ansfield
f23166190d Remove unused ember-resize dependency
no issue
- removes `ember-resize` dep that crept back in under the radar in the Ember 2.2 update
- updates `ember-cli-build`'s test dependencies to match the format specified in http://ember-cli.com/managing-dependencies/#test-assets
2015-12-01 11:03:53 +00:00
Kevin Ansfield
2f4f6db133 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
675a1221fa Add acceptance test for setup flow happy-path
refs #6039
- add `jquery-deparam` ember testing dependency for use in mirage config
- setup necessary mirage fixtures & endpoints for successful testing of setup flow's happy-path
- add happy-path acceptance test for setup flow
2015-11-15 11:51:19 +00:00
Kevin Ansfield
d8728aad57 Fix nav regressions in admin client
issue #5841

- fix relative link checks in navlink url input component
- fix navlink url input component sending absolute URLs instead of relative URLs to action handler
- remove URL manipulation in navigation settings controller (url input handles URL manipulation, validator flags anything that's still incorrect)
- capture cmd-s in url input to ensure changes are actioned before save
- automatically add mailto: to e-mail addresses
- add gh-validation-state-container component so .error/.success validation classes can be applied to any container element
- add validation-state mixin that can be mixed in to any other component to give it access to validation status (used in gh-navitem component to keep alignment when inline error message elements are added)
- validate and display inline errors on save
- improve ember test coverage for navigation settings related controller and components
2015-09-23 17:05:41 +01:00
Kevin Ansfield
a915390a7d upgrade ember-cli to 1.13.0 and ember-cli-mocha to 0.9.3
no issue
- upgrades ember-cli, ember-cli-mocha, ember-mocha dependencies
- switches Brocfile.js to ember-cli-build.js
- fixes controller tests with missing needs

Pulled into a separate PR as it doesn't affect running code but does provide access to the very useful component integration tests.
2015-09-21 14:55:59 +01:00