propTypes.jsRather than defining PropTypes inline within each component's .propTypes declaration, the ProjectForge webapp extracts shared shapes into this utility module. Components import specific validators (e.g., buttonPropType) and use them directly. This is a form of the "shared type vocabulary" pattern — it reduces drift where the same concept (say, a button) gets slightly different PropTypes in different components.
menuItemPropType — minimal shape with a title string. Used in navigation dropdown and sidebar menu components.
buttonPropType — comprehensive button shape covering Bootstrap-style variants (primary through link), optional id, click handler, a CHECKBOX subtype, and checked state.
colorPropType — enumerated color strings matching Bootstrap 4 color names plus light.
selectProps — select input shape with required id and options array (supporting both {value, title} object arrays and flat string/number arrays), plus optional label and color.
tableColumnsPropType — array of column descriptors with id and title.
contentPropType — the foundational shape for the DynamicLayout system: each content block requires a type string (e.g., INPUT, TABLE, LABEL) and a key string (unique identifier within the layout).
An earlier version of this file defined a dynamicTypePropType enumerating the set of supported DynamicLayout types (CHECKBOX, COL, CUSTOMIZED, FIELDSET, INPUT, LABEL, ROW, SELECT, TABLE, TEXTAREA). This was later replaced with a plain PropTypes.string.isRequired — a deliberate relaxation that allows the server-side layout engine to introduce new content types without requiring a frontend PropTypes update, following an open-closed design principle.
| Commit | What changed |
|---|---|
09fadca1c | Added 'light' to the colorPropType enum. This was needed when calendar configuration started supporting a light color variant for event source styles, aligning with Bootstrap's color palette expansion. |
4b945f64d | Reverted 30eea8132: restored the contentPropType.key field to .isRequired. The revert suggests the optional key was causing layout lookups to fail silently — a required key forces consumer code to always provide identifiers. |
30eea8132 | Made contentPropType.key optional (removed .isRequired), presumably to support inline content blocks that don't need persistence identifiers. This was later reverted. |
3763871f8 | Removed the dynamicTypePropType enum and replaced contentPropType.type with a plain PropTypes.string.isRequired. This opened the DynamicLayout system to arbitrary server-driven content types without frontend code changes. |
ae35f5cc0 | Added TABLE to the dynamicTypePropType enum when the list view was migrated to use the DynamicLayout table rendering system instead of a hardcoded table component. |
a8102b34e | Added SELECT to the dynamicTypePropType enum and introduced the contentPropType shape. This was the foundational commit that established the PropTypes module as a shared vocabulary for the DynamicLayout system. |