Skip to content

Commit

Permalink
Merge pull request #178 from nfdi4plants/Kevinf-patch-0.5.1
Browse files Browse the repository at this point in the history
Kevinf patch 0.5.1
  • Loading branch information
Freymaurer authored Dec 8, 2021
2 parents 930587f + 9ce752e commit ede6726
Show file tree
Hide file tree
Showing 57 changed files with 6,799 additions and 11,710 deletions.
6 changes: 3 additions & 3 deletions .assets/assets/manifest.xml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<OfficeApp xmlns="http://schemas.microsoft.com/office/appforoffice/1.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:bt="http://schemas.microsoft.com/office/officeappbasictypes/1.0" xmlns:ov="http://schemas.microsoft.com/office/taskpaneappversionoverrides" xsi:type="TaskPaneApp">
<Id>5d6f5462-3401-48ec-9406-d12882e9ad83</Id>
<Version>0.5.0</Version>
<Version>0.5.1</Version>
<ProviderName>Computational Systems Biology</ProviderName>
<DefaultLocale>en-US</DefaultLocale>
<DisplayName DefaultValue="Swate"/>
<Description DefaultValue="Utility functions to annotate data in a fast and safe way."/>
<IconUrl DefaultValue="https://swate.nfdi4plants.de/assets/swate_32x32.png"/>
<HighResolutionIconUrl DefaultValue="https://swate.nfdi4plants.de/assets/swate_80x80.png"/>
<SupportUrl DefaultValue="https://csb.bio.uni-kl.de/"/>
<SupportUrl DefaultValue="https://github.com/nfdi4plants/Swate/issues"/>
<AppDomains>
<AppDomain>bio.uni-kl.de</AppDomain>
</AppDomains>
Expand Down
60 changes: 27 additions & 33 deletions .config/dotnet-tools.json
Original file line number Diff line number Diff line change
@@ -1,36 +1,30 @@
{
"version": 1,
"isRoot": true,
"tools": {
"paket": {
"version": "6.0.0-rc002",
"commands": [
"paket"
]
},
"fake-cli": {
"version": "5.20.3",
"commands": [
"fake"
]
},
"fable": {
"version": "3.2.1",
"commands": [
"fable"
]
},
"fantomas-tool": {
"version": "4.4.0",
"commands": [
"fantomas"
]
},
"femto": {
"version": "0.8.6",
"commands": [
"femto"
]
"version": 1,
"isRoot": true,
"tools": {
"paket": {
"version": "6.0.7",
"commands": [
"paket"
]
},
"fable": {
"version": "3.2.11",
"commands": [
"fable"
]
},
"fantomas-tool": {
"version": "4.5.2",
"commands": [
"fantomas"
]
},
"femto": {
"version": "0.9.0",
"commands": [
"femto"
]
}
}
}
}
4 changes: 1 addition & 3 deletions .db/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,14 @@ services:
# newer version fail with .net
image: mariadb:10.4
# command: --default-authentication-plugin=mysql_native_password
restart: always
volumes:
- ./mysql-dump:/docker-entrypoint-initdb.d
environment:
MYSQL_ROOT_PASSWORD: {PASSWORD}
MYSQL_ROOT_PASSWORD: example
ports:
- 42333:3306

adminer:
image: adminer
restart: always
ports:
- 8085:8080
19 changes: 19 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
.fable/
*.fs.js
.fake/
.farmer/
.idea/
.ionide/
.vs/
deploy/
obj/
bin/
packages/
paket-files/
node_modules/
release.cmd
release.sh
*.orig
*.DotSettings.user
.assets/swate.zip
.git
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
.fable/
*.fs.js
*.fs.js.map
.fake/
.farmer/
.idea/
Expand Down
18 changes: 12 additions & 6 deletions .paket/Paket.Restore.targets
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@
This value should match the version in the props generated by paket
If they differ, this means we need to do a restore in order to ensure correct dependencies
-->
<PropertyGroup Condition="'$(PaketPropsVersion)' != '5.185.3' ">
<PropertyGroup Condition="'$(PaketPropsVersion)' != '6.0.0' ">
<PaketRestoreRequired>true</PaketRestoreRequired>
</PropertyGroup>

Expand Down Expand Up @@ -236,13 +236,16 @@
<PackageName>$([System.String]::Copy('%(PaketReferencesFileLines.Identity)').Split(',')[0])</PackageName>
<PackageVersion>$([System.String]::Copy('%(PaketReferencesFileLines.Identity)').Split(',')[1])</PackageVersion>
<AllPrivateAssets>$([System.String]::Copy('%(PaketReferencesFileLines.Identity)').Split(',')[4])</AllPrivateAssets>
<CopyLocal Condition="'%(PaketReferencesFileLinesInfo.Splits)' == '6'">$([System.String]::Copy('%(PaketReferencesFileLines.Identity)').Split(',')[5])</CopyLocal>
<CopyLocal Condition="%(PaketReferencesFileLinesInfo.Splits) &gt;= 6">$([System.String]::Copy('%(PaketReferencesFileLines.Identity)').Split(',')[5])</CopyLocal>
<OmitContent Condition="%(PaketReferencesFileLinesInfo.Splits) &gt;= 7">$([System.String]::Copy('%(PaketReferencesFileLines.Identity)').Split(',')[6])</OmitContent>
<ImportTargets Condition="%(PaketReferencesFileLinesInfo.Splits) &gt;= 8">$([System.String]::Copy('%(PaketReferencesFileLines.Identity)').Split(',')[7])</ImportTargets>
</PaketReferencesFileLinesInfo>
<PackageReference Include="%(PaketReferencesFileLinesInfo.PackageName)">
<Version>%(PaketReferencesFileLinesInfo.PackageVersion)</Version>
<PrivateAssets Condition=" ('%(PaketReferencesFileLinesInfo.AllPrivateAssets)' == 'true') Or ('$(PackAsTool)' == 'true') ">All</PrivateAssets>
<ExcludeAssets Condition=" '%(PaketReferencesFileLinesInfo.Splits)' == '6' And %(PaketReferencesFileLinesInfo.CopyLocal) == 'false'">runtime</ExcludeAssets>
<ExcludeAssets Condition=" '%(PaketReferencesFileLinesInfo.Splits)' != '6' And %(PaketReferencesFileLinesInfo.AllPrivateAssets) == 'exclude'">runtime</ExcludeAssets>
<ExcludeAssets Condition=" %(PaketReferencesFileLinesInfo.CopyLocal) == 'false' or %(PaketReferencesFileLinesInfo.AllPrivateAssets) == 'exclude'">runtime</ExcludeAssets>
<ExcludeAssets Condition=" %(PaketReferencesFileLinesInfo.OmitContent) == 'true'">$(ExcludeAssets);contentFiles</ExcludeAssets>
<ExcludeAssets Condition=" %(PaketReferencesFileLinesInfo.ImportTargets) == 'false'">$(ExcludeAssets);build;buildMultitargeting;buildTransitive</ExcludeAssets>
<Publish Condition=" '$(PackAsTool)' == 'true' ">true</Publish>
<AllowExplicitVersion>true</AllowExplicitVersion>
</PackageReference>
Expand Down Expand Up @@ -362,7 +365,9 @@
PackageLicenseFile="$(PackageLicenseFile)"
PackageLicenseExpression="$(PackageLicenseExpression)"
PackageLicenseExpressionVersion="$(PackageLicenseExpressionVersion)"
PackageReadmeFile="$(PackageReadmeFile)" />
Readme="$(PackageReadmeFile)"
NoDefaultExcludes="$(NoDefaultExcludes)"/>

<PackTask Condition="$(UseMSBuild16_0_Pack)"
PackItem="$(PackProjectInputFile)"
PackageFiles="@(_PackageFiles)"
Expand Down Expand Up @@ -410,7 +415,8 @@
NuspecProperties="$(NuspecProperties)"
PackageLicenseFile="$(PackageLicenseFile)"
PackageLicenseExpression="$(PackageLicenseExpression)"
PackageLicenseExpressionVersion="$(PackageLicenseExpressionVersion)" />
PackageLicenseExpressionVersion="$(PackageLicenseExpressionVersion)"
NoDefaultExcludes="$(NoDefaultExcludes)" />

<PackTask Condition="$(UseMSBuild15_9_Pack)"
PackItem="$(PackProjectInputFile)"
Expand Down
8 changes: 4 additions & 4 deletions AssemblyVersion.fs
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ namespace System
open System.Reflection

[<assembly: AssemblyTitleAttribute("Swate")>]
[<assembly: AssemblyVersionAttribute("0.5.0")>]
[<assembly: AssemblyMetadataAttribute("ReleaseDate","22-Oct-21")>]
[<assembly: AssemblyVersionAttribute("0.5.1")>]
[<assembly: AssemblyMetadataAttribute("ReleaseDate","02-Nov-21")>]
do ()

module internal AssemblyVersionInformation =
let [<Literal>] AssemblyTitle = "Swate"
let [<Literal>] AssemblyVersion = "0.5.0"
let [<Literal>] AssemblyMetadata_ReleaseDate = "22-Oct-21"
let [<Literal>] AssemblyVersion = "0.5.1"
let [<Literal>] AssemblyMetadata_ReleaseDate = "02-Nov-21"
15 changes: 9 additions & 6 deletions Build.fs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ let clientTestsPath = Path.getFullName "tests/Client"

let dockerComposePath = Path.getFullName ".db\docker-compose.yml"

let developmentUrl = "https://localhost:3000"

module ProjectInfo =

let gitOwner = "nfdi4plants"
Expand Down Expand Up @@ -191,29 +193,30 @@ Target.create "InstallClient" (fun _ ->
run npm "install" "."
)

Target.create "Bundle" (fun _ ->
Target.create "bundle" (fun _ ->
[ "server", dotnet $"publish -c Release -o \"{deployPath}\"" serverPath
"client", dotnet "fable --run webpack -p" clientPath ]
"client", dotnet "fable src/Client -s --run webpack --config webpack.config.js" "" ]
|> runParallel
)

Target.create "Bundle-Linux" (fun _ ->
Target.create "bundle-linux" (fun _ ->
[ "server", dotnet $"publish -c Release -r linux-x64 -o \"{deployPath}\"" serverPath
"client", dotnet "fable --run webpack -p" clientPath ]
"client", dotnet "fable src/Client -s --run webpack --config webpack.config.js" "" ]
|> runParallel
)

Target.create "Run" (fun _ ->
run dotnet "build" sharedPath
[ "server", dotnet "watch run" serverPath
"client", dotnet "fable watch --run webpack-dev-server" clientPath ]
"client", dotnet "fable watch src/Client -s --run webpack-dev-server" "" ]
|> runParallel
)

Target.create "officedebug" (fun _ ->
run dotnet "build" sharedPath
openBrowser developmentUrl
[ "server", dotnet "watch run" serverPath
"client", dotnet "fable watch --run webpack-dev-server" clientPath
"client", dotnet "fable watch src/Client -s --run webpack-dev-server" ""
/// start up mysql db from docker-compose
"database", dockerCompose $"-f {dockerComposePath} up" __SOURCE_DIRECTORY__
/// sideload webapp in excel
Expand Down
18 changes: 18 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
FROM mcr.microsoft.com/dotnet/sdk:5.0 as build

# Install node
RUN curl -sL https://deb.nodesource.com/setup_14.x | bash
RUN apt-get update && apt-get install -y nodejs

WORKDIR /workspace
COPY . .
RUN dotnet tool restore

RUN dotnet run Bundle


FROM mcr.microsoft.com/dotnet/aspnet:5.0-alpine
COPY --from=build /workspace/deploy /app
WORKDIR /app
EXPOSE 5000
ENTRYPOINT [ "dotnet", "Server.dll" ]
12 changes: 12 additions & 0 deletions Helpers.fs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
module Helpers

open Fake.Core
open System.Runtime.InteropServices

let initializeContext () =
let execContext = Context.FakeExecutionContext.Create false "build.fsx" [ ]
Expand Down Expand Up @@ -102,6 +103,17 @@ let node =

let dockerCompose = createProcess "docker-compose"

///Choose process to open plots with depending on OS. Thanks to @zyzhu for hinting at a solution (https://github.com/plotly/Plotly.NET/issues/31)
let openBrowser url =
if RuntimeInformation.IsOSPlatform(OSPlatform.Windows) then
CreateProcess.fromRawCommand "cmd.exe" [ "/C"; $"start {url}" ] |> Proc.run |> ignore
elif RuntimeInformation.IsOSPlatform(OSPlatform.Linux) then
CreateProcess.fromRawCommand "xdg-open" [ url ] |> Proc.run |> ignore
elif RuntimeInformation.IsOSPlatform(OSPlatform.OSX) then
CreateProcess.fromRawCommand "open" [ url ] |> Proc.run |> ignore
else
failwith "Cannot open Browser. OS not supported."

let run proc arg dir =
proc arg dir
|> Proc.run
Expand Down
45 changes: 24 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@ Swate aims to provide a low-friction workflow annotation experience that makes t

- [Swate](#swate)
- [Features](#features)
- [Swate Features sorted by Excel Versions](#swate-features-sorted-by-excel-versions)
- [Install/Use](#installuse)
- [Excel desktop](#excel-desktop)
- [Using the Swate Installer](#using-the-swate-installer)
- [Using the Swate installer](#using-the-swate-installer)
- [Using a shared folder](#using-a-shared-folder)
- [Excel online](#excel-online)
- [Discuss/Get help](#discussget-help)
- [Documentation](#documentation)
- [API docs](#api-docs)
- [Feature documentation](#feature-documentation)
- [Guides](#guides)
- [Report problems and request features](#report-problems-and-request-features)
Expand All @@ -47,13 +47,28 @@ The base features of Swate are:
There are many more small and incremental features. Check the [latest release notes](https://github.com/nfdi4plants/Swate/releases) for the newest additions.


### Swate Features sorted by Excel Versions

Feature | Excel 365/ Office online | Excel 2019 |
|--- |:---: |:---: |
| **Core** | |
| Adding and managing <br> building blocks|<span style="color:#1FC2A7">✓</span>|<span style="color:#1FC2A7">✓</span>|
| Ontology Term search <br> and insert|<span style="color:#1FC2A7">✓</span>| <span style="color:#1FC2A7">✓</span>
| Ontology Term update | <span style="color:#1FC2A7">✓</span> |<span style="color:#1FC2A7">✓</span>|
| Add Templates|<span style="color:#1FC2A7">✓</span>|<span style="color:#1FC2A7">✓</span>
| Copy filenames into table| <span style="color:#1FC2A7">✓</span>| <span style="color:#1FC2A7">✓</span>
| Display DAG| <span style="color:#1FC2A7">✓</span>| <span style="color:#c21f3a">x</span>
| **Experts** | |
| Export Swate information | <span style="color:#1FC2A7">✓</span>| <span style="color:#c21f3a">x</span>
| Create Template Metadata | <span style="color:#1FC2A7">✓</span>| <span style="color:#c21f3a">x</span>
| Write Checklist Custom Xml | <span style="color:#1FC2A7">✓</span>| <span style="color:#1FC2A7">✓</span>
| Edit Custom Xml | <span style="color:#1FC2A7">✓</span>| <span style="color:#1FC2A7">✓</span>

## Install/Use

You can test swate by following the steps below. If you decide to do so, please take the time to set up a Github account to report your issues and suggestions [here](https://github.com/nfdi4plants/Swate/issues).
You can also search existing issues for solutions for your questions and/or discussions about your suggestions.

___N O T E___ : Swate runs **only** on MS Excel 365, and MS Excel Online. We test on and develop for explicitly these versions. (It is possible though that some older versions like MS Excel 2019 work.)

### Excel desktop


Expand Down Expand Up @@ -88,10 +103,6 @@ If you have administrative access in your organization, you can create a network

### Documentation

#### API docs

The RPC API docs of Swate are available [here](https://swate.denbi.uni-tuebingen.de/api/IAnnotatorAPIv1/docs)

#### Feature documentation

Documentation of the features is now a top priority as we completed the POC stage :rocket:. You can discuss needed docs and the available ones [here](https://github.com/nfdi4plants/Swate/issues/47)
Expand Down Expand Up @@ -170,31 +181,23 @@ By installing this repo via the install.cmd file the MySql password will default
### Set up Sql Dump
The database became too large for GitHub to upload the dump directly. Therefore we now provide the basic Database structure as .sql dump file in this repo, including the data for ontologiesand all template related tables. Only Terms and TermRelationships are missing. These tables can be populated via the private repository SwateDB (v2 branch). If you can't access this repository, please post an issue and you will get a complete dump.
The following instructions can help to import that dump into the database:
After following the instructions above:
1. Open powershell in the folder with the sql dump.
2. Use `cmd /c "docker exec -i db_db_1 mysql -uroot -pexample SwateDB<SwateDB.sql"`
3. Observe in Adminer how the tables are created and slowly filled.
The database became too large for GitHub to upload the dump directly. Therefore we now provide the basic Database structure as .sql dump file in this repo, including the data for ontologies and all template related tables. If you wish to participate in development open an issue and we can figure out how to share a ready-to-use database dump.
### Project Decription
This project uses the [SAFE Stack](https://github.com/SAFE-Stack) to create a website that uses [office.js](https://github.com/OfficeDev/office-js) to interop with Excel.
The file [OfficeJS.fs](src/Client/OfficeJS.fs) contains Fable bindings autogenerated from the office.js typescript definitions.
The utilized Fable bindings for office-js can be found in [office-fable](https://github.com/Freymaurer/office-fable).
to debug the AddIn locally, use the build target `OfficeDebug`:
To debug the AddIn locally, use the build target `officedebug`:
`fake build -t OfficeDebug`
`dotnet run officedebug`
this will launch an Excel instance with the AddIn sideloaded, while also running docker with a MySql- and a Adminer instance.
The MySql user/password will be root/example and can be set in .db/docker-compose.yml.
Adminer can be accessed at localhost:8085, MySql at localhost:42333, and the app runs at localhost:3000 for client and localhost:8080 for the server.
However it is currently pretty hard to attach a debugger to the instance of edge that runs in
the Excel window (update: you can now use [EdgeDevToolsPreview](https://www.microsoft.com/en-us/p/microsoft-edge-devtools-preview/9mzbfrmz0mnj?activetab=pivot:overviewtab) for that aswell). You can circumvent this issue by additionally testing in Excel online:
To debug add-in instances you can now easily open debug console/inspect for newer Excel versions. For Excel 2019 and earlier you can use the create a `.cmd` file with `C:\Windows\SysWOW64\F12\IEChooser.exe` to easily open the f12 tools (on windows). Alternatively use office online:
- open Excel online in your favorite browser
- create a blank new workbook (or use any workbook, but be warned that you can't undo stuff done via Office.js)
Expand Down
11 changes: 11 additions & 0 deletions RELEASE_NOTES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
### 0.5.1+0c90a83 (Released 2021-12-8)
* Additions:
* latest commit #0c90a83
* Add support for Excel 2019 :tada:
* [[#48d8d61](https://github.com/nfdi4plants/Swate/commit/48d8d61409d1404b9bd254241e54742ced36b357)] Replace drag and drop for filepicker with simplified table sorting element
* [[#e16c861](https://github.com/nfdi4plants/Swate/commit/e16c8613acde31738ecf0af09bee503feea7246a)] Add whitespace between authors.
* [[#7b0884f](https://github.com/nfdi4plants/Swate/commit/7b0884f9d2c76bae5d59148acecd7b4165739587)] add pure json return for common api
* Bugfixes:
* [[#2a09a55](https://github.com/nfdi4plants/Swate/commit/2a09a55120261db8527b1c80e63a50cb0ecfe4e3)] Split template tags by "," instead of ";"
* [[#c82dd4f](https://github.com/nfdi4plants/Swate/commit/c82dd4f3ef72a21af8f0896ea0cb103811f2c198)] Fix server port error for production.

### 0.5.0+70632951 (Released 2021-10-22)
* Additions:
* latest commit #70632951
Expand Down
Loading

0 comments on commit ede6726

Please sign in to comment.