Skip to content

Commit

Permalink
Implement review changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Etschbeijer committed Dec 3, 2024
1 parent 869ade6 commit ca0a1d4
Show file tree
Hide file tree
Showing 18 changed files with 35 additions and 28 deletions.
1 change: 1 addition & 0 deletions src/Client/Client.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
<Compile Include="OfficeInterop\InteropLogging.fs" />
<Compile Include="OfficeInterop\ExcelUtil.fs" />
<Compile Include="OfficeInterop\OfficeInterop.fs" />
<Compile Include="States\SelectedColumns.fs" />
<Compile Include="States\DataAnnotator.fs" />
<Compile Include="States\ARCitect.fs" />
<Compile Include="States\SpreadsheetInterface.fs" />
Expand Down
4 changes: 2 additions & 2 deletions src/Client/MainComponents/Widgets.fs
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ open Feliz
open Feliz.DaisyUI
open Browser.Types
open LocalStorage.Widgets
open Modals.Template
open Shared.DTOs.SelectedColumnsModalDto
open Modals
open SelectedColumns

module private InitExtensions =

Expand Down
2 changes: 1 addition & 1 deletion src/Client/Modals/ModalElements.fs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ open Feliz.DaisyUI
open Model
open Messages
open Shared
open Shared.DTOs.SelectedColumnsModalDto
open SelectedColumns

open ARCtrl
open JsonImport
Expand Down
4 changes: 2 additions & 2 deletions src/Client/Modals/ModalProvider.fs
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ type ModalProvider =
| TableModals.TermDetails term ->
Modals.TermModal.Main (term, dispatch)
| TableModals.SelectiveTemplateImportFromDB ->
Modals.Template.SelectiveTemplateFromDBModal.Main (model, dispatch)
Modals.SelectiveTemplateFromDBModal.Main (model, dispatch)
| TableModals.SelectiveFileImport arcfile ->
Modals.Import.SelectiveImportModal.Main (arcfile, dispatch)
Modals.SelectiveImportModal.Main (arcfile, dispatch)
| TableModals.BatchUpdateColumnValues (columnIndex, column) ->
Modals.UpdateColumn.Main (columnIndex, column, dispatch)
| TableModals.TableCellContext (mouseX, mouseY, ci, ri) ->
Expand Down
4 changes: 1 addition & 3 deletions src/Client/Modals/SelectiveImportModal.fs
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,12 @@ open Feliz.DaisyUI
open Model
open Messages
open Shared
open Shared.DTOs.SelectedColumnsModalDto
open SelectedColumns

open ARCtrl
open JsonImport
open Components

open Modals

type SelectiveImportModal =

static member private MetadataImport(isActive: bool, setActive: bool -> unit, disArcFile: ArcFilesDiscriminate) =
Expand Down
2 changes: 1 addition & 1 deletion src/Client/Modals/SelectiveTemplateFromDB.fs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ open Feliz.DaisyUI
open Model
open Messages
open Shared
open Shared.DTOs.SelectedColumnsModalDto
open SelectedColumns

open ARCtrl
open JsonImport
Expand Down
3 changes: 2 additions & 1 deletion src/Client/Pages/DataAnnotator/DataAnnotator.fs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ open Model
open Messages
open Feliz
open Feliz.DaisyUI
open Modals

module private DataAnnotatorHelper =

Expand Down Expand Up @@ -342,7 +343,7 @@ type DataAnnotator =

SidebarComponents.SidebarLayout.Description "Specify exact data points for annotation."

SidebarComponents.SidebarLayout.LogicContainer [
ModalElements.LogicContainer [
ModalMangementComponent ref model (fun _ -> setShowModal true) rmvFile uploadFile
match model.DataAnnotatorModel, showModal with
| { DataFile = Some _; ParsedFile = Some _ }, true -> DataAnnotator.Modal(model, dispatch, rmvFile, fun _ -> setShowModal false)
Expand Down
4 changes: 3 additions & 1 deletion src/Client/Pages/FilePicker/FilePickerView.fs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ open Messages
open Feliz
open Feliz.DaisyUI

open Modals

let update (filePickerMsg:FilePicker.Msg) (state: FilePicker.Model) (model: Model.Model) : FilePicker.Model * Cmd<Messages.Msg> =
match filePickerMsg with
| LoadNewFiles fileNames ->
Expand Down Expand Up @@ -216,7 +218,7 @@ module FileNameTable =


let fileContainer (model:Model) dispatch =
SidebarComponents.SidebarLayout.LogicContainer [
ModalElements.LogicContainer [

uploadButton model dispatch "@md/sidebar:flex-row"

Expand Down
4 changes: 3 additions & 1 deletion src/Client/Pages/JsonExporter/JsonExporter.fs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ open GlobalBindings
open ARCtrl
open ARCtrl.Spreadsheet

open Modals

let download(filename, text) =
let element = document.createElement("a");
element.setAttribute("href", "data:text/plain;charset=utf-8," + Fable.Core.JS.encodeURIComponent(text));
Expand Down Expand Up @@ -139,7 +141,7 @@ type FileExporter =
]
]
])
SidebarComponents.SidebarLayout.LogicContainer [
ModalElements.LogicContainer [
FileExporter.JsonExport(model, dispatch)
]
]
Expand Down
4 changes: 3 additions & 1 deletion src/Client/Pages/ProtocolTemplates/ProtocolSearch.fs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ open Messages
open Feliz
open Feliz.DaisyUI

open Modals

module private HelperProtocolSearch =

let breadcrumbEle (model:Model) dispatch =
Expand Down Expand Up @@ -53,7 +55,7 @@ type SearchContainer =

Html.p "Search the database for protocol templates."

SidebarComponents.SidebarLayout.LogicContainer [
ModalElements.LogicContainer [
Protocol.Search.InfoField()
Protocol.Search.FileSortElement(model, config, setConfig)
Protocol.Search.Component (filteredTemplates, model, dispatch)
Expand Down
2 changes: 1 addition & 1 deletion src/Client/Pages/ProtocolTemplates/ProtocolView.fs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ type Templates =
// Box 1
SidebarComponents.SidebarLayout.Description "Add template from database."

Modals.Template.SelectiveTemplateFromDBModal.Main(model, dispatch)
Modals.SelectiveTemplateFromDBModal.Main(model, dispatch)

// Box 2
SidebarComponents.SidebarLayout.Description (Html.p [
Expand Down
6 changes: 3 additions & 3 deletions src/Client/Pages/ProtocolTemplates/TemplateFromFile.fs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ open Shared
open ARCtrl
open Fable.Core.JsInterop

open Modals.ModalElements
open Modals

type private TemplateFromFileState = {
/// User select type to upload
Expand Down Expand Up @@ -99,11 +99,11 @@ type TemplateFromFile =
| ArcFilesDiscriminate.Template, JsonExportFormat.ROCrate
| ArcFilesDiscriminate.Template, JsonExportFormat.ISA -> true
| _ -> false
SidebarComponents.SidebarLayout.LogicContainer [
ModalElements.LogicContainer [
// modal!
match state.UploadedFile with
| Some af ->
Modals.Import.SelectiveImportModal.Main (af, dispatch, rmv = (fun _ -> TemplateFromFileState.init() |> setState))
Modals.SelectiveImportModal.Main (af, dispatch, rmv = (fun _ -> TemplateFromFileState.init() |> setState))
| None -> Html.none
Html.div [
Daisy.join [
Expand Down
3 changes: 2 additions & 1 deletion src/Client/Pages/TermSearch/TermSearchView.fs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ open Elmish
open TermSearch
open Model

open Modals

let update (termSearchMsg: TermSearch.Msg) (currentState:TermSearch.Model) : TermSearch.Model * Cmd<Messages.Msg> =
match termSearchMsg with
Expand Down Expand Up @@ -100,7 +101,7 @@ let Main (model:Model, dispatch) =

SidebarComponents.SidebarLayout.Description "Search for an ontology term to fill into the selected field(s)"

SidebarComponents.SidebarLayout.LogicContainer [
ModalElements.LogicContainer [
Components.TermSearch.Input(setTerm, fullwidth=true, ?parent=model.TermSearchState.ParentTerm, advancedSearchDispatch=dispatch, ?onFocus=excelGetParentTerm, autofocus=true)
addButton(model, dispatch)
]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module Shared.DTOs.SelectedColumnsModalDto
module SelectedColumns

type SelectedColumns = {
Columns: bool []
Expand All @@ -7,4 +7,5 @@ with
static member init(length) =
{
Columns = Array.init length (fun _ -> true)
}
}

2 changes: 1 addition & 1 deletion src/Client/States/SpreadsheetInterface.fs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
namespace SpreadsheetInterface

open Shared
open Shared.DTOs.SelectedColumnsModalDto
open SelectedColumns
open ARCtrl
open JsonImport

Expand Down
2 changes: 1 addition & 1 deletion src/Client/Update/UpdateUtil.fs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ module Update.UpdateUtil

open ARCtrl
open Shared
open Shared.DTOs.SelectedColumnsModalDto
open SelectedColumns
open Fable.Remoting.Client

let download(filename, bytes:byte []) = bytes.SaveFileAs(filename)
Expand Down
10 changes: 5 additions & 5 deletions src/Shared/Shared.fs
Original file line number Diff line number Diff line change
Expand Up @@ -234,14 +234,14 @@ type IOntologyAPIv1 = {
///
getTermSuggestions : (int*string) -> Async<Term []>
/// (nOfReturnedResults*queryString*parentOntology). If parentOntology = "" then isNull -> Error.
getTermSuggestionsByParentTerm : (int*string*SwateObsolete.TermMinimal) -> Async<Term []>
getAllTermsByParentTerm : SwateObsolete.TermMinimal -> Async<Term []>
getTermSuggestionsByParentTerm : (int*string*SwateObsolete.TermMinimal) -> Async<Term []>

Check warning on line 237 in src/Shared/Shared.fs

View workflow job for this annotation

GitHub Actions / test (ubuntu-latest)

This construct is deprecated

Check warning on line 237 in src/Shared/Shared.fs

View workflow job for this annotation

GitHub Actions / test (ubuntu-latest)

This construct is deprecated

Check warning on line 237 in src/Shared/Shared.fs

View workflow job for this annotation

GitHub Actions / test (windows-latest)

This construct is deprecated

Check warning on line 237 in src/Shared/Shared.fs

View workflow job for this annotation

GitHub Actions / test (windows-latest)

This construct is deprecated
getAllTermsByParentTerm : SwateObsolete.TermMinimal -> Async<Term []>

Check warning on line 238 in src/Shared/Shared.fs

View workflow job for this annotation

GitHub Actions / test (ubuntu-latest)

This construct is deprecated

Check warning on line 238 in src/Shared/Shared.fs

View workflow job for this annotation

GitHub Actions / test (ubuntu-latest)

This construct is deprecated

Check warning on line 238 in src/Shared/Shared.fs

View workflow job for this annotation

GitHub Actions / test (windows-latest)

This construct is deprecated

Check warning on line 238 in src/Shared/Shared.fs

View workflow job for this annotation

GitHub Actions / test (windows-latest)

This construct is deprecated
/// (nOfReturnedResults*queryString*parentOntology). If parentOntology = "" then isNull -> Error.
getTermSuggestionsByChildTerm : (int*string*SwateObsolete.TermMinimal) -> Async<Term []>
getAllTermsByChildTerm : SwateObsolete.TermMinimal -> Async<Term []>
getTermSuggestionsByChildTerm : (int*string*SwateObsolete.TermMinimal) -> Async<Term []>

Check warning on line 240 in src/Shared/Shared.fs

View workflow job for this annotation

GitHub Actions / test (ubuntu-latest)

This construct is deprecated

Check warning on line 240 in src/Shared/Shared.fs

View workflow job for this annotation

GitHub Actions / test (ubuntu-latest)

This construct is deprecated

Check warning on line 240 in src/Shared/Shared.fs

View workflow job for this annotation

GitHub Actions / test (windows-latest)

This construct is deprecated

Check warning on line 240 in src/Shared/Shared.fs

View workflow job for this annotation

GitHub Actions / test (windows-latest)

This construct is deprecated
getAllTermsByChildTerm : SwateObsolete.TermMinimal -> Async<Term []>

Check warning on line 241 in src/Shared/Shared.fs

View workflow job for this annotation

GitHub Actions / test (ubuntu-latest)

This construct is deprecated

Check warning on line 241 in src/Shared/Shared.fs

View workflow job for this annotation

GitHub Actions / test (ubuntu-latest)

This construct is deprecated

Check warning on line 241 in src/Shared/Shared.fs

View workflow job for this annotation

GitHub Actions / test (windows-latest)

This construct is deprecated

Check warning on line 241 in src/Shared/Shared.fs

View workflow job for this annotation

GitHub Actions / test (windows-latest)

This construct is deprecated
getTermsForAdvancedSearch : (AdvancedSearchTypes.AdvancedSearchOptions) -> Async<Term []>
getUnitTermSuggestions : (int*string) -> Async<Term []>
getTermsByNames : SwateObsolete.TermSearchable [] -> Async<SwateObsolete.TermSearchable []>
getTermsByNames : SwateObsolete.TermSearchable [] -> Async<SwateObsolete.TermSearchable []>

Check warning on line 244 in src/Shared/Shared.fs

View workflow job for this annotation

GitHub Actions / test (ubuntu-latest)

This construct is deprecated

Check warning on line 244 in src/Shared/Shared.fs

View workflow job for this annotation

GitHub Actions / test (ubuntu-latest)

This construct is deprecated

Check warning on line 244 in src/Shared/Shared.fs

View workflow job for this annotation

GitHub Actions / test (windows-latest)

This construct is deprecated

Check warning on line 244 in src/Shared/Shared.fs

View workflow job for this annotation

GitHub Actions / test (windows-latest)

This construct is deprecated

// Tree related requests
getTreeByAccession : string -> Async<TreeTypes.Tree>
Expand Down
1 change: 0 additions & 1 deletion src/Shared/Shared.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
</PropertyGroup>
<ItemGroup>
<Compile Include="Database.fs" />
<Compile Include="DTOs\SelectedColumnsModalDto.fs" />
<Compile Include="DTOs\ParentTermQueryDto.fs" />
<Compile Include="DTOs\TermQueryDto.fs" />
<Compile Include="Extensions.fs" />
Expand Down

0 comments on commit ca0a1d4

Please sign in to comment.