Commit Graph

4771 Commits

Author SHA1 Message Date
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
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
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
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
Simon Backx
7f6de77cee Removed selectablePortalLinks feature flag
refs https://github.com/TryGhost/Team/issues/1616
2022-05-25 11:36:30 +02: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
Kevin Ansfield
90be535eb8 Fixed linter error
refs a90f9d275c
2022-05-24 17:56:12 +01:00
Kevin Ansfield
a90f9d275c Fixed "Update support address" button showing error on success
no issue

- the API response is now empty so returning the parsed response is null/undefined resulting in `<GhTaskButton>` showing a failure state
- switched to returning an enforced `true` value, if there was an error that's handled by the try/catch
2022-05-24 17:52:31 +01:00
Simon Backx
3f95a5e00f Removed unnecessary and helper 2022-05-24 16:55:50 +02:00
Simon Backx
bc1aa493fa 🐛 Fixed unreliable paid members enabled checks (#2405)
refs https://github.com/TryGhost/Team/issues/1650

- Some places only checked for Stripe being connected via the 'connect' method and ignored the 'direct' method
- Updated (where possible) admin to use the new calculated `paid_members_enabled` setting
2022-05-24 16:53:03 +02:00
Kevin Ansfield
94c192041d Added guards for missing codemirror elements when destroying markdown cards
no issue

- if a markdown card is created and destroyed before the simplemde+codemirror instance is fully initialised we could throw errors due to simplemde calling methods on objects that don't yet exist during teardown
- we also had issues with the `_applyToolbarStyles()` method being called async by event handlers after the component was destroyed
2022-05-24 13:12:22 +01:00
Hannah Wolfe
1ca5b43fcb Fixed link to redirect documentation
closes: https://github.com/TryGhost/Ghost/issues/14888

- tutorials no longer lives under docs
2022-05-24 12:31:33 +01:00
Sanne de Vries
70f82896cd Added break-all to email addresses on member details page 2022-05-24 13:25:53 +02:00
Kevin Ansfield
7dd32423b6 🐛 Fixed inability to select a date in future months when scheduling
no issue

- selecting a date in a future month always selected the same day number in the current month, if that was in the past it would also reset to "in 5 minutes"
- we were grabbing the day/month/year from the moment object provided by the calendar picker but we weren't using the correct property names, moment.js uses `months` and `years` instead of `month` and `year`
2022-05-24 10:41:50 +01:00
Sanne de Vries
446ab3a9d8 Fixed subscriber count formatting on publish confirmation page
No ref
2022-05-24 10:57:56 +02:00
Kevin Ansfield
2502639a86 🐛 Fixed timezone related issues when scheduling posts
no issue

- fixed incorrect conversion of time when converting between site tz and utc when setting scheduled hour/minute in publish flow
  - we initially created a UTC `newDate` moment from `publishOptions.scheduledAtUTC` but then used `newDate.tz(siteTimezone).format()` to get the time which was the source of the bug, it was assumed that was a non-destructive action returning a new date but it actually changed the underlying date resulting in the later calculations causing timezone adjustments to be applied twice
  - simplified by not converting to UTC inside the publish-at component as that's already handled inside PublishOptions
- fixed time not resetting to minimum schedule time when set to earlier date than allowed
2022-05-23 22:12:37 +01:00
Djordje Vlaisavljevic
f3b56d092a Fixed text overflow in the input field 2022-05-20 12:09:41 +02:00
Djordje Vlaisavljevic
80a9a664a7 Fixed mobile preview border-radius issue in Safari 2022-05-20 10:13:03 +02:00
Simon Backx
552800bde7 Fixed dashboard recent posts not showing email only posts
refs https://ghost.slack.com/archives/C02G9E68C/p1652982196273769
2022-05-20 09:34:25 +02:00
Kevin Ansfield
7a5f15414b Fixed scheduled publishedAt validation being triggered unexpectedly
no issue

Problem:
- the server stores time with second-level precision but we send milliseconds
- when scheduling a post we were storing the selected publish-at time in the PublishOptions instance with non-zero milliseconds as the initial date was based on now+5mins
- when we were saving after the initial schedule that millisecond-containing time was still being used resulting in a perceived time difference in our client-side and server-side validations indicating that the published_at value should be updated, but when that time was <2 mins in the future the published_at change validation was triggered resulting in errors

Solution:
- ensure we only set times on PublishOptions with 0 milliseconds
- update client-side validations so we only trigger published_at validation when it's dirty

Also fixed:
- client-side validation errors were not shown on the confirm step due to a missing `.args`
2022-05-19 23:11:01 +01:00
Simon Backx
bafbe9b6b0 Fixed paid subscribers graph not counting all items
refs https://ghost.slack.com/archives/C02G9E68C/p1652971697862399?thread_ts=1652893154.768669&cid=C02G9E68C

mergeDates skips a value when the date of the next item is different than the currently aggregating entry
2022-05-19 17:20:03 +02:00
Djordje Vlaisavljevic
d2db9c6a7f Fixed dropdown flicker in dark mode 2022-05-19 16:44:16 +02:00
Sanne de Vries
20b797d2e4 Updated subscriber count in newsletter selection dropdown in publish flow
No ref
2022-05-19 15:17:55 +02:00
Kevin Ansfield
802a3c6187 Skipped animation when switching between preview modal tabs
refs 2c9998be69

- animation should only show when opening the preview modal directly from the editor
2022-05-19 13:33:23 +01:00
Sanne de Vries
2c9998be69 Added animation to post preview modes and publish button
No ref
2022-05-19 14:13:12 +02:00
Sanne de Vries
2941065eb7 Added back button to completed publishing flow
No ref
2022-05-19 13:39:40 +02:00
Kevin Ansfield
b03aa5f255 Added reverse animation to publish/preview modal contents when closing modal
refs 2fb62708a8

- use modal's own `.epm-out` class that's added when closing to trigger the reverse of the fade-in animation
- added `.publish-modal` class to the three publish modals so we can alter the default modal animations/timing if required
2022-05-19 12:19:55 +01:00
Simon Backx
e7a703ee73 Removed commented css code 2022-05-19 13:19:21 +02:00
Simon Backx
195733af2c Fixed icon and button colours in dark mode
refs https://ghost.slack.com/archives/C02G9E68C/p1652957053084759

- Activiy feed filters label colours
- Activiy feed member email address text colour
- . (i) icon when editing newsletters
- colour of edit pencil when editing free tier
- paid tiers 'active' dropdown button colour
2022-05-19 13:15:30 +02:00
Kevin Ansfield
08aa2d91ba Skipped publish flow modal animations when swapping between publish/preview
no issue

- updated the publish/preview toggle action to pass a `skipAnimation` data attribute to the modals when opening if they are being swapped rather than initially opened
2022-05-19 12:02:23 +01:00
Djordje Vlaisavljevic
5d0e3d2536 Fixed icon color in dark mode 2022-05-19 13:01:26 +02:00