Skip to content

Commit

Permalink
lint fix
Browse files Browse the repository at this point in the history
  • Loading branch information
v-rocheleau committed Aug 9, 2023
1 parent aca3586 commit 656680c
Show file tree
Hide file tree
Showing 6 changed files with 40 additions and 34 deletions.
3 changes: 2 additions & 1 deletion src/components/datasets/DatasetDataTypes.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ import DataTypeSummaryModal from "./datatype/DataTypeSummaryModal";

const NA_TEXT = <span style={{ color: "#999", fontStyle: "italic" }}>N/A</span>;

const DatasetDataTypes = React.memo(({ isPrivate, project, dataset, onDatasetIngest: onDatasetIngest, isFetchingDatasets }) => {
const DatasetDataTypes = React.memo(({isPrivate, project, dataset, onDatasetIngest:
onDatasetIngest, isFetchingDatasets }) => {
const dispatch = useDispatch();

const datasetDataTypes = useSelector((state) => state.datasetDataTypes.itemsById[dataset.identifier]);
Expand Down
12 changes: 6 additions & 6 deletions src/components/manager/DataTypeSelect.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ const DataTypeSelect = ({value, workflows, onChange}) => {
const [selected, setSelected] = useState(value ?? undefined);
const servicesFetching = useSelector((state) => state.services.isFetchingAll);
const workflowsFetching = useSelector((state) => state.serviceWorkflows.isFetchingAll);

useEffect(() => {
setSelected(value);
}, [value])
}, [value]);

const onChangeInner = useCallback((newSelected) => {
if (!value) setSelected(newSelected);
Expand All @@ -25,8 +25,8 @@ const DataTypeSelect = ({value, workflows, onChange}) => {
return Array.from(dataTypes).map((dt) =>
<Select.Option value={dt} key={dt}>
{dt}
</Select.Option>
)
</Select.Option>,
);
}
return [];
}, [workflows]);
Expand All @@ -37,14 +37,14 @@ const DataTypeSelect = ({value, workflows, onChange}) => {
{options}
</Select>
</Spin>

);
};

DataTypeSelect.propTypes = {
workflows: PropTypes.array,
onChange: PropTypes.func,
value: PropTypes.string
value: PropTypes.string,
};

export default DataTypeSelect;
8 changes: 6 additions & 2 deletions src/components/manager/ManagerIngestionContent.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { useCallback, useMemo } from "react";
import React, {useCallback} from "react";
import {useDispatch, useSelector} from "react-redux";
import {useHistory} from "react-router-dom";
import PropTypes from "prop-types";
Expand Down Expand Up @@ -37,7 +37,11 @@ const IngestWorkflowSelection = ({values, setValues, handleWorkflowClick}) => {
/>,
);

const onChange = useCallback(({project=selectedProject, dataset=selectedDataset, dataType=selectedDataType}) => {
const onChange = useCallback(({
project = selectedProject,
dataset = selectedDataset,
dataType = selectedDataType,
}) => {
setValues({
selectedProject: project,
selectedDataset: dataset,
Expand Down
8 changes: 4 additions & 4 deletions src/components/manager/projects/RoutedProject.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,10 @@ class RoutedProject extends Component {
ingestIntoDataset(p, d, dt) {
this.props.history.push("/admin/data/manager/ingestion",
{workflowSelectionValues: {
selectedProject: p.identifier,
selectedDataset: d.identifier,
selectedDataType: dt.id,
}
selectedProject: p.identifier,
selectedDataset: d.identifier,
selectedDataType: dt.id,
},
});
}

Expand Down
41 changes: 21 additions & 20 deletions src/modules/wes/actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -129,26 +129,27 @@ export const submitWorkflowRun = networkAction(
});


export const submitIngestionWorkflowRun = (serviceInfo, projectID, datasetID, dataType, workflow, inputs, redirect, hist) =>
(dispatch) =>
dispatch(submitWorkflowRun(
SUBMIT_INGESTION_RUN,
serviceInfo,
workflow,
{projectID, datasetID, dataType}, // params
inputs,
{ // tags
service_url: serviceInfo.url,
project_id: projectID,
dataset_id: datasetID,
data_type: dataType,
},
run => { // onSuccess
message.success(`Ingestion with run ID "${run.run_id}" submitted!`);
if (redirect) hist.push(redirect);
},
"Error submitting ingestion workflow", // errorMessage
));
export const submitIngestionWorkflowRun =
(serviceInfo, projectID, datasetID, dataType, workflow, inputs, redirect, hist) =>
(dispatch) =>
dispatch(submitWorkflowRun(
SUBMIT_INGESTION_RUN,
serviceInfo,
workflow,
{projectID, datasetID, dataType}, // params
inputs,
{ // tags
service_url: serviceInfo.url,
project_id: projectID,
dataset_id: datasetID,
data_type: dataType,
},
run => { // onSuccess
message.success(`Ingestion with run ID "${run.run_id}" submitted!`);
if (redirect) hist.push(redirect);
},
"Error submitting ingestion workflow", // errorMessage
));


export const submitAnalysisWorkflowRun = (serviceInfo, workflow, inputs, redirect, hist) => (dispatch) =>
Expand Down
2 changes: 1 addition & 1 deletion src/propTypes.js
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ export const workflowTarget = PropTypes.shape({
selectedProject: PropTypes.string,
selectedDataset: PropTypes.string,
selectedDataType: PropTypes.string,
})
});

// Gives components which include this in their state to props connection access to workflows and loading status.
export const workflowsStateToPropsMixin = state => {
Expand Down

0 comments on commit 656680c

Please sign in to comment.