1
0
Fork 0
mirror of https://github.com/TryGhost/Ghost-Admin.git synced 2023-12-14 02:33:04 +01:00
Commit graph

62 commits

Author SHA1 Message Date
Kevin Ansfield
f529296129
Migrated to <AngleBracketSyntax /> (#1460)
no issue

Ember is migrating to `<AngleBracketSyntax />` for component invocation, see https://github.com/emberjs/rfcs/blob/master/text/0311-angle-bracket-invocation.md

We were in a half-way situation where some templates used angle bracket syntax in some places, this PR updates templates to use the syntax everywhere.

This simplifies the rules for what template code is referring to...

`<Component>` = a component
`{{helper}}` = a helper (or locally assigned handlebars variable)
`{{this.foo}}` = data on the template backing context (a component/controller)
`{{@foo}}` = a named argument passed into the component that the component backing class has not modified (note: this commit does not introduce any named arguments)

- ran codemod https://github.com/ember-codemods/ember-angle-brackets-codemod on the following directories:
  - `app/templates`
  - `lib/koenig-editor/addon/templates`
- removed positional params from components as angle bracket syntax does not support them
  - `gh-feature-flag`
  - `gh-tour-item`
  - `gh-cm-editor`
  - `gh-fullscreen-modal`
  - `gh-task-button`
- updates some code that was missed in aaf9f88ebc to use explicit this
2020-01-16 15:14:03 +00:00
Kevin Ansfield
ad4cbc3321
Enabled manual typing of post publish dates (#1431)
*  Enabled manual typing of post publish dates

closes https://github.com/TryGhost/Ghost/issues/9256

- stores the typed date internally to the component until
  - Enter is pressed whilst focused
  - Ctrl/Cmd+S is pressed whilst focused
  - the input loses focus
- shows an error message if the typed date is not in the correct format or is invalid
- stops Ctrl/Cmd+S propagating if the typed date is not in the correct format or is invalid
- as long as the date is valid it calls the `setDate` action when the input loses focus, Ctrl/Cmd+S or Enter is pressed
- prevents publish being triggered in the publish menu if an invalid date is entered
- resets any invalid state in the PSM when it's closed
- manages focus when using <kbd>Tab</kbd>
2020-01-10 14:25:59 +00:00
Kevin Ansfield
403bac5876 Converted <GhErrorMessage> to glimmer component
no issue

- fixes `isVisible` deprecation warning that was showing up for every component invocation since the Ember 3.14 upgrade
2019-12-13 16:12:04 +00:00
Kevin Ansfield
aaf9f88ebc Ran "no implicit this in templates" codemod
no issue

We were in a part-way state where some touched files had been (sometimes partially) migrated to explicit `this`. The codemod that was available has now fixed the formatting issues it had so it was a good time to run it.

https://github.com/ember-codemods/ember-no-implicit-this-codemod

- part of the migration path for https://github.com/emberjs/rfcs/pull/308
- starts to make template resolution rules more explicit
  - `<MyComponent />` - always a component
  - `{{my-component}}` - component or helper (components _must_ have a `-`. This style of component will go away once fully migrated to angle bracket components)
  - `{{value}}` - a helper or local template variable
  - `{{this.value}}` - reference to a property on the backing context (either a controller or a component JS file)
2019-12-13 14:20:29 +00:00
Peter Zimon
175e022634 Updated email role restrictions
no issue.
Only admins and owners should have access to sending emails. Updated relevant templates
to restrict access to emails for non-admins/owners
2019-11-26 13:20:49 +01:00
Kevin Ansfield
ecff12221e Extracted PSM email settings into separate component 2019-11-08 15:56:56 +07:00
Peter Zimon
9ff273b882 Refined post status and email warning copy 2019-11-08 15:38:25 +07:00
Peter Zimon
fc2b8fc597 Updated PSM copy 2019-11-08 13:19:19 +07:00
Peter Zimon
e2dd5f517a Refined mailgun warning 2019-11-07 17:14:08 +07:00
Peter Zimon
5af94d7b7c Refined disabled states and copy 2019-11-07 15:32:29 +07:00
Rish
914e5d731d Added error for incorrect mailgun config in publish and settings menu 2019-11-07 12:44:37 +07:00
Peter Zimon
6da3667c0e Refined styles for test email 2019-11-07 11:20:21 +07:00
Rish
7f70845751 Fixed valid test email check 2019-11-07 10:55:55 +07:00
Rish
42f59387eb Added test email validation in settings 2019-11-07 10:54:04 +07:00
Rish
c36c7a1950 Added send test email button loading states 2019-11-07 09:58:25 +07:00
Rish
e83c44de93 Disabled email subject based on delivered action 2019-11-06 15:28:40 +07:00
Peter Zimon
c177ad2575 Updated email settings design in PSM 2019-11-06 11:23:20 +07:00
Kevin Ansfield
3c5d55db7a Hid email settings in PSM when editing a post 2019-11-05 18:34:10 +07:00
Rish
6901edfdb0 Added test preview email to post email settings
no issue
2019-11-05 16:10:24 +07:00
Rish
7f63e3ce11 Added email preview modal flow 2019-11-05 13:10:49 +07:00
Rishabh Garg
7739adecaa
Added email settings to post settings menu (#1398)
no issue
2019-11-04 13:15:13 +07:00
Naz Gargol
9ae73c3bd7
Hidden post visibility select from PSM for non editors (#1357)
no issue

- Limited visiblity to only those users who have the rights to edit post's visibility
2019-10-09 10:23:36 +02:00
Peter Zimon
6633cbb0fc Renamed post visiblity dropdown values for posts
no issue
2019-10-04 12:57:58 +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
Peter Zimon
183e22e0bf 🎨 Updated admin area design and usability (#1232)
refs. https://github.com/TryGhost/Team/issues/205

Major update to Ghost Admin UI including:
- improved general consistency (typography, colors and contrast, UI components, icons)
- new design for post and pages lists, improved discoverability of filters 
- search moved to modal
- account menu is decoupled from ghost logo
- further usability fixes
2019-06-18 11:47:20 +01:00
Kevin Ansfield
3697d15ec5 Hid "feature this post" toggle when logged in as an Author or Contributor
no issue
- hides the "Featured this post" toggle in the post settings menu when the currently logged in user is an Author or Contributor
- https://forum.ghost.org/t/remove-the-permission-to-set-posts-to-featured/7441/5?u=kevin
2019-05-28 09:39:22 +01:00
Vikas Potluri
98f2ba36e4 Fixed post/page labels in feature image and save components (#1143)
closes https://github.com/TryGhost/Ghost/issues/10658

- update publish menu states to use `{{post.displayName}}` instead of hard coded `post`
- update settings menu image uploader to generate CTA using `post.displayName`
2019-04-06 09:01:49 +01:00
Kevin Ansfield
ef7151ca3f 🐛 Fixed author names not appearing in Facebook open-graph preview
no issue
- added an `{{author-names}}` helper that takes an array of author-like objects and returns their names separated by a comma
2019-03-12 12:15:02 +00:00
Kevin Ansfield
69571b171f Added ability to override the canonical URL of posts/pages
closes https://github.com/TryGhost/Ghost/issues/10593
- adds a "Canonical URL" field to the Meta Data section of the Post Settings Menu
- adds validation for canonical url being a valid absolute or relative URL
2019-03-12 10:40:07 +00:00
Vikas Potluri
0ce7490b4e Fixed post/page wording in Page PSM and delete modal (#1109)
closes https://github.com/TryGhost/Ghost/issues/10577
2019-03-07 09:13:31 +00: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
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
902e361e22 Add {{background-image-style}} helper
no issue
- cleans up multiple CPs that were only outputting a background image style
- moves URL decoding/encoding and `htmlSafe` output into one place
2018-05-14 13:04:53 +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
Austin Burdine
3fd2c7ad66 Swap out ember-inline-svg for ember-svg-jar (#970)
closes TryGhost/Ghost#9506
2018-03-19 09:57:31 +00:00
Kevin Ansfield
479b187ac0
Remove ember-one-way-controls (#959)
closes https://github.com/TryGhost/Ghost/issues/9386
- remove usage of `{{one-way-checkbox}}` in favour of direct HTML+handlebars
- add `{{gh-text-input}}` that inherits from Ember's built-in `TextInput` component along with our custom `TextInput` mixin
- swap all uses of `{{gh-input}}` for `{{gh-text-input}}
- remove `{{gh-input}}` component
- update `{{gh-textarea}}` to inherit from Ember's `TextArea` component instead of `OneWayTextarea` and update all component uses accordingly
- update `{{gh-trim-focus-input}}` to inherit from `{{gh-text-input}}` and update all component uses accordingly
- standardize on using the `focus-out` action naming rather than `focusOut` for all text inputs, this is because the text input components (especially `{{gh-trim-focus-input}}`) have their own `focusOut` handler which gets overridden if consumers supply their own `focusOut` attr
- drop `ember-one-way-controls` package
- add `ember-one-way-select` package
2018-02-28 11:44:03 +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
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
3139b23258
🎨 Improved code injection loading behaviour on slow connections (#935)
closes https://github.com/TryGhost/Ghost/issues/9249
- in `{{gh-cm-editor}}` display a standard textarea in place of the CodeMirror editor whilst CodeMirror assets are loading in the background, textarea will be upgraded to a CodeMirror editor when loading finishes
- update styles so that the switch from plain textarea to CodeMirror is not too jarring
2018-01-02 18:29:03 +00:00
Kevin Ansfield
3aa44c9f21
🐛 Fixed "Someone else is editing" errors showing when no-one else is editing (#901)
closes https://github.com/TryGhost/Ghost/issues/8969

Collision detection errors were appearing incorrectly because the save routines in the post settings menu bypass the sequential saves in the main editor controller and so are prone to having stale data if a previous save is still in progress.

- added a new `savePost` task that is part of the `saveTasks` group so that all post saves are sequential
- pass the `savePost` task to the `{{gh-post-settings-menu}}` component
- use `savePost` task in `gh-post-settings-menu` instead of calling `save()` directly on the model instance
2017-11-02 09:47:52 +00:00
Kevin Ansfield
72ff75b935
New tags input, drop selectize & jquery-ui deps (#892)
closes https://github.com/TryGhost/Ghost/issues/6458
- swap `ember-sortable` for `ember-drag-drop` in navigation UI
- extract PSM tag input into new `{{gh-psm-tags-input}}`
- add new `{{gh-token-input}}` that wraps `ember-power-select` and `ember-drag-drop` to replicate the previous selectize based tags input
- enhance `{{gh-psm-tags-input}}` behaviour to highlight selected primary tag and show "primary/internal" in selected tag titles
- 🔥 remove `selectize`
- 🔥 remove `jquery-ui`
- 🔥 remove unused `{{gh-navigation}}` component
2017-10-31 09:10:49 +00:00
Kevin Ansfield
3da1702af9 Fix Ember deprecations and warnings (#895)
no issue 

- `controller.content` will no longer be an alias to `controller.model`
- split relationships and `attrs` in Post model, add missing transforms
- fix unknown `error` field in payload warning when `/users/me` returns 404 during tests
- fix unsafe style binding warnings
2017-10-13 16:39:49 +07:00
Kevin Ansfield
68442c5676 Custom Post Templates UI (#878)
refs https://github.com/TryGhost/Ghost/issues/9060

- add `{{gh-psm-template-select}}` component
  - allows selection of a custom template for a post if the active theme has custom templates
  - loads themes on render, only hitting the server if not already in the store
  - disables select if post slug matches a `post-*.hbs` or `page-*.hbs` template
- adds `customTemplate` attr to `Post` model
- adds `templates` attr to `Theme` model with CPs to pull out custom vs post/page override templates
- add `.gh-select.disabled` styles to make disabled selects look visually disabled
2017-10-10 14:26:19 +02: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
0eac658b91 Refactor general UI state into a service
no issue
- moves general UI state control such as menu display, autonav, settings menu, etc into a `ui` service for easier use within components
- no longer required to jump through hoops passing state and actions down from application controller into components
- removes indirect "route" actions in favour of calling actions/methods directly on the `ui` service
2017-08-15 16:01:12 +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
Kevin Ansfield
9d9d040d7c 🐛 fix loss of editor focus on new post autosave (#798)
refs TryGhost/Ghost#8723
- #795 contained a regression where the body focus was lost during the new->edit transition because at that point `model.isNew` is false
- returns `shouldFocusEditor` code that was removed in #768 (it was assumed the body should _always_ have focus in that PR)
- instant-save if body is edited and the post is new - fixes issue where you could keep typing without any save when body had autofocus
- don't show preview link for new posts - fixes issue where it links directly to the admin endpoint so it would force a refresh
2017-07-21 19:11:24 -04:00
Kevin Ansfield
8aaf7f3502 🐛 fix PSM throbber bugs (#777)
closes https://github.com/TryGhost/Ghost/issues/8611
- fix positioning of "static page" throbber
- fix PSM throbbers re-appearing after PSM close/open (need to use `pushObject` instead of `push` so that it's KVO compliant and the `_activeThrobbers` CP is updated)
- fix order of `willDestroyElement` so that we don't attempt to use `get` after the component is destroyed
- fix issue in Chrome that was preventing the Meta Data link from sliding the PSM panels
2017-07-10 19:15:20 +07:00