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

126 commits

Author SHA1 Message Date
Rishabh Garg
1cf443b42e
Updated member management data (#1150)
no issue

- Updated hard-coded data in member management to use real values from API
2019-04-16 20:32:43 +05:30
Kevin Ansfield
0c2c8ec1b7 🐛 Fixed unsaved editor changes being lost when changing PSM data on a published post
This reverts commit 6b01266b1f.

The "fix" is not correct, we want to ensure that unsaved changes in the editor are always kept.
2019-03-22 11:06:22 +00:00
Kevin Ansfield
6b01266b1f 🐛 Fixed unnecessary "Are you sure you want to leave?" modals
no issue
- if a post was saved before the body content was edited you would get stuck with an "Are you sure you want to leave?" modal even though you had already saved
- the editor saw the post as being in a dirty state because the `mobiledoc` and `scratch` value were null but after saving the `mobiledoc` value was set to an blank mobiledoc object as returned by the API
- updated the `post` model save method to reset the `scratch` value if the returned `mobiledoc` no longer matches
2019-03-15 16:18:53 +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
Kevin Ansfield
78b67968a3 Removed unused forceI18n attribute from the settings model 2019-03-07 09:10:46 +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
850d56e60e
Renamed ghostHead/Foot settings to codeinjectionHead/Foot (#1107)
closes https://github.com/TryGhost/Ghost/issues/10560
- match changes in the API
2019-03-05 10:40:19 +00:00
Kevin Ansfield
8de12b5d3c Fixed error causing missing sidebar after import
no issue
- the `Role.lowerCaseName` CP could throw an error when `name` was missing which caused the sidebar rendering to be aborted
- adds a guard to ensure we aren't calling string methods on `null` or `undefined`
2019-03-04 16:17:28 +00:00
Rish
e6a6b097e2 Added members feature to labs
no issue

- Added new members settings/toggle to labs
2019-02-26 15:33:38 +07:00
Kevin Ansfield
f90811e994 Updated post list preview to use excerpt instead of plaintext 2019-02-26 13:37:23 +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
17c7a7f3b5 Filter non-custom integrations from Custom Integrations list 2019-02-15 14:18:05 +00:00
Kevin Ansfield
8e734d3c79 Added initial members model and associated mirage setup
no issue
- mirage is now enabled by default in development with logging (can be turned off once we're no longer relying on mocked members endpoints)
2019-01-22 17:18:44 +00:00
Kevin Ansfield
0923b1d362 Added user.isOwnerOrAdmin CP 2019-01-22 16:22:12 +00:00
Greg Hart
fb4794c3b5 Added ability to configure Slack integration's username (#1084)
closes https://github.com/TryGhost/Ghost/issues/9735
- add "Username" form to Slack integration
2019-01-21 12:26:21 +00:00
Kevin Ansfield
fe1365d03e Fixed missing invite role name on team screen
no issue
- removed the rename of `role_id` to `role` in the invite serialiser to let Ember Data do it's thing with the `invite.role` relationship
- added a guard to the team screen background reloading to ensure that role data is present in the store before loading invites so that Ember Data doesn't trigger unnecessary requests to find missing relationship data
2019-01-14 17:01:30 +00:00
Kevin Ansfield
519b736015
Added initial custom integrations UI (#1051)
refs https://github.com/TryGhost/Ghost/issues/9865, https://github.com/TryGhost/Ghost/issues/9942

- `integration`, `api-key`, and `webhook` models and respective mirage mocks
- moves integration routes around to match ember's concept of nested routes (nested routes reflect nested UI not nested URLs)
- adds custom integrations list to integrations screen
- adds custom integration screen
  - allow editing of integration details
  - show list of webhooks
  - webhook creation modal

NB: the `enableDeveloperExperiments` flag needs to be enabled in the `config.development.json` file for the custom integrations UI to be displayed until it's out of development.
2018-10-18 00:18:29 +01: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
d24bad6aca Fixed default user images returning 404s
no issue
- dropping IE11 support meant that babel/uglifyjs was able to be clever and inline the image URLs variables directly into the template strings which was then breaking the fingerprint asset rewriting resulting in files having hashes but file references in the JS not having the hash
- removing use of template strings to build the default image URLs prevents the inlining behaviour, letting the asset fingerprint plugin do it's thing correctly
2018-08-15 23:58:37 +01:00
Kevin Ansfield
11e301b63c Made Koenig the default editor, removed Koenig labs flag 2018-08-14 17:49:50 +01:00
Kevin Ansfield
05eb7db8e9 Removed dated permalinks setting
no issue
- permalink config is now handled through `routes.yaml`
2018-08-14 17:49:50 +01:00
Kevin Ansfield
da903af5c2 Bump dependencies 2018-05-14 13:56:09 +01:00
Kevin Ansfield
c71437048a 🐛 Fixed low-resolution gravatar images on Team/User screens
closes https://github.com/TryGhost/Ghost/issues/9563
- fixes incorrect gravatar URLs by removing incorrect HTML encoding of the URL and enforcing URL encoding
- centralise image URL generation in the User model so that default image logic isn't spread across the app
- remove unnecessary proxy mixin from `ghost-paths` service (allows property access without `.get()`)
2018-05-14 12:15:08 +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
Aileen Nowak
ec178590f0 Replaced config routeKeyword with hardcoded one (#1004)
refs TryGhost/Ghost#9561

- used the hardcoded routeKeyword for `preview`
- removed `routeKeywords` from mirage configurations API fixtures
2018-04-17 09:52:41 +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
04b8dbb855
Bump Ember dependencies to 3.0 (#961)
no issue
- upgrade `ember-cli`, `ember-source`, and `ember-data` to their latest 3.x versions
- remove jquery ajax test that was a silent failure anyway (we removed the global jquery ajax auth patch a while ago)
- fix issues that arose from using/abusing Ember internals in a couple of places
2018-02-28 17:31:43 +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
3d341e2dd6
Koenig reboot - rich text (#952)
refs https://github.com/TryGhost/Ghost/issues/9311

Koenig is being fully rebooted, first port of call is to focus on getting the rich-text only aspect of mobiledoc-kit working with our popup toolbar.

- renames old koenig implementation (used for reference, will eventually be deleted)
- new `{{koenig-editor}}` mobiledoc-kit component implementation based on ember-mobiledoc-editor
  - markdown text expansions
- new `{{gh-koenig-edtor}}` that wraps our title+editor and handles keyboard navigation between the two
  - clicks below content will focus the editor
- new `{{koenig-toolbar}}` component for the popup formatting toolbar with improved behaviour and simplified code
2018-01-30 10:01:07 +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
0ef503f23d ESLint: Don't use observers if possible
closes https://github.com/TryGhost/Ghost/issues/8690
- https://github.com/ember-cli/eslint-plugin-ember/blob/master/docs/rules/no-observers.md
- remove observers where possible
- move night shift toggle behaviour to the feature service
	- refresh feature service after import to fix stuck night shift toggle
2018-01-12 12:17:56 +00:00
Kevin Ansfield
9fe5159915 ESLint: Be explicit with Ember Data attribute types
no issue
- https://github.com/ember-cli/eslint-plugin-ember/blob/master/docs/rules/no-empty-attrs.md
2018-01-12 12:17:56 +00:00
Kevin Ansfield
63fe1b1a88
🎨 Move "Update available" notification to the About screen (#894)
refs https://github.com/TryGhost/Ghost/issues/5071

Upgrade messages are now shown on the About screen rather than as alerts. Notifications that are marked as `top` or `custom` are still shown as alerts to allow for certain upgrade messages to be given more visibility.

- remove old `upgrade-notification` service
- update the `upgrade-status` service:
  - add a `message` property that contains an upgrade notification if any exists
  - add a `handleUpgradeNotification` method that accepts a Notification model instance and extracts the `notification.message` property into a html safe string for use in templates
- when loading server notifications during app boot, pass notifications that aren't marked as `top` or `custom` to the new `handleUpgradeNotification` method
- update the `about.hbs` template to pull the upgrade message from the `upgradeStatus` service
2018-01-09 14:23:36 +00:00
Kevin Ansfield
b696c750b8 Use computed property brace expansion
no issue
- https://github.com/ember-cli/eslint-plugin-ember/blob/master/docs/rules/use-brace-expansion.md
2017-11-25 09:49:49 +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
238983a5df Match service/controller import to ember-modules-codemod style for consistency
no issue

Automated tools, code generators, and editor integrations are increasingly standardising on the import style used in `ember-modules-codemod`. Our import style differed a little with regards to service/controller injection imports which meant we were starting to see inconsistent naming.
2017-10-30 09:38:01 +00:00
Aileen Nowak
4eff42bdac Match client-side password validation to new server-side rules (#899)
refs TryGhost/Ghost#9150

- added a new validator for password validations that will take care of the rules client side
- Passwort rules added:
   - Disallow obviously bad passwords: 1234567890, qwertyuiop, asdfghjkl; and asdfghjklm
   - Disallow passwords that contain the words "password" or "ghost"
   - Disallow passwords that match the user's email address
   - Disallow passwords that match the blog domain or blog title
   - Disallow passwords that include 50% or more of the same characters: 'aaaaaaaaaa', '1111111111' and 'ababababab' for example.
- When changing the own password, the old password is not affected by the new validations
- Validation are running on
   - setup
   - signup
   - password change in Team - User (only new passwords are validated)
   - passwort reset
2017-10-26 11:02:17 +01: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
Katharina Irrgang
cb576b14d3 Display private RSS feed url in general settings (#888)
refs https://github.com/TryGhost/Ghost/issues/9001

- show private feed url if private blogging is enabled
- added a `.avoid-break-out` CSS utility class to prevent layout issues caused by non-breaking text such as long links
2017-10-05 10:59:14 +01:00
Kevin Ansfield
c994022511 🐛 Fixed error when navigating to tag from admin search box (#881)
closes https://github.com/TryGhost/Ghost/issues/9074

- remove unused pagination route attrs that were interfering with routing service - these were a pre-1.0 hangover from when the tags screen had infinite scroll
- change `Posts` to `Stories` in the search dropdown for consistency
- add general fix for `adapter returned an array for the primary data of a 'queryRecord' response` deprecations by ensuring that `normalizeResponse` in our application serializer transforms the array we get from the server into a "single" JSON-API response
  - this deprecation was being triggered when loading a tag route directly
- fix `defaultValue` complex object deprecations raised from `Setting.unsplash` attr
2017-10-03 11:54:24 +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
Kevin Ansfield
2e12987938 🎨 Enabled Unsplash integration by default (#862)
no issue

- Unsplash integration is enabled by default for all users
- it's no longer necessary to create your own Unsplash application and configure your application ID
2017-09-20 12:19:48 +02:00
Kevin Ansfield
de37ae5382 🐛 Fix #tags added via PSM having "public" visibility (#841)
refs TryGhost/Ghost#8943
- Tag model has an observer watching the `isNew` and `name` properties so that it can set the `visibility: "internal"` property for new tags based on their name starting with a `#`
- PSM creates tags using `store.createRecord('tag', {name: tagName})` which means that the tag is instantiated with the `isNew` and `name` properties already set (unlike the tags screen where an empty tag is first created before the name is set via UI) - because the properties are there before at instantiation the observer never fires because it's only watching for changes
- adds the `.on('init')` modifier to the `setVisibilityOnNew` observer so that it's run for the watched properties during instantiation as well as on change
2017-08-29 10:19:47 +07:00
Kevin Ansfield
88449ed639 Switched from ember-cli-shims to new module imports (#779)
no issue

- add eslint-plugin-ember, configure no-old-shims rule
- run `eslint --fix` on `app`, `lib`, `mirage`, and `tests` to move imports to the new module imports
- further cleanup of Ember globals usage
- remove event-dispatcher initializer now that `canDispatchToEventManager` is deprecated
2017-08-22 14:53:26 +07: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
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
ffa1b59a4c 🎨 show "locked" badge in team list (#794)
refs https://github.com/TryGhost/Ghost/issues/8652
2017-07-21 22:21:27 +01:00