From fc3f4be347359f84ed80943c9e961e64ebb9aa6c Mon Sep 17 00:00:00 2001 From: RenatoBrittoAraujo Date: Mon, 23 Aug 2021 09:23:10 -0300 Subject: [PATCH 1/3] Remove recaptcha --- src/Components/users/Register.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Components/users/Register.tsx b/src/Components/users/Register.tsx index c60952d3..12a61c65 100644 --- a/src/Components/users/Register.tsx +++ b/src/Components/users/Register.tsx @@ -273,7 +273,7 @@ const Register = (props: any) => { )} - { }); }} /> - + */} Date: Tue, 24 Aug 2021 06:30:45 -0300 Subject: [PATCH 2/3] Remove test red matter button --- src/Components/home/LandingPage.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Components/home/LandingPage.tsx b/src/Components/home/LandingPage.tsx index 6673f161..c71e4827 100644 --- a/src/Components/home/LandingPage.tsx +++ b/src/Components/home/LandingPage.tsx @@ -203,7 +203,7 @@ const AppLandingPage = () => {

Analysing FCS files has never been easier

- { ? "Start Analysing" : "Test Red Matter"} - {" "} + {" "} */} {!isLoggedIn ? (
From 1def8eb1a5ad942f3e80617753316407f9b5e109 Mon Sep 17 00:00:00 2001 From: Keshav Agrawal Date: Fri, 10 Sep 2021 20:55:26 +0530 Subject: [PATCH 3/3] Fixed some build stuff and re-checked flowjo --- .../dataManagement/workspaceAssembler.tsx | 75 ++++++++--------- src/graph/utils/workspace.ts | 83 +++++++++++++++++++ src/services/FlowJoParser.tsx | 2 +- 3 files changed, 122 insertions(+), 38 deletions(-) create mode 100644 src/graph/utils/workspace.ts diff --git a/src/graph/dataManagement/workspaceAssembler.tsx b/src/graph/dataManagement/workspaceAssembler.tsx index 519949a1..7341d976 100644 --- a/src/graph/dataManagement/workspaceAssembler.tsx +++ b/src/graph/dataManagement/workspaceAssembler.tsx @@ -13,43 +13,44 @@ import { COMMON_CONSTANTS } from "assets/constants/commonConstants"; export default class WorkspaceAssembler { exportWorkspace(workspace: WorkspaceData): string { - const files: string[] = []; - workspace.files.forEach((e) => { - files.push(e.src + "://" + e.id); - }); - const gates: Gate[] = []; - workspace.gates.forEach((e) => { - e = lodash.cloneDeep(e); - e.parents = e.parents.map((p: any) => p.id); - e.children = e.children.map((c: any) => c.id); - const gateObj = JSON.parse(JSON.stringify(e)); - delete gateObj.observers; - gates.push(gateObj); - }); - const plots: object[] = []; - workspace.plots.forEach((plot: any) => { - let nplot = lodash.cloneDeep(plot); - nplot.histogramBarOverlays.forEach((x: any) => { - if (x.plot && Object.keys(x.plot).length > 0) - x.plot = this.parsePlot(x.plot); - }); - nplot.histogramOverlays.forEach((x: any) => { - if (x.plot && Object.keys(x.plot).length > 0) - x.plot = this.parsePlot(x.plot); - }); - let p = this.parsePlot(nplot); - plots.push(p); - }); - const name = - workspace.workspaceName === undefined ? "" : workspace.workspaceName; - - const workspaceJSON = JSON.stringify({ - name, - files, - gates, - plots: plots === null || plots === undefined ? [] : plots, - }); - return workspaceJSON; + // const files: string[] = []; + // workspace.files.forEach((e) => { + // files.push(e.src + "://" + e.id); + // }); + // const gates: Gate[] = []; + // workspace.gates.forEach((e) => { + // e = lodash.cloneDeep(e); + // e.parents = e.parents.map((p: any) => p.id); + // e.children = e.children.map((c: any) => c.id); + // const gateObj = JSON.parse(JSON.stringify(e)); + // delete gateObj.observers; + // gates.push(gateObj); + // }); + // const plots: object[] = []; + // workspace.plots.forEach((plot: any) => { + // let nplot = lodash.cloneDeep(plot); + // nplot.histogramBarOverlays.forEach((x: any) => { + // if (x.plot && Object.keys(x.plot).length > 0) + // x.plot = this.parsePlot(x.plot); + // }); + // nplot.histogramOverlays.forEach((x: any) => { + // if (x.plot && Object.keys(x.plot).length > 0) + // x.plot = this.parsePlot(x.plot); + // }); + // let p = this.parsePlot(nplot); + // plots.push(p); + // }); + // const name = + // workspace.workspaceName === undefined ? "" : workspace.workspaceName; + // const workspaceJSON = JSON.stringify({ + // name, + // files, + // gates, + // plots: plots === null || plots === undefined ? [] : plots, + // }); + // return workspaceJSON; + + return ""; } parsePlot(plot: any) { plot = lodash.cloneDeep(plot); diff --git a/src/graph/utils/workspace.ts b/src/graph/utils/workspace.ts new file mode 100644 index 00000000..ee290691 --- /dev/null +++ b/src/graph/utils/workspace.ts @@ -0,0 +1,83 @@ +// import { +// File, +// FileID, +// Gate, +// GateID, +// Plot, +// PlotID, +// Population, +// PopulationID, +// Workspace, +// } from "graph/resources/types"; +// import { store } from "redux/store"; + +// export const getWorkspace = (): Workspace => { +// return new ReduxCache().getWorkspace(); +// }; + +// class ReduxCache { +// static instance: ReduxCache | null = null; +// private workspace: Workspace; + +// constructor() { +// if (ReduxCache.instance) { +// return ReduxCache.instance; +// } +// ReduxCache.instance = this; +// this.workspace = store.getState().workspace as Workspace; +// store.subscribe((state: any) => { +// if (!state || !state?.workspace) return; +// this.workspace = state.workspace as Workspace; +// }); +// } + +// getWorkspace() { +// // TODO FIX CACHING SYNCHRONICITY BROKEN +// return store.getState().workspace; +// // return this.workspace; +// } +// } + +// export const getFile = (fileID: FileID): File => { +// const workspace = getWorkspace(); +// const files = workspace.files.filter((file) => file.id === fileID); +// if (files.length === 0) throw Error("File not found"); +// if (files.length > 1) throw Error("Multiple files with ID = " + fileID); +// return files[0]; +// }; + +// export const getPlot = (plotID: PlotID): Plot => { +// const workspace = getWorkspace(); +// const plots = workspace.plots.filter((plot) => plot.id === plotID); +// if (plots.length === 0) throw Error("Plot not found"); +// if (plots.length > 1) throw Error("Multiple plots with ID = " + plotID); +// return plots[0]; +// }; + +// export const getPopulation = (populationID: PopulationID): Population => { +// const workspace = getWorkspace(); +// const populations = workspace.populations.filter( +// (population) => population.id === populationID +// ); +// if (populations.length === 0) throw Error("Population not found"); +// if (populations.length > 1) +// throw Error("Multiple populations with ID = " + populationID); +// return populations[0]; +// }; + +// export const getGate = (gateID: GateID): Gate => { +// const workspace = getWorkspace(); +// const gates = workspace.gates.filter((gate) => gate.id === gateID); +// if (gates.length === 0) throw Error("Gate not found"); +// if (gates.length > 1) throw Error("Multiple gates with ID = " + gateID); +// return gates[0]; +// }; + +// export const getGate = (gateID: GateID): Gate => { +// const workspace = getWorkspace(); +// const gates = workspace.gates.filter((gate) => gate.id === gateID); +// if (gates.length === 0) throw Error("Gate not found"); +// if (gates.length > 1) throw Error("Multiple gates with ID = " + gateID); +// return gates[0]; +// }; +export {}; diff --git a/src/services/FlowJoParser.tsx b/src/services/FlowJoParser.tsx index 3b35b815..78e15e03 100644 --- a/src/services/FlowJoParser.tsx +++ b/src/services/FlowJoParser.tsx @@ -65,7 +65,7 @@ const ParseFlowJoJson = async (flowJoJson: any) => { let plot = new PlotData(); let sampleUri = samples[i]["DataSet"]["_attributes"]["uri"]; let sampleUrlArray = sampleUri.split("/"); - let sampleName = sampleUri[sampleUrlArray.length - 1]; + let sampleName = sampleUrlArray[sampleUrlArray.length - 1]; sampleName = sampleName.replace("%20", ""); let transformations = samples[i]["Transformations"]; let channelsInfo: any = [];