Skip to content

Commit

Permalink
Create basic structure for adding multiple templates
Browse files Browse the repository at this point in the history
  • Loading branch information
Etschbeijer committed Dec 9, 2024
1 parent e4d42d8 commit b74953d
Show file tree
Hide file tree
Showing 6 changed files with 184 additions and 140 deletions.
73 changes: 36 additions & 37 deletions src/Client/Messages.fs
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,7 @@ open Fable.Remoting.Client
open Fable.SimpleJson
open Database

open OfficeInterop
open Model
open Routing
open ARCtrl
open Fable.Core

Expand All @@ -25,13 +23,13 @@ type System.Exception with
| ex ->
ex.Message

let curry f a b = f (a,b)
let curry f a b = f (a, b)

module TermSearch =

type Msg =
| UpdateSelectedTerm of OntologyAnnotation option
| UpdateParentTerm of OntologyAnnotation option
| UpdateSelectedTerm of OntologyAnnotation option
| UpdateParentTerm of OntologyAnnotation option


module AdvancedSearch =
Expand All @@ -53,39 +51,40 @@ type DevMsg =

module PersistentStorage =
type Msg =
| NewSearchableOntologies of Ontology []
| UpdateAppVersion of string
| UpdateShowSidebar of bool
| NewSearchableOntologies of Ontology []
| UpdateAppVersion of string
| UpdateShowSidebar of bool

module FilePicker =
type Msg =
| LoadNewFiles of string list
| UpdateFileNames of newFileNames:(int*string) list
| LoadNewFiles of string list
| UpdateFileNames of newFileNames:(int*string) list

module BuildingBlock =

open TermSearch

type Msg =
| UpdateHeaderWithIO of CompositeHeaderDiscriminate * IOType
| UpdateHeaderCellType of CompositeHeaderDiscriminate
| UpdateHeaderArg of U2<OntologyAnnotation,IOType> option
| UpdateBodyCellType of CompositeCellDiscriminate
| UpdateBodyArg of U2<string, OntologyAnnotation> option
| UpdateHeaderWithIO of CompositeHeaderDiscriminate * IOType
| UpdateHeaderCellType of CompositeHeaderDiscriminate
| UpdateHeaderArg of U2<OntologyAnnotation,IOType> option
| UpdateBodyCellType of CompositeCellDiscriminate
| UpdateBodyArg of U2<string, OntologyAnnotation> option

module Protocol =

type Msg =
// Client
| UpdateTemplates of Template []
| UpdateLoading of bool
| UpdateTemplates of Template []
| UpdateLoading of bool
| RemoveSelectedProtocol
// // ------ Protocol from Database ------
| GetAllProtocolsForceRequest
| GetAllProtocolsRequest
| GetAllProtocolsResponse of string
| SelectProtocol of Template
| ProtocolIncreaseTimesUsed of protocolName:string
| GetAllProtocolsResponse of string
| SelectProtocol of Template
| AddProtocol of Template
| ProtocolIncreaseTimesUsed of protocolName:string

type SettingsDataStewardMsg =
// Client
Expand All @@ -95,26 +94,26 @@ type TopLevelMsg =
| CloseSuggestions

type Msg =
| UpdateModel of Model
| DevMsg of DevMsg
| OntologyMsg of Ontologies.Msg
| TermSearchMsg of TermSearch.Msg
| AdvancedSearchMsg of AdvancedSearch.Msg
| OfficeInteropMsg of OfficeInterop.Msg
| PersistentStorageMsg of PersistentStorage.Msg
| FilePickerMsg of FilePicker.Msg
| BuildingBlockMsg of BuildingBlock.Msg
| ProtocolMsg of Protocol.Msg
| UpdateModel of Model
| DevMsg of DevMsg
| OntologyMsg of Ontologies.Msg
| TermSearchMsg of TermSearch.Msg
| AdvancedSearchMsg of AdvancedSearch.Msg
| OfficeInteropMsg of OfficeInterop.Msg
| PersistentStorageMsg of PersistentStorage.Msg
| FilePickerMsg of FilePicker.Msg
| BuildingBlockMsg of BuildingBlock.Msg
| ProtocolMsg of Protocol.Msg
// | CytoscapeMsg of Cytoscape.Msg
| DataAnnotatorMsg of DataAnnotator.Msg
| SpreadsheetMsg of Spreadsheet.Msg
| DataAnnotatorMsg of DataAnnotator.Msg
| SpreadsheetMsg of Spreadsheet.Msg
/// This is used to forward Msg to SpreadsheetMsg/OfficeInterop
| InterfaceMsg of SpreadsheetInterface.Msg
| Batch of seq<Messages.Msg>
| Run of (unit -> unit)
| UpdateHistory of LocalHistory.Model
| InterfaceMsg of SpreadsheetInterface.Msg
| Batch of seq<Messages.Msg>
| Run of (unit -> unit)
| UpdateHistory of LocalHistory.Model
/// Top level msg to test specific api interactions, only for dev.
| TestMyAPI
| TestMyPostAPI
| UpdateModal of Model.ModalState.ModalTypes option
| UpdateModal of Model.ModalState.ModalTypes option
| DoNothing
22 changes: 0 additions & 22 deletions src/Client/Modals/ModalElements.fs
Original file line number Diff line number Diff line change
Expand Up @@ -73,28 +73,6 @@ type ModalElements =
]
]

static member BoxWithChildren(children: ReactElement list, ?title: string, ?icon: string, ?className: string list) =
Html.div [
prop.className [
"rounded shadow p-2 flex flex-col gap-2 border"
if className.IsSome then
className.Value |> String.concat " "
]
prop.children [
Html.h3 [
prop.className "font-semibold gap-2 flex flex-row items-center"
if icon.IsSome || title.IsSome then
prop.children [
if icon.IsSome then
Html.i [prop.className icon.Value]
if title.IsSome then
Html.span title.Value
]
prop.children children
]
]
]

static member SelectorButton<'a when 'a : equality> (targetselector: 'a, selector: 'a, setSelector: 'a -> unit, ?isDisabled) =
Daisy.button.button [
join.item
Expand Down
Loading

0 comments on commit b74953d

Please sign in to comment.