Ghost/ghost/admin
Kevin Ansfield 2625199fb2 Removed duplication of "delete if empty" card logic
no issue

The logic for "delete if empty" was duplicated in two places:

1. when `createComponentCard` is used to register a card, this option method was used when cleaning up a post when first rendering (cards in empty state can be saved before the editor auto-removes them but we don't want to show them again)
2. inside of card's own delete-if-empty handling on certain actions such as deselection or leaving edit mode

- added an `ifEmpty` property to each card component
  - used by the editor's first-render cleanup routing if the property is present
  - can be re-used internally for the card's own deselect/exit-edit-mode behaviour
- updated the cleanup routine in `<KoenigEditor>`
  - added a `allComponentCardsRegistered` property that will return `true` when the `.component` property is set on every card (the property is set during card component initialisation so we're at the mercy of Ember's render process so not all card components will be immediately registered)
  - swapped `_cleanup` for `_cleanupTask` that will wait for `allComponentCardsRegistered` to be `true` before performing cleanup, ensuring that we always have access to the card component's `isEmpty` property even when Ember renders cards across multiple render batches
  - checks for `isEmpty` being a boolean and will delete the card if it's value is `true`
- updated all cards that had delete-if-empty behaviour
  - added `isEmpty` properties
  - removed duplicated logic in the `createComponentCard` calls
2021-11-10 14:46:00 +00:00
..
.github Added support for Node 16 2021-10-27 10:46:00 +01:00
app Updated link styles in Button and Email CTA cards 2021-11-10 15:42:35 +01:00
config Added codecov.io coverage uploader to CI 2021-10-21 10:37:03 +02:00
lib Removed duplication of "delete if empty" card logic 2021-11-10 14:46:00 +00:00
mirage Fixed linter error 2021-11-01 18:40:47 +00:00
public/assets Deleted Massively and Editorial screenshots 2021-11-05 16:25:03 +01:00
tests Fixed tests expecting old theme settings screen 2021-11-10 12:45:26 +00:00
.csscomb.json Unsplash integration 2017-08-15 16:01:12 +01:00
.editorconfig deps: ember-cli@2.8.0 2016-10-07 17:32:30 +01:00
.ember-cli Co-located component template files 2020-05-18 13:14:08 +01:00
.eslintignore Bumped ember core dependencies to 3.5.x 2019-03-06 07:39:51 +00:00
.eslintrc.js Update dependency eslint-plugin-ghost to v2.0.0 2020-10-23 09:59:09 +01:00
.gitignore Updated gitignore to exclude IDE files 2021-06-09 15:42:13 +05:30
.watchmanconfig deps: ember-cli@1.13.13 2015-11-30 11:21:39 -06:00
ember-cli-build.js Initial ember-promise-modals implementation 2021-09-13 13:01:12 +01:00
ember-cli-update.json Updated core files to match ember-cli new output 2020-08-03 09:24:58 +01:00
Gruntfile.js Bower => NPM (#972) 2018-03-19 17:56:09 +00:00
LICENSE 2021 2021-01-25 16:51:15 +00:00
package.json Updated parser plugin to add toggle card 2021-11-10 20:14:40 +05:30
README.md Updated badge URL in README 2021-02-03 09:21:06 +00:00
renovate.json Removed ember-testing group from Renovate config 2021-05-12 15:52:17 +01:00
SECURITY.md Updated links to ghost.org sites 2021-01-19 13:18:59 +13:00
testem.js Increased testem's browser_start_timeout to 120s 2020-07-20 12:20:26 +01:00
yarn.lock Updated parser plugin to add toggle card 2021-11-10 20:14:40 +05:30

Ghost-Admin

This is the home of Ember.js based admin client that ships with Ghost.

Do you want to set up a Ghost blog? Check the getting started guide

Do you want to modify or contribute to Ghost-Admin? Please read how to install from source and swing by our forum if you need any help 😄

Have a bug or issue?

Bugs and issues (even if they only affect the admin client) should be opened on the core Ghost repository.

Copyright & License

Copyright (c) 2013-2021 Ghost Foundation - Released under the MIT license. Ghost and the Ghost Logo are trademarks of Ghost Foundation Ltd. Please see our trademark policy for info on acceptable usage.