diff --git a/scm-ui/ui-api/src/LegacyContext.test.tsx b/scm-ui/ui-api/src/LegacyContext.test.tsx index 48b0a10114..8ed9e29cca 100644 --- a/scm-ui/ui-api/src/LegacyContext.test.tsx +++ b/scm-ui/ui-api/src/LegacyContext.test.tsx @@ -23,18 +23,24 @@ */ import { LegacyContext, LegacyContextProvider, useLegacyContext } from "./LegacyContext"; -import { FC } from "react"; import * as React from "react"; +import { FC } from "react"; import { renderHook } from "@testing-library/react-hooks"; +import { QueryClient, QueryClientProvider } from "react-query"; describe("LegacyContext tests", () => { + const queryClient = new QueryClient(); const createWrapper = (context?: LegacyContext): FC => { - return ({ children }) => {children}; + return ({ children }) => ( + + {children} + + ); }; it("should return provided context", () => { const { result } = renderHook(() => useLegacyContext(), { - wrapper: createWrapper(), + wrapper: createWrapper() }); expect(result.current).toBeDefined(); }); diff --git a/scm-ui/ui-api/src/LegacyContext.tsx b/scm-ui/ui-api/src/LegacyContext.tsx index e3e6760407..1e61aadb1b 100644 --- a/scm-ui/ui-api/src/LegacyContext.tsx +++ b/scm-ui/ui-api/src/LegacyContext.tsx @@ -33,6 +33,7 @@ export type BaseContext = { export type LegacyContext = BaseContext & { initialize: () => void; + queryClient?: QueryClient; }; const Context = createContext(undefined); diff --git a/scm-ui/ui-components/.storybook/.babelrc b/scm-ui/ui-components/.storybook/.babelrc index a138b1182a..2fa1f1e174 100644 --- a/scm-ui/ui-components/.storybook/.babelrc +++ b/scm-ui/ui-components/.storybook/.babelrc @@ -1,3 +1,4 @@ { - "presets": ["@scm-manager/babel-preset"] + "presets": ["@scm-manager/babel-preset"], + "plugins": ["@babel/plugin-syntax-dynamic-import"] } 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 4317690197..c13f279dbf 100644 --- a/scm-ui/ui-components/src/__snapshots__/storyshots.test.ts.snap +++ b/scm-ui/ui-components/src/__snapshots__/storyshots.test.ts.snap @@ -24450,7 +24450,7 @@ exports[`Storyshots Repositories/Diff Binaries 1`] = ` >
@@ -24671,7 +24671,7 @@ exports[`Storyshots Repositories/Diff Binaries 1`] = `
@@ -24746,7 +24746,7 @@ exports[`Storyshots Repositories/Diff Changing Content 1`] = `
@@ -25363,7 +25363,7 @@ exports[`Storyshots Repositories/Diff Changing Content 1`] = `
@@ -26317,7 +26317,7 @@ exports[`Storyshots Repositories/Diff Changing Content 1`] = `
@@ -26842,7 +26842,7 @@ exports[`Storyshots Repositories/Diff Changing Content 1`] = `
@@ -27367,7 +27367,7 @@ exports[`Storyshots Repositories/Diff Changing Content 1`] = `
@@ -28582,7 +28582,7 @@ exports[`Storyshots Repositories/Diff Changing Content 1`] = `
@@ -29157,7 +29157,7 @@ exports[`Storyshots Repositories/Diff Collapsed 1`] = ` >
@@ -29269,7 +29269,7 @@ exports[`Storyshots Repositories/Diff Collapsed 1`] = `
@@ -29381,7 +29381,7 @@ exports[`Storyshots Repositories/Diff Collapsed 1`] = `
@@ -29493,7 +29493,7 @@ exports[`Storyshots Repositories/Diff Collapsed 1`] = `
@@ -29605,7 +29605,7 @@ exports[`Storyshots Repositories/Diff Collapsed 1`] = `
@@ -29717,7 +29717,7 @@ exports[`Storyshots Repositories/Diff Collapsed 1`] = `
@@ -29838,7 +29838,7 @@ exports[`Storyshots Repositories/Diff CollapsingWithFunction 1`] = ` >
@@ -29912,7 +29912,7 @@ exports[`Storyshots Repositories/Diff CollapsingWithFunction 1`] = `
@@ -30769,7 +30769,7 @@ exports[`Storyshots Repositories/Diff CollapsingWithFunction 1`] = `
@@ -31222,7 +31222,7 @@ exports[`Storyshots Repositories/Diff CollapsingWithFunction 1`] = `
@@ -31675,7 +31675,7 @@ exports[`Storyshots Repositories/Diff CollapsingWithFunction 1`] = `
@@ -31749,7 +31749,7 @@ exports[`Storyshots Repositories/Diff CollapsingWithFunction 1`] = `
@@ -31832,3935 +31832,76 @@ exports[`Storyshots Repositories/Diff Default 1`] = ` >
-
-
-
- -

- 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; -
-
+ loading.alt +

-
-
-
- -

- 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 - - ); -
-
+ loading.alt +

-
-
-
- -

- src/main/resources/locales/de/plugins.json -

- - modify - -
-
-
-
- -
-
- -
-
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- 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 - - } -
- - 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": { -
-
+ loading.alt +

-
-
-
- -

- 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": { -
-
+ loading.alt +

-
-
-
- -

- src/test/java/com/cloudogu/scm/review/events/ClientTest.java -

- - modify - -
-
-
-
- -
-
- -
-
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- 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; -
-
-
- 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 -
-
+ loading.alt +

-
-
-
- -

- 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 - - } -
-
+ loading.alt +

@@ -35772,7 +31913,7 @@ exports[`Storyshots Repositories/Diff Expandable 1`] = ` >
@@ -36389,7 +32530,7 @@ exports[`Storyshots Repositories/Diff Expandable 1`] = `
@@ -37343,7 +33484,7 @@ exports[`Storyshots Repositories/Diff Expandable 1`] = `
@@ -37868,7 +34009,7 @@ exports[`Storyshots Repositories/Diff Expandable 1`] = `
@@ -38393,7 +34534,7 @@ exports[`Storyshots Repositories/Diff Expandable 1`] = `
@@ -39608,7 +35749,7 @@ exports[`Storyshots Repositories/Diff Expandable 1`] = `
@@ -40182,7 +36323,7 @@ exports[`Storyshots Repositories/Diff External state management 1`] = ` >
@@ -40799,7 +36940,7 @@ exports[`Storyshots Repositories/Diff External state management 1`] = `
@@ -41753,7 +37894,7 @@ exports[`Storyshots Repositories/Diff External state management 1`] = `
@@ -42278,7 +38419,7 @@ exports[`Storyshots Repositories/Diff External state management 1`] = `
@@ -42803,7 +38944,7 @@ exports[`Storyshots Repositories/Diff External state management 1`] = `
@@ -44018,7 +40159,7 @@ exports[`Storyshots Repositories/Diff External state management 1`] = `
@@ -44592,7 +40733,7 @@ exports[`Storyshots Repositories/Diff File Annotation 1`] = ` >
@@ -45176,7 +41317,7 @@ exports[`Storyshots Repositories/Diff File Annotation 1`] = `
@@ -46037,7 +42178,7 @@ exports[`Storyshots Repositories/Diff File Annotation 1`] = `
@@ -46494,7 +42635,7 @@ exports[`Storyshots Repositories/Diff File Annotation 1`] = `
@@ -46951,7 +43092,7 @@ exports[`Storyshots Repositories/Diff File Annotation 1`] = `
@@ -48015,7 +44156,7 @@ exports[`Storyshots Repositories/Diff File Annotation 1`] = `
@@ -48556,7 +44697,7 @@ exports[`Storyshots Repositories/Diff File Controls 1`] = ` >
@@ -49152,7 +45293,7 @@ exports[`Storyshots Repositories/Diff File Controls 1`] = `
@@ -50025,7 +46166,7 @@ exports[`Storyshots Repositories/Diff File Controls 1`] = `
@@ -50494,7 +46635,7 @@ exports[`Storyshots Repositories/Diff File Controls 1`] = `
@@ -50963,7 +47104,7 @@ exports[`Storyshots Repositories/Diff File Controls 1`] = `
@@ -52039,7 +48180,7 @@ exports[`Storyshots Repositories/Diff File Controls 1`] = `
@@ -52592,7 +48733,7 @@ exports[`Storyshots Repositories/Diff Hunks 1`] = ` >
@@ -53436,7 +49577,7 @@ exports[`Storyshots Repositories/Diff Line Annotation 1`] = ` >
@@ -54028,7 +50169,7 @@ exports[`Storyshots Repositories/Diff Line Annotation 1`] = `
@@ -54897,7 +51038,7 @@ exports[`Storyshots Repositories/Diff Line Annotation 1`] = `
@@ -55350,7 +51491,7 @@ exports[`Storyshots Repositories/Diff Line Annotation 1`] = `
@@ -55803,7 +51944,7 @@ exports[`Storyshots Repositories/Diff Line Annotation 1`] = `
@@ -56863,7 +53004,7 @@ exports[`Storyshots Repositories/Diff Line Annotation 1`] = `
@@ -57412,7 +53553,7 @@ exports[`Storyshots Repositories/Diff OnClick 1`] = ` >
@@ -58032,7 +54173,7 @@ exports[`Storyshots Repositories/Diff OnClick 1`] = `
@@ -58951,7 +55092,7 @@ exports[`Storyshots Repositories/Diff OnClick 1`] = `
@@ -59434,7 +55575,7 @@ exports[`Storyshots Repositories/Diff OnClick 1`] = `
@@ -59917,7 +56058,7 @@ exports[`Storyshots Repositories/Diff OnClick 1`] = `
@@ -61053,7 +57194,7 @@ exports[`Storyshots Repositories/Diff OnClick 1`] = `
@@ -61626,7 +57767,7 @@ exports[`Storyshots Repositories/Diff Side-By-Side 1`] = ` >
@@ -62299,7 +58440,7 @@ exports[`Storyshots Repositories/Diff Side-By-Side 1`] = `
@@ -63246,7 +59387,7 @@ exports[`Storyshots Repositories/Diff Side-By-Side 1`] = `
@@ -63751,7 +59892,7 @@ exports[`Storyshots Repositories/Diff Side-By-Side 1`] = `
@@ -64256,7 +60397,7 @@ exports[`Storyshots Repositories/Diff Side-By-Side 1`] = `
@@ -65485,7 +61626,7 @@ exports[`Storyshots Repositories/Diff Side-By-Side 1`] = `
@@ -66095,7 +62236,7 @@ exports[`Storyshots Repositories/Diff SyntaxHighlighting (Markdown) 1`] = ` >
@@ -66457,7 +62598,7 @@ exports[`Storyshots Repositories/Diff SyntaxHighlighting 1`] = ` >
@@ -67037,7 +63178,7 @@ exports[`Storyshots Repositories/Diff SyntaxHighlighting 1`] = `
@@ -67894,7 +64035,7 @@ exports[`Storyshots Repositories/Diff SyntaxHighlighting 1`] = `
@@ -68347,7 +64488,7 @@ exports[`Storyshots Repositories/Diff SyntaxHighlighting 1`] = `
@@ -68800,7 +64941,7 @@ exports[`Storyshots Repositories/Diff SyntaxHighlighting 1`] = `
@@ -69860,7 +66001,7 @@ exports[`Storyshots Repositories/Diff SyntaxHighlighting 1`] = `
@@ -70397,7 +66538,7 @@ exports[`Storyshots Repositories/Diff WithLinkToFile 1`] = ` >
@@ -71014,7 +67155,7 @@ exports[`Storyshots Repositories/Diff WithLinkToFile 1`] = `
@@ -71968,7 +68109,7 @@ exports[`Storyshots Repositories/Diff WithLinkToFile 1`] = `
@@ -72493,7 +68634,7 @@ exports[`Storyshots Repositories/Diff WithLinkToFile 1`] = `
@@ -73018,7 +69159,7 @@ exports[`Storyshots Repositories/Diff WithLinkToFile 1`] = `
@@ -74233,7 +70374,7 @@ exports[`Storyshots Repositories/Diff WithLinkToFile 1`] = `
diff --git a/scm-ui/ui-legacy/package.json b/scm-ui/ui-legacy/package.json index feaef4f8f0..15fa66264b 100644 --- a/scm-ui/ui-legacy/package.json +++ b/scm-ui/ui-legacy/package.json @@ -4,7 +4,7 @@ "private": true, "main": "src/index.ts", "scripts": { - "test": "jest", + "test": "jest --passWithNoTests", "lint": "eslint src" }, "dependencies": { diff --git a/scm-ui/ui-modules/package.json b/scm-ui/ui-modules/package.json index 91fab3d68c..80bbe89b8a 100644 --- a/scm-ui/ui-modules/package.json +++ b/scm-ui/ui-modules/package.json @@ -4,7 +4,7 @@ "private": true, "main": "src/index.ts", "scripts": { - "test": "jest", + "test": "jest --passWithNoTests", "lint": "eslint src" }, "devDependencies": {