๐ Directus User Field Hider
Hide specific fields from directus_users form with an easy-to-use configuration interface.
The ultimate solution for simplified user management in Directus
๐ Quick Start โข ๐ Features โข ๐ฆ Installation โข ๐ฏ Usage โข ๐ค Contributing
โจ Problem Solved
Directus doesn’t allow hiding system fields from the directus_users
collection through the standard interface. This extension provides a clean, user-friendly solution to hide unwanted fields from user forms without modifying core files.
Perfect for:
- ๐ข HR departments managing users without technical fields
- ๐ฅ Multi-role organizations with different user types
- ๐จ Clean UI/UX with reduced visual clutter
- ๐ Security compliance hiding sensitive system fields
๐ Quick Start
# Install via NPM
npm install directus-user-field-hider
# Or download and extract to your extensions folder
# extensions/directus-user-field-hider/
- Restart your Directus instance
- Navigate to Settings โ User Field Hider (Admin only)
- Select fields to hide and Save
- Done! Fields are hidden immediately ๐
๐ Features
๐๏ธ Intuitive Configuration Interface
- โ Visual field selector with categorized organization
- โ Smart search functionality to quickly find fields
- โ Real-time CSS preview showing generated code
- โ Immediate application - see changes instantly
- โ Admin-only access for security
๐ Comprehensive Field Coverage
๐ค Basic Information
- ID, Names, Email
- Password, Avatar
๐ Profile & Location
- Location, Title
- Description, Tags
โ๏ธ Preferences
- Language, 2FA Secret
- Email Notifications
- Preference Dividers
๐จ Theming
- Appearance Mode
- Light/Dark Themes
- Theme Overrides
๐ง Administration
- Status, Role, Policies
- Access Tokens
๐ System & Tracking
- Provider, External ID
- Last Access, Last Page
๐ฏ Smart CSS Injection
- ๐ Persistent across page loads and route changes
- ๐ฏ SPA-aware automatic detection
- ๐ Authentication handling with stored tokens
- โก Conflict-free with unique element IDs
๐ฆ Installation
Method 1: NPM (Recommended)
npm install directus-user-field-hider
Method 2: Manual Installation
- Download the latest release
- Extract to:
extensions/directus-user-field-hider/
- Restart your Directus instance
Method 3: Build from Source
git clone https://github.com/brunribeiro/directus-user-field-hider.git
cd directus-user-field-hider
npm install
npm run build
๐ฏ Usage
1๏ธโฃ Access the Module
- Log in as an admin user
- Navigate to Settings โ User Field Hider
- Access the configuration interface
2๏ธโฃ Configure Hidden Fields
- Browse categories to find fields
- Use search for quick location
- Toggle checkboxes to hide/show fields
- Preview CSS in real-time
- Save configuration
3๏ธโฃ Real-time Application
- Changes apply immediately
- Works across all admin pages
- Persists after browser refresh
๐จ Generated CSS Example
When you select fields, the extension generates clean CSS:
.field[data-collection="directus_users"][data-field="id"],
.field[data-collection="directus_users"][data-field="location"],
.field[data-collection="directus_users"][data-field="title"],
.field[data-collection="directus_users"][data-field="preferences_divider"] {
display: none !important;
}
โ๏ธ Configuration Storage
Settings are securely stored in Directus settings:
{
"user_field_hider_config": {
"hidden_fields": [
"id", "location", "title",
"preferences_divider", "language"
],
"updated_at": "2024-12-18T10:30:00.000Z"
}
}
๐ฏ Use Cases & Benefits
๐ข Enterprise Use Cases
- HR Departments: Hide technical fields from HR staff
- Multi-role Organizations: Different interfaces per user type
- Client Management: Simplified user registration forms
- Training Environments: Reduced complexity for new users
โจ Benefits
- ๐จ Cleaner UI: Remove visual clutter
- ๐ Enhanced Security: Hide sensitive system fields
- โก Better UX: Streamlined user management
- ๐ฑ Responsive: Works on all devices
๐ Security & Compliance
- ๐ก๏ธ Admin-only access: Restricted to users with admin privileges
- ๐ Safe CSS injection: Uses unique IDs to prevent conflicts
- ๐๏ธ No core modifications: Doesn’t touch Directus core files
- ๐ Audit trail: All changes logged with timestamps
๐งช Development
Prerequisites
- Node.js 18+
- Directus 10+
- Admin access
Local Development
# Clone repository
git clone https://github.com/brunribeiro/directus-user-field-hider.git
cd directus-user-field-hider
# Install dependencies
npm install
# Build extension
npm run build
# Development mode
npm run dev
Project Structure
directus-user-field-hider/
โโโ ๐ฆ package.json # Extension configuration
โโโ ๐๏ธ src/
โ โโโ ๐ฏ index.ts # Module definition
โ โโโ ๐จ module.vue # Main Vue component
โโโ ๐ dist/ # Built extension
โโโ ๐ README.md # Documentation
โโโ ๐ LICENSE # MIT License
๐ Deployment
Production Setup
- Install extension in Directus
- Restart Directus instance
- Configure field visibility
- Test user forms
Docker Support
# Copy extension to Directus container
COPY extensions/directus-user-field-hider /directus/extensions/
๐ค Contributing
We welcome contributions! ๐
How to Contribute
- ๐ด Fork the repository
- ๐ฟ Create a feature branch (
git checkout -b feature/amazing-feature
) - ๐ฌ Commit changes (
git commit -m 'Add amazing feature'
) - ๐ค Push to branch (
git push origin feature/amazing-feature
) - ๐ Open a Pull Request
Development Guidelines
- Follow existing code style
- Test thoroughly across scenarios
- Update documentation for new features
- Ensure Directus compatibility
๐ Troubleshooting
- โ Ensure you have admin privileges
- โ Check extension is properly installed
- โ Restart your Directus instance
- โ Clear browser cache
- โ Verify field names match exactly
- โ Check browser developer tools for CSS conflicts
- โ Clear cache and reload page
- โ Check configuration is saved
- โ Check Directus logs for API errors
- โ Verify admin permissions
- โ Ensure settings API is accessible
- โ Check network connectivity
๐ Statistics & Performance
- โก ~50KB bundle size
- ๐ <100ms initial load time
- ๐พ Minimal memory footprint
- ๐ Zero dependencies (uses Directus SDK)
๐ฏ Roadmap
- ๐ Multi-language support (PT-BR, ES, FR, DE)
- ๐ Bulk import/export configurations
- ๐ฅ Role-based field visibility rules
- ๐ Field grouping and organization
- ๐จ Enhanced CSS customization options
- ๐ฑ Mobile app compatibility
- ๐ API endpoints for programmatic control
๐ License
This project is licensed under the MIT License - see the LICENSE file for details.
๐ Acknowledgments
- ๐ Directus Team for the amazing extension SDK
- ๐ Community for feedback and feature requests
- ๐จ Vue.js Team for the excellent framework
- ๐ก CSS injection techniques inspired by modern web development
๐ Support
Need help? We’re here for you!
- ๐ Documentation: Full Guide
- ๐ Bug Reports: Create Issue
- ๐ก Feature Requests: Submit Idea
- ๐ฌ Discussions: Community Forum
โญ Star this repo if it helped you!
Made with โค๏ธ by Bruno Ribeiro
๐ Get Started Now โข ๐ View Docs โข ๐ค Contribute