Skip to content

Commit

Permalink
finish update to ARCtrl v2 #427
Browse files Browse the repository at this point in the history
  • Loading branch information
Freymaurer committed Jun 18, 2024
1 parent 665cedd commit dcf570a
Show file tree
Hide file tree
Showing 10 changed files with 45 additions and 39 deletions.
2 changes: 1 addition & 1 deletion paket.dependencies
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ source https://api.nuget.org/v3/index.json
framework: net8.0
storage: none

nuget ARCtrl 2.0.0-alpha.6.swate alpha
nuget ARCtrl 2.0.0-alpha.7.swate alpha
nuget Fable.Fetch 2.7.0
nuget Feliz.Bulma.Checkradio
nuget Feliz.Bulma.Switch
Expand Down
41 changes: 21 additions & 20 deletions paket.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2,38 +2,39 @@ STORAGE: NONE
RESTRICTION: == net8.0
NUGET
remote: https://api.nuget.org/v3/index.json
ARCtrl (2.0.0-alpha.6.swate)
ARCtrl.Contract (>= 2.0.0-alpha.6.swate)
ARCtrl.CWL (>= 2.0.0-alpha.6.swate)
ARCtrl.FileSystem (>= 2.0.0-alpha.6.swate)
ARCtrl.Json (>= 2.0.0-alpha.6.swate)
ARCtrl.Spreadsheet (>= 2.0.0-alpha.6.swate)
ARCtrl (2.0.0-alpha.7.swate)
ARCtrl.Contract (>= 2.0.0-alpha.7.swate)
ARCtrl.CWL (>= 2.0.0-alpha.7.swate)
ARCtrl.FileSystem (>= 2.0.0-alpha.7.swate)
ARCtrl.Json (>= 2.0.0-alpha.7.swate)
ARCtrl.Spreadsheet (>= 2.0.0-alpha.7.swate)
Fable.Fetch (>= 2.6)
Fable.SimpleHttp (>= 3.5)
FSharp.Core (>= 7.0.401)
ARCtrl.Contract (2.0.0-alpha.6.swate)
ARCtrl.Core (>= 2.0.0-alpha.6.swate)
ARCtrl.Json (>= 2.0.0-alpha.6.swate)
ARCtrl.Spreadsheet (>= 2.0.0-alpha.6.swate)
ARCtrl.Contract (2.0.0-alpha.7.swate)
ARCtrl.Core (>= 2.0.0-alpha.7.swate)
ARCtrl.Json (>= 2.0.0-alpha.7.swate)
ARCtrl.Spreadsheet (>= 2.0.0-alpha.7.swate)
FSharp.Core (>= 7.0.401)
ARCtrl.Core (2.0.0-alpha.6.swate)
ARCtrl.CWL (>= 2.0.0-alpha.6.swate)
ARCtrl.FileSystem (>= 2.0.0-alpha.6.swate)
ARCtrl.Core (2.0.0-alpha.7.swate)
ARCtrl.CWL (>= 2.0.0-alpha.7.swate)
ARCtrl.FileSystem (>= 2.0.0-alpha.7.swate)
FSharp.Core (>= 7.0.401)
ARCtrl.CWL (2.0.0-alpha.6.swate)
ARCtrl.CWL (2.0.0-alpha.7.swate)
FSharp.Core (>= 6.0.7)
ARCtrl.FileSystem (2.0.0-alpha.6.swate)
ARCtrl.FileSystem (2.0.0-alpha.7.swate)
Fable.Core (>= 4.2)
FSharp.Core (>= 6.0.7)
ARCtrl.Json (2.0.0-alpha.6.swate)
ARCtrl.Core (>= 2.0.0-alpha.6.swate)
ARCtrl.Json (2.0.0-alpha.7.swate)
ARCtrl.Core (>= 2.0.0-alpha.7.swate)
FSharp.Core (>= 7.0.401)
NJsonSchema (>= 10.8)
Thoth.Json.Core (>= 0.2.1)
Thoth.Json.JavaScript (>= 0.1)
Thoth.Json.Newtonsoft (>= 0.1)
ARCtrl.Spreadsheet (2.0.0-alpha.6.swate)
ARCtrl.Core (>= 2.0.0-alpha.6.swate)
ARCtrl.FileSystem (>= 2.0.0-alpha.6.swate)
ARCtrl.Spreadsheet (2.0.0-alpha.7.swate)
ARCtrl.Core (>= 2.0.0-alpha.7.swate)
ARCtrl.FileSystem (>= 2.0.0-alpha.7.swate)
FSharp.Core (>= 7.0.401)
FsSpreadsheet (>= 6.1.2)
ExcelJS.Fable (0.3)
Expand Down
12 changes: 6 additions & 6 deletions src/Client/MainComponents/Metadata/Assay.fs
Original file line number Diff line number Diff line change
Expand Up @@ -18,25 +18,25 @@ let Main(assay: ArcAssay, model: Messages.Model, dispatch: Msg -> unit) =
fullwidth=true
)
FormComponents.OntologyAnnotationInput(
assay.MeasurementType |> Option.defaultValue OntologyAnnotation.empty,
assay.MeasurementType |> Option.defaultValue (OntologyAnnotation.empty()),
(fun oa ->
let oa = if oa = OntologyAnnotation.empty then None else Some oa
let oa = if oa = (OntologyAnnotation.empty()) then None else Some oa
assay.MeasurementType <- oa
assay |> Assay |> Spreadsheet.UpdateArcFile |> SpreadsheetMsg |> dispatch),
"Measurement Type"
)
FormComponents.OntologyAnnotationInput(
assay.TechnologyType |> Option.defaultValue OntologyAnnotation.empty,
assay.TechnologyType |> Option.defaultValue (OntologyAnnotation.empty()),
(fun oa ->
let oa = if oa = OntologyAnnotation.empty then None else Some oa
let oa = if oa = (OntologyAnnotation.empty()) then None else Some oa
assay.TechnologyType <- oa
assay |> Assay |> Spreadsheet.UpdateArcFile |> SpreadsheetMsg |> dispatch),
"Technology Type"
)
FormComponents.OntologyAnnotationInput(
assay.TechnologyPlatform |> Option.defaultValue OntologyAnnotation.empty,
assay.TechnologyPlatform |> Option.defaultValue (OntologyAnnotation.empty()),
(fun oa ->
let oa = if oa = OntologyAnnotation.empty then None else Some oa
let oa = if oa = (OntologyAnnotation.empty()) then None else Some oa
assay.TechnologyPlatform <- oa
assay |> Assay |> Spreadsheet.UpdateArcFile |> SpreadsheetMsg |> dispatch),
"Technology Platform"
Expand Down
6 changes: 3 additions & 3 deletions src/Client/MainComponents/Metadata/Forms.fs
Original file line number Diff line number Diff line change
Expand Up @@ -778,7 +778,7 @@ type FormComponents =
[<ReactComponent>]
static member OntologyAnnotationsInput (oas: OntologyAnnotation [], label: string, setter: OntologyAnnotation [] -> unit, ?showTextLabels: bool) =
FormComponents.InputSequence(
oas, OntologyAnnotation.empty, label, setter,
oas, (OntologyAnnotation.empty()), label, setter,
(fun (a,b,c,d) -> FormComponents.OntologyAnnotationInput(a,c,label=b,removebutton=d,?showTextLabels=showTextLabels))
)

Expand Down Expand Up @@ -1036,9 +1036,9 @@ type FormComponents =
]
createPersonFieldTextInput(state.Authors, "Authors", fun s -> state.Authors <- s)
FormComponents.OntologyAnnotationInput(
Option.defaultValue OntologyAnnotation.empty state.Status,
Option.defaultValue (OntologyAnnotation.empty()) state.Status,
(fun s ->
state.Status <- if s = OntologyAnnotation.empty then None else Some s
state.Status <- if s = (OntologyAnnotation.empty()) then None else Some s
state |> setter
),
"Status"
Expand Down
2 changes: 1 addition & 1 deletion src/Client/Pages/BuildingBlock/Helper.fs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ let selectHeaderCellType (hct: BuildingBlock.HeaderCellType) setUiState dispatch
open Fable.Core

let createCompositeHeaderFromState (state: BuildingBlock.Model) =
let getOA() = state.TryHeaderOA() |> Option.defaultValue OntologyAnnotation.empty
let getOA() = state.TryHeaderOA() |> Option.defaultValue (OntologyAnnotation.empty())
let getIOType() = state.TryHeaderIO() |> Option.defaultValue (IOType.FreeText "")
match state.HeaderCellType with
| HeaderCellType.Component -> CompositeHeader.Component <| getOA()
Expand Down
2 changes: 1 addition & 1 deletion src/Client/SharedComponents/TermSearchInput.fs
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ type TermSearch =
let fullwidth = defaultArg fullwidth false
let loading, setLoading = React.useState(false)
let state, setState = React.useState(input)
let searchable, setSearchable = React.useState(not searchableToggle)
let searchable, setSearchable = React.useState(true)
let searchNameState, setSearchNameState = React.useState(SearchState.init)
let searchTreeState, setSearchTreeState = React.useState(SearchState.init)
let isSearching, setIsSearching = React.useState(false)
Expand Down
1 change: 1 addition & 0 deletions src/Client/Spreadsheet/Table.Controller.fs
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ let fillColumnWithCell (index: int*int) (state: Spreadsheet.Model) : Spreadsheet
let cell = cell|> Option.defaultValue (column.GetDefaultEmptyCell())
if i = columnIndex then
for cellRowIndex in 0 .. column.Cells.Length-1 do
let cell = cell
state.ActiveTable.UpdateCellAt(columnIndex, cellRowIndex, cell)
)
{state with ArcFile = state.ArcFile}
Expand Down
4 changes: 4 additions & 0 deletions src/Client/Update/SpreadsheetUpdate.fs
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,12 @@ module Spreadsheet =
let cmd = Cmd.none
state, model, cmd
| UpdateCell (index, cell) ->
log ("[UPDATECELL]", index, cell)
let nextState =
state.ActiveTable.UpdateCellAt(fst index,snd index, cell)
log "START"
log state.ActiveTable
log "END"
{state with ArcFile = state.ArcFile}
nextState, model, Cmd.none
| UpdateCells arr ->
Expand Down
4 changes: 2 additions & 2 deletions src/Server/Server.fs
Original file line number Diff line number Diff line change
Expand Up @@ -176,13 +176,13 @@ let templateApi credentials =
{
getTemplates = fun () -> async {
let! templates = ARCtrl.Template.Web.getTemplates (None)
let templatesJson = ARCtrl.Json.Templates.toJsonString 0 (Array.ofSeq templates.Values)
let templatesJson = ARCtrl.Json.Templates.toJsonString 0 (Array.ofSeq templates)
return templatesJson
}

getTemplateById = fun id -> async {
let! templates = ARCtrl.Template.Web.getTemplates (None)
let template = templates.Values |> Seq.find (fun t -> t.Id = System.Guid(id))
let template = templates |> Seq.find (fun t -> t.Id = System.Guid(id))
let templateJson = Template.toCompressedJsonString 0 template
return templateJson
}
Expand Down
10 changes: 5 additions & 5 deletions src/Shared/ARCtrl.Helper.fs
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ module Extensions =
open ArcTableAux

type OntologyAnnotation with
static member empty = OntologyAnnotation.create()
static member empty() = OntologyAnnotation.create()

type ArcTable with
member this.SetCellAt(columnIndex: int, rowIndex: int, cell: CompositeCell) =
Expand Down Expand Up @@ -109,10 +109,10 @@ module Extensions =
| CompositeHeader.Factor _ -> CompositeHeader.Factor oa
| _ -> failwithf "Cannot update OntologyAnnotation on CompositeHeader without OntologyAnnotation: '%A'" this

static member ParameterEmpty = CompositeHeader.Parameter OntologyAnnotation.empty
static member CharacteristicEmpty = CompositeHeader.Characteristic OntologyAnnotation.empty
static member ComponentEmpty = CompositeHeader.Component OntologyAnnotation.empty
static member FactorEmpty = CompositeHeader.Factor OntologyAnnotation.empty
static member ParameterEmpty = CompositeHeader.Parameter <| OntologyAnnotation.empty()
static member CharacteristicEmpty = CompositeHeader.Characteristic <| OntologyAnnotation.empty()
static member ComponentEmpty = CompositeHeader.Component <| OntologyAnnotation.empty()
static member FactorEmpty = CompositeHeader.Factor <| OntologyAnnotation.empty()
static member InputEmpty = CompositeHeader.Input <| IOType.FreeText ""
static member OutputEmpty = CompositeHeader.Output <| IOType.FreeText ""

Expand Down

0 comments on commit dcf570a

Please sign in to comment.