Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: back navigation from version details view #219

Merged
merged 1 commit into from
Sep 28, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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