From 088138b72d8dfb2414b4354f3c889e482ab992a0 Mon Sep 17 00:00:00 2001 From: Kevin F Date: Thu, 27 Jun 2024 15:51:07 +0200 Subject: [PATCH] Improve Form design #401 --- src/Client/MainComponents/Metadata/Forms.fs | 5 +++-- .../MainComponents/Metadata/Investigation.fs | 16 ++++++++-------- src/Client/MainComponents/Metadata/Study.fs | 16 ++++++++-------- 3 files changed, 19 insertions(+), 18 deletions(-) diff --git a/src/Client/MainComponents/Metadata/Forms.fs b/src/Client/MainComponents/Metadata/Forms.fs index 82a909e7..10141165 100644 --- a/src/Client/MainComponents/Metadata/Forms.fs +++ b/src/Client/MainComponents/Metadata/Forms.fs @@ -709,7 +709,7 @@ type FormComponents = let element = React.useElementRef() React.useEffect((fun () -> setState input), dependencies=[|box input|]) Bulma.field.div [ - if label.IsSome then Bulma.label label.Value + //if label.IsSome then Bulma.label label.Value Bulma.field.div [ //prop.ref element prop.style [style.position.relative] @@ -721,7 +721,8 @@ type FormComponents = Bulma.field.div [ prop.style [style.flexGrow 1] prop.children [ - if showTextLabels then Bulma.label $"Term Name" + let label = defaultArg label "Term Name" + Bulma.label label let innersetter = fun (oaOpt: OntologyAnnotation option) -> if oaOpt.IsSome then diff --git a/src/Client/MainComponents/Metadata/Investigation.fs b/src/Client/MainComponents/Metadata/Investigation.fs index 4ae50a80..671c8265 100644 --- a/src/Client/MainComponents/Metadata/Investigation.fs +++ b/src/Client/MainComponents/Metadata/Investigation.fs @@ -1,4 +1,4 @@ -module MainComponents.Metadata.Investigation +module MainComponents.Metadata.Investigation open Feliz open Feliz.Bulma @@ -72,13 +72,13 @@ let Main(inv: ArcInvestigation, model: Messages.Model, dispatch: Msg -> unit) = inv.OntologySourceReferences <- ResizeArray oas inv |> Investigation |> Spreadsheet.UpdateArcFile |> SpreadsheetMsg |> dispatch) ) - FormComponents.TextInputs( - Array.ofSeq inv.RegisteredStudyIdentifiers, - "RegisteredStudyIdentifiers", - (fun i -> - inv.RegisteredStudyIdentifiers <- ResizeArray i - inv |> Investigation |> Spreadsheet.UpdateArcFile |> SpreadsheetMsg |> dispatch) - ) + //FormComponents.TextInputs( + // Array.ofSeq inv.RegisteredStudyIdentifiers, + // "RegisteredStudyIdentifiers", + // (fun i -> + // inv.RegisteredStudyIdentifiers <- ResizeArray i + // inv |> Investigation |> Spreadsheet.UpdateArcFile |> SpreadsheetMsg |> dispatch) + //) FormComponents.CommentsInput( Array.ofSeq inv.Comments, "Comments", diff --git a/src/Client/MainComponents/Metadata/Study.fs b/src/Client/MainComponents/Metadata/Study.fs index 9d3956bd..cec36820 100644 --- a/src/Client/MainComponents/Metadata/Study.fs +++ b/src/Client/MainComponents/Metadata/Study.fs @@ -1,4 +1,4 @@ -module MainComponents.Metadata.Study +module MainComponents.Metadata.Study open Feliz open Feliz.Bulma @@ -63,13 +63,13 @@ let Main(study: ArcStudy, assignedAssays: ArcAssay list, model: Messages.Model, study.StudyDesignDescriptors <- ResizeArray(oas) (study, assignedAssays) |> Study |> Spreadsheet.UpdateArcFile |> SpreadsheetMsg |> dispatch ) - FormComponents.TextInputs( - Array.ofSeq study.RegisteredAssayIdentifiers, - "Registered Assay Identifiers", - fun rais -> - study.RegisteredAssayIdentifiers <- ResizeArray(rais) - (study, assignedAssays) |> Study |> Spreadsheet.UpdateArcFile |> SpreadsheetMsg |> dispatch - ) + //FormComponents.TextInputs( + // Array.ofSeq study.RegisteredAssayIdentifiers, + // "Registered Assay Identifiers", + // fun rais -> + // study.RegisteredAssayIdentifiers <- ResizeArray(rais) + // (study, assignedAssays) |> Study |> Spreadsheet.UpdateArcFile |> SpreadsheetMsg |> dispatch + //) FormComponents.CommentsInput( Array.ofSeq study.Comments, "Comments",