Skip to content

Commit

Permalink
fix: back navigation from version details view (#219)
Browse files Browse the repository at this point in the history
Signed-off-by: csirius <[email protected]>
  • Loading branch information
govalt authored Sep 28, 2021
1 parent 6b83d2d commit 003d6ca
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 2 deletions.
2 changes: 2 additions & 0 deletions src/components/Entities/EntityDetails.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ function getLaunchProps(id: ResourceIdentifier) {
* for use with all entities (not all entities have schedules, for example).
* @param id
* @param versionView
* @param showStaticGraph
*/
export const EntityDetails: React.FC<EntityDetailsProps> = ({
id,
Expand All @@ -88,6 +89,7 @@ export const EntityDetails: React.FC<EntityDetailsProps> = ({
project={project.value}
id={id}
launchable={!!sections.launch}
versionView={versionView}
onClickLaunch={onLaunch}
/>
{!versionView && (
Expand Down
23 changes: 21 additions & 2 deletions src/components/Entities/EntityDetailsHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { Project } from 'models/Project/types';
import { getProjectDomain } from 'models/Project/utils';
import * as React from 'react';
import { Link } from 'react-router-dom';
import { Routes } from 'routes/routes';
import { launchStrings } from './constants';
import { backUrlGenerator } from './generators';

Expand All @@ -34,14 +35,24 @@ interface EntityDetailsHeaderProps {
project: Project;
id: ResourceIdentifier;
launchable?: boolean;
versionView: boolean;
onClickLaunch?(): void;
}

/** Renders the entity name and any applicable actions. */
/**
* Renders the entity name and any applicable actions.
* @param id
* @param onClickLaunch
* @param launchable
* @param versionView
* @param project
* @constructor
*/
export const EntityDetailsHeader: React.FC<EntityDetailsHeaderProps> = ({
id,
onClickLaunch,
launchable = false,
versionView,
project
}) => {
const styles = useStyles();
Expand All @@ -58,7 +69,15 @@ export const EntityDetailsHeader: React.FC<EntityDetailsHeaderProps> = ({
>
<Link
className={commonStyles.linkUnstyled}
to={backUrlGenerator[id.resourceType](id)}
to={
versionView
? Routes.WorkflowDetails.makeUrl(
id.project,
id.domain,
id.name
)
: backUrlGenerator[id.resourceType](id)
}
>
<ArrowBack color="inherit" />
</Link>
Expand Down

0 comments on commit 003d6ca

Please sign in to comment.