pptb-universal-search
v1.0.1
Published
A comprehensive search tool for finding records, metadata, and solution components across Dataverse environments using wildcards and specific values.
Readme
Universal Search for Power Platform ToolBox
A comprehensive search tool for Power Platform ToolBox (PPTB) that enables searching across records, metadata, and solution components in Dataverse environments using specific values and wildcard patterns.
✨ Features
Core Search Capabilities
- 🔍 Multi-mode search: Records, metadata, and solution components
- 🎯 Wildcard support: Use
*and?for flexible pattern matching - 📊 Entity selection: Choose specific entities or search across all
- 🏷️ Picklist integration: Search by option labels and values
- 🔗 Lookup field support: Deep search across related records
- ⚙️ Solution filtering: Scope searches to specific solutions
Search Options
- Case sensitivity: Toggle case-sensitive/insensitive searches
- Attribute filtering: Include/exclude specific attribute types
- Relationship search: Navigate through entity relationships
- Forms & Views: Search across custom forms and view definitions
- Real-time results: Progressive search with live updates
User Experience
- 📱 Responsive design: Optimized for different screen sizes
- 🎨 Theme awareness: Automatic light/dark theme detection
- ⌨️ Keyboard shortcuts: F11 or Ctrl+Enter for fullscreen
- 📋 Results export: Copy results or open records directly
- 🚀 Progress tracking: Real-time search progress with cancellation
🏗️ Architecture
universal-search/
├── src/
│ ├── components/ # React UI components
│ │ ├── EntitySelectionPanel.tsx # Entity picker
│ │ ├── SearchControlsPanel.tsx # Search options & controls
│ │ ├── SearchResults.tsx # Results display with tabs
│ │ └── SearchProgressIndicator.tsx # Progress & cancellation
│ ├── services/ # Business logic
│ │ ├── UniversalSearchService.ts # Core search engine
│ │ └── MetadataCache.ts # Metadata caching
│ ├── hooks/ # React hooks
│ │ └── useToolboxAPI.ts # PPTB API integration
│ ├── types/ # TypeScript definitions
│ │ └── search.ts # Search types & interfaces
│ └── test/ # Testing infrastructure
├── dist/ # Production build output
├── TESTING.md # Testing documentation
└── README.md # This file🚀 Quick Start
Prerequisites
- Node.js ≥18.0.0
- Power Platform ToolBox
- Access to Dataverse environment
Installation
# Install dependencies
npm install
# Run tests
npm test
# Build for production
npm run buildDevelopment
# Start development server with HMR
npm run dev
# Run tests in watch mode
npm run test:watch
# Generate coverage report
npm run test:coverage🔧 Usage
Basic Search
- Connect to your Dataverse environment via PPTB
- Select entities to search (or leave blank for all)
- Choose search mode: Records, Metadata, or Solutions
- Enter search text with optional wildcards (
*,?) - Configure options (case sensitivity, attribute types, etc.)
- Click Search to begin
Wildcard Patterns
*company*- Matches any text containing "company"test*- Matches text starting with "test"*Ltd- Matches text ending with "Ltd"te?t- Matches "test", "text", "tent", etc.
Advanced Features
- Fullscreen mode: Press F11 or Ctrl+Enter
- Panel collapse: Click arrow buttons to hide/show panels
- Result navigation: Use tabs to switch between entity results
- Record opening: Click table rows to open records in Dataverse
- Search cancellation: Use progress indicator to stop long searches
🧪 Testing
The project includes comprehensive unit tests with 100% pass rate (97/97 tests):
# Run all tests
npm test
# Watch mode for development
npm run test:watch
# Coverage report
npm run test:coverageTest Coverage Areas:
- ✅ Component rendering and interactions
- ✅ Search service functionality
- ✅ API integrations and error handling
- ✅ Type safety and interface contracts
- ✅ Metadata caching and performance
See TESTING.md for detailed testing documentation.
🔌 PPTB Integration
The tool integrates seamlessly with Power Platform ToolBox APIs:
Connection Management
const { connection, isLoading } = useConnection();
// Automatically handles PPTB connection stateEvent Handling
useToolboxEvents((event, data) => {
// Responds to connection changes, theme updates, etc.
});Notifications
await window.toolboxAPI.utils.showNotification({
title: 'Search Complete',
body: `Found ${results.length} results`,
type: 'success'
});🛠️ Development
Key Components
- UniversalSearchService: Core search logic with progressive results
- MetadataCache: Efficient caching for entity and picklist metadata
- SearchControlsPanel: Tabbed interface for search configuration
- SearchResults: Tabular results with highlighting and pagination
- EntitySelectionPanel: Multi-select entity picker with search
Contributing
- Follow TypeScript strict mode guidelines
- Maintain 100% test coverage for new features
- Use React hooks and functional components
- Follow existing code patterns and naming conventions
📄 License
MIT License - see LICENSE file for details.
👨💻 Author
Mike Ochs - [email protected]
Built for Power Platform ToolBox with ❤️ and TypeScript
