diff --git a/CHANGELOG.md b/CHANGELOG.md index de8beb16eb..4aa440222b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## Unreleased ### Added - Generation of email addresses for users, where none is configured ([#1370](https://github.com/scm-manager/scm-manager/pull/1370)) +- Source code fullscreen view ([#1376](https://github.com/scm-manager/scm-manager/pull/1376)) ### Fixed - Missing default permission to manage public gpg keys ([#1377](https://github.com/scm-manager/scm-manager/pull/1377)) @@ -370,3 +371,5 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 [2.6.1]: https://www.scm-manager.org/download/2.6.1 [2.6.2]: https://www.scm-manager.org/download/2.6.2 [2.6.3]: https://www.scm-manager.org/download/2.6.3 +[2.7.0]: https://www.scm-manager.org/download/2.7.0 +[2.7.1]: https://www.scm-manager.org/download/2.7.1 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 eec24b0966..9bbf3d36c6 100644 --- a/scm-ui/ui-components/src/__snapshots__/storyshots.test.ts.snap +++ b/scm-ui/ui-components/src/__snapshots__/storyshots.test.ts.snap @@ -3951,6 +3951,19 @@ exports[`Storyshots Diff Binaries 1`] = ` +
+ + + +
@@ -4219,6 +4232,19 @@ exports[`Storyshots Diff Collapsed 1`] = ` +
+ + + +
@@ -4315,6 +4341,19 @@ exports[`Storyshots Diff Collapsed 1`] = `
+
+ + + +
@@ -4411,6 +4450,19 @@ exports[`Storyshots Diff Collapsed 1`] = `
+
+ + + +
@@ -4507,6 +4559,19 @@ exports[`Storyshots Diff Collapsed 1`] = `
+
+ + + +
@@ -4603,6 +4668,19 @@ exports[`Storyshots Diff Collapsed 1`] = `
+
+ + + +
@@ -4699,6 +4777,19 @@ exports[`Storyshots Diff Collapsed 1`] = `
+
+ + + +
@@ -4804,6 +4895,19 @@ exports[`Storyshots Diff CollapsingWithFunction 1`] = `
+
+ + + +
@@ -4862,6 +4966,19 @@ exports[`Storyshots Diff CollapsingWithFunction 1`] = ` +
+ + + +
@@ -5703,6 +5820,19 @@ exports[`Storyshots Diff CollapsingWithFunction 1`] = ` +
+ + + +
@@ -6140,6 +6270,19 @@ exports[`Storyshots Diff CollapsingWithFunction 1`] = ` +
+ + + +
@@ -6577,6 +6720,19 @@ exports[`Storyshots Diff CollapsingWithFunction 1`] = ` +
+ + + +
@@ -6635,6 +6791,19 @@ exports[`Storyshots Diff CollapsingWithFunction 1`] = ` +
+ + + +
@@ -6702,6 +6871,19 @@ exports[`Storyshots Diff Default 1`] = ` +
+ + + +
@@ -7266,6 +7448,19 @@ exports[`Storyshots Diff Default 1`] = ` +
+ + + +
@@ -8107,6 +8302,19 @@ exports[`Storyshots Diff Default 1`] = ` +
+ + + +
@@ -8544,6 +8752,19 @@ exports[`Storyshots Diff Default 1`] = ` +
+ + + +
@@ -8981,6 +9202,19 @@ exports[`Storyshots Diff Default 1`] = ` +
+ + + +
@@ -10025,6 +10259,19 @@ exports[`Storyshots Diff Default 1`] = ` +
+ + + +
@@ -10546,6 +10793,19 @@ exports[`Storyshots Diff Expandable 1`] = ` +
+ + + +
@@ -11147,6 +11407,19 @@ exports[`Storyshots Diff Expandable 1`] = ` +
+ + + +
@@ -12085,6 +12358,19 @@ exports[`Storyshots Diff Expandable 1`] = ` +
+ + + +
@@ -12594,6 +12880,19 @@ exports[`Storyshots Diff Expandable 1`] = ` +
+ + + +
@@ -13103,6 +13402,19 @@ exports[`Storyshots Diff Expandable 1`] = ` +
+ + + +
@@ -14302,6 +14614,19 @@ exports[`Storyshots Diff Expandable 1`] = ` +
+ + + +
@@ -14860,6 +15185,19 @@ exports[`Storyshots Diff File Annotation 1`] = ` +
+ + + +
@@ -15428,6 +15766,19 @@ exports[`Storyshots Diff File Annotation 1`] = ` +
+ + + +
@@ -16273,6 +16624,19 @@ exports[`Storyshots Diff File Annotation 1`] = ` +
+ + + +
@@ -16714,6 +17078,19 @@ exports[`Storyshots Diff File Annotation 1`] = ` +
+ + + +
@@ -17155,6 +17532,19 @@ exports[`Storyshots Diff File Annotation 1`] = ` +
+ + + +
@@ -18203,6 +18593,19 @@ exports[`Storyshots Diff File Annotation 1`] = ` +
+ + + +
@@ -18728,6 +19131,19 @@ exports[`Storyshots Diff File Controls 1`] = ` +
+ + + +
@@ -19310,6 +19726,19 @@ exports[`Storyshots Diff File Controls 1`] = `
+
+ + + +
@@ -20169,6 +20598,19 @@ exports[`Storyshots Diff File Controls 1`] = `
+
+ + + +
@@ -20624,6 +21066,19 @@ exports[`Storyshots Diff File Controls 1`] = `
+
+ + + +
@@ -21079,6 +21534,19 @@ exports[`Storyshots Diff File Controls 1`] = `
+
+ + + +
@@ -22141,6 +22609,19 @@ exports[`Storyshots Diff File Controls 1`] = `
+
+ + + +
@@ -22680,6 +23161,19 @@ exports[`Storyshots Diff Hunks 1`] = `
+
+ + + +
@@ -23508,6 +24002,19 @@ exports[`Storyshots Diff Line Annotation 1`] = ` +
+ + + +
@@ -24084,6 +24591,19 @@ exports[`Storyshots Diff Line Annotation 1`] = ` +
+ + + +
@@ -24937,6 +25457,19 @@ exports[`Storyshots Diff Line Annotation 1`] = ` +
+ + + +
@@ -25374,6 +25907,19 @@ exports[`Storyshots Diff Line Annotation 1`] = ` +
+ + + +
@@ -25811,6 +26357,19 @@ exports[`Storyshots Diff Line Annotation 1`] = ` +
+ + + +
@@ -26855,6 +27414,19 @@ exports[`Storyshots Diff Line Annotation 1`] = ` +
+ + + +
@@ -27388,6 +27960,19 @@ exports[`Storyshots Diff OnClick 1`] = ` +
+ + + +
@@ -27992,6 +28577,19 @@ exports[`Storyshots Diff OnClick 1`] = ` +
+ + + +
@@ -28895,6 +29493,19 @@ exports[`Storyshots Diff OnClick 1`] = ` +
+ + + +
@@ -29362,6 +29973,19 @@ exports[`Storyshots Diff OnClick 1`] = ` +
+ + + +
@@ -29829,6 +30453,19 @@ exports[`Storyshots Diff OnClick 1`] = ` +
+ + + +
@@ -30949,6 +31586,19 @@ exports[`Storyshots Diff OnClick 1`] = ` +
+ + + +
@@ -31506,6 +32156,19 @@ exports[`Storyshots Diff Side-By-Side 1`] = ` +
+ + + +
@@ -32163,6 +32826,19 @@ exports[`Storyshots Diff Side-By-Side 1`] = ` +
+ + + +
@@ -33094,6 +33770,19 @@ exports[`Storyshots Diff Side-By-Side 1`] = ` +
+ + + +
@@ -33583,6 +34272,19 @@ exports[`Storyshots Diff Side-By-Side 1`] = ` +
+ + + +
@@ -34072,6 +34774,19 @@ exports[`Storyshots Diff Side-By-Side 1`] = ` +
+ + + +
@@ -35285,6 +36000,19 @@ exports[`Storyshots Diff Side-By-Side 1`] = ` +
+ + + +
@@ -35879,6 +36607,19 @@ exports[`Storyshots Diff SyntaxHighlighting 1`] = ` +
+ + + +
@@ -36443,6 +37184,19 @@ exports[`Storyshots Diff SyntaxHighlighting 1`] = ` +
+ + + +
@@ -37284,6 +38038,19 @@ exports[`Storyshots Diff SyntaxHighlighting 1`] = ` +
+ + + +
@@ -37721,6 +38488,19 @@ exports[`Storyshots Diff SyntaxHighlighting 1`] = ` +
+ + + +
@@ -38158,6 +38938,19 @@ exports[`Storyshots Diff SyntaxHighlighting 1`] = ` +
+ + + +
@@ -39202,6 +39995,19 @@ exports[`Storyshots Diff SyntaxHighlighting 1`] = ` +
+ + + +
@@ -39723,6 +40529,19 @@ exports[`Storyshots Diff WithLinkToFile 1`] = ` +
+ + + +
@@ -40324,6 +41143,19 @@ exports[`Storyshots Diff WithLinkToFile 1`] = ` +
+ + + +
@@ -41262,6 +42094,19 @@ exports[`Storyshots Diff WithLinkToFile 1`] = ` +
+ + + +
@@ -41771,6 +42616,19 @@ exports[`Storyshots Diff WithLinkToFile 1`] = ` +
+ + + +
@@ -42280,6 +43138,19 @@ exports[`Storyshots Diff WithLinkToFile 1`] = ` +
+ + + +
@@ -43479,6 +44350,19 @@ exports[`Storyshots Diff WithLinkToFile 1`] = ` +
+ + + +
diff --git a/scm-ui/ui-components/src/buttons/OpenInFullscreenButton.tsx b/scm-ui/ui-components/src/buttons/OpenInFullscreenButton.tsx new file mode 100644 index 0000000000..70d4ee5ead --- /dev/null +++ b/scm-ui/ui-components/src/buttons/OpenInFullscreenButton.tsx @@ -0,0 +1,63 @@ +/* + * MIT License + * + * Copyright (c) 2020-present Cloudogu GmbH and Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +import * as React from "react"; +import { FC, ReactNode, useState } from "react"; +import { useTranslation } from "react-i18next"; +import styled from "styled-components"; +import FullscreenModal from "../modals/FullscreenModal"; + +type Props = { + modalTitle: string; + modalBody: ReactNode; +}; + +const Button = styled.a` + width: 50px; + &:hover { + color: #33b2e8; + } +`; + +const OpenInFullscreenButton: FC = ({ modalTitle, modalBody }) => { + const [t] = useTranslation("repos"); + const [showModal, setShowModal] = useState(false); + + return ( + <> + + {showModal && ( + setShowModal(false)} + body={modalBody} + active={showModal} + /> + )} + + ); +}; + +export default OpenInFullscreenButton; diff --git a/scm-ui/ui-components/src/buttons/index.ts b/scm-ui/ui-components/src/buttons/index.ts index 3949b333fe..cc7307572d 100644 --- a/scm-ui/ui-components/src/buttons/index.ts +++ b/scm-ui/ui-components/src/buttons/index.ts @@ -33,4 +33,5 @@ export { default as SubmitButton } from "./SubmitButton"; export { default as DownloadButton } from "./DownloadButton"; export { default as ButtonGroup } from "./ButtonGroup"; export { default as ButtonAddons } from "./ButtonAddons"; +export { default as OpenInFullscreenButton } from "./OpenInFullscreenButton"; export { default as RemoveEntryOfTableButton } from "./RemoveEntryOfTableButton"; diff --git a/scm-ui/ui-components/src/modals/FullscreenModal.tsx b/scm-ui/ui-components/src/modals/FullscreenModal.tsx new file mode 100644 index 0000000000..72951da5ca --- /dev/null +++ b/scm-ui/ui-components/src/modals/FullscreenModal.tsx @@ -0,0 +1,52 @@ +/* + * MIT License + * + * Copyright (c) 2020-present Cloudogu GmbH and Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +import * as React from "react"; +import { FC, ReactNode } from "react"; +import { useTranslation } from "react-i18next"; +import { Modal } from "./Modal"; +import Button from "../buttons/Button"; +import styled from "styled-components"; + +type Props = { + title: string; + closeFunction: () => void; + body: ReactNode; + active: boolean; +}; + +const FullSizedModal = styled(Modal)` + & .modal-card { + width: 98%; + max-height: 97vh; + } +`; + +const FullscreenModal: FC = ({ title, closeFunction, body, active }) => { + const [t] = useTranslation("repos"); + const footer =