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 9bbf3d36c6..55f0977dc9 100644 --- a/scm-ui/ui-components/src/__snapshots__/storyshots.test.ts.snap +++ b/scm-ui/ui-components/src/__snapshots__/storyshots.test.ts.snap @@ -3954,15 +3954,19 @@ exports[`Storyshots Diff Binaries 1`] = `
- - - + + + +
@@ -4235,15 +4239,19 @@ exports[`Storyshots Diff Collapsed 1`] = `
- - - + + + +
- - - + + + +
@@ -4969,15 +5001,19 @@ exports[`Storyshots Diff CollapsingWithFunction 1`] = ` @@ -5823,15 +5859,19 @@ exports[`Storyshots Diff CollapsingWithFunction 1`] = ` @@ -6273,15 +6313,19 @@ exports[`Storyshots Diff CollapsingWithFunction 1`] = ` @@ -6723,15 +6767,19 @@ exports[`Storyshots Diff CollapsingWithFunction 1`] = ` @@ -6794,15 +6842,19 @@ exports[`Storyshots Diff CollapsingWithFunction 1`] = ` @@ -6874,15 +6926,19 @@ exports[`Storyshots Diff Default 1`] = ` @@ -7451,15 +7507,19 @@ exports[`Storyshots Diff Default 1`] = ` @@ -8305,15 +8365,19 @@ exports[`Storyshots Diff Default 1`] = ` @@ -8755,15 +8819,19 @@ exports[`Storyshots Diff Default 1`] = ` @@ -9205,15 +9273,19 @@ exports[`Storyshots Diff Default 1`] = ` @@ -10262,15 +10334,19 @@ exports[`Storyshots Diff Default 1`] = ` @@ -10796,15 +10872,19 @@ exports[`Storyshots Diff Expandable 1`] = ` @@ -11410,15 +11490,19 @@ exports[`Storyshots Diff Expandable 1`] = ` @@ -12361,15 +12445,19 @@ exports[`Storyshots Diff Expandable 1`] = ` @@ -12883,15 +12971,19 @@ exports[`Storyshots Diff Expandable 1`] = ` @@ -13405,15 +13497,19 @@ exports[`Storyshots Diff Expandable 1`] = ` @@ -14617,15 +14713,19 @@ exports[`Storyshots Diff Expandable 1`] = ` @@ -15188,15 +15288,19 @@ exports[`Storyshots Diff File Annotation 1`] = ` @@ -15769,15 +15873,19 @@ exports[`Storyshots Diff File Annotation 1`] = ` @@ -16627,15 +16735,19 @@ exports[`Storyshots Diff File Annotation 1`] = ` @@ -17081,15 +17193,19 @@ exports[`Storyshots Diff File Annotation 1`] = ` @@ -17535,15 +17651,19 @@ exports[`Storyshots Diff File Annotation 1`] = ` @@ -18596,15 +18716,19 @@ exports[`Storyshots Diff File Annotation 1`] = ` @@ -19134,15 +19258,19 @@ exports[`Storyshots Diff File Controls 1`] = ` @@ -24005,15 +24157,19 @@ exports[`Storyshots Diff Line Annotation 1`] = ` @@ -24594,15 +24750,19 @@ exports[`Storyshots Diff Line Annotation 1`] = ` @@ -25460,15 +25620,19 @@ exports[`Storyshots Diff Line Annotation 1`] = ` @@ -25910,15 +26074,19 @@ exports[`Storyshots Diff Line Annotation 1`] = ` @@ -26360,15 +26528,19 @@ exports[`Storyshots Diff Line Annotation 1`] = ` @@ -27417,15 +27589,19 @@ exports[`Storyshots Diff Line Annotation 1`] = ` @@ -27963,15 +28139,19 @@ exports[`Storyshots Diff OnClick 1`] = ` @@ -28580,15 +28760,19 @@ exports[`Storyshots Diff OnClick 1`] = ` @@ -29496,15 +29680,19 @@ exports[`Storyshots Diff OnClick 1`] = ` @@ -29976,15 +30164,19 @@ exports[`Storyshots Diff OnClick 1`] = ` @@ -30456,15 +30648,19 @@ exports[`Storyshots Diff OnClick 1`] = ` @@ -31589,15 +31785,19 @@ exports[`Storyshots Diff OnClick 1`] = ` @@ -32159,15 +32359,19 @@ exports[`Storyshots Diff Side-By-Side 1`] = ` @@ -32829,15 +33033,19 @@ exports[`Storyshots Diff Side-By-Side 1`] = ` @@ -33773,15 +33981,19 @@ exports[`Storyshots Diff Side-By-Side 1`] = ` @@ -34275,15 +34487,19 @@ exports[`Storyshots Diff Side-By-Side 1`] = ` @@ -34777,15 +34993,19 @@ exports[`Storyshots Diff Side-By-Side 1`] = ` @@ -36003,15 +36223,19 @@ exports[`Storyshots Diff Side-By-Side 1`] = ` @@ -36610,15 +36834,19 @@ exports[`Storyshots Diff SyntaxHighlighting 1`] = ` @@ -37187,15 +37415,19 @@ exports[`Storyshots Diff SyntaxHighlighting 1`] = ` @@ -38041,15 +38273,19 @@ exports[`Storyshots Diff SyntaxHighlighting 1`] = ` @@ -38491,15 +38727,19 @@ exports[`Storyshots Diff SyntaxHighlighting 1`] = ` @@ -38941,15 +39181,19 @@ exports[`Storyshots Diff SyntaxHighlighting 1`] = ` @@ -39998,15 +40242,19 @@ exports[`Storyshots Diff SyntaxHighlighting 1`] = ` @@ -40532,15 +40780,19 @@ exports[`Storyshots Diff WithLinkToFile 1`] = ` @@ -41146,15 +41398,19 @@ exports[`Storyshots Diff WithLinkToFile 1`] = ` @@ -42097,15 +42353,19 @@ exports[`Storyshots Diff WithLinkToFile 1`] = ` @@ -42619,15 +42879,19 @@ exports[`Storyshots Diff WithLinkToFile 1`] = ` @@ -43141,15 +43405,19 @@ exports[`Storyshots Diff WithLinkToFile 1`] = ` @@ -44353,15 +44621,19 @@ exports[`Storyshots Diff WithLinkToFile 1`] = ` diff --git a/scm-ui/ui-components/src/buttons/OpenInFullscreenButton.tsx b/scm-ui/ui-components/src/buttons/OpenInFullscreenButton.tsx index 70d4ee5ead..c1cd1c6da2 100644 --- a/scm-ui/ui-components/src/buttons/OpenInFullscreenButton.tsx +++ b/scm-ui/ui-components/src/buttons/OpenInFullscreenButton.tsx @@ -26,10 +26,12 @@ import { FC, ReactNode, useState } from "react"; import { useTranslation } from "react-i18next"; import styled from "styled-components"; import FullscreenModal from "../modals/FullscreenModal"; +import Tooltip from "../Tooltip"; type Props = { modalTitle: string; modalBody: ReactNode; + tooltipStyle?: "tooltipComponent" | "htmlTitle"; }; const Button = styled.a` @@ -39,13 +41,18 @@ const Button = styled.a` } `; -const OpenInFullscreenButton: FC = ({ modalTitle, modalBody }) => { +const OpenInFullscreenButton: FC = ({ modalTitle, modalBody, tooltipStyle = "tooltipComponent" }) => { const [t] = useTranslation("repos"); const [showModal, setShowModal] = useState(false); - return ( + const tooltip = t("diff.fullscreen.open"); + const content = ( <> - {showModal && ( @@ -58,6 +65,15 @@ const OpenInFullscreenButton: FC = ({ modalTitle, modalBody }) => { )} ); + + if (tooltipStyle === "htmlTitle") { + return <>{content}; + } + return ( + + {content} + + ); }; export default OpenInFullscreenButton; diff --git a/scm-ui/ui-components/src/modals/Modal.tsx b/scm-ui/ui-components/src/modals/Modal.tsx index d7552ad898..21825e5c75 100644 --- a/scm-ui/ui-components/src/modals/Modal.tsx +++ b/scm-ui/ui-components/src/modals/Modal.tsx @@ -53,7 +53,7 @@ export const Modal: FC = ({ title, closeFunction, body, footer, active, c const modalElement = (
-
+

{title}

diff --git a/scm-ui/ui-components/src/repos/DiffFile.tsx b/scm-ui/ui-components/src/repos/DiffFile.tsx index 77d44ec595..e98d6fc39f 100644 --- a/scm-ui/ui-components/src/repos/DiffFile.tsx +++ b/scm-ui/ui-components/src/repos/DiffFile.tsx @@ -93,6 +93,11 @@ const ChangeTypeTag = styled(Tag)` const MarginlessModalContent = styled.div` margin: -1.25rem; + + & .panel-block { + flex-direction: column; + align-items: stretch; + } `; class DiffFile extends React.Component { @@ -410,30 +415,31 @@ class DiffFile extends React.Component { const { file, collapsed, sideBySide, diffExpander, expansionError } = this.state; const viewType = sideBySide ? "split" : "unified"; - let body = null; + const fileAnnotations = fileAnnotationFactory ? fileAnnotationFactory(file) : null; + const innerContent = ( +
+ {fileAnnotations} + + {(hunks: HunkType[]) => + hunks?.map((hunk, n) => { + return this.renderHunk(file, diffExpander.getHunk(n), n); + }) + } + +
+ ); let icon = "angle-right"; + let body = null; if (!collapsed) { - const fileAnnotations = fileAnnotationFactory ? fileAnnotationFactory(file) : null; icon = "angle-down"; - body = ( -
- {fileAnnotations} - - {(hunks: HunkType[]) => - hunks?.map((hunk, n) => { - return this.renderHunk(file, diffExpander.getHunk(n), n); - }) - } - -
- ); + body = innerContent; } const collapseIcon = this.hasContent(file) ? : null; const fileControls = fileControlFactory ? fileControlFactory(file, this.setCollapse) : null; const openInFullscreen = file?.hunks?.length ? ( {body}} + modalBody={{innerContent}} /> ) : null; const sideBySideToggle = file?.hunks?.length && ( diff --git a/scm-ui/ui-webapp/src/repos/sources/containers/Content.tsx b/scm-ui/ui-webapp/src/repos/sources/containers/Content.tsx index 7f827f855a..03f2d6dc84 100644 --- a/scm-ui/ui-webapp/src/repos/sources/containers/Content.tsx +++ b/scm-ui/ui-webapp/src/repos/sources/containers/Content.tsx @@ -138,6 +138,7 @@ class Content extends React.Component { {content}} + tooltipStyle="htmlTitle" />