Commit Graph

8655 Commits

Author SHA1 Message Date
Gabriel Csapo 15f0aa7355
[chore] migrate to eslint@8 and run --fix (#2256)
closes https://github.com/TryGhost/Admin/pull/2107

- updated related babel dependencies
- bumped eslint
- ran `yarn lint:js --fix`
- added eslint ignore comments for some required non-camel-case properties
2022-02-10 10:41:36 +00:00
Djordje Vlaisavljevic c7383b446d Added tierName feature flag
refs https://github.com/TryGhost/Team/issues/1069
2022-02-10 11:37:57 +01:00
Kevin Ansfield d6b66a2bfa Updated .lint-todo file 2022-02-10 10:26:55 +00:00
Kevin Ansfield 41346a5167 Fixed duplicate top-level properties after native class codemod
refs https://github.com/TryGhost/Ghost/issues/14101
refs https://github.com/TryGhost/Admin/pull/2256

Before migrating to native classes we had a number of controllers/components that had an `.actions.foo` action and a `.foo` task. The automated migration to native classes didn't take that into account and we've ended up with duplicate top-level property names. These duplicates are confusing and can potentially lead to errors or unexpected behaviour, they'll also be flagged as linter errors when we bump our eslint version.

- switched tasks with matching action names to `.actionTask` naming scheme
2022-02-10 10:20:03 +00:00
Kevin Ansfield 0cbbaf6cb8 Refactored modal for bulk unsubscribing members
refs https://github.com/TryGhost/Team/issues/559

Members controller was becoming bloated and difficult to follow due to catering for many different concerns.

- converted old modal to newer promise-modal style
- pulled full bulk unsubscribing logic out of the members controller and into the modal so logic is contained in one place
2022-02-09 22:04:02 +00:00
Kevin Ansfield 97305b3ecf Refactored modal for bulk deleting members
refs https://github.com/TryGhost/Team/issues/559

Members controller was becoming bloated and difficult to follow due to catering for many different concerns.

- converted old modal to newer promise-modal style
- pulled full label-removing logic out of the members controller and into the modal so logic is contained in one place
2022-02-09 22:04:02 +00:00
Kevin Ansfield 6f4c7aea29 Refactored modal for bulk removing a label to members
refs https://github.com/TryGhost/Team/issues/559

Members controller was becoming bloated and difficult to follow due to catering for many different concerns.

- converted old modal to newer promise-modal style
- pulled full label-removing logic out of the members controller and into the modal so logic is contained in one place
2022-02-09 21:58:59 +00:00
Kevin Ansfield f662bf3916 Removed unused `addLabel()` action on members controller
no issue

- left-over from earlier iterations
- adding a new label whilst filtering will be added back in so we don't want to confuse things with similar-but-unused code
2022-02-09 21:58:59 +00:00
Kevin Ansfield f3fe695de9 Refactored modal for bulk adding a label to members
refs https://github.com/TryGhost/Team/issues/559

Members controller was becoming bloated and difficult to follow due to catering for many different concerns.

- converted old modal to newer promise-modal style
- pulled full label-adding logic out of the members controller and into the modal so logic is contained in one place
- added `{{members-count-fetcher}}` resource that allows for member counts to be fetched directly from templates avoiding duplicated code
2022-02-09 21:58:59 +00:00
James Morris c4ce836566 Better styling for the Finishing Touches screen
refs: https://github.com/TryGhost/Team/issues/1303

- fixed glaring styling issues after technical implementation
- got to a place for testing, though small issues remain
2022-02-09 18:10:02 +00:00
Kevin Ansfield 9ed91a4f18 Fixed Cmd+S not saving on membership and members email setting screens
no issue

- routes no longer automatically trigger save for cmd+s, it should be explicitly tied to the action that should be performed
- added `{{on-key "cmd+s"}}` to the `<GhTaskButton>` save buttons
  - `{{on-key}}` with no explicit action triggers a click action on the attached element, in this case the screen's save buttons
2022-02-09 10:59:12 +00:00
Kevin Ansfield 9463e7af64 Dropped ember-concurrency-decorators dependency
no issue

- since `ember-concurrency@2.0` it's possible to use the standard imports as decorators removing the need for the extra `ember-concurrency-decorators` dependency and imports
2022-02-09 10:49:38 +00:00
Sanne de Vries 4ed18f01bb Fixed test 2022-02-09 10:56:21 +01:00
Gabriel Csapo 19cd6a9410
[chore] migrate app/controllers/settings/navigation.js to use native classes (#2254)
refs https://github.com/TryGhost/Ghost/issues/14101
refs https://github.com/TryGhost/Admin/pull/2245

- continuing migration to native classes with use of `@classic` decorator
- required as a part of https://github.com/TryGhost/Admin/pull/2245
2022-02-09 09:53:38 +00:00
Gabriel Csapo 3b89475163
[chore] updates app/controllers/editor.js to use native classes (#2253)
refs https://github.com/TryGhost/Ghost/issues/14101

- continuing migration to native classes with use of `@classic` decorator
2022-02-09 09:50:46 +00:00
Sanne de Vries 6d3a2b73f1 Updated copy of Save buttons on settings pages
No issue

- Changed all buttons to "Save" for consistency across settings
2022-02-09 10:32:47 +01:00
Gabriel Csapo 22975bab61
[chore] migrates koenig-editor files to native classes (#2251)
refs https://github.com/TryGhost/Ghost/issues/14101

- continuing migration to native classes with use of `@classic` decorator
2022-02-09 09:19:45 +00:00
Kevin Ansfield e062b94ab7 Swapped use of EmberObject for member filter rows to native classes
refs https://github.com/TryGhost/Team/issues/1309

General cleanup to switch to more modern idioms.

- removed unnecessary assignment of properties in component's `constructor`
- dropped use of `EmberObject`, use an explicitly defined `Filter` class instead
  - marked properties that change as `@tracked`
  - switched to direct property setting with `=` instead of `.set()`
2022-02-09 09:10:55 +00:00
renovate[bot] 549e06fce8
Update dependency ember-concurrency to v2.2.1 (#2255)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2022-02-09 09:10:21 +00:00
Fabien "egg" O'Carroll ecafdbc322 🐛 Fixed sending non-integer prices to Tiers API
refs https://github.com/TryGhost/Team/issues/1319

Due to how JS implements numbers, it's possible that when we multiple a
number with 2 decimal places by 100 that we do not end up with an
integer e.g. 9.95 * 100 = 994.999...

This is not a valid price for the API and so we must round it to the
nearest integer. Rounding is safe here, because the errors involved in
floating point operations are very small.
2022-02-09 10:41:16 +02:00
Sanne de Vries 683731c66f Updated empty states for posts, pages, and tags 2022-02-09 09:34:12 +01:00
Sanne de Vries b6c9cc0347 Updated copy on empty members screen 2022-02-09 09:24:11 +01:00
Kevin Ansfield a27b16729b Resolved linter errors in `<Members::FilterValue>` component
refs https://github.com/TryGhost/Ghost/issues/14101

- dropped use of unnecessary `<GhTextInput>` component
- switched action calls over to standard `{{on "event"}}` rather than the sometimes error-prone overriding of EmberObject component event handlers
2022-02-08 15:11:01 +00:00
Kevin Ansfield 797e6a9274 Moved members screen filter components into components/members
no issue

- currently the components are screen-specific rather than generalised so shouldn't have the `gh-` prefix
- fixed linter error for confusing `{{#unless}}...{{else}}` usage
2022-02-08 15:11:01 +00:00
Fabien "egg" O'Carroll d99aa1393a Revert "Rounded monthly/yearly Price"
This reverts commit 00848a3d5d.
2022-02-08 16:46:00 +02:00
Fabien "egg" O'Carroll 00848a3d5d Rounded monthly/yearly Price
refs https://github.com/TryGhost/Team/issues/1319
2022-02-08 16:43:57 +02:00
Sanne de Vries 6617759add Updated import-members modal 2022-02-08 14:56:19 +01:00
Kevin Ansfield 2e296efd3d Cleaned up members filter labs components
no issue

- the members filtering is out of labs, we don't need to keep the labs component naming around
- renamed `-labs` components/classes to non-labs naming, replacing old and unused non-labs components where necessary
2022-02-08 11:48:55 +00:00
Kevin Ansfield 343ad982ea Fixed members search input losing focus whilst typing
closes https://github.com/TryGhost/Team/issues/1318

The `{{if this.members.length "" "hidden"}}` class meant that whenever loading occurred the search input was briefly changed to `display: none` which caused focus to be lost making searching rather painful. It also meant the search input disappeared completely when no members matched a search.

- switched to a standard `<input>` element to get better event handling ergonomics
- added `searchIsFocused` tracked property that is set to `true` any time the search input has focus - works around an unexpected re-render when clearing the search input whilst it has focus
- switched the "hide" conditional to a getter that takes members length, search param text, and search input focus into account so there are no unexpected hides of the search bar
2022-02-08 11:44:08 +00:00
Kevin Ansfield 9ff105614d 🐛 Fixed "Show all members" button not clearing search field when no results match
no issue

- the reset button was only clearing the `filter` param rather than resetting all query params
- removed unnecessary `searchText` indirection, the search input can work directly with the query param
2022-02-08 11:36:49 +00:00
Kevin Ansfield f46111bb77 Migrated `<GhUnsplashPhoto>` to glimmer component
refs https://github.com/TryGhost/Ghost/issues/14101

- extracted the ratio zoom handling to a `{{ratio-zoom}}` modifier to clean up the component and avoid needing lifecycle hooks that don't exist in Glimmer components
- disabled `no-nested-interactive` linting in the template - not ideal but we'd need a much bigger design refactor to eliminate the nested links
2022-02-08 10:13:18 +00:00
renovate[bot] ec45a9d0aa
Update dependency tracked-built-ins to v2 (#2146)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2022-02-08 08:58:18 +00:00
renovate[bot] 5ec4588292
Update dependency ember-modifier to v3 (#2123)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2022-02-08 08:54:14 +00:00
Djordje Vlaisavljevic dd12bd913e Fixed showing explainer text for free membership welcome page input field
refs https://github.com/TryGhost/Team/issues/1168
2022-02-08 09:39:48 +01:00
renovate[bot] de3eaab058
Update dependency ember-css-transitions to v3 (#2249)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2022-02-08 08:28:25 +00:00
Rishabh 035f15a8d4 Updated welcome page location for free membership
refs https://github.com/TryGhost/Team/issues/1168

- moved free tier welcome page url from product card to main screen
2022-02-08 09:31:40 +05:30
renovate[bot] 170c1378cb
Update dependency @tryghost/kg-parser-plugins to v2.11.4 (#2248)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2022-02-08 00:15:30 +00:00
renovate[bot] 09ecbe0a4f
Update dependency @tryghost/kg-clean-basic-html to v2.2.8 (#2247)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2022-02-07 21:21:41 +00:00
James Morris da808f4f94 Quick fixed the links not showing when activity feature flag is off for members
refs: https://github.com/TryGhost/Team/issues/1317
2022-02-07 17:00:59 +00:00
Kevin Ansfield 36a28e0c13 Updated linter todo file
refs 00ba87cf59

- ran `yarn lint:hbs` to update the todo list for errors that were resolved in the `<GhUnsplash>` glimmer component refactor
2022-02-07 16:58:36 +00:00
Kevin Ansfield 88deb86f16 🐛 Fixed Ctrl+Enter-to-edit keyboard shortcut not working on Windows for some editor cards
no issue

- Callout, Email, Email CTA, Header, Product, and Toggle cards all had the same typo in the Ctrl/Cmd+Enter keyboard handling
2022-02-07 16:55:01 +00:00
Kevin Ansfield 00ba87cf59 Migrated `<GhUnsplash>` to glimmer component
refs https://github.com/TryGhost/Ghost/issues/14101

- swapped use of `<LiquidWormhole>` to `{{#in-element}}` because we weren't animating anything
  - we can now use `{{css-transition}}` instead if we want to animate in the future
- swapped use of `ShortcutsMixin` for ember-keyboard's `{{on-key}}` modifier
- added `{{query-selector}}` helper so we can grab an element from inside the template rather than requiring a backing component function (used to pass the wormhole element to `{{#in-element}}`)
- added `{{on-resize}}` modifier so the `resizeDetector` service can be used directly from the template rather than requiring a backing component to wait for render and use query selectors to grab an element
2022-02-07 16:53:12 +00:00
Kevin Ansfield 2f09357e6a Disabled linting rule that forbids use of `<style>` elements
no issue

- rule: https://github.com/ember-template-lint/ember-template-lint/blob/master/docs/rule/no-forbidden-elements.md
- we need to use `<stye>` in our application template to allow use of dynamic CSS variables
- the whatwg html spec says `<style>` is not valid inside `<body>` but all of the browsers we care about support it
2022-02-07 15:22:32 +00:00
Sanne de Vries ba73455ebf 🎨 Improved empty state of the Members screen
No issue

- Added resources to help and inspire people get started with members, which will be hidden after 6+ members are added
2022-02-07 16:11:08 +01:00
Kevin Ansfield 95069d5b15 Added unsplash button/selector to publication cover image form field
no issue

- shows an unsplash button when no image is present, opening the full unsplash selector when clicked
- behind the `improvedOnboarding` labs flag
2022-02-07 12:16:57 +00:00
Kevin Ansfield b422bbe60a Updated conditionals for editorIsLaunchComplete with improvedOnboarding feature
closes https://github.com/TryGhost/Team/issues/1294

- ensures latest member activity is shown when improvedOnboarding feature is enabled no matter what the `editorIsLaunchComplete` value is to better show what the dashboard will look like when the launch wizard is removed
2022-02-07 11:11:19 +00:00
Kevin Ansfield e6b09d567b Disabled "no-inline-styles" template lint rule
no issue

- in general we only use inline styles when it reduces maintenance problems so the rule was providing too many false negatives
2022-02-07 10:21:03 +00:00
Kevin Ansfield fdd04551de Added collapse animation to get-started dashboard panel when dismissing
no issue

- softens the disappearance by fading out and collapsing the height when removing
- uses `{{css-transition}}` modifier from https://peec.github.io/ember-css-transitions/docs/insert-destroy
- max-height used in order to animate collapse of a `height: auto` panel, 350px starting point chosen as it's slightly bigger than the largest height of the panel at mobile widths
2022-02-07 10:04:52 +00:00
Kevin Ansfield 674062ea1a Added saving spinner to finishing-touches screen
refs https://github.com/TryGhost/Team/issues/1310

- switched to a task and `<GhTaskButton>` to show a saving indicator whilst waiting for API to return
2022-02-04 17:32:43 +00:00
Kevin Ansfield 793ccecf5b Changed firstStart flow to show a streamlined settings screen
closes https://github.com/TryGhost/Team/issues/1310

- added `/setup/finishing-touches` route
  - refreshes theme preview on access
  - uses existing setting form components to build a reduced settings menu
- updated `/?firstStart=true` handling to transition to `/setup/finishing-touches` instead of showing the get-started modal
- updated standard setup flow to show the get-started modal upon completion
  - `/?firstStart=true` flow for now will only be used when a theme has been chosen before site creation
2022-02-04 17:06:40 +00:00