Skip to content

Commit

Permalink
developing
Browse files Browse the repository at this point in the history
  • Loading branch information
jmrodriguezc committed Aug 9, 2024
1 parent 2bd798c commit 00db8b2
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 27 deletions.
41 changes: 15 additions & 26 deletions app/src/components/Pipelines.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import React, {
useState,
useEffect,
useContext
useContext,
} from 'react';
import { useHistory } from 'react-router-dom';
import { DataTable } from 'primereact/datatable';
Expand Down Expand Up @@ -50,34 +50,23 @@ const Pipelines = () => {
const [loading, setLoading] = useState(false);
const [datatable, setDatatable] = useState([]);

// If auth is still null, render a loading spinner or some fallback UI
// useEffect(() => {
// if (auth !== null) {
// const data = pipelineFiles.map(convertDataToTable);
// setDatatable(data);
// setLoading(false);
// }
// }, [auth]);

// Perform actions outside the main scope
useEffect(() => {
// transform the data pipeline for the table
const convertDataToTable = (data) => ({
id: data.$id,
status: <StatusIcon status={data.status} />,
title: data.title,
description: data.description,
url: <UrlLink url={data.url} />,
action: <LunchButton data={data} auth={auth} />
});

const data = pipelineFiles.map(convertDataToTable);
setDatatable(data);
setLoading(false);
}, []);
}, [auth]);


// Transform the data pipeline for the table
const convertDataToTable = (data) => ({
id: data.$id,
status: <StatusIcon status={data.status} />,
title: data.title,
description: data.description,
url: <UrlLink url={data.url} />,
action: <LunchButton data={data} auth={auth} />
});
// const [datatable] = useState(pipelineFiles.map(convertDataToTable));

// Define header
const columns = [
{ field: 'status', header: 'Status' },
Expand Down Expand Up @@ -107,10 +96,10 @@ const Pipelines = () => {
// Lunch Button that redirect to "Parameters"
const LunchButton = ({ data, auth }) => {
const history = useHistory();
const [navigate, setNavigate] = useState(false);
const [workflowId, setWorkflowId] = useState({});
const [workflowId, setWorkflowId] = useState('');
const [attemptId, setAttemptId] = useState(0);
const [datasetId, setDatasetId] = useState({});
const [datasetId, setDatasetId] = useState('');
const [navigate, setNavigate] = useState(false);

// Navigate to parameter form
useEffect(() => {
Expand Down
2 changes: 1 addition & 1 deletion app/src/components/Workflow.js
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,7 @@ const FileViewer = ({typeOutput, files, expandedKeys, onToggle, workflowId, atte
});
return (
<button type="button" className="p-treetable-toggler p-link" style={options.buttonStyle} tabIndex={-1} onClick={options.onClick}>
<span className={iconClassName} aria-hidden="true"></span>
<span className={iconClassName}></span>
</button>
);
};
Expand Down

0 comments on commit 00db8b2

Please sign in to comment.