Added naive stats button to Post analytics#22555
Conversation
ref ANAL-141 - Traffic analytics can be filtered for pages but only from within stats. This PR adds a button in the Post analytics which allows direct filtering of the post in traffic analytics. This is a naive implementation as it simply redirects to Stats and prefilters for the slug, it doesn't check if any data exists for the post in analytics. Also since it's based on slug and not post.id it only works until the URL/slug is not changed.
|
Caution Review failedThe pull request is closed. WalkthroughThe changes modify the analytics functionality in two parts. In the template file, a conditional block is introduced that checks if a user has administrative permissions and if the statistics feature is enabled in the configuration. When both conditions are met, a link is rendered to navigate to the post's statistics view using the post’s slug as a query parameter. In the corresponding component file, two services are added: a session service to handle user session data and a configuration service (injected with an Suggested labels
Warning There were issues while running some tools. Please review the errors and either fix the tool’s configuration or disable the tool if it’s a critical failure. 🔧 ESLint
ghost/admin/app/components/posts/analytics.jsOops! Something went wrong! :( ESLint: 8.44.0 Error: Failed to load parser '@babel/eslint-parser' declared in 'ghost/admin/.eslintrc.js': Cannot find module '@babel/eslint-parser'
Tip ⚡🧪 Multi-step agentic review comment chat (experimental)
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (2)
✨ Finishing Touches
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:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
ref ANAL-141