Commit Graph

45 Commits

Author SHA1 Message Date
Kevin Ansfield 5606b9c068 Implemented first iteration of content snippets
closes https://github.com/TryGhost/Team/issues/411

- adds "Create snippet" icon to the editor toolbar
- uses the same link input component design for specifying snippet titles
- snippets are loaded in the background when the editor is accessed
- snippets are listed at the bottom of the card menus of the + and / menus
- clicking a snippet inserts the snippet's contents in place of the current blank section
2020-10-15 18:03:35 +01:00
Roshan Dash 3eb8830cbd
🐛 Fixed incorrect scheduled date in toast (#1663)
closes https://github.com/TryGhost/Ghost/issues/12102

- The scheduled date was incorrectly shown as month number in the toast box after scheduling
- Updates to correctly show the selected date
2020-08-04 13:04:24 +05:30
Kevin Ansfield b965e7f57f Fixed "View post" rather than "View page" in save notifications
no issue

- the post/page conditional was looking at the old `post.page` property rather than the `post.displayName` that was added when posts and pages became separate models
2020-06-30 15:07:58 +01:00
Kevin Ansfield ec8e4530df Updated "successfully scheduled" notification message
refs https://github.com/TryGhost/Ghost/issues/11965

- be more explicit about when the post will be published
- indicate if and to which type of members the post will be emailed
- improved description formatting by making sure pertinent pieces of information do not wrap
2020-06-30 11:15:39 +01:00
Peter Zimon 81945b22ef
Updated notifications design (#1498)
no issue

- updating toaster design for better discoverability
2020-02-27 09:19:29 +00:00
Rish 059ce28cb6 Fixed lint
no issue
2020-02-24 13:39:59 +05:30
Rishabh Garg fb5663f3f0
Updated send email messaging for Editors (#1505)
no issue

Fixes incorrect member count for Editors when trying to publish/schedule post with send email.

Note: This is a short-term fix till we fix fetching member data for Editors for proper count.
2020-02-24 13:22:39 +05:30
Rishabh Garg f95c68662b
Added upgrade modal for host member limits (#1428)
no issue

Uses 160ef2976a to add new upgrade popup for host limit errors while publishing/scheduling post with emails.
2019-12-17 19:27:42 +05:30
Kevin Ansfield ffa200d00f Added console log with reason unsaved changes modal is shown in editor
no issue

- output the reason we're showing the unsaved changes modal along with some context to the console
- to share it, right click on the object that is logged to the web inspector console next to the text "showing leave editor modal" and choose "Store as global variable" in the popup menu, then execute `copy(temp1)` (if `temp1` was the variable that was created for you) which will copy a string representation of the object to your clipboard ready for sharing
2019-12-17 09:57:37 +00:00
Kevin Ansfield 693d6b48b2 🐛 Fixed unexpected "unsaved changes" modals when accessing screens
no issue

We weren't correctly clearing state for the "display modal" booleans when leaving screens. This meant that it was possible to end up in a state where where every time you access a screen you get the unsaved changes modal
2019-12-13 17:09:06 +00:00
Kevin Ansfield 4bcd016e88 Fixed members count in confirm email modal
no issue

- the members count used to disable the email toggle and shown in the confirm modal was incorrect as it didn't take into account subscribed vs non-subscribed members
- adjusts the filter in the count query to only fetch subscribed members
2019-11-26 15:08:33 +00: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 8cbf1d5442 Removed "and sent to x members" from publish toast notification
no issue

- the toast notification occurs before polling for a successful email occurs so it was confusing to have different states represented in the UI simultaneously
2019-11-22 11:00:47 +00:00
Kevin Ansfield 150dca7e81 Updated handling of send_email_when_published
refs 5fd2b7fed1

- sends `?send_email_when_published=true` query param when scheduling/publishing a post with the toggle turned on
  - adds support to the posts adapter for handling the `adapterOptions` option
  - updates the editor `save` task to pass through the required adapter option when a post is being published or scheduled with the toggle checked
- moves state for the email toggle into the publish menu so that we don't try to toggle the model attribute which should only be fetched from the API
- prevent `post.send_email_when_published` being sent to the API via the serializer as it's now a read-only attribute
2019-11-14 17:33:35 +00:00
Kevin Ansfield 0e5932c605 Display "all paid members" instead of incorrect count in email confirm modal 2019-11-13 10:17:00 +00:00
Kevin Ansfield 56204d0129 Added confirmation modal and use email model in place of action 2019-11-07 15:56:41 +07:00
Rish 997b250fe1 Enabled fetch members count on post only if members is enabled 2019-11-07 11:15:31 +07:00
Rish 7f63e3ce11 Added email preview modal flow 2019-11-05 13:10:49 +07:00
Kevin Ansfield 7ebe9f6e13 Display real member count in publish menu 2019-11-04 16:44:18 +07:00
Kevin Ansfield da5d4e7131 Display "sent" info in publish menu 2019-11-04 16:13:18 +07:00
Rishabh Garg 7739adecaa
Added email settings to post settings menu (#1398)
no issue
2019-11-04 13:15:13 +07:00
Kevin Ansfield 47e125b3f1
🐛 Fixed "unsaved changes" modal when leaving a new post with no content (#1358)
no issue

- if you created a post by setting a title but did not enter anything into the editor body before trying to leave the editor you'd see an "unsaved changes" modal because the "scratch" value for the post mobiledoc is `null` but the post's real mobiledoc value is now a blank document as returned from the API
- adds a conditional reset of the `post.scratch` value after a successful save if the scratch value is blank
2019-10-09 10:53:57 +01:00
Naz Gargol 6bbe7bb3d4
Content visibility configuration in labs (#1346)
no issue

- Changed members description to less verbose
- Added content visibility radio options to members configuration screen
- Moved setting of default visibility to server-side
- Default visibility setting when PSM is opened before making the first request to the server
2019-10-02 11:13:59 +02:00
Naz Gargol 411b2fa232
Added PSM visibility input (#1344)
refs 80f7e0b19e

- Added visibility input in PSM to control content access level for members
- Added default post visibility in editor. To be changed (moved to server-side) once `defaultContentVisibility` is available in settings service
- Added `visibility` property to post model & mirage
2019-10-01 15:00:53 +02:00
Kevin Ansfield 367419ab5a Resolved deprecated usage of Ember Data evented api usage
no issue

- https://deprecations.emberjs.com/ember-data/v3.x/#toc_evented-api-usage
- we were using the now deprecated `didCreate` and `didUpdate` events on the post model to perform controller-specific logic each time `post.save()` was called
- moved the functionality that was attached to the hook events into a `_savePost()` function and used that anywhere we were calling `post.save()`
2019-08-26 15:08:49 +01:00
Kevin Ansfield be07650154 Fix linting errors
refs https://github.com/TryGhost/Ghost-Admin/pull/1274

- fixes errors introduced from upgrading to eslint@6
2019-07-22 11:21:24 +01:00
Kevin Ansfield 06d50b065e Refactored document-title handler
no issue
- moved `document-title` Route extension's functionality into the `ui` service
  - updates the title each time the router service emits a route changed event
  - `ui.updateDocumentTitle()` can now be called directly from components rather than the confusing `this.send('updateDocumentTitle')` bubbling behaviour
- refactored the `titleToken` implementation to use the now-formalised `RouteInfo`'s `metadata` field (https://github.com/emberjs/rfcs/blob/master/text/0398-RouteInfo-Metadata.md#appendix-a)
2019-05-20 16:16:19 +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
Kevin Ansfield e9c7fad302 Refactored usage of `.get('property')` with es5 getters
no issue
- ran [es5-getter-ember-codemod](https://github.com/rondale-sc/es5-getter-ember-codemod)
- [es5 getters RFC](https://github.com/emberjs/rfcs/blob/master/text/0281-es5-getters.md)
- updates the majority of `object.get('property')` with `object.property` with exceptions:
  - `.get('nested.property')` - it's not possible to determine if this is relying on "safe" path chaining for when `nested` doesn't exist
  - `.get('config.x')` and `.get('settings.x')` - both our `config` and `settings` services are proxy objects which do not support es5 getters
- this PR is not exhaustive, there are still a number of places where `.get('service.foo')` and similar could be replaced but it gets us a long way there in a quick and automated fashion
2019-03-06 13:54:14 +00:00
Kevin Ansfield 92623073d0 Added `undefined` guards to uses of JSON stringify/parse copying
no issue
- added guards for JSON stringify+parse replacements of `Ember.copy` introduced in 18dd5e34f6
2019-01-30 14:44:53 +00:00
Kevin Ansfield 18dd5e34f6 Fixed Ember.copy deprecations
refs https://github.com/TryGhost/Ghost/issues/10310
- https://emberjs.com/deprecations/v3.x/#toc_ember-runtime-deprecate-copy-copyable
2019-01-30 10:14:07 +00:00
Moritz Schramm e261b80c22 🎨 Added post title to document title for easier location with multiple editor tabs (#1072)
closes https://github.com/tryghost/ghost/issues/10088
* added `updateDocumentTitle` action to base route and replace usage of `.send('collectTitleTokens, [])`
* added `.titleToken()` method to editor route to add post title to document title
* called `.send('updateDocumentTitle')` after saving post title in editor controller to keep document title in sync
* updated editor controller test for latest ember-mocha and ember-test-helpers
2019-01-21 11:44:30 +00:00
Kevin Ansfield bccd9ea0b3
🎨 Removed auto hide/show navigation toggle (#1094)
no issue
- the autonav behaviour has outlasted it's usefulness - it was mostly useful for editing but the editor screen is now always fullscreen and the number of low-resolution screens has dropped significantly
- dropped the components and all supporting code associated with autonav behaviour
2019-01-10 15:00:07 +00:00
Kevin Ansfield 0cbc8f5eaf
Adjust post URL handling for API v2's absolute URLs (#1055)
no issue
- API v2 outputs absolute URLs so we no longer need to construct full URLs ourselves
2018-10-16 16:54:15 +01:00
Kevin Ansfield 11e301b63c Made Koenig the default editor, removed Koenig labs flag 2018-08-14 17:49:50 +01:00
Kevin Ansfield 09a8c7fa88 Koenig - Added reading time and word count display
refs https://github.com/TryGhost/Ghost/issues/9724
- add `registerComponent` hook to cards so that `{{koenig-editor}}` can fetch properties from card components directly
- add word count and reading time utilities
- add throttled word count update routine to `{{koenig-editor}}` that walks all sections and counts text words or fetches word/image counts from card components
- add `wordCountDidChange` hook to `{{koenig-editor}}` so that word count + reading time can be exposed
- modify editor controller to update it's own word count property when koenig triggers it's action
- modified the editor template to show reading time + word count next to the post status
2018-07-20 15:53:21 +01:00
Kevin Ansfield fd9fe42296 🎨 Koenig - Keep posts free of blank cards
refs https://github.com/TryGhost/Ghost/issues/9623
- add new `deleteIfEmpty` option when defining cards
- add `.cleanup()` method to `{{koenig-editor}}` that will remove any blank cards
- pass `{{koenig-editor}}` instance up to the editor controller when it is initialised
- call `.cleanup()` in the editor controller when performing full saves, when leaving the editor with a draft, and when opening the editor with a draft
2018-06-14 16:55:02 +01:00
Zimo 150f68e826 Koenig Editor Beta Release
refs https://github.com/TryGhost/Ghost/issues/9505
- see https://forum.ghost.org/t/koenig-beta-release/1284 for full details
- moved Koenig editor checkbox from experimental to Beta
- added info message support in editor screen
- removed alert when opening markdown-incompatible post with Koenig disabled
2018-05-17 12:01:00 +01: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
Kevin Ansfield f6ec2f23f5 Move mobiledoc knowledge out of {{gh-markdown-editor}}
no issue
- pre-requisite for using `{{gh-markdown-editor}}` inside a Koenig card
- switch to passing markdown into `{{gh-markdown-editor}}`
- move markdown->mobiledoc logic into the `editor` controller
2018-04-20 15:43:44 +01:00
Kevin Ansfield 351c7adf89 Fixed post autosave for changes to nested objects in mobiledoc
no issue
- fixes a problem that appeared after the first save of a post; refs for nested objects in the `mobiledoc` object didn't change so any time they were updated in the `scratch` object they were also updated in the `mobiledoc` object which broke our dirty attributes tracking
- by creating a deep copy during save we ensure `scratch` and `mobiledoc` are kept separate without causing unnecessary copying (saves occur much less frequently than scratch updates)
2018-04-19 17:29:01 +01: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 3bbd488ff2 🐛 Fixed editor autofocus when starting a new post
no issue
- we were setting the `shouldFocusEditor` value correctly but then immediately resetting it again 🙈
- updated the logic to change the value when going from new->edit as well as setting it correctly _after_ all of the controller values are reset in the `setPost` method
2018-01-25 13:14:50 +00: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 51e890b991
Refactor new->edit transition to avoid editor re-renders (#949)
closes TryGhost/Ghost#8287
closes TryGhost/Ghost#8750
- moved all editor model functionality into the new `editor` route+controller
- moved editor template from `editor/edit.hbs` to `editor.hbs`
- refactored `editor` controller and the `editor.new`/`editor.edit` routes to work with a persistent editor rather than a teardown/re-render when transitioning from new->edit
- fixed issue in `{{gh-markdown-editor}}` for `autofocus` behaviour when the component isn't re-rendered
- fixed issue in `{{gh-simplemde}}` that was causing multiple updates to the `value` property when a new value is passed in to the component
- added `{{gh-scheduled-post-countdown}}` component to lower the noise in the editor controller
- removed editor route/controller mixins
- removed the `editor.edit` and `editor.new` controllers
2018-01-17 13:27:37 +00:00
Renamed from app/mixins/editor-base-controller.js (Browse further)