diff --git a/scm-ui/ui-components/src/repos/Diff.tsx b/scm-ui/ui-components/src/repos/Diff.tsx index cb4ad30f9f..b34c5ae68e 100644 --- a/scm-ui/ui-components/src/repos/Diff.tsx +++ b/scm-ui/ui-components/src/repos/Diff.tsx @@ -1,11 +1,14 @@ import React from "react"; import DiffFile from "./DiffFile"; import { DiffObjectProps, File } from "./DiffTypes"; +import Notification from "../Notification"; +import { WithTranslation, withTranslation } from "react-i18next"; -type Props = DiffObjectProps & { - diff: File[]; - defaultCollapse?: boolean; -}; +type Props = WithTranslation & + DiffObjectProps & { + diff: File[]; + defaultCollapse?: boolean; + }; class Diff extends React.Component { static defaultProps: Partial = { @@ -13,15 +16,17 @@ class Diff extends React.Component { }; render() { - const { diff, ...fileProps } = this.props; + const { diff, t, ...fileProps } = this.props; return ( <> - {diff.map((file, index) => ( - - ))} + {diff.length === 0 ? ( + {t("noDiffFound")} + ) : ( + diff.map((file, index) => ) + )} ); } } -export default Diff; +export default withTranslation("plugins")(Diff); diff --git a/scm-ui/ui-components/src/repos/LoadingDiff.tsx b/scm-ui/ui-components/src/repos/LoadingDiff.tsx index 1cfbc00b14..45b62f9b35 100644 --- a/scm-ui/ui-components/src/repos/LoadingDiff.tsx +++ b/scm-ui/ui-components/src/repos/LoadingDiff.tsx @@ -43,6 +43,7 @@ class LoadingDiff extends React.Component { fetchDiff = () => { const { url } = this.props; + this.setState({loading: true}); apiClient .get(url) .then(response => response.text()) diff --git a/scm-webapp/src/main/resources/locales/de/plugins.json b/scm-webapp/src/main/resources/locales/de/plugins.json index 3cb6522922..a2cd4530dd 100644 --- a/scm-webapp/src/main/resources/locales/de/plugins.json +++ b/scm-webapp/src/main/resources/locales/de/plugins.json @@ -202,5 +202,6 @@ "CustomNamespaceStrategy": "Benutzerdefiniert", "CurrentYearNamespaceStrategy": "Aktuelles Jahr", "RepositoryTypeNamespaceStrategy": "Repository Typ" - } + }, + "noDiffFound": "Kein Diff zwischen den ausgewählten Branches gefunden." } diff --git a/scm-webapp/src/main/resources/locales/en/plugins.json b/scm-webapp/src/main/resources/locales/en/plugins.json index 0be1c1f803..271d7e8c20 100644 --- a/scm-webapp/src/main/resources/locales/en/plugins.json +++ b/scm-webapp/src/main/resources/locales/en/plugins.json @@ -198,9 +198,10 @@ } }, "namespaceStrategies": { - "UsernameNamespaceStrategy": "Username", - "CustomNamespaceStrategy": "Custom", - "CurrentYearNamespaceStrategy": "Current year", + "UsernameNamespaceStrategy": "Username", + "CustomNamespaceStrategy": "Custom", + "CurrentYearNamespaceStrategy": "Current year", "RepositoryTypeNamespaceStrategy": "Repository type" - } + }, + "noDiffFound": "No Diff between the selected branches found." } diff --git a/scm-webapp/src/main/resources/locales/es/plugins.json b/scm-webapp/src/main/resources/locales/es/plugins.json index e56973946b..042a6ebc63 100644 --- a/scm-webapp/src/main/resources/locales/es/plugins.json +++ b/scm-webapp/src/main/resources/locales/es/plugins.json @@ -182,5 +182,6 @@ "CustomNamespaceStrategy": "Personalizar", "CurrentYearNamespaceStrategy": "Año actual", "RepositoryTypeNamespaceStrategy": "Tipo de repositorio" - } + }, + "noDiffFound": "No se encontraron diferencias entre las ramas seleccionadas." }