Commit Graph

450 Commits

Author SHA1 Message Date
Kevin Ansfield
85d7932e45 Resolved deprecation warnings for dynamic modal component binding (#2303)
refs https://github.com/TryGhost/Team/issues/559
refs 054a5f15f5

- with the update of `ember-promise-modals` we started to get deprecation warnings when using `modals.open('modal-component-name')`
  - upcoming Ember build updates will introduce tree shaking but using run-time lookup of modal components by name works against that because it's not statically analysable
- switched to importing components and passing the component class directly, eg. `modals.open(ModalComponent)`
- standardized modal component class names with a `MyModal` style to get better behaviour in code editors when it auto generates imports
- dropped the modal defaults from the modals service because we can now use a static `modalOptions` property on the modal components themselves when we want to override the defaults
2022-03-14 10:52:04 +00:00
Kevin Ansfield
4d8c12d2b8 Fixed sticky URL when using Escape to close view theme modal
no issue

- we were missing handling for the view-theme modal being closed outside of a route transition meaning the URL would stay on `/settings/design/view-theme/Theme` even though it's the index that was shown, preventing the same theme being viewable again and back/forward behaving as expected
2022-03-11 19:14:16 +00:00
Kevin Ansfield
4db4233b87 Fixed integration edit page not showing after creating new integration
refs 054a5f15f5

- `beforeClose` behaviour has changed slightly with the upgraded ember-promise-modals
- added a guard for the modal existing when transitioning back to the integrations index screen, this makes sure we're not transitioning back to the index screen after the modal has already initiated a transition to the integration edit screen
2022-03-11 19:10:44 +00:00
Sanne de Vries
3ae3e8142a 🎨 Redesigned user authentication pages (#2286)
Refs https://www.notion.so/ghost/Invite-staff-users-steps-in-setup-guide-367737e13d97450a98a0f39ec6b68181

* Simplified the selfhoster setup flow to one setup page only
* Redesigned the reset password pages and the signup page for new staff members

Co-authored-by: Daniel Lockyer <hi@daniellockyer.com>
2022-03-08 17:30:46 +00:00
Kevin Ansfield
4aa9d4554e Dropped ember-useragent dependency
no issue

We made very limited use of the `ua-parser-js` sub-dependency that `ember-useragent` pulls in so it didn't seem worth having the fairly large 17KB import or the associated sub-dependency version resolutions.

- switched the two iOS and Safari detections to use associated Regexes on `navigator.userAgent`
- dropped the "Microsoft Edge not supported" message in the editor
  - old Edge is still not supported but it was been replaced with a Chromium-based version that is supported a while back
  - we can re-introduce a warning if we get any significant reports (there is nothing showing in Sentry for this alert in the last 14 days)
2022-03-07 10:06:35 +00:00
James Morris
bf676ddfb0 Renamed Finishing Touches onboarding step to Done with other changes and styling tweaks
refs: https://github.com/TryGhost/Team/issues/1376

- renamed finishing touches file to done
- no last modal, just the done screen for first start
- added options for next steps
2022-03-02 12:46:15 +00:00
Gabriel Csapo
d51f2bcf23 [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
Kevin Ansfield
2525a43156 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
Peter Zimon
d5018cbb3a Fix tests 2022-02-02 10:57:34 +01:00
Peter Zimon
b5995419dc Updated default redirect for contributors 2022-02-02 10:12:16 +01:00
Kevin Ansfield
8bc4309deb Added display of get-started modal after completing setup flow
refs https://github.com/TryGhost/Team/issues/1295

- moved `?firstStart` query param handling into `'home'` route as it seemed like a preferable location
  - switched to using `resetController` hook to manage removal of query param which seemed more reliable than the transition approach
- added `firstStart` query param to the transitions when completing step 3 of the setup flow
2022-02-01 18:20:26 +00:00
Peter Zimon
6fa8dafa79 Contributors updates (#2235)
Updates Admin UX for Contributors

When logged in as a Contributor:

- removes sidebar, added floating account menu and dark-mode switch to right side. Updated mobile menu accordingly
- all post by the given user is listed in the Post list
- changed post filtering
- hides email columns in post list
- removes publishmenu for Contributors in Post preview modal
- visual tweaks
2022-02-01 18:59:20 +01:00
Kevin Ansfield
9760e67b3d Added "Get started" modal for first-load onboarding
refs https://github.com/TryGhost/Team/issues/1295

- modal is triggered by the query param `?firstStart=true`, eg https://localhost:2368/ghost/#/?firstStart=true
- clears the query param after triggering the modal so it doesn't get re-triggered after leaving and re-entering the dashboard route
2022-02-01 17:47:50 +00:00
Sanne de Vries
21b4b15a1c Improved Email newsletter settings page (#2207)
Updated email newsletter settings

- Added toggle to disable email newsletters
- Hides email related UI when email is completely turned off
- Rearranged email newsletter settings
- Added publish-menu preview in 
- Changed default-recipients setting
- Updated publish-menu to show Publish as default action
- Removed the confirmation modal during publishing when no emails are intended to be sent
2022-01-27 12:40:11 +01:00
Sanne de Vries
beca9b13dd Updated Author user profile page and sidebar
No issue

- Authors don't need access to staff page and don't need to see breadcrumbs on their profile page
- There's enough space in the side navigation for the post views to be visible by default
2022-01-26 14:49:55 +00:00
Kevin Ansfield
ee5aae8a90 Switched member activity feed widget from email_recipients to events feed
refs https://github.com/TryGhost/Team/issues/1277

- removed inclusion of `email_recipients` in member query when fetching member for display on the member details screen as it was only used for the activity feed
- added `<Member::ActivityFeed>` template-only component as a replacement for `<GhMemberActivityFeed>`
  - uses `members-event-fetcher` resource for consistency with main activity feed and dashboard widget. Allows for a template-only component because data fetching behaviour can be managed directly from the template rather than requiring a backing component
2022-01-26 10:55:05 +00:00
Kevin Ansfield
d51e25888d Resolved ember-simple-auth deprecations
no issue

- many "The automatic session initialization is deprecated" were shown in test output due to an old method of initializing the session service
- switched to explicit session setup in the application route's `beforeModel` hook
- https://github.com/simplabs/ember-simple-auth/issues/2314
2022-01-22 00:30:56 +00:00
Sanne de Vries
0ddca821d6 Revert "Updated profile page for Authors & Contributors"
This reverts commit c5940ab57b.
2022-01-21 12:46:27 +00:00
Sanne de Vries
c5940ab57b Updated profile page for Authors & Contributors
No ref

- Removed breadcrumbs when profile page is loading
- Redirected Authors and Contributors to profile page when accessing /staff
2022-01-21 11:35:02 +00:00
Kevin Ansfield
eb2109499a Added initial setup of members activity feed
refs https://github.com/TryGhost/Team/issues/1277

- added `/members-activity` route with associated controller, template, and components behind labs flag
  - table component currently renders some dummy rows
- added navigation item to main menu
  - will use the currently set `?filter` query param unless clicked whilst already on the `/members-activity` screen in which case it will reset the query
- added link to dashboard members activity panel
- added link to member details activity panel
  - sets the filter param to `?filter=member:{member.id}` in preparation for the feed to be filtered to the member's activity
- updated the labs-flag test helper file to export both `enableLabsFlag()` and the new `disableLabsFlag()` so it's easier to test for flag-disabled functionality
2022-01-17 18:06:12 +00:00
Kevin Ansfield
75abe76346 Migrated route objects to native class syntax
no issue

- ran the `ember-native-class-codemod` codemod to convert just the route classes to native class syntax and performed some minor manual cleanup
  - modern Ember uses native classes rather than EmberObject-based objects, this brings us closer to normalizing our code style across the codebase
- skipped the Application route as that requires deeper testing with a replacement for the `ShortcutsRoute` mixin
2022-01-17 10:06:57 +00:00
Kevin Ansfield
d09db70f43 Refactored use of ShortcutsRoute mixin on editor screen
no issue

- mixins are deprecated in Ember so we want to remove their usage
  - pre-requisite for easier automation for switching to native class syntax
- removed ShortcutsRoute mixin in favor of using the `{{on-key}}` modifier and standard controller action
2022-01-17 10:06:57 +00:00
Kevin Ansfield
c868dd6224 Refactored use of ShortcutsRoute mixin on tags screen
no issue

- mixins are deprecated in Ember so we want to remove their usage
  - pre-requisite for easier automation for switching to native class syntax
- removed ShortcutsRoute mixin in favor of using the `{{on-key}}` modifier and standard controller action
2022-01-17 10:06:57 +00:00
Kevin Ansfield
683a8584ce Refactored away CurrentUserSettings mixin (#2200)
no issue

Mixins are deprecated in Ember so we want to remove their usage. The `CurrentUserSettings` mixin was used in Route files to provide `transitionAuthor()` (that also transitions contributors) and `transitionEditor()` methods so the the consuming route could use them to prevent access to authors/editors. In practice the only reason this was used was to prevent access to admin-only routes.

- added an `AdminRoute` class that inherits from our `AuthenticatedRoute` class
  - when any route inherits from this class it will only allow access to admins and owners, any other user will be redirected to the home screen (dashboard or site depending on permissions)
- updated all of our admin-only routes to use the new `AdminRoute`
  - allowed for removal of `CurrentUserSettings` mixin usage
  - allowed for `beforeModel()` hooks to be removed from consuming routes in many cases
  - some admin-only routes were extending/inheriting directly from Ember's `Route` based on the assumption that the router hierarchy would have a parent route perform the redirect. Those have also been switched to `AdminRoute` for consistency and to prevent accidentally making them available if the router hierarchy changes
  - `/#/settings` does not use the `AdminRoute` so that it can redirect to the current user's setting page for non-admin users
- removed `CurrentUserSettings` mixin file
- cleaned up unnecessary computed property and function used for redirect-when-disabled in the Zapier route
2022-01-17 10:05:27 +00:00
Kevin Ansfield
f1e74516ac Cleaned up unused theme routes
no issue

- the controllers and templates for the old theme setting screens have been removed already but the route files had been missed in the cleanup
2022-01-14 19:09:58 +00:00
Kevin Ansfield
d0f6dd7fef Refactored custom integration creation and limits modals
refs https://github.com/TryGhost/Team/issues/559

- switched to new ember-promise-modals pattern
- removed controller and template in favor of opening modals directly from the route
- removed unused `mousedown` event handlers - they are only necessary when an input blur would trigger validation errors
- fixed Enter key not triggering create action by adding an `{{on-key "Enter"}}` event handler to the name input
- fixed scroll not resetting to top of integrations screens when navigating between them by adding `{{scroll-top}}` element modifier to the main content sections
2022-01-13 13:16:13 +00:00
Kevin Ansfield
40a48c1e99 Cleaned up customThemeSettings feature flag
refs https://github.com/TryGhost/Team/issues/1164

- removed flag and labs screen toggle
- removed all conditionals
- removed all old/unused route/controller/component files
- renamed labs components and classes to non-labs naming
2022-01-03 14:09:27 +00:00
Kevin Ansfield
84b8d1be3b Moved cmd+shift+p shortcut handling into <GhPublishmenu>
refs https://github.com/TryGhost/Team/issues/1169

We want all publish actions to trigger a confirmation modal. Currently that confirmation modal is controlled by `<GhPublishmenu>` which made it difficult to use from the route-induced publish shortcut.

- removed old shortcut mixin approach from the editor route
- added modern keyboard handler to a hidden element that is rendered any time the publish menu is present
2021-12-01 11:51:10 +00:00
Kevin Ansfield
e289b391f1 🐛 Fixed install of free themes from the marketplace that aren't in the built-in list
no issue

When we were given a source+ref we were using that to find a theme object from the built-in list of marketplace themes and if it wasn't found redirecting to the change-theme screen. That redirect didn't need to happen because we only need the `ref` and can determine the theme name from that.

- passed `ref` through to the install modal as a data argument
- updated install modal to get theme name from passed in theme or extracted from passed in `ref` when theme is not known
- adjusted "isDefaultTheme" so it always checks against Casper rather than using the `ref: 'default'` value from the list of marketplace themes
2021-11-12 12:57:25 +00:00
Daniel Lockyer
1c6ee2abca Merged v4.22.1 into main
v4.22.1
2021-11-10 12:58:15 +00:00
Rishabh
c3d8834810 Removed membership setting access for contributors
no refs

- access to membership settings is restricted to owners and admins as contributors/authors cannot perform any actions on the page
- redirects non owners/admins back to site when trying to access membership settings via URL
2021-11-10 16:57:25 +05:30
Kevin Ansfield
0d7c2f4790 🐛 Fixed theme installs from ghost.org/marketplace
no issue

The marketplace still uses the `/settings/theme/install` route but that was removed as part of the redesign for design settings.

- added `settings.design.change-theme.install` route that uses the newer theme install modal
  - requires backing controller for query param support despite no template being rendered
  - uses the `change-theme` controller's official theme list to fetch theme details based on query param `ref`
- added `settings.change-theme` route that lives on the old `/settings/theme/install` path and redirects to the new install route
- commented out the old theme settings routes ready for full cleanup/removal
2021-11-10 10:58:29 +00:00
Kevin Ansfield
9c3ddf4b2b Added additional error reporting and context to Sentry
refs https://github.com/TryGhost/Team/issues/1121

- adds error reporting for `notifications.showAlert()` in addition to `notifications.showAPIError()` because the former is used for some handled errors but will still show the undesired red error bar
- adds `shown_to_user` tag to all reported errors. Only errors that result in the red error bar will be reported with the tag as `true`, there may still be cases where we display errors outside of the red error bar but those wouldn't make it to Sentry either, we'll need a full audit of Admin source to find those situations and handle the reporting manually
- adds `ghost` context to errors that are shown in the red bar
  - `ghost_error_code` - code returned from the API or passed manually through the `notifications.showAPIError()` options argument. Will be filled in once the error message has been audited+approved
  - `displayed_message` - the full error message displayed to the user. Admin combines multiple attributes from the error details so it's useful to see what we actually show
  - `full_error` - the actual API error response or a client-side generated error object
  - `source` - whether the red bar came from `.showAlert()` or `.showAPIError()`, useful for tracking down where errors originated
2021-11-08 12:34:23 +00:00
Peter Zimon
e5b6db173c Removed obsolete integration files
- removed unused integration files (was restructured under Settings / integrations)
- removed unused routes
2021-11-05 13:42:38 +01:00
Peter Zimon
62dd32c411 Removed unused staff related files
- removed old staff files
- removed unused routes
2021-11-05 13:10:58 +01:00
Kevin Ansfield
7251b1acac Added acceptance tests for new design screen
no issue

- moved navigation settings tests from old settings/design tests to a separate file and unskipped them
- added happy-path acceptance tests for
  - rendering design screen
  - installing an official theme from the themes list
  - uploading a custom theme
2021-11-01 17:48:49 +00:00
Rishabh Garg
65495b528f 🐛 Fixed settings previews not working in private site mode (#2128)
closes https://github.com/TryGhost/Team/issues/1161

- when a site is in private mode, design previews, the portal previews on membership, customize portal and offer pages were unable to load. 
- For design and theme previews, the request to fetch preview data was failing due to cors and cookie not attached when admin and frontend have split urls. 
- For portal and offer previews, there was no authentication done on private site before load, so if user opened the pages directly on them it failed to load the site.
- this change adds a new service that authenticates private site from admin as soon as user session is loaded, so previews on settings will always find the authenticated session for private sites and load correctly.
- it also updates fetch method for previews to include credentials so they are always able to fetch the site data after login
- removes authentication from site route since that was done as its now centrally taken care of by the frontend service
2021-10-28 18:29:41 +05:30
Aileen Nowak
b63a396423 Added handling for forceUpgrade state (#2116)
no issue

- Lapsed trials and subscriptions will set the site's hosting config to `forceUpgrade` in which case a Ghost(Pro) site does not have a valid subscription or trial
- In this state we need to redirect all routes for all staff users to `/#/pro` to ensure the subscription can be put back into an active state
- This commit tackles
    - Route update on startup on the application route level
    - Catching and redirecting all transition (utils routes)
    - Fetching the owner user to pass this information to the Ghost(Pro) app for better communication to non-owner staff users
    - Allowing non-owner users in the force upgrade state to transition to the `/#/pro` route
2021-10-22 12:29:55 +02:00
Kevin Ansfield
505ae7493e Optimized loading of custom theme setting in design screens
no issue

We want to automatically show brand settings expanded in the design menu when the active theme has no custom theme settings, in order to do that without causing visual noise/jank we need to ensure that we have all the data we need up-front before the design menu is rendered.

- optimized `customThemeSettings` loading behaviour
  - `.load()` will now only perform a fetch if settings have not previously been loaded so it can be called without causing unnecessary waits
  - `.reload()` will force a clear+refetch of the settings - called by `themeManagement.activate()` after successfully changing a theme
- moved fetching of theme settings from the design menu constructor to the `settings.design` route's `model()` hook
  - means the app will wait for loading to finish before showing any of the design settings screen so we can guarantee the data we need is available
- moved update of preview html from the design menu constructor to the design settings route as it's a more appropriate place to find screen setup/loading behaviour
2021-10-22 10:49:13 +01:00
Kevin Ansfield
83eb392403 Added a redirect from /settings/theme -> /settings/design
no issue

- ensure the old theme screen is not accessible when the `customThemeSettings` feature is active to avoid confusion
2021-10-21 16:35:20 +01:00
Kevin Ansfield
1593eed79a Closed advanced theme settings when leaving change-theme route
refs https://github.com/TryGhost/Team/issues/1149

- uses `willTransition` action rather than `deactivate` hook because we also want to close the table when navigating to the theme demo child routes
2021-10-20 20:54:15 +01:00
Kevin Ansfield
09fcdc3629 Reset homepage/post and mobile/desktop selects when leaving design screen
refs https://github.com/TryGhost/Team/issues/1149

- it felt unexpected for state to be remembered when moving around the design/settings screens
2021-10-20 17:35:03 +01:00
Kevin Ansfield
10176087f8 Fixed syntax error
refs d9c9818c73

- trailing `}` was lost when deleting functionality from the `design.settings` route class
2021-10-19 16:25:37 +01:00
Kevin Ansfield
d9c9818c73 Fixed custom theme settings disappearing when confirming leave-without-save
refs https://github.com/TryGhost/Team/issues/1149

- `customThemeSettings.rollback()` was not performing the correct job, changed to rollback attributes on each model rather than resetting everything to empty
- moved leave confirmation handling to the `settings.design.index` route so that it's always called when moving to the change-theme route, previously with the behaviour on the main `settings.design` route the willtransition/deactivate was not called when expected because that route is still active when on `settings.design.change-theme`
2021-10-19 16:22:16 +01:00
Sanne de Vries
e0842183c0 Updated design settings and theme directory
Refs https://github.com/TryGhost/Team/issues/1149
2021-10-18 17:43:06 +02:00
Peter Zimon
737db37175 Added Integrations as a subpage of Settings
- Restructured Admin so that Integrations becomes a subpage of Settings.
2021-10-18 14:47:59 +02:00
Kevin Ansfield
9a0a98e64a Added "active" indicator and list themes in "active, default, ...rest" order
refs https://github.com/TryGhost/Team/issues/1149

- built a secondary list of themes that's decorated and sorted for display purposes
2021-10-18 13:02:35 +01:00
Peter Zimon
a78afb5749 Added Staff as subpages of Settings
- The Admin is being restructured with Offers. This commit moves Staff under Settings.
2021-10-18 13:27:42 +02:00
Rishabh
88049f1692 Updated offers list to filter on archived offers
refs https://github.com/TryGhost/Team/issues/1136

- adds dropdown for active/archived offers selection
- wires active/archived offers on list screen to API
- filters offers list on archived/active based on selection
2021-10-13 21:23:30 +05:30
Kevin Ansfield
265a19f550 Added initial view-theme modal for installing from themes list
refs https://github.com/TryGhost/Team/issues/1130

- added new route for viewing themes so back/forward buttons can be used
  - takes theme name as a parameter
  - opens a fullscreen modal with an iframe containing the theme demo
- changed installable themes list to link to new route
- swapped `previewUrl` in theme data to point at the real demo rather than the ghost.org demo page
2021-10-12 14:28:05 +01:00