Commit Graph

67 Commits

Author SHA1 Message Date
Kevin Ansfield 3da8815759 Renamed `activeTimezone` setting to `timezone`
refs https://github.com/TryGhost/Ghost/issues/10318

- API has been updated to still work with `active_timezone` for backwards compatibility but it makes sense for the client to match the underlying settings keys
2020-06-24 15:34:59 +01:00
Kevin Ansfield b364b81956 Fixed publish menu tests
refs 98f49e39a0

- the publish menu button text will now reset and because tests wait for all timers to finish before continuing the button text we're checking against has changed
2020-04-23 21:11:04 +01:00
Kevin Ansfield 39c738ee67
Added ability to retry failed emails from the confirm modal (#1412)
no issue

- adds a `.retry()` method to the email model+adapter
- adds a retry email task to the publishmenu that follows the same retry-then-poll behaviour as the regular email confirmation
- show a retry button in the confirm email modal if the original send failed
- increases max "immediate failure" poll timeout to 15sec (an 8sec retry-to-failure time has been seen locally)
2019-11-22 15:09:48 +00:00
Kevin Ansfield 567ec911f0 Fixed tests 2019-11-13 16:10:29 +00:00
Rish 9ff39e5f0a Fixed tests for copy changes 2019-11-13 11:45:58 +05:30
Kevin Ansfield ee09e46c8d Fixed tests 2019-11-08 16:01:40 +07:00
Kevin Ansfield 5b0e9826f7 Fixed tests 2019-11-08 11:14:04 +07:00
Paul Perkins a96f4fd5d2 🎨 Changed post/page date picker format to 'YYYY-MM-DD' (#1213)
refs https://github.com/TryGhost/Ghost/issues/10767

The use of the date format 'MM/DD/YYYY' is confusing to those not in American English locations. In the absence of being able to dynamically determine full locale data, using 'YYYY-MM-DD' seems to the least ambiguous date format which would be intuitive to most users.
2019-06-24 09:06:39 +01:00
Kevin Ansfield fdb4b46fd2 Updated for breaking changes in ember-cli-mirage@1.0.0 2019-05-27 09:58:33 +01:00
Kevin Ansfield f0ad9dcdc4 🐛 Fixed missing error notification when attempting to activate an invalid theme
no issue
- updates error handling to work with new v2 error response formats
  - `.errorType` -> `.error`
  - `.errorDetails` -> `.details`
2019-03-25 11:32:29 +00:00
John O'Nolan 584eeb8cf1 View site inside Ghost Admin
no refs.
- added "View site" as the first and default menu item in navigation bar to be able to browse the site without leaving the Admin
- rearranged left sidebar items according to new structure (moved Labs down to bottom)
- removed "View site" from publication main menu because it's become redundant
- added Night shift toggle in line with Labs menu to be able quickly access it
2019-03-21 10:33:14 +01:00
Kevin Ansfield 226c4c45c2 Updated editor error handler to work better with new API error messages
no issue
- pass a received API error directly through to the notifications service rather than adding an unnecessary prefix to the error message
2019-03-12 17:49:15 +00:00
Peter Zimon b63f5f59d0
Left navigation menu update (#1102)
refs. [f8b03f5](f8b03f50b6)

- added icons for members and pages
- improved view site link visibility
- added view site to logo dropdown
- updated all navigation and logo menu icons
- rename 'team' to 'staff'
- lots of design refinement and update (colors, shadows)
2019-02-22 16:43:35 +07:00
Kevin Ansfield f8b03f50b6
🎨 Separated post and page list screens (#1101)
no issue
- added `page` model
- removed `page` param from Post model
- added pages screen with associated links
- added `:type` param to editor screens to work with the right models
- removed post<->page toggle and associated tour item
2019-02-22 10:17:33 +07:00
Kevin Ansfield 079c8ccc2c
Migrate to latest ember, ember-mocha and modern ember testing (#1044)
no issue
- upgrade to latest `ember-source` and related dependencies including `ember-cli`
- upgrade to latest `ember-mocha` and modern ember testing setup
    - https://github.com/emberjs/rfcs/blob/master/text/0268-acceptance-testing-refactor.md
    - switch from using global acceptance test helpers and `native-dom-helpers` to using the new `ember-test-helpers` methods
    - use [`chai-dom`](https://github.com/nathanboktae/chai-dom) assertions where in some places (still a lot of places in the tests that could use these)
- pin `ember-in-viewport` to 3.0.x to work around incompatibilities between different versions used in `ember-light-table`, `ember-infinity`, and `ember-sticky-element`
    - incompatibilities manifested as "Invalid value used as weak map key" errors thrown when using `ember-light-table` (subscribers screen)
- pin `ember-power-datepicker` to unreleased version that contains a move from global acceptance test helpers to modern test helpers
2019-01-02 09:58:55 +00:00
Kevin Ansfield 11e301b63c Made Koenig the default editor, removed Koenig labs flag 2018-08-14 17:49:50 +01:00
Kevin Ansfield faba3f59e2 Fix tests
no issue
- 150f68e826 contained a wording change that was not taken into account in the tests
2018-05-17 15:18:09 +01:00
Kevin Ansfield d6169c38ef Fixed publishmenu re-rending side-effects breaking tests
no issue
- we currently rely on a side-effect of the individual publish menu components calling `setSaveType` when they are rendered
- in tests sometimes the timing was not what we expected and the menu would swap components mid-save which then updated the save type and caused further problems
- added a guard so that we never swap the publish menu components whilst a save is in progress
2018-03-27 18:50:52 +01:00
Kevin Ansfield 38b138d759 Use token input to allow selection of multiple authors in PSM
requires https://github.com/TryGhost/Ghost/pull/9426
- fixed default token component display in {{gh-token-input}}
    - if no `tokenComponent` is passed to `{{gh-token-input}}` then it should default to the ember-drag-drop `draggable-object` component but instead it didn't output anything
    - put `draggable-object` in quotes because `{{component}}` needs a component name rather than an object
    - rename `option` attribute to `content` to match the default `{{draggable-object}}` interface
- add embedded `authors` attr to the Post model
    - ensure authors is populated when starting new post
    - add validation for empty authors list
- swap author dropdown for a token input in PSM
- show all post authors in posts list
- update tests for `authors`
  - always provide through an authors array
  - fix mirage serialisation for paginated responses (embedded records were not being serialised)
- unify tags and author inputs design
  - remove highlight of primary tags
  - highlight internal tags
  - remove unnecessary/redundant title attributes on tags
  - use SVG icon for "remove option" button in token inputs
2018-03-27 18:50:52 +01:00
Kevin Ansfield c066bc8183
Bump dependencies (#991)
no issue
- bump `ember-cli-chai` and update tests
    - add missing Post model properties to the post factory with `null` to better match API output
    - replace uses of `.blank` which no longer exists, swapping for `.empty` or explicit checks for `null`
    - manually parse strings to numbers before using `.above` and `.below`
- bump top-level deps with no breaking changes
- bump yarn.lock sub-dependencies
2018-03-26 11:41:45 +01:00
Austin Burdine c6ddf3eb80 Bump ember-cli-mirage to 0.4.2 (#969)
closes TryGhost/Ghost#9433
- remove unnecessary bower deps
- update mirage usage
- fix tests
2018-03-19 09:53:17 +00:00
Austin Burdine ae3b9f97d9 Contributor Role (#948)
refs https://github.com/TryGhost/Ghost/issues/9314

* added save button for contributor
* hide tag filter & redirect to posts.index if post is published
* update editor controller test to need session service
2018-02-07 10:42:46 +01:00
Kevin Ansfield 41b3521cf1
Resurrect the old alpha Koenig editor (#916)
requires https://github.com/TryGhost/Ghost/pull/9277

- added a `koenigEditor` feature flag
  - modified the feature service to accept a `developer` boolean on the options object passed into the internal `feature` method, if `true` the feature flag won't be enabled unless the `enableDeveloperExperiments` config option is also enabled
  - added "developer feature testing" section in labs that's only visible if `enableDeveloperExperiments` config flag is enabled
  - added koenig editor toggle to the developer section in labs

- enabled a switch between the markdown and koenig editors
  - modified the default value of the `mobiledoc` attr in the Post model to be a blank mobiledoc or blank markdown mobiledoc depending on the feature flag
  - modified the `autofocus` switch in editor controller's `setPost` method so that it is always switched, even for new->edit where the post model isn't swapped
  - added a compatibility check to the editor controller's `setPost` method that shows an alert and force enables the koenig editor if the koenig flag is not enabled and the opened post is not compatible with the markdown editor

- fixed various issues that have appeared due to the old koenig alpha becoming out of sync with master
2018-01-18 15:36:01 +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 fb3dbbdff8 Fixed normalization of attrs in Mirage config and tests (#872)
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
2017-09-28 09:33:00 +07:00
Kevin Ansfield 92e43b7514 Fixed missing Unsplash icons when API doesn't return an unsplash setting (#865)
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
2017-09-21 11:13:31 +02:00
Austin Burdine 268b53e648 🐛 Fixed draft/scheduled/published date in content list (#852)
closes https://github.com/TryGhost/Ghost/issues/8917

- rename gh-format-timeago to gh-format-post-time
- add special handling for published & scheduled posts as per https://github.com/TryGhost/Ghost/issues/8917#issuecomment-327583767
- fix some timezone issues in acceptance tests
2017-09-07 13:17:36 +02:00
Kevin Ansfield b3d1474f40 Bump dependencies (#826)
no issue
- rollup of minor dependency updates
- bump yarn.lock sub-dependencies
- remove deprecated use of `testSelector`
2017-08-11 16:28:05 +01:00
Aileen Nowak 837f37de26 Added Twitter & Facebook data override fields to PSM (#814)
refs https://github.com/TryGhost/Ghost/issues/8334, requires https://github.com/TryGhost/Ghost/pull/8827
- added open graph and twitter fields to `Post` model
- added facebook and twitter card pane to PSM
- 💅🏼 Added preview styles for custom FB/Twitter cards
2017-08-03 15:45:14 +04:00
Kevin Ansfield 7c1f6e14b8 ️ Added per-post code injection fields to PSM (#811)
- 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
2017-08-02 13:32:51 +04:00
Kevin Ansfield 45210fb8bf ️ Add "Excerpt" field to post settings menu (#810)
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
2017-08-01 12:24:46 +04:00
Aileen Nowak ab67f40600 🎨 Publish menu wording and saving states improvements (#788)
closes TryGhost/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'.
2017-07-20 11:46:31 +01:00
Kevin Ansfield a9c8d7258c 🐛 fix autosave+transition on title blur with empty title (#767)
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
2017-07-10 18:33:05 +07:00
David Wolfe fd52adeb1f Update post save button texts (#736)
closes https://github.com/TryGhost/Ghost/issues/8536, closes https://github.com/TryGhost/Ghost/issues/8500

- Post save button will now display publish/un-publish/schedule/un-schedule/re-schedule/update
- On successful save button will display published/un-published/scheduled/un-scheduled/re-scheduled/updated
2017-06-15 18:35:23 +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
Aileen Nowak 627a71e1a4 🗜 Database soft limits (#683)
closes TryGhost/Ghost#8143

- uses new soft limits in validation:
	- post title to 255
	- meta title (post and tag) to 300
	- meta description (post and tag) to 500
2017-05-15 13:58:32 +02:00
Kevin Ansfield 16438f8c68 bump dependencies (#673)
no issue
- autoprefixer@7.0.1
- broccoli-funnel@1.2.0
- codemirror@5.25.2
- coveralls@2.13.1
- ember-cli@2.13.1
- ember-cli-babel@6.1.0
- ember-cli-chai@0.4.0
- ember-cli-code-coverage@0.3.12
- ember-cli-dependency-checker@1.4.0
- ember-cli-eslint@3.1.0
- ember-cli-htmlbars@1.3.2
- ember-cli-htmlbars-inline-precompile@0.4.2
- ember-cli-mocha@0.14.3
- ember-cli-test-loader@2.1.0
- ember-composable-helpers@2.0.1
- ember-data@2.13.1
- ember-light-table@1.8.6
- ember-native-dom-helpers@0.4.0
- ember-power-datepicker@0.3.0
- ember-power-select@1.8.2
- ember-route-action-helper@2.0.3
- ember-simple-auth@1.3.0
- ember-source@2.13.0
- ember-test-selectors@0.3.3
- fs-extra@3.0.1
- liquid-fire@0.27.3
- liquid-wormhole@2.0.5
- loader.js@4.4.0
- fix async issue in editor title placeholder test
- adds `targets.js` so that babel will only polyfill for the lowest common denominator
2017-05-09 18:15:04 -05:00
Kevin Ansfield 4b48328e6d SimpleMDE editor (#682)
no issue

* move "save on first change" behaviour into editor controller
* allow TAB events to be specified in keyEvents hash of gh-input
* replace mobiledoc-kit/gh-koenig with a SimpleMDE based editor
    - remove `gh-koenig` in-repo-addon from `package.json` so that test files etc aren't loaded
    - remove `mobiledoc-kit` dependencies
    - extends `gh-editor` to handle file drag/drop
    - adds `gh-uploader` and `gh-progress-bar` components to handle file uploads in a more composable manner
    - adds `gh-simplemde` component that wraps SimpleMDE
2017-05-08 11:35:42 +01:00
Kevin Ansfield 5c36ee4b9d Editor refactors (#679)
no issue

* split key commands and text expansions into separate files for easier file searches

* basic formatting, added a few comments

* move editor title input into addon
- the editor and title are now tightly integrated so that it's possible to use up/down cursor navigation so it makes more sense to keep them together
- start of a deeper component restructure so that we don't need to leak properties/actions to parent components

* first pass at refactor of gh-koenig and koenig-title-input
- remove need for editor reference to be held outside of the `gh-koenig` component by yielding it from the component so that the integrated title element can sit inside the container's scope
- refactor `gh-koenig` to more closely match the default ember mobiledoc addon
  - fixes runloop issues by starting/ending a manual runloop
- refactored the mutation observer and event handlers in `koenig-title-input` so that we're not doing unecessary work on every render/key press
- rename CSS classes to be more specific (these may still need more separation between `.gh` and `.kg` later)
  - `.editor-holder` to `.gh-koenig-container`
  - `.surface` to `.gh-koenig-surface`

* fix tests and start testing refactor

* move gh-koenig integration tests into addon, remove empty test files

* first-pass at component template cleanup

* first pass at koenig-toolbar-button refactor
2017-05-08 10:44:02 +01:00
Kevin Ansfield 1f3b79e289 💄 refactor acceptance tests to use async/await (#663)
no issue
- replaces `andThen(() => {}` blocks with usage of `async/await`
2017-04-25 00:29:48 +12:00
Ryan McCarvill df8bb6fbe7 🐝 Strip HTML from title (#665)
closes https://github.com/TryGhost/Ghost/issues/8353
- if a user pastes or inserts HTML into the title in some other way (modifying the dom, having a plugin mutate the dom, etc) then strip the HTML and insure that the title is always unstyled and plain text
2017-04-24 12:37:30 +01:00
Kevin Ansfield bab4aba942 🐛 clear date error when closing the PSM (#657)
closes https://github.com/TryGhost/Ghost/issues/8359

- if the date/time picker is in an error state when the PSM is closed, reset it to the currently saved time
- resolves the problem with the flash of an error as the publish menu is closed as it's no longer possible to be in a hidden error state
2017-04-24 09:29:41 +02:00
Kevin Ansfield ff12348433 💄 convert editor acceptance tests to async/await (#654)
no issue
- `async/await` cuts down on some boilerplate `andThen(() => { ... })` code and makes it more explicit which methods are async and will wait for run-loop/promise behaviour to finish before continuing
2017-04-20 01:21:37 +12:00
Kevin Ansfield 02e8ed023a fix timezone errors in editor tests (#638) 2017-04-11 15:48:20 +01:00
Kevin Ansfield 34cb65df5c new publish menu and date/time picker (#588)
closes https://github.com/TryGhost/Ghost/issues/8249

- replaces the old split-button publish/schedule/update button with a less confusing menu system
- adds a `{{gh-date-time-picker}}` component that contains a datepicker with separate time input
- replaces the date text input in the post settings menu with `{{gh-date-time-picker}}`
  - disabled when post is scheduled, only way to update a scheduled time is via the publish menu
  - validates date is in the past when draft/published so there's no confusion with scheduling
- displays saving status in top-left of editor screen
- refactor editor (auto)saving processes to use ember-concurrency

Other minor changes:
- adds `post.publishedAtBlog{TZ,Date,Time}` properties to Post model to allow working with `publishedAt` datetime in the selected blog timezone rather than UTC
- adds a `beforeSave` hook to `validation-engine` that is called after successful validation and before the Ember Data save call is made
- adds validation of `publishedAtBlog{Date,Time}` to post validator
- prevent gh-task-button showing last task state on first render
- fixes bug where clicking into and out of the published date input in the PSM without making any changes saves a published date for draft posts
2017-04-11 14:39:45 +01:00
Ryan McCarvill 4f33b83035 🐜 fix key up to empty title (#629)
closes https://github.com/TryGhost/Ghost/issues/8293
- when a title is empty it has no textnode to get a length of so we automaticlly put the horizontal offset of the cursor to 0
2017-04-10 10:12:04 +01:00
Kevin Ansfield 5e9e3cd027 switch to ember-cli-moment-shim (#622)
no issue

- preparation for using `ember-pikaday` that utilizes `ember-cli-moment-shim`
- removes usage of `moment` global
- removes custom imports of `moment` and `moment-timezone` libraries
2017-04-05 19:45:35 +02:00
Ryan McCarvill 4ebb184184 Multi line title. (#595)
refs https://github.com/TryGhost/Ghost/issues/7754

The title is now a contenteditable div which stretches and wraps to behave like the editor.

It also tries to seemlessly move the cursor between the editor and title to make one coherent editing experience.
2017-03-21 23:42:14 +00:00
Kevin Ansfield 7661212b1b Revert "Multi line title (#575)"
This reverts commit b5a7fef6f9.
2017-03-14 16:37:47 +00:00
Ryan McCarvill b5a7fef6f9 Multi line title (#575)
refs https://github.com/TryGhost/Ghost/issues/7754
- The title is now a contenteditable div which stretches and wraps to behave like the editor.
- It also tries to seemlessly move the cursor between the editor and title to make one coherent editing experience.
2017-03-14 13:50:30 +00:00