From 8f3c0dce1e62df976189e2c10678a0513554a07f Mon Sep 17 00:00:00 2001 From: Konstantin Schaper Date: Fri, 21 Aug 2020 18:27:48 +0200 Subject: [PATCH 1/5] initial implementation --- scm-ui/ui-components/src/repos/Diff.tsx | 53 ++++++++++++++++++--- scm-ui/ui-components/src/repos/DiffFile.tsx | 16 ++++++- 2 files changed, 62 insertions(+), 7 deletions(-) diff --git a/scm-ui/ui-components/src/repos/Diff.tsx b/scm-ui/ui-components/src/repos/Diff.tsx index 5a0571e95f..f5086f2881 100644 --- a/scm-ui/ui-components/src/repos/Diff.tsx +++ b/scm-ui/ui-components/src/repos/Diff.tsx @@ -22,34 +22,75 @@ * SOFTWARE. */ import React from "react"; -import DiffFile from "./DiffFile"; +import DiffFile, {escapeWhitespace} from "./DiffFile"; import { DiffObjectProps, File, FileControlFactory } from "./DiffTypes"; import Notification from "../Notification"; import { WithTranslation, withTranslation } from "react-i18next"; +import {RouteComponentProps, withRouter} from "react-router-dom"; -type Props = WithTranslation & +type Props = RouteComponentProps & WithTranslation & DiffObjectProps & { diff: File[]; fileControlFactory?: FileControlFactory; }; -class Diff extends React.Component { +type State = { + contentRef?: HTMLElement; +} + +function getAnchorSelector(uriHashContent: string) { + return "#" + escapeWhitespace(decodeURIComponent(uriHashContent)); +} + +class Diff extends React.Component { static defaultProps: Partial = { sideBySide: false }; + constructor(props: Readonly) { + super(props); + this.state = { + contentRef: undefined + }; + } + + componentDidUpdate() { + const { contentRef } = this.state; + + // we have to use componentDidUpdate, because we have to wait until all + // children are rendered and componentDidMount is called before the + // changeset content was rendered. + const hash = this.props.location.hash; + const match = hash && hash.match(/^#diff-(.*)$/); + if (contentRef && match) { + const selector = getAnchorSelector(match[1]); + const element = contentRef.querySelector(selector); + if (element && element.scrollIntoView) { + element.scrollIntoView(); + } + } + } + render() { const { diff, t, ...fileProps } = this.props; + const updateContentRef = (el: HTMLElement | null) => { + if (el !== null && this.state.contentRef === undefined) { + this.setState({ contentRef: el }); + } + }; + return ( - <> +
{diff.length === 0 ? ( {t("diff.noDiffFound")} ) : ( diff.map((file, index) => ) )} - +
); } } -export default withTranslation("repos")(Diff); +export default withRouter(withTranslation("repos")(Diff)); diff --git a/scm-ui/ui-components/src/repos/DiffFile.tsx b/scm-ui/ui-components/src/repos/DiffFile.tsx index 637128fae9..91f87e821b 100644 --- a/scm-ui/ui-components/src/repos/DiffFile.tsx +++ b/scm-ui/ui-components/src/repos/DiffFile.tsx @@ -90,6 +90,10 @@ const ChangeTypeTag = styled(Tag)` margin-left: 0.75rem; `; +export function escapeWhitespace(path: string) { + return path.toLowerCase().replace(/\W/g, "-"); +} + class DiffFile extends React.Component { static defaultProps: Partial = { defaultCollapse: false, @@ -350,6 +354,16 @@ class DiffFile extends React.Component { } }; + getAnchorId(file: File) { + let path: string; + if (file.type === "delete") { + path = file.oldPath; + } else { + path = file.newPath; + } + return escapeWhitespace(path); + } + renderFileTitle = (file: File) => { if (file.oldPath !== file.newPath && (file.type === "copy" || file.type === "rename")) { return ( @@ -454,7 +468,7 @@ class DiffFile extends React.Component { } return ( - + {errorModal}
From e9a4a9f1733cf523291c5a9fcbff4d7f64f02683 Mon Sep 17 00:00:00 2001 From: Konstantin Schaper Date: Wed, 26 Aug 2020 11:18:45 +0200 Subject: [PATCH 2/5] update storyshots and fix endless loop in tests --- .../src/__snapshots__/storyshots.test.ts.snap | 76525 ++++++++-------- scm-ui/ui-components/src/repos/Diff.tsx | 15 +- 2 files changed, 38318 insertions(+), 38222 deletions(-) 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 c725cfbb6d..3a1290349d 100644 --- a/scm-ui/ui-components/src/__snapshots__/storyshots.test.ts.snap +++ b/scm-ui/ui-components/src/__snapshots__/storyshots.test.ts.snap @@ -3896,261 +3896,265 @@ exports[`Storyshots Diff Binaries 1`] = `
-
+
- - - Main.java - - - modify - -
-
+ + + Main.java + + + modify + +
+
- - - - - + + + + +
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- 1 - - 1 - - class Main { -
- 2 - - 2 - - - public static void main(String[] args) { -
- 3 - - 3 - - + public static void main(String[] arguments) { -
- 4 - - 4 - - System.out.println("Expect nothing more to happen."); -
- 5 - - 5 - - } -
-
-
-
-
-
- + + + + + - conflict.png - - - add - -
-
-
-
+ + + 1 + + + 1 + + + class Main { + + + + + 2 + + + 2 + + + - public static void main(String[] args) { + + + + + 3 + + + 3 + + + + public static void main(String[] arguments) { + + + + + 4 + + + 4 + + + System.out.println("Expect nothing more to happen."); + + + + + 5 + + + 5 + + + } + + + +
- - - - - - -
+
+
+ + conflict.png + + + add + +
+
+
+
+
+
+
+ + + + + + +
+
@@ -4160,570 +4164,578 @@ exports[`Storyshots Diff Collapsed 1`] = `
-
+
- - - src/main/java/com/cloudogu/scm/review/events/EventListener.java - - - modify - -
-
+ + + src/main/java/com/cloudogu/scm/review/events/EventListener.java + + + modify + +
+
- - - - - -
-
- + + + +
+
- - - - -
-
- + + + +
+
- - - - + + + + +
-
-
- - - src/main/js/ChangeNotification.tsx - - - modify - -
-
+ + + src/main/js/ChangeNotification.tsx + + + modify + +
+
- - - - - -
-
- + + + +
+
- - - - -
-
- + + + +
+
- - - - + + + + +
-
-
- - - src/main/resources/locales/de/plugins.json - - - modify - -
-
+ + + src/main/resources/locales/de/plugins.json + + + modify + +
+
- - - - - -
-
- + + + +
+
- - - - -
-
- + + + +
+
- - - - + + + + +
-
-
- - - src/main/resources/locales/en/plugins.json - - - modify - -
-
+ + + src/main/resources/locales/en/plugins.json + + + modify + +
+
- - - - - -
-
- + + + +
+
- - - - -
-
- + + + +
+
- - - - + + + + +
-
-
- - - src/test/java/com/cloudogu/scm/review/events/ClientTest.java - - - modify - -
-
+ + + src/test/java/com/cloudogu/scm/review/events/ClientTest.java + + + modify + +
+
- - - - - -
-
- + + + +
+
- - - - -
-
- + + + +
+
- - - - + + + + +
- -
- - - Main.java - - - modify - -
-
+ + + Main.java + + + modify + +
+
- - - - - -
-
- + + + +
+
- - - - -
-
- + + + +
+
- - - - + + + + +
@@ -4737,1883 +4749,1891 @@ exports[`Storyshots Diff CollapsingWithFunction 1`] = `
-
+
- - - src/main/java/com/cloudogu/scm/review/events/EventListener.java - - - modify - -
-
-
- - - - - -
-
-
-
-
-
-
-
-
-
- - - src/main/js/ChangeNotification.tsx - - - modify - -
-
-
-
- - - - - -
-
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - + +
-
- - - - - - - - - - - - - - - + + + + + + + + + + + +
+
+
-
- + + + + +
- 2 - - 2 - - import { Link } from "@scm-manager/ui-types"; -
- 3 - - 3 - - import { apiClient, Toast, ToastButtons, ToastButton } from "@scm-manager/ui-components"; -
- 4 - - 4 - - import { PullRequest } from "./types/PullRequest"; -
- - 5 - + - import { useTranslation } from "react-i18next"; -
- 5 - - 6 - - -
- 6 - - 7 - - type HandlerProps = { -
- 7 - - 8 - - url: string; -
+ + -
+ + modify + + +
+
+
+ + + + + +
+
+
+ + +
+ + + + + + + + + + + + + + + + + + + + + + + + - - - - + 5 + + + + + + + + + + + + + + + + + + + + - - - - - + + + + - - + + + + - 17 - - + + + + - }); - - - - + + + + - 17 - - + + + - 18 - - + + + + - }, [url]); - - - - + + + + - 19 - - + + + - const { t } = useTranslation("plugins"); - - - - + + + - 18 - - + + + - 20 - - + + + - if (event) { - - - - + + + - 19 - - + + + - 21 - - + + + + - return ( - - - - + + + - 20 - - + + + - <Toast type="warning" title="New Changes"> - - - - + + + - 21 - - + + + - <p>The underlying Pull-Request has changed. Press reload to see the changes.</p> - - - - + + + - 22 - - + + + - <p>Warning: Non saved modification will be lost.</p> - - - - + + + - 22 - - + + + - <Toast type="warning" title={t("scm-review-plugin.changeNotification.title")}> - - - - + + + + - 23 - - + + + + - <p>{t("scm-review-plugin.changeNotification.description")}</p> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+ 2 + + 2 + + import { Link } from "@scm-manager/ui-types"; +
+ 3 + + 3 + + import { apiClient, Toast, ToastButtons, ToastButton } from "@scm-manager/ui-components"; +
+ 4 + + 4 + + import { PullRequest } from "./types/PullRequest"; +
-
+ import { useTranslation } from "react-i18next"; +
+ 5 + + 6 + + +
+ 6 + + 7 + + type HandlerProps = { +
+ 7 + + 8 + + url: string; +
- 15 - - 16 - - pullRequest: setEvent -
+
+
- 16 - + 15 + + 16 + + pullRequest: setEvent +
+ 16 + + 17 + + }); +
+ 17 + + 18 + + }, [url]); +
+ + 19 + + const { t } = useTranslation("plugins"); +
+ 18 + + 20 + + if (event) { +
- + 19 + + 21 + + return ( +
+ 20 + + + <Toast type="warning" title="New Changes"> +
+ 21 + + + <p>The underlying Pull-Request has changed. Press reload to see the changes.</p> +
+ 22 + + + <p>Warning: Non saved modification will be lost.</p> +
+ + 22 + + <Toast type="warning" title={t("scm-review-plugin.changeNotification.title")}> +
+ + 23 + + <p>{t("scm-review-plugin.changeNotification.description")}</p> +
+ + 24 + + <p>{t("scm-review-plugin.changeNotification.modificationWarning")}</p> +
+ 23 + + 25 + + <ToastButtons> +
+ 24 + + + <ToastButton icon="redo" onClick={reload}>Reload</ToastButton> +
- + 25 + + + <ToastButton icon="times" onClick={() => setEvent(undefined)}>Ignore</ToastButton> +
+ + 26 + + <ToastButton icon="redo" onClick={reload}> +
- + + 27 + + {t("scm-review-plugin.changeNotification.buttons.reload")} +
+ + 28 + + </ToastButton> +
- + + 29 + + <ToastButton icon="times" onClick={() => setEvent(undefined)}> +
- + + 30 + + {t("scm-review-plugin.changeNotification.buttons.ignore")} +
+ + 31 + + </ToastButton> +
- + 26 + + 32 + + </ToastButtons> +
+ 27 + + 33 + + </Toast> +
- - 24 - - <p>{t("scm-review-plugin.changeNotification.modificationWarning")}</p> -
- 23 - - 25 - - <ToastButtons> -
- 24 - - - <ToastButton icon="redo" onClick={reload}>Reload</ToastButton> -
- 25 - - - <ToastButton icon="times" onClick={() => setEvent(undefined)}>Ignore</ToastButton> -
- - 26 - - <ToastButton icon="redo" onClick={reload}> -
- - 27 - - {t("scm-review-plugin.changeNotification.buttons.reload")} -
- - 28 - - </ToastButton> -
- - 29 - - <ToastButton icon="times" onClick={() => setEvent(undefined)}> -
- - 30 - - {t("scm-review-plugin.changeNotification.buttons.ignore")} -
- - 31 - - </ToastButton> -
- 26 - - 32 - - </ToastButtons> -
- 27 - - 33 - - </Toast> -
- 28 - - 34 - - ); -
+
+ 28 + + 34 + + ); +
+
-
-
- - - src/main/resources/locales/de/plugins.json - - - modify - -
-
+ + + src/main/resources/locales/de/plugins.json + + + modify + +
+
- - - - - + + + + +
-
-
- - - - - - - - + + + + + - - + + + + - 181 - - - - - - - + + + + + + + - - - + - 183 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- 181 - + 181 + + 181 + + "titleClickable": "Der Kommentar bezieht sich auf eine ältere Version des Source- oder Target-Branches. Klicken Sie hier, um den ursprünglichen Kontext zu sehen." +
- "titleClickable": "Der Kommentar bezieht sich auf eine ältere Version des Source- oder Target-Branches. Klicken Sie hier, um den ursprünglichen Kontext zu sehen." -
- 182 - - 182 - + 182 + + 182 + + } +
+ 183 + + 183 + } -
+
- 183 - - } -
- - 184 - - }, -
- - 185 - - "changeNotification": { -
- - 186 - - "title": "Neue Änderungen", -
- - 187 - - "description": "An diesem Pull Request wurden Änderungen vorgenommen. Laden Sie die Seite neu um diese anzuzeigen.", -
- - 188 - - "modificationWarning": "Warnung: Nicht gespeicherte Eingaben gehen verloren.", -
- - 189 - - "buttons": { -
- - 190 - - "reload": "Neu laden", -
- - 191 - - "ignore": "Ignorieren" -
- - 192 - - } -
- 184 - - 193 - - } -
- 185 - - 194 - - }, -
- 186 - - 195 - - "permissions": { -
-
-
-
-
-
-
- - - src/main/resources/locales/en/plugins.json - - - modify - -
-
-
-
- + - - - - -
-
-
-
-
-
- - - - - - - - - + + - 181 - - + + + - 181 - - + + + - "titleClickable": "The comment is related to an older of the source or target branch. Click here to see the original context." - - - - + + + - 182 - - + + + - 182 - - + + + + + + + + + + + + + - - - - - + + + + - - - - + + + + - - - + - 185 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+ + }, +
+ + 185 + + "changeNotification": { +
+ + 186 + + "title": "Neue Änderungen", +
+ + 187 + + "description": "An diesem Pull Request wurden Änderungen vorgenommen. Laden Sie die Seite neu um diese anzuzeigen.", +
+ + 188 + + "modificationWarning": "Warnung: Nicht gespeicherte Eingaben gehen verloren.", +
+ + 189 + + "buttons": { +
+ + 190 + + "reload": "Neu laden", +
+ + 191 + + "ignore": "Ignorieren" +
+ + 192 + } -
- 183 - - 183 - +
+ 184 + + 193 + } -
- - 184 - +
+ 185 + + 194 + }, -
- +
- "changeNotification": { -
- - 186 - - "title": "New Changes", -
- - 187 - - "description": "The underlying Pull-Request has changed. Press reload to see the changes.", -
- - 188 - - "modificationWarning": "Warning: Non saved modification will be lost.", -
- - 189 - - "buttons": { -
- - 190 - - "reload": "Reload", -
- - 191 - - "ignore": "Ignore" -
- - 192 - - } -
- 184 - - 193 - - } -
- 185 - - 194 - - }, -
- 186 - - 195 - - "permissions": { -
+ + 186 + + + 195 + + + "permissions": { + + + + +
-
-
- - - src/test/java/com/cloudogu/scm/review/events/ClientTest.java - - - modify - -
-
+ + + src/main/resources/locales/en/plugins.json + + + modify + +
+
- - - - - + + + + +
+
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ 181 + + 181 + + "titleClickable": "The comment is related to an older of the source or target branch. Click here to see the original context." +
+ 182 + + 182 + + } +
+ 183 + + 183 + + } +
+ + 184 + + }, +
+ + 185 + + "changeNotification": { +
+ + 186 + + "title": "New Changes", +
+ + 187 + + "description": "The underlying Pull-Request has changed. Press reload to see the changes.", +
+ + 188 + + "modificationWarning": "Warning: Non saved modification will be lost.", +
+ + 189 + + "buttons": { +
+ + 190 + + "reload": "Reload", +
+ + 191 + + "ignore": "Ignore" +
+ + 192 + + } +
+ 184 + + 193 + + } +
+ 185 + + 194 + + }, +
+ 186 + + 195 + + "permissions": { +
+
+
+
+
+
+
+ + + src/test/java/com/cloudogu/scm/review/events/ClientTest.java + + + modify + +
+
+
+
+ + + + + +
-
-
- - - Main.java - - - modify - -
-
+ + + Main.java + + + modify + +
+
- - - - - + + + + +
@@ -6627,3834 +6647,3842 @@ exports[`Storyshots Diff Default 1`] = `
-
+
- - - src/main/java/com/cloudogu/scm/review/events/EventListener.java - - - modify - -
-
+ + + src/main/java/com/cloudogu/scm/review/events/EventListener.java + + + modify + +
+
- - - - - + + + + +
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- 1 - - 1 - - package com.cloudogu.scm.review.events; -
- 2 - - 2 - - -
- 3 - - - import com.cloudogu.scm.review.comment.service.BasicComment; -
- 4 - - - import com.cloudogu.scm.review.comment.service.BasicCommentEvent; -
- 5 - - - import com.cloudogu.scm.review.comment.service.CommentEvent; -
- 6 - - - import com.cloudogu.scm.review.comment.service.ReplyEvent; -
- 7 - - 3 - - import com.cloudogu.scm.review.pullrequest.service.BasicPullRequestEvent; -
- 8 - - 4 - - import com.cloudogu.scm.review.pullrequest.service.PullRequest; -
- 9 - - - import com.cloudogu.scm.review.pullrequest.service.PullRequestEvent; -
- 10 - - 5 - - import com.github.legman.Subscribe; -
- 11 - - - import lombok.Data; -
- 12 - - 6 - - import org.apache.shiro.SecurityUtils; -
- 13 - - 7 - - import org.apache.shiro.subject.PrincipalCollection; -
- 14 - - 8 - - import org.apache.shiro.subject.Subject; -
- 15 - - 9 - - import sonia.scm.EagerSingleton; -
- 16 - - - import sonia.scm.HandlerEventType; -
- 17 - - - import sonia.scm.event.HandlerEvent; -
- 18 - - 10 - - import sonia.scm.plugin.Extension; -
- 19 - - 11 - - import sonia.scm.repository.Repository; -
- 20 - - 12 - - import sonia.scm.security.SessionId; -
-
-
-
-
-
- - - src/main/js/ChangeNotification.tsx - - - modify - -
-
-
-
- - - - - -
-
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + - - + + + + - 6 - - + + + + - - - - - - - - - - - - - - - - - + - - - - - + + - 15 - - + + + - 16 - - + + + - pullRequest: setEvent - - - - + + + - 16 - - + + + + - 17 - - + + + + - }); - - - - + + + - 17 - - + + + + - 18 - - + + + - }, [url]); - - - - + + + + - 19 - - + + + + - const { t } = useTranslation("plugins"); - - - - + + + + - 18 - - + + + + - 20 - - + + + - if (event) { - - - - + + + - 19 - - + + + + - 21 - - + + + + - return ( - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- 2 - - 2 - - import { Link } from "@scm-manager/ui-types"; -
- 3 - - 3 - - import { apiClient, Toast, ToastButtons, ToastButton } from "@scm-manager/ui-components"; -
- 4 - - 4 - - import { PullRequest } from "./types/PullRequest"; -
+
- 5 - - import { useTranslation } from "react-i18next"; -
- 5 - + 1 + + 1 + + package com.cloudogu.scm.review.events; +
+ 2 + + 2 + + +
- 6 - - 7 - - type HandlerProps = { -
- 7 - - 8 - - url: string; -
-
+ 3 +
-
+ import com.cloudogu.scm.review.comment.service.BasicComment; +
+ 4 + + + import com.cloudogu.scm.review.comment.service.BasicCommentEvent; +
+ 5 + + + import com.cloudogu.scm.review.comment.service.CommentEvent; +
+ 6 + + + import com.cloudogu.scm.review.comment.service.ReplyEvent; +
+ 7 + + 3 + + import com.cloudogu.scm.review.pullrequest.service.BasicPullRequestEvent; +
+ 8 + + 4 + + import com.cloudogu.scm.review.pullrequest.service.PullRequest; +
+ 9 + + + import com.cloudogu.scm.review.pullrequest.service.PullRequestEvent; +
+ 10 + + 5 + + import com.github.legman.Subscribe; +
+ 11 + + + import lombok.Data; +
- + 12 + + 6 + + import org.apache.shiro.SecurityUtils; +
+ 13 + + 7 + + import org.apache.shiro.subject.PrincipalCollection; +
+ 14 + + 8 + + import org.apache.shiro.subject.Subject; +
+ 15 + + 9 + + import sonia.scm.EagerSingleton; +
+ 16 + + + import sonia.scm.HandlerEventType; +
+ 17 + + + import sonia.scm.event.HandlerEvent; +
+ 18 + + 10 + + import sonia.scm.plugin.Extension; +
+ 19 + + 11 + + import sonia.scm.repository.Repository; +
- 20 - - - <Toast type="warning" title="New Changes"> -
- 21 - - - <p>The underlying Pull-Request has changed. Press reload to see the changes.</p> -
- 22 - - - <p>Warning: Non saved modification will be lost.</p> -
- - 22 - - <Toast type="warning" title={t("scm-review-plugin.changeNotification.title")}> -
- - 23 - - <p>{t("scm-review-plugin.changeNotification.description")}</p> -
- - 24 - - <p>{t("scm-review-plugin.changeNotification.modificationWarning")}</p> -
- 23 - - 25 - - <ToastButtons> -
- 24 - - - <ToastButton icon="redo" onClick={reload}>Reload</ToastButton> -
- 25 - - - <ToastButton icon="times" onClick={() => setEvent(undefined)}>Ignore</ToastButton> -
- - 26 - - <ToastButton icon="redo" onClick={reload}> -
- - 27 - - {t("scm-review-plugin.changeNotification.buttons.reload")} -
- - 28 - - </ToastButton> -
- - 29 - - <ToastButton icon="times" onClick={() => setEvent(undefined)}> -
- - 30 - - {t("scm-review-plugin.changeNotification.buttons.ignore")} -
- - 31 - - </ToastButton> -
- 26 - - 32 - - </ToastButtons> -
- 27 - - 33 - - </Toast> -
- 28 - - 34 - - ); -
+ + 20 + + + 12 + + + import sonia.scm.security.SessionId; + + + + +
-
-
- - - src/main/resources/locales/de/plugins.json - - - modify - -
-
+ + + src/main/js/ChangeNotification.tsx + + + modify + +
+
- - - - - + + + + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ 2 + + 2 + + import { Link } from "@scm-manager/ui-types"; +
+ 3 + + 3 + + import { apiClient, Toast, ToastButtons, ToastButton } from "@scm-manager/ui-components"; +
+ 4 + + 4 + + import { PullRequest } from "./types/PullRequest"; +
+ + 5 + + import { useTranslation } from "react-i18next"; +
+ 5 + + 6 + + +
+ 6 + + 7 + + type HandlerProps = { +
+ 7 + + 8 + + url: string; +
+
+
+ 15 + + 16 + + pullRequest: setEvent +
+ 16 + + 17 + + }); +
+ 17 + + 18 + + }, [url]); +
+ + 19 + + const { t } = useTranslation("plugins"); +
+ 18 + + 20 + + if (event) { +
+ 19 + + 21 + + return ( +
+ 20 + + + <Toast type="warning" title="New Changes"> +
+ 21 + + + <p>The underlying Pull-Request has changed. Press reload to see the changes.</p> +
+ 22 + + + <p>Warning: Non saved modification will be lost.</p> +
+ + 22 + + <Toast type="warning" title={t("scm-review-plugin.changeNotification.title")}> +
+ + 23 + + <p>{t("scm-review-plugin.changeNotification.description")}</p> +
+ + 24 + + <p>{t("scm-review-plugin.changeNotification.modificationWarning")}</p> +
+ 23 + + 25 + + <ToastButtons> +
+ 24 + + + <ToastButton icon="redo" onClick={reload}>Reload</ToastButton> +
+ 25 + + + <ToastButton icon="times" onClick={() => setEvent(undefined)}>Ignore</ToastButton> +
+ + 26 + + <ToastButton icon="redo" onClick={reload}> +
+ + 27 + + {t("scm-review-plugin.changeNotification.buttons.reload")} +
+ + 28 + + </ToastButton> +
+ + 29 + + <ToastButton icon="times" onClick={() => setEvent(undefined)}> +
+ + 30 + + {t("scm-review-plugin.changeNotification.buttons.ignore")} +
+ + 31 + + </ToastButton> +
+ 26 + + 32 + + </ToastButtons> +
+ 27 + + 33 + + </Toast> +
+ 28 + + 34 + + ); +
+
- - - - - - - - - - - - - + +
-
- + + + + +
+ - 181 - + - 181 - - "titleClickable": "Der Kommentar bezieht sich auf eine ältere Version des Source- oder Target-Branches. Klicken Sie hier, um den ursprünglichen Kontext zu sehen." -
- 182 - + + + + + + + + + + +
+ + + + + + + + - 182 - - + + + + + + + + + + + + - - - + - 183 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+ 181 + + 181 + + "titleClickable": "Der Kommentar bezieht sich auf eine ältere Version des Source- oder Target-Branches. Klicken Sie hier, um den ursprünglichen Kontext zu sehen." +
+ 182 + + 182 + + } +
+ 183 + + 183 + } -
+
- 183 - - } -
- - 184 - - }, -
- - 185 - - "changeNotification": { -
- - 186 - - "title": "Neue Änderungen", -
- - 187 - - "description": "An diesem Pull Request wurden Änderungen vorgenommen. Laden Sie die Seite neu um diese anzuzeigen.", -
- - 188 - - "modificationWarning": "Warnung: Nicht gespeicherte Eingaben gehen verloren.", -
- - 189 - - "buttons": { -
- - 190 - - "reload": "Neu laden", -
- - 191 - - "ignore": "Ignorieren" -
- - 192 - - } -
- 184 - - 193 - - } -
- 185 - - 194 - - }, -
- 186 - - 195 - - "permissions": { -
-
- -
-
-
-
- - - src/main/resources/locales/en/plugins.json - - - modify - -
-
-
-
- +
- - - - - - - - - -
- - - - - - - - - + + - 181 - - + + + - 181 - - + + + - "titleClickable": "The comment is related to an older of the source or target branch. Click here to see the original context." - - - - + + + - 182 - - + + + - 182 - - + + + + + + + + + + + + + - - - - - + + + + - - - - + + + + - - - + - 185 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+ + }, +
+ + 185 + + "changeNotification": { +
+ + 186 + + "title": "Neue Änderungen", +
+ + 187 + + "description": "An diesem Pull Request wurden Änderungen vorgenommen. Laden Sie die Seite neu um diese anzuzeigen.", +
+ + 188 + + "modificationWarning": "Warnung: Nicht gespeicherte Eingaben gehen verloren.", +
+ + 189 + + "buttons": { +
+ + 190 + + "reload": "Neu laden", +
+ + 191 + + "ignore": "Ignorieren" +
+ + 192 + } -
- 183 - - 183 - +
+ 184 + + 193 + } -
- - 184 - +
+ 185 + + 194 + }, -
- +
- "changeNotification": { -
- - 186 - - "title": "New Changes", -
- - 187 - - "description": "The underlying Pull-Request has changed. Press reload to see the changes.", -
- - 188 - - "modificationWarning": "Warning: Non saved modification will be lost.", -
- - 189 - - "buttons": { -
- - 190 - - "reload": "Reload", -
- - 191 - - "ignore": "Ignore" -
- - 192 - - } -
- 184 - - 193 - - } -
- 185 - - 194 - - }, -
- 186 - - 195 - - "permissions": { -
+
+ 186 + + 195 + + "permissions": { +
+
-
-
- - - src/test/java/com/cloudogu/scm/review/events/ClientTest.java - - - modify - -
-
+ + + src/main/resources/locales/en/plugins.json + + + modify + +
+
- - - - - + + + + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ 181 + + 181 + + "titleClickable": "The comment is related to an older of the source or target branch. Click here to see the original context." +
+ 182 + + 182 + + } +
+ 183 + + 183 + + } +
+ + 184 + + }, +
+ + 185 + + "changeNotification": { +
+ + 186 + + "title": "New Changes", +
+ + 187 + + "description": "The underlying Pull-Request has changed. Press reload to see the changes.", +
+ + 188 + + "modificationWarning": "Warning: Non saved modification will be lost.", +
+ + 189 + + "buttons": { +
+ + 190 + + "reload": "Reload", +
+ + 191 + + "ignore": "Ignore" +
+ + 192 + + } +
+ 184 + + 193 + + } +
+ 185 + + 194 + + }, +
+ 186 + + 195 + + "permissions": { +
+
- - - - - - - - - - - - - - - - - - - - - - - - - - - + +
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + +
+
- 7 - - 7 - - import org.mockito.Mock; -
- 8 - - 8 - - import org.mockito.junit.jupiter.MockitoExtension; -
- 9 - - 9 - - import sonia.scm.security.SessionId; -
- - 10 - + - -
- 10 - - 11 - - import javax.ws.rs.sse.OutboundSseEvent; -
- 11 - - 12 - - import javax.ws.rs.sse.SseEventSink; -
- 12 - - - -
- 13 - - 13 - - import java.time.Clock; -
- 14 - - 14 - - import java.time.Instant; -
- 15 - - 15 - - import java.time.LocalDateTime; -
- 16 - - 16 - - import java.time.ZoneOffset; -
- 17 - - 17 - - import java.time.temporal.ChronoField; -
- 18 - - - import java.time.temporal.ChronoUnit; -
- 19 - - - import java.time.temporal.TemporalField; -
- 20 - - 18 - - import java.util.concurrent.CompletableFuture; -
- 21 - - 19 - - import java.util.concurrent.CompletionStage; -
- 22 - - - import java.util.concurrent.atomic.AtomicLong; -
- 23 - - 20 - - import java.util.concurrent.atomic.AtomicReference; -
- 24 - - 21 - - -
- 25 - - 22 - - import static java.time.temporal.ChronoUnit.MINUTES; -
- - + + + + + -
+ 7 + +
+ + + + + + + + + + + + + + - - - - - + + + - 83 - - + + + + - 80 - - + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ 7 + + import org.mockito.Mock; +
+ 8 + + 8 + + import org.mockito.junit.jupiter.MockitoExtension; +
+ 9 + + 9 + + import sonia.scm.security.SessionId; +
-
+ 10 + + +
+ 10 + + 11 + + import javax.ws.rs.sse.OutboundSseEvent; +
+ 11 + + 12 + + import javax.ws.rs.sse.SseEventSink; +
- 84 - - 81 - - @Test -
- 85 - - 82 - - @SuppressWarnings("unchecked") -
- 86 - - - void shouldCloseEventSinkOnFailure() throws InterruptedException { -
- - 83 - - void shouldCloseEventSinkOnFailure() { -
- 87 - - 84 - - CompletionStage future = CompletableFuture.supplyAsync(() -> { -
- 88 - - 85 - - throw new RuntimeException("failed to send message"); -
- 89 - - 86 - - }); -
-
+ 12 +
-
+ 13 + + 13 + + import java.time.Clock; +
+ 14 + + 14 + + import java.time.Instant; +
+ 15 + + 15 + + import java.time.LocalDateTime; +
+ 16 + + 16 + + import java.time.ZoneOffset; +
+ 17 + + 17 + + import java.time.temporal.ChronoField; +
+ 18 + + + import java.time.temporal.ChronoUnit; +
+ 19 + + + import java.time.temporal.TemporalField; +
+ 20 + + 18 + + import java.util.concurrent.CompletableFuture; +
+ 21 + + 19 + + import java.util.concurrent.CompletionStage; +
+ 22 + + + import java.util.concurrent.atomic.AtomicLong; +
+ 23 + + 20 + + import java.util.concurrent.atomic.AtomicReference; +
+ 24 + + 21 + + +
+ 25 + + 22 + + import static java.time.temporal.ChronoUnit.MINUTES; +
+
+
+ 83 + + 80 + + +
+ 84 + + 81 + + @Test +
+ 85 + + 82 + + @SuppressWarnings("unchecked") +
+ 86 + + + void shouldCloseEventSinkOnFailure() throws InterruptedException { +
+ + 83 + + void shouldCloseEventSinkOnFailure() { +
+ 87 + + 84 + + CompletionStage future = CompletableFuture.supplyAsync(() -> { +
+ 88 + + 85 + + throw new RuntimeException("failed to send message"); +
+ 89 + + 86 + + }); +
+
+
+ 91 + + 88 + + +
+ 92 + + 89 + + client.send(message); +
+ 93 + + 90 + + +
+ 94 + + + Thread.sleep(50L); +
+ 95 + + + +
+ 96 + + + verify(eventSink).close(); +
+ + 91 + + verify(eventSink, timeout(50L)).close(); +
+ 97 + + 92 + + } +
+ 98 + + 93 + + +
+ 99 + + 94 + + @Test +
+
+ +
+
+
- - - 91 - - - 88 - - - - - - - - 92 - - - 89 - - - client.send(message); - - - - - 93 - - - 90 - - - - - - - - 94 - - - - Thread.sleep(50L); - - - + + modify + +
+
- - 95 - - + + + + + +
+
+
+ + +
+ + + - - - - - - - + + - - + + + - verify(eventSink, timeout(50L)).close(); - - - - + + + + - 97 - - + + + + - 92 - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - -
- -
- 96 - - - verify(eventSink).close(); -
- - 91 - + + 1 + + import java.io.PrintStream; +
+ 1 + + 2 + + import java.util.Arrays; +
+ 2 + + 3 + + +
+ 3 + + 4 + + class Main { +
+ + 5 + + private static final PrintStream OUT = System.out; +
+ + 6 + + +
+ 4 + + 7 + + public static void main(String[] args) { +
+ + 8 + + <<<<<<< HEAD +
+ 5 + + 9 + + System.out.println("Expect nothing more to happen."); +
+ 6 + + 10 + + System.out.println("The command line parameters are:"); +
+ 7 + + 11 + + Arrays.stream(args).map(arg -> "- " + arg).forEach(System.out::println); +
+ + 12 + + ======= +
+ + 13 + + OUT.println("Expect nothing more to happen."); +
+ + 14 + + OUT.println("Parameters:"); +
+ + 15 + + Arrays.stream(args).map(arg -> "- " + arg).forEach(OUT::println); +
+ + 16 + + >>>>>>> feature/use_constant +
+ 8 + + 17 + + } +
+ 9 + + 18 + } -
- 98 - - 93 - - -
- 99 - - 94 - - @Test -
-
- -
-
-
-
- - - Main.java - - - modify - -
-
-
-
- - - - - -
-
-
+ + + +
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - 1 - - import java.io.PrintStream; -
- 1 - - 2 - - import java.util.Arrays; -
- 2 - - 3 - - -
- 3 - - 4 - - class Main { -
- - 5 - - private static final PrintStream OUT = System.out; -
- - 6 - - -
- 4 - - 7 - - public static void main(String[] args) { -
- - 8 - - <<<<<<< HEAD -
- 5 - - 9 - - System.out.println("Expect nothing more to happen."); -
- 6 - - 10 - - System.out.println("The command line parameters are:"); -
- 7 - - 11 - - Arrays.stream(args).map(arg -> "- " + arg).forEach(System.out::println); -
- - 12 - - ======= -
- - 13 - - OUT.println("Expect nothing more to happen."); -
- - 14 - - OUT.println("Parameters:"); -
- - 15 - - Arrays.stream(args).map(arg -> "- " + arg).forEach(OUT::println); -
- - 16 - - >>>>>>> feature/use_constant -
- 8 - - 17 - - } -
- 9 - - 18 - - } -
-
`; @@ -10463,4304 +10491,4312 @@ exports[`Storyshots Diff Expandable 1`] = `
-
+
- - - src/main/java/com/cloudogu/scm/review/events/EventListener.java - - - modify - -
-
+ + + src/main/java/com/cloudogu/scm/review/events/EventListener.java + + + modify + +
+
- - - - - + + + + +
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - -
- 1 - - 1 - - package com.cloudogu.scm.review.events; -
- 2 - - 2 - - -
- 3 - +
- import com.cloudogu.scm.review.comment.service.BasicComment; -
- 4 - - - import com.cloudogu.scm.review.comment.service.BasicCommentEvent; -
- 5 - - - import com.cloudogu.scm.review.comment.service.CommentEvent; -
- 6 - - - import com.cloudogu.scm.review.comment.service.ReplyEvent; -
- 7 - - 3 - - import com.cloudogu.scm.review.pullrequest.service.BasicPullRequestEvent; -
- 8 - - 4 - - import com.cloudogu.scm.review.pullrequest.service.PullRequest; -
- 9 - - - import com.cloudogu.scm.review.pullrequest.service.PullRequestEvent; -
- 10 - - 5 - - import com.github.legman.Subscribe; -
- 11 - - - import lombok.Data; -
- 12 - - 6 - - import org.apache.shiro.SecurityUtils; -
- 13 - - 7 - - import org.apache.shiro.subject.PrincipalCollection; -
- 14 - - 8 - - import org.apache.shiro.subject.Subject; -
- 15 - - 9 - - import sonia.scm.EagerSingleton; -
- 16 - - - import sonia.scm.HandlerEventType; -
- 17 - - - import sonia.scm.event.HandlerEvent; -
- 18 - - 10 - - import sonia.scm.plugin.Extension; -
- 19 - - 11 - - import sonia.scm.repository.Repository; -
- 20 - - 12 - - import sonia.scm.security.SessionId; -
-
+ 1 +
+ 1 + + package com.cloudogu.scm.review.events; +
+ 2 + + 2 + - - - - diff.expandLastBottomByLines - - +
+ 3 + + + import com.cloudogu.scm.review.comment.service.BasicComment; +
+ 4 + + + import com.cloudogu.scm.review.comment.service.BasicCommentEvent; +
+ 5 + + + import com.cloudogu.scm.review.comment.service.CommentEvent; +
+ 6 + + + import com.cloudogu.scm.review.comment.service.ReplyEvent; +
+ 7 + + 3 + + import com.cloudogu.scm.review.pullrequest.service.BasicPullRequestEvent; +
+ 8 + + 4 + + import com.cloudogu.scm.review.pullrequest.service.PullRequest; +
+ 9 + + + import com.cloudogu.scm.review.pullrequest.service.PullRequestEvent; +
+ 10 + + 5 + + import com.github.legman.Subscribe; +
+ 11 + + + import lombok.Data; +
+ 12 + + 6 + + import org.apache.shiro.SecurityUtils; +
+ 13 + + 7 + + import org.apache.shiro.subject.PrincipalCollection; +
+ 14 + + 8 + + import org.apache.shiro.subject.Subject; +
+ 15 + + 9 + + import sonia.scm.EagerSingleton; +
+ 16 + + + import sonia.scm.HandlerEventType; +
+ 17 + + + import sonia.scm.event.HandlerEvent; +
+ 18 + + 10 + + import sonia.scm.plugin.Extension; +
+ 19 + + 11 + + import sonia.scm.repository.Repository; +
+ 20 + + 12 + + import sonia.scm.security.SessionId; +
+
- + + + + diff.expandLastBottomByLines + - diff.expandLastBottomComplete - -
-
+ + + + diff.expandLastBottomComplete + +
+ + + + +
- -
- - - src/main/js/ChangeNotification.tsx - - - modify - -
-
+ + + src/main/js/ChangeNotification.tsx + + + modify + +
+
- - - - - + + + + +
-
-
- - - - - - - - - + + + + + + - - - - + + + diff.expandComplete + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - -
-
+
- - - - diff.expandComplete - - -
- 2 - - 2 - - import { Link } from "@scm-manager/ui-types"; -
- 3 - - 3 - - import { apiClient, Toast, ToastButtons, ToastButton } from "@scm-manager/ui-components"; -
- 4 - - 4 - - import { PullRequest } from "./types/PullRequest"; -
- - 5 - - import { useTranslation } from "react-i18next"; -
- 5 - - 6 - - -
- 6 - - 7 - - type HandlerProps = { -
- 7 - - 8 - - url: string; -
-
- - - - diff.expandComplete - -
-
-
+
- - - - diff.expandComplete - - -
- 15 - - 16 - - pullRequest: setEvent -
- 16 - - 17 - - }); -
- 17 - - 18 - - }, [url]); -
- - 19 - - const { t } = useTranslation("plugins"); -
- 18 - - 20 - - if (event) { -
- 19 - - 21 - - return ( -
- 20 - - - <Toast type="warning" title="New Changes"> -
- 21 - - - <p>The underlying Pull-Request has changed. Press reload to see the changes.</p> -
- 22 - - - <p>Warning: Non saved modification will be lost.</p> -
- - 22 - - <Toast type="warning" title={t("scm-review-plugin.changeNotification.title")}> -
- - 23 - - <p>{t("scm-review-plugin.changeNotification.description")}</p> -
- - 24 - - <p>{t("scm-review-plugin.changeNotification.modificationWarning")}</p> -
- 23 - - 25 - - <ToastButtons> -
- 24 - - - <ToastButton icon="redo" onClick={reload}>Reload</ToastButton> -
- 25 - - - <ToastButton icon="times" onClick={() => setEvent(undefined)}>Ignore</ToastButton> -
- - 26 - - <ToastButton icon="redo" onClick={reload}> -
- - 27 - - {t("scm-review-plugin.changeNotification.buttons.reload")} -
- - 28 - - </ToastButton> -
- - 29 - - <ToastButton icon="times" onClick={() => setEvent(undefined)}> -
- - 30 - - {t("scm-review-plugin.changeNotification.buttons.ignore")} -
- - 31 - - </ToastButton> -
- 26 - - 32 - - </ToastButtons> -
- 27 - - 33 - - </Toast> -
- 28 - - 34 - - ); -
-
+
+ import { Link } from "@scm-manager/ui-types"; +
+ 3 + + 3 + + import { apiClient, Toast, ToastButtons, ToastButton } from "@scm-manager/ui-components"; +
+ 4 + + 4 + + import { PullRequest } from "./types/PullRequest"; +
+ + 5 + + import { useTranslation } from "react-i18next"; +
+ 5 + + 6 + - - - - diff.expandLastBottomByLines - - +
+ 6 + + 7 + + type HandlerProps = { +
+ 7 + + 8 + + url: string; +
+
- + + + + diff.expandComplete + +
+
+
+ + + + diff.expandComplete + +
+
+ 15 + + 16 + + pullRequest: setEvent +
+ 16 + + 17 + + }); +
+ 17 + + 18 + + }, [url]); +
+ + 19 + + const { t } = useTranslation("plugins"); +
+ 18 + + 20 + + if (event) { +
+ 19 + + 21 + + return ( +
+ 20 + + + <Toast type="warning" title="New Changes"> +
+ 21 + + + <p>The underlying Pull-Request has changed. Press reload to see the changes.</p> +
+ 22 + + + <p>Warning: Non saved modification will be lost.</p> +
+ + 22 + + <Toast type="warning" title={t("scm-review-plugin.changeNotification.title")}> +
+ + 23 + + <p>{t("scm-review-plugin.changeNotification.description")}</p> +
+ + 24 + + <p>{t("scm-review-plugin.changeNotification.modificationWarning")}</p> +
+ 23 + + 25 + + <ToastButtons> +
+ 24 + + + <ToastButton icon="redo" onClick={reload}>Reload</ToastButton> +
+ 25 + + + <ToastButton icon="times" onClick={() => setEvent(undefined)}>Ignore</ToastButton> +
+ + 26 + + <ToastButton icon="redo" onClick={reload}> +
+ + 27 + + {t("scm-review-plugin.changeNotification.buttons.reload")} +
+ + 28 + + </ToastButton> +
+ + 29 + + <ToastButton icon="times" onClick={() => setEvent(undefined)}> +
+ + 30 + + {t("scm-review-plugin.changeNotification.buttons.ignore")} +
+ + 31 + + </ToastButton> +
+ 26 + + 32 + + </ToastButtons> +
+ 27 + + 33 + + </Toast> +
+ 28 + + 34 + + ); +
+
+ + + + diff.expandLastBottomByLines + - diff.expandLastBottomComplete - -
-
+ + + + diff.expandLastBottomComplete + +
+ + + + + - -
- - - src/main/resources/locales/de/plugins.json - - - modify - -
-
+ + + src/main/resources/locales/de/plugins.json + + + modify + +
+
- - - - - + + + + +
-
-
- - - - - - - - - + + + + + + - - - - + + + diff.expandComplete + + + + + + - - + + + + - 181 - - - - - - - + + + + + + + - - - + - 183 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
+
- - + + + + diff.expandByLines + - diff.expandByLines - - - - - - diff.expandComplete - - -
- 181 - + 181 + + 181 + + "titleClickable": "Der Kommentar bezieht sich auf eine ältere Version des Source- oder Target-Branches. Klicken Sie hier, um den ursprünglichen Kontext zu sehen." +
- "titleClickable": "Der Kommentar bezieht sich auf eine ältere Version des Source- oder Target-Branches. Klicken Sie hier, um den ursprünglichen Kontext zu sehen." -
- 182 - - 182 - + 182 + + 182 + + } +
+ 183 + + 183 + } -
+
- 183 - - } -
- - 184 - - }, -
- - 185 - - "changeNotification": { -
- - 186 - - "title": "Neue Änderungen", -
- - 187 - - "description": "An diesem Pull Request wurden Änderungen vorgenommen. Laden Sie die Seite neu um diese anzuzeigen.", -
- - 188 - - "modificationWarning": "Warnung: Nicht gespeicherte Eingaben gehen verloren.", -
- - 189 - - "buttons": { -
- - 190 - - "reload": "Neu laden", -
- - 191 - - "ignore": "Ignorieren" -
- - 192 - - } -
- 184 - - 193 - - } -
- 185 - - 194 - - }, -
- 186 - - 195 - - "permissions": { -
-
+
- - - - diff.expandLastBottomByLines - - - - - - diff.expandLastBottomComplete - - -
-
- -
-
-
-
- - - src/main/resources/locales/en/plugins.json - - - modify - -
-
-
-
- + - - - - -
-
-
-
-
-
- - - - - - - - - + -
+
- - - - - + + - 181 - - + + + - 181 - - + + + - "titleClickable": "The comment is related to an older of the source or target branch. Click here to see the original context." - - - - + + + - 182 - - + + + - 182 - - + + + + + + + + + - - - + - 183 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + - - -
+
- - - - diff.expandByLines - - - - - - diff.expandComplete - - -
+ + "changeNotification": { +
+ + 186 + + "title": "Neue Änderungen", +
+ + 187 + + "description": "An diesem Pull Request wurden Änderungen vorgenommen. Laden Sie die Seite neu um diese anzuzeigen.", +
+ + 188 + + "modificationWarning": "Warnung: Nicht gespeicherte Eingaben gehen verloren.", +
+ + 189 + + "buttons": { +
+ + 190 + + "reload": "Neu laden", +
+ + 191 + + "ignore": "Ignorieren" +
+ + 192 + } -
+
- 183 - - } -
- - 184 - - }, -
- - 185 - - "changeNotification": { -
- - 186 - - "title": "New Changes", -
- - 187 - - "description": "The underlying Pull-Request has changed. Press reload to see the changes.", -
- - 188 - - "modificationWarning": "Warning: Non saved modification will be lost.", -
- - 189 - - "buttons": { -
- - 190 - - "reload": "Reload", -
- - 191 - - "ignore": "Ignore" -
- - 192 - - } -
- 184 - - 193 - - } -
- 185 - - 194 - - }, -
- 186 - - 195 - - "permissions": { -
-
- +
+ 193 + + } +
+ 185 + + 194 + + }, +
+ 186 + + 195 + + "permissions": { +
+
- + + + + diff.expandLastBottomByLines + - diff.expandLastBottomByLines - - - - - - diff.expandLastBottomComplete - -
-
+ + + + diff.expandLastBottomComplete + +
+ + + + +
- -
- - - src/test/java/com/cloudogu/scm/review/events/ClientTest.java - - - modify - -
-
+ + + src/main/resources/locales/en/plugins.json + + + modify + +
+
- - - - - + + + + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + diff.expandByLines + + + + + + diff.expandComplete + +
+
+ 181 + + 181 + + "titleClickable": "The comment is related to an older of the source or target branch. Click here to see the original context." +
+ 182 + + 182 + + } +
+ 183 + + 183 + + } +
+ + 184 + + }, +
+ + 185 + + "changeNotification": { +
+ + 186 + + "title": "New Changes", +
+ + 187 + + "description": "The underlying Pull-Request has changed. Press reload to see the changes.", +
+ + 188 + + "modificationWarning": "Warning: Non saved modification will be lost.", +
+ + 189 + + "buttons": { +
+ + 190 + + "reload": "Reload", +
+ + 191 + + "ignore": "Ignore" +
+ + 192 + + } +
+ 184 + + 193 + + } +
+ 185 + + 194 + + }, +
+ 186 + + 195 + + "permissions": { +
+
+ + + + diff.expandLastBottomByLines + + + + + + diff.expandLastBottomComplete + +
+
+
- - - - - - - - - - - - + + + +
+
+ + + src/test/java/com/cloudogu/scm/review/events/ClientTest.java + + + modify + + +
+
- - - diff.expandComplete + + +
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + - - - - - + -
+ 10 + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - + + + diff.expandComplete + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
- 7 - - 7 - - import org.mockito.Mock; -
- 8 - - 8 - - import org.mockito.junit.jupiter.MockitoExtension; -
- 9 - - 9 - - import sonia.scm.security.SessionId; -
+
- 10 - - -
- 10 - - 11 - - import javax.ws.rs.sse.OutboundSseEvent; -
- 11 - - 12 - - import javax.ws.rs.sse.SseEventSink; -
- 12 - - - -
- 13 - - 13 - - import java.time.Clock; -
- 14 - - 14 - - import java.time.Instant; -
- 15 - - 15 - - import java.time.LocalDateTime; -
- 16 - - 16 - - import java.time.ZoneOffset; -
- 17 - - 17 - - import java.time.temporal.ChronoField; -
- 18 - - - import java.time.temporal.ChronoUnit; -
- 19 - - - import java.time.temporal.TemporalField; -
- 20 - - 18 - - import java.util.concurrent.CompletableFuture; -
- 21 - - 19 - - import java.util.concurrent.CompletionStage; -
- 22 - - - import java.util.concurrent.atomic.AtomicLong; -
- 23 - - 20 - - import java.util.concurrent.atomic.AtomicReference; -
- 24 - - 21 - - -
- 25 - - 22 - - import static java.time.temporal.ChronoUnit.MINUTES; -
-
+
- - - - diff.expandByLines - + + + + diff.expandComplete + + +
+ 7 + + 7 + + import org.mockito.Mock; +
+ 8 + + 8 + + import org.mockito.junit.jupiter.MockitoExtension; +
+ 9 + + 9 + + import sonia.scm.security.SessionId; +
+ + 10 + - - - - diff.expandComplete - - -
+
+ 11 + + import javax.ws.rs.sse.OutboundSseEvent; +
+ 11 + + 12 + + import javax.ws.rs.sse.SseEventSink; +
+ 12 + + - - - - diff.expandByLines - - +
+ 13 + + 13 + + import java.time.Clock; +
+ 14 + + 14 + + import java.time.Instant; +
+ 15 + + 15 + + import java.time.LocalDateTime; +
+ 16 + + 16 + + import java.time.ZoneOffset; +
+ 17 + + 17 + + import java.time.temporal.ChronoField; +
+ 18 + + + import java.time.temporal.ChronoUnit; +
+ 19 + + + import java.time.temporal.TemporalField; +
+ 20 + + 18 + + import java.util.concurrent.CompletableFuture; +
+ 21 + + 19 + + import java.util.concurrent.CompletionStage; +
+ 22 + + + import java.util.concurrent.atomic.AtomicLong; +
+ 23 + + 20 + + import java.util.concurrent.atomic.AtomicReference; +
+ 24 + + 21 + + +
+ 25 + + 22 + + import static java.time.temporal.ChronoUnit.MINUTES; +
+
- + + + + diff.expandByLines + - diff.expandComplete - -
-
+
+ + + + diff.expandByLines + + + + + + diff.expandComplete + +
+
+ 83 + + 80 + + +
+ 84 + + 81 + + @Test +
+ 85 + + 82 + + @SuppressWarnings("unchecked") +
+ 86 + + + void shouldCloseEventSinkOnFailure() throws InterruptedException { +
+ + 83 + + void shouldCloseEventSinkOnFailure() { +
+ 87 + + 84 + + CompletionStage future = CompletableFuture.supplyAsync(() -> { +
+ 88 + + 85 + + throw new RuntimeException("failed to send message"); +
+ 89 + + 86 + + }); +
+
+ + + + diff.expandComplete + +
+
+
+ + + + diff.expandComplete + +
+
+ 91 + + 88 + + +
+ 92 + + 89 + + client.send(message); +
+ 93 + + 90 + + +
+ 94 + + + Thread.sleep(50L); +
+ 95 + + + +
+ 96 + + + verify(eventSink).close(); +
+ + 91 + + verify(eventSink, timeout(50L)).close(); +
+ 97 + + 92 + + } +
+ 98 + + 93 + + +
+ 99 + + 94 + + @Test +
+
+ + + + diff.expandLastBottomByLines + + + + + + diff.expandLastBottomComplete + +
+
+
+ +
+
+
- - - 83 - - - 80 - - - - - - - - 84 - - - 81 - - - @Test - - - - - 85 - - - 82 - - - @SuppressWarnings("unchecked") - - - - - 86 - - - - void shouldCloseEventSinkOnFailure() throws InterruptedException { - - - + + modify + +
+
- - - 83 - - - void shouldCloseEventSinkOnFailure() { - - - - - 87 - - - 84 - - - CompletionStage future = CompletableFuture.supplyAsync(() -> { - - - - - 88 - - - 85 - - - throw new RuntimeException("failed to send message"); - - - - - 89 - - - 86 - - - }); - - - - - -
- - - diff.expandComplete + + +
- - - - +
+
+
+
+ - - + + + + + + -
+
- - - - - + + - 91 - - + + + + - 88 - - + + + + - - - - - + + + + - 92 - - + + + - 89 - - + + + - client.send(message); - - - - + + + + - 93 - - + + + - 90 - - + + + + - - - - - + + + + - 94 - - + + + + - Thread.sleep(50L); - - - - + + + - 95 - - + + + - - - - - + + + - 96 - - + + + - verify(eventSink).close(); - - - - + + + - 91 - - - - - - - + + + + + + + - - + + + - - - - - - - - - - - - - - - -
+
- - - - diff.expandComplete - - -
+ + import java.io.PrintStream; +
+ 1 + + 2 + + import java.util.Arrays; +
+ 2 + + 3 + + +
+ 3 + + 4 + + class Main { +
+ + 5 + + private static final PrintStream OUT = System.out; +
+ + 6 + + +
+ 4 + + 7 + + public static void main(String[] args) { +
+ + 8 + + <<<<<<< HEAD +
+ 5 + + 9 + + System.out.println("Expect nothing more to happen."); +
+ 6 + + 10 + + System.out.println("The command line parameters are:"); +
- + 7 + + 11 + + Arrays.stream(args).map(arg -> "- " + arg).forEach(System.out::println); +
+ + 12 + + ======= +
- + + 13 + + OUT.println("Expect nothing more to happen."); +
+ + 14 + + OUT.println("Parameters:"); +
- + + 15 + + Arrays.stream(args).map(arg -> "- " + arg).forEach(OUT::println); +
- + + 16 + + >>>>>>> feature/use_constant +
- verify(eventSink, timeout(50L)).close(); -
- 97 - - 92 - + 8 + + 17 + + } +
+ 9 + + 18 + } -
- 98 - - 93 - - -
- 99 - - 94 - - @Test -
-
+
- - + + + + diff.expandLastBottomByLines + - diff.expandLastBottomByLines - - - - - - diff.expandLastBottomComplete - - -
-
- -
-
-
-
- - - Main.java - - - modify - -
-
-
-
- - - - - -
-
-
+ + + + diff.expandLastBottomComplete + +
+ + + +
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - 1 - - import java.io.PrintStream; -
- 1 - - 2 - - import java.util.Arrays; -
- 2 - - 3 - - -
- 3 - - 4 - - class Main { -
- - 5 - - private static final PrintStream OUT = System.out; -
- - 6 - - -
- 4 - - 7 - - public static void main(String[] args) { -
- - 8 - - <<<<<<< HEAD -
- 5 - - 9 - - System.out.println("Expect nothing more to happen."); -
- 6 - - 10 - - System.out.println("The command line parameters are:"); -
- 7 - - 11 - - Arrays.stream(args).map(arg -> "- " + arg).forEach(System.out::println); -
- - 12 - - ======= -
- - 13 - - OUT.println("Expect nothing more to happen."); -
- - 14 - - OUT.println("Parameters:"); -
- - 15 - - Arrays.stream(args).map(arg -> "- " + arg).forEach(OUT::println); -
- - 16 - - >>>>>>> feature/use_constant -
- 8 - - 17 - - } -
- 9 - - 18 - - } -
-
- - - - diff.expandLastBottomByLines - - - - - - diff.expandLastBottomComplete - -
-
-
`; @@ -14769,3858 +14805,3866 @@ exports[`Storyshots Diff File Annotation 1`] = `
-
+
- - - src/main/java/com/cloudogu/scm/review/events/EventListener.java - - - modify - -
-
+ + + src/main/java/com/cloudogu/scm/review/events/EventListener.java + + + modify + +
+
- - - - - + + + + +
-
-
-

- Custom File annotation for - src/main/java/com/cloudogu/scm/review/events/EventListener.java -

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- 1 - - 1 - - package com.cloudogu.scm.review.events; -
- 2 - - 2 - - -
- 3 - - - import com.cloudogu.scm.review.comment.service.BasicComment; -
- 4 - - - import com.cloudogu.scm.review.comment.service.BasicCommentEvent; -
- 5 - - - import com.cloudogu.scm.review.comment.service.CommentEvent; -
- 6 - - - import com.cloudogu.scm.review.comment.service.ReplyEvent; -
- 7 - - 3 - - import com.cloudogu.scm.review.pullrequest.service.BasicPullRequestEvent; -
- 8 - - 4 - - import com.cloudogu.scm.review.pullrequest.service.PullRequest; -
- 9 - - - import com.cloudogu.scm.review.pullrequest.service.PullRequestEvent; -
- 10 - - 5 - - import com.github.legman.Subscribe; -
- 11 - - - import lombok.Data; -
- 12 - - 6 - - import org.apache.shiro.SecurityUtils; -
- 13 - - 7 - - import org.apache.shiro.subject.PrincipalCollection; -
- 14 - - 8 - - import org.apache.shiro.subject.Subject; -
- 15 - - 9 - - import sonia.scm.EagerSingleton; -
- 16 - - - import sonia.scm.HandlerEventType; -
- 17 - - - import sonia.scm.event.HandlerEvent; -
- 18 - - 10 - - import sonia.scm.plugin.Extension; -
- 19 - - 11 - - import sonia.scm.repository.Repository; -
- 20 - - 12 - - import sonia.scm.security.SessionId; -
-
-
-
-
-
+ Custom File annotation for + src/main/java/com/cloudogu/scm/review/events/EventListener.java +

+ - - - src/main/js/ChangeNotification.tsx - - - modify - - -
-
-
- - - - - -
-
-
- - -
-

- Custom File annotation for - src/main/js/ChangeNotification.tsx -

-
- - - - - - - - - - - - - - - - - - - - - - - - - - - + + + - - + + + + - 6 - - + + + + - - - - - - - - - - - - - - - - - + - - - - - + + - 15 - - + + + - 16 - - + + + - pullRequest: setEvent - - - - + + + - 16 - - + + + + - 17 - - + + + + - }); - - - - + + + - 17 - - + + + + - 18 - - + + + - }, [url]); - - - - + + + + - 19 - - + + + + - const { t } = useTranslation("plugins"); - - - - + + + + - 18 - - + + + + - 20 - - + + + - if (event) { - - - - + + + - 19 - - + + + + - 21 - - + + + + - return ( - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- 2 - - 2 - - import { Link } from "@scm-manager/ui-types"; -
- 3 - - 3 - - import { apiClient, Toast, ToastButtons, ToastButton } from "@scm-manager/ui-components"; -
- 4 - - 4 - - import { PullRequest } from "./types/PullRequest"; -
+
- 5 - - import { useTranslation } from "react-i18next"; -
- 5 - + 1 + + 1 + + package com.cloudogu.scm.review.events; +
+ 2 + + 2 + + +
- 6 - - 7 - - type HandlerProps = { -
- 7 - - 8 - - url: string; -
-
+ 3 +
-
+ import com.cloudogu.scm.review.comment.service.BasicComment; +
+ 4 + + + import com.cloudogu.scm.review.comment.service.BasicCommentEvent; +
+ 5 + + + import com.cloudogu.scm.review.comment.service.CommentEvent; +
+ 6 + + + import com.cloudogu.scm.review.comment.service.ReplyEvent; +
+ 7 + + 3 + + import com.cloudogu.scm.review.pullrequest.service.BasicPullRequestEvent; +
+ 8 + + 4 + + import com.cloudogu.scm.review.pullrequest.service.PullRequest; +
+ 9 + + + import com.cloudogu.scm.review.pullrequest.service.PullRequestEvent; +
+ 10 + + 5 + + import com.github.legman.Subscribe; +
+ 11 + + + import lombok.Data; +
- + 12 + + 6 + + import org.apache.shiro.SecurityUtils; +
+ 13 + + 7 + + import org.apache.shiro.subject.PrincipalCollection; +
+ 14 + + 8 + + import org.apache.shiro.subject.Subject; +
+ 15 + + 9 + + import sonia.scm.EagerSingleton; +
+ 16 + + + import sonia.scm.HandlerEventType; +
+ 17 + + + import sonia.scm.event.HandlerEvent; +
+ 18 + + 10 + + import sonia.scm.plugin.Extension; +
+ 19 + + 11 + + import sonia.scm.repository.Repository; +
- 20 - - - <Toast type="warning" title="New Changes"> -
- 21 - - - <p>The underlying Pull-Request has changed. Press reload to see the changes.</p> -
- 22 - - - <p>Warning: Non saved modification will be lost.</p> -
- - 22 - - <Toast type="warning" title={t("scm-review-plugin.changeNotification.title")}> -
- - 23 - - <p>{t("scm-review-plugin.changeNotification.description")}</p> -
- - 24 - - <p>{t("scm-review-plugin.changeNotification.modificationWarning")}</p> -
- 23 - - 25 - - <ToastButtons> -
- 24 - - - <ToastButton icon="redo" onClick={reload}>Reload</ToastButton> -
- 25 - - - <ToastButton icon="times" onClick={() => setEvent(undefined)}>Ignore</ToastButton> -
- - 26 - - <ToastButton icon="redo" onClick={reload}> -
- - 27 - - {t("scm-review-plugin.changeNotification.buttons.reload")} -
- - 28 - - </ToastButton> -
- - 29 - - <ToastButton icon="times" onClick={() => setEvent(undefined)}> -
- - 30 - - {t("scm-review-plugin.changeNotification.buttons.ignore")} -
- - 31 - - </ToastButton> -
- 26 - - 32 - - </ToastButtons> -
- 27 - - 33 - - </Toast> -
- 28 - - 34 - - ); -
+ + 20 + + + 12 + + + import sonia.scm.security.SessionId; + + + + +
-
-
- - - src/main/resources/locales/de/plugins.json - - - modify - -
-
+ + + src/main/js/ChangeNotification.tsx + + + modify + +
+
- - - - - + + + + +
+
+

+ Custom File annotation for + src/main/js/ChangeNotification.tsx +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ 2 + + 2 + + import { Link } from "@scm-manager/ui-types"; +
+ 3 + + 3 + + import { apiClient, Toast, ToastButtons, ToastButton } from "@scm-manager/ui-components"; +
+ 4 + + 4 + + import { PullRequest } from "./types/PullRequest"; +
+ + 5 + + import { useTranslation } from "react-i18next"; +
+ 5 + + 6 + + +
+ 6 + + 7 + + type HandlerProps = { +
+ 7 + + 8 + + url: string; +
+
+
+ 15 + + 16 + + pullRequest: setEvent +
+ 16 + + 17 + + }); +
+ 17 + + 18 + + }, [url]); +
+ + 19 + + const { t } = useTranslation("plugins"); +
+ 18 + + 20 + + if (event) { +
+ 19 + + 21 + + return ( +
+ 20 + + + <Toast type="warning" title="New Changes"> +
+ 21 + + + <p>The underlying Pull-Request has changed. Press reload to see the changes.</p> +
+ 22 + + + <p>Warning: Non saved modification will be lost.</p> +
+ + 22 + + <Toast type="warning" title={t("scm-review-plugin.changeNotification.title")}> +
+ + 23 + + <p>{t("scm-review-plugin.changeNotification.description")}</p> +
+ + 24 + + <p>{t("scm-review-plugin.changeNotification.modificationWarning")}</p> +
+ 23 + + 25 + + <ToastButtons> +
+ 24 + + + <ToastButton icon="redo" onClick={reload}>Reload</ToastButton> +
+ 25 + + + <ToastButton icon="times" onClick={() => setEvent(undefined)}>Ignore</ToastButton> +
+ + 26 + + <ToastButton icon="redo" onClick={reload}> +
+ + 27 + + {t("scm-review-plugin.changeNotification.buttons.reload")} +
+ + 28 + + </ToastButton> +
+ + 29 + + <ToastButton icon="times" onClick={() => setEvent(undefined)}> +
+ + 30 + + {t("scm-review-plugin.changeNotification.buttons.ignore")} +
+ + 31 + + </ToastButton> +
+ 26 + + 32 + + </ToastButtons> +
+ 27 + + 33 + + </Toast> +
+ 28 + + 34 + + ); +
+
-

- Custom File annotation for - src/main/resources/locales/de/plugins.json -

- - - - - - - - - - - - - + +
-
- + + + + +
+ - 181 - + - 181 - - "titleClickable": "Der Kommentar bezieht sich auf eine ältere Version des Source- oder Target-Branches. Klicken Sie hier, um den ursprünglichen Kontext zu sehen." -
- 182 - + + + + + + + + + + +
+

+ Custom File annotation for + src/main/resources/locales/de/plugins.json +

+ + + + + + + + - 182 - - + + + + + + + + + + + + - - - + - 183 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+ 181 + + 181 + + "titleClickable": "Der Kommentar bezieht sich auf eine ältere Version des Source- oder Target-Branches. Klicken Sie hier, um den ursprünglichen Kontext zu sehen." +
+ 182 + + 182 + + } +
+ 183 + + 183 + } -
+
- 183 - - } -
- - 184 - - }, -
- - 185 - - "changeNotification": { -
- - 186 - - "title": "Neue Änderungen", -
- - 187 - - "description": "An diesem Pull Request wurden Änderungen vorgenommen. Laden Sie die Seite neu um diese anzuzeigen.", -
- - 188 - - "modificationWarning": "Warnung: Nicht gespeicherte Eingaben gehen verloren.", -
- - 189 - - "buttons": { -
- - 190 - - "reload": "Neu laden", -
- - 191 - - "ignore": "Ignorieren" -
- - 192 - - } -
- 184 - - 193 - - } -
- 185 - - 194 - - }, -
- 186 - - 195 - - "permissions": { -
-
- -
-
-
-
- - - src/main/resources/locales/en/plugins.json - - - modify - -
-
-
-
- +
- - - - - - - - - -
-

- Custom File annotation for - src/main/resources/locales/en/plugins.json -

- - - - - - - - - + + - 181 - - + + + - 181 - - + + + - "titleClickable": "The comment is related to an older of the source or target branch. Click here to see the original context." - - - - + + + - 182 - - + + + - 182 - - + + + + + + + + + + + + + - - - - - + + + + - - - - + + + + - - - + - 185 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+ + }, +
+ + 185 + + "changeNotification": { +
+ + 186 + + "title": "Neue Änderungen", +
+ + 187 + + "description": "An diesem Pull Request wurden Änderungen vorgenommen. Laden Sie die Seite neu um diese anzuzeigen.", +
+ + 188 + + "modificationWarning": "Warnung: Nicht gespeicherte Eingaben gehen verloren.", +
+ + 189 + + "buttons": { +
+ + 190 + + "reload": "Neu laden", +
+ + 191 + + "ignore": "Ignorieren" +
+ + 192 + } -
- 183 - - 183 - +
+ 184 + + 193 + } -
- - 184 - +
+ 185 + + 194 + }, -
- +
- "changeNotification": { -
- - 186 - - "title": "New Changes", -
- - 187 - - "description": "The underlying Pull-Request has changed. Press reload to see the changes.", -
- - 188 - - "modificationWarning": "Warning: Non saved modification will be lost.", -
- - 189 - - "buttons": { -
- - 190 - - "reload": "Reload", -
- - 191 - - "ignore": "Ignore" -
- - 192 - - } -
- 184 - - 193 - - } -
- 185 - - 194 - - }, -
- 186 - - 195 - - "permissions": { -
+
+ 186 + + 195 + + "permissions": { +
+
-
-
- - - src/test/java/com/cloudogu/scm/review/events/ClientTest.java - - - modify - -
-
+ + + src/main/resources/locales/en/plugins.json + + + modify + +
+
- - - - - + + + + +
+
+

+ Custom File annotation for + src/main/resources/locales/en/plugins.json +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ 181 + + 181 + + "titleClickable": "The comment is related to an older of the source or target branch. Click here to see the original context." +
+ 182 + + 182 + + } +
+ 183 + + 183 + + } +
+ + 184 + + }, +
+ + 185 + + "changeNotification": { +
+ + 186 + + "title": "New Changes", +
+ + 187 + + "description": "The underlying Pull-Request has changed. Press reload to see the changes.", +
+ + 188 + + "modificationWarning": "Warning: Non saved modification will be lost.", +
+ + 189 + + "buttons": { +
+ + 190 + + "reload": "Reload", +
+ + 191 + + "ignore": "Ignore" +
+ + 192 + + } +
+ 184 + + 193 + + } +
+ 185 + + 194 + + }, +
+ 186 + + 195 + + "permissions": { +
+
-

- Custom File annotation for - src/test/java/com/cloudogu/scm/review/events/ClientTest.java -

- - - - - - - - - - - - - - - - - - - - - - - - - - - + +
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + +
+

+ Custom File annotation for + src/test/java/com/cloudogu/scm/review/events/ClientTest.java +

+
- 7 - - 7 - - import org.mockito.Mock; -
- 8 - - 8 - - import org.mockito.junit.jupiter.MockitoExtension; -
- 9 - - 9 - - import sonia.scm.security.SessionId; -
- - 10 - + - -
- 10 - - 11 - - import javax.ws.rs.sse.OutboundSseEvent; -
- 11 - - 12 - - import javax.ws.rs.sse.SseEventSink; -
- 12 - - - -
- 13 - - 13 - - import java.time.Clock; -
- 14 - - 14 - - import java.time.Instant; -
- 15 - - 15 - - import java.time.LocalDateTime; -
- 16 - - 16 - - import java.time.ZoneOffset; -
- 17 - - 17 - - import java.time.temporal.ChronoField; -
- 18 - - - import java.time.temporal.ChronoUnit; -
- 19 - - - import java.time.temporal.TemporalField; -
- 20 - - 18 - - import java.util.concurrent.CompletableFuture; -
- 21 - - 19 - - import java.util.concurrent.CompletionStage; -
- 22 - - - import java.util.concurrent.atomic.AtomicLong; -
- 23 - - 20 - - import java.util.concurrent.atomic.AtomicReference; -
- 24 - - 21 - - -
- 25 - - 22 - - import static java.time.temporal.ChronoUnit.MINUTES; -
- - + + + + + -
+ 7 + +
+ + + + + + + + + + + + + + - - - - - + + + - 83 - - + + + + - 80 - - + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ 7 + + import org.mockito.Mock; +
+ 8 + + 8 + + import org.mockito.junit.jupiter.MockitoExtension; +
+ 9 + + 9 + + import sonia.scm.security.SessionId; +
-
+ 10 + + +
+ 10 + + 11 + + import javax.ws.rs.sse.OutboundSseEvent; +
+ 11 + + 12 + + import javax.ws.rs.sse.SseEventSink; +
- 84 - - 81 - - @Test -
- 85 - - 82 - - @SuppressWarnings("unchecked") -
- 86 - - - void shouldCloseEventSinkOnFailure() throws InterruptedException { -
- - 83 - - void shouldCloseEventSinkOnFailure() { -
- 87 - - 84 - - CompletionStage future = CompletableFuture.supplyAsync(() -> { -
- 88 - - 85 - - throw new RuntimeException("failed to send message"); -
- 89 - - 86 - - }); -
-
+ 12 +
-
+ 13 + + 13 + + import java.time.Clock; +
+ 14 + + 14 + + import java.time.Instant; +
+ 15 + + 15 + + import java.time.LocalDateTime; +
+ 16 + + 16 + + import java.time.ZoneOffset; +
+ 17 + + 17 + + import java.time.temporal.ChronoField; +
+ 18 + + + import java.time.temporal.ChronoUnit; +
+ 19 + + + import java.time.temporal.TemporalField; +
+ 20 + + 18 + + import java.util.concurrent.CompletableFuture; +
+ 21 + + 19 + + import java.util.concurrent.CompletionStage; +
+ 22 + + + import java.util.concurrent.atomic.AtomicLong; +
+ 23 + + 20 + + import java.util.concurrent.atomic.AtomicReference; +
+ 24 + + 21 + + +
+ 25 + + 22 + + import static java.time.temporal.ChronoUnit.MINUTES; +
+
+
+ 83 + + 80 + + +
+ 84 + + 81 + + @Test +
+ 85 + + 82 + + @SuppressWarnings("unchecked") +
+ 86 + + + void shouldCloseEventSinkOnFailure() throws InterruptedException { +
+ + 83 + + void shouldCloseEventSinkOnFailure() { +
+ 87 + + 84 + + CompletionStage future = CompletableFuture.supplyAsync(() -> { +
+ 88 + + 85 + + throw new RuntimeException("failed to send message"); +
+ 89 + + 86 + + }); +
+
+
+ 91 + + 88 + + +
+ 92 + + 89 + + client.send(message); +
+ 93 + + 90 + + +
+ 94 + + + Thread.sleep(50L); +
+ 95 + + + +
+ 96 + + + verify(eventSink).close(); +
+ + 91 + + verify(eventSink, timeout(50L)).close(); +
+ 97 + + 92 + + } +
+ 98 + + 93 + + +
+ 99 + + 94 + + @Test +
+
+ +
+
+
- - - 91 - - - 88 - - - - - - - - 92 - - - 89 - - - client.send(message); - - - - - 93 - - - 90 - - - - - - - - 94 - - - - Thread.sleep(50L); - - - + + modify + +
+
- - 95 - - + + + + + +
+
+
+ + +
+

+ Custom File annotation for + Main.java +

+ + + - - - - - - - + + - - + + + - verify(eventSink, timeout(50L)).close(); - - - - + + + + - 97 - - + + + + - 92 - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - -
- -
- 96 - - - verify(eventSink).close(); -
- - 91 - + + 1 + + import java.io.PrintStream; +
+ 1 + + 2 + + import java.util.Arrays; +
+ 2 + + 3 + + +
+ 3 + + 4 + + class Main { +
+ + 5 + + private static final PrintStream OUT = System.out; +
+ + 6 + + +
+ 4 + + 7 + + public static void main(String[] args) { +
+ + 8 + + <<<<<<< HEAD +
+ 5 + + 9 + + System.out.println("Expect nothing more to happen."); +
+ 6 + + 10 + + System.out.println("The command line parameters are:"); +
+ 7 + + 11 + + Arrays.stream(args).map(arg -> "- " + arg).forEach(System.out::println); +
+ + 12 + + ======= +
+ + 13 + + OUT.println("Expect nothing more to happen."); +
+ + 14 + + OUT.println("Parameters:"); +
+ + 15 + + Arrays.stream(args).map(arg -> "- " + arg).forEach(OUT::println); +
+ + 16 + + >>>>>>> feature/use_constant +
+ 8 + + 17 + + } +
+ 9 + + 18 + } -
- 98 - - 93 - - -
- 99 - - 94 - - @Test -
-
- -
-
-
-
- - - Main.java - - - modify - -
-
-
-
- - - - - -
-
-
+ + + +
-
-

- Custom File annotation for - Main.java -

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - 1 - - import java.io.PrintStream; -
- 1 - - 2 - - import java.util.Arrays; -
- 2 - - 3 - - -
- 3 - - 4 - - class Main { -
- - 5 - - private static final PrintStream OUT = System.out; -
- - 6 - - -
- 4 - - 7 - - public static void main(String[] args) { -
- - 8 - - <<<<<<< HEAD -
- 5 - - 9 - - System.out.println("Expect nothing more to happen."); -
- 6 - - 10 - - System.out.println("The command line parameters are:"); -
- 7 - - 11 - - Arrays.stream(args).map(arg -> "- " + arg).forEach(System.out::println); -
- - 12 - - ======= -
- - 13 - - OUT.println("Expect nothing more to happen."); -
- - 14 - - OUT.println("Parameters:"); -
- - 15 - - Arrays.stream(args).map(arg -> "- " + arg).forEach(OUT::println); -
- - 16 - - >>>>>>> feature/use_constant -
- 8 - - 17 - - } -
- 9 - - 18 - - } -
-
`; @@ -18629,3942 +18673,3950 @@ exports[`Storyshots Diff File Controls 1`] = `
-
+
- - - src/main/java/com/cloudogu/scm/review/events/EventListener.java - - - modify - -
-
+ + + src/main/java/com/cloudogu/scm/review/events/EventListener.java + + + modify + +
+
- - - - - -
-
- + + + +
+
- - - - + + + + +
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- 1 - - 1 - - package com.cloudogu.scm.review.events; -
- 2 - - 2 - - -
- 3 - - - import com.cloudogu.scm.review.comment.service.BasicComment; -
- 4 - - - import com.cloudogu.scm.review.comment.service.BasicCommentEvent; -
- 5 - - - import com.cloudogu.scm.review.comment.service.CommentEvent; -
- 6 - - - import com.cloudogu.scm.review.comment.service.ReplyEvent; -
- 7 - - 3 - - import com.cloudogu.scm.review.pullrequest.service.BasicPullRequestEvent; -
- 8 - - 4 - - import com.cloudogu.scm.review.pullrequest.service.PullRequest; -
- 9 - - - import com.cloudogu.scm.review.pullrequest.service.PullRequestEvent; -
- 10 - - 5 - - import com.github.legman.Subscribe; -
- 11 - - - import lombok.Data; -
- 12 - - 6 - - import org.apache.shiro.SecurityUtils; -
- 13 - - 7 - - import org.apache.shiro.subject.PrincipalCollection; -
- 14 - - 8 - - import org.apache.shiro.subject.Subject; -
- 15 - - 9 - - import sonia.scm.EagerSingleton; -
- 16 - - - import sonia.scm.HandlerEventType; -
- 17 - - - import sonia.scm.event.HandlerEvent; -
- 18 - - 10 - - import sonia.scm.plugin.Extension; -
- 19 - - 11 - - import sonia.scm.repository.Repository; -
- 20 - - 12 - - import sonia.scm.security.SessionId; -
-
-
-
-
-
- - - src/main/js/ChangeNotification.tsx - - - modify - -
-
-
-
- - - - - -
-
- - - - - -
-
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + - - + + + + - 6 - - + + + + - - - - - - - - - - - - - - - - - + - - - - - + + - 15 - - + + + - 16 - - + + + - pullRequest: setEvent - - - - + + + - 16 - - + + + + - 17 - - + + + + - }); - - - - + + + - 17 - - + + + + - 18 - - + + + - }, [url]); - - - - + + + + - 19 - - + + + + - const { t } = useTranslation("plugins"); - - - - + + + + - 18 - - + + + + - 20 - - + + + - if (event) { - - - - + + + - 19 - - + + + + - 21 - - + + + + - return ( - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- 2 - - 2 - - import { Link } from "@scm-manager/ui-types"; -
- 3 - - 3 - - import { apiClient, Toast, ToastButtons, ToastButton } from "@scm-manager/ui-components"; -
- 4 - - 4 - - import { PullRequest } from "./types/PullRequest"; -
+
- 5 - - import { useTranslation } from "react-i18next"; -
- 5 - + 1 + + 1 + + package com.cloudogu.scm.review.events; +
+ 2 + + 2 + + +
- 6 - - 7 - - type HandlerProps = { -
- 7 - - 8 - - url: string; -
-
+ 3 +
-
+ import com.cloudogu.scm.review.comment.service.BasicComment; +
+ 4 + + + import com.cloudogu.scm.review.comment.service.BasicCommentEvent; +
+ 5 + + + import com.cloudogu.scm.review.comment.service.CommentEvent; +
+ 6 + + + import com.cloudogu.scm.review.comment.service.ReplyEvent; +
+ 7 + + 3 + + import com.cloudogu.scm.review.pullrequest.service.BasicPullRequestEvent; +
+ 8 + + 4 + + import com.cloudogu.scm.review.pullrequest.service.PullRequest; +
+ 9 + + + import com.cloudogu.scm.review.pullrequest.service.PullRequestEvent; +
+ 10 + + 5 + + import com.github.legman.Subscribe; +
+ 11 + + + import lombok.Data; +
- + 12 + + 6 + + import org.apache.shiro.SecurityUtils; +
+ 13 + + 7 + + import org.apache.shiro.subject.PrincipalCollection; +
+ 14 + + 8 + + import org.apache.shiro.subject.Subject; +
+ 15 + + 9 + + import sonia.scm.EagerSingleton; +
+ 16 + + + import sonia.scm.HandlerEventType; +
+ 17 + + + import sonia.scm.event.HandlerEvent; +
+ 18 + + 10 + + import sonia.scm.plugin.Extension; +
+ 19 + + 11 + + import sonia.scm.repository.Repository; +
- 20 - - - <Toast type="warning" title="New Changes"> -
- 21 - - - <p>The underlying Pull-Request has changed. Press reload to see the changes.</p> -
- 22 - - - <p>Warning: Non saved modification will be lost.</p> -
- - 22 - - <Toast type="warning" title={t("scm-review-plugin.changeNotification.title")}> -
- - 23 - - <p>{t("scm-review-plugin.changeNotification.description")}</p> -
- - 24 - - <p>{t("scm-review-plugin.changeNotification.modificationWarning")}</p> -
- 23 - - 25 - - <ToastButtons> -
- 24 - - - <ToastButton icon="redo" onClick={reload}>Reload</ToastButton> -
- 25 - - - <ToastButton icon="times" onClick={() => setEvent(undefined)}>Ignore</ToastButton> -
- - 26 - - <ToastButton icon="redo" onClick={reload}> -
- - 27 - - {t("scm-review-plugin.changeNotification.buttons.reload")} -
- - 28 - - </ToastButton> -
- - 29 - - <ToastButton icon="times" onClick={() => setEvent(undefined)}> -
- - 30 - - {t("scm-review-plugin.changeNotification.buttons.ignore")} -
- - 31 - - </ToastButton> -
- 26 - - 32 - - </ToastButtons> -
- 27 - - 33 - - </Toast> -
- 28 - - 34 - - ); -
+ + 20 + + + 12 + + + import sonia.scm.security.SessionId; + + + + +
-
-
- - - src/main/resources/locales/de/plugins.json - - - modify - -
-
+ + + src/main/js/ChangeNotification.tsx + + + modify + +
+
- - - - - -
-
- + + + +
+
- - - - + + + + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ 2 + + 2 + + import { Link } from "@scm-manager/ui-types"; +
+ 3 + + 3 + + import { apiClient, Toast, ToastButtons, ToastButton } from "@scm-manager/ui-components"; +
+ 4 + + 4 + + import { PullRequest } from "./types/PullRequest"; +
+ + 5 + + import { useTranslation } from "react-i18next"; +
+ 5 + + 6 + + +
+ 6 + + 7 + + type HandlerProps = { +
+ 7 + + 8 + + url: string; +
+
+
+ 15 + + 16 + + pullRequest: setEvent +
+ 16 + + 17 + + }); +
+ 17 + + 18 + + }, [url]); +
+ + 19 + + const { t } = useTranslation("plugins"); +
+ 18 + + 20 + + if (event) { +
+ 19 + + 21 + + return ( +
+ 20 + + + <Toast type="warning" title="New Changes"> +
+ 21 + + + <p>The underlying Pull-Request has changed. Press reload to see the changes.</p> +
+ 22 + + + <p>Warning: Non saved modification will be lost.</p> +
+ + 22 + + <Toast type="warning" title={t("scm-review-plugin.changeNotification.title")}> +
+ + 23 + + <p>{t("scm-review-plugin.changeNotification.description")}</p> +
+ + 24 + + <p>{t("scm-review-plugin.changeNotification.modificationWarning")}</p> +
+ 23 + + 25 + + <ToastButtons> +
+ 24 + + + <ToastButton icon="redo" onClick={reload}>Reload</ToastButton> +
+ 25 + + + <ToastButton icon="times" onClick={() => setEvent(undefined)}>Ignore</ToastButton> +
+ + 26 + + <ToastButton icon="redo" onClick={reload}> +
+ + 27 + + {t("scm-review-plugin.changeNotification.buttons.reload")} +
+ + 28 + + </ToastButton> +
+ + 29 + + <ToastButton icon="times" onClick={() => setEvent(undefined)}> +
+ + 30 + + {t("scm-review-plugin.changeNotification.buttons.ignore")} +
+ + 31 + + </ToastButton> +
+ 26 + + 32 + + </ToastButtons> +
+ 27 + + 33 + + </Toast> +
+ 28 + + 34 + + ); +
+
- - - - - - - - - - - - - + +
-
- + + + + +
+ - 181 - + - 181 - - "titleClickable": "Der Kommentar bezieht sich auf eine ältere Version des Source- oder Target-Branches. Klicken Sie hier, um den ursprünglichen Kontext zu sehen." -
- 182 - + + + + + + +
+ + + + + +
+ + + + +
+ + + + + + + + - 182 - - + + + + + + + + + + + + - - - + - 183 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+ 181 + + 181 + + "titleClickable": "Der Kommentar bezieht sich auf eine ältere Version des Source- oder Target-Branches. Klicken Sie hier, um den ursprünglichen Kontext zu sehen." +
+ 182 + + 182 + + } +
+ 183 + + 183 + } -
+
- 183 - - } -
- - 184 - - }, -
- - 185 - - "changeNotification": { -
- - 186 - - "title": "Neue Änderungen", -
- - 187 - - "description": "An diesem Pull Request wurden Änderungen vorgenommen. Laden Sie die Seite neu um diese anzuzeigen.", -
- - 188 - - "modificationWarning": "Warnung: Nicht gespeicherte Eingaben gehen verloren.", -
- - 189 - - "buttons": { -
- - 190 - - "reload": "Neu laden", -
- - 191 - - "ignore": "Ignorieren" -
- - 192 - - } -
- 184 - - 193 - - } -
- 185 - - 194 - - }, -
- 186 - - 195 - - "permissions": { -
-
- -
-
-
-
- - - src/main/resources/locales/en/plugins.json - - - modify - -
-
-
-
- +
- - - - - -
- +
- - - - - - - - - -
- - - - - - - - - + - 181 - - + + + - 181 - - + + + - "titleClickable": "The comment is related to an older of the source or target branch. Click here to see the original context." - - - - + + + - 182 - - + + + - 182 - - + + + + + + + + + + + + + - - - - - + + + + - - - - + + + + - - - + - 185 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+
+ + 185 + + "changeNotification": { +
+ + 186 + + "title": "Neue Änderungen", +
+ + 187 + + "description": "An diesem Pull Request wurden Änderungen vorgenommen. Laden Sie die Seite neu um diese anzuzeigen.", +
+ + 188 + + "modificationWarning": "Warnung: Nicht gespeicherte Eingaben gehen verloren.", +
+ + 189 + + "buttons": { +
+ + 190 + + "reload": "Neu laden", +
+ + 191 + + "ignore": "Ignorieren" +
+ + 192 + } -
- 183 - - 183 - +
+ 184 + + 193 + } -
- - 184 - +
+ 185 + + 194 + }, -
- +
- "changeNotification": { -
- - 186 - - "title": "New Changes", -
- - 187 - - "description": "The underlying Pull-Request has changed. Press reload to see the changes.", -
- - 188 - - "modificationWarning": "Warning: Non saved modification will be lost.", -
- - 189 - - "buttons": { -
- - 190 - - "reload": "Reload", -
- - 191 - - "ignore": "Ignore" -
- - 192 - - } -
- 184 - - 193 - - } -
- 185 - - 194 - - }, -
- 186 - - 195 - - "permissions": { -
+
+ 186 + + 195 + + "permissions": { +
+
- -
- - - src/test/java/com/cloudogu/scm/review/events/ClientTest.java - - - modify - -
-
+ + + src/main/resources/locales/en/plugins.json + + + modify + +
+
- - - - - -
-
- + + + +
+
- - - - + + + + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ 181 + + 181 + + "titleClickable": "The comment is related to an older of the source or target branch. Click here to see the original context." +
+ 182 + + 182 + + } +
+ 183 + + 183 + + } +
+ + 184 + + }, +
+ + 185 + + "changeNotification": { +
+ + 186 + + "title": "New Changes", +
+ + 187 + + "description": "The underlying Pull-Request has changed. Press reload to see the changes.", +
+ + 188 + + "modificationWarning": "Warning: Non saved modification will be lost.", +
+ + 189 + + "buttons": { +
+ + 190 + + "reload": "Reload", +
+ + 191 + + "ignore": "Ignore" +
+ + 192 + + } +
+ 184 + + 193 + + } +
+ 185 + + 194 + + }, +
+ 186 + + 195 + + "permissions": { +
+
- - - - - - - - - - - - - - - - - - - - - - - - - - - + +
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + +
+ + + + + +
+ + + + +
+
- 7 - - 7 - - import org.mockito.Mock; -
- 8 - - 8 - - import org.mockito.junit.jupiter.MockitoExtension; -
- 9 - - 9 - - import sonia.scm.security.SessionId; -
- - 10 - + - -
- 10 - - 11 - - import javax.ws.rs.sse.OutboundSseEvent; -
- 11 - - 12 - - import javax.ws.rs.sse.SseEventSink; -
- 12 - - - -
- 13 - - 13 - - import java.time.Clock; -
- 14 - - 14 - - import java.time.Instant; -
- 15 - - 15 - - import java.time.LocalDateTime; -
- 16 - - 16 - - import java.time.ZoneOffset; -
- 17 - - 17 - - import java.time.temporal.ChronoField; -
- 18 - - - import java.time.temporal.ChronoUnit; -
- 19 - - - import java.time.temporal.TemporalField; -
- 20 - - 18 - - import java.util.concurrent.CompletableFuture; -
- 21 - - 19 - - import java.util.concurrent.CompletionStage; -
- 22 - - - import java.util.concurrent.atomic.AtomicLong; -
- 23 - - 20 - - import java.util.concurrent.atomic.AtomicReference; -
- 24 - - 21 - - -
- 25 - - 22 - - import static java.time.temporal.ChronoUnit.MINUTES; -
- - + + + + + -
+ 7 + +
+ + + + + + + + + + + + + + - - - - - + + + - 83 - - + + + + - 80 - - + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ 7 + + import org.mockito.Mock; +
+ 8 + + 8 + + import org.mockito.junit.jupiter.MockitoExtension; +
+ 9 + + 9 + + import sonia.scm.security.SessionId; +
-
+ 10 + + +
+ 10 + + 11 + + import javax.ws.rs.sse.OutboundSseEvent; +
+ 11 + + 12 + + import javax.ws.rs.sse.SseEventSink; +
- 84 - - 81 - - @Test -
- 85 - - 82 - - @SuppressWarnings("unchecked") -
- 86 - - - void shouldCloseEventSinkOnFailure() throws InterruptedException { -
- - 83 - - void shouldCloseEventSinkOnFailure() { -
- 87 - - 84 - - CompletionStage future = CompletableFuture.supplyAsync(() -> { -
- 88 - - 85 - - throw new RuntimeException("failed to send message"); -
- 89 - - 86 - - }); -
-
+ 12 +
-
+ 13 + + 13 + + import java.time.Clock; +
+ 14 + + 14 + + import java.time.Instant; +
+ 15 + + 15 + + import java.time.LocalDateTime; +
+ 16 + + 16 + + import java.time.ZoneOffset; +
+ 17 + + 17 + + import java.time.temporal.ChronoField; +
+ 18 + + + import java.time.temporal.ChronoUnit; +
+ 19 + + + import java.time.temporal.TemporalField; +
+ 20 + + 18 + + import java.util.concurrent.CompletableFuture; +
+ 21 + + 19 + + import java.util.concurrent.CompletionStage; +
+ 22 + + + import java.util.concurrent.atomic.AtomicLong; +
+ 23 + + 20 + + import java.util.concurrent.atomic.AtomicReference; +
+ 24 + + 21 + + +
+ 25 + + 22 + + import static java.time.temporal.ChronoUnit.MINUTES; +
+
+
+ 83 + + 80 + + +
+ 84 + + 81 + + @Test +
+ 85 + + 82 + + @SuppressWarnings("unchecked") +
+ 86 + + + void shouldCloseEventSinkOnFailure() throws InterruptedException { +
+ + 83 + + void shouldCloseEventSinkOnFailure() { +
+ 87 + + 84 + + CompletionStage future = CompletableFuture.supplyAsync(() -> { +
+ 88 + + 85 + + throw new RuntimeException("failed to send message"); +
+ 89 + + 86 + + }); +
+
+
+ 91 + + 88 + + +
+ 92 + + 89 + + client.send(message); +
+ 93 + + 90 + + +
+ 94 + + + Thread.sleep(50L); +
+ 95 + + + +
+ 96 + + + verify(eventSink).close(); +
+ + 91 + + verify(eventSink, timeout(50L)).close(); +
+ 97 + + 92 + + } +
+ 98 + + 93 + + +
+ 99 + + 94 + + @Test +
+
+ +
+
+
- - - 91 - - - 88 - - - - - - - - 92 - - - 89 - - - client.send(message); - - - - - 93 - - - 90 - - - - - - - - 94 - - - - Thread.sleep(50L); - - - + + modify + +
+
- - 95 - - + + + + + +
+
+ + + + + +
+
+
+ + +
+ + + - - - - - - - + + - - + + + - verify(eventSink, timeout(50L)).close(); - - - - + + + + - 97 - - + + + + - 92 - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - -
- -
- 96 - - - verify(eventSink).close(); -
- - 91 - + + 1 + + import java.io.PrintStream; +
+ 1 + + 2 + + import java.util.Arrays; +
+ 2 + + 3 + + +
+ 3 + + 4 + + class Main { +
+ + 5 + + private static final PrintStream OUT = System.out; +
+ + 6 + + +
+ 4 + + 7 + + public static void main(String[] args) { +
+ + 8 + + <<<<<<< HEAD +
+ 5 + + 9 + + System.out.println("Expect nothing more to happen."); +
+ 6 + + 10 + + System.out.println("The command line parameters are:"); +
+ 7 + + 11 + + Arrays.stream(args).map(arg -> "- " + arg).forEach(System.out::println); +
+ + 12 + + ======= +
+ + 13 + + OUT.println("Expect nothing more to happen."); +
+ + 14 + + OUT.println("Parameters:"); +
+ + 15 + + Arrays.stream(args).map(arg -> "- " + arg).forEach(OUT::println); +
+ + 16 + + >>>>>>> feature/use_constant +
+ 8 + + 17 + + } +
+ 9 + + 18 + } -
- 98 - - 93 - - -
- 99 - - 94 - - @Test -
-
- -
-
-
-
- - - Main.java - - - modify - -
-
-
-
- - - - - -
-
- - - - - -
-
-
+ + + +
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - 1 - - import java.io.PrintStream; -
- 1 - - 2 - - import java.util.Arrays; -
- 2 - - 3 - - -
- 3 - - 4 - - class Main { -
- - 5 - - private static final PrintStream OUT = System.out; -
- - 6 - - -
- 4 - - 7 - - public static void main(String[] args) { -
- - 8 - - <<<<<<< HEAD -
- 5 - - 9 - - System.out.println("Expect nothing more to happen."); -
- 6 - - 10 - - System.out.println("The command line parameters are:"); -
- 7 - - 11 - - Arrays.stream(args).map(arg -> "- " + arg).forEach(System.out::println); -
- - 12 - - ======= -
- - 13 - - OUT.println("Expect nothing more to happen."); -
- - 14 - - OUT.println("Parameters:"); -
- - 15 - - Arrays.stream(args).map(arg -> "- " + arg).forEach(OUT::println); -
- - 16 - - >>>>>>> feature/use_constant -
- 8 - - 17 - - } -
- 9 - - 18 - - } -
-
`; @@ -22573,822 +22625,825 @@ exports[`Storyshots Diff Hunks 1`] = `
-
+
- - - src/main/java/com/cloudogu/scm/review/pullrequest/service/DefaultPullRequestService.java - - - modify - -
-
+ + + src/main/java/com/cloudogu/scm/review/pullrequest/service/DefaultPullRequestService.java + + + modify + +
+
- - - - - + + + + +
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + - - + + + + - 30 - - + + + + - import static com.cloudogu.scm.review.pullrequest.service.PullRequestStatus.MERGED; - - - - + + + + - 29 - - - - - - - - - - - - - - - - - - + + + - 200 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + 29 + + + + + + + + + + + + + + + + + + + + - - - - - + + + + - - + + + + - 215 - - + + + + - .filter(recipient -> user.getId().equals(recipient)) - - - + 202 + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - + + + + - - + + + + - .ifPresent(pullRequest::removeApprover); - - - - + + + + - 215 - - + + + + - getStore(repository).update(pullRequest); - - - - + + + - 217 - - + + + - .ifPresent( - - - - + + + - 218 - - + + + - approval -> { - - - - + + + - 219 - - + + + - pullRequest.removeApprover(approval); - - - - + + + - 220 - - + + + - getStore(repository).update(pullRequest); - - - - + + + + - 221 - - + + + + - eventBus.post(new PullRequestApprovalEvent(repository, pullRequest, APPROVAL_REMOVED)); - - - - - - - - - - - - - - - - - - - - - - -
- 25 - - 25 - - import java.util.Set; -
- 26 - - 26 - - import java.util.stream.Collectors; -
- 27 - - 27 - - -
+
- 28 - - import static com.cloudogu.scm.review.pullrequest.service.PullRequestApprovalEvent.ApprovalCause.APPROVAL_REMOVED; -
- - 29 - - import static com.cloudogu.scm.review.pullrequest.service.PullRequestApprovalEvent.ApprovalCause.APPROVED; -
- 28 - + 25 + + 25 + + import java.util.Set; +
+ 26 + + 26 + + import java.util.stream.Collectors; +
+ 27 + + 27 + + +
- 31 - - import static com.cloudogu.scm.review.pullrequest.service.PullRequestStatus.OPEN; -
- 30 - - 32 - - import static com.cloudogu.scm.review.pullrequest.service.PullRequestStatus.REJECTED; -
-
-
+ 28 + + import static com.cloudogu.scm.review.pullrequest.service.PullRequestApprovalEvent.ApprovalCause.APPROVAL_REMOVED; +
- 202 - - PullRequest pullRequest = getPullRequestFromStore(repository, pullRequestId); -
- 201 - - 203 - - pullRequest.addApprover(user.getId()); -
- 202 - - 204 - - getStore(repository).update(pullRequest); -
- - 205 - - eventBus.post(new PullRequestApprovalEvent(repository, pullRequest, APPROVED)); -
- 203 - - 206 - - } -
- 204 - - 207 - - -
- 205 - - 208 - - @Override -
-
-
+ import static com.cloudogu.scm.review.pullrequest.service.PullRequestApprovalEvent.ApprovalCause.APPROVED; +
+ 28 + + 30 + + import static com.cloudogu.scm.review.pullrequest.service.PullRequestStatus.MERGED; +
+ 29 + + 31 + + import static com.cloudogu.scm.review.pullrequest.service.PullRequestStatus.OPEN; +
+ 30 + + 32 + + import static com.cloudogu.scm.review.pullrequest.service.PullRequestStatus.REJECTED; +
- 211 - - 214 - - approver.stream() -
+
+
- 212 - + 200 + + 202 + + PullRequest pullRequest = getPullRequestFromStore(repository, pullRequestId); +
+ 201 + + 203 + + pullRequest.addApprover(user.getId()); +
+ 204 + + getStore(repository).update(pullRequest); +
+ + 205 + + eventBus.post(new PullRequestApprovalEvent(repository, pullRequest, APPROVED)); +
+ 203 + + 206 + + } +
+ 204 + + 207 + + +
+ 205 + + 208 + + @Override +
- 213 - - 216 - - .findFirst() -
+
+
- 214 - - + 211 + + 214 + + approver.stream() +
+ 212 + + 215 + + .filter(recipient -> user.getId().equals(recipient)) +
- + 213 + + 216 + + .findFirst() +
- + 214 + + + .ifPresent(pullRequest::removeApprover); +
+ 215 + + + getStore(repository).update(pullRequest); +
- + + 217 + + .ifPresent( +
+ + 218 + + approval -> { +
- + + 219 + + pullRequest.removeApprover(approval); +
+ + 220 + + getStore(repository).update(pullRequest); +
- + + 221 + + eventBus.post(new PullRequestApprovalEvent(repository, pullRequest, APPROVAL_REMOVED)); +
+ + 222 + + }); +
- + 216 + + 223 + + } +
+ 217 + + 224 + + +
- - 222 - - }); -
- 216 - - 223 - - } -
- 217 - - 224 - - -
- 218 - - 225 - - @Override -
+ + 218 + + + 225 + + + @Override + + + + +
@@ -23398,3870 +23453,3878 @@ exports[`Storyshots Diff Line Annotation 1`] = `
-
+
- - - src/main/java/com/cloudogu/scm/review/events/EventListener.java - - - modify - -
-
+ + + src/main/java/com/cloudogu/scm/review/events/EventListener.java + + + modify + +
+
- - - - - + + + + +
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- 1 - - 1 - - package com.cloudogu.scm.review.events; -
- 2 - - 2 - - -
-

- Line Annotation -

-
- 3 - - - import com.cloudogu.scm.review.comment.service.BasicComment; -
- 4 - - - import com.cloudogu.scm.review.comment.service.BasicCommentEvent; -
- 5 - - - import com.cloudogu.scm.review.comment.service.CommentEvent; -
- 6 - - - import com.cloudogu.scm.review.comment.service.ReplyEvent; -
- 7 - - 3 - - import com.cloudogu.scm.review.pullrequest.service.BasicPullRequestEvent; -
- 8 - - 4 - - import com.cloudogu.scm.review.pullrequest.service.PullRequest; -
- 9 - - - import com.cloudogu.scm.review.pullrequest.service.PullRequestEvent; -
- 10 - - 5 - - import com.github.legman.Subscribe; -
- 11 - - - import lombok.Data; -
- 12 - - 6 - - import org.apache.shiro.SecurityUtils; -
- 13 - - 7 - - import org.apache.shiro.subject.PrincipalCollection; -
- 14 - - 8 - - import org.apache.shiro.subject.Subject; -
- 15 - - 9 - - import sonia.scm.EagerSingleton; -
- 16 - - - import sonia.scm.HandlerEventType; -
- 17 - - - import sonia.scm.event.HandlerEvent; -
- 18 - - 10 - - import sonia.scm.plugin.Extension; -
- 19 - - 11 - - import sonia.scm.repository.Repository; -
- 20 - - 12 - - import sonia.scm.security.SessionId; -
-
-
-
-
-
- - - src/main/js/ChangeNotification.tsx - - - modify - -
-
-
-
- - - - - -
-
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + - - + + + + - 6 - - + + + + - - - - - + + - 6 - - - - - - - - - - - - - + - - - - - + + - 15 - - + + + - 16 - - + + + - pullRequest: setEvent - - - - + + + - 16 - - + + + + - 17 - - + + + + - }); - - - - + + + - 17 - - + + + + - 18 - - + + + - }, [url]); - - - - + + + + - 19 - - + + + + - const { t } = useTranslation("plugins"); - - - - + + + + - 18 - - + + + + - 20 - - + + + - if (event) { - - - - + + + - 19 - - + + + + - 21 - - + + + + - return ( - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- 2 - - 2 - - import { Link } from "@scm-manager/ui-types"; -
-

- Line Annotation -

-
- 3 - - 3 - - import { apiClient, Toast, ToastButtons, ToastButton } from "@scm-manager/ui-components"; -
- 4 - - 4 - - import { PullRequest } from "./types/PullRequest"; -
+
- 5 - - import { useTranslation } from "react-i18next"; -
- 5 - + 1 + + 1 + + package com.cloudogu.scm.review.events; +
+ 2 + + 2 + + +
+

+ Line Annotation +

+
- 7 - - type HandlerProps = { -
- 7 - - 8 - - url: string; -
-
+ 3 +
-
+ import com.cloudogu.scm.review.comment.service.BasicComment; +
+ 4 + + + import com.cloudogu.scm.review.comment.service.BasicCommentEvent; +
+ 5 + + + import com.cloudogu.scm.review.comment.service.CommentEvent; +
+ 6 + + + import com.cloudogu.scm.review.comment.service.ReplyEvent; +
+ 7 + + 3 + + import com.cloudogu.scm.review.pullrequest.service.BasicPullRequestEvent; +
+ 8 + + 4 + + import com.cloudogu.scm.review.pullrequest.service.PullRequest; +
+ 9 + + + import com.cloudogu.scm.review.pullrequest.service.PullRequestEvent; +
+ 10 + + 5 + + import com.github.legman.Subscribe; +
+ 11 + + + import lombok.Data; +
- + 12 + + 6 + + import org.apache.shiro.SecurityUtils; +
+ 13 + + 7 + + import org.apache.shiro.subject.PrincipalCollection; +
+ 14 + + 8 + + import org.apache.shiro.subject.Subject; +
+ 15 + + 9 + + import sonia.scm.EagerSingleton; +
+ 16 + + + import sonia.scm.HandlerEventType; +
+ 17 + + + import sonia.scm.event.HandlerEvent; +
+ 18 + + 10 + + import sonia.scm.plugin.Extension; +
+ 19 + + 11 + + import sonia.scm.repository.Repository; +
- 20 - - - <Toast type="warning" title="New Changes"> -
- 21 - - - <p>The underlying Pull-Request has changed. Press reload to see the changes.</p> -
- 22 - - - <p>Warning: Non saved modification will be lost.</p> -
- - 22 - - <Toast type="warning" title={t("scm-review-plugin.changeNotification.title")}> -
- - 23 - - <p>{t("scm-review-plugin.changeNotification.description")}</p> -
- - 24 - - <p>{t("scm-review-plugin.changeNotification.modificationWarning")}</p> -
- 23 - - 25 - - <ToastButtons> -
- 24 - - - <ToastButton icon="redo" onClick={reload}>Reload</ToastButton> -
- 25 - - - <ToastButton icon="times" onClick={() => setEvent(undefined)}>Ignore</ToastButton> -
- - 26 - - <ToastButton icon="redo" onClick={reload}> -
- - 27 - - {t("scm-review-plugin.changeNotification.buttons.reload")} -
- - 28 - - </ToastButton> -
- - 29 - - <ToastButton icon="times" onClick={() => setEvent(undefined)}> -
- - 30 - - {t("scm-review-plugin.changeNotification.buttons.ignore")} -
- - 31 - - </ToastButton> -
- 26 - - 32 - - </ToastButtons> -
- 27 - - 33 - - </Toast> -
- 28 - - 34 - - ); -
+ + 20 + + + 12 + + + import sonia.scm.security.SessionId; + + + + +
-
-
- - - src/main/resources/locales/de/plugins.json - - - modify - -
-
+ + + src/main/js/ChangeNotification.tsx + + + modify + +
+
- - - - - + + + + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ 2 + + 2 + + import { Link } from "@scm-manager/ui-types"; +
+

+ Line Annotation +

+
+ 3 + + 3 + + import { apiClient, Toast, ToastButtons, ToastButton } from "@scm-manager/ui-components"; +
+ 4 + + 4 + + import { PullRequest } from "./types/PullRequest"; +
+ + 5 + + import { useTranslation } from "react-i18next"; +
+ 5 + + 6 + + +
+ 6 + + 7 + + type HandlerProps = { +
+ 7 + + 8 + + url: string; +
+
+
+ 15 + + 16 + + pullRequest: setEvent +
+ 16 + + 17 + + }); +
+ 17 + + 18 + + }, [url]); +
+ + 19 + + const { t } = useTranslation("plugins"); +
+ 18 + + 20 + + if (event) { +
+ 19 + + 21 + + return ( +
+ 20 + + + <Toast type="warning" title="New Changes"> +
+ 21 + + + <p>The underlying Pull-Request has changed. Press reload to see the changes.</p> +
+ 22 + + + <p>Warning: Non saved modification will be lost.</p> +
+ + 22 + + <Toast type="warning" title={t("scm-review-plugin.changeNotification.title")}> +
+ + 23 + + <p>{t("scm-review-plugin.changeNotification.description")}</p> +
+ + 24 + + <p>{t("scm-review-plugin.changeNotification.modificationWarning")}</p> +
+ 23 + + 25 + + <ToastButtons> +
+ 24 + + + <ToastButton icon="redo" onClick={reload}>Reload</ToastButton> +
+ 25 + + + <ToastButton icon="times" onClick={() => setEvent(undefined)}>Ignore</ToastButton> +
+ + 26 + + <ToastButton icon="redo" onClick={reload}> +
+ + 27 + + {t("scm-review-plugin.changeNotification.buttons.reload")} +
+ + 28 + + </ToastButton> +
+ + 29 + + <ToastButton icon="times" onClick={() => setEvent(undefined)}> +
+ + 30 + + {t("scm-review-plugin.changeNotification.buttons.ignore")} +
+ + 31 + + </ToastButton> +
+ 26 + + 32 + + </ToastButtons> +
+ 27 + + 33 + + </Toast> +
+ 28 + + 34 + + ); +
+
- - - - - - - - - - - - - + +
-
- + + + + +
+ - 181 - + - 181 - - "titleClickable": "Der Kommentar bezieht sich auf eine ältere Version des Source- oder Target-Branches. Klicken Sie hier, um den ursprünglichen Kontext zu sehen." -
- 182 - + + + + + + + + + + +
+ + + + + + + + - 182 - - + + + + + + + + + + + + - - - + - 183 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+ 181 + + 181 + + "titleClickable": "Der Kommentar bezieht sich auf eine ältere Version des Source- oder Target-Branches. Klicken Sie hier, um den ursprünglichen Kontext zu sehen." +
+ 182 + + 182 + + } +
+ 183 + + 183 + } -
+
- 183 - - } -
- - 184 - - }, -
- - 185 - - "changeNotification": { -
- - 186 - - "title": "Neue Änderungen", -
- - 187 - - "description": "An diesem Pull Request wurden Änderungen vorgenommen. Laden Sie die Seite neu um diese anzuzeigen.", -
- - 188 - - "modificationWarning": "Warnung: Nicht gespeicherte Eingaben gehen verloren.", -
- - 189 - - "buttons": { -
- - 190 - - "reload": "Neu laden", -
- - 191 - - "ignore": "Ignorieren" -
- - 192 - - } -
- 184 - - 193 - - } -
- 185 - - 194 - - }, -
- 186 - - 195 - - "permissions": { -
-
- -
-
-
-
- - - src/main/resources/locales/en/plugins.json - - - modify - -
-
-
-
- +
- - - - - - - - - -
- - - - - - - - - + + - 181 - - + + + - 181 - - + + + - "titleClickable": "The comment is related to an older of the source or target branch. Click here to see the original context." - - - - + + + - 182 - - + + + - 182 - - + + + + + + + + + + + + + - - - - - + + + + - - - - + + + + - - - + - 185 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+ + }, +
+ + 185 + + "changeNotification": { +
+ + 186 + + "title": "Neue Änderungen", +
+ + 187 + + "description": "An diesem Pull Request wurden Änderungen vorgenommen. Laden Sie die Seite neu um diese anzuzeigen.", +
+ + 188 + + "modificationWarning": "Warnung: Nicht gespeicherte Eingaben gehen verloren.", +
+ + 189 + + "buttons": { +
+ + 190 + + "reload": "Neu laden", +
+ + 191 + + "ignore": "Ignorieren" +
+ + 192 + } -
- 183 - - 183 - +
+ 184 + + 193 + } -
- - 184 - +
+ 185 + + 194 + }, -
- +
- "changeNotification": { -
- - 186 - - "title": "New Changes", -
- - 187 - - "description": "The underlying Pull-Request has changed. Press reload to see the changes.", -
- - 188 - - "modificationWarning": "Warning: Non saved modification will be lost.", -
- - 189 - - "buttons": { -
- - 190 - - "reload": "Reload", -
- - 191 - - "ignore": "Ignore" -
- - 192 - - } -
- 184 - - 193 - - } -
- 185 - - 194 - - }, -
- 186 - - 195 - - "permissions": { -
+
+ 186 + + 195 + + "permissions": { +
+
- -
- - - src/test/java/com/cloudogu/scm/review/events/ClientTest.java - - - modify - -
-
+ + + src/main/resources/locales/en/plugins.json + + + modify + +
+
- - - - - + + + + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ 181 + + 181 + + "titleClickable": "The comment is related to an older of the source or target branch. Click here to see the original context." +
+ 182 + + 182 + + } +
+ 183 + + 183 + + } +
+ + 184 + + }, +
+ + 185 + + "changeNotification": { +
+ + 186 + + "title": "New Changes", +
+ + 187 + + "description": "The underlying Pull-Request has changed. Press reload to see the changes.", +
+ + 188 + + "modificationWarning": "Warning: Non saved modification will be lost.", +
+ + 189 + + "buttons": { +
+ + 190 + + "reload": "Reload", +
+ + 191 + + "ignore": "Ignore" +
+ + 192 + + } +
+ 184 + + 193 + + } +
+ 185 + + 194 + + }, +
+ 186 + + 195 + + "permissions": { +
+
- - - - - - - - - - - - - - - - - - - - - - - - - - - + +
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + +
+
- 7 - - 7 - - import org.mockito.Mock; -
- 8 - - 8 - - import org.mockito.junit.jupiter.MockitoExtension; -
- 9 - - 9 - - import sonia.scm.security.SessionId; -
- - 10 - + - -
- 10 - - 11 - - import javax.ws.rs.sse.OutboundSseEvent; -
- 11 - - 12 - - import javax.ws.rs.sse.SseEventSink; -
- 12 - - - -
- 13 - - 13 - - import java.time.Clock; -
- 14 - - 14 - - import java.time.Instant; -
- 15 - - 15 - - import java.time.LocalDateTime; -
- 16 - - 16 - - import java.time.ZoneOffset; -
- 17 - - 17 - - import java.time.temporal.ChronoField; -
- 18 - - - import java.time.temporal.ChronoUnit; -
- 19 - - - import java.time.temporal.TemporalField; -
- 20 - - 18 - - import java.util.concurrent.CompletableFuture; -
- 21 - - 19 - - import java.util.concurrent.CompletionStage; -
- 22 - - - import java.util.concurrent.atomic.AtomicLong; -
- 23 - - 20 - - import java.util.concurrent.atomic.AtomicReference; -
- 24 - - 21 - - -
- 25 - - 22 - - import static java.time.temporal.ChronoUnit.MINUTES; -
- - + + + + + -
+ 7 + +
+ + + + + + + + + + + + + + - - - - - + + + - 83 - - + + + + - 80 - - + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ 7 + + import org.mockito.Mock; +
+ 8 + + 8 + + import org.mockito.junit.jupiter.MockitoExtension; +
+ 9 + + 9 + + import sonia.scm.security.SessionId; +
-
+ 10 + + +
+ 10 + + 11 + + import javax.ws.rs.sse.OutboundSseEvent; +
+ 11 + + 12 + + import javax.ws.rs.sse.SseEventSink; +
- 84 - - 81 - - @Test -
- 85 - - 82 - - @SuppressWarnings("unchecked") -
- 86 - - - void shouldCloseEventSinkOnFailure() throws InterruptedException { -
- - 83 - - void shouldCloseEventSinkOnFailure() { -
- 87 - - 84 - - CompletionStage future = CompletableFuture.supplyAsync(() -> { -
- 88 - - 85 - - throw new RuntimeException("failed to send message"); -
- 89 - - 86 - - }); -
-
+ 12 +
-
+ 13 + + 13 + + import java.time.Clock; +
+ 14 + + 14 + + import java.time.Instant; +
+ 15 + + 15 + + import java.time.LocalDateTime; +
+ 16 + + 16 + + import java.time.ZoneOffset; +
+ 17 + + 17 + + import java.time.temporal.ChronoField; +
+ 18 + + + import java.time.temporal.ChronoUnit; +
+ 19 + + + import java.time.temporal.TemporalField; +
+ 20 + + 18 + + import java.util.concurrent.CompletableFuture; +
+ 21 + + 19 + + import java.util.concurrent.CompletionStage; +
+ 22 + + + import java.util.concurrent.atomic.AtomicLong; +
+ 23 + + 20 + + import java.util.concurrent.atomic.AtomicReference; +
+ 24 + + 21 + + +
+ 25 + + 22 + + import static java.time.temporal.ChronoUnit.MINUTES; +
+
+
+ 83 + + 80 + + +
+ 84 + + 81 + + @Test +
+ 85 + + 82 + + @SuppressWarnings("unchecked") +
+ 86 + + + void shouldCloseEventSinkOnFailure() throws InterruptedException { +
+ + 83 + + void shouldCloseEventSinkOnFailure() { +
+ 87 + + 84 + + CompletionStage future = CompletableFuture.supplyAsync(() -> { +
+ 88 + + 85 + + throw new RuntimeException("failed to send message"); +
+ 89 + + 86 + + }); +
+
+
+ 91 + + 88 + + +
+ 92 + + 89 + + client.send(message); +
+ 93 + + 90 + + +
+ 94 + + + Thread.sleep(50L); +
+ 95 + + + +
+ 96 + + + verify(eventSink).close(); +
+ + 91 + + verify(eventSink, timeout(50L)).close(); +
+ 97 + + 92 + + } +
+ 98 + + 93 + + +
+ 99 + + 94 + + @Test +
+
+ +
+
+
- - - 91 - - - 88 - - - - - - - - 92 - - - 89 - - - client.send(message); - - - - - 93 - - - 90 - - - - - - - - 94 - - - - Thread.sleep(50L); - - - + + modify + +
+
- - 95 - - + + + + + +
+
+
+ + +
+ + + - - - - - - - + + - - + + + - verify(eventSink, timeout(50L)).close(); - - - - + + + + - 97 - - + + + + - 92 - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - -
- -
- 96 - - - verify(eventSink).close(); -
- - 91 - + + 1 + + import java.io.PrintStream; +
+ 1 + + 2 + + import java.util.Arrays; +
+ 2 + + 3 + + +
+

+ Line Annotation +

+
+ 3 + + 4 + + class Main { +
+ + 5 + + private static final PrintStream OUT = System.out; +
+ + 6 + + +
+ 4 + + 7 + + public static void main(String[] args) { +
+ + 8 + + <<<<<<< HEAD +
+ 5 + + 9 + + System.out.println("Expect nothing more to happen."); +
+ 6 + + 10 + + System.out.println("The command line parameters are:"); +
+ 7 + + 11 + + Arrays.stream(args).map(arg -> "- " + arg).forEach(System.out::println); +
+ + 12 + + ======= +
+ + 13 + + OUT.println("Expect nothing more to happen."); +
+ + 14 + + OUT.println("Parameters:"); +
+ + 15 + + Arrays.stream(args).map(arg -> "- " + arg).forEach(OUT::println); +
+ + 16 + + >>>>>>> feature/use_constant +
+ 8 + + 17 + + } +
+ 9 + + 18 + } -
- 98 - - 93 - - -
- 99 - - 94 - - @Test -
-
- -
-
-
-
- - - Main.java - - - modify - -
-
-
-
- - - - - -
-
-
+ + + +
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - 1 - - import java.io.PrintStream; -
- 1 - - 2 - - import java.util.Arrays; -
- 2 - - 3 - - -
-

- Line Annotation -

-
- 3 - - 4 - - class Main { -
- - 5 - - private static final PrintStream OUT = System.out; -
- - 6 - - -
- 4 - - 7 - - public static void main(String[] args) { -
- - 8 - - <<<<<<< HEAD -
- 5 - - 9 - - System.out.println("Expect nothing more to happen."); -
- 6 - - 10 - - System.out.println("The command line parameters are:"); -
- 7 - - 11 - - Arrays.stream(args).map(arg -> "- " + arg).forEach(System.out::println); -
- - 12 - - ======= -
- - 13 - - OUT.println("Expect nothing more to happen."); -
- - 14 - - OUT.println("Parameters:"); -
- - 15 - - Arrays.stream(args).map(arg -> "- " + arg).forEach(OUT::println); -
- - 16 - - >>>>>>> feature/use_constant -
- 8 - - 17 - - } -
- 9 - - 18 - - } -
-
`; @@ -27270,4108 +27333,4116 @@ exports[`Storyshots Diff OnClick 1`] = `
-
+
- - - src/main/java/com/cloudogu/scm/review/events/EventListener.java - - - modify - -
-
+ + + src/main/java/com/cloudogu/scm/review/events/EventListener.java + + + modify + +
+
- - - - - + + + + +
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- 1 - - 1 - - package com.cloudogu.scm.review.events; -
- 2 - - 2 - - -
- 3 - - - import com.cloudogu.scm.review.comment.service.BasicComment; -
- 4 - - - import com.cloudogu.scm.review.comment.service.BasicCommentEvent; -
- 5 - - - import com.cloudogu.scm.review.comment.service.CommentEvent; -
- 6 - - - import com.cloudogu.scm.review.comment.service.ReplyEvent; -
- 7 - - 3 - - import com.cloudogu.scm.review.pullrequest.service.BasicPullRequestEvent; -
- 8 - - 4 - - import com.cloudogu.scm.review.pullrequest.service.PullRequest; -
- 9 - - - import com.cloudogu.scm.review.pullrequest.service.PullRequestEvent; -
- 10 - - 5 - - import com.github.legman.Subscribe; -
- 11 - - - import lombok.Data; -
- 12 - - 6 - - import org.apache.shiro.SecurityUtils; -
- 13 - - 7 - - import org.apache.shiro.subject.PrincipalCollection; -
- 14 - - 8 - - import org.apache.shiro.subject.Subject; -
- 15 - - 9 - - import sonia.scm.EagerSingleton; -
- 16 - - - import sonia.scm.HandlerEventType; -
- 17 - - - import sonia.scm.event.HandlerEvent; -
- 18 - - 10 - - import sonia.scm.plugin.Extension; -
- 19 - - 11 - - import sonia.scm.repository.Repository; -
- 20 - - 12 - - import sonia.scm.security.SessionId; -
-
-
-
-
-
- - - src/main/js/ChangeNotification.tsx - - - modify - -
-
-
-
- - - - - -
-
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + - - + + + + - 6 - - + + + + - - - - - - - - - - - - - - - - - + - - - - - + + - 15 - - + + + - 16 - - + + + - pullRequest: setEvent - - - - + + + - 16 - - + + + + - 17 - - + + + + - }); - - - - + + + - 17 - - + + + + - 18 - - + + + - }, [url]); - - - - + + + + - 19 - - + + + + - const { t } = useTranslation("plugins"); - - - - + + + + - 18 - - + + + + - 20 - - + + + - if (event) { - - - - + + + - 19 - - + + + + - 21 - - + + + + - return ( - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- 2 - - 2 - - import { Link } from "@scm-manager/ui-types"; -
- 3 - - 3 - - import { apiClient, Toast, ToastButtons, ToastButton } from "@scm-manager/ui-components"; -
- 4 - - 4 - - import { PullRequest } from "./types/PullRequest"; -
+
- 5 - - import { useTranslation } from "react-i18next"; -
- 5 - + 1 + + 1 + + package com.cloudogu.scm.review.events; +
+ 2 + + 2 + + +
- 6 - - 7 - - type HandlerProps = { -
- 7 - - 8 - - url: string; -
-
+ 3 +
-
+ import com.cloudogu.scm.review.comment.service.BasicComment; +
+ 4 + + + import com.cloudogu.scm.review.comment.service.BasicCommentEvent; +
+ 5 + + + import com.cloudogu.scm.review.comment.service.CommentEvent; +
+ 6 + + + import com.cloudogu.scm.review.comment.service.ReplyEvent; +
+ 7 + + 3 + + import com.cloudogu.scm.review.pullrequest.service.BasicPullRequestEvent; +
+ 8 + + 4 + + import com.cloudogu.scm.review.pullrequest.service.PullRequest; +
+ 9 + + + import com.cloudogu.scm.review.pullrequest.service.PullRequestEvent; +
+ 10 + + 5 + + import com.github.legman.Subscribe; +
+ 11 + + + import lombok.Data; +
- + 12 + + 6 + + import org.apache.shiro.SecurityUtils; +
+ 13 + + 7 + + import org.apache.shiro.subject.PrincipalCollection; +
+ 14 + + 8 + + import org.apache.shiro.subject.Subject; +
+ 15 + + 9 + + import sonia.scm.EagerSingleton; +
+ 16 + + + import sonia.scm.HandlerEventType; +
+ 17 + + + import sonia.scm.event.HandlerEvent; +
+ 18 + + 10 + + import sonia.scm.plugin.Extension; +
+ 19 + + 11 + + import sonia.scm.repository.Repository; +
- 20 - - - <Toast type="warning" title="New Changes"> -
- 21 - - - <p>The underlying Pull-Request has changed. Press reload to see the changes.</p> -
- 22 - - - <p>Warning: Non saved modification will be lost.</p> -
- - 22 - - <Toast type="warning" title={t("scm-review-plugin.changeNotification.title")}> -
- - 23 - - <p>{t("scm-review-plugin.changeNotification.description")}</p> -
- - 24 - - <p>{t("scm-review-plugin.changeNotification.modificationWarning")}</p> -
- 23 - - 25 - - <ToastButtons> -
- 24 - - - <ToastButton icon="redo" onClick={reload}>Reload</ToastButton> -
- 25 - - - <ToastButton icon="times" onClick={() => setEvent(undefined)}>Ignore</ToastButton> -
- - 26 - - <ToastButton icon="redo" onClick={reload}> -
- - 27 - - {t("scm-review-plugin.changeNotification.buttons.reload")} -
- - 28 - - </ToastButton> -
- - 29 - - <ToastButton icon="times" onClick={() => setEvent(undefined)}> -
- - 30 - - {t("scm-review-plugin.changeNotification.buttons.ignore")} -
- - 31 - - </ToastButton> -
- 26 - - 32 - - </ToastButtons> -
- 27 - - 33 - - </Toast> -
- 28 - - 34 - - ); -
+ + 20 + + + 12 + + + import sonia.scm.security.SessionId; + + + + +
-
-
- - - src/main/resources/locales/de/plugins.json - - - modify - -
-
+ + + src/main/js/ChangeNotification.tsx + + + modify + +
+
- - - - - + + + + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ 2 + + 2 + + import { Link } from "@scm-manager/ui-types"; +
+ 3 + + 3 + + import { apiClient, Toast, ToastButtons, ToastButton } from "@scm-manager/ui-components"; +
+ 4 + + 4 + + import { PullRequest } from "./types/PullRequest"; +
+ + 5 + + import { useTranslation } from "react-i18next"; +
+ 5 + + 6 + + +
+ 6 + + 7 + + type HandlerProps = { +
+ 7 + + 8 + + url: string; +
+
+
+ 15 + + 16 + + pullRequest: setEvent +
+ 16 + + 17 + + }); +
+ 17 + + 18 + + }, [url]); +
+ + 19 + + const { t } = useTranslation("plugins"); +
+ 18 + + 20 + + if (event) { +
+ 19 + + 21 + + return ( +
+ 20 + + + <Toast type="warning" title="New Changes"> +
+ 21 + + + <p>The underlying Pull-Request has changed. Press reload to see the changes.</p> +
+ 22 + + + <p>Warning: Non saved modification will be lost.</p> +
+ + 22 + + <Toast type="warning" title={t("scm-review-plugin.changeNotification.title")}> +
+ + 23 + + <p>{t("scm-review-plugin.changeNotification.description")}</p> +
+ + 24 + + <p>{t("scm-review-plugin.changeNotification.modificationWarning")}</p> +
+ 23 + + 25 + + <ToastButtons> +
+ 24 + + + <ToastButton icon="redo" onClick={reload}>Reload</ToastButton> +
+ 25 + + + <ToastButton icon="times" onClick={() => setEvent(undefined)}>Ignore</ToastButton> +
+ + 26 + + <ToastButton icon="redo" onClick={reload}> +
+ + 27 + + {t("scm-review-plugin.changeNotification.buttons.reload")} +
+ + 28 + + </ToastButton> +
+ + 29 + + <ToastButton icon="times" onClick={() => setEvent(undefined)}> +
+ + 30 + + {t("scm-review-plugin.changeNotification.buttons.ignore")} +
+ + 31 + + </ToastButton> +
+ 26 + + 32 + + </ToastButtons> +
+ 27 + + 33 + + </Toast> +
+ 28 + + 34 + + ); +
+
- - - - - - - - - - - - - + +
-
- + + + + +
+ - 181 - + - 181 - - "titleClickable": "Der Kommentar bezieht sich auf eine ältere Version des Source- oder Target-Branches. Klicken Sie hier, um den ursprünglichen Kontext zu sehen." -
- 182 - + + + + + + + + + + +
+ + + + + + + + - 182 - - + + + + + + + + + + + + - - - + - 183 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+ 181 + + 181 + + "titleClickable": "Der Kommentar bezieht sich auf eine ältere Version des Source- oder Target-Branches. Klicken Sie hier, um den ursprünglichen Kontext zu sehen." +
+ 182 + + 182 + + } +
+ 183 + + 183 + } -
+
- 183 - - } -
- - 184 - - }, -
- - 185 - - "changeNotification": { -
- - 186 - - "title": "Neue Änderungen", -
- - 187 - - "description": "An diesem Pull Request wurden Änderungen vorgenommen. Laden Sie die Seite neu um diese anzuzeigen.", -
- - 188 - - "modificationWarning": "Warnung: Nicht gespeicherte Eingaben gehen verloren.", -
- - 189 - - "buttons": { -
- - 190 - - "reload": "Neu laden", -
- - 191 - - "ignore": "Ignorieren" -
- - 192 - - } -
- 184 - - 193 - - } -
- 185 - - 194 - - }, -
- 186 - - 195 - - "permissions": { -
-
- -
-
-
-
- - - src/main/resources/locales/en/plugins.json - - - modify - -
-
-
-
- +
- - - - - - - - - -
- - - - - - - - - + + - 181 - - + + + - 181 - - + + + - "titleClickable": "The comment is related to an older of the source or target branch. Click here to see the original context." - - - - + + + - 182 - - + + + - 182 - - + + + + + + + + + + + + + - - - - - + + + + - - - - + + + + - - - + - 185 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+ + }, +
+ + 185 + + "changeNotification": { +
+ + 186 + + "title": "Neue Änderungen", +
+ + 187 + + "description": "An diesem Pull Request wurden Änderungen vorgenommen. Laden Sie die Seite neu um diese anzuzeigen.", +
+ + 188 + + "modificationWarning": "Warnung: Nicht gespeicherte Eingaben gehen verloren.", +
+ + 189 + + "buttons": { +
+ + 190 + + "reload": "Neu laden", +
+ + 191 + + "ignore": "Ignorieren" +
+ + 192 + } -
- 183 - - 183 - +
+ 184 + + 193 + } -
- - 184 - +
+ 185 + + 194 + }, -
- +
- "changeNotification": { -
- - 186 - - "title": "New Changes", -
- - 187 - - "description": "The underlying Pull-Request has changed. Press reload to see the changes.", -
- - 188 - - "modificationWarning": "Warning: Non saved modification will be lost.", -
- - 189 - - "buttons": { -
- - 190 - - "reload": "Reload", -
- - 191 - - "ignore": "Ignore" -
- - 192 - - } -
- 184 - - 193 - - } -
- 185 - - 194 - - }, -
- 186 - - 195 - - "permissions": { -
+
+ 186 + + 195 + + "permissions": { +
+
- -
- - - src/test/java/com/cloudogu/scm/review/events/ClientTest.java - - - modify - -
-
+ + + src/main/resources/locales/en/plugins.json + + + modify + +
+
- - - - - + + + + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ 181 + + 181 + + "titleClickable": "The comment is related to an older of the source or target branch. Click here to see the original context." +
+ 182 + + 182 + + } +
+ 183 + + 183 + + } +
+ + 184 + + }, +
+ + 185 + + "changeNotification": { +
+ + 186 + + "title": "New Changes", +
+ + 187 + + "description": "The underlying Pull-Request has changed. Press reload to see the changes.", +
+ + 188 + + "modificationWarning": "Warning: Non saved modification will be lost.", +
+ + 189 + + "buttons": { +
+ + 190 + + "reload": "Reload", +
+ + 191 + + "ignore": "Ignore" +
+ + 192 + + } +
+ 184 + + 193 + + } +
+ 185 + + 194 + + }, +
+ 186 + + 195 + + "permissions": { +
+
- - - - - - - - - - - - - - - - - - - - - - - - - - - + +
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + +
+
- 7 - - 7 - - import org.mockito.Mock; -
- 8 - - 8 - - import org.mockito.junit.jupiter.MockitoExtension; -
- 9 - - 9 - - import sonia.scm.security.SessionId; -
- - 10 - + - -
- 10 - - 11 - - import javax.ws.rs.sse.OutboundSseEvent; -
- 11 - - 12 - - import javax.ws.rs.sse.SseEventSink; -
- 12 - - - -
- 13 - - 13 - - import java.time.Clock; -
- 14 - - 14 - - import java.time.Instant; -
- 15 - - 15 - - import java.time.LocalDateTime; -
- 16 - - 16 - - import java.time.ZoneOffset; -
- 17 - - 17 - - import java.time.temporal.ChronoField; -
- 18 - - - import java.time.temporal.ChronoUnit; -
- 19 - - - import java.time.temporal.TemporalField; -
- 20 - - 18 - - import java.util.concurrent.CompletableFuture; -
- 21 - - 19 - - import java.util.concurrent.CompletionStage; -
- 22 - - - import java.util.concurrent.atomic.AtomicLong; -
- 23 - - 20 - - import java.util.concurrent.atomic.AtomicReference; -
- 24 - - 21 - - -
- 25 - - 22 - - import static java.time.temporal.ChronoUnit.MINUTES; -
- - + + + + + -
+ 7 + +
+ + + + + + + + + + + + + + - - - - - + + + - 83 - - + + + + - 80 - - + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ 7 + + import org.mockito.Mock; +
+ 8 + + 8 + + import org.mockito.junit.jupiter.MockitoExtension; +
+ 9 + + 9 + + import sonia.scm.security.SessionId; +
-
+ 10 + + +
+ 10 + + 11 + + import javax.ws.rs.sse.OutboundSseEvent; +
+ 11 + + 12 + + import javax.ws.rs.sse.SseEventSink; +
- 84 - - 81 - - @Test -
- 85 - - 82 - - @SuppressWarnings("unchecked") -
- 86 - - - void shouldCloseEventSinkOnFailure() throws InterruptedException { -
- - 83 - - void shouldCloseEventSinkOnFailure() { -
- 87 - - 84 - - CompletionStage future = CompletableFuture.supplyAsync(() -> { -
- 88 - - 85 - - throw new RuntimeException("failed to send message"); -
- 89 - - 86 - - }); -
-
+ 12 +
-
+ 13 + + 13 + + import java.time.Clock; +
+ 14 + + 14 + + import java.time.Instant; +
+ 15 + + 15 + + import java.time.LocalDateTime; +
+ 16 + + 16 + + import java.time.ZoneOffset; +
+ 17 + + 17 + + import java.time.temporal.ChronoField; +
+ 18 + + + import java.time.temporal.ChronoUnit; +
+ 19 + + + import java.time.temporal.TemporalField; +
+ 20 + + 18 + + import java.util.concurrent.CompletableFuture; +
+ 21 + + 19 + + import java.util.concurrent.CompletionStage; +
+ 22 + + + import java.util.concurrent.atomic.AtomicLong; +
+ 23 + + 20 + + import java.util.concurrent.atomic.AtomicReference; +
+ 24 + + 21 + + +
+ 25 + + 22 + + import static java.time.temporal.ChronoUnit.MINUTES; +
+
+
+ 83 + + 80 + + +
+ 84 + + 81 + + @Test +
+ 85 + + 82 + + @SuppressWarnings("unchecked") +
+ 86 + + + void shouldCloseEventSinkOnFailure() throws InterruptedException { +
+ + 83 + + void shouldCloseEventSinkOnFailure() { +
+ 87 + + 84 + + CompletionStage future = CompletableFuture.supplyAsync(() -> { +
+ 88 + + 85 + + throw new RuntimeException("failed to send message"); +
+ 89 + + 86 + + }); +
+
+
+ 91 + + 88 + + +
+ 92 + + 89 + + client.send(message); +
+ 93 + + 90 + + +
+ 94 + + + Thread.sleep(50L); +
+ 95 + + + +
+ 96 + + + verify(eventSink).close(); +
+ + 91 + + verify(eventSink, timeout(50L)).close(); +
+ 97 + + 92 + + } +
+ 98 + + 93 + + +
+ 99 + + 94 + + @Test +
+
+ +
+
+
- - - 91 - - - 88 - - - - - - - - 92 - - - 89 - - - client.send(message); - - - - - 93 - - - 90 - - - - - - - - 94 - - - - Thread.sleep(50L); - - - + + modify + +
+
- - 95 - - + + + + + +
+
+
+ + +
+ + + - - - - - - - + + - - + + + - verify(eventSink, timeout(50L)).close(); - - - - + + + + - 97 - - + + + + - 92 - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - -
- -
- 96 - - - verify(eventSink).close(); -
- - 91 - + + 1 + + import java.io.PrintStream; +
+ 1 + + 2 + + import java.util.Arrays; +
+ 2 + + 3 + + +
+ 3 + + 4 + + class Main { +
+ + 5 + + private static final PrintStream OUT = System.out; +
+ + 6 + + +
+ 4 + + 7 + + public static void main(String[] args) { +
+ + 8 + + <<<<<<< HEAD +
+ 5 + + 9 + + System.out.println("Expect nothing more to happen."); +
+ 6 + + 10 + + System.out.println("The command line parameters are:"); +
+ 7 + + 11 + + Arrays.stream(args).map(arg -> "- " + arg).forEach(System.out::println); +
+ + 12 + + ======= +
+ + 13 + + OUT.println("Expect nothing more to happen."); +
+ + 14 + + OUT.println("Parameters:"); +
+ + 15 + + Arrays.stream(args).map(arg -> "- " + arg).forEach(OUT::println); +
+ + 16 + + >>>>>>> feature/use_constant +
+ 8 + + 17 + + } +
+ 9 + + 18 + } -
- 98 - - 93 - - -
- 99 - - 94 - - @Test -
-
- -
-
-
-
- - - Main.java - - - modify - -
-
-
-
- - - - - -
-
-
+ + + +
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - 1 - - import java.io.PrintStream; -
- 1 - - 2 - - import java.util.Arrays; -
- 2 - - 3 - - -
- 3 - - 4 - - class Main { -
- - 5 - - private static final PrintStream OUT = System.out; -
- - 6 - - -
- 4 - - 7 - - public static void main(String[] args) { -
- - 8 - - <<<<<<< HEAD -
- 5 - - 9 - - System.out.println("Expect nothing more to happen."); -
- 6 - - 10 - - System.out.println("The command line parameters are:"); -
- 7 - - 11 - - Arrays.stream(args).map(arg -> "- " + arg).forEach(System.out::println); -
- - 12 - - ======= -
- - 13 - - OUT.println("Expect nothing more to happen."); -
- - 14 - - OUT.println("Parameters:"); -
- - 15 - - Arrays.stream(args).map(arg -> "- " + arg).forEach(OUT::println); -
- - 16 - - >>>>>>> feature/use_constant -
- 8 - - 17 - - } -
- 9 - - 18 - - } -
-
`; @@ -31380,4362 +31451,4370 @@ exports[`Storyshots Diff Side-By-Side 1`] = `
-
+
- - - src/main/java/com/cloudogu/scm/review/events/EventListener.java - - - modify - -
-
+ + + src/main/java/com/cloudogu/scm/review/events/EventListener.java + + + modify + +
+
- - - - - + + + + +
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- 1 - - package com.cloudogu.scm.review.events; - - 1 - - package com.cloudogu.scm.review.events; -
- 2 - - - - 2 - - -
- 3 - - import com.cloudogu.scm.review.comment.service.BasicComment; - - -
- 4 - - import com.cloudogu.scm.review.comment.service.BasicCommentEvent; - - -
- 5 - - import com.cloudogu.scm.review.comment.service.CommentEvent; - - -
- 6 - - import com.cloudogu.scm.review.comment.service.ReplyEvent; - - -
- 7 - - import com.cloudogu.scm.review.pullrequest.service.BasicPullRequestEvent; - - 3 - - import com.cloudogu.scm.review.pullrequest.service.BasicPullRequestEvent; -
- 8 - - import com.cloudogu.scm.review.pullrequest.service.PullRequest; - - 4 - - import com.cloudogu.scm.review.pullrequest.service.PullRequest; -
- 9 - - import com.cloudogu.scm.review.pullrequest.service.PullRequestEvent; - - -
- 10 - - import com.github.legman.Subscribe; - - 5 - - import com.github.legman.Subscribe; -
- 11 - - import lombok.Data; - - -
- 12 - - import org.apache.shiro.SecurityUtils; - - 6 - - import org.apache.shiro.SecurityUtils; -
- 13 - - import org.apache.shiro.subject.PrincipalCollection; - - 7 - - import org.apache.shiro.subject.PrincipalCollection; -
- 14 - - import org.apache.shiro.subject.Subject; - - 8 - - import org.apache.shiro.subject.Subject; -
- 15 - - import sonia.scm.EagerSingleton; - - 9 - - import sonia.scm.EagerSingleton; -
- 16 - - import sonia.scm.HandlerEventType; - - -
- 17 - - import sonia.scm.event.HandlerEvent; - - -
- 18 - - import sonia.scm.plugin.Extension; - - 10 - - import sonia.scm.plugin.Extension; -
- 19 - - import sonia.scm.repository.Repository; - - 11 - - import sonia.scm.repository.Repository; -
- 20 - - import sonia.scm.security.SessionId; - - 12 - - import sonia.scm.security.SessionId; -
-
-
-
-
-
- - + + + + + + - src/main/js/ChangeNotification.tsx - - - modify - -
-
-
-
- - - - - -
-
-
-
-
-
- - - - - - - - - - + + + + - 2 - - + + + + + - import { Link } from "@scm-manager/ui-types"; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+ + package com.cloudogu.scm.review.events; + + 1 + + package com.cloudogu.scm.review.events; +
+ 2 + + + + 2 + + +
- 2 - - import { Link } from "@scm-manager/ui-types"; -
- 3 - - import { apiClient, Toast, ToastButtons, ToastButton } from "@scm-manager/ui-components"; - - 3 - - import { apiClient, Toast, ToastButtons, ToastButton } from "@scm-manager/ui-components"; -
- 4 - - import { PullRequest } from "./types/PullRequest"; - - 4 - - import { PullRequest } from "./types/PullRequest"; -
- - - 5 - - import { useTranslation } from "react-i18next"; -
- 5 - - - - 6 - - -
- 6 - - type HandlerProps = { - - 7 - - type HandlerProps = { -
- 7 - - url: string; - - 8 - - url: string; -
-
+ 3 +
+ import com.cloudogu.scm.review.comment.service.BasicComment; + -
- 15 - - pullRequest: setEvent - - 16 - - pullRequest: setEvent -
- 16 - - }); - - 17 - - }); -
- 17 - - }, [url]); - - 18 - - }, [url]); -
- - - 19 - - const { t } = useTranslation("plugins"); -
- 18 - - if (event) { - - 20 - - if (event) { -
- 19 - - return ( - - 21 - - return ( -
- 20 - - <Toast type="warning" title="New Changes"> - - -
- 21 - - <p>The underlying Pull-Request has changed. Press reload to see the changes.</p> - - -
- 22 - - <p>Warning: Non saved modification will be lost.</p> - - 22 - - <Toast type="warning" title={t("scm-review-plugin.changeNotification.title")}> -
- - - 23 - - <p>{t("scm-review-plugin.changeNotification.description")}</p> -
- - - 24 - - <p>{t("scm-review-plugin.changeNotification.modificationWarning")}</p> -
- 23 - - <ToastButtons> - - 25 - - <ToastButtons> -
- 24 - - <ToastButton icon="redo" onClick={reload}>Reload</ToastButton> - - -
- 25 - - <ToastButton icon="times" onClick={() => setEvent(undefined)}>Ignore</ToastButton> - - 26 - - <ToastButton icon="redo" onClick={reload}> -
- - - 27 - - {t("scm-review-plugin.changeNotification.buttons.reload")} -
- - - 28 - - </ToastButton> -
- - - 29 - - <ToastButton icon="times" onClick={() => setEvent(undefined)}> -
- - - 30 - - {t("scm-review-plugin.changeNotification.buttons.ignore")} -
- - - 31 - - </ToastButton> -
- 26 - - </ToastButtons> - - 32 - - </ToastButtons> -
- 27 - - </Toast> - - 33 - - </Toast> -
- 28 - - ); - - 34 - - ); -
+ + + + + 4 + + + import com.cloudogu.scm.review.comment.service.BasicCommentEvent; + + + + + + + 5 + + + import com.cloudogu.scm.review.comment.service.CommentEvent; + + + + + + + 6 + + + import com.cloudogu.scm.review.comment.service.ReplyEvent; + + + + + + + 7 + + + import com.cloudogu.scm.review.pullrequest.service.BasicPullRequestEvent; + + + 3 + + + import com.cloudogu.scm.review.pullrequest.service.BasicPullRequestEvent; + + + + + 8 + + + import com.cloudogu.scm.review.pullrequest.service.PullRequest; + + + 4 + + + import com.cloudogu.scm.review.pullrequest.service.PullRequest; + + + + + 9 + + + import com.cloudogu.scm.review.pullrequest.service.PullRequestEvent; + + + + + + + 10 + + + import com.github.legman.Subscribe; + + + 5 + + + import com.github.legman.Subscribe; + + + + + 11 + + + import lombok.Data; + + + + + + + 12 + + + import org.apache.shiro.SecurityUtils; + + + 6 + + + import org.apache.shiro.SecurityUtils; + + + + + 13 + + + import org.apache.shiro.subject.PrincipalCollection; + + + 7 + + + import org.apache.shiro.subject.PrincipalCollection; + + + + + 14 + + + import org.apache.shiro.subject.Subject; + + + 8 + + + import org.apache.shiro.subject.Subject; + + + + + 15 + + + import sonia.scm.EagerSingleton; + + + 9 + + + import sonia.scm.EagerSingleton; + + + + + 16 + + + import sonia.scm.HandlerEventType; + + + + + + + 17 + + + import sonia.scm.event.HandlerEvent; + + + + + + + 18 + + + import sonia.scm.plugin.Extension; + + + 10 + + + import sonia.scm.plugin.Extension; + + + + + 19 + + + import sonia.scm.repository.Repository; + + + 11 + + + import sonia.scm.repository.Repository; + + + + + 20 + + + import sonia.scm.security.SessionId; + + + 12 + + + import sonia.scm.security.SessionId; + + + + +
-
-
- - - src/main/resources/locales/de/plugins.json - - - modify - -
-
+ + + src/main/js/ChangeNotification.tsx + + + modify + +
+
- - - - - + + + + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ 2 + + import { Link } from "@scm-manager/ui-types"; + + 2 + + import { Link } from "@scm-manager/ui-types"; +
+ 3 + + import { apiClient, Toast, ToastButtons, ToastButton } from "@scm-manager/ui-components"; + + 3 + + import { apiClient, Toast, ToastButtons, ToastButton } from "@scm-manager/ui-components"; +
+ 4 + + import { PullRequest } from "./types/PullRequest"; + + 4 + + import { PullRequest } from "./types/PullRequest"; +
+ + + 5 + + import { useTranslation } from "react-i18next"; +
+ 5 + + + + 6 + + +
+ 6 + + type HandlerProps = { + + 7 + + type HandlerProps = { +
+ 7 + + url: string; + + 8 + + url: string; +
+
+
+ 15 + + pullRequest: setEvent + + 16 + + pullRequest: setEvent +
+ 16 + + }); + + 17 + + }); +
+ 17 + + }, [url]); + + 18 + + }, [url]); +
+ + + 19 + + const { t } = useTranslation("plugins"); +
+ 18 + + if (event) { + + 20 + + if (event) { +
+ 19 + + return ( + + 21 + + return ( +
+ 20 + + <Toast type="warning" title="New Changes"> + + +
+ 21 + + <p>The underlying Pull-Request has changed. Press reload to see the changes.</p> + + +
+ 22 + + <p>Warning: Non saved modification will be lost.</p> + + 22 + + <Toast type="warning" title={t("scm-review-plugin.changeNotification.title")}> +
+ + + 23 + + <p>{t("scm-review-plugin.changeNotification.description")}</p> +
+ + + 24 + + <p>{t("scm-review-plugin.changeNotification.modificationWarning")}</p> +
+ 23 + + <ToastButtons> + + 25 + + <ToastButtons> +
+ 24 + + <ToastButton icon="redo" onClick={reload}>Reload</ToastButton> + + +
+ 25 + + <ToastButton icon="times" onClick={() => setEvent(undefined)}>Ignore</ToastButton> + + 26 + + <ToastButton icon="redo" onClick={reload}> +
+ + + 27 + + {t("scm-review-plugin.changeNotification.buttons.reload")} +
+ + + 28 + + </ToastButton> +
+ + + 29 + + <ToastButton icon="times" onClick={() => setEvent(undefined)}> +
+ + + 30 + + {t("scm-review-plugin.changeNotification.buttons.ignore")} +
+ + + 31 + + </ToastButton> +
+ 26 + + </ToastButtons> + + 32 + + </ToastButtons> +
+ 27 + + </Toast> + + 33 + + </Toast> +
+ 28 + + ); + + 34 + + ); +
+
- - - - - - - - - - - - - - - - - - - - - - - - - - - - + - - - + +
-
- - - + + + + + + + + + + +
+
- 181 - - "titleClickable": "Der Kommentar bezieht sich auf eine ältere Version des Source- oder Target-Branches. Klicken Sie hier, um den ursprünglichen Kontext zu sehen." - - 181 - - "titleClickable": "Der Kommentar bezieht sich auf eine ältere Version des Source- oder Target-Branches. Klicken Sie hier, um den ursprünglichen Kontext zu sehen." -
- 182 - - } - - 182 - - } -
- 183 - - } - - 183 - - } -
- + src/main/resources/locales/de/plugins.json + + + modify + + +
+
+
+ + + + + +
+
+
+ + +
+ + + - + + + + - 184 - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+
+ 181 + + "titleClickable": "Der Kommentar bezieht sich auf eine ältere Version des Source- oder Target-Branches. Klicken Sie hier, um den ursprünglichen Kontext zu sehen." + + 181 + + "titleClickable": "Der Kommentar bezieht sich auf eine ältere Version des Source- oder Target-Branches. Klicken Sie hier, um den ursprünglichen Kontext zu sehen." +
+ 182 + + } + + 182 + + } +
+ 183 + + } + + 183 + + } +
+ + + 184 + + }, +
+ + + 185 + + "changeNotification": { +
+ + + 186 + + "title": "Neue Änderungen", +
+ + + 187 + + "description": "An diesem Pull Request wurden Änderungen vorgenommen. Laden Sie die Seite neu um diese anzuzeigen.", +
+ + + 188 + + "modificationWarning": "Warnung: Nicht gespeicherte Eingaben gehen verloren.", +
+ + + 189 + + "buttons": { +
+ + + 190 + + "reload": "Neu laden", +
+ + + 191 + + "ignore": "Ignorieren" +
+ + + 192 + + } +
+ 184 + + } + + 193 + + } +
+ 185 + }, -
- - - 185 - - "changeNotification": { -
- - - 186 - - "title": "Neue Änderungen", -
- - - 187 - - "description": "An diesem Pull Request wurden Änderungen vorgenommen. Laden Sie die Seite neu um diese anzuzeigen.", -
- - - 188 - - "modificationWarning": "Warnung: Nicht gespeicherte Eingaben gehen verloren.", -
- - - 189 - - "buttons": { -
- - - 190 - - "reload": "Neu laden", -
- - - 191 - - "ignore": "Ignorieren" -
- - - 192 - - } -
- 184 - - } - - 193 - - } -
- 185 - - }, - - 194 - - }, -
- 186 - - "permissions": { - - 195 - - "permissions": { -
-
- -
-
-
-
- - - src/main/resources/locales/en/plugins.json - - - modify - -
-
-
-
- +
+ 194 + - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + +
- 181 - - "titleClickable": "The comment is related to an older of the source or target branch. Click here to see the original context." - - 181 - - "titleClickable": "The comment is related to an older of the source or target branch. Click here to see the original context." -
- 182 - - } - - 182 - - } -
- 183 - - } - - 183 - - } -
- - - 184 - }, -
+ 186 + + "permissions": { + + 195 + + "permissions": { +
+
+ +
+
+
+
-
- - - 185 - + - "changeNotification": { -
- - - 186 - - "title": "New Changes", -
+ + + + + + + - - + + + + + - "description": "The underlying Pull-Request has changed. Press reload to see the changes.", - - - - + + + + + - 188 - - + + + + + - "modificationWarning": "Warning: Non saved modification will be lost.", - - - - + + + - 189 - - + + + - "buttons": { - - - - + + + - 190 - - + + + - "reload": "Reload", - - - - + + + - 191 - - + + + - "ignore": "Ignore" - - - - + + + - 192 - - + + + + + + + + + - - - + + + - 184 - - + + + + + - } - - - - - - - - - - - - - - - - - -
- - - 187 - + 181 + + "titleClickable": "The comment is related to an older of the source or target branch. Click here to see the original context." + + 181 + + "titleClickable": "The comment is related to an older of the source or target branch. Click here to see the original context." +
- - + 182 + + } + + 182 + + } +
+ 183 + + } + + 183 + + } +
- - + + + 184 + + }, +
+ + + 185 + + "changeNotification": { +
- - + + + 186 + + "title": "New Changes", +
+ + + 187 + + "description": "The underlying Pull-Request has changed. Press reload to see the changes.", +
- - + + + 188 + + "modificationWarning": "Warning: Non saved modification will be lost.", +
+ + + 189 + + "buttons": { +
- - + + + 190 + + "reload": "Reload", +
+ + + 191 + + "ignore": "Ignore" +
+ + + 192 + + } +
+ 184 + } -
+ + 193 + + } +
+ 185 + + }, + + 194 + + }, +
- 193 - - } -
- 185 - - }, - - 194 - - }, -
- 186 - - "permissions": { - - 195 - - "permissions": { -
+ + 186 + + + "permissions": { + + + 195 + + + "permissions": { + + + + +
- -
- - - src/test/java/com/cloudogu/scm/review/events/ClientTest.java - - - modify - -
-
+ + + src/test/java/com/cloudogu/scm/review/events/ClientTest.java + + + modify + +
+
- - - - - + + + + +
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + - - + + + + + - import javax.ws.rs.sse.OutboundSseEvent; - - + + + + + - 11 - - + + + + + - import javax.ws.rs.sse.OutboundSseEvent; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + 10 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - + + + + - - + + + + + - client.send(message); - - + + + + + - 89 - - + + + + + - client.send(message); - - - + 86 + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - + + + + - - + + + + + - Thread.sleep(50L); - - - - + + + + + - 95 - - + + + + + - - - - - + + + - 96 - - + + + - verify(eventSink).close(); - - + + + + + - 91 - - + + + + + - verify(eventSink, timeout(50L)).close(); - - - - + + + + + - 97 - - - - - - - - - - - - - - - - - - -
- 7 - - import org.mockito.Mock; - - 7 - - import org.mockito.Mock; -
- 8 - - import org.mockito.junit.jupiter.MockitoExtension; - - 8 - - import org.mockito.junit.jupiter.MockitoExtension; -
- 9 - - import sonia.scm.security.SessionId; - - 9 - - import sonia.scm.security.SessionId; -
+
+
- 10 - - -
- 10 - + 7 + + import org.mockito.Mock; + + 7 + + import org.mockito.Mock; +
+ 8 + + import org.mockito.junit.jupiter.MockitoExtension; + + 8 + + import org.mockito.junit.jupiter.MockitoExtension; +
+ 9 + + import sonia.scm.security.SessionId; + + 9 + + import sonia.scm.security.SessionId; +
- 11 - - import javax.ws.rs.sse.SseEventSink; - - 12 - - import javax.ws.rs.sse.SseEventSink; -
- 12 - - - - -
- 13 - - import java.time.Clock; - - 13 - - import java.time.Clock; -
- 14 - - import java.time.Instant; - - 14 - - import java.time.Instant; -
- 15 - - import java.time.LocalDateTime; - - 15 - - import java.time.LocalDateTime; -
- 16 - - import java.time.ZoneOffset; - - 16 - - import java.time.ZoneOffset; -
- 17 - - import java.time.temporal.ChronoField; - - 17 - - import java.time.temporal.ChronoField; -
- 18 - - import java.time.temporal.ChronoUnit; - - -
- 19 - - import java.time.temporal.TemporalField; - - -
- 20 - - import java.util.concurrent.CompletableFuture; - - 18 - - import java.util.concurrent.CompletableFuture; -
- 21 - - import java.util.concurrent.CompletionStage; - - 19 - - import java.util.concurrent.CompletionStage; -
- 22 - - import java.util.concurrent.atomic.AtomicLong; - - -
- 23 - - import java.util.concurrent.atomic.AtomicReference; - - 20 - - import java.util.concurrent.atomic.AtomicReference; -
- 24 - - - - 21 - - -
- 25 - - import static java.time.temporal.ChronoUnit.MINUTES; - - 22 - - import static java.time.temporal.ChronoUnit.MINUTES; -
-
-
- 83 - - - - 80 - - -
- 84 - - @Test - - 81 - - @Test -
- 85 - - @SuppressWarnings("unchecked") - - 82 - - @SuppressWarnings("unchecked") -
- 86 - - void shouldCloseEventSinkOnFailure() throws InterruptedException { - - 83 - - void shouldCloseEventSinkOnFailure() { -
- 87 - - CompletionStage future = CompletableFuture.supplyAsync(() -> { - - 84 - - CompletionStage future = CompletableFuture.supplyAsync(() -> { -
- 88 - - throw new RuntimeException("failed to send message"); - - 85 - - throw new RuntimeException("failed to send message"); -
- 89 - - }); - - 86 - - }); -
-
-
+ +
+ 10 + + import javax.ws.rs.sse.OutboundSseEvent; + + 11 + + import javax.ws.rs.sse.OutboundSseEvent; +
+ 11 + + import javax.ws.rs.sse.SseEventSink; + + 12 + + import javax.ws.rs.sse.SseEventSink; +
+ 12 + + + + +
+ 13 + + import java.time.Clock; + + 13 + + import java.time.Clock; +
+ 14 + + import java.time.Instant; + + 14 + + import java.time.Instant; +
+ 15 + + import java.time.LocalDateTime; + + 15 + + import java.time.LocalDateTime; +
+ 16 + + import java.time.ZoneOffset; + + 16 + + import java.time.ZoneOffset; +
+ 17 + + import java.time.temporal.ChronoField; + + 17 + + import java.time.temporal.ChronoField; +
+ 18 + + import java.time.temporal.ChronoUnit; + + +
+ 19 + + import java.time.temporal.TemporalField; + + +
+ 20 + + import java.util.concurrent.CompletableFuture; + + 18 + + import java.util.concurrent.CompletableFuture; +
+ 21 + + import java.util.concurrent.CompletionStage; + + 19 + + import java.util.concurrent.CompletionStage; +
+ 22 + + import java.util.concurrent.atomic.AtomicLong; + + +
+ 23 + + import java.util.concurrent.atomic.AtomicReference; + + 20 + + import java.util.concurrent.atomic.AtomicReference; +
+ 24 + + + + 21 + + +
+ 25 + + import static java.time.temporal.ChronoUnit.MINUTES; + + 22 + + import static java.time.temporal.ChronoUnit.MINUTES; +
- 91 - - - - 88 - - -
+
+
- 92 - + 83 + + + + 80 + + +
+ 84 + + @Test + + 81 + + @Test +
+ 85 + + @SuppressWarnings("unchecked") + + 82 + + @SuppressWarnings("unchecked") +
+ void shouldCloseEventSinkOnFailure() throws InterruptedException { + + 83 + + void shouldCloseEventSinkOnFailure() { +
+ 87 + + CompletionStage future = CompletableFuture.supplyAsync(() -> { + + 84 + + CompletionStage future = CompletableFuture.supplyAsync(() -> { +
+ 88 + + throw new RuntimeException("failed to send message"); + + 85 + + throw new RuntimeException("failed to send message"); +
+ 89 + + }); + + 86 + + }); +
- 93 - - - - 90 - - -
+
+
- 94 - + 91 + + + + 88 + + +
- -
+ 92 + + client.send(message); + + 89 + + client.send(message); +
+ 93 + + + + 90 + + +
- -
+ 94 + + Thread.sleep(50L); + + +
+ 95 + + + + +
+ 96 + + verify(eventSink).close(); + + 91 + + verify(eventSink, timeout(50L)).close(); +
+ 97 + + } + + 92 + + } +
+ 98 + + + + 93 + + +
- } - - 92 - - } -
- 98 - - - - 93 - - -
- 99 - - @Test - - 94 - - @Test -
+ + 99 + + + @Test + + + 94 + + + @Test + + + + +
- -
- - - Main.java - - - modify - -
-
+ + + Main.java + + + modify + +
+
- - - - - + + + + +
-
-
- - - - - - - - - - - - - - - + + - - + + + - import java.util.Arrays; - - + + + + + - 2 - - + + + + + - import java.util.Arrays; - - - - + + + + + - 2 - - + + + - - - + + + - 3 - - + + + + + - - - - - + + + - 3 - - + + + + + - class Main { - - + + + + + - 4 - - + + + + + - class Main { - - - - + + + - 5 - - + + + - private static final PrintStream OUT = System.out; - - - - + + + - 6 - - + + + - - - - - + + + - 4 - - + + + + + - public static void main(String[] args) { - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+
+
- 1 - - import java.io.PrintStream; -
- 1 - + + + 1 + + import java.io.PrintStream; +
+ 1 + + import java.util.Arrays; + + 2 + + import java.util.Arrays; +
+ 2 + + + + 3 + + +
+ 3 + + class Main { + + 4 + + class Main { +
+ + + 5 + + private static final PrintStream OUT = System.out; +
+ + + 6 + + +
+ 4 + + public static void main(String[] args) { + + 7 + + public static void main(String[] args) { +
+ + + 8 + + <<<<<<< HEAD +
+ 5 + + System.out.println("Expect nothing more to happen."); + + 9 + + System.out.println("Expect nothing more to happen."); +
+ 6 + + System.out.println("The command line parameters are:"); + + 10 + + System.out.println("The command line parameters are:"); +
+ 7 + + Arrays.stream(args).map(arg -> "- " + arg).forEach(System.out::println); + + 11 + + Arrays.stream(args).map(arg -> "- " + arg).forEach(System.out::println); +
- - + + + 12 + + ======= +
+ + + 13 + + OUT.println("Expect nothing more to happen."); +
- - + + + 14 + + OUT.println("Parameters:"); +
+ + + 15 + + Arrays.stream(args).map(arg -> "- " + arg).forEach(OUT::println); +
+ + + 16 + + >>>>>>> feature/use_constant +
+ 8 + + } + + 17 + + } +
- 7 - - public static void main(String[] args) { -
- - - 8 - - <<<<<<< HEAD -
- 5 - - System.out.println("Expect nothing more to happen."); - - 9 - - System.out.println("Expect nothing more to happen."); -
- 6 - - System.out.println("The command line parameters are:"); - - 10 - - System.out.println("The command line parameters are:"); -
- 7 - - Arrays.stream(args).map(arg -> "- " + arg).forEach(System.out::println); - - 11 - - Arrays.stream(args).map(arg -> "- " + arg).forEach(System.out::println); -
- - - 12 - - ======= -
- - - 13 - - OUT.println("Expect nothing more to happen."); -
- - - 14 - - OUT.println("Parameters:"); -
- - - 15 - - Arrays.stream(args).map(arg -> "- " + arg).forEach(OUT::println); -
- - - 16 - - >>>>>>> feature/use_constant -
- 8 - - } - - 17 - - } -
- 9 - - } - - 18 - - } -
+ + 9 + + + } + + + 18 + + + } + + + + +
@@ -35745,3834 +35824,3842 @@ exports[`Storyshots Diff SyntaxHighlighting 1`] = `
-
+
- - - src/main/java/com/cloudogu/scm/review/events/EventListener.java - - - modify - -
-
+ + + src/main/java/com/cloudogu/scm/review/events/EventListener.java + + + modify + +
+
- - - - - + + + + +
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- 1 - - 1 - - package com.cloudogu.scm.review.events; -
- 2 - - 2 - - -
- 3 - - - import com.cloudogu.scm.review.comment.service.BasicComment; -
- 4 - - - import com.cloudogu.scm.review.comment.service.BasicCommentEvent; -
- 5 - - - import com.cloudogu.scm.review.comment.service.CommentEvent; -
- 6 - - - import com.cloudogu.scm.review.comment.service.ReplyEvent; -
- 7 - - 3 - - import com.cloudogu.scm.review.pullrequest.service.BasicPullRequestEvent; -
- 8 - - 4 - - import com.cloudogu.scm.review.pullrequest.service.PullRequest; -
- 9 - - - import com.cloudogu.scm.review.pullrequest.service.PullRequestEvent; -
- 10 - - 5 - - import com.github.legman.Subscribe; -
- 11 - - - import lombok.Data; -
- 12 - - 6 - - import org.apache.shiro.SecurityUtils; -
- 13 - - 7 - - import org.apache.shiro.subject.PrincipalCollection; -
- 14 - - 8 - - import org.apache.shiro.subject.Subject; -
- 15 - - 9 - - import sonia.scm.EagerSingleton; -
- 16 - - - import sonia.scm.HandlerEventType; -
- 17 - - - import sonia.scm.event.HandlerEvent; -
- 18 - - 10 - - import sonia.scm.plugin.Extension; -
- 19 - - 11 - - import sonia.scm.repository.Repository; -
- 20 - - 12 - - import sonia.scm.security.SessionId; -
-
-
-
-
-
- - - src/main/js/ChangeNotification.tsx - - - modify - -
-
-
-
- - - - - -
-
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + - - + + + + - 6 - - + + + + - - - - - - - - - - - - - - - - - + - - - - - + + - 15 - - + + + - 16 - - + + + - pullRequest: setEvent - - - - + + + - 16 - - + + + + - 17 - - + + + + - }); - - - - + + + - 17 - - + + + + - 18 - - + + + - }, [url]); - - - - + + + + - 19 - - + + + + - const { t } = useTranslation("plugins"); - - - - + + + + - 18 - - + + + + - 20 - - + + + - if (event) { - - - - + + + - 19 - - + + + + - 21 - - + + + + - return ( - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- 2 - - 2 - - import { Link } from "@scm-manager/ui-types"; -
- 3 - - 3 - - import { apiClient, Toast, ToastButtons, ToastButton } from "@scm-manager/ui-components"; -
- 4 - - 4 - - import { PullRequest } from "./types/PullRequest"; -
+
- 5 - - import { useTranslation } from "react-i18next"; -
- 5 - + 1 + + 1 + + package com.cloudogu.scm.review.events; +
+ 2 + + 2 + + +
- 6 - - 7 - - type HandlerProps = { -
- 7 - - 8 - - url: string; -
-
+ 3 +
-
+ import com.cloudogu.scm.review.comment.service.BasicComment; +
+ 4 + + + import com.cloudogu.scm.review.comment.service.BasicCommentEvent; +
+ 5 + + + import com.cloudogu.scm.review.comment.service.CommentEvent; +
+ 6 + + + import com.cloudogu.scm.review.comment.service.ReplyEvent; +
+ 7 + + 3 + + import com.cloudogu.scm.review.pullrequest.service.BasicPullRequestEvent; +
+ 8 + + 4 + + import com.cloudogu.scm.review.pullrequest.service.PullRequest; +
+ 9 + + + import com.cloudogu.scm.review.pullrequest.service.PullRequestEvent; +
+ 10 + + 5 + + import com.github.legman.Subscribe; +
+ 11 + + + import lombok.Data; +
- + 12 + + 6 + + import org.apache.shiro.SecurityUtils; +
+ 13 + + 7 + + import org.apache.shiro.subject.PrincipalCollection; +
+ 14 + + 8 + + import org.apache.shiro.subject.Subject; +
+ 15 + + 9 + + import sonia.scm.EagerSingleton; +
+ 16 + + + import sonia.scm.HandlerEventType; +
+ 17 + + + import sonia.scm.event.HandlerEvent; +
+ 18 + + 10 + + import sonia.scm.plugin.Extension; +
+ 19 + + 11 + + import sonia.scm.repository.Repository; +
- 20 - - - <Toast type="warning" title="New Changes"> -
- 21 - - - <p>The underlying Pull-Request has changed. Press reload to see the changes.</p> -
- 22 - - - <p>Warning: Non saved modification will be lost.</p> -
- - 22 - - <Toast type="warning" title={t("scm-review-plugin.changeNotification.title")}> -
- - 23 - - <p>{t("scm-review-plugin.changeNotification.description")}</p> -
- - 24 - - <p>{t("scm-review-plugin.changeNotification.modificationWarning")}</p> -
- 23 - - 25 - - <ToastButtons> -
- 24 - - - <ToastButton icon="redo" onClick={reload}>Reload</ToastButton> -
- 25 - - - <ToastButton icon="times" onClick={() => setEvent(undefined)}>Ignore</ToastButton> -
- - 26 - - <ToastButton icon="redo" onClick={reload}> -
- - 27 - - {t("scm-review-plugin.changeNotification.buttons.reload")} -
- - 28 - - </ToastButton> -
- - 29 - - <ToastButton icon="times" onClick={() => setEvent(undefined)}> -
- - 30 - - {t("scm-review-plugin.changeNotification.buttons.ignore")} -
- - 31 - - </ToastButton> -
- 26 - - 32 - - </ToastButtons> -
- 27 - - 33 - - </Toast> -
- 28 - - 34 - - ); -
+ + 20 + + + 12 + + + import sonia.scm.security.SessionId; + + + + +
-
-
- - - src/main/resources/locales/de/plugins.json - - - modify - -
-
+ + + src/main/js/ChangeNotification.tsx + + + modify + +
+
- - - - - + + + + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ 2 + + 2 + + import { Link } from "@scm-manager/ui-types"; +
+ 3 + + 3 + + import { apiClient, Toast, ToastButtons, ToastButton } from "@scm-manager/ui-components"; +
+ 4 + + 4 + + import { PullRequest } from "./types/PullRequest"; +
+ + 5 + + import { useTranslation } from "react-i18next"; +
+ 5 + + 6 + + +
+ 6 + + 7 + + type HandlerProps = { +
+ 7 + + 8 + + url: string; +
+
+
+ 15 + + 16 + + pullRequest: setEvent +
+ 16 + + 17 + + }); +
+ 17 + + 18 + + }, [url]); +
+ + 19 + + const { t } = useTranslation("plugins"); +
+ 18 + + 20 + + if (event) { +
+ 19 + + 21 + + return ( +
+ 20 + + + <Toast type="warning" title="New Changes"> +
+ 21 + + + <p>The underlying Pull-Request has changed. Press reload to see the changes.</p> +
+ 22 + + + <p>Warning: Non saved modification will be lost.</p> +
+ + 22 + + <Toast type="warning" title={t("scm-review-plugin.changeNotification.title")}> +
+ + 23 + + <p>{t("scm-review-plugin.changeNotification.description")}</p> +
+ + 24 + + <p>{t("scm-review-plugin.changeNotification.modificationWarning")}</p> +
+ 23 + + 25 + + <ToastButtons> +
+ 24 + + + <ToastButton icon="redo" onClick={reload}>Reload</ToastButton> +
+ 25 + + + <ToastButton icon="times" onClick={() => setEvent(undefined)}>Ignore</ToastButton> +
+ + 26 + + <ToastButton icon="redo" onClick={reload}> +
+ + 27 + + {t("scm-review-plugin.changeNotification.buttons.reload")} +
+ + 28 + + </ToastButton> +
+ + 29 + + <ToastButton icon="times" onClick={() => setEvent(undefined)}> +
+ + 30 + + {t("scm-review-plugin.changeNotification.buttons.ignore")} +
+ + 31 + + </ToastButton> +
+ 26 + + 32 + + </ToastButtons> +
+ 27 + + 33 + + </Toast> +
+ 28 + + 34 + + ); +
+
- - - - - - - - - - - - - + +
-
- + + + + +
+ - 181 - + - 181 - - "titleClickable": "Der Kommentar bezieht sich auf eine ältere Version des Source- oder Target-Branches. Klicken Sie hier, um den ursprünglichen Kontext zu sehen." -
- 182 - + + + + + + + + + + +
+ + + + + + + + - 182 - - + + + + + + + + + + + + - - - + - 183 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+ 181 + + 181 + + "titleClickable": "Der Kommentar bezieht sich auf eine ältere Version des Source- oder Target-Branches. Klicken Sie hier, um den ursprünglichen Kontext zu sehen." +
+ 182 + + 182 + + } +
+ 183 + + 183 + } -
+
- 183 - - } -
- - 184 - - }, -
- - 185 - - "changeNotification": { -
- - 186 - - "title": "Neue Änderungen", -
- - 187 - - "description": "An diesem Pull Request wurden Änderungen vorgenommen. Laden Sie die Seite neu um diese anzuzeigen.", -
- - 188 - - "modificationWarning": "Warnung: Nicht gespeicherte Eingaben gehen verloren.", -
- - 189 - - "buttons": { -
- - 190 - - "reload": "Neu laden", -
- - 191 - - "ignore": "Ignorieren" -
- - 192 - - } -
- 184 - - 193 - - } -
- 185 - - 194 - - }, -
- 186 - - 195 - - "permissions": { -
-
- -
-
-
-
- - - src/main/resources/locales/en/plugins.json - - - modify - -
-
-
-
- +
- - - - - - - - - -
- - - - - - - - - + + - 181 - - + + + - 181 - - + + + - "titleClickable": "The comment is related to an older of the source or target branch. Click here to see the original context." - - - - + + + - 182 - - + + + - 182 - - + + + + + + + + + + + + + - - - - - + + + + - - - - + + + + - - - + - 185 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+ + }, +
+ + 185 + + "changeNotification": { +
+ + 186 + + "title": "Neue Änderungen", +
+ + 187 + + "description": "An diesem Pull Request wurden Änderungen vorgenommen. Laden Sie die Seite neu um diese anzuzeigen.", +
+ + 188 + + "modificationWarning": "Warnung: Nicht gespeicherte Eingaben gehen verloren.", +
+ + 189 + + "buttons": { +
+ + 190 + + "reload": "Neu laden", +
+ + 191 + + "ignore": "Ignorieren" +
+ + 192 + } -
- 183 - - 183 - +
+ 184 + + 193 + } -
- - 184 - +
+ 185 + + 194 + }, -
- +
- "changeNotification": { -
- - 186 - - "title": "New Changes", -
- - 187 - - "description": "The underlying Pull-Request has changed. Press reload to see the changes.", -
- - 188 - - "modificationWarning": "Warning: Non saved modification will be lost.", -
- - 189 - - "buttons": { -
- - 190 - - "reload": "Reload", -
- - 191 - - "ignore": "Ignore" -
- - 192 - - } -
- 184 - - 193 - - } -
- 185 - - 194 - - }, -
- 186 - - 195 - - "permissions": { -
+
+ 186 + + 195 + + "permissions": { +
+
- -
- - - src/test/java/com/cloudogu/scm/review/events/ClientTest.java - - - modify - -
-
+ + + src/main/resources/locales/en/plugins.json + + + modify + +
+
- - - - - + + + + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ 181 + + 181 + + "titleClickable": "The comment is related to an older of the source or target branch. Click here to see the original context." +
+ 182 + + 182 + + } +
+ 183 + + 183 + + } +
+ + 184 + + }, +
+ + 185 + + "changeNotification": { +
+ + 186 + + "title": "New Changes", +
+ + 187 + + "description": "The underlying Pull-Request has changed. Press reload to see the changes.", +
+ + 188 + + "modificationWarning": "Warning: Non saved modification will be lost.", +
+ + 189 + + "buttons": { +
+ + 190 + + "reload": "Reload", +
+ + 191 + + "ignore": "Ignore" +
+ + 192 + + } +
+ 184 + + 193 + + } +
+ 185 + + 194 + + }, +
+ 186 + + 195 + + "permissions": { +
+
- - - - - - - - - - - - - - - - - - - - - - - - - - - + +
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + +
+
- 7 - - 7 - - import org.mockito.Mock; -
- 8 - - 8 - - import org.mockito.junit.jupiter.MockitoExtension; -
- 9 - - 9 - - import sonia.scm.security.SessionId; -
- - 10 - + - -
- 10 - - 11 - - import javax.ws.rs.sse.OutboundSseEvent; -
- 11 - - 12 - - import javax.ws.rs.sse.SseEventSink; -
- 12 - - - -
- 13 - - 13 - - import java.time.Clock; -
- 14 - - 14 - - import java.time.Instant; -
- 15 - - 15 - - import java.time.LocalDateTime; -
- 16 - - 16 - - import java.time.ZoneOffset; -
- 17 - - 17 - - import java.time.temporal.ChronoField; -
- 18 - - - import java.time.temporal.ChronoUnit; -
- 19 - - - import java.time.temporal.TemporalField; -
- 20 - - 18 - - import java.util.concurrent.CompletableFuture; -
- 21 - - 19 - - import java.util.concurrent.CompletionStage; -
- 22 - - - import java.util.concurrent.atomic.AtomicLong; -
- 23 - - 20 - - import java.util.concurrent.atomic.AtomicReference; -
- 24 - - 21 - - -
- 25 - - 22 - - import static java.time.temporal.ChronoUnit.MINUTES; -
- - + + + + + -
+ 7 + +
+ + + + + + + + + + + + + + - - - - - + + + - 83 - - + + + + - 80 - - + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ 7 + + import org.mockito.Mock; +
+ 8 + + 8 + + import org.mockito.junit.jupiter.MockitoExtension; +
+ 9 + + 9 + + import sonia.scm.security.SessionId; +
-
+ 10 + + +
+ 10 + + 11 + + import javax.ws.rs.sse.OutboundSseEvent; +
+ 11 + + 12 + + import javax.ws.rs.sse.SseEventSink; +
- 84 - - 81 - - @Test -
- 85 - - 82 - - @SuppressWarnings("unchecked") -
- 86 - - - void shouldCloseEventSinkOnFailure() throws InterruptedException { -
- - 83 - - void shouldCloseEventSinkOnFailure() { -
- 87 - - 84 - - CompletionStage future = CompletableFuture.supplyAsync(() -> { -
- 88 - - 85 - - throw new RuntimeException("failed to send message"); -
- 89 - - 86 - - }); -
-
+ 12 +
-
+ 13 + + 13 + + import java.time.Clock; +
+ 14 + + 14 + + import java.time.Instant; +
+ 15 + + 15 + + import java.time.LocalDateTime; +
+ 16 + + 16 + + import java.time.ZoneOffset; +
+ 17 + + 17 + + import java.time.temporal.ChronoField; +
+ 18 + + + import java.time.temporal.ChronoUnit; +
+ 19 + + + import java.time.temporal.TemporalField; +
+ 20 + + 18 + + import java.util.concurrent.CompletableFuture; +
+ 21 + + 19 + + import java.util.concurrent.CompletionStage; +
+ 22 + + + import java.util.concurrent.atomic.AtomicLong; +
+ 23 + + 20 + + import java.util.concurrent.atomic.AtomicReference; +
+ 24 + + 21 + + +
+ 25 + + 22 + + import static java.time.temporal.ChronoUnit.MINUTES; +
+
+
+ 83 + + 80 + + +
+ 84 + + 81 + + @Test +
+ 85 + + 82 + + @SuppressWarnings("unchecked") +
+ 86 + + + void shouldCloseEventSinkOnFailure() throws InterruptedException { +
+ + 83 + + void shouldCloseEventSinkOnFailure() { +
+ 87 + + 84 + + CompletionStage future = CompletableFuture.supplyAsync(() -> { +
+ 88 + + 85 + + throw new RuntimeException("failed to send message"); +
+ 89 + + 86 + + }); +
+
+
+ 91 + + 88 + + +
+ 92 + + 89 + + client.send(message); +
+ 93 + + 90 + + +
+ 94 + + + Thread.sleep(50L); +
+ 95 + + + +
+ 96 + + + verify(eventSink).close(); +
+ + 91 + + verify(eventSink, timeout(50L)).close(); +
+ 97 + + 92 + + } +
+ 98 + + 93 + + +
+ 99 + + 94 + + @Test +
+
+ +
+
+
- - - 91 - - - 88 - - - - - - - - 92 - - - 89 - - - client.send(message); - - - - - 93 - - - 90 - - - - - - - - 94 - - - - Thread.sleep(50L); - - - + + modify + +
+
- - 95 - - + + + + + +
+
+
+ + +
+ + + - - - - - - - + + - - + + + - verify(eventSink, timeout(50L)).close(); - - - - + + + + - 97 - - + + + + - 92 - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - -
- -
- 96 - - - verify(eventSink).close(); -
- - 91 - + + 1 + + import java.io.PrintStream; +
+ 1 + + 2 + + import java.util.Arrays; +
+ 2 + + 3 + + +
+ 3 + + 4 + + class Main { +
+ + 5 + + private static final PrintStream OUT = System.out; +
+ + 6 + + +
+ 4 + + 7 + + public static void main(String[] args) { +
+ + 8 + + <<<<<<< HEAD +
+ 5 + + 9 + + System.out.println("Expect nothing more to happen."); +
+ 6 + + 10 + + System.out.println("The command line parameters are:"); +
+ 7 + + 11 + + Arrays.stream(args).map(arg -> "- " + arg).forEach(System.out::println); +
+ + 12 + + ======= +
+ + 13 + + OUT.println("Expect nothing more to happen."); +
+ + 14 + + OUT.println("Parameters:"); +
+ + 15 + + Arrays.stream(args).map(arg -> "- " + arg).forEach(OUT::println); +
+ + 16 + + >>>>>>> feature/use_constant +
+ 8 + + 17 + + } +
+ 9 + + 18 + } -
- 98 - - 93 - - -
- 99 - - 94 - - @Test -
-
- -
-
-
-
- - - Main.java - - - modify - -
-
-
-
- - - - - -
-
-
+ + + +
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - 1 - - import java.io.PrintStream; -
- 1 - - 2 - - import java.util.Arrays; -
- 2 - - 3 - - -
- 3 - - 4 - - class Main { -
- - 5 - - private static final PrintStream OUT = System.out; -
- - 6 - - -
- 4 - - 7 - - public static void main(String[] args) { -
- - 8 - - <<<<<<< HEAD -
- 5 - - 9 - - System.out.println("Expect nothing more to happen."); -
- 6 - - 10 - - System.out.println("The command line parameters are:"); -
- 7 - - 11 - - Arrays.stream(args).map(arg -> "- " + arg).forEach(System.out::println); -
- - 12 - - ======= -
- - 13 - - OUT.println("Expect nothing more to happen."); -
- - 14 - - OUT.println("Parameters:"); -
- - 15 - - Arrays.stream(args).map(arg -> "- " + arg).forEach(OUT::println); -
- - 16 - - >>>>>>> feature/use_constant -
- 8 - - 17 - - } -
- 9 - - 18 - - } -
-
`; @@ -39581,4304 +39668,4312 @@ exports[`Storyshots Diff WithLinkToFile 1`] = `
-
+
- - - src/main/java/com/cloudogu/scm/review/events/EventListener.java - - - modify - -
-
+ + + src/main/java/com/cloudogu/scm/review/events/EventListener.java + + + modify + +
+
- - - - - + + + + +
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - -
- 1 - - 1 - - package com.cloudogu.scm.review.events; -
- 2 - - 2 - - -
- 3 - +
- import com.cloudogu.scm.review.comment.service.BasicComment; -
- 4 - - - import com.cloudogu.scm.review.comment.service.BasicCommentEvent; -
- 5 - - - import com.cloudogu.scm.review.comment.service.CommentEvent; -
- 6 - - - import com.cloudogu.scm.review.comment.service.ReplyEvent; -
- 7 - - 3 - - import com.cloudogu.scm.review.pullrequest.service.BasicPullRequestEvent; -
- 8 - - 4 - - import com.cloudogu.scm.review.pullrequest.service.PullRequest; -
- 9 - - - import com.cloudogu.scm.review.pullrequest.service.PullRequestEvent; -
- 10 - - 5 - - import com.github.legman.Subscribe; -
- 11 - - - import lombok.Data; -
- 12 - - 6 - - import org.apache.shiro.SecurityUtils; -
- 13 - - 7 - - import org.apache.shiro.subject.PrincipalCollection; -
- 14 - - 8 - - import org.apache.shiro.subject.Subject; -
- 15 - - 9 - - import sonia.scm.EagerSingleton; -
- 16 - - - import sonia.scm.HandlerEventType; -
- 17 - - - import sonia.scm.event.HandlerEvent; -
- 18 - - 10 - - import sonia.scm.plugin.Extension; -
- 19 - - 11 - - import sonia.scm.repository.Repository; -
- 20 - - 12 - - import sonia.scm.security.SessionId; -
-
+ 1 +
+ 1 + + package com.cloudogu.scm.review.events; +
+ 2 + + 2 + - - - - diff.expandLastBottomByLines - - +
+ 3 + + + import com.cloudogu.scm.review.comment.service.BasicComment; +
+ 4 + + + import com.cloudogu.scm.review.comment.service.BasicCommentEvent; +
+ 5 + + + import com.cloudogu.scm.review.comment.service.CommentEvent; +
+ 6 + + + import com.cloudogu.scm.review.comment.service.ReplyEvent; +
+ 7 + + 3 + + import com.cloudogu.scm.review.pullrequest.service.BasicPullRequestEvent; +
+ 8 + + 4 + + import com.cloudogu.scm.review.pullrequest.service.PullRequest; +
+ 9 + + + import com.cloudogu.scm.review.pullrequest.service.PullRequestEvent; +
+ 10 + + 5 + + import com.github.legman.Subscribe; +
+ 11 + + + import lombok.Data; +
+ 12 + + 6 + + import org.apache.shiro.SecurityUtils; +
+ 13 + + 7 + + import org.apache.shiro.subject.PrincipalCollection; +
+ 14 + + 8 + + import org.apache.shiro.subject.Subject; +
+ 15 + + 9 + + import sonia.scm.EagerSingleton; +
+ 16 + + + import sonia.scm.HandlerEventType; +
+ 17 + + + import sonia.scm.event.HandlerEvent; +
+ 18 + + 10 + + import sonia.scm.plugin.Extension; +
+ 19 + + 11 + + import sonia.scm.repository.Repository; +
+ 20 + + 12 + + import sonia.scm.security.SessionId; +
+
- + + + + diff.expandLastBottomByLines + - diff.expandLastBottomComplete - -
-
+ + + + diff.expandLastBottomComplete + +
+ + + + +
- -
- - - src/main/js/ChangeNotification.tsx - - - modify - -
-
+ + + src/main/js/ChangeNotification.tsx + + + modify + +
+
- - - - - + + + + +
-
-
- - - - - - - - - + + + + + + - - - - + + + diff.expandComplete + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - -
-
+
- - - - diff.expandComplete - - -
- 2 - - 2 - - import { Link } from "@scm-manager/ui-types"; -
- 3 - - 3 - - import { apiClient, Toast, ToastButtons, ToastButton } from "@scm-manager/ui-components"; -
- 4 - - 4 - - import { PullRequest } from "./types/PullRequest"; -
- - 5 - - import { useTranslation } from "react-i18next"; -
- 5 - - 6 - - -
- 6 - - 7 - - type HandlerProps = { -
- 7 - - 8 - - url: string; -
-
- - - - diff.expandComplete - -
-
-
+
- - - - diff.expandComplete - - -
- 15 - - 16 - - pullRequest: setEvent -
- 16 - - 17 - - }); -
- 17 - - 18 - - }, [url]); -
- - 19 - - const { t } = useTranslation("plugins"); -
- 18 - - 20 - - if (event) { -
- 19 - - 21 - - return ( -
- 20 - - - <Toast type="warning" title="New Changes"> -
- 21 - - - <p>The underlying Pull-Request has changed. Press reload to see the changes.</p> -
- 22 - - - <p>Warning: Non saved modification will be lost.</p> -
- - 22 - - <Toast type="warning" title={t("scm-review-plugin.changeNotification.title")}> -
- - 23 - - <p>{t("scm-review-plugin.changeNotification.description")}</p> -
- - 24 - - <p>{t("scm-review-plugin.changeNotification.modificationWarning")}</p> -
- 23 - - 25 - - <ToastButtons> -
- 24 - - - <ToastButton icon="redo" onClick={reload}>Reload</ToastButton> -
- 25 - - - <ToastButton icon="times" onClick={() => setEvent(undefined)}>Ignore</ToastButton> -
- - 26 - - <ToastButton icon="redo" onClick={reload}> -
- - 27 - - {t("scm-review-plugin.changeNotification.buttons.reload")} -
- - 28 - - </ToastButton> -
- - 29 - - <ToastButton icon="times" onClick={() => setEvent(undefined)}> -
- - 30 - - {t("scm-review-plugin.changeNotification.buttons.ignore")} -
- - 31 - - </ToastButton> -
- 26 - - 32 - - </ToastButtons> -
- 27 - - 33 - - </Toast> -
- 28 - - 34 - - ); -
-
+
+ import { Link } from "@scm-manager/ui-types"; +
+ 3 + + 3 + + import { apiClient, Toast, ToastButtons, ToastButton } from "@scm-manager/ui-components"; +
+ 4 + + 4 + + import { PullRequest } from "./types/PullRequest"; +
+ + 5 + + import { useTranslation } from "react-i18next"; +
+ 5 + + 6 + - - - - diff.expandLastBottomByLines - - +
+ 6 + + 7 + + type HandlerProps = { +
+ 7 + + 8 + + url: string; +
+
- + + + + diff.expandComplete + +
+
+
+ + + + diff.expandComplete + +
+
+ 15 + + 16 + + pullRequest: setEvent +
+ 16 + + 17 + + }); +
+ 17 + + 18 + + }, [url]); +
+ + 19 + + const { t } = useTranslation("plugins"); +
+ 18 + + 20 + + if (event) { +
+ 19 + + 21 + + return ( +
+ 20 + + + <Toast type="warning" title="New Changes"> +
+ 21 + + + <p>The underlying Pull-Request has changed. Press reload to see the changes.</p> +
+ 22 + + + <p>Warning: Non saved modification will be lost.</p> +
+ + 22 + + <Toast type="warning" title={t("scm-review-plugin.changeNotification.title")}> +
+ + 23 + + <p>{t("scm-review-plugin.changeNotification.description")}</p> +
+ + 24 + + <p>{t("scm-review-plugin.changeNotification.modificationWarning")}</p> +
+ 23 + + 25 + + <ToastButtons> +
+ 24 + + + <ToastButton icon="redo" onClick={reload}>Reload</ToastButton> +
+ 25 + + + <ToastButton icon="times" onClick={() => setEvent(undefined)}>Ignore</ToastButton> +
+ + 26 + + <ToastButton icon="redo" onClick={reload}> +
+ + 27 + + {t("scm-review-plugin.changeNotification.buttons.reload")} +
+ + 28 + + </ToastButton> +
+ + 29 + + <ToastButton icon="times" onClick={() => setEvent(undefined)}> +
+ + 30 + + {t("scm-review-plugin.changeNotification.buttons.ignore")} +
+ + 31 + + </ToastButton> +
+ 26 + + 32 + + </ToastButtons> +
+ 27 + + 33 + + </Toast> +
+ 28 + + 34 + + ); +
+
+ + + + diff.expandLastBottomByLines + - diff.expandLastBottomComplete - -
-
+ + + + diff.expandLastBottomComplete + +
+ + + + + - -
- - - src/main/resources/locales/de/plugins.json - - - modify - -
-
+ + + src/main/resources/locales/de/plugins.json + + + modify + +
+
- - - - - + + + + +
-
-
- - - - - - - - - + + + + + + - - - - + + + diff.expandComplete + + + + + + - - + + + + - 181 - - - - - - - + + + + + + + - - - + - 183 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
+
- - + + + + diff.expandByLines + - diff.expandByLines - - - - - - diff.expandComplete - - -
- 181 - + 181 + + 181 + + "titleClickable": "Der Kommentar bezieht sich auf eine ältere Version des Source- oder Target-Branches. Klicken Sie hier, um den ursprünglichen Kontext zu sehen." +
- "titleClickable": "Der Kommentar bezieht sich auf eine ältere Version des Source- oder Target-Branches. Klicken Sie hier, um den ursprünglichen Kontext zu sehen." -
- 182 - - 182 - + 182 + + 182 + + } +
+ 183 + + 183 + } -
+
- 183 - - } -
- - 184 - - }, -
- - 185 - - "changeNotification": { -
- - 186 - - "title": "Neue Änderungen", -
- - 187 - - "description": "An diesem Pull Request wurden Änderungen vorgenommen. Laden Sie die Seite neu um diese anzuzeigen.", -
- - 188 - - "modificationWarning": "Warnung: Nicht gespeicherte Eingaben gehen verloren.", -
- - 189 - - "buttons": { -
- - 190 - - "reload": "Neu laden", -
- - 191 - - "ignore": "Ignorieren" -
- - 192 - - } -
- 184 - - 193 - - } -
- 185 - - 194 - - }, -
- 186 - - 195 - - "permissions": { -
-
+
- - - - diff.expandLastBottomByLines - - - - - - diff.expandLastBottomComplete - - -
-
- -
-
-
-
- - - src/main/resources/locales/en/plugins.json - - - modify - -
-
-
-
- + - - - - -
-
-
-
-
-
- - - - - - - - - + -
+
- - - - - + + - 181 - - + + + - 181 - - + + + - "titleClickable": "The comment is related to an older of the source or target branch. Click here to see the original context." - - - - + + + - 182 - - + + + - 182 - - + + + + + + + + + - - - + - 183 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + - - -
+
- - - - diff.expandByLines - - - - - - diff.expandComplete - - -
+ + "changeNotification": { +
+ + 186 + + "title": "Neue Änderungen", +
+ + 187 + + "description": "An diesem Pull Request wurden Änderungen vorgenommen. Laden Sie die Seite neu um diese anzuzeigen.", +
+ + 188 + + "modificationWarning": "Warnung: Nicht gespeicherte Eingaben gehen verloren.", +
+ + 189 + + "buttons": { +
+ + 190 + + "reload": "Neu laden", +
+ + 191 + + "ignore": "Ignorieren" +
+ + 192 + } -
+
- 183 - - } -
- - 184 - - }, -
- - 185 - - "changeNotification": { -
- - 186 - - "title": "New Changes", -
- - 187 - - "description": "The underlying Pull-Request has changed. Press reload to see the changes.", -
- - 188 - - "modificationWarning": "Warning: Non saved modification will be lost.", -
- - 189 - - "buttons": { -
- - 190 - - "reload": "Reload", -
- - 191 - - "ignore": "Ignore" -
- - 192 - - } -
- 184 - - 193 - - } -
- 185 - - 194 - - }, -
- 186 - - 195 - - "permissions": { -
-
- +
+ 193 + + } +
+ 185 + + 194 + + }, +
+ 186 + + 195 + + "permissions": { +
+
- + + + + diff.expandLastBottomByLines + - diff.expandLastBottomByLines - - - - - - diff.expandLastBottomComplete - -
-
+ + + + diff.expandLastBottomComplete + +
+ + + + +
- -
- - - src/test/java/com/cloudogu/scm/review/events/ClientTest.java - - - modify - -
-
+ + + src/main/resources/locales/en/plugins.json + + + modify + +
+
- - - - - + + + + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + diff.expandByLines + + + + + + diff.expandComplete + +
+
+ 181 + + 181 + + "titleClickable": "The comment is related to an older of the source or target branch. Click here to see the original context." +
+ 182 + + 182 + + } +
+ 183 + + 183 + + } +
+ + 184 + + }, +
+ + 185 + + "changeNotification": { +
+ + 186 + + "title": "New Changes", +
+ + 187 + + "description": "The underlying Pull-Request has changed. Press reload to see the changes.", +
+ + 188 + + "modificationWarning": "Warning: Non saved modification will be lost.", +
+ + 189 + + "buttons": { +
+ + 190 + + "reload": "Reload", +
+ + 191 + + "ignore": "Ignore" +
+ + 192 + + } +
+ 184 + + 193 + + } +
+ 185 + + 194 + + }, +
+ 186 + + 195 + + "permissions": { +
+
+ + + + diff.expandLastBottomByLines + + + + + + diff.expandLastBottomComplete + +
+
+
- - - - - - - - - - - - + + + +
+
+ + + src/test/java/com/cloudogu/scm/review/events/ClientTest.java + + + modify + + +
+
- - - diff.expandComplete + + +
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + - - - - - + -
+ 10 + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - + + + diff.expandComplete + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
- 7 - - 7 - - import org.mockito.Mock; -
- 8 - - 8 - - import org.mockito.junit.jupiter.MockitoExtension; -
- 9 - - 9 - - import sonia.scm.security.SessionId; -
+
- 10 - - -
- 10 - - 11 - - import javax.ws.rs.sse.OutboundSseEvent; -
- 11 - - 12 - - import javax.ws.rs.sse.SseEventSink; -
- 12 - - - -
- 13 - - 13 - - import java.time.Clock; -
- 14 - - 14 - - import java.time.Instant; -
- 15 - - 15 - - import java.time.LocalDateTime; -
- 16 - - 16 - - import java.time.ZoneOffset; -
- 17 - - 17 - - import java.time.temporal.ChronoField; -
- 18 - - - import java.time.temporal.ChronoUnit; -
- 19 - - - import java.time.temporal.TemporalField; -
- 20 - - 18 - - import java.util.concurrent.CompletableFuture; -
- 21 - - 19 - - import java.util.concurrent.CompletionStage; -
- 22 - - - import java.util.concurrent.atomic.AtomicLong; -
- 23 - - 20 - - import java.util.concurrent.atomic.AtomicReference; -
- 24 - - 21 - - -
- 25 - - 22 - - import static java.time.temporal.ChronoUnit.MINUTES; -
-
+
- - - - diff.expandByLines - + + + + diff.expandComplete + + +
+ 7 + + 7 + + import org.mockito.Mock; +
+ 8 + + 8 + + import org.mockito.junit.jupiter.MockitoExtension; +
+ 9 + + 9 + + import sonia.scm.security.SessionId; +
+ + 10 + - - - - diff.expandComplete - - -
+
+ 11 + + import javax.ws.rs.sse.OutboundSseEvent; +
+ 11 + + 12 + + import javax.ws.rs.sse.SseEventSink; +
+ 12 + + - - - - diff.expandByLines - - +
+ 13 + + 13 + + import java.time.Clock; +
+ 14 + + 14 + + import java.time.Instant; +
+ 15 + + 15 + + import java.time.LocalDateTime; +
+ 16 + + 16 + + import java.time.ZoneOffset; +
+ 17 + + 17 + + import java.time.temporal.ChronoField; +
+ 18 + + + import java.time.temporal.ChronoUnit; +
+ 19 + + + import java.time.temporal.TemporalField; +
+ 20 + + 18 + + import java.util.concurrent.CompletableFuture; +
+ 21 + + 19 + + import java.util.concurrent.CompletionStage; +
+ 22 + + + import java.util.concurrent.atomic.AtomicLong; +
+ 23 + + 20 + + import java.util.concurrent.atomic.AtomicReference; +
+ 24 + + 21 + + +
+ 25 + + 22 + + import static java.time.temporal.ChronoUnit.MINUTES; +
+
- + + + + diff.expandByLines + - diff.expandComplete - -
-
+
+ + + + diff.expandByLines + + + + + + diff.expandComplete + +
+
+ 83 + + 80 + + +
+ 84 + + 81 + + @Test +
+ 85 + + 82 + + @SuppressWarnings("unchecked") +
+ 86 + + + void shouldCloseEventSinkOnFailure() throws InterruptedException { +
+ + 83 + + void shouldCloseEventSinkOnFailure() { +
+ 87 + + 84 + + CompletionStage future = CompletableFuture.supplyAsync(() -> { +
+ 88 + + 85 + + throw new RuntimeException("failed to send message"); +
+ 89 + + 86 + + }); +
+
+ + + + diff.expandComplete + +
+
+
+ + + + diff.expandComplete + +
+
+ 91 + + 88 + + +
+ 92 + + 89 + + client.send(message); +
+ 93 + + 90 + + +
+ 94 + + + Thread.sleep(50L); +
+ 95 + + + +
+ 96 + + + verify(eventSink).close(); +
+ + 91 + + verify(eventSink, timeout(50L)).close(); +
+ 97 + + 92 + + } +
+ 98 + + 93 + + +
+ 99 + + 94 + + @Test +
+
+ + + + diff.expandLastBottomByLines + + + + + + diff.expandLastBottomComplete + +
+
+
+ +
+
+
- - - 83 - - - 80 - - - - - - - - 84 - - - 81 - - - @Test - - - - - 85 - - - 82 - - - @SuppressWarnings("unchecked") - - - - - 86 - - - - void shouldCloseEventSinkOnFailure() throws InterruptedException { - - - + + modify + +
+
- - - 83 - - - void shouldCloseEventSinkOnFailure() { - - - - - 87 - - - 84 - - - CompletionStage future = CompletableFuture.supplyAsync(() -> { - - - - - 88 - - - 85 - - - throw new RuntimeException("failed to send message"); - - - - - 89 - - - 86 - - - }); - - - - - -
- - - diff.expandComplete + + +
- - - - +
+
+
+
+ - - + + + + + + -
+
- - - - - + + - 91 - - + + + + - 88 - - + + + + - - - - - + + + + - 92 - - + + + - 89 - - + + + - client.send(message); - - - - + + + + - 93 - - + + + - 90 - - + + + + - - - - - + + + + - 94 - - + + + + - Thread.sleep(50L); - - - - + + + - 95 - - + + + - - - - - + + + - 96 - - + + + - verify(eventSink).close(); - - - - + + + - 91 - - - - - - - + + + + + + + - - + + + - - - - - - - - - - - - - - - -
+
- - - - diff.expandComplete - - -
+ + import java.io.PrintStream; +
+ 1 + + 2 + + import java.util.Arrays; +
+ 2 + + 3 + + +
+ 3 + + 4 + + class Main { +
+ + 5 + + private static final PrintStream OUT = System.out; +
+ + 6 + + +
+ 4 + + 7 + + public static void main(String[] args) { +
+ + 8 + + <<<<<<< HEAD +
+ 5 + + 9 + + System.out.println("Expect nothing more to happen."); +
+ 6 + + 10 + + System.out.println("The command line parameters are:"); +
- + 7 + + 11 + + Arrays.stream(args).map(arg -> "- " + arg).forEach(System.out::println); +
+ + 12 + + ======= +
- + + 13 + + OUT.println("Expect nothing more to happen."); +
+ + 14 + + OUT.println("Parameters:"); +
- + + 15 + + Arrays.stream(args).map(arg -> "- " + arg).forEach(OUT::println); +
- + + 16 + + >>>>>>> feature/use_constant +
- verify(eventSink, timeout(50L)).close(); -
- 97 - - 92 - + 8 + + 17 + + } +
+ 9 + + 18 + } -
- 98 - - 93 - - -
- 99 - - 94 - - @Test -
-
+
- - + + + + diff.expandLastBottomByLines + - diff.expandLastBottomByLines - - - - - - diff.expandLastBottomComplete - - -
-
- -
-
-
-
- - - Main.java - - - modify - -
-
-
-
- - - - - -
-
-
+ + + + diff.expandLastBottomComplete + +
+ + + +
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - 1 - - import java.io.PrintStream; -
- 1 - - 2 - - import java.util.Arrays; -
- 2 - - 3 - - -
- 3 - - 4 - - class Main { -
- - 5 - - private static final PrintStream OUT = System.out; -
- - 6 - - -
- 4 - - 7 - - public static void main(String[] args) { -
- - 8 - - <<<<<<< HEAD -
- 5 - - 9 - - System.out.println("Expect nothing more to happen."); -
- 6 - - 10 - - System.out.println("The command line parameters are:"); -
- 7 - - 11 - - Arrays.stream(args).map(arg -> "- " + arg).forEach(System.out::println); -
- - 12 - - ======= -
- - 13 - - OUT.println("Expect nothing more to happen."); -
- - 14 - - OUT.println("Parameters:"); -
- - 15 - - Arrays.stream(args).map(arg -> "- " + arg).forEach(OUT::println); -
- - 16 - - >>>>>>> feature/use_constant -
- 8 - - 17 - - } -
- 9 - - 18 - - } -
-
- - - - diff.expandLastBottomByLines - - - - - - diff.expandLastBottomComplete - -
-
-
`; diff --git a/scm-ui/ui-components/src/repos/Diff.tsx b/scm-ui/ui-components/src/repos/Diff.tsx index f5086f2881..3fb81571e6 100644 --- a/scm-ui/ui-components/src/repos/Diff.tsx +++ b/scm-ui/ui-components/src/repos/Diff.tsx @@ -35,7 +35,7 @@ type Props = RouteComponentProps & WithTranslation & }; type State = { - contentRef?: HTMLElement; + contentRef?: HTMLElement | null; } function getAnchorSelector(uriHashContent: string) { @@ -71,17 +71,18 @@ class Diff extends React.Component { } } + shouldComponentUpdate(nextProps: Readonly, nextState: Readonly): boolean { + // We have check if the contentRef changed and update afterwards so the page can scroll to the anchor links. + // Otherwise it can happen that componentDidUpdate is never executed depending on how fast the markdown got rendered + return this.state.contentRef !== nextState.contentRef; + } + render() { const { diff, t, ...fileProps } = this.props; - const updateContentRef = (el: HTMLElement | null) => { - if (el !== null && this.state.contentRef === undefined) { - this.setState({ contentRef: el }); - } - }; return (
this.setState({ contentRef: el })} > {diff.length === 0 ? ( {t("diff.noDiffFound")} From cfbaf63b5c8d9b563b7b4da7242a7c782f0f3d60 Mon Sep 17 00:00:00 2001 From: Konstantin Schaper Date: Wed, 26 Aug 2020 11:34:15 +0200 Subject: [PATCH 3/5] add additional precautious check --- scm-ui/ui-components/src/repos/Diff.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scm-ui/ui-components/src/repos/Diff.tsx b/scm-ui/ui-components/src/repos/Diff.tsx index 3fb81571e6..7f11bb6cca 100644 --- a/scm-ui/ui-components/src/repos/Diff.tsx +++ b/scm-ui/ui-components/src/repos/Diff.tsx @@ -74,7 +74,7 @@ class Diff extends React.Component { shouldComponentUpdate(nextProps: Readonly, nextState: Readonly): boolean { // We have check if the contentRef changed and update afterwards so the page can scroll to the anchor links. // Otherwise it can happen that componentDidUpdate is never executed depending on how fast the markdown got rendered - return this.state.contentRef !== nextState.contentRef; + return this.state.contentRef !== nextState.contentRef || this.props !== nextProps; } render() { From 0069f401f814b397849957897e77e7c8da31ec71 Mon Sep 17 00:00:00 2001 From: Konstantin Schaper Date: Wed, 26 Aug 2020 11:37:53 +0200 Subject: [PATCH 4/5] update changelog --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8d8fd79db9..fbd175bc70 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## Unreleased +### Added +- Add support for scroll anchors in url hash of diff page ([#1304](https://github.com/scm-manager/scm-manager/pull/1304)) + ## [2.4.0] - 2020-08-14 ### Added - Introduced merge detection for receive hooks ([#1278](https://github.com/scm-manager/scm-manager/pull/1278)) From 95dde51bba0bcd7715f2ca6674314a728bbd9b50 Mon Sep 17 00:00:00 2001 From: Sebastian Sdorra Date: Wed, 2 Sep 2020 07:40:52 +0200 Subject: [PATCH 5/5] Move escapeWhitespace to diffs and add small test --- scm-ui/ui-components/src/repos/Diff.tsx | 14 +++++++------- scm-ui/ui-components/src/repos/DiffFile.tsx | 7 ++----- scm-ui/ui-components/src/repos/diffs.test.ts | 13 ++++++++++++- scm-ui/ui-components/src/repos/diffs.ts | 4 ++++ 4 files changed, 25 insertions(+), 13 deletions(-) diff --git a/scm-ui/ui-components/src/repos/Diff.tsx b/scm-ui/ui-components/src/repos/Diff.tsx index 7f11bb6cca..1cec03ab37 100644 --- a/scm-ui/ui-components/src/repos/Diff.tsx +++ b/scm-ui/ui-components/src/repos/Diff.tsx @@ -22,13 +22,15 @@ * SOFTWARE. */ import React from "react"; -import DiffFile, {escapeWhitespace} from "./DiffFile"; +import DiffFile from "./DiffFile"; import { DiffObjectProps, File, FileControlFactory } from "./DiffTypes"; +import { escapeWhitespace } from "./diffs"; import Notification from "../Notification"; import { WithTranslation, withTranslation } from "react-i18next"; -import {RouteComponentProps, withRouter} from "react-router-dom"; +import { RouteComponentProps, withRouter } from "react-router-dom"; -type Props = RouteComponentProps & WithTranslation & +type Props = RouteComponentProps & + WithTranslation & DiffObjectProps & { diff: File[]; fileControlFactory?: FileControlFactory; @@ -36,7 +38,7 @@ type Props = RouteComponentProps & WithTranslation & type State = { contentRef?: HTMLElement | null; -} +}; function getAnchorSelector(uriHashContent: string) { return "#" + escapeWhitespace(decodeURIComponent(uriHashContent)); @@ -81,9 +83,7 @@ class Diff extends React.Component { const { diff, t, ...fileProps } = this.props; return ( -
this.setState({ contentRef: el })} - > +
this.setState({ contentRef: el })}> {diff.length === 0 ? ( {t("diff.noDiffFound")} ) : ( diff --git a/scm-ui/ui-components/src/repos/DiffFile.tsx b/scm-ui/ui-components/src/repos/DiffFile.tsx index 91f87e821b..b4ec64a8e8 100644 --- a/scm-ui/ui-components/src/repos/DiffFile.tsx +++ b/scm-ui/ui-components/src/repos/DiffFile.tsx @@ -39,6 +39,7 @@ import HunkExpandLink from "./HunkExpandLink"; import { Modal } from "../modals"; import ErrorNotification from "../ErrorNotification"; import HunkExpandDivider from "./HunkExpandDivider"; +import { escapeWhitespace } from "./diffs"; const EMPTY_ANNOTATION_FACTORY = {}; @@ -90,10 +91,6 @@ const ChangeTypeTag = styled(Tag)` margin-left: 0.75rem; `; -export function escapeWhitespace(path: string) { - return path.toLowerCase().replace(/\W/g, "-"); -} - class DiffFile extends React.Component { static defaultProps: Partial = { defaultCollapse: false, @@ -110,7 +107,7 @@ class DiffFile extends React.Component { }; } - componentDidUpdate(prevProps: Readonly, prevState: Readonly, snapshot?: any): void { + componentDidUpdate(prevProps: Readonly) { if (this.props.defaultCollapse !== prevProps.defaultCollapse) { this.setState({ collapsed: this.defaultCollapse() diff --git a/scm-ui/ui-components/src/repos/diffs.test.ts b/scm-ui/ui-components/src/repos/diffs.test.ts index 9e02ed43e4..58c5caca5a 100644 --- a/scm-ui/ui-components/src/repos/diffs.test.ts +++ b/scm-ui/ui-components/src/repos/diffs.test.ts @@ -23,7 +23,7 @@ */ import { File, FileChangeType, Hunk } from "./DiffTypes"; -import { getPath, createHunkIdentifier, createHunkIdentifierFromContext } from "./diffs"; +import { getPath, createHunkIdentifier, createHunkIdentifierFromContext, escapeWhitespace } from "./diffs"; describe("tests for diff util functions", () => { const file = (type: FileChangeType, oldPath: string, newPath: string): File => { @@ -88,4 +88,15 @@ describe("tests for diff util functions", () => { expect(identifier).toBe("delete_/etc/passwd_@@ -1,42 +1,39 @@"); }); }); + + describe("escapeWhitespace tests", () => { + it("should escape whitespaces", () => { + const escaped = escapeWhitespace("spaceship hog"); + expect(escaped).toBe("spaceship-hog"); + }); + it("should escape multiple whitespaces", () => { + const escaped = escapeWhitespace("spaceship heart of gold"); + expect(escaped).toBe("spaceship-heart-of-gold"); + }); + }); }); diff --git a/scm-ui/ui-components/src/repos/diffs.ts b/scm-ui/ui-components/src/repos/diffs.ts index 9171b6ef09..029803a0a4 100644 --- a/scm-ui/ui-components/src/repos/diffs.ts +++ b/scm-ui/ui-components/src/repos/diffs.ts @@ -39,3 +39,7 @@ export function createHunkIdentifier(file: File, hunk: Hunk) { export function createHunkIdentifierFromContext(ctx: BaseContext) { return createHunkIdentifier(ctx.file, ctx.hunk); } + +export function escapeWhitespace(path: string) { + return path.toLowerCase().replace(/\W/g, "-"); +}