ezsystems/ezplatform-admin-ui-modules
Modular extensions for eZ Platform Admin UI. Provides pluggable UI modules and integration points to customize and extend the back-office experience, enabling additional features, panels, and workflows within the admin interface.
Installation Add the package via npm/yarn in your eZ Platform Admin UI project:
yarn add @ezsystems/ezplatform-admin-ui-modules
Ensure your project uses React 16.8+ (for hooks) and eZ Platform Admin UI (v3.x+).
Locate Core Components
Browse the source code (if available) or check the dist folder for pre-built components. Key entry points:
Button (e.g., @ezsystems/ezplatform-admin-ui-modules/Button)Modal (e.g., @ezsystems/ezplatform-admin-ui-modules/Modal)DataGrid (for tabular data)Form utilities (e.g., field components, validation helpers).First Use Case: Adding a Button
Import and use the Button component in your admin panel:
import { Button } from '@ezsystems/ezplatform-admin-ui-modules/Button';
function MyComponent() {
return <Button label="Save" onClick={() => console.log('Saved')} />;
}
Styling & Theming
styled-components:
import styled from 'styled-components';
const StyledButton = styled(Button)`
background: #ff0000;
`;
theme prop (if supported) for dynamic theming:
<Button theme="danger" label="Delete" />
Forms & Validation
Field and Form components for consistent input handling:
import { Field, Form } from '@ezsystems/ezplatform-admin-ui-modules/Form';
<Form onSubmit={handleSubmit}>
<Field name="title" label="Title" type="text" />
</Form>
ContentService) for backend validation.DataGrid Integration
DataGrid for CRUD operations with server-side data:
import { DataGrid } from '@ezsystems/ezplatform-admin-ui-modules/DataGrid';
<DataGrid
columns={columns}
data={fetchContentItems()}
onRowClick={handleRowClick}
/>
useFetch or useQuery hooks for data loading.Modal Dialogs
import { Modal } from '@ezsystems/ezplatform-admin-ui-modules/Modal';
<Modal
title="Confirm"
onClose={handleClose}
actions={[
<Button key="cancel" label="Cancel" onClick={handleClose} />,
<Button key="confirm" label="Confirm" onClick={handleConfirm} />,
]}
>
Are you sure?
</Modal>
Integration with eZ Platform Services
useService hook (if available) to inject eZ services:
const { contentService } = useService('contentService');
Custom Components
Button for analytics):
const TrackedButton = ({ label, onClick, ...props }) => (
<Button
label={label}
onClick={() => {
trackEvent('button_click', { label });
onClick();
}}
{...props}
/>
);
Internationalization (i18n)
useTranslation (if supported) for labels:
const { translate } = useTranslation();
<Button label={translate('admin.save')} />
Server-Side Rendering (SSR)
window checks). Test with next-server or laravel-mix SSR.Testing
@testing-library/react:
test('renders button', () => {
const { getByText } = render(<Button label="Test" />);
expect(getByText('Test')).toBeInTheDocument();
});
Dependency Conflicts
resolutions in package.json or yarn.lock to enforce versions:
"resolutions": {
"react": "16.14.0",
"@ezsystems/ezplatform-admin-ui-modules": "1.0.0"
}
Missing TypeScript Support
.d.ts files may cause IDE errors.@types/react for base components.Undocumented Props
data-testid).console.log to explore props:
<Button label="Debug" onClick={() => console.log(Button.propTypes)} />
eZ Platform API Changes
Performance with Large DataGrids
windowing or virtualization (e.g., react-window).Console Logging
<Button
label="Debug"
onClick={() => console.log('Button clicked!', { props })}
/>
React DevTools
Network Requests
ContentService requests).Error Boundaries
class ErrorBoundary extends React.Component {
state = { hasError: false };
static getDerivedStateFromError() { return { hasError: true }; }
render() { return this.state.hasError ? <div>Fallback UI</div> : this.props.children; }
}
Custom Themes
--ez-button-primary-color) in your global styles.New Components
Select, DatePicker).Hooks Utilities
useContentService):
const useContentService = () => {
const { services } = useContext(eZPlatformContext);
return services.contentService;
};
Storybook Integration
yarn add -D @storybook/react
eZ Platform Context
eZPlatformContext (check ez-platform-admin-ui docs).Lazy Loading
const LazyButton = React.lazy(() => import('@ezsystems/ezplatform-admin-ui-modules/Button'));
Environment Variables
process.env for API endpoints (e.g., API_URL) in components.Build Optimization
webpack to exclude unused components:
// webpack.config.js
optimization: {
splitChunks: { chunks: 'all' },
},
How can I help you explore Laravel packages today?