Skip to content

Conversation

dfradehubs
Copy link

Description

This PR implements Display Names functionality for Index Patterns, allowing users to assign friendly, intuitive names to complex technical patterns without altering their semantic behavior.

Key Changes:

  • New optional displayName field: Added to IndexPatternSpec interface and index pattern data model
  • Separation of presentation and semantics: The title field maintains the technical pattern (used in queries), while displayName provides a user-friendly name for the UI
  • Full backward compatibility: Existing index patterns work without changes; if displayName is not set, title is used as fallback
  • Complete UI integration:
    • Management UI: Create and edit display names
    • Discover/Data Explorer: Selectors show friendly names
    • Visualize: Display names in all pickers
    • Dashboards: Friendly names in all contexts
    • Breadcrumbs and page titles updated

Benefits:

✅ Significant UX improvement for complex patterns (e.g., logs-*,prod-istio-gateway-*,metrics-* → "Production Logs")
✅ Easier adoption for non-technical users
✅ Reduces errors when selecting patterns in environments with many index patterns
✅ No breaking changes - transparent migration
✅ Enterprise-friendly with readable naming conventions

Issues Resolved

Closes #10645

Screenshot

Management - Index Pattern Creation:
Image

Index Pattern Selector in Discover:

Image

Creation Wizard - Step 1:

Image

Visualization:

Image Image

Testing the changes

Initial Setup:

  1. Clone the fork and switch to the main branch:

    git clone https://github.com/dfradehubs/OpenSearch-Dashboards.git
    cd OpenSearch-Dashboards
    yarn install
    yarn start
  2. Start OpenSearch Dashboards in development mode

Test Cases:

1. Create New Index Pattern with Display Name

  • Navigate to Management → Index Patterns → Create Index Pattern
  • Enter a technical pattern: test-logs-*,test-metrics-*
  • In the "Display Name" field (new), enter: Test Environment Data
  • Complete creation
  • Expected result: Selector shows "Test Environment Data" instead of the technical pattern

2. Edit Display Name of Existing Index Pattern

  • Open an existing index pattern in Management
  • Click the pencil icon next to the title
  • Modify the Display Name
  • Save changes
  • Expected result: Changes are immediately reflected throughout the UI

3. Backward Compatibility

  • Index patterns without displayName should automatically display their title
  • Expected result: No visual changes for existing patterns

4. Functionality in Discover

  • Go to Discover
  • Open the index pattern selector
  • Expected result: Patterns with displayName show the friendly name, others show title

5. Queries Unaffected

  • Create a visualization using an index pattern with displayName
  • Verify in DevTools that queries use the title field (technical pattern)
  • Expected result: Queries continue using the original technical pattern

6. Export/Import

  • Export an index pattern with displayName
  • Import into another instance
  • Expected result: displayName is preserved correctly

7. Migration

  • Start the application with existing index patterns
  • Expected result: Migration executes automatically without errors

Automated Tests:

# Unit tests
yarn test:jest

# Integration tests
yarn test:jest_integration

# Module-specific tests
yarn test:jest --testPathPattern=index_pattern

Changelog

  • feat: Add optional displayName field to Index Patterns for improved UX with friendly names while preserving technical patterns
  • feat: Update Index Pattern creation wizard to include Display Name input field
  • feat: Implement inline Display Name editor in Index Pattern management page
  • feat: Update all selectors (Discover, Visualize, Dashboard) to display friendly names
  • feat: Add getDisplayName() method with automatic fallback to title for backward compatibility
  • refactor: Update IndexPatternSpec interface and saved object mappings to support displayName
  • test: Add comprehensive unit and integration tests for Display Name functionality

Check List

  • All tests pass
    • yarn test:jest
    • yarn test:jest_integration
  • New functionality includes testing.
  • New functionality has been documented.
  • Update CHANGELOG.md
  • Commits are signed per the DCO using --signoff

Additional Notes for Reviewers

Files Modified (~30 files):

Core Models & Types:

  • src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts
  • src/plugins/data/common/index_patterns/types.ts

UI Components:

  • src/plugins/index_pattern_management/public/components/create_index_pattern_wizard/
  • src/plugins/index_pattern_management/public/components/edit_index_pattern/
  • src/plugins/data/public/ui/index_pattern_select/

Integration Points:

  • Discover plugin
  • Visualize plugin
  • Dashboard plugin
  • Data Explorer plugin

Migration Strategy:

Migration runs automatically on startup and is safe:

  • Adds displayName: undefined to all existing index patterns
  • No data loss
  • Safe rollback if needed

Performance Impact:

✅ Minimal impact - only one additional field in memory
✅ No additional backend queries
✅ Lazy loading where possible

Implementation Highlights:

  • Clean separation of concerns (presentation vs. semantics)
  • Follows established patterns from Kubernetes, Grafana, and LDAP
  • Zero breaking changes to existing functionality
  • Comprehensive test coverage including edge cases
  • Fully documented with inline comments and JSDoc

Copy link
Contributor

github-actions bot commented Oct 9, 2025

❌ Invalid Prefix For Manual Changeset Creation

Invalid description prefix. Found "feat". Only "skip" entry option is permitted for manual commit of changeset files.

If you were trying to skip the changelog entry, please use the "skip" entry option in the ##Changelog section of your PR description.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature] Support Display Names for Index Patterns

1 participant