Skip to content

Commit

Permalink
Update to ARCtrl v2.0.0 #187
Browse files Browse the repository at this point in the history
  • Loading branch information
Freymaurer committed Jun 18, 2024
1 parent 4b8db4b commit 9ec2aab
Show file tree
Hide file tree
Showing 8 changed files with 19 additions and 24 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
6 changes: 2 additions & 4 deletions packages/renderer/src/ArcControlService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down
4 changes: 2 additions & 2 deletions packages/renderer/src/Property.ts
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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,
Expand Down
6 changes: 3 additions & 3 deletions packages/renderer/src/components/FormInput.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion packages/renderer/src/dialogs/NewAssayDialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down
2 changes: 1 addition & 1 deletion packages/renderer/src/dialogs/NewStudyDialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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 : {
Expand Down
2 changes: 1 addition & 1 deletion packages/renderer/src/views/ArcTreeView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down
17 changes: 7 additions & 10 deletions packages/renderer/src/views/SwateView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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({})
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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) => {
Expand Down

0 comments on commit 9ec2aab

Please sign in to comment.