You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+77-35Lines changed: 77 additions & 35 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,17 +1,13 @@
1
1
# Widgetized Dashboard
2
2
3
-
A generic, reusable PatternFly component library providing a customizable widget-based dashboard with drag-and-drop functionality. This library was created by lifting and adapting code from the [RedHatInsights/widget-layout](https://github.com/RedHatInsights/widget-layout) repository, removing console-specific dependencies to make it suitable for any PatternFly application.
3
+
A generic, reusable PatternFly component library providing a customizable widget-based dashboard with drag-and-drop functionality.
4
4
5
-
## Features
5
+
## Prerequisites
6
6
7
-
-**Drag-and-Drop Grid Layout**: Powered by `react-grid-layout` with responsive breakpoints
8
-
-**Widget Drawer**: Easy widget selection and management
9
-
-**Lock/Unlock Widgets**: Prevent accidental changes to widget positions and sizes
10
-
-**Resize Widgets**: Adjust widget dimensions with corner handles
11
-
-**Responsive Design**: Automatic layout adjustments for xl, lg, md, and sm breakpoints
12
-
-**Customizable**: Fully configurable widgets with custom icons, titles, and content
13
-
-**TypeScript Support**: Full type definitions included
14
-
-**No External Dependencies**: Self-contained state management (no Jotai, Redux, or other state libraries required)
-[Basic Example](./packages/module/patternfly-docs/content/examples/BasicExample.tsx) - Complete dashboard with drawer
88
+
-[Locked Layout Example](./packages/module/patternfly-docs/content/examples/LockedLayoutExample.tsx) - Dashboard with locked widgets
89
+
-[Without Drawer Example](./packages/module/patternfly-docs/content/examples/WithoutDrawerExample.tsx) - Grid layout without widget drawer
89
90
90
91
## Key Components
91
92
@@ -105,40 +106,81 @@ The widget selection drawer (can be used standalone with GridLayout).
105
106
106
107
Individual widget tile wrapper with actions menu (used internally by GridLayout).
107
108
108
-
## Differences from widget-layout
109
+
## Development
109
110
110
-
This library is based on [RedHatInsights/widget-layout](https://github.com/RedHatInsights/widget-layout) but has been adapted to be a generic, reusable PatternFly component:
111
+
### Setup
111
112
112
-
### Removed
113
-
- ❌ Scalprum federated module loading
114
-
- ❌ Chrome Services API calls for template persistence
- ✅ Generic widget rendering via `renderWidget` prop
122
-
- ✅ Prop-based template management (bring your own state management)
123
-
- ✅ Optional analytics callback
124
-
- ✅ Standalone component usage (no external state required)
125
-
- ✅ Full TypeScript support
126
-
- ✅ Simplified API without console dependencies
119
+
2. Install dependencies:
120
+
```bash
121
+
yarn install
122
+
```
127
123
128
-
## Browser Support
124
+
3. Start the development server:
125
+
```bash
126
+
yarn start
127
+
```
128
+
This will build the library and start the documentation site at http://localhost:8003
129
129
130
-
Modern browsers (Chrome, Firefox, Safari, Edge) with ES6 support.
130
+
### Building for Production
131
131
132
-
## License
132
+
```bash
133
+
yarn build
134
+
```
133
135
134
-
MIT
136
+
### Testing and Linting
137
+
138
+
- Run unit tests: `yarn test`
139
+
- Run linter: `yarn lint`
140
+
- Lint JavaScript: `yarn lint:js`
141
+
- Lint Markdown: `yarn lint:md`
142
+
143
+
### Accessibility Testing
144
+
145
+
1. Build the docs: `yarn build:docs`
146
+
2. Serve the docs: `yarn serve:docs`
147
+
3. In a new terminal window, run: `yarn test:a11y`
148
+
4. View the generated report: `yarn serve:a11y`
135
149
136
150
## Contributing
137
151
152
+
We welcome contributions! Please follow the guidelines below when contributing to this project.
153
+
154
+
### Component Guidelines
155
+
156
+
- Follow PatternFly naming conventions
157
+
- Include TypeScript definitions for all components and props
158
+
- Write unit tests using React Testing Library
159
+
- Add documentation examples in `packages/module/patternfly-docs/content/examples/`
160
+
- Follow the existing code style and linting rules
161
+
- Ensure all tests pass before submitting a pull request
162
+
163
+
### Pull Request Process
164
+
165
+
1. Fork the repository
166
+
2. Create a feature branch (`git checkout -b feature/amazing-feature`)
167
+
3. Make your changes with appropriate tests
168
+
4. Run `yarn lint` and `yarn test` to ensure code quality
169
+
5. Commit your changes (`git commit -m 'Add some amazing feature'`)
170
+
6. Push to the branch (`git push origin feature/amazing-feature`)
171
+
7. Open a pull request
172
+
138
173
### AI-assisted development guidelines
139
174
140
175
Please reference [PatternFly's AI-assisted development guidelines](https://github.com/patternfly/.github/blob/main/CONTRIBUTING.md) if you'd like to contribute code generated using AI.
141
176
142
-
## Credits
177
+
## License
178
+
179
+
This project is licensed under the MIT License - see the [LICENSE](./LICENSE) file for details.
This library is based on the [RedHatInsights/widget-layout](https://github.com/RedHatInsights/widget-layout) repository, adapted to be a generic PatternFly component.
0 commit comments