Commit Graph

7185 Commits

Author SHA1 Message Date
Kevin Ansfield
3e82a19791 Fixed linter error 2021-07-21 20:34:30 +01:00
Kevin Ansfield
5b09cd5bef Added segment selection to email-cta card
refs https://github.com/TryGhost/Team/issues/926

- updated `<KoenigEditor>` so it creates default card payloads as TrackedObject instances so that getters in glimmer component based cards can track changes to payload properties
- added dropdown free/paid selector to email-cta card that sets the `segment` payload property to the respective filter
- updated design to show the footer outside of edit mode too so that the selected segment is always visible
2021-07-21 18:39:33 +01:00
Rishabh
ad3126b632 Added alpha feature flag for members filtering feature
refs https://github.com/TryGhost/Team/issues/925
2021-07-21 21:21:50 +05:30
Kevin Ansfield
019a1cf41d 🐛 Fixed publication icon in nav bar sometimes appearing inverted in dark mode
no issue

- `iconClass` was set to `gh-nav-logo-default` when first loading admin with the default icon
- when a new icon was uploaded the background style was changed but the class wasn't reset so continued to appear inverted
2021-07-21 11:40:55 +01:00
Thibaut Patel
a7f47b30b7 Added a feature flag to the oauth login feature
issue https://github.com/TryGhost/Team/issues/614

- Makes the feature confiration more similar to other feature flags
2021-07-20 23:18:45 +02:00
Kevin Ansfield
84581e9109 Converted <KoenigCardEmailCta> to native class glimmer component
no issue

- switched to native class syntax
- updated to glimmer/octane syntax
- fixed infinite render issue from `<KoenigTextReplacementHtmlInput>`'s `didReceiveAttrs()` lifecycle hook
2021-07-20 18:33:39 +01:00
Daniel Lockyer
832f9defe8 v4.10.0 2021-07-20 13:45:52 +01:00
Kevin Ansfield
bb20e56d13 Bumped Koenig-related packages
no issue

- dropped node 10 support
2021-07-20 12:21:42 +01:00
Kevin Ansfield
463c610e70 Duplicated email card as email-cta
refs https://github.com/TryGhost/Team/issues/910

- readying the foundation for adding segment selection and CTA config to the `email-cta` card
- will only be available to select from card menus when the `emailCardSegments` feature flag is enabled
2021-07-20 10:54:19 +01:00
Kevin Ansfield
10f83ebd45 Added support for feature-gated editor cards
refs https://github.com/TryGhost/Team/issues/910

- added `card-is-available` helper that handles the previous `card.developerExperiment` and the new `card.feature` options
- updated `<KoenigMenuContent>` to use the `card-is-available` helper in the conditional when adding cards to the list

Cards can be gated by feature when specifying them in `cards.js`, in the card definition object you can add `feature: 'flagName'` which will mean the card is only available when that feature is enabled.
2021-07-20 10:48:41 +01:00
Sanne de Vries
6e540cf2ef Changed drag&drop indicator color 2021-07-20 11:30:10 +02:00
Kevin Ansfield
d6a01147cc Updated labs description of emailCardSegments feature
refs https://github.com/TryGhost/Team/issues/910

- segmented email content will be used for a new "Email-only CTA" card
- updated labs checkbox text to reflect what's actually being turned on/off
2021-07-20 10:09:50 +01:00
Renovate Bot
98d3517847 Update dependency @tryghost/members-csv to v1.1.2 2021-07-20 08:46:03 +01:00
Peter Zimon
a6ba245bcd Updated copy for tiers
- Updated copy of multiple products to "Tiers"
2021-07-19 12:39:59 +02:00
Renovate Bot
a78ed7cf81 Update dependency eslint-plugin-ghost to v2.6.0 2021-07-19 10:06:27 +00:00
Rishabh
95c3759282 Removed focus out error handling for invite staff modal
refs https://github.com/TryGhost/Team/issues/732

This fix is part of the broader design change we want in Admin, moving away from showing errors on focus out in fields with feels a little aggressive and instead change it to the default behaviour of showing errors when submitting the form. This change updates this behaviour for invite staff modal.
2021-07-19 14:02:15 +05:30
Renovate Bot
dea8dbe81a Lock file maintenance 2021-07-19 02:29:24 +00:00
Renovate Bot
34f9e31d1d Update dependency eslint to v7.31.0 2021-07-19 01:05:44 +00:00
Kevin Ansfield
876c2b6cdd Added first pass at feature image drag+drop uploading
refs https://github.com/TryGhost/Team/issues/884

- add `[data-user-is-dragging]` to `body` element when any drag is occurring so that we can make drop zones active
- added dropzone and drop handling to feature image component
2021-07-16 15:01:00 +01:00
Rishabh
0f9177919c Refined segment selection in default post access setting
closes https://github.com/TryGhost/Team/issues/862

- allows deleting a single product in the segment dropdown
- shows error message in segment when no product is selected
2021-07-16 18:31:23 +05:30
Rishabh
031339ad6d Fixed typo in post save notification
refs 1ad2c05d37 (diff-7541a4cdb9acc4ffbfc9317258269618a25bc5ea9aa3fadd1a9123c6dc0839a9L959-R959)

-  removes typo `.htmlSafe` from actions to fix the save message
2021-07-16 13:20:28 +05:30
Sanne de Vries
f901adf5ae Updated drag & drop indicator color 2021-07-15 16:26:01 +01:00
Kevin Ansfield
04f39e047e Always show feature image buttons when no title is set
no issue

- keeps the buttons visible for longer to aid discovery
2021-07-15 15:50:32 +01:00
Kevin Ansfield
1ad2c05d37 Bumped eslint-plugin-ghost and fixed linter errors
no issue

- new linting rules that needed fixing:
   - calling `super` in lifecycle hooks
   - no usage of String prototype extensions
2021-07-15 15:27:29 +01:00
Kevin Ansfield
7a3b171f7f Fixed error when interacting with tag accent color input
closes https://github.com/TryGhost/Team/issues/744

- we were using `{{on}}` with a function on the component that wasn't bound to `this` via the `action` decorator meaning errors were thrown every time the input lost focus
2021-07-14 16:00:24 +01:00
Kevin Ansfield
85f579b785 Fixed error when entering invalid URL in canonical URL field
closes https://github.com/TryGhost/Team/issues/745

- `URL()` will throw when given something it doesn't understand. As `seoURL` is just a display property it doesn't matter, we can catch the error and do nothing
2021-07-14 15:53:55 +01:00
Kevin Ansfield
8cbf2a5eea Fixed transformer error when saving invalid twitter/facebook URLs
closes https://github.com/TryGhost/Team/issues/746

- `.match()` returns `null` if there's no match which then breaks the array destructuring
2021-07-14 15:24:17 +01:00
Kevin Ansfield
b3b5ac6cef Fixed error when resizing browser after pasting embed link
closes https://github.com/TryGhost/Team/issues/749

- resize event listener is created twice when converting a link to an embed card, if we don't clear the older resize event handler before creating a new one then it persists after the component is torn down and the iframe no longer exists
2021-07-14 14:50:59 +01:00
Kevin Ansfield
9bc799258d Fixed more tests
refs 8630be5a87

- referenced commit skipped current user and proxy service population when `skipAuthSuccessHandler` was set but the population is needed during setup
- `skipAuthSuccessHandler` is used for skipping the post-authentication transition rather than skipping all post-auth behaviour so the the post-auth behaviour was reintroduced but put in a guard so we don't try to do it again when it's already been run
2021-07-14 13:15:59 +01:00
Kevin Ansfield
a7dc63cfab Fixed tests
refs 8630be5a87

- referenced commit introduced an early return when invalidating session on a failed ajax request so that error alerts weren't shown when re-authenticating. This had an unintended side-effect of breaking invalidation when not re-authenticating and redirecting to signin screen
2021-07-14 12:55:23 +01:00
Kevin Ansfield
8630be5a87 🐛 Fixed re-authenticate modal not showing when saving in editor
closes https://github.com/TryGhost/Team/issues/865

Ghost now returns a forbidden error rather than an unauthorized error when saving whilst logged out so the session invalidation was not being triggered.

- added forbidden check to ajax service to trigger session invalidation
- added automatic retry of save in editor when re-authenticating
- fixed re-population of user and proxy services when re-authenticating, it's not needed at that point because nothing has been cleared
2021-07-14 12:28:09 +01:00
Sanne de Vries
53d76da054 Updated feature image Unsplash integration to appear on post title hover 2021-07-14 09:50:59 +01:00
Sanne de Vries
fed040010d Adjusted feature image button to always be visible on mobile 2021-07-14 09:34:24 +01:00
Kevin Ansfield
040f033e2d Fixed editor error when deleting a card via DEL key with no following section
refs https://github.com/TryGhost/Team/issues/747

- we were assuming that a next section exists, when it didn't we'd error trying to read `type` of `undefined`
2021-07-12 21:56:33 +01:00
Kevin Ansfield
cdcd358feb Fixed new post screen showing 500 error
refs c646e78fff

- `return` value was missing from `editor.new` route
2021-07-12 20:19:50 +01:00
Daniel Lockyer
785b7d2239 Merged v4.9.4 into main
v4.9.4
2021-07-12 18:54:47 +01:00
Daniel Lockyer
b3c49f08b2 v4.9.4 2021-07-12 18:53:21 +01:00
Kevin Ansfield
3dc4126397 Dropped use of @classic decorator in <GhTokenInput>
no issue

- updated component to be a glimmer component and use full "Octane" syntax
2021-07-12 14:03:48 +01:00
Thibaut Patel
dc9c812d9c Renamed isAdmin/isOwner/isAdminOrOwner to reduce confusion
issue https://github.com/TryGhost/Team/issues/857

- The goal is to avoid testing for the owner role only is cases where we should be testing for the owner or admin role
- `isOwner` => `isOwnerOnly`
- `isAdmin` => `isAdminOnly`
- `isOwnerOrAdmin` => `isAdmin` (concerns now both Owner and Admins)
2021-07-12 14:55:56 +02:00
renovate[bot]
a23b191257 Update dependency @sentry/ember to v6.9.0 (#2037)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2021-07-12 12:14:09 +01:00
Daniel Lockyer
3a5a6b33fe Merged v4.9.3 into main
v4.9.3
2021-07-12 08:18:18 +01:00
Renovate Bot
a2588ff3c1 Lock file maintenance 2021-07-12 01:47:19 +00:00
Sam Lord
9435e16c89 v4.9.3 2021-07-09 20:41:27 +01:00
Sam Lord
98a7d53c73 Merged 4.9.2 into main 2021-07-09 10:29:36 +01:00
Sam Lord
2bef71dcdc v4.9.2 2021-07-09 10:23:26 +01:00
renovate[bot]
9772866233 Update dependency ember-test-selectors to v6 (#2034)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2021-07-09 09:52:33 +01:00
Kevin Ansfield
7ab0db9be7 Fixed ember-test-selectors bound attributes deprecations
no issue

- converted publish menu and `gh-tags-list-item` components to glimmer syntax so data attributes can be passed in via `...attributes`
- added explicit `data-test-button` bound attribute to `gh-task-button` component
- moved `modal-theme-warnings` auto-bound data attribute from JS file to explicit html attribute in template
2021-07-08 22:44:52 +01:00
Kevin Ansfield
c646e78fff Made session.user a synchronous property rather than a promise
no issue

Having `session.user` return a promise made dealing with it in components difficult because you always had to remember it returned a promise rather than a model and had to handle the async behaviour. It also meant that you couldn't use any current user properties directly inside getters which made refactors to Glimmer/Octane idioms harder to reason about.

`session.user` was a cached computed property so it really made no sense for it to be a promise - it was loaded on first access and then always returned instantly but with a fulfilled promise rather than the  underlying model.

Refactoring to a synchronous property that is loaded as part of the authentication flows (we load the current user to check that we're logged in - we may as well make use of that!) means one less thing to be aware of/remember and provides a nicer migration process to Glimmer components. As part of the refactor, the auth flows and pre-load of required data across other services was also simplified to make it easier to find and follow.

- refactored app setup and `session.user`
  - added `session.populateUser()` that fetches a user model from the current user endpoint and sets it on `session.user`
  - removed knowledge of app setup from the `cookie` authenticator and moved it into = `session.postAuthPreparation()`, this means we have the same post-authentication setup no matter which authenticator is used so we have more consistent behaviour in tests which don't use the `cookie` authenticator
  - switched `session` service to native class syntax to get the expected `super()` behaviour
  - updated `handleAuthentication()` so it populate's `session.user` and performs post-auth setup before transitioning (handles sign-in after app load)
  - updated `application` route to remove duplicated knowledge of app preload behaviour that now lives in `session.postAuthPreparation()` (handles already-authed app load)
  - removed out-of-date attempt at pre-loading data from setup controller as that's now handled automatically via `session.handleAuthentication`
- updated app code to not treat `session.user` as a promise
  - predominant usage was router `beforeModel` hooks that transitioned users without valid permissions, this sets us up for an easier removal of the `current-user-settings` mixin in the future
2021-07-08 14:54:31 +01:00
Peter Zimon
cc25b2348a Fixed 404 code alignment 2021-07-08 15:42:46 +02:00
Peter Zimon
e36f0a42d3 Updated character counter color 2021-07-08 15:15:49 +02:00