-
-
Notifications
You must be signed in to change notification settings - Fork 11k
Added redirect from Ember Dashboard to new Analytics page #24613
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
ref https://linear.app/ghost/issue/PROD-2415/add-redirect-for-dashboard-analytics - added redirect from Dashboard -> Analytics This change helps preserve existing user bookmarks by simply pushing them towards the 'new dashboard'.
WalkthroughThe changes simplify the dashboard route by removing role-based conditional redirects and other lifecycle methods, leaving only an unconditional redirect to the 'stats-x' route in the Estimated code review effort🎯 3 (Moderate) | ⏱️ ~18 minutes Note ⚡️ Unit Test Generation is now available in beta!Learn more here, or try it out under "Finishing Touches" below. 📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
🧰 Additional context used🧠 Learnings (4)📚 Learning: the pending activity utilities in the ghost activitypub module are covered by tests in the file `app...
Applied to files:
📚 Learning: in the ghost test framework, when testing csv exports via the admin api, the response `body` field i...
Applied to files:
📚 Learning: the pending activity utilities in ghost's activitypub module are thoroughly tested in `apps/admin-x-...
Applied to files:
📚 Learning: in ghost project, app.js files under core/server/web are intentionally excluded from unit test cover...
Applied to files:
🔇 Additional comments (3)
✨ Finishing Touches
🧪 Generate unit tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (1)
ghost/admin/tests/acceptance/dashboard-test.js (1)
22-32
: Consider adding a test for non-Owner roles to verify unconditional redirect.While the current test verifies the redirect for an Owner, since the dashboard redirect is now unconditional for all authenticated users, consider adding at least one test with a different role (e.g., Editor or Author) to ensure the redirect works consistently across all user types.
Example additional test:
it('redirects Editor users to Analytics', async function () { let role = this.server.create('role', {name: 'Editor'}); this.server.create('user', {roles: [role]}); await authenticateSession(); await visit('/dashboard'); expect(currentURL()).to.equal('/analytics'); });
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
ghost/admin/app/routes/dashboard.js
(1 hunks)ghost/admin/tests/acceptance/dashboard-test.js
(2 hunks)
🧰 Additional context used
🧠 Learnings (4)
📚 Learning: the pending activity utilities in the ghost activitypub module are covered by tests in the file `app...
Learnt from: mike182uk
PR: TryGhost/Ghost#22471
File: apps/admin-x-activitypub/src/utils/pending-activity.ts:13-71
Timestamp: 2025-03-13T09:00:20.205Z
Learning: The pending activity utilities in the Ghost ActivityPub module are covered by tests in the file `apps/admin-x-activitypub/test/unit/utils/pending-activity.ts`.
Applied to files:
ghost/admin/tests/acceptance/dashboard-test.js
📚 Learning: in ghost project, app.js files under core/server/web are intentionally excluded from unit test cover...
Learnt from: ErisDS
PR: TryGhost/Ghost#23582
File: ghost/core/.c8rc.json:24-24
Timestamp: 2025-05-29T07:45:35.714Z
Learning: In Ghost project, app.js files under core/server/web are intentionally excluded from unit test coverage because they are not easily unit-testable due to being entry points with initialization code and side effects.
Applied to files:
ghost/admin/tests/acceptance/dashboard-test.js
📚 Learning: in the ghost test framework, when testing csv exports via the admin api, the response `body` field i...
Learnt from: ErisDS
PR: TryGhost/Ghost#23588
File: ghost/core/test/e2e-api/admin/backup.test.js:136-148
Timestamp: 2025-05-29T10:37:26.369Z
Learning: In the Ghost test framework, when testing CSV exports via the admin API, the response `body` field is empty while the actual CSV data is provided through the `text` field. Tests should use `expectEmptyBody()` and then validate the CSV content via `.expect(({text}) => ...)` - this is not contradictory behavior.
Applied to files:
ghost/admin/tests/acceptance/dashboard-test.js
📚 Learning: the pending activity utilities in ghost's activitypub module are thoroughly tested in `apps/admin-x-...
Learnt from: mike182uk
PR: TryGhost/Ghost#22471
File: apps/admin-x-activitypub/src/utils/pending-activity.ts:13-71
Timestamp: 2025-03-13T09:00:20.205Z
Learning: The pending activity utilities in Ghost's ActivityPub module are thoroughly tested in `apps/admin-x-activitypub/test/unit/utils/pending-activity.ts`, which covers `generatePendingActivityId`, `isPendingActivity`, and `generatePendingActivity` functions.
Applied to files:
ghost/admin/tests/acceptance/dashboard-test.js
🧬 Code Graph Analysis (1)
ghost/admin/tests/acceptance/dashboard-test.js (5)
ghost/admin/tests/helpers/mock-analytics-apps.js (2)
mockAnalyticsApps
(3-23)cleanupMockAnalyticsApps
(25-33)ghost/admin/tests/acceptance/analytics-navigation-test.js (2)
role
(15-15)role
(63-63)ghost/admin/tests/acceptance/authentication-test.js (2)
role
(134-134)role
(350-350)ghost/admin/tests/acceptance/signup-test.js (1)
role
(200-200)ghost/admin/tests/acceptance/members/filter-test.js (1)
role
(32-32)
🔇 Additional comments (2)
ghost/admin/app/routes/dashboard.js (1)
4-9
: Confirmation: ‘stats-x’ routes to ‘/analytics’
- Inspected
ghost/admin/app/router.js
:this.route('stats-x', {path: '/analytics'}, function () { this.route('stats-x', {path: '/*sub'}); });- The dashboard’s
transitionTo('stats-x')
will indeed navigate to/analytics
.- No further changes are needed.
ghost/admin/tests/acceptance/dashboard-test.js (1)
1-2
: Good test isolation with mock analytics apps.The addition of mock analytics apps setup and cleanup ensures proper test isolation and prevents actual component loading during tests. This is a good testing practice.
Also applies to: 14-20
ref https://linear.app/ghost/issue/PROD-2415/add-redirect-for-dashboard-analytics
This change helps preserve existing user bookmarks by simply pushing them towards the 'new dashboard'.