Skip to content

Commit

Permalink
implement review requests
Browse files Browse the repository at this point in the history
  • Loading branch information
Etschbeijer committed Dec 20, 2024
1 parent 286e7dc commit 02780e2
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 23 deletions.
6 changes: 3 additions & 3 deletions src/Client/MainComponents/Widgets.fs
Original file line number Diff line number Diff line change
Expand Up @@ -231,10 +231,10 @@ type Widget =

let content =
let switchContent =
if model.ProtocolState.TemplatesSelected.Length > 0 && not model.ProtocolState.IsProtocolSearch then
insertContent ()
else
if model.ProtocolState.IsProtocolSearch then
selectContent ()
else
insertContent ()
Html.div [
prop.className "flex flex-col gap-4 @container/templateWidget"
prop.children switchContent
Expand Down
1 change: 0 additions & 1 deletion src/Client/Pages/ProtocolTemplates/ProtocolState.fs
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@ module Protocol =
let nextState = {
state with
TemplatesSelected = templates
IsProtocolSearch = true
}
nextState, Cmd.none
| ProtocolIncreaseTimesUsed templateId ->
Expand Down
9 changes: 6 additions & 3 deletions src/Client/Pages/ProtocolTemplates/ProtocolView.fs
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,12 @@ type Templates =
// Box 1
SidebarComponents.SidebarLayout.Description "Add template from database."

SidebarComponents.SidebarLayout.LogicContainer [
Modals.SelectiveTemplateFromDB.Main(model, dispatch)
]
if model.ProtocolState.IsProtocolSearch then
Protocol.SearchContainer.Main model dispatch
else
SidebarComponents.SidebarLayout.LogicContainer [
Modals.SelectiveTemplateFromDB.Main(model, dispatch)
]

// Box 2
SidebarComponents.SidebarLayout.Description (Html.p [
Expand Down
29 changes: 13 additions & 16 deletions src/Client/Views/SidebarView.fs
Original file line number Diff line number Diff line change
Expand Up @@ -14,27 +14,24 @@ type SidebarView =
Html.div [
prop.className "grow overflow-y-auto"
prop.children [
if model.ProtocolState.IsProtocolSearch then
Protocol.SearchContainer.Main model dispatch
else
match model.PageState with
| {SidebarPage = Routing.SidebarPage.BuildingBlock } ->
BuildingBlock.Core.addBuildingBlockComponent model dispatch
match model.PageState with
| {SidebarPage = Routing.SidebarPage.BuildingBlock } ->
BuildingBlock.Core.addBuildingBlockComponent model dispatch

| {SidebarPage = Routing.SidebarPage.TermSearch } ->
TermSearch.Main (model, dispatch)
| {SidebarPage = Routing.SidebarPage.TermSearch } ->
TermSearch.Main (model, dispatch)

| {SidebarPage = Routing.SidebarPage.FilePicker } ->
FilePicker.filePickerComponent model dispatch
| {SidebarPage = Routing.SidebarPage.FilePicker } ->
FilePicker.filePickerComponent model dispatch

| {SidebarPage = Routing.SidebarPage.Protocol } ->
Protocol.Templates.Main (model, dispatch)
| {SidebarPage = Routing.SidebarPage.Protocol } ->
Protocol.Templates.Main (model, dispatch)

| {SidebarPage = Routing.SidebarPage.DataAnnotator } ->
Pages.DataAnnotator.Main(model, dispatch)
| {SidebarPage = Routing.SidebarPage.DataAnnotator } ->
Pages.DataAnnotator.Main(model, dispatch)

| {SidebarPage = Routing.SidebarPage.JsonExport } ->
JsonExporter.Core.FileExporter.Main(model, dispatch)
| {SidebarPage = Routing.SidebarPage.JsonExport } ->
JsonExporter.Core.FileExporter.Main(model, dispatch)
]
]

Expand Down

0 comments on commit 02780e2

Please sign in to comment.