Skip to content

Commit

Permalink
Clean-up
Browse files Browse the repository at this point in the history
  • Loading branch information
mareklibra committed Feb 28, 2023
1 parent 4a1140b commit ab60712
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 11 deletions.
5 changes: 4 additions & 1 deletion plugins/orion/src/components/PluginRouter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,10 @@ export const PluginRouter = () => (
<Route path="/notification" element={<Notification />} />
<Route path="/training" element={<Training />} />
<Route path="/metrics" element={<Metrics />} />
<Route path="/onboarding/:projectId/:workflowId/new/" element={<Onboarding isNew />} />
<Route
path="/onboarding/:projectId/:workflowId/new/"
element={<Onboarding isNew />}
/>
<Route
path="/onboarding/:executionId/workflow-detail"
element={<WorkFlowDetail isNew />}
Expand Down
6 changes: 2 additions & 4 deletions plugins/orion/src/components/workflow/Onboarding.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@ import {
} from '../../context/WorkflowParametersContext';
import { mockAndromedaWorkflowDefinition } from './mockData';

// TODO: use WorkflowStepper component after http://161.156.17.167:8080/swagger-ui/index.html#/Workflow/execute

const getAllFlattenedParameters = (
allWorkflowDefinitions: WorkflowDefinitionType[],
workflowDefinition: WorkflowDefinitionType,
Expand Down Expand Up @@ -98,7 +96,6 @@ export const OnboardingImpl: React.FC<OnboardingProps> = ({ isNew }) => {
const [workflowParameters, setWorkflowParameters] = React.useState<
WorkFlowTaskParameterType[]
>([]); // parameters from whole chain of tasks - nextWorkflow
// TODO: provide inra for storing dynamic parameters

React.useEffect(() => {
if (!workflowId) {
Expand Down Expand Up @@ -145,7 +142,7 @@ export const OnboardingImpl: React.FC<OnboardingProps> = ({ isNew }) => {

const onStart = async () => {
const body: WorkflowType = {
projectId,
projectId: projectId || 'missing',
workFlowName: workflow?.name || 'missing',
workFlowTasks:
workflow?.tasks.map(task => {
Expand Down Expand Up @@ -178,6 +175,7 @@ export const OnboardingImpl: React.FC<OnboardingProps> = ({ isNew }) => {
});
} catch (e) {
setError('Failed to start workflow');
// eslint-disable-next-line no-console
console.error('Failed to start workflow: ', e);
}
};
Expand Down
19 changes: 13 additions & 6 deletions plugins/orion/src/components/workflow/Workflow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,19 @@ import {
import { useCommonStyles } from '../../styles';
import { ParodosPage } from '../ParodosPage';
import { useBackendUrl } from '../api';
import { AssessmentStatusType, ProjectType, WorkflowDefinitionType } from '../types';
import {
AssessmentStatusType,
ProjectType,
WorkflowDefinitionType,
} from '../types';
import { mockAndromedaWorkflowDefinition } from './mockData';

const useStyles = makeStyles({
applicationHeader: {
background: 'gray',
},
applicationCard: {
'height': '15rem',
height: '15rem',
width: '17rem',
},
});
Expand Down Expand Up @@ -72,8 +76,8 @@ export const Workflow = () => {
}),
},
);
const project = (await response.json()) as ProjectType;
setProject(project);
const prj = (await response.json()) as ProjectType;
setProject(prj);

setAssessmentStatus('complete');

Expand Down Expand Up @@ -105,7 +109,10 @@ export const Workflow = () => {
);

// mock
filteredWorkflowDefinitions = [mockAndromedaWorkflowDefinition, ...filteredWorkflowDefinitions];
filteredWorkflowDefinitions = [
mockAndromedaWorkflowDefinition,
...filteredWorkflowDefinitions,
];

setWorkflowDefinitions(filteredWorkflowDefinitions);
} catch (e) {
Expand All @@ -115,7 +122,7 @@ export const Workflow = () => {
}
};
doItAsync();
}, []);
}, [backendUrl]);

return (
<ParodosPage>
Expand Down

0 comments on commit ab60712

Please sign in to comment.