Skip to content

Commit

Permalink
Add easy to access navigation option to advanced search (Issue #91).
Browse files Browse the repository at this point in the history
  • Loading branch information
Freymaurer committed Jan 27, 2021
1 parent 374e326 commit 4e0d0c9
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 4 deletions.
5 changes: 4 additions & 1 deletion src/Client/CustomComponents/AdvancedSearch.fs
Original file line number Diff line number Diff line change
Expand Up @@ -115,13 +115,16 @@ let advancedTermSearchComponent (model:Model) (dispatch: Msg -> unit) =
]
]
Dropdown.menu [Props[colorControl model.SiteStyleState.ColorMode];] [
Dropdown.content [] [
Dropdown.content [
Props [Style [MaxHeight "180px"; OverflowY OverflowOptions.Scroll; MarginRight "-100px"; PaddingRight "100px"; Border "1px solid darkgrey"]]
] [
// all ontologies found in database
yield createOntologyDropdownItem model dispatch None
yield! (
model.PersistentStorageState.SearchableOntologies
|> Array.map snd
|> Array.toList
|> List.sortBy (fun o -> o.Name)
|> List.map (fun ont -> createOntologyDropdownItem model dispatch (Some ont))
)
]
Expand Down
12 changes: 10 additions & 2 deletions src/Client/Views/AddBuildingBlockView.fs
Original file line number Diff line number Diff line change
Expand Up @@ -89,10 +89,10 @@ let addBuildingBlockComponent (model:Model) (dispatch:Msg -> unit) =
OnKeyDown (fun k -> if k.key = "Enter" then k.preventDefault())
] [
Label.label [Label.Size Size.IsLarge; Label.Props [Style [Color model.SiteStyleState.ColorMode.Accent]]][ str "Annotation building block selection"]
br []

Field.div [] [
Label.label [Label.Props [Style [Color model.SiteStyleState.ColorMode.Accent]]] [ str "Building block"]
Help.help [] [str "Select the type of annotation building block (column) to add to the annotation table"]
Label.label [Label.Size Size.IsSmall; Label.Props [Style [Color model.SiteStyleState.ColorMode.Accent]]] [str "Select the type of annotation building block (column) to add to the annotation table."]
Field.div [Field.HasAddons] [
Control.div [] [
Dropdown.dropdown [Dropdown.IsActive model.AddBuildingBlockState.ShowBuildingBlockSelection] [
Expand Down Expand Up @@ -155,9 +155,17 @@ let addBuildingBlockComponent (model:Model) (dispatch:Msg -> unit) =
// if BuildingBlockHasUnit = false then disabled = true
(model.AddBuildingBlockState.BuildingBlockHasUnit |> not)
]

a [OnClick (fun _ -> ToggleModal (AutocompleteSearch.AutocompleteParameters<DbDomain.Term>.ofAddBuildingBlockState model.AddBuildingBlockState).ModalId |> AdvancedSearch |> dispatch)] [
str "Use Advanced Search"
]

| _ -> ()


]


// Fill selection confirmation
Field.div [] [
Control.div [] [
Expand Down
5 changes: 4 additions & 1 deletion src/Client/Views/TermSearchView.fs
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ let simpleSearchComponent (model:Model) (dispatch: Msg -> unit) =
Label.label [Label.Size Size.IsLarge; Label.Props [Style [Color model.SiteStyleState.ColorMode.Accent]]][ str "Ontology term search"]
br []

Label.label [Label.Size Size.IsSmall; Label.Props [Style [Color model.SiteStyleState.ColorMode.Accent]]] [str "Search for an ontology term to fill into the selected field(s)"]
AutocompleteSearch.autocompleteTermSearchComponentOfParentOntology
dispatch
model.SiteStyleState.ColorMode
Expand All @@ -69,6 +70,9 @@ let simpleSearchComponent (model:Model) (dispatch: Msg -> unit) =
)
] [ str "Use related term directed search." ]
]
a [OnClick (fun _ -> ToggleModal (AutocompleteSearch.AutocompleteParameters<DbDomain.Term>.ofTermSearchState model.TermSearchState).ModalId |> AdvancedSearch |> dispatch)] [
str "Use Advanced Search"
]

//Control.div [] [

Expand All @@ -85,7 +89,6 @@ let simpleSearchComponent (model:Model) (dispatch: Msg -> unit) =
// model.TermSearchState.Simple.HasSuggestionsLoading
// (createTermSuggestions model dispatch)
//]
Help.help [] [str "When applicable, search for an ontology term to fill into the selected field(s)"]
]


Expand Down

0 comments on commit 4e0d0c9

Please sign in to comment.