Commit Graph

9508 Commits

Author SHA1 Message Date
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
Kevin Ansfield
f76d7e9cd2 Renamed editor-labs component directory to editor
no issue

- cleanup now the old publish flow is no more
2022-05-25 09:13:08 +01:00
Simon Backx
49c0a64184 Cleaned up removed feature flags
refs https://github.com/TryGhost/Team/issues/1616
2022-05-25 10:11:24 +02:00
Sanne de Vries
edbdcb410d Fixed spacing bug on filtered posts empty state 2022-05-25 10:08:47 +02:00
renovate[bot]
db09ec7b01 Update dependency glob to v8.0.3 (#2383)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2022-05-25 08:48:24 +01:00
renovate[bot]
e915ca6892 Update dependency @tryghost/color-utils to v0.1.17 (#2385)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2022-05-25 08:48:11 +01:00
renovate[bot]
7125f2cddd Update dependency @tryghost/helpers to v1.1.69 (#2386)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2022-05-25 08:47:58 +01:00