Skip to content

Commit

Permalink
Merge pull request #573 from nfdi4plants/kevinf_patch_issues_20241118
Browse files Browse the repository at this point in the history
Patching multiple smaller issues!
  • Loading branch information
Freymaurer authored Nov 19, 2024
2 parents b9d8783 + ffc2baa commit f824e11
Show file tree
Hide file tree
Showing 25 changed files with 423 additions and 637 deletions.
8 changes: 5 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/Client/Client.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@
<ProjectReference Include="..\Shared\Shared.fsproj" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="ARCtrl.Javascript" Version="2.2.0" />
<PackageReference Include="ARCtrl.Javascript" Version="2.2.4" />
<PackageReference Include="Fable.Core" Version="4.3.0" />
<PackageReference Include="Fable.Elmish" Version="4.2.0" />
<PackageReference Include="Fable.Elmish.HMR" Version="7.0.0" />
Expand Down
14 changes: 5 additions & 9 deletions src/Client/Init.fs
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,7 @@ open Model
open Messages
open Update

let initializeModel () =
let dt = LocalStorage.Darkmode.DataTheme.GET()
LocalStorage.Darkmode.DataTheme.SET dt
let initialModel =
{
PageState = PageState .init()
PersistentStorageState = PersistentStorageState .init()
Expand All @@ -21,14 +19,12 @@ let initializeModel () =
ProtocolState = Protocol.Model .init()
CytoscapeModel = Cytoscape.Model .init()
DataAnnotatorModel = DataAnnotator.Model .init()
SpreadsheetModel = Spreadsheet.Model .fromLocalStorage()
History = LocalHistory.Model .init().UpdateFromSessionStorage()
SpreadsheetModel = Spreadsheet.Model .init()
History = LocalHistory.Model .init()
}


// defines the initial state and initial command (= side-effect) of the application
let init (pageOpt: Routing.Route option) : Model * Cmd<Msg> =
let initialModel, pageCmd = initializeModel () |> urlUpdate pageOpt
let cmd = Cmd.ofMsg <| InterfaceMsg (SpreadsheetInterface.Initialize initialModel.PersistentStorageState.Host.Value)
let batch = Cmd.batch [|pageCmd; cmd|]
initialModel, batch
let model, cmd = urlUpdate pageOpt initialModel
model, cmd
2 changes: 1 addition & 1 deletion src/Client/MainComponents/Navbar.fs
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ let Main(model: Model, dispatch, widgets, setWidgets) =
]
Daisy.navbarCenter [
prop.children [
QuickAccessButtonListStart model.History dispatch
// QuickAccessButtonListStart model.History dispatch
WidgetNavbarList(model, dispatch, addWidget)
]
]
Expand Down
23 changes: 13 additions & 10 deletions src/Client/MainComponents/Widgets.fs
Original file line number Diff line number Diff line change
Expand Up @@ -245,18 +245,21 @@ type Widget =

static member FilePicker (model, dispatch, rmv) =
let content = Html.div [
FilePicker.uploadButton model dispatch
if model.FilePickerState.FileNames <> [] then
FilePicker.fileSortElements model dispatch
prop.className "@container/filePickerWidget min-w-32"
prop.children [
FilePicker.uploadButton model dispatch "@md/filePickerWidget:flex-row"
if model.FilePickerState.FileNames <> [] then
FilePicker.fileSortElements model dispatch

Html.div [
prop.style [style.maxHeight (length.px 350); style.overflow.auto]
prop.children [
FilePicker.FileNameTable.table model dispatch
Html.div [
prop.style [style.maxHeight (length.px 350); style.overflow.auto]
prop.children [
FilePicker.FileNameTable.table model dispatch
]
]
]
//fileNameElements model dispatch
FilePicker.insertButton model dispatch
//fileNameElements model dispatch
FilePicker.insertButton model dispatch
]
]
let prefix = WidgetLiterals.FilePicker
Widget.Base(content, prefix, rmv)
Expand Down
Loading

0 comments on commit f824e11

Please sign in to comment.