Commit Graph

828 Commits

Author SHA1 Message Date
Kevin Ansfield
060d791a63 Removed need for .get() with settings service
no issue

The `settings` service has been a source of confusion when writing with modern Ember patterns because it's use of the deprecated `ProxyMixin` forced all property access/setting to go via `.get()` and `.set()` whereas the rest of the system has mostly (there are a few other uses of ProxyObjects remaining) eliminated the use of the non-native get/set methods.

- removed use of `ProxyMixin` in the `settings` service by grabbing the attributes off the setting model after fetching and using `Object.defineProperty()` to add native getters/setters that pass through to the model's getters/setters. Ember's autotracking automatically works across the native getters/setters so we can then use the service as if it was any other native object
- updated all code to use `settings.{attrName}` directly for getting/setting instead of `.get()` and `.set()`
- removed use of observer in the `customViews` service because it was being set up before the native properties had been added on the settings service meaning autotracking wasn't able to set up properly
2022-10-07 16:14:57 +01:00
Aileen Booker
c4188c1a9e
Added Ghost Explore in Ghost as iframe app behind feature flag (#15495)
no issue

- Added Ghost Explore screen behind alpha flag
- Moved existing /explore route to /explore/connect which we'll redirect to for outside requests
- Added iframe communication with Ghost Explore App
2022-10-07 14:32:54 +01:00
Simon Backx
7e3b41f643
Removed emailClicks feature flag (#15556)
fixes https://github.com/TryGhost/Team/issues/2028

Since link clicks became GA, some older components and templates are no longer used.
2022-10-07 14:27:57 +02:00
Simon Backx
07cb542b97
Improved timezone support date picker and improved tests (#15545)
fixes https://github.com/TryGhost/Team/issues/1946

Problem:
- When running the admin tests in a timezone that is later than UTC, the tests failed.

Causes:
- Some tests needed some adjustements
- The DateTimePicker did not always use the correct timezone.
- Test models createdAt times sometimes depended on the timezone of the test runner

Solution:
- All the input DateTimePicker gets should be processed in the blog's timezone.
- Make sure that all communication (properties, setters, minDate...) with `PowerDatepicker` happens in the local timezone. When setting, convert that date to the blog timezone and use that as the real value.
2022-10-07 12:20:06 +02:00
Kevin Ansfield
524b23c182
Migrated staff user screen to Ember Octane patterns (#15532)
refs https://github.com/TryGhost/Ghost/issues/14101

- migrated staff user controller to native class syntax
- removed use of `{{action}}` helper
- moved from custom components to native `<input>` and `<textarea>` for form fields
  - added `{{select-on-click}}` modifier to cover the `<GhTextingInput @selectOnClick>` option behaviour for any input element
- added `submitForm()` test helper that finds closest `form` element and trigger's a `submit` event on it simulating <kbd>Enter</kbd> being pressed whilst a field has focus
2022-10-05 12:05:31 +01:00
Kevin Ansfield
289e8a8da6 Fixed staff acceptance test
refs e0430b4efc

- acceptance test had mixed up name/slug fields so was testing for incorrect values now that cmd+s inside the slug field is working as really expected
2022-10-04 18:55:25 +01:00
Kevin Ansfield
e0430b4efc 🐛 Fixed ctrl/cmd+s not saving focused fields on general/staff settings screens
no issue

- swapped from route actions triggered by shortcuts mixin to explicit `{{on-key}}` actions
- when saved via keyboard, blur any focused element to trigger it's on-blur action and schedule the save to run after those actions
2022-10-04 17:55:24 +01:00
Sanne de Vries
2c498ab193 Updated breadcrumb and title style across admin
Refs https://www.notion.so/ghost/Switch-breadcrumb-style-513a624c0e0d490ca39a2fdb97a6971a

- Separating out the breadcrumbs and the title makes it easier to navigate back on multiple levels for nested pages.
- Avoids very long titles, as it doesn't include breadcrumbs anymore
2022-10-04 12:35:29 +07:00
Kevin Ansfield
cd9a50841e Fixed tests
refs 85cce39af7

- removed out of date transfer owner modal integration test
- fixed missing `?` in optional chaining in `<GhImageUploader>` error handling
2022-10-03 22:05:02 +01:00
Stephen Sauceda
eb585f9c02
🐛 Fixed active state bug in sidebar nav (#15511)
closes: https://github.com/TryGhost/Ghost/issues/15506

- The sidebar items that don't open the editor were missing some relative current-when attributes so the nested views weren't considered "active".
2022-10-03 19:49:21 +01:00
Kevin Ansfield
258f56ded9
Added regression test for publishing as editor when over member limit (#15518)
closes https://github.com/TryGhost/Team/issues/2010
refs a67cb265fc

- wrapped all members endpoints in a permission check that returns a 403 response if the logged in member is not an admin
- added a publish-flow acceptance test that goes through the flow as an Editor user that fails if the stats endpoint is hit and throws a permissions error
- removed some unnecessary waits in members acceptance test that were added for earlier versions of Ember
2022-10-03 12:05:58 +01:00
Kevin Ansfield
485b793ee3 Deleted test for component that doesn't exist
no issue

- looks like the test file was left over from development
2022-10-03 11:26:00 +01:00
Daniel Lockyer
9818634b63
Merged v5.16.1 into main
v5.16.1
2022-09-27 11:21:48 +07:00
Kevin Ansfield
e3db911108
🐛 Fixed confusing error state when publishing if member count is over hosting plan limit (#15473)
closes https://github.com/TryGhost/Team/issues/1885

- adds limit check for members to the `PublishOptions` class when it's constructed to set a `publishDisabledError` property if the limit check fails
  - if `publishOptions.publishDisabledCheck` is present, all publish options in the publish flow are disabled, the underlying error message is shown, and the continue button is removed to prevent filling in everything only to find at the end of the process that publishing fails
- added handling for a `HostLimitError` error from the API when confirming publishing so the proper underlying message is displayed instead of the confusing "Host limit error, cannot edit post" error
  - this is a backup measure for any instances where you're under the max members limit when starting the publish flow but are over the limit when you reach the end of the publish flow
2022-09-26 17:37:35 +01:00
renovate[bot]
65a74f41c8
Update dependency ember-power-select to v4.1.7 (#15157)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Kevin Ansfield <kevin@lookingsideways.co.uk>
2022-09-24 15:08:42 +02:00
Kevin Ansfield
fa84808048 Dropped ember-cli-moment-shim dependency
no issue

Since `ember-moment@10.0` it's not been necessary to use the `ember-cli-moment-shim` package, with `moment` instead being usable directly via `ember-auto-import`. Getting rid of the shim package is necessary for compatibility with `embroider`, Ember's new build tooling.

- dropped `ember-cli-moment-shim` dependency
- added `moment-timezone` dependency and updated all imports to reflect the different package
- worked around `ember-power-calendar` having `ember-cli-moment-shim` as a sub-dependency
  - added empty in-repo-addon `ember-power-calendar-moment` to avoid `ember-power-calendar` complaining about a missing package
  - added `ember-power-calendar-utils` in-repo-addon that is a copy of `ember-power-calendar-moment` but without the build-time renaming of the tree for better compatibility with embroider
2022-09-24 13:28:23 +02:00
Sanne de Vries
47903962cc Updated post list layouts
Refs https://github.com/TryGhost/Team/issues/1895
2022-09-15 12:50:53 +01:00
Kevin Ansfield
2d9dd4639d Added redirect between mobiledoc/lexical editors
no issue

- mobiledoc and lexical editors will co-exist for some time so we want to make using both as straight forward as possible
- posts can only have one of `lexical` or `mobiledoc` properties set so in the `edit` route for each editor we detect the opposite property being present and redirect so the right editor is loaded for each post
2022-09-13 18:55:39 +01:00
Kevin Ansfield
8376f1f2fc Updated lexical editor acceptance test to match new behaviour
refs e97d5dd3fe

- `/lexical-editor` route now checks for `editor.url` config rather than `editor.lexicalUrl`
2022-09-13 11:45:49 +01:00
Daniel Lockyer
a766253a78
Merged v5.14.1 into main
v5.14.1
2022-09-12 16:06:43 +01:00
Kevin Ansfield
e230370b33 🐛 Fixed Admin freeze when filtering long tag lists
closes https://github.com/TryGhost/Ghost/issues/15391

- `vertical-collection` component was throwing errors during render when the tags list was filtered down causing slowdowns or full Admin crashes
- similar regression had popped up before and fixed in https://github.com/TryGhost/Ghost/pull/15207 but the dependency had been bumped again without realising it caused an error
- added a test that triggers the error-throwing behaviour in the tags input to help catch this in future dependency updates
2022-09-12 15:49:59 +01:00
Kevin Ansfield
8fde9a05d2 Switched User settings unsaved changes modal to new modal pattern
refs https://github.com/TryGhost/Team/issues/1734
refs https://github.com/TryGhost/Team/issues/559
refs https://github.com/TryGhost/Ghost/issues/14101

- switches to newer modal patterns ready for later Ember upgrades
2022-09-09 17:44:12 +01:00
Kevin Ansfield
6e11a24002 Switched Unsplash integration unsaved changes modal to new modal pattern
refs https://github.com/TryGhost/Team/issues/1734
refs https://github.com/TryGhost/Team/issues/559
refs https://github.com/TryGhost/Ghost/issues/14101

- switches to newer modal patterns ready for later Ember upgrades
2022-09-09 17:44:12 +01:00
Kevin Ansfield
5d5e77af85 Switched Slack integration unsaved changes modal to new modal pattern
refs https://github.com/TryGhost/Team/issues/1734
refs https://github.com/TryGhost/Team/issues/559
refs https://github.com/TryGhost/Ghost/issues/14101

- switches to newer modal patterns ready for later Ember upgrades
2022-09-09 17:44:12 +01:00
Kevin Ansfield
2c10e53774 Switched AMP unsaved changes modal to new modal pattern
refs https://github.com/TryGhost/Team/issues/1734
refs https://github.com/TryGhost/Team/issues/559
refs https://github.com/TryGhost/Ghost/issues/14101

- switches to newer modal patterns ready for later Ember upgrades
2022-09-09 17:44:12 +01:00
Kevin Ansfield
a6f19ca807 Switched navigation unsaved changes modal to new modal pattern
refs https://github.com/TryGhost/Team/issues/1734
refs https://github.com/TryGhost/Team/issues/559
refs https://github.com/TryGhost/Ghost/issues/14101

- switches to newer modal patterns ready for later Ember upgrades
2022-09-09 17:44:12 +01:00
Kevin Ansfield
2396c6d615 Switched general settings unsaved changes modal to new modal pattern
refs https://github.com/TryGhost/Team/issues/1734
refs https://github.com/TryGhost/Team/issues/559
refs https://github.com/TryGhost/Ghost/issues/14101

- switches to newer modal patterns ready for later Ember upgrades
2022-09-09 17:44:11 +01:00
Kevin Ansfield
4ad040b4aa Improved display of recipient filter posts list sends column tooltip
refs https://github.com/TryGhost/Team/issues/1025

- added `{{humanize-recipient-filter}}` helper that converts an NQL recipient filter into a more readable format
- updated posts list to use the new helper in the sends column tooltip shown when hovering with the mouse
2022-09-08 11:03:20 +01:00
Kevin Ansfield
bd87ee3e2a Refactored delete custom integration modal
refs https://github.com/TryGhost/Team/issues/1734
refs https://github.com/TryGhost/Team/issues/559
refs https://github.com/TryGhost/Ghost/issues/14101

- switches to newer modal patterns ready for later Ember upgrades
2022-09-08 09:18:48 +01:00
Kevin Ansfield
5bbdad38a5 Refactored delete all content modal
refs https://github.com/TryGhost/Team/issues/1734
refs https://github.com/TryGhost/Team/issues/559
refs https://github.com/TryGhost/Ghost/issues/14101

- switches to newer modal patterns ready for later Ember upgrades
2022-09-08 09:18:46 +01:00
Kevin Ansfield
eca3cd7110 Moved tag screen components
no issue

- relocated screen-specific components into a separate `tags/` directory as part of the move to keep the top-level `components/` directory for re-usable components
2022-09-08 09:18:36 +01:00
Kevin Ansfield
4ce3d58e34 Fixed linting
refs aa53a1c71f

- missed some cleanup when replacing tests
2022-09-07 17:57:15 +01:00
Kevin Ansfield
aa53a1c71f 🐛 Fixed error when deleting tag and missing slugs on tags list
no issue

- fixes error that left the confirmation modal in place when deleting a tag by ensuring we return `true` in the task used by the confirm button, if we return the transition object it trips the "failed" state because the `/tags` route aborts and refreshes when transitioning to it
- fixes missing attached posts count in the tag delete confirmation modal by using the correct `tag.count.posts` attribute in the conditional
- fixes missing slugs in the tags list by using the properties on `@tag` rather than expecting a separate `@slug` argument
- replaced the skipped tags acceptance tests with an updated tests that match the recent redesign
2022-09-07 17:51:56 +01:00
Sanne de Vries
594e2ccb08 Removed all launch-wizard related code
No issue

- With the onboarding flow redesign, the launch wizard can no longer be accessed and is therefore deleted.
2022-09-02 13:20:01 +01:00
James Morris
4f8526fd77 Improving the members page on mobile
no issue
2022-09-01 13:09:23 +01:00
Kevin Ansfield
04c3de8ffc Fixed tests that compared .textContent instead of .innerText with inline SVGs
refs 038600c350

- SVGs have titles now and title text content will be included in `element.textContent`
- updated tests that failed to use `.innerText` instead
  - via chai-dom's `.rendered.text()`
  - via direct access `find('.elem').innerText).to...`
2022-09-01 10:01:30 +01:00
James Morris
2a198c367e Reverting back some changes to try and fix failed tests
no issue
2022-08-31 16:07:12 +01:00
James Morris
ae28cdffbb Fixed the test for new member page based on changes
no issue
2022-08-31 15:16:32 +01:00
Rishabh
5e2613b6ed Fixed lint
refs 594ef34871
2022-08-26 15:31:10 +05:30
Rishabh
74f94e85a4 Fixed lint for staff user test 2022-08-26 15:29:06 +05:30
Rishabh
76419f8ed4 Removed email alerts UI for non admin staff
refs https://github.com/TryGhost/Team/issues/1825
2022-08-26 15:24:28 +05:30
Rishabh Garg
da62355e18
Wired email alert settings for staff users on admin (#15313)
refs TryGhost/Team#1826

- allows staff users to manage their email alert settings behind the flag
- only owner and admin users are able to toggle their email alerts
2022-08-25 15:47:14 +05:30
Kevin Ansfield
3fd32ce3cf
Lexical-powered editor experiment (#15278)
no issue

We're spending a bit of time playing with an alternative to mobiledoc-kit to test it's feasibility as a base for future editor improvements.

- add `editor.lexicalUrl` config that points at the unpkg release by default
- set up a route on `/ghost/#/lexical-editor/post/` for the test playground which renders `<KoenigLexicialEditor>` as the editor
- adds `<KoenigLexicalEditor>` component that lazy loads the external react component
2022-08-23 11:45:50 +01:00
Aileen Nowak
515bf1cc14 Added Ghost Explore UI
no issue

- Added `/explore` route which requires min. Admin and is behind a feature flag
- Fetches Admin API key and ID to create a token and return back to Ghost Explore with the correct query params
- Fullscreen UI
2022-08-01 11:11:47 +01:00
Sanne de Vries
09794a7c05 Updated theme upload modal in Casper error state
No ref

- Updated modal default state to make it look more clickable
- Updated the Casper upload error state design
- Changed the 'try again' button to directly open the finder rather than only resetting the modal
2022-07-14 15:07:08 +01:00
Sanne de Vries
be0fb41636 Updated webhook actions to dotdotdot menu 2022-07-12 13:38:51 +01:00
Simon Backx
549e8c526f Added newsletter slug generation to mirage 2022-06-02 13:19:52 +02:00
Simon Backx
7c04c2c472 Added test to see if newsletter is saved 2022-06-02 12:58:10 +02:00
Simon Backx
d5887c6ac0 Added tests for newsletter limits
refs https://github.com/TryGhost/Team/issues/1477
2022-06-02 11:21:29 +02:00
Simon Backx
557e268445 Added newsletter archiving tests
refs https://github.com/TryGhost/Team/issues/1477
2022-06-02 10:39:17 +02:00