Skip to content

Commit d1c32d0

Browse files
author
Bob Strahan
committed
Fix #134 - Doc class dropdown shows no options when editing sections
1 parent cde2e20 commit d1c32d0

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

src/ui/src/components/sections-panel/SectionsPanel.jsx

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -275,10 +275,17 @@ const SectionsPanel = ({ sections, pages, documentItem, mergedConfig, onSaveChan
275275
// Get available classes from configuration
276276
const getAvailableClasses = () => {
277277
if (!configuration?.classes) return [];
278-
return configuration.classes.map((cls) => ({
279-
label: cls.name,
280-
value: cls.name,
281-
}));
278+
return configuration.classes.map((cls) => {
279+
// Support both JSON Schema and legacy formats
280+
// JSON Schema: $id or x-aws-idp-document-type
281+
// Legacy: name
282+
const className = cls.$id || cls['x-aws-idp-document-type'] || cls.name;
283+
284+
return {
285+
label: className,
286+
value: className,
287+
};
288+
}).filter(option => option.value); // Remove any undefined entries
282289
};
283290

284291
// Generate next sequential section ID

0 commit comments

Comments
 (0)