no issue
The default recipients setting "Usually nobody" was being respected with the email recipient list defaulting to no members selected. However the UI for that state was confusing because the default publish options ended up being "Publish and email" and "Not sent as a newsletter" but it was expected to be "Publish" with the newsletter option being disabled.
- updated the `PublishOptions` setup to reflect the desired outcome for "Usually nobody"
- default publish type is set to "Publish"
- default email recipients are set to match post visibility - this means there are fewer clicks required when switching from "Publish" to "Publish and send"
- updated mirage data setup so any members created are automatically assigned to any newsletter instance with `subscribeOnSignup` set
- ensures we get proper member counts in the publish flow
refs https://github.com/TryGhost/Team/issues/1586
- added test helper for enabling/disabling members and helpers for disabling mailgun and newsletters
- added `loginAsRole` helper that alleviates duplication of user+role creation and also handles log-out before log-in so it's easier to mix different role tests within a block that has a default role setup in `beforeEach()`
- cleaned up editor tests that were skipped due to using the old publish flow
- added `Publish flow` acceptance test suite with an initial batch of tests
no issue
- the settings fixtures file was becoming hard to use because settings have been appended to it on an as-used basis which meant it was difficult to reason about the base-state in acceptance tests and was never really in sync with the default settings state for a Ghost site
- added a utility function to create a settings object with the `id` defined to avoid problems with manually updating the ids in the list
- updated to include all default settings with their default values if not already set to a specific testing value in the old fixtures
no issue
- some tests were unnecessarily slowed down by waiting repeatedly for animations to complete
- added override for `<LiquidContainer>` component that `<LiquidIf>` uses internally with the only change being to set the default growth animation duration to 5ms when running tests
no issue
- `<KoenigBasicHtmlTextarea>` has no UI or keyboard shortcut support for blockquotes but the markdown text expansion for quotes was left in despite the code required for it not existing, this meant any time `> text` was typed the editor would throw errors due to missing actions
refs TryGhost/Team#1652
- Support picking new image types in the favicon image uploader.
- Added support for non-square and not resizable files (e.g., svg files) as favicon (cover background image).
closes https://github.com/TryGhost/Ghost/issues/14018
- product card descriptions and toggle card content both use `<KoeingBasicHtmlTextarea>` which is a stripped down Koenig editor with basic formatting support where heading sections are not expected
- when pasting into or updating the content in `<KoeingBasicHtmlTextarea>`, convert any headings, blockquotes, or other markerable section types to standard paragraphs so the content formatting matches what is possible through the editing interface
refs https://github.com/TryGhost/Ghost/issues/14101
- dropped usage of `<GhTrimFocusInput>` and `<GhTextInput>` in favor of native input elements for more explicit behaviour
- switched `SignupController` to native class syntax
- migrated to `@action` decorators and swapped all template action triggers to `{{on}}` and `{{fn}}`
refs https://github.com/TryGhost/Admin/pull/2286
- the UI to upload a profile image during setup/signup was removed as part of the auth screens redesign but the related code was left behind
no issue
- ensure tasks return `true` or `false` so the button states reflect reality
- added `@showSuccess={{false}}` to both forms because they automatically switch to a new screen on success so there's no point showing a flash of the success state
- removed unnecessary and not-recommended tabindex properties on form elements
refs https://github.com/TryGhost/Team/issues/1613
We use `notifications.showAPIError()` in many of our try/catch routines but those can also pick up standard JS errors which can result in ugly and useless messages showing in alerts.
- added a list of known built-in JS error type names to check against and a generic error message to be used in place of ones we know shouldn't be displayed
- in `showAPIError(obj)` check `obj.name` against the known list and swap the message for a generic one
- only the message is swapped, we still log the full/original error to Sentry
- in `handleNotification(msg)` which is the final method used when displaying any alert/notification, extract all words in the supplied message and check that against the known list and swap the message on a match. This handles situations where the API might give us a raw JS error message in the message string
refs a021553203
- keeps text and logic together, avoids duplication of button code just for changing the running/success text
- added a `buttonTextMap` to keep the high-level text states in one place
- added `publishType` getter for easier switching between states in other getters and to have one place for the logic
- updated `confirmButtonText` getter and added `confirmRunningText` and `confirmSuccessText` getters that read from the button text map so the pattern used for getting text to pass as arguments in the template is consistent
no issue
When adding cards to the editor, especially image cards, we were seeing the cards removed instantaneously or whilst the file dialog was open making it appear that nothing had happened after selecting the card in the menu or selecting a file.
- as part of the publish flow workflow we extracted the pre-save routine into a separate task so that it could be triggered from external components
- one of the pre-save routine actions was to trigger an editor cleanup that removes empty cards and trailing paragraphs _but_ it should only do that when not performing a background save that occurs on any change to the post contents for drafts
- the problem arose from the background saves because the `options` argument was never passed through to the `beforeSaveTask` call meaning every save looked like a full save and performed editor cleanup resulting in unexpected removal of empty cards that had just been created
no issue
When adding cards to the editor, especially image cards, we were seeing the cards removed instantaneously or whilst the file dialog was open making it appear that nothing had happened after selecting the card in the menu or selecting a file.
- as part of the publish flow workflow we extracted the pre-save routine into a separate task so that it could be triggered from external components
- one of the pre-save routine actions was to trigger an editor cleanup that removes empty cards and trailing paragraphs _but_ it should only do that when not performing a background save that occurs on any change to the post contents for drafts
- the problem arose from the background saves because the `options` argument was never passed through to the `beforeSaveTask` call meaning every save looked like a full save and performed editor cleanup resulting in unexpected removal of empty cards that had just been created
no issue
- we had a mix of legacy jQuery triggers and native triggers for file input clicks and jQuery hasn't been required to do this in our target browsers for quite a long time now so it made sense to update all click triggers to avoid old patterns being replicated
- cleaned up some conditionals with optional-chaining
- removed use of `run.bind(this)` for methods that use `@action` because the binding is already handled for us
closes https://github.com/TryGhost/Team/issues/1647
- sending the embedded `email` record back to the API when saving could trigger "Request entity too large" errors for very large posts that were sent as email because it doubles up on the request size
- `post.email` is a read-only property and is ignored by the API so there's no point serializing it and making request bodies larger than they need to be
refs e021843e3f
- fixed closing of alerts due to missing `.args` after migrating to glimmer syntax
- updated related tests for glimmer component syntax
no issue
- migrated `notifications` service from EmberObject to true native class
- switched to tracked properties and use of `TrackedArray`
- swapped computed properties to getters
- dropped unnecessary usage of `get` and `set`
- migrated alert/notification related components to Glimmer components
no issue
- the relationship is no longer used (it was a temporary solution whilst we built full member events) and was never fully set up resulting in warning output in test runs
- dropped remaining vestiges of the relationship
no issue
`ember-cli-mirage` replaced the use of a default function export with a `createServer` function that applies config and deprecated the older mirage config export style. It will also soon drop support of the separate `testConfig` export we used for defining our test routes.
- switched to the newer `return createServer(config);` server configuration approach
- extracted dev and test routes into separate files for a cleaner base config