Skip to content

Commit

Permalink
ARCtrl version upgrade; force swate loading screen
Browse files Browse the repository at this point in the history
  • Loading branch information
JonasLukasczyk committed Nov 19, 2024
1 parent 2e93921 commit 265b1b8
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
"dependencies": {
"@fslab/fsspreadsheet": "^6.2.0",
"@imengyu/vue3-context-menu": "^1.3.5",
"@nfdi4plants/arctrl": "^2.0.1",
"@nfdi4plants/arctrl": "^2.2.4",
"@nfdi4plants/exceljs": "0.2.0",
"@quasar/extras": "^1.16.9",
"chokidar": "^3.5.3",
Expand Down
9 changes: 6 additions & 3 deletions packages/renderer/src/SwateControlService.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { reactive } from 'vue'
import { reactive, nextTick } from 'vue'

import AppProperties from './AppProperties.ts';
import ArcControlService from './ArcControlService.ts';
Expand All @@ -24,15 +24,18 @@ const SwateControlService = {
* @param type object type: 0 investigation, 1 study, 2 assay
* @param identifier object identifier
*/
LoadSwateState: (type: number, identifier: string) => {
LoadSwateState: async (type: number, identifier: string) => {
SwateControlService.props.object = null;
AppProperties.state = AppProperties.STATES.EDIT_SWATE;
await nextTick();

const methods = [null,'TryGetStudy','TryGetAssay'];
SwateControlService.props.type = type;
if(type===0){
SwateControlService.props.object = ArcControlService.props.arc.ISA;
} else {
SwateControlService.props.object = ArcControlService.props.arc.ISA[methods[type]](identifier);
}
AppProperties.state = AppProperties.STATES.EDIT_SWATE;
}
}

Expand Down
6 changes: 4 additions & 2 deletions packages/renderer/src/views/SwateView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,13 @@ const send = (msg: Msg, data: any = null): void => {
switch (msg) {
case Msg.InvestigationToSwate:
if (data instanceof ArcInvestigation) {
const jsonString = JsonController.Investigation.toJsonString(data,0)
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 = JsonController.Assay.toJsonString(data,0)
const jsonString = JsonController.Assay.toJsonString(data,0);
toSwate({ ArcAssayJsonString: jsonString });
} else return console.error('Invalid data type for Msg.AssayToSwate');
break;
Expand Down Expand Up @@ -125,6 +125,8 @@ const init = async ()=>{
iProps.loading = true;
iProps.showTimeout = false;
setTimeout(()=>iProps.showTimeout=true,4000);
if(!SwateControlService.props.object) return;
iframe.value.setAttribute("src", `${AppProperties.config.swate_url}?is_swatehost=1&random=${SwateControlService.props.cacheNumber}`);
};
Expand Down

0 comments on commit 265b1b8

Please sign in to comment.