diff --git a/build.gradle b/build.gradle index bf69af10..d549c6c1 100644 --- a/build.gradle +++ b/build.gradle @@ -23,7 +23,7 @@ */ plugins { - id 'org.scm-manager.smp' version '0.10.4' + id 'org.scm-manager.smp' version '0.11.1' } dependencies { @@ -34,7 +34,7 @@ dependencies { } scmPlugin { - scmVersion = "2.32.0" + scmVersion = "2.35.0-SNAPSHOT" displayName = "Review" description = "Depict a review process with pull requests" author = "Cloudogu GmbH" diff --git a/gradle/changelog/modal_diff_comment_icon.yaml b/gradle/changelog/modal_diff_comment_icon.yaml new file mode 100644 index 00000000..773091bf --- /dev/null +++ b/gradle/changelog/modal_diff_comment_icon.yaml @@ -0,0 +1,2 @@ +- type: fixed + description: Styling of diff interaction not working in modal ([#210](https://github.com/scm-manager/scm-review-plugin/pull/210)) diff --git a/src/main/js/diff/Diff.tsx b/src/main/js/diff/Diff.tsx index 00cb5719..bf332013 100644 --- a/src/main/js/diff/Diff.tsx +++ b/src/main/js/diff/Diff.tsx @@ -46,7 +46,6 @@ import PullRequestComment from "../comment/PullRequestComment"; import CreateComment from "../comment/CreateComment"; import CommentSpacingWrapper from "../comment/CommentSpacingWrapper"; import InlineComments from "./InlineComments"; -import StyledDiffWrapper from "./StyledDiffWrapper"; import AddCommentButton from "./AddCommentButton"; import FileComments from "./FileComments"; import MarkReviewedButton from "./MarkReviewedButton"; @@ -337,7 +336,7 @@ const Diff: FC = ({ }; return ( - + <> {changed ? : null} = ({ annotationFactory={annotationFactory} onClick={onGutterClick} refetchOnWindowFocus={false} - hunkClass={(hunk: Hunk) => (hunk.expansion ? "expanded" : "commentable")} + hunkGutterHoverIcon={isPermittedToComment() ? "\\f075" : ""} + highlightLineOnHover={isPermittedToComment()} diffUrl={diffUrl} actions={actions} pullRequestComments={comments?._embedded.pullRequestComments || []} /> - + ); }; diff --git a/src/main/js/diff/StyledDiffWrapper.tsx b/src/main/js/diff/StyledDiffWrapper.tsx deleted file mode 100644 index 72d9fa13..00000000 --- a/src/main/js/diff/StyledDiffWrapper.tsx +++ /dev/null @@ -1,64 +0,0 @@ -/* - * MIT License - * - * Copyright (c) 2020-present Cloudogu GmbH and Contributors - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ -import React, { Component, ReactNode } from "react"; -import styled from "styled-components"; - -type Props = { - children: ReactNode; - commentable: boolean; -}; - -const CommentableWrapper = styled.div` - & table.diff tr:hover > td { - background-color: var(--sh-selected-color) !important; - } - - tbody.commentable .diff-gutter:hover::after { - font-family: "Font Awesome 5 Free"; - content: " \\f075"; - color: var(--scm-column-selection); - } - - tbody.expanded .diff-gutter { - cursor: default; - } -`; - -const NotCommentableWrapper = styled.div` - tbody.expanded .diff-gutter { - cursor: default; - } -`; - -class StyledDiffWrapper extends Component { - render() { - const { children, commentable } = this.props; - if (commentable) { - return {children}; - } - return {children}; - } -} - -export default StyledDiffWrapper;