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

33 commits

Author SHA1 Message Date
Rish d8dc8d9de5 🐛 Fixed broken structured data previews
closes https://github.com/TryGhost/Ghost/issues/11385

- Updates og and twitter description to use correct fallbacks for posts/pages
- Updates og and twitter description to use correct fallback for tags
- Updates og and twitter title to use correct name format for tags
2020-07-15 12:06:03 +05:30
Fabien 'egg' O'Carroll bd477449f6
Added UI for setting tag metadata (#1632)
no-issue

* Updated tag model with new metadata fields
* Updated Tag setting UI to handle metadata

Co-authored-by: Peter Zimon <zimo@ghost.org>
2020-07-13 14:58:13 +02:00
Kevin Ansfield 26e975e791 Cleaned up more unused code in <GhTagSettingsForm>
refs b61f3f1ecc

- `reset()` method was previously removed as it's no longer needed
- supporting code for calling that method was missed in the previous cleanup
2020-01-10 14:56:43 +00:00
Kevin Ansfield b61f3f1ecc Cleaned up unused code in <GhTagSettingsForm>
no issue

- the tag screen is now separate from the index so the code needed for handling switches between main/meta panes and scroll resets is not used and no longer needed
- tidies up indentation in the template
2020-01-10 14:14:55 +00:00
Kevin Ansfield 35b53e7712 🐛 Fixed unsaved changes modal when using Cmd+S on tag/member screens
no issue

- keep a scratch model on the tag/member controllers rather than inside of the form components
  - allows the controller's `save` task to transfer scratch values to real values before saving
  - means that pressing Cmd+S whilst a field is still focused will save the expected value rather than the old value avoiding unsaved changes modals when trying to leave the screen when you think you've already saved
- fixed route and url not changing after saving a new member
- fixed error when clicking delete tag button
- cleaned up unused `showDeleteTagModal` actions
2019-12-13 11:37:01 +00:00
Kevin Ansfield 421f4ea0e5 Fixed linting 2019-12-09 17:45:51 +00:00
Kevin Ansfield c2605a32ae Cleaned up and re-organised tag and new tag routes/controllers
no issue

- removed unused `<GhTagsManagementContainer>` component and related `isMobile` CPs
- un-nested `tag` and `tag.new` routes
  - nested routes in Ember are used for nested UI but these are both separate screens
  - removes usage of `selectedTag` property in favour of using Ember's built-in model handling
  - removed unnecessary `tags/new` controller
  - sets up `tag.new` route which extends the `tag` route to avoid duplicate code
2019-12-09 17:44:16 +00:00
Zimo 5dcf5b9651 Fixed button and title cases for Tags screen
no refs.
Set "New tag" button and "Tag settings" to sentence case to be consistent with the rest of the UI. (Previously they were title case.)
2019-03-25 09:37:44 +01: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
Austin Burdine 7bd38066f7 Remove ember-invoke-action (#978)
closes TryGhost/Ghost#9477
- remove ember-invoke-action in favor of straight function calls
2018-03-20 14:57:59 +00:00
Kevin Ansfield ac16e6504c ESLint: Consistent ember property/method ordering
no issue
- https://github.com/ember-cli/eslint-plugin-ember/blob/master/docs/rules/order-in-components.md
- https://github.com/ember-cli/eslint-plugin-ember/blob/master/docs/rules/order-in-controllers.md
- https://github.com/ember-cli/eslint-plugin-ember/blob/master/docs/rules/order-in-routes.md
2018-01-12 12:17:56 +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
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 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
Katharina Irrgang 7169a14568 🔥 Adapt image property changes (#661)
refs https://github.com/TryGhost/Ghost/issues/8348, requires https://github.com/TryGhost/Ghost/pull/8364
- rename all image properties
- e.g. author.image --> author.profile_image
- test all image functionality
2017-04-24 18:22:39 +01:00
Kevin Ansfield eb36bb4f53 minor refactors for recent/up-coming deprecations 2017-03-28 18:17:59 +01:00
Kevin Ansfield bd458ba1f9 add extra escaping when using htmlSafe on user input (#469)
no issue
- ensure that we always pre-escape user input when it's used within `htmlSafe` marked output
2017-01-04 08:52:00 -07:00
Austin Burdine 2dff7edd3d convert remainder of components to use ember-cli-shims (#101)
follow up from #95
- converts components to use ember-cli-shims
2016-06-30 19:14:25 +01:00
Austin Burdine 7d693c1f96 internal tags feature
refs TryGhost/Ghost#6165
- change behavior to use 'visibility' property
- add tests
2016-06-13 08:21:41 -06:00
Austin Burdine ed2c5f328d deps: grunt-jscs,ember-suave@3.0.0
replaces #41, #60
- update ember-suave and grunt-jscs to 3.0
- standardize Ember global de-structuring rules across app & tests
2016-06-11 13:39:31 -06:00
Kevin Ansfield 604fda4348 Update package.json details, rename module to ghost-admin
no issue
- updates `package.json` details to better reflect the separation from the `Ghost` package
- update ember config and all import statements to reflect the new `ghost-admin` module name in `package.json`
2016-06-03 16:12:54 +01:00
Austin Burdine 9f0b760ce4 convert more action calls to the ember-invoke-action syntax 2016-04-28 10:34:36 -05:00
Austin Burdine d957f52508 deps: ember-invoke-action@1.3.0
no issue
- replace instances of `this.get('action')()` with ember-invoke-action syntax
2016-04-26 16:32:17 -05:00
Hannah Wolfe 1ebe96b284 Merge pull request #6651 from kevinansfield/uploader-js-must-die
Replace jQuery-based uploader.js with ember components
2016-04-14 16:57:57 +01:00
Kevin Ansfield 02e89fbdfc Avoid use of this.attrs for closure actions
no issue
- `this.attrs` is a glimmer-component thing (which doesn't exist in Ghost yet), to avoid confusion we should avoid using it
- https://locks.svbtle.com/to-attrs-or-not-to-attrs
- https://github.com/cibernox/ember-power-select/issues/233#issuecomment-170352572
2016-04-09 10:46:19 +01:00
Kevin Ansfield 39a175108b Replace jQuery-based uploader.js with ember components
no issue
- adds `gh-image-uploader` that handles image uploads in a fully ember fashion and with no dependency on `uploader.js`
- adds `gh-image-uploader-with-preview` that can fully replace the old `gh-uploader`
- replace uses of `gh-uploader` in PSM & TSM with `gh-image-uploader-with-preview`
- updates the editor preview image handling to use the new `gh-image-uploader-with-preview` component
- updates the image upload modal to use `gh-image-uploader` (utilises the `saveButton=false` flag which means the preview has to be handled externally to avoid auto-replacement when typing a URL)
- removes all old `uploader.js` related code
- adds custom `RequestEntityTooLargeError` and `UnsupportedMediaTypeError` errors to our `ajax` service
2016-04-05 12:03:20 +01:00
Kevin P. Kucharczyk 24cc72cafd Standardise client property names to camelCase
closes #6018
- added keyForAttribute method in application serializer
- override keyForAttribute in settings serializer to not apply camelCase/underscore conversion
- rename under_scored properties to camelCased
2016-01-23 19:12:22 +01:00
Austin Burdine b2c91dd3be cleanup usage of Ember.inject 2016-01-19 07:03:27 -06:00
Kevin Ansfield 97bb577496 Refactor modals
refs #5798, closes #5018
- adds new `gh-fullscreen-modal` component - modals are now specified in-context so that they can have deeper interaction with their surrounding components/controller/route, i.e. a modal component can be a thin confirm/deny wrapper over the underlying controller action keeping all context-sensitive logic in one place
- adds spin-buttons to all modals with async behaviour
- adds/improves behaviour of inline-validation in modals
- improves re-authenticate modal to properly handle validation and authentication errors
2016-01-12 20:53:08 +00:00
Kevin Ansfield 17b3ced8c9 Always call _super when using Ember hooks
no issue
- review use of Ember core hooks and add a call to `this._super` if missing
- fix a few occurrences of using the wrong component lifecycle hooks that could result in multiple/duplicate event handlers being attached

`_super` should always be called when overriding Ember's base hooks so that core functionality or app functionality added through extensions, mixins or addons is not lost. This is important as it guards against issues arising from later refactorings or core changes.

As example of lost functionality, there were a number of routes that extended from `AuthenticatedRoute` but then overrode the `beforeModel` hook without calling `_super` which meant that the route was no longer treated as authenticated.
2015-11-30 12:45:37 +00:00
Kevin Ansfield 7ce3726589 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
Matthew Beale 4d98363c7c Unify mobile state in JS, drop resize
In `gh-content-view-container` the visibility of another DOM node was
being used to detect if a given view was mobile or not. This means the
UI needed to have layout forced (and DOM rendered) before the content
view container would render a second time. This is slow interaction with
the DOM (forcing layout) and slow for Ember's renderer (it needs to
render the container once with a default, then again when the value
changes).

Additionally there were two ways resize was being observed. The
`Window.matchMedia` API was used for some styles and the `ember-resize`
addon used to detect other changes. Here I've unified around just the
`Window.matcheMedia` API but abstracted it behind a service.

Sizes are exposed as properties that can be bound to or used directly in
templates.
2015-11-25 11:54:08 -05:00
Kevin Ansfield 4ecdf182e6 Routable tags
refs #5845
- Updates tag settings screen to match content screen behaviour. Each now tag has it's own route that is link-able from other areas of the app
- Updates a number of places where jQuery event handler code was not wrapped in Ember's run loop
2015-10-27 12:48:41 +00:00