Commit Graph

9439 Commits

Author SHA1 Message Date
Kevin Ansfield
e1dfe3edb0 🎨 Improved save/update button copy in editor (#2413)
no issue

- renamed "Update" to "Unpublish" or "Unschedule" to match the available actions
- renamed "Save" to "Update" and made it always visible but disabled when there are no unsaved changes
- switched <Editor::PublishManagement> to a provider component and extracted `<Editor::PublishButtons>`
  - allows for the management flow to wrap other UI elements and have the yielded actions passed down so the publish/update flow can be opened from more than just the publish/unschedule/unpublish buttons
- added link to "Sent" in editor status that opens the update flow for email-only posts

Co-authored-by: Peter Zimon <peter.zimon@gmail.com>
2022-06-01 13:48:33 +01:00
Kevin Ansfield
ed235b374d Increased publish flow acceptance tests
refs https://github.com/TryGhost/Team/issues/1586

- updated `?newsletter_id=id` handling in posts API mock to match the real `?newsletter=slug` behaviour
- added additional publish flow acceptance tests for single/multiple newsletter behaviour, scheduling, and sending
2022-05-31 22:59:20 +01:00
Peter Zimon
4d89ddf5bf Added 2 digit pad to fraction prices 2022-05-31 17:38:43 +02:00
Sodbileg Gansukh
ce37e969ce Updated Casper screenshot 2022-05-31 16:47:30 +08:00
Kevin Ansfield
99f05e14b2 🐛 Fixed default publish type being "Publish and email" when default recipients set to "Usually nobody"
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
2022-05-30 20:04:04 +01:00
Kevin Ansfield
3f0e46c7b0 Added initial tests for new 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
2022-05-30 19:12:16 +01:00
Kevin Ansfield
b123b297b6 Improved test settings fixtures
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
2022-05-30 14:09:29 +01:00
Daniel Lockyer
3d0e4c9380 v5.1.1 2022-05-30 13:54:28 +01:00
Kevin Ansfield
e4b402c603 Sped up tests that use {{liquid-if}}
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
2022-05-30 12:10:37 +01:00
Djordje Vlaisavljevic
ac52e01977 Put less emphasis on the "Send test email" button 2022-05-30 12:42:13 +02:00
Kevin Ansfield
09400a1ef8 🐛 Fixed broken file selectors in labs, general, and portal settings screens
refs 8fee5f155b

- the conversion from jQuery to native was incomplete in a few places and still used `.find()` in place of `.querySelector()`
2022-05-29 11:18:55 +01:00
Daniel Lockyer
f9736d2437 v5.1.0 2022-05-27 16:10:19 +01:00
Kevin Ansfield
508af14460 Fixed linting
refs 3f9c019bc0
2022-05-27 15:24:30 +01:00
Kevin Ansfield
3f9c019bc0 Fixed editor error when using blockquote text expansion in product/toggle card content
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
2022-05-27 15:21:54 +01:00
Simon Backx
191c7e312b 🎨 Reduced favicon requirements (#2408)
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).
2022-05-27 16:20:40 +02:00
Kevin Ansfield
cab7f2cd74 🐛 Fixed paste into product card descriptions not stripping header formatting
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
2022-05-27 15:11:08 +01:00
Hannah Wolfe
8ac5bb5b48 🐛 Fixed word count for RTL languages
closes: https://github.com/TryGhost/Ghost/issues/14365
closes: https://github.com/TryGhost/SDK/issues/366
closes: https://github.com/TryGhost/SDK/issues/389
refs: https://github.com/TryGhost/SDK/pull/431

- our word count helper has been updated to handle RTL languages

Co-authored-by: Emmanuel-Melon <emmanuelgatwech@gmail.com>
2022-05-27 13:58:48 +01:00
Kevin Ansfield
8e9582d632 Migrated signup screen to Octane patterns
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}}`
2022-05-27 13:28:29 +01:00
Kevin Ansfield
33d724527c Fixed linter error
refs 817bc3453d
2022-05-27 13:07:36 +01:00
Kevin Ansfield
817bc3453d Cleaned up unused profile image upload in signup controller
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
2022-05-27 13:04:33 +01:00
Peter Zimon
1b682696cc Fixed publish end screen bookmark text overflow bug 2022-05-27 13:28:42 +02:00
Kevin Ansfield
67d87e8756 Fixed flash of failure state when submitting site setup and staff signup forms
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
2022-05-27 12:13:54 +01:00
Kevin Ansfield
c24ea5d0bc Fixed raw JS error messages appearing in alerts (#2407)
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
2022-05-27 11:52:39 +01:00
Kevin Ansfield
b9707a2b4a Moved logic for publish confirm button text states into backing class (#2397)
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
2022-05-27 11:45:40 +01:00
Matt Hanley
a8acd63aff Merged v5.0.2 into main
v5.0.2
2022-05-26 15:23:32 +01:00
Daniel Lockyer
bcde7970fb v5.0.2 2022-05-26 15:17:24 +01:00
Kevin Ansfield
ffdbde8eed 🐛 Fixed editor cards sometimes being removed as soon as they are added
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
2022-05-26 15:09:58 +01:00
James Morris
2f85bd6ea4 Fixed the button positions and spacings for the Publish, Save and Sidebar icons in the editor
no issue
2022-05-26 13:47:38 +01:00
Kevin Ansfield
a4df422249 🐛 Fixed editor cards sometimes being removed as soon as they are added
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
2022-05-26 12:39:15 +01:00
Kevin Ansfield
8fee5f155b Standardized on non-jQuery file dialog triggers
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
2022-05-26 11:05:14 +01:00
Kevin Ansfield
aaef8f7d44 Deleted unused <GhProfileImage> component
no issue

- the component became unused when the staff user page design was updated but was never cleaned up
2022-05-26 10:42:10 +01:00
Kevin Ansfield
1130b609c3 Fixed linter errors in <KoenigCardProduct> template
refs https://github.com/TryGhost/Ghost/issues/14101
2022-05-26 10:09:00 +01:00
Renovate Bot
f4f519ed90 Update dependency grunt to v1.5.3 [SECURITY] 2022-05-25 22:23:31 +00:00
Kevin Ansfield
d23b7525a4 Removed post.email from serialization when saving posts
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
2022-05-25 14:27:05 +01:00
Simon Backx
741d00baf6 Removed tweetGridCard feature flag 2022-05-25 13:52:57 +02:00
Kevin Ansfield
7356bfbcd9 Migrated notifications tests to Octane patterns
refs e021843e3f

- fixed closing of alerts due to missing `.args` after migrating to glimmer syntax
- updated related tests for glimmer component syntax
2022-05-25 12:45:26 +01:00
Kevin Ansfield
e021843e3f Migrated notifications to Octane patterns
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
2022-05-25 12:16:37 +01:00
renovate[bot]
0c07e26cc4 Update babel monorepo to v7.18.2 (#2406)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2022-05-25 11:24:38 +01:00
Kevin Ansfield
36564a984f Deleted email-recipient model file missed in relationship cleanup
refs 1ade40d697
2022-05-25 11:22:09 +01:00
Kevin Ansfield
1ade40d697 Removed unneeded member.emailRecipients relationship setup
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
2022-05-25 11:18:37 +01:00
Kevin Ansfield
5544389b80 Fixed "The routes only function has been deprecated" output in test runs
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
2022-05-25 11:03:05 +01:00
Simon Backx
7f6de77cee Removed selectablePortalLinks feature flag
refs https://github.com/TryGhost/Team/issues/1616
2022-05-25 11:36:30 +02:00
renovate[bot]
8115a4b6d2 Update dependency @tryghost/timezone-data to v0.2.68 (#2369)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2022-05-25 10:14:05 +01:00
Kevin Ansfield
c69509ee1b Updated .lint-todo
refs 99bfde4417
2022-05-25 10:12:27 +01:00
Kevin Ansfield
99bfde4417 Converted <GhCanvasHeader> to glimmer component
no issue

- added `{{on-scroll}}` modifier to replace custom setup and teardown of event handlers inside the component
2022-05-25 10:07:11 +01:00
Sanne de Vries
96a2e016b1 Fixed truncation of publication title in post bookmark 2022-05-25 10:39:00 +02:00
Sanne de Vries
7263d74c15 Truncated publication and author names in post bookmark 2022-05-25 10:33:19 +02:00
Peter Zimon
90dfe9f0df Fixed button type from membership settings link 2022-05-25 10:27:44 +02:00
Sanne de Vries
5edc95d96d Fixed dark mode issues in publishing flow 2022-05-25 10:23:11 +02:00
Kevin Ansfield
a09a1939c7 Fixed linter errors in editor preview templates 2022-05-25 09:13:08 +01:00