Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

fix(gwas-ui): fix bugs & pr feedback #1058

Merged
merged 1 commit into from
Aug 17, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/Analysis/AnalysisApp.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -225,8 +225,8 @@ class AnalysisApp extends React.Component {
? (
<div className='analysis-app__job-status'>
{this.isJobRunning() ? <Spin size='large' tip='Job in progress...' /> : null}
{job && job.status === 'Completed' ? <h3>Job Completed</h3> : null}
{job && job.status === 'Failed' ? <h3>Job Failed</h3> : null}
{job?.status === 'Completed' ? <h3>Job Completed</h3> : null}
{job?.status === 'Failed' ? <h3>Job Failed</h3> : null}
{results ? results.map((line, i) => <p key={i}>{line}</p>) : null}
</div>
)
Expand Down
1 change: 0 additions & 1 deletion src/Analysis/GWASUIApp/GWASWorkflowList.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ const GWASWorkflowList = () => {
<GWASJob workflow={item} />
)}
/>

</Panel>
</Collapse>
</React.Fragment>
Expand Down
2 changes: 1 addition & 1 deletion src/Analysis/GWASWizard/shared/CustomDichotomousSelect.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ const CustomDichotomousSelect = ({
width: 300,
}}
actions={[
<DeleteOutlined onClick={() => handleCDRemove(cd.uuid)} key='delete' />,
<DeleteOutlined onClick={(d) => handleCDRemove(d.uuid)} key='delete' />,
]}
>
<Meta
Expand Down
3 changes: 2 additions & 1 deletion src/Analysis/GWASWizard/shared/GWASFormSubmit.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ const GWASFormSubmit = ({

GWASFormSubmit.propTypes = {
sourceId: PropTypes.number.isRequired,
outcome: PropTypes.object.isRequired,
outcome: PropTypes.object,
numOfPC: PropTypes.number.isRequired,
mafThreshold: PropTypes.number.isRequired,
imputationScore: PropTypes.number.isRequired,
Expand All @@ -179,6 +179,7 @@ GWASFormSubmit.defaultProps = {
selectedControlCohort: undefined,
selectedCaseCohort: undefined,
selectedQuantitativeCohort: undefined,
outcome: undefined,
};

export default GWASFormSubmit;
31 changes: 16 additions & 15 deletions src/Analysis/GWASWizard/shared/GWASJob.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,15 @@ import {
SyncOutlined,
CloseCircleOutlined,
QuestionCircleOutlined,
MinusCircleOutlined,
StopOutlined,
LoadingOutlined,
CloseOutlined
} from '@ant-design/icons';
import { useQuery } from 'react-query';
import PropTypes from 'prop-types';
import { gwasWorkflowPath } from '../../../localconf';
import { headers } from '../../../configs';
import { getPresignedUrl } from '../../AnalysisJob';
import { gwasStatus } from './constants';

const GWASJob = ({ workflow }) => {
async function handleWorkflowOutput(url) {
Expand All @@ -37,16 +38,16 @@ const GWASJob = ({ workflow }) => {
let buttonText;
let buttonClickHandler;

if (phase === 'Succeeded') {
if (phase === gwasStatus.suceeded) {
actionUrl = `${gwasWorkflowPath}status/${workflowName}`;
buttonText = 'download outputs';
buttonClickHandler = handleWorkflowOutput;
} else if (phase === 'Failed') {
} else if (phase === gwasStatus.failed) {
actionUrl = `${gwasWorkflowPath}logs/${workflowName}`;
buttonText = 'view logs';
buttonClickHandler = handleWorkflowLogs;
}
if (['Succeeded', 'Failed'].includes(phase)) {
if ([gwasStatus.suceeded, gwasStatus.failed].includes(phase)) {
actionButtons.unshift(
<Button
primary='true'
Expand Down Expand Up @@ -75,34 +76,34 @@ const GWASJob = ({ workflow }) => {
);
}
switch (phase) {
case 'Running':
case gwasStatus.running:
return (
<Tag icon={<SyncOutlined spin />} color='processing'>
In Progress
</Tag>
);
case 'Succeeded':
case gwasStatus.succeeded:
return (
<Tag icon={<CheckCircleOutlined />} color='success'>
Completed
</Tag>
);
case 'Failed':
case gwasStatus.failed:
return (
<Tag icon={<CloseCircleOutlined />} color='error'>
Failed
</Tag>
);
case 'Canceling':
case gwasStatus.pending:
return (
<Tag icon={<MinusCircleOutlined />} color='warning'>
Canceling
<Tag icon={<LoadingOutlined />} color='processing'>
Pending
</Tag>
);
case 'Canceled':
case gwasStatus.error:
return (
<Tag icon={<StopOutlined />} color='warning'>
Canceled
<Tag icon={<CloseOutlined />} color='error'>
Error
</Tag>
);
default:
Expand Down Expand Up @@ -144,7 +145,7 @@ const GWASJob = ({ workflow }) => {
description={(
<dl>
<dt>Workflow Name: {data.wf_name}</dt>
<dt>Started at {data.startedAt} and finished at {finishedAt}</dt>
<dt>Started at {data.startedAt} {data.phase === gwasStatus.succeeded ? `and finished at ${finishedAt}`: ''}</dt>
</dl>
)}

Expand Down
2 changes: 1 addition & 1 deletion src/Analysis/GWASWizard/shared/WorkflowParameters.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ const WorkflowParameters = ({
<Select
id='select-dichotomous-covariates'
mode='multiple'
value={selectedDichotomousCovariates.map((s) => s.concept_name)}
value={selectedDichotomousCovariates.length ? selectedDichotomousCovariates.map((s) => s.provided_name) : []}
// TODO currently cant delete cd's from this page
// onChange={(e) => handleDichotomousCovariateDelete(e)}
style={{ width: '70%' }}
Expand Down
10 changes: 10 additions & 0 deletions src/Analysis/GWASWizard/shared/constants.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
export const hareConceptId = 2000007027;

export const gwasStatus = {
pending: 'Pending',
running: 'Running',
succeeded: 'Succeeded',
failed: 'Failed',
error: 'Error',
};

export const quantitativeSteps = [
{
title: 'Step 1',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ import { useState, useEffect } from 'react';
import { cohortMiddlewarePath, wtsPath } from '../../../localconf';
import { fetchWithCreds } from '../../../actions';
import { headers } from '../../../configs';
import { hareConceptId } from '../shared/constants';

export const fetchConceptStatsByHare = async (cohortDefinitionId, selectedCovariates, selectedDichotomousCovariates, sourceId) => {
const hareConceptId = 2000007027;
const variablesPayload = {
variables:
[
Expand Down
2 changes: 1 addition & 1 deletion src/Discovery/Discovery.css
Original file line number Diff line number Diff line change
Expand Up @@ -532,7 +532,7 @@
.discovery-modal__subheading {
background-color: #dfe3e2;
border-radius: 4px;
padding: 0 10px;
padding: 0px 10px;
}

.discovery-modal__fieldgroup {
Expand Down