Skip to content

Commit

Permalink
feat(teamProjectApiUpdate): Added API update for results app
Browse files Browse the repository at this point in the history
  • Loading branch information
jarvisraymond-uchicago committed Nov 6, 2023
1 parent 281b187 commit bab3a70
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 5 deletions.
5 changes: 2 additions & 3 deletions src/Analysis/GWASApp/GWASContainer.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import { Space, Button } from 'antd';
import ProgressBar from './Components/ProgressBar/ProgressBar';
import { GWASAppSteps, checkFinalPopulationSizeZero } from './Utils/constants';
import { SourceContextProvider } from './Utils/Source';
import initialState from './Utils/StateManagement/InitialState';
import reducer from './Utils/StateManagement/reducer';
import ACTIONS from './Utils/StateManagement/Actions';
import AttritionTableWrapper from './Components/AttritionTableWrapper/AttritionTableWrapper';
Expand All @@ -13,13 +12,13 @@ import SelectOutcome from './Steps/SelectOutcome/SelectOutcome';
import SelectCovariates from './Steps/SelectCovariates/SelectCovariates';
import DismissibleMessagesList from './Components/DismissibleMessagesList/DismissibleMessagesList';
import MakeFullscreenButton from './Components/MakeFullscreenButton/MakeFullscreenButton';
import InitializeCurrentState from './Utils/StateManagement/InitializeCurrentState';
import './GWASApp.css';

const GWASContainer = () => {
const [state, dispatch] = useReducer(reducer, initialState);
const [state, dispatch] = useReducer(reducer, InitializeCurrentState());

const generateStep = () => {
console.log('initialState', state);
switch (state.currentStep) {
case 0:
return (
Expand Down
2 changes: 1 addition & 1 deletion src/Analysis/GWASApp/Utils/StateManagement/InitialState.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const initialState = {
finalPopulationSizes: [],
selectionMode: '',
messages: [],
selectedTeamProject: localStorage.getItem('teamProject')
selectedTeamProject: localStorage.getItem('teamProject'),
};

export default initialState;
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
const InitializeCurrentState = () => ({
outcome: null,
selectedStudyPopulationCohort: null,
covariates: [],
imputationScore: 0.3,
mafThreshold: 0.01,
numOfPC: 3,
gwasName: '',
selectedHare: { concept_value: '' },
currentStep: 0,
finalPopulationSizes: [],
selectionMode: '',
messages: [],
selectedTeamProject: localStorage.getItem('teamProject'),
});

export default InitializeCurrentState;
4 changes: 3 additions & 1 deletion src/Analysis/GWASResults/Views/Home/Home.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@ const Home = () => {
const refetchInterval = 5000;

async function fetchGwasWorkflows() {
const workflowsEndpoint = `${gwasWorkflowPath}workflows`;
const currentTeamProject = localStorage.getItem('teamProject');
const workflowsEndpoint = `${gwasWorkflowPath}workflows?teamproject=${currentTeamProject}`;
console.log("workflowsEndpoint", workflowsEndpoint)
const getWorkflows = await fetch(workflowsEndpoint);
return getWorkflows.json();
}
Expand Down

0 comments on commit bab3a70

Please sign in to comment.