Skip to content

Implement Standardized Content Node Specifications #13315

Open
@Abhishek-Punhani

Description

@Abhishek-Punhani

This issue is not open for contribution. Visit Contributing guidelines to learn about the contributing process and how to find suitable issues.

Problem

Currently, content node validation is scattered across components, leading to:

  • Duplicated validation logic
  • Inconsistent validation rules
  • Difficulty maintaining validation requirements

Motivation

We need a centralized, reusable specification system for content nodes to:

  • Ensure consistency across the application
  • Reduce code duplication
  • Make validation maintenance easier
  • Support component-specific extensions

Proposed Solution

  1. Create a base content node specification in packages/kolibri/utils/specs/:

    • Define required/optional fields
    • Implement type validation
    • Support extensibility
  2. Migrate existing validation:

    • Move component-specific validation to central specs
    • Update components to use the new spec system
    • Support extensions for special cases (e.g., LibraryAndChannelBrowserMainContent)

Implementation Details

  • Location: packages/kolibri/utils/specs/contentNodeSpec.js
  • Based on the existing objectSpecs.js pattern
  • Will support:
    • Required/optional fields
    • Type validation
    • Default values
    • Extension mechanism
    • Nested object validation

/cc @rtibbles @nucleogenesis

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions