diff --git a/scm-ui/ui-components/src/repos/DiffFile.tsx b/scm-ui/ui-components/src/repos/DiffFile.tsx index 98fa9959e3..00a15a0987 100644 --- a/scm-ui/ui-components/src/repos/DiffFile.tsx +++ b/scm-ui/ui-components/src/repos/DiffFile.tsx @@ -21,8 +21,8 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ -import React from "react"; -import { withTranslation, WithTranslation } from "react-i18next"; +import React, { FC } from "react"; +import { useTranslation, withTranslation, WithTranslation } from "react-i18next"; import classNames from "classnames"; import styled from "styled-components"; // @ts-ignore @@ -39,6 +39,7 @@ import HunkExpandLink from "./HunkExpandLink"; import { Modal } from "../modals"; import ErrorNotification from "../ErrorNotification"; import HunkExpandDivider from "./HunkExpandDivider"; +import Tooltip from "../Tooltip"; const EMPTY_ANNOTATION_FACTORY = {}; @@ -90,6 +91,10 @@ const ChangeTypeTag = styled(Tag)` margin-left: 0.75rem; `; +const LeftMarginSpan = styled.span` + margin-left: 0.25rem; +`; + class DiffFile extends React.Component { static defaultProps: Partial = { defaultCollapse: false, @@ -309,7 +314,11 @@ class DiffFile extends React.Component { if (file._links?.lines) { items.push(this.createHunkHeader(expandableHunk)); } else if (i > 0) { - items.push(); + items.push( + + + + ); } items.push( @@ -461,6 +470,7 @@ class DiffFile extends React.Component { {this.renderFileTitle(file)} + {this.renderChangeTag(file)} {sideBySideToggle} @@ -472,4 +482,15 @@ class DiffFile extends React.Component { } } +const LinkToFile: FC = ({ file }) => { + const [t] = useTranslation("repos"); + return ( + + + + + + ); +}; + export default withTranslation("repos")(DiffFile); diff --git a/scm-ui/ui-webapp/public/locales/de/repos.json b/scm-ui/ui-webapp/public/locales/de/repos.json index e5c16389ea..e5bb731596 100644 --- a/scm-ui/ui-webapp/public/locales/de/repos.json +++ b/scm-ui/ui-webapp/public/locales/de/repos.json @@ -223,6 +223,7 @@ } }, "diff": { + "jumpToFile": "Zur Datei springen", "sideBySide": "Zur zweispaltigen Ansicht wechseln", "combined": "Zur kombinierten Ansicht wechseln", "noDiffFound": "Kein Diff zwischen den ausgewählten Branches gefunden.", diff --git a/scm-ui/ui-webapp/public/locales/en/repos.json b/scm-ui/ui-webapp/public/locales/en/repos.json index 09d54ff58a..857264d07b 100644 --- a/scm-ui/ui-webapp/public/locales/en/repos.json +++ b/scm-ui/ui-webapp/public/locales/en/repos.json @@ -230,6 +230,7 @@ "rename": "renamed", "copy": "copied" }, + "jumpToFile": "Jump to file", "sideBySide": "Switch to side-by-side view", "combined": "Switch to combined view", "noDiffFound": "No Diff between the selected branches found.",