1
0
Fork 0
mirror of https://github.com/TryGhost/Ghost-Admin.git synced 2023-12-14 02:33:04 +01:00
Ghost-Admin/app
Kevin Ansfield e4c0aaf7b9 "400 Version Mismatch" error handling
refs https://github.com/TryGhost/Ghost/issues/6949

Handle version mismatch errors by:
- displaying an alert asking the user to copy any data and refresh
- disabling navigation so that unsaved data is not accidentally lost

Detailed changes:
- add `error` action to application route for global route-based error handling
- remove 404-handler mixin, move logic into app route error handler
- update `.catch` in validation-engine so that promises are rejected with the
  original error objects
- add `VersionMismatchError` and `isVersionMismatchError` to ajax service
- add `upgrade-status` service
  - has a method to trigger the alert and toggle the "upgrade required" mode
  - is injected into all routes by default so that it can be checked before
    transitioning
- add `Route` override
  - updates the `willTransition` hook to check the `upgrade-status` service
    and abort the transition if we're in "upgrade required" mode
- update notifications `showAPIError` method to handle version mismatch errors
- update any areas where we were catching ajax errors manually so that the
  version mismatch error handling is obeyed
- fix redirect tests in editor acceptance test
- fix mirage's handling of 404s for unknown posts in get post requests
- adjust alert z-index to to appear above modal backgrounds
2016-07-08 14:56:26 +01:00
..
adapters convert ember imports to ember-cli-shim imports where possible (#95) 2016-06-30 11:21:47 +01:00
authenticators convert ember imports to ember-cli-shim imports where possible (#95) 2016-06-30 11:21:47 +01:00
authorizers deps: ember-simple-auth@1.0.0 2015-10-18 13:17:02 -05:00
components "400 Version Mismatch" error handling 2016-07-08 14:56:26 +01:00
controllers "400 Version Mismatch" error handling 2016-07-08 14:56:26 +01:00
helpers convert ember imports to ember-cli-shim imports where possible (#95) 2016-06-30 11:21:47 +01:00
html Slack integration 2016-05-08 12:49:15 +02:00
initializers "400 Version Mismatch" error handling 2016-07-08 14:56:26 +01:00
instance-initializers convert ember imports to ember-cli-shim imports where possible (#95) 2016-06-30 11:21:47 +01:00
mirage "400 Version Mismatch" error handling 2016-07-08 14:56:26 +01:00
mixins "400 Version Mismatch" error handling 2016-07-08 14:56:26 +01:00
models convert ember imports to ember-cli-shim imports where possible (#95) 2016-06-30 11:21:47 +01:00
routes "400 Version Mismatch" error handling 2016-07-08 14:56:26 +01:00
serializers convert ember imports to ember-cli-shim imports where possible (#95) 2016-06-30 11:21:47 +01:00
services "400 Version Mismatch" error handling 2016-07-08 14:56:26 +01:00
session-stores Update package.json details, rename module to ghost-admin 2016-06-03 16:12:54 +01:00
styles "400 Version Mismatch" error handling 2016-07-08 14:56:26 +01:00
templates "400 Version Mismatch" error handling 2016-07-08 14:56:26 +01:00
transforms convert ember imports to ember-cli-shim imports where possible (#95) 2016-06-30 11:21:47 +01:00
utils "400 Version Mismatch" error handling 2016-07-08 14:56:26 +01:00
validators convert ember imports to ember-cli-shim imports where possible (#95) 2016-06-30 11:21:47 +01:00
_config.yml The great migration (EAK -> ember-cli) 2015-03-11 12:37:41 -06:00
app.js "400 Version Mismatch" error handling 2016-07-08 14:56:26 +01:00
index.html Restructure Configuration API endpoint 2016-02-19 18:49:23 +00:00
README.md Convert Sass to Myth 2015-05-22 19:05:09 +01:00
resolver.js deps: ember-cli@2.3.0 2016-02-16 12:32:48 -06:00
router.js convert ember imports to ember-cli-shim imports where possible (#95) 2016-06-30 11:21:47 +01:00
transitions.js Subscribers: Admin User Interface v1 2016-05-11 10:28:11 +02:00

Ghost Admin Client

Ember.js application used as a client-side admin for the Ghost blogging platform. This readme is a work in progress guide aimed at explaining the specific nuances of the Ghost Ember app to contributors whose main focus is on this side of things.

CSS

We use pure CSS, which is pre-processed for backwards compatibility by Myth. We do not follow any strict CSS framework, however our general style is pretty similar to BEM.

Styles are primarily broken up into 4 main categories:

  • Patterns - are base level visual styles for HTML elements (eg. Buttons)
  • Components - are groups of patterns used to create a UI component (eg. Modals)
  • Layouts - are groups of components used to create application screens (eg. Settings)

All of these separate files are subsequently imported and compiled in app.css.

Front End Standards

  • 4 spaces for HTML & CSS indentation. Never tabs.
  • Double quotes only, never single quotes.
  • Use tags and elements appropriate for an HTML5 doctype (including self-closing tags)
  • Adhere to the Recess CSS property order.
  • Always a space after a property's colon (.e.g, display: block; and not display:block;).
  • End all lines with a semi-colon.
  • For multiple, comma-separated selectors, place each selector on its own line.
  • Use js- prefixed classes for JavaScript hooks into the DOM, and never use these in CSS as per Slightly Obtrusive JavaSript
  • Avoid over-nesting CSS. Never nest more than 3 levels deep.
  • Use comments to explain "why" not "what" (Good: This requires a z-index in order to appear above mobile navigation. Bad: This is a thing which is always on top!)