From d462addbf1cdb9bac29ae7d9de087b72c632878e Mon Sep 17 00:00:00 2001 From: Florian Scholdei Date: Tue, 28 Jul 2020 12:36:21 +0200 Subject: [PATCH] Check if baseUrl is missing, update storyshots --- .../src/__snapshots__/storyshots.test.ts.snap | 12 ++++++------ scm-ui/ui-components/src/repos/Diff.stories.tsx | 8 +++++++- scm-ui/ui-components/src/repos/Diff.tsx | 1 + scm-ui/ui-components/src/repos/DiffFile.tsx | 15 ++++++++------- 4 files changed, 22 insertions(+), 14 deletions(-) diff --git a/scm-ui/ui-components/src/__snapshots__/storyshots.test.ts.snap b/scm-ui/ui-components/src/__snapshots__/storyshots.test.ts.snap index e1e29e4537..f1a2e7fce8 100644 --- a/scm-ui/ui-components/src/__snapshots__/storyshots.test.ts.snap +++ b/scm-ui/ui-components/src/__snapshots__/storyshots.test.ts.snap @@ -38383,7 +38383,7 @@ exports[`Storyshots Diff WithLinkToFile 1`] = ` ; }) - .add("WithLinkToFile", () => ); + .add("WithLinkToFile", () => ( + + )); diff --git a/scm-ui/ui-components/src/repos/Diff.tsx b/scm-ui/ui-components/src/repos/Diff.tsx index 46913c6f4f..f666174476 100644 --- a/scm-ui/ui-components/src/repos/Diff.tsx +++ b/scm-ui/ui-components/src/repos/Diff.tsx @@ -31,6 +31,7 @@ type Props = WithTranslation & DiffObjectProps & { diff: File[]; changesetId?: string; + baseUrl?: string; }; class Diff extends React.Component { diff --git a/scm-ui/ui-components/src/repos/DiffFile.tsx b/scm-ui/ui-components/src/repos/DiffFile.tsx index 261f200f2b..457541d5e9 100644 --- a/scm-ui/ui-components/src/repos/DiffFile.tsx +++ b/scm-ui/ui-components/src/repos/DiffFile.tsx @@ -417,13 +417,14 @@ class DiffFile extends React.Component { } const collapseIcon = this.hasContent(file) ? : null; const fileControls = fileControlFactory ? fileControlFactory(file, this.setCollapse) : null; - const jumpToFile = changesetId ? ( - - ) : null; + const jumpToFile = + changesetId && baseUrl ? ( + + ) : null; const sideBySideToggle = file.hunks && file.hunks.length > 0 ? (