Skip to content

Commit

Permalink
Improve Form design #401
Browse files Browse the repository at this point in the history
  • Loading branch information
Freymaurer committed Jun 27, 2024
1 parent dbe34fd commit 088138b
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 18 deletions.
5 changes: 3 additions & 2 deletions src/Client/MainComponents/Metadata/Forms.fs
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand All @@ -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
Expand Down
16 changes: 8 additions & 8 deletions src/Client/MainComponents/Metadata/Investigation.fs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module MainComponents.Metadata.Investigation
module MainComponents.Metadata.Investigation

open Feliz
open Feliz.Bulma
Expand Down Expand Up @@ -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",
Expand Down
16 changes: 8 additions & 8 deletions src/Client/MainComponents/Metadata/Study.fs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module MainComponents.Metadata.Study
module MainComponents.Metadata.Study

open Feliz
open Feliz.Bulma
Expand Down Expand Up @@ -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",
Expand Down

0 comments on commit 088138b

Please sign in to comment.