dxpr / analyze

API framework adding analysis data to Drupal entities' Analyze tab.
GNU General Public License v2.0
0 stars 1 forks source link

Implement Core Features for the Analyze Module #1

Open jjroelofs opened 1 month ago

jjroelofs commented 1 month ago

Proposal

This proposal outlines the implementation of the Analyze module, which serves as a platform for displaying analysis results related to content entities in Drupal. The module will provide various reports and metrics, enhancing the Analyze tab for entities.

Important note

What you see in the screenshot is what you can already see when enabling this module and going to a node and clicking the Analyze tab. This is for demonstration purposes only, to showcase the design and the gauge widget which has been developed for you already.

analyze

Why are we doing this work

The Analyze module aims to provide users with valuable insights into their content through various analysis reports. This will help improve content quality and engagement by making data-driven decisions.

Requirements

  1. Core Module Development

    • Implement the hook_analyze_info() function
      • Define structure for analyzer plugins
      • Allow plugins to specify data points and report links
    • Implement the hook_analyze_info_alter() function
      • Enable modules to modify existing analyzer definitions
    • Create a service for managing analyzers and their results
      • Provide methods to retrieve analyzer results
      • Handle plugin discovery and instantiation
    • Implement permission handling for accessing analysis data
      • Define granular permissions for viewing analysis results
      • Integrate with Drupal's existing permission system
    • Develop analyze.api.php file following Drupal API documentation and comment standards
    • Remove https://github.com/dxpr/analyze/blob/1.0.x/src/Controller/AnalyzeController.php
  2. User Interface

    • Max 3 pieces of information can be shown on the Analyze tab (top level page), per implementation of the API
    • On the full page, e.g. '/node/{node}/analyze/accessibility — there is no moderation, anything can be shown just as on a regular page callback.
    • Convert existing gauge template to a Single Directory Component
      • Use Drupal's SDC system
      • Ensure compatibility with different themes
    • Develop admin UI for Analyze module
      • Create entity bundle configuration options (similar to content translation module)
      • Integrate with entity type configuration pages
      • Allow per-bundle analyzer selection
      • Implement Analyze module admin page listing plugin configurations for enabled entity types
      • Provide overview of all enabled analyzers
      • Allow global configuration of analyzers
  3. Additional Features

    • Test multilingual support
      • Ensure all strings are translatable
      • Test with RTL languages
      • Verify that statistics like word count and page views are counted for the correct translation
  4. Submodule Development (after main module completion)

    • Develop ./modules/analyze_basic_content_info submodule
      • Implement analyzer for basic content metadata
    • Develop ./modules/analyze_page_views submodule
      • Integrate with Drupal statistics module for page view data display
      • Implement analyzer for displaying page view statistics

What does success look like, and how can we measure that?

Desired business outcomes

Acceptance criteria

Links / references

jjroelofs commented 1 month ago

The task described we manage analyze plugins in a similar way to how Content translation module does it:

Here are some screenshots to help you understand how it works in Content translation module:

Screenshot 2024-08-12 at 09 09 51 Screenshot 2024-08-12 at 09 10 11 Screenshot 2024-08-12 at 09 11 29 Screenshot 2024-08-12 at 09 13 44