From 5b996a799472442ad120408bdd6f9ec543aa51dc Mon Sep 17 00:00:00 2001 From: Jon Date: Mon, 19 Oct 2026 10:33:57 +0930 Subject: [PATCH 1/7] feat(Component): only render fields that are in both apiMetadata and apiData ref: #280 #279 --- src/components/DisplayFields.tsx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/components/DisplayFields.tsx b/src/components/DisplayFields.tsx index 563d5f11..5890a7b3 100644 --- a/src/components/DisplayFields.tsx +++ b/src/components/DisplayFields.tsx @@ -141,6 +141,10 @@ export const Fields = ({ return fields.map((field) => { + if( ! Object(objectData).hasOwnProperty(field) && ! isCreate ) { + return; + } + if( String(objectMetadata.fields[field]?.type).toLowerCase() == 'markdown' && field !== 'model_notes' From 522d6d8585fb9682763addbd8369b2bcdff27093 Mon Sep 17 00:00:00 2001 From: Jon Date: Thu, 5 Nov 2026 13:35:09 +0930 Subject: [PATCH 2/7] fix(action): Ensure that JSON fields are correctly formatted prior to submitting ref: #280 --- src/components/DisplayFields.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/src/components/DisplayFields.tsx b/src/components/DisplayFields.tsx index 5890a7b3..b44c39c8 100644 --- a/src/components/DisplayFields.tsx +++ b/src/components/DisplayFields.tsx @@ -773,6 +773,7 @@ export async function APISubmitAction({ break; + case 'json': case 'relationship': value = JSON.parse(fieldValue); From 43a519b444c13f910ceb2d5fd09e2d5e862e4bad Mon Sep 17 00:00:00 2001 From: Jon Date: Thu, 5 Nov 2026 13:39:18 +0930 Subject: [PATCH 3/7] feat(action): Pass error state to fields ref: #280 --- src/components/DisplayFields.tsx | 43 ++++++++++---------- src/components/page/detail/DetailSection.jsx | 2 + src/layouts/Detail.tsx | 1 + 3 files changed, 25 insertions(+), 21 deletions(-) diff --git a/src/components/DisplayFields.tsx b/src/components/DisplayFields.tsx index b44c39c8..4c2875b8 100644 --- a/src/components/DisplayFields.tsx +++ b/src/components/DisplayFields.tsx @@ -363,6 +363,7 @@ export type DisplayFieldsProps = { * @since 0.9.0 */ const DisplayFields = ({ + errorState = undefined, existingFormData = null, FormComponent = Form, isCreate = false, @@ -371,7 +372,7 @@ const DisplayFields = ({ onClose = null, }: DisplayFieldsProps): React.JSX.Element => { - const actionData = useActionData(); + // const actionData = useActionData(); const [ data, setformData ] = useState(existingFormData); @@ -404,33 +405,33 @@ const DisplayFields = ({ }, [existingFormData]); - useEffect(() => { + // useEffect(() => { - if(actionData?.body && actionData?.ok) { + // if(actionData?.body && actionData?.ok) { - setformData(actionData?.body); + // setformData(actionData?.body); - if( isCreate && isLoading ) { + // if( isCreate && isLoading ) { - delete actionData.body; - delete actionData.errors; - delete actionData.ok; + // delete actionData.body; + // delete actionData.errors; + // delete actionData.ok; - if( onClose ) { - onClose(true) - } + // if( onClose ) { + // onClose(true) + // } - } + // } - } - }, [actionData]) + // } + // }, [actionData]) useEffect(() => { setIsEdit(() => { if( - actionData?.errors + errorState || String(location.pathname).endsWith('/add') || @@ -442,7 +443,7 @@ const DisplayFields = ({ return false; }) - }, [actionData, location.pathname]) + }, [errorState, location.pathname]) let cardData; @@ -467,7 +468,7 @@ const DisplayFields = ({ isMobile={isMobile} > - {actionData?.errors && + {errorState && - {Object.entries(actionData.errors).map(([fieldKey, fieldErrors]) => { + {Object.entries(errorState.errors).map(([fieldKey, fieldErrors]) => { return ({pageMetadata.fields[fieldKey].label}); diff --git a/src/components/page/detail/DetailSection.jsx b/src/components/page/detail/DetailSection.jsx index bc7c1f39..20d4f454 100644 --- a/src/components/page/detail/DetailSection.jsx +++ b/src/components/page/detail/DetailSection.jsx @@ -38,6 +38,7 @@ import URLSanitize from "../../../functions/URLSanitize"; * @returns Card Component ready to be placed. */ const DetailSection = ({ + errorState = undefined, FormComponent = Form, layout, data, @@ -70,6 +71,7 @@ const DetailSection = ({ cardData = ( { Date: Thu, 5 Nov 2026 13:39:44 +0930 Subject: [PATCH 4/7] feat(action): Sanitize url for action dialog ref: #280 --- src/components/ActionDialog.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/components/ActionDialog.tsx b/src/components/ActionDialog.tsx index b748011d..cb1e1325 100644 --- a/src/components/ActionDialog.tsx +++ b/src/components/ActionDialog.tsx @@ -3,6 +3,7 @@ import { Button, ButtonVariant, Spinner } from "@patternfly/react-core"; import React, { useState } from "react"; import { apiFetch } from "../hooks/apiFetch"; import { apiObject } from "../types/backend/apiObject/object"; +import URLSanitize from "../functions/URLSanitize"; const sleep = ms => new Promise(r => setTimeout(r, ms)) @@ -22,7 +23,7 @@ const ActionDeleteRow = async ( ): Promise => { const action = await apiFetch( - deleteURL, + URLSanitize(deleteURL), null, "DELETE", null, From aaed2bb76c0a12efaccc34abbac499c707bf5728 Mon Sep 17 00:00:00 2001 From: Jon Date: Thu, 5 Nov 2026 13:40:11 +0930 Subject: [PATCH 5/7] feat(component): Collapse threads if thread is closed ref: #280 --- src/components/Comment.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/Comment.tsx b/src/components/Comment.tsx index 5d0848e2..9876d786 100644 --- a/src/components/Comment.tsx +++ b/src/components/Comment.tsx @@ -874,7 +874,7 @@ export const Comment = ({ { (comment_page_data?._urls?.threads || start_thread ) && Date: Thu, 5 Nov 2026 13:41:49 +0930 Subject: [PATCH 6/7] refactor(component): Display DescriptionList text as large ref: #280 --- src/components/DisplayFields.tsx | 1 + src/components/DisplayTable.jsx | 4 ---- src/components/form/DualFieldSelector.jsx | 4 +++- src/layouts/Detail.tsx | 2 +- src/layouts/Ticket.tsx | 1 + 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/components/DisplayFields.tsx b/src/components/DisplayFields.tsx index 4c2875b8..2b9e0d45 100644 --- a/src/components/DisplayFields.tsx +++ b/src/components/DisplayFields.tsx @@ -298,6 +298,7 @@ const Column = ({isEdit, isMobile, children}) => { default: '1Col' }} aria-label="Model fields" + displaySize = "lg" isCompact = {true} isFillColumns = {true} > diff --git a/src/components/DisplayTable.jsx b/src/components/DisplayTable.jsx index 382bfc5e..739f0cc3 100644 --- a/src/components/DisplayTable.jsx +++ b/src/components/DisplayTable.jsx @@ -439,9 +439,6 @@ const DisplayTable = ({ {collapsable_fields.length > 0 && } {tableHeaderColumns} - { table_columns_count > 0 && -   - } @@ -565,7 +562,6 @@ const DisplayTable = ({ } } })} - {collapsable_fields.length > 0 && diff --git a/src/components/form/DualFieldSelector.jsx b/src/components/form/DualFieldSelector.jsx index d1bbba81..9b0da714 100644 --- a/src/components/form/DualFieldSelector.jsx +++ b/src/components/form/DualFieldSelector.jsx @@ -96,7 +96,9 @@ const DualFieldSelector = ({ pageData[name]?.map((permission) => { - data[permission.id]["selected"] = true + if( ! data?.[permission.id] ) console.error(`permission "${permission.display_name}" id "${permission.id} does not exist in data."`) + + if( data?.[permission.id] ) data[permission.id]["selected"] = true }); } diff --git a/src/layouts/Detail.tsx b/src/layouts/Detail.tsx index 7e75cee8..79560a29 100644 --- a/src/layouts/Detail.tsx +++ b/src/layouts/Detail.tsx @@ -224,7 +224,7 @@ const DetailLayout = (): React.JSX.Element => { { > Date: Thu, 19 Nov 2026 12:34:12 +0930 Subject: [PATCH 7/7] refactor(component): Display DisplayTable text as large ref: #280 --- src/components/DisplayTable.jsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/components/DisplayTable.jsx b/src/components/DisplayTable.jsx index 739f0cc3..2c5aa0a8 100644 --- a/src/components/DisplayTable.jsx +++ b/src/components/DisplayTable.jsx @@ -10,6 +10,7 @@ import { import { Button, + Content, Pagination, PaginationVariant, Toolbar, @@ -533,13 +534,14 @@ const DisplayTable = ({ + > + ); } @@ -550,12 +552,14 @@ const DisplayTable = ({ return ( + + ); }