diff --git a/package.json b/package.json index 5d8bc1c..6a269bd 100644 --- a/package.json +++ b/package.json @@ -27,9 +27,9 @@ "typecheck": "npm run typecheck:main && npm run typecheck:preload && npm run typecheck:renderer" }, "dependencies": { - "@fslab/fsspreadsheet": "^5.0.0", + "@fslab/fsspreadsheet": "^6.1.3", "@imengyu/vue3-context-menu": "^1.3.5", - "@nfdi4plants/arctrl": "^1.1.0", + "@nfdi4plants/arctrl": "^2.0.0-alpha.7", "@nfdi4plants/exceljs": "0.2.0", "@quasar/extras": "^1.16.9", "chokidar": "^3.5.3", diff --git a/packages/renderer/src/ArcControlService.ts b/packages/renderer/src/ArcControlService.ts index bfe225e..b68d89c 100644 --- a/packages/renderer/src/ArcControlService.ts +++ b/packages/renderer/src/ArcControlService.ts @@ -2,11 +2,9 @@ import { reactive } from 'vue' import AppProperties from './AppProperties.ts'; -import { ARC } from "@nfdi4plants/arctrl/ARC.js"; -import { ArcInvestigation } from "@nfdi4plants/arctrl/ISA/ISA/ArcTypes/ArcTypes.js"; -import { gitignoreContract } from "@nfdi4plants/arctrl/Contracts/Contracts.Git.js"; +import { ARC, ArcInvestigation } from "@nfdi4plants/arctrl"; +import { gitignoreContract } from "@nfdi4plants/arctrl/Contract/Git"; import { Xlsx } from '@fslab/fsspreadsheet/Xlsx.js'; -import {FileSystemTree} from '@nfdi4plants/arctrl/FileSystem/FileSystemTree.js' import {Contract} from '@nfdi4plants/arctrl/Contract/Contract.js' import pDebounce from 'p-debounce'; diff --git a/packages/renderer/src/Property.ts b/packages/renderer/src/Property.ts index 8ab713c..7d37c7b 100644 --- a/packages/renderer/src/Property.ts +++ b/packages/renderer/src/Property.ts @@ -1,6 +1,6 @@ import { reactive, watch, ref } from 'vue'; -import {OntologyAnnotation} from '@nfdi4plants/arctrl/ISA/ISA/JsonTypes/OntologyAnnotation.js'; +import {OntologyAnnotation} from '@nfdi4plants/arctrl'; const autoLabel = property => { let words = property @@ -26,7 +26,7 @@ const Property = (model: any,property: string, config?: any)=>{ // console.log(property, model[property]); config = config || {}; if(config.type==='ontology' && !model[property]) - model[property] = OntologyAnnotation.fromString(''); + model[property] = new OntologyAnnotation(''); const p = reactive({ model: model, diff --git a/packages/renderer/src/components/FormInput.vue b/packages/renderer/src/components/FormInput.vue index f8a647c..804bad5 100644 --- a/packages/renderer/src/components/FormInput.vue +++ b/packages/renderer/src/components/FormInput.vue @@ -2,7 +2,7 @@ import { date } from 'quasar' -import {OntologyAnnotation} from '@nfdi4plants/arctrl/ISA/ISA/JsonTypes/OntologyAnnotation.js'; +import {OntologyAnnotation} from '@nfdi4plants/arctrl'; export interface Props { property: Object @@ -40,7 +40,7 @@ const isValidTerm = ()=>{ :options="props.property.options" :option-id="'TermAccessionNumber'" :option-label="a=> a ? a.NameText : ''" - @input-value="v=>{if(props.property.model[props.property.property].NameText!==v){props.property.model[props.property.property] = OntologyAnnotation.fromString(v)}}" + @input-value="v=>{if(props.property.model[props.property.property].NameText!==v){props.property.model[props.property.property] = new OntologyAnnotation(v)}}" @filter="props.property.filter" :disable="props.property.disabled" options-dense @@ -83,7 +83,7 @@ const isValidTerm = ()=>{ :options="props.property.options" :option-id="'TermAccessionNumber'" :option-label="a=> a ? a.NameText : ''" - @input-value="v=>{if(props.property.model[props.property.property].NameText!==v){props.property.model[props.property.property] = OntologyAnnotation.fromString(v)}}" + @input-value="v=>{if(props.property.model[props.property.property].NameText!==v){props.property.model[props.property.property] = new OntologyAnnotation(v)}}" @filter="props.property.filter" :disable="props.property.disabled" options-dense diff --git a/packages/renderer/src/dialogs/NewAssayDialog.vue b/packages/renderer/src/dialogs/NewAssayDialog.vue index 33fccb5..e2e0957 100644 --- a/packages/renderer/src/dialogs/NewAssayDialog.vue +++ b/packages/renderer/src/dialogs/NewAssayDialog.vue @@ -3,7 +3,7 @@ import { useDialogPluginComponent } from 'quasar'; import { reactive, onMounted, watch, ref } from 'vue'; import ArcControlService from '../ArcControlService.ts'; import {ArcStudy} from "@nfdi4plants/arctrl" -import {checkValidCharacters} from '@nfdi4plants/arctrl/ISA/ISA/Identifier.js' +import {checkValidCharacters} from '@nfdi4plants/arctrl/Core/Helper/Identifier.js' import * as internal from 'stream'; export type NewAssayInformation = { diff --git a/packages/renderer/src/dialogs/NewStudyDialog.vue b/packages/renderer/src/dialogs/NewStudyDialog.vue index c40265d..a4eac70 100644 --- a/packages/renderer/src/dialogs/NewStudyDialog.vue +++ b/packages/renderer/src/dialogs/NewStudyDialog.vue @@ -3,7 +3,7 @@ import { useDialogPluginComponent } from 'quasar'; import { reactive, onMounted, watch, ref } from 'vue'; import ArcControlService from '../ArcControlService'; -import {checkValidCharacters} from '@nfdi4plants/arctrl/ISA/ISA/Identifier.js' +import {checkValidCharacters} from '@nfdi4plants/arctrl/Core/Helper/Identifier.js' const iProps : { diff --git a/packages/renderer/src/views/ArcTreeView.vue b/packages/renderer/src/views/ArcTreeView.vue index e47ec34..d6e35f0 100644 --- a/packages/renderer/src/views/ArcTreeView.vue +++ b/packages/renderer/src/views/ArcTreeView.vue @@ -10,7 +10,7 @@ import AddProtocolDialog from '../dialogs/AddProtocolDialog.vue'; import NewAssayDialog from '../dialogs/NewAssayDialog.vue'; import { NewAssayInformation } from '../dialogs/NewAssayDialog.vue'; import { useQuasar } from 'quasar' -import {ArcStudy, ArcAssay} from '@nfdi4plants/arctrl/ISA/ISA/ArcTypes/ArcTypes.js'; +import {ArcStudy, ArcAssay} from '@nfdi4plants/arctrl'; import NewStudyDialog from '../dialogs/NewStudyDialog.vue'; const Image = 'image'; diff --git a/packages/renderer/src/views/SwateView.vue b/packages/renderer/src/views/SwateView.vue index afeefbc..8ebab2d 100644 --- a/packages/renderer/src/views/SwateView.vue +++ b/packages/renderer/src/views/SwateView.vue @@ -3,10 +3,7 @@ import { onMounted, onUnmounted, ref, watch, reactive } from 'vue'; import ArcControlService from '../ArcControlService.ts'; import AppProperties from '../AppProperties.ts'; import SwateControlService from '../SwateControlService.ts'; -import { ArcInvestigation, ArcAssay, ArcStudy } from '@nfdi4plants/arctrl'; -import { ArcAssay_fromArcJsonString, ArcAssay_toArcJsonString } from '@nfdi4plants/arctrl/ISA/ISA.Json/ArcTypes/ArcAssay.js' -import { ArcStudy_fromArcJsonString, ArcStudy_toArcJsonString } from '@nfdi4plants/arctrl/ISA/ISA.Json/ArcTypes/ArcStudy.js' -import { ArcInvestigation_fromArcJsonString, ArcInvestigation_toArcJsonString } from '@nfdi4plants/arctrl/ISA/ISA.Json/ArcTypes/ArcInvestigation.js' +import { ArcInvestigation, ArcAssay, ArcStudy, JsonController } from '@nfdi4plants/arctrl'; let iframe: any | HTMLElement = ref({}) @@ -44,19 +41,19 @@ const send = (msg: Msg, data: any = null): void => { switch (msg) { case Msg.InvestigationToSwate: if (data instanceof ArcInvestigation) { - const jsonString = ArcInvestigation_toArcJsonString(data); + const jsonString = JsonController.Investigation.toJsonString(data,0) toSwate({ ArcInvestigationJsonString: jsonString }); } else return console.error('Invalid data type for Msg.InvestigationToSwate'); break; case Msg.AssayToSwate: if (data instanceof ArcAssay) { - const jsonString = ArcAssay_toArcJsonString(data); + const jsonString = JsonController.Assay.toJsonString(data,0) toSwate({ ArcAssayJsonString: jsonString }); } else return console.error('Invalid data type for Msg.AssayToSwate'); break; case Msg.StudyToSwate: if (data instanceof ArcStudy) { - const jsonString = ArcStudy_toArcJsonString(data); + const jsonString = JsonController.Study.toJsonString(data,0); toSwate({ ArcStudyJsonString: jsonString }); } else return console.error('Invalid data type for Msg.AssayToSwate'); break; @@ -103,17 +100,17 @@ const SwateAPI: SwateAPI = { send(Msg.PathsToSwate, selection) }, InvestigationToARCitect: (investigationJsonString: string) => { - let investigation = ArcInvestigation_fromArcJsonString(investigationJsonString); + let investigation = JsonController.Investigation.fromJsonString(investigationJsonString); ArcControlService.props.arc.ISA = investigation; }, AssayToARCitect: (assayJsonString: string) => { - let assay = ArcAssay_fromArcJsonString(assayJsonString); + let assay = JsonController.Assay.fromJsonString(assayJsonString); ArcControlService.props.arc.ISA.SetAssay(assay.Identifier, assay); }, StudyToARCitect: (studyJsonString: string) => { /// ignore assays, I am actually not sure why this must be create, but it will be empty. Must talk to Lukas Weil about this. /// ~Kevin F. 12.01.2024 - let study = ArcStudy_fromArcJsonString(studyJsonString); + let study = JsonController.Study.fromJsonString(studyJsonString); ArcControlService.props.arc.ISA.SetStudy(study.Identifier, study); }, Error: (e) => {