From 92d7b7703af1cd3527f6a601676725f79d1bdecf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Pfeuffer?= Date: Fri, 12 Jun 2020 17:27:32 +0200 Subject: [PATCH] Add "annotations" button to sources view --- .../components/content/FileButtonAddons.tsx | 28 ++++++-- .../repos/sources/containers/AnnotateView.tsx | 70 +++++++++++++++++++ .../src/repos/sources/containers/Content.tsx | 48 +++++++------ .../sonia/scm/api/v2/resources/BlameDto.java | 2 +- .../BlameResultToBlameDtoMapper.java | 2 +- 5 files changed, 121 insertions(+), 29 deletions(-) create mode 100644 scm-ui/ui-webapp/src/repos/sources/containers/AnnotateView.tsx diff --git a/scm-ui/ui-webapp/src/repos/sources/components/content/FileButtonAddons.tsx b/scm-ui/ui-webapp/src/repos/sources/components/content/FileButtonAddons.tsx index 38f803e958..f2dfe8a7b5 100644 --- a/scm-ui/ui-webapp/src/repos/sources/components/content/FileButtonAddons.tsx +++ b/scm-ui/ui-webapp/src/repos/sources/components/content/FileButtonAddons.tsx @@ -24,20 +24,27 @@ import React from "react"; import { WithTranslation, withTranslation } from "react-i18next"; import { Button, ButtonAddons } from "@scm-manager/ui-components"; +import { SourceViewSelection } from "../../containers/Content"; type Props = WithTranslation & { className?: string; - historyIsSelected: boolean; - showHistory: (p: boolean) => void; + selected: SourceViewSelection; + showSources: () => void; + showHistory: () => void; + showAnnotations: () => void; }; class FileButtonAddons extends React.Component { showHistory = () => { - this.props.showHistory(true); + this.props.showHistory(); }; showSources = () => { - this.props.showHistory(false); + this.props.showSources(); + }; + + showAnnotations = () => { + this.props.showAnnotations(); }; color = (selected: boolean) => { @@ -45,19 +52,26 @@ class FileButtonAddons extends React.Component { }; render() { - const { className, t, historyIsSelected } = this.props; + const { className, t, selected, showSources, showHistory, showAnnotations } = this.props; return (
-
+
+ +
-