From 87cabf3886034d76be156d1789fa1e620ef1ca05 Mon Sep 17 00:00:00 2001 From: Steven RYDELL Date: Thu, 30 Jul 2026 13:06:33 +0200 Subject: [PATCH] Align x:Application list layout with Domains: Description first, Enabled second --- src/components/lists/DynamicList.tsx | 41 ++++++++++++++-------------- src/i18n/en.json | 3 +- 2 files changed, 21 insertions(+), 23 deletions(-) diff --git a/src/components/lists/DynamicList.tsx b/src/components/lists/DynamicList.tsx index eb8e70f..36dc72f 100644 --- a/src/components/lists/DynamicList.tsx +++ b/src/components/lists/DynamicList.tsx @@ -361,10 +361,26 @@ export function DynamicList({ viewName }: DynamicListProps) { return { obj, schema: schem, list }; }, [schema, viewName]); + const objectName = resolved?.obj.objectName; + const isWebApplications = objectName === 'x:Application'; + const displayColumns = useMemo(() => { const columns = resolved?.list?.columns ?? []; - return columns; - }, [resolved?.list?.columns]); + if (!isWebApplications) return columns; + + // For Web Applications, present Description first and Enabled second + // to match the layout of other tables such as Domains. + const ordered = ['description', 'enabled']; + const rest = columns.filter((c) => !ordered.includes(c.name)); + const descriptionCol = columns.find((c) => c.name === 'description'); + const enabledCol = columns.find((c) => c.name === 'enabled'); + + const result = []; + if (descriptionCol) result.push(descriptionCol); + if (enabledCol) result.push(enabledCol); + result.push(...rest); + return result; + }, [resolved?.list?.columns, isWebApplications]); const [items, setItems] = useState[]>([]); const [total, setTotal] = useState(null); @@ -392,9 +408,6 @@ export function DynamicList({ viewName }: DynamicListProps) { const [confirmAction, setConfirmAction] = useState(null); const [activeWebApp, setActiveWebApp] = useState | null>(null); - const objectName = resolved?.obj.objectName; - const isWebApplications = objectName === 'x:Application'; - useEffect(() => { if (!isWebApplications || !schema) return; let cancelled = false; @@ -1291,11 +1304,6 @@ export function DynamicList({ viewName }: DynamicListProps) { /> )} - {isWebApplications && ( - - {t('list.active', 'Active')} - - )} {displayColumns.map((col) => (
@@ -1315,7 +1323,7 @@ export function DynamicList({ viewName }: DynamicListProps) { {loading && items.length === 0 ? ( @@ -1324,7 +1332,7 @@ export function DynamicList({ viewName }: DynamicListProps) { ) : items.length === 0 ? ( {t('list.noResults', 'No results found')} @@ -1348,15 +1356,6 @@ export function DynamicList({ viewName }: DynamicListProps) { /> )} - {isWebApplications && ( - - {activeWebApp?.id === item.id ? ( - {t('list.active', 'Active')} - ) : ( - - - )} - - )} {displayColumns.map((col) => ( {renderCellValue( diff --git a/src/i18n/en.json b/src/i18n/en.json index e612a0d..8cdb3ff 100644 --- a/src/i18n/en.json +++ b/src/i18n/en.json @@ -309,8 +309,7 @@ "showing": "Showing {{from}}-{{to}} of {{total}} {{name}}", "showingItems": "Showing {{count}} items", "sort": "Sort", - "unknownError": "Unknown error", - "active": "Active" + "unknownError": "Unknown error" }, "login": { "continue": "Continue",