Skip to content

Commit

Permalink
fix: merge conflict solved
Browse files Browse the repository at this point in the history
Signed-off-by: eugenejahn <[email protected]>
  • Loading branch information
eugenejahn committed May 16, 2022
2 parents b76d4ea + cf2682e commit 4dc7232
Show file tree
Hide file tree
Showing 3 changed files with 97 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
import * as React from 'react';
import { withRouteParams } from 'components/common/withRouteParams';
import { ResourceIdentifier, ResourceType } from 'models/Common/types';
import { makeStyles, Theme } from '@material-ui/core/styles';
import { WaitForData } from 'components/common/WaitForData';
import { useProject } from 'components/hooks/useProjects';
import { StaticGraphContainer } from 'components/Workflow/StaticGraphContainer';
import { WorkflowId } from 'models/Workflow/types';
import { entitySections } from 'components/Entities/constants';
import { EntityDetailsHeader } from 'components/Entities/EntityDetailsHeader';
import { EntityVersions } from 'components/Entities/EntityVersions';
import { typeNameToEntityResource } from './constants';

const useStyles = makeStyles((theme: Theme) => ({
verionDetailsContatiner: {
display: 'flex',
flexDirection: 'column',
flexWrap: 'nowrap',
overflow: 'hidden',
height: `calc(100vh - ${theme.spacing(1)}rem)`,
},
staticGraphContainer: {
display: 'flex',
height: '60%',
width: '100%',
flex: '1',
},
versionsContainer: {
display: 'flex',
flex: '0 1 auto',
height: '40%',
flexDirection: 'column',
overflowY: 'scroll',
},
}));

interface WorkflowVersionDetailsRouteParams {
projectId: string;
domainId: string;
entityType: string;
entityName: string;
entityVersion: string;
}

/**
* The view component for the Workflow Versions page
* @param projectId
* @param domainId
* @param workflowName
*/
const WorkflowVersionDetailsContainer: React.FC<WorkflowVersionDetailsRouteParams> = ({
projectId,
domainId,
entityType,
entityName,
entityVersion,
}) => {
const workflowId = React.useMemo<WorkflowId>(
() => ({
resourceType: typeNameToEntityResource[entityType],
project: projectId,
domain: domainId,
name: entityName,
version: entityVersion,
}),
[entityType, projectId, domainId, entityName, entityVersion],
);

const id = workflowId as ResourceIdentifier;
const sections = entitySections[ResourceType.WORKFLOW];
const project = useProject(workflowId.project);
const styles = useStyles();

return (
<WaitForData {...project}>
<EntityDetailsHeader
project={project.value}
id={id}
launchable={sections.launch}
backToWorkflow
/>
<div className={styles.verionDetailsContatiner}>
<div className={styles.staticGraphContainer}>
<StaticGraphContainer workflowId={workflowId} />
</div>
<div className={styles.versionsContainer}>
<EntityVersions id={id} showAll />
</div>
</div>
</WaitForData>
);
};

export const EntityVersionDetails = withRouteParams<WorkflowVersionDetailsRouteParams>(
WorkflowVersionDetailsContainer,
);
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,6 @@ export const EntityVersions: React.FC<EntityVersionsProps> = ({ id, showAll = fa
);
}, [project, domain, name, versions]);

console.log('versions', versions);
return (
<>
{!showAll && (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import BasicTable from '../EnvVars';

const useStyles = makeStyles((theme: Theme) => ({
container: {
maxHeight: 500,
maxHeight: '60%',
overflow: 'scroll',
},
header: {
Expand Down

0 comments on commit 4dc7232

Please sign in to comment.