diff --git a/CHANGELOG.md b/CHANGELOG.md index c7eec3b53f..09c7454ad9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,11 +7,15 @@ 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)) -- Add mechanism for deploying ui content ([#1382](https://github.com/scm-manager/scm-manager/pull/1382)) +- Generation of email addresses for users, where none is configured ([#1370](https://github.com/scm-manager/scm-manager/pull/1370))- Add mechanism for deploying ui content ([#1382](https://github.com/scm-manager/scm-manager/pull/1382)) ### Changed - Centralise syntax highlighting ([#1382](https://github.com/scm-manager/scm-manager/pull/1382)) +- Source code fullscreen view ([#1376](https://github.com/scm-manager/scm-manager/pull/1376)) + +## [2.6.3] - 2020-10-16 +### Fixed +- Missing default permission to manage public gpg keys ([#1377](https://github.com/scm-manager/scm-manager/pull/1377)) ## [2.7.1] - 2020-10-14 ### Fixed @@ -366,3 +370,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 [2.6.0]: https://www.scm-manager.org/download/2.6.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/Jenkinsfile b/Jenkinsfile index 2ef5929e09..c6dc70b8d7 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -7,7 +7,8 @@ import com.cloudogu.ces.cesbuildlib.* node('docker') { - mainBranch = 'develop' + developmentBranch = 'develop' + mainBranch = 'master' properties([ // Keep only the last 10 build to preserve space @@ -51,9 +52,9 @@ node('docker') { sh "git config 'remote.origin.fetch' '+refs/heads/*:refs/remotes/origin/*'" sh "git fetch --all" - // merge release branch into master - sh "git checkout master" - sh "git reset --hard origin/master" + // merge release branch into main branch + sh "git checkout ${mainBranch}" + sh "git reset --hard origin/${mainBranch}" sh "git merge --ff-only ${env.BRANCH_NAME}" // set tag @@ -87,7 +88,7 @@ node('docker') { sonarQube.analyzeWith(mvn) } - if (isBuildSuccessful() && (isMainBranch() || isReleaseBranch())) { + if (isBuildSuccessful() && (isDevelopmentBranch() || isReleaseBranch())) { def commitHash = git.getCommitHash() def imageVersion = mvn.getVersion() @@ -143,20 +144,28 @@ node('docker') { } stage('Presentation Environment') { - build job: 'scm-manager/next-scm.cloudogu.com', propagate: false, wait: false, parameters: [ - string(name: 'changeset', value: commitHash), - string(name: 'imageTag', value: imageVersion) - ] + // we don't use developmentBranch, because we only want the lastest version of develop branch on + // next-scm. We don't want a support branch or something similar on the presentation environment. + if ("develop".equals(env.BRANCH_NAME)) { + build job: 'scm-manager/next-scm.cloudogu.com', propagate: false, wait: false, parameters: [ + string(name: 'changeset', value: commitHash), + string(name: 'imageTag', value: imageVersion) + ] + } } if (isReleaseBranch()) { stage('Update Repository') { // merge changes into develop - sh "git checkout develop" + sh "git checkout ${developmentBranch}" + // TODO what if we have a conflict // e.g.: someone has edited the changelog during the release - sh "git merge master" + if (!developmentBranch.equals(mainBranch)) { + sh "git merge ${mainBranch}" + } + // set versions for maven packages mvn "build-helper:parse-version versions:set -DgenerateBackupPoms=false -DnewVersion='\${parsedVersion.majorVersion}.\${parsedVersion.nextMinorVersion}.0-SNAPSHOT'" @@ -176,8 +185,10 @@ node('docker') { // push changes back to remote repository withCredentials([usernamePassword(credentialsId: 'cesmarvin-github', usernameVariable: 'GIT_AUTH_USR', passwordVariable: 'GIT_AUTH_PSW')]) { - sh "git -c credential.helper=\"!f() { echo username='\$GIT_AUTH_USR'; echo password='\$GIT_AUTH_PSW'; }; f\" push origin master --tags" - sh "git -c credential.helper=\"!f() { echo username='\$GIT_AUTH_USR'; echo password='\$GIT_AUTH_PSW'; }; f\" push origin develop --tags" + sh "git -c credential.helper=\"!f() { echo username='\$GIT_AUTH_USR'; echo password='\$GIT_AUTH_PSW'; }; f\" push origin ${mainBranch} --tags" + if (!developmentBranch.equals(mainBranch)) { + sh "git -c credential.helper=\"!f() { echo username='\$GIT_AUTH_USR'; echo password='\$GIT_AUTH_PSW'; }; f\" push origin develop --tags" + } sh "git -c credential.helper=\"!f() { echo username='\$GIT_AUTH_USR'; echo password='\$GIT_AUTH_PSW'; }; f\" push origin :${env.BRANCH_NAME}" } } @@ -189,6 +200,7 @@ node('docker') { } } +String developmentBranch String mainBranch Maven setupMavenBuild() { @@ -201,7 +213,7 @@ Maven setupMavenBuild() { mvn.additionalArgs += " -Dscm-it.logbackConfiguration=${logConf}" mvn.additionalArgs += " -Dsonar.coverage.exclusions=**/*.test.ts,**/*.test.tsx,**/*.stories.tsx" - if (isMainBranch() || isReleaseBranch()) { + if (isDevelopmentBranch() || isReleaseBranch()) { // Release starts javadoc, which takes very long, so do only for certain branches mvn.additionalArgs += ' -DperformRelease' // JDK8 is more strict, we should fix this before the next release. Right now, this is just not the focus, yet. @@ -218,8 +230,8 @@ String getReleaseVersion() { return env.BRANCH_NAME.substring("release/".length()); } -boolean isMainBranch() { - return mainBranch.equals(env.BRANCH_NAME) +boolean isDevelopmentBranch() { + return developmentBranch.equals(env.BRANCH_NAME) } void withGPGEnvironment(def closure) { diff --git a/pom.xml b/pom.xml index 192705ba6b..4b50003136 100644 --- a/pom.xml +++ b/pom.xml @@ -903,7 +903,7 @@ - 3.5.11 + 3.5.13 2.1 5.7.0 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 06e6ae59b1..cd79a5424a 100644 --- a/scm-ui/ui-components/src/__snapshots__/storyshots.test.ts.snap +++ b/scm-ui/ui-components/src/__snapshots__/storyshots.test.ts.snap @@ -4199,6 +4199,23 @@ exports[`Storyshots Diff Binaries 1`] = ` +
+ + + + + +
@@ -4467,6 +4484,23 @@ exports[`Storyshots Diff Collapsed 1`] = ` +
+ + + + + +
@@ -4563,6 +4597,23 @@ exports[`Storyshots Diff Collapsed 1`] = `
+
+ + + + + +
@@ -4659,6 +4710,23 @@ exports[`Storyshots Diff Collapsed 1`] = `
+
+ + + + + +
@@ -4755,6 +4823,23 @@ exports[`Storyshots Diff Collapsed 1`] = `
+
+ + + + + +
@@ -4851,6 +4936,23 @@ exports[`Storyshots Diff Collapsed 1`] = `
+
+ + + + + +
@@ -4947,6 +5049,23 @@ exports[`Storyshots Diff Collapsed 1`] = `
+
+ + + + + +
@@ -5052,6 +5171,23 @@ exports[`Storyshots Diff CollapsingWithFunction 1`] = `
+
+ + + + + +
@@ -5110,6 +5246,23 @@ exports[`Storyshots Diff CollapsingWithFunction 1`] = ` +
+ + + + + +
@@ -5951,6 +6104,23 @@ exports[`Storyshots Diff CollapsingWithFunction 1`] = ` +
+ + + + + +
@@ -6388,6 +6558,23 @@ exports[`Storyshots Diff CollapsingWithFunction 1`] = ` +
+ + + + + +
@@ -6825,6 +7012,23 @@ exports[`Storyshots Diff CollapsingWithFunction 1`] = ` +
+ + + + + +
@@ -6883,6 +7087,23 @@ exports[`Storyshots Diff CollapsingWithFunction 1`] = ` +
+ + + + + +
@@ -6950,6 +7171,23 @@ exports[`Storyshots Diff Default 1`] = ` +
+ + + + + +
@@ -7514,6 +7752,23 @@ exports[`Storyshots Diff Default 1`] = ` +
+ + + + + +
@@ -8355,6 +8610,23 @@ exports[`Storyshots Diff Default 1`] = ` +
+ + + + + +
@@ -8792,6 +9064,23 @@ exports[`Storyshots Diff Default 1`] = ` +
+ + + + + +
@@ -9229,6 +9518,23 @@ exports[`Storyshots Diff Default 1`] = ` +
+ + + + + +
@@ -10273,6 +10579,23 @@ exports[`Storyshots Diff Default 1`] = ` +
+ + + + + +
@@ -10794,6 +11117,23 @@ exports[`Storyshots Diff Expandable 1`] = ` +
+ + + + + +
@@ -11395,6 +11735,23 @@ exports[`Storyshots Diff Expandable 1`] = ` +
+ + + + + +
@@ -12333,6 +12690,23 @@ exports[`Storyshots Diff Expandable 1`] = ` +
+ + + + + +
@@ -12842,6 +13216,23 @@ exports[`Storyshots Diff Expandable 1`] = ` +
+ + + + + +
@@ -13351,6 +13742,23 @@ exports[`Storyshots Diff Expandable 1`] = ` +
+ + + + + +
@@ -14550,6 +14958,23 @@ exports[`Storyshots Diff Expandable 1`] = ` +
+ + + + + +
@@ -15108,6 +15533,23 @@ exports[`Storyshots Diff File Annotation 1`] = ` +
+ + + + + +
@@ -15676,6 +16118,23 @@ exports[`Storyshots Diff File Annotation 1`] = ` +
+ + + + + +
@@ -16521,6 +16980,23 @@ exports[`Storyshots Diff File Annotation 1`] = ` +
+ + + + + +
@@ -16962,6 +17438,23 @@ exports[`Storyshots Diff File Annotation 1`] = ` +
+ + + + + +
@@ -17403,6 +17896,23 @@ exports[`Storyshots Diff File Annotation 1`] = ` +
+ + + + + +
@@ -18451,6 +18961,23 @@ exports[`Storyshots Diff File Annotation 1`] = ` +
+ + + + + +
@@ -18976,6 +19503,23 @@ exports[`Storyshots Diff File Controls 1`] = ` +
+ + + + + +
@@ -19558,6 +20102,23 @@ exports[`Storyshots Diff File Controls 1`] = `
+
+ + + + + +
@@ -20417,6 +20978,23 @@ exports[`Storyshots Diff File Controls 1`] = `
+
+ + + + + +
@@ -20872,6 +21450,23 @@ exports[`Storyshots Diff File Controls 1`] = `
+
+ + + + + +
@@ -21327,6 +21922,23 @@ exports[`Storyshots Diff File Controls 1`] = `
+
+ + + + + +
@@ -22389,6 +23001,23 @@ exports[`Storyshots Diff File Controls 1`] = `
+
+ + + + + +
@@ -22928,6 +23557,23 @@ exports[`Storyshots Diff Hunks 1`] = `
+
+ + + + + +
@@ -23756,6 +24402,23 @@ exports[`Storyshots Diff Line Annotation 1`] = ` +
+ + + + + +
@@ -24332,6 +24995,23 @@ exports[`Storyshots Diff Line Annotation 1`] = ` +
+ + + + + +
@@ -25185,6 +25865,23 @@ exports[`Storyshots Diff Line Annotation 1`] = ` +
+ + + + + +
@@ -25622,6 +26319,23 @@ exports[`Storyshots Diff Line Annotation 1`] = ` +
+ + + + + +
@@ -26059,6 +26773,23 @@ exports[`Storyshots Diff Line Annotation 1`] = ` +
+ + + + + +
@@ -27103,6 +27834,23 @@ exports[`Storyshots Diff Line Annotation 1`] = ` +
+ + + + + +
@@ -27636,6 +28384,23 @@ exports[`Storyshots Diff OnClick 1`] = ` +
+ + + + + +
@@ -28240,6 +29005,23 @@ exports[`Storyshots Diff OnClick 1`] = ` +
+ + + + + +
@@ -29143,6 +29925,23 @@ exports[`Storyshots Diff OnClick 1`] = ` +
+ + + + + +
@@ -29610,6 +30409,23 @@ exports[`Storyshots Diff OnClick 1`] = ` +
+ + + + + +
@@ -30077,6 +30893,23 @@ exports[`Storyshots Diff OnClick 1`] = ` +
+ + + + + +
@@ -31197,6 +32030,23 @@ exports[`Storyshots Diff OnClick 1`] = ` +
+ + + + + +
@@ -31754,6 +32604,23 @@ exports[`Storyshots Diff Side-By-Side 1`] = ` +
+ + + + + +
@@ -32411,6 +33278,23 @@ exports[`Storyshots Diff Side-By-Side 1`] = ` +
+ + + + + +
@@ -33342,6 +34226,23 @@ exports[`Storyshots Diff Side-By-Side 1`] = ` +
+ + + + + +
@@ -33831,6 +34732,23 @@ exports[`Storyshots Diff Side-By-Side 1`] = ` +
+ + + + + +
@@ -34320,6 +35238,23 @@ exports[`Storyshots Diff Side-By-Side 1`] = ` +
+ + + + + +
@@ -35533,6 +36468,23 @@ exports[`Storyshots Diff Side-By-Side 1`] = ` +
+ + + + + +
@@ -36127,6 +37079,23 @@ exports[`Storyshots Diff SyntaxHighlighting 1`] = ` +
+ + + + + +
@@ -36691,6 +37660,23 @@ exports[`Storyshots Diff SyntaxHighlighting 1`] = ` +
+ + + + + +
@@ -37532,6 +38518,23 @@ exports[`Storyshots Diff SyntaxHighlighting 1`] = ` +
+ + + + + +
@@ -37969,6 +38972,23 @@ exports[`Storyshots Diff SyntaxHighlighting 1`] = ` +
+ + + + + +
@@ -38406,6 +39426,23 @@ exports[`Storyshots Diff SyntaxHighlighting 1`] = ` +
+ + + + + +
@@ -39450,6 +40487,23 @@ exports[`Storyshots Diff SyntaxHighlighting 1`] = ` +
+ + + + + +
@@ -39971,6 +41025,23 @@ exports[`Storyshots Diff WithLinkToFile 1`] = ` +
+ + + + + +
@@ -40572,6 +41643,23 @@ exports[`Storyshots Diff WithLinkToFile 1`] = ` +
+ + + + + +
@@ -41510,6 +42598,23 @@ exports[`Storyshots Diff WithLinkToFile 1`] = ` +
+ + + + + +
@@ -42019,6 +43124,23 @@ exports[`Storyshots Diff WithLinkToFile 1`] = ` +
+ + + + + +
@@ -42528,6 +43650,23 @@ exports[`Storyshots Diff WithLinkToFile 1`] = ` +
+ + + + + +
@@ -43727,6 +44866,23 @@ 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..c1cd1c6da2 --- /dev/null +++ b/scm-ui/ui-components/src/buttons/OpenInFullscreenButton.tsx @@ -0,0 +1,79 @@ +/* + * 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"; +import Tooltip from "../Tooltip"; + +type Props = { + modalTitle: string; + modalBody: ReactNode; + tooltipStyle?: "tooltipComponent" | "htmlTitle"; +}; + +const Button = styled.a` + width: 50px; + &:hover { + color: #33b2e8; + } +`; + +const OpenInFullscreenButton: FC = ({ modalTitle, modalBody, tooltipStyle = "tooltipComponent" }) => { + const [t] = useTranslation("repos"); + const [showModal, setShowModal] = useState(false); + + const tooltip = t("diff.fullscreen.open"); + const content = ( + <> + + {showModal && ( + setShowModal(false)} + body={modalBody} + active={showModal} + /> + )} + + ); + + if (tooltipStyle === "htmlTitle") { + return <>{content}; + } + return ( + + {content} + + ); +}; + +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 =