From 7554deaad4c1db7a8531c99ae562882cc20c901a Mon Sep 17 00:00:00 2001 From: Eduard Heimbuch Date: Thu, 19 Mar 2020 13:12:03 +0100 Subject: [PATCH 01/44] prepare first extensionpoint for favourite repository icon --- scm-ui/ui-components/src/CardColumn.tsx | 4 ++-- .../src/admin/plugins/components/PluginEntry.tsx | 2 +- .../src/repos/components/list/RepositoryEntry.tsx | 12 +++++++++++- 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/scm-ui/ui-components/src/CardColumn.tsx b/scm-ui/ui-components/src/CardColumn.tsx index f7e7570d1d..0f28c3f3dc 100644 --- a/scm-ui/ui-components/src/CardColumn.tsx +++ b/scm-ui/ui-components/src/CardColumn.tsx @@ -4,7 +4,7 @@ import styled from "styled-components"; import { Link } from "react-router-dom"; type Props = { - title: string; + title: ReactNode; description?: string; avatar: ReactNode; contentRight?: ReactNode; @@ -77,7 +77,7 @@ export default class CardColumn extends React.Component {

- {title} + {title}

{description}

diff --git a/scm-ui/ui-webapp/src/admin/plugins/components/PluginEntry.tsx b/scm-ui/ui-webapp/src/admin/plugins/components/PluginEntry.tsx index c5afeae3e7..e4e3413863 100644 --- a/scm-ui/ui-webapp/src/admin/plugins/components/PluginEntry.tsx +++ b/scm-ui/ui-webapp/src/admin/plugins/components/PluginEntry.tsx @@ -158,7 +158,7 @@ class PluginEntry extends React.Component { this.toggleModal("showInstallModal") : null} avatar={avatar} - title={plugin.displayName ? plugin.displayName : plugin.name} + title={plugin.displayName ? {plugin.displayName} : {plugin.name}} description={plugin.description} contentRight={plugin.pending || plugin.markedForUninstall ? this.createPendingSpinner() : actionbar} footerRight={footerRight} diff --git a/scm-ui/ui-webapp/src/repos/components/list/RepositoryEntry.tsx b/scm-ui/ui-webapp/src/repos/components/list/RepositoryEntry.tsx index 8f4f0c295a..0f73065303 100644 --- a/scm-ui/ui-webapp/src/repos/components/list/RepositoryEntry.tsx +++ b/scm-ui/ui-webapp/src/repos/components/list/RepositoryEntry.tsx @@ -62,15 +62,25 @@ class RepositoryEntry extends React.Component { ); }; + createTitle = () => { + const { repository } = this.props; + return ( + <> + {repository.name} + + ); + }; + render() { const { repository } = this.props; const repositoryLink = this.createLink(repository); const footerLeft = this.createFooterLeft(repository, repositoryLink); const footerRight = this.createFooterRight(repository); + const title = this.createTitle(); return ( } - title={repository.name} + title={title} description={repository.description} link={repositoryLink} footerLeft={footerLeft} From 606d1992249d7bfb391012d92a72550ffe495f1a Mon Sep 17 00:00:00 2001 From: snyk-bot Date: Sun, 22 Mar 2020 01:37:34 +0000 Subject: [PATCH 02/44] fix: upgrade javax.xml.bind:jaxb-api from 2.3.0 to 2.3.1 Snyk has created this PR to upgrade javax.xml.bind:jaxb-api from 2.3.0 to 2.3.1. See this package in NPM: https://www.npmjs.com/package/javax.xml.bind:jaxb-api See this project in Snyk: https://app.snyk.io/org/scm-manager/project/e67572ee-5940-4f2b-93b0-dced62d7ed85?utm_source=github&utm_medium=upgrade-pr --- scm-webapp/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scm-webapp/pom.xml b/scm-webapp/pom.xml index 8dd7873238..dd504200fb 100644 --- a/scm-webapp/pom.xml +++ b/scm-webapp/pom.xml @@ -179,7 +179,7 @@ javax.xml.bind jaxb-api - 2.3.0 + 2.3.1 From cfbce89717953f2c620e43ceaddc51349cc8cb10 Mon Sep 17 00:00:00 2001 From: snyk-bot Date: Mon, 23 Mar 2020 04:42:53 +0000 Subject: [PATCH 03/44] fix: upgrade mini-css-extract-plugin from 0.8.2 to 0.9.0 Snyk has created this PR to upgrade mini-css-extract-plugin from 0.8.2 to 0.9.0. See this package in NPM: https://www.npmjs.com/package/mini-css-extract-plugin See this project in Snyk: https://app.snyk.io/org/scm-manager/project/e563ed8d-dedf-4b52-af75-5d89b1e70f44?utm_source=github&utm_medium=upgrade-pr --- scm-ui/ui-scripts/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scm-ui/ui-scripts/package.json b/scm-ui/ui-scripts/package.json index 5df93fa572..e200893c27 100644 --- a/scm-ui/ui-scripts/package.json +++ b/scm-ui/ui-scripts/package.json @@ -14,7 +14,7 @@ "babel-loader": "^8.0.6", "css-loader": "^3.2.0", "file-loader": "^4.2.0", - "mini-css-extract-plugin": "^0.8.0", + "mini-css-extract-plugin": "^0.9.0", "mustache": "^3.1.0", "optimize-css-assets-webpack-plugin": "^5.0.3", "react-refresh": "^0.7.2", From 5e430a373f71b54b6f42e7d0164c57cce4692ba8 Mon Sep 17 00:00:00 2001 From: snyk-bot Date: Mon, 23 Mar 2020 04:42:58 +0000 Subject: [PATCH 04/44] fix: upgrade react-refresh from 0.7.2 to 0.8.0 Snyk has created this PR to upgrade react-refresh from 0.7.2 to 0.8.0. See this package in NPM: https://www.npmjs.com/package/react-refresh See this project in Snyk: https://app.snyk.io/org/scm-manager/project/e563ed8d-dedf-4b52-af75-5d89b1e70f44?utm_source=github&utm_medium=upgrade-pr --- scm-ui/ui-scripts/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scm-ui/ui-scripts/package.json b/scm-ui/ui-scripts/package.json index 5df93fa572..8a80763cc8 100644 --- a/scm-ui/ui-scripts/package.json +++ b/scm-ui/ui-scripts/package.json @@ -17,7 +17,7 @@ "mini-css-extract-plugin": "^0.8.0", "mustache": "^3.1.0", "optimize-css-assets-webpack-plugin": "^5.0.3", - "react-refresh": "^0.7.2", + "react-refresh": "^0.8.0", "sass": "^1.26.3", "sass-loader": "^8.0.0", "script-loader": "^0.7.2", From e2d4ebe70661be686da3c593157e2e2c922fbaa5 Mon Sep 17 00:00:00 2001 From: Eduard Heimbuch Date: Tue, 24 Mar 2020 08:46:58 +0100 Subject: [PATCH 05/44] add second extension point for repository favorite --- .../src/repos/components/RepositoryDetailTable.tsx | 5 ++++- .../src/repos/components/list/RepositoryEntry.tsx | 2 +- yarn.lock | 8 ++++---- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/scm-ui/ui-webapp/src/repos/components/RepositoryDetailTable.tsx b/scm-ui/ui-webapp/src/repos/components/RepositoryDetailTable.tsx index bf5ce5eaff..422d9baaab 100644 --- a/scm-ui/ui-webapp/src/repos/components/RepositoryDetailTable.tsx +++ b/scm-ui/ui-webapp/src/repos/components/RepositoryDetailTable.tsx @@ -2,6 +2,7 @@ import React from "react"; import { WithTranslation, withTranslation } from "react-i18next"; import { Repository } from "@scm-manager/ui-types"; import { DateFromNow, MailLink } from "@scm-manager/ui-components"; +import { ExtensionPoint } from "@scm-manager/ui-extensions"; type Props = WithTranslation & { repository: Repository; @@ -15,7 +16,9 @@ class RepositoryDetailTable extends React.Component { {t("repository.name")} - {repository.name} + + {repository.name} + {t("repository.type")} diff --git a/scm-ui/ui-webapp/src/repos/components/list/RepositoryEntry.tsx b/scm-ui/ui-webapp/src/repos/components/list/RepositoryEntry.tsx index 0f73065303..58ce2ee0d9 100644 --- a/scm-ui/ui-webapp/src/repos/components/list/RepositoryEntry.tsx +++ b/scm-ui/ui-webapp/src/repos/components/list/RepositoryEntry.tsx @@ -66,7 +66,7 @@ class RepositoryEntry extends React.Component { const { repository } = this.props; return ( <> - {repository.name} + {repository.name} ); }; diff --git a/yarn.lock b/yarn.lock index 42d56ee047..80a0146d61 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4370,10 +4370,10 @@ bulma-tooltip@^3.0.0: resolved "https://registry.yarnpkg.com/bulma-tooltip/-/bulma-tooltip-3.0.2.tgz#2cf0abab1de2eba07f9d84eb7f07a8a88819ea92" integrity sha512-CsT3APjhlZScskFg38n8HYL8oYNUHQtcu4sz6ERarxkUpBRbk9v0h/5KAvXeKapVSn2dp9l7bOGit5SECP8EWQ== -bulma@^0.7.5: - version "0.7.5" - resolved "https://registry.yarnpkg.com/bulma/-/bulma-0.7.5.tgz#35066c37f82c088b68f94450be758fc00a967208" - integrity sha512-cX98TIn0I6sKba/DhW0FBjtaDpxTelU166pf7ICXpCCuplHWyu6C9LYZmL5PEsnePIeJaiorsTEzzNk3Tsm1hw== +bulma@^0.8.0: + version "0.8.0" + resolved "https://registry.yarnpkg.com/bulma/-/bulma-0.8.0.tgz#ac1606431703a4761b18a4a2d5cc1fa864a2aece" + integrity sha512-nhf3rGyiZh/VM7FrSJ/5KeLlfaFkXz0nYcXriynfPH4vVpnxnqyEwaNGdNCVzHyyCA3cHgkQAMpdF/SFbFGZfA== byline@^5.0.0: version "5.0.0" From df285182a8a85e81b1d9192de0e892c8db2141ec Mon Sep 17 00:00:00 2001 From: Eduard Heimbuch Date: Wed, 25 Mar 2020 08:08:40 +0100 Subject: [PATCH 06/44] move favorite icon from details table to page title --- scm-ui/ui-components/src/layout/Page.tsx | 11 +++++++++-- .../src/repos/components/RepositoryDetailTable.tsx | 4 +--- .../ui-webapp/src/repos/containers/RepositoryRoot.tsx | 5 ++++- 3 files changed, 14 insertions(+), 6 deletions(-) diff --git a/scm-ui/ui-components/src/layout/Page.tsx b/scm-ui/ui-components/src/layout/Page.tsx index 128337fd73..3746ee7fbc 100644 --- a/scm-ui/ui-components/src/layout/Page.tsx +++ b/scm-ui/ui-components/src/layout/Page.tsx @@ -10,6 +10,7 @@ import ErrorBoundary from "../ErrorBoundary"; type Props = { title?: string; + afterTitle?: ReactNode; subtitle?: string; loading?: boolean; error?: Error; @@ -27,6 +28,10 @@ const PageActionContainer = styled.div` } `; +const MarginLeft = styled.div` +margin-left: 0.5rem; +`; + export default class Page extends React.Component { componentDidUpdate() { const { title } = this.props; @@ -57,7 +62,7 @@ export default class Page extends React.Component { } renderPageHeader() { - const { error, title, subtitle, children } = this.props; + const { error, title, afterTitle, subtitle, children } = this.props; let pageActions = null; let pageActionsExists = false; @@ -81,7 +86,9 @@ export default class Page extends React.Component { <>
- + <div className="is-flex"> + <Title title={title} /> <MarginLeft>{afterTitle}</MarginLeft> + </div> <Subtitle subtitle={subtitle} /> </div> {pageActions} diff --git a/scm-ui/ui-webapp/src/repos/components/RepositoryDetailTable.tsx b/scm-ui/ui-webapp/src/repos/components/RepositoryDetailTable.tsx index 422d9baaab..3d9a9ea5aa 100644 --- a/scm-ui/ui-webapp/src/repos/components/RepositoryDetailTable.tsx +++ b/scm-ui/ui-webapp/src/repos/components/RepositoryDetailTable.tsx @@ -16,9 +16,7 @@ class RepositoryDetailTable extends React.Component<Props> { <tbody> <tr> <th>{t("repository.name")}</th> - <td> - <ExtensionPoint name={"repository.details.beforeName"} props={{ repository }} /> {repository.name} - </td> + <td>{repository.name}</td> </tr> <tr> <th>{t("repository.type")}</th> diff --git a/scm-ui/ui-webapp/src/repos/containers/RepositoryRoot.tsx b/scm-ui/ui-webapp/src/repos/containers/RepositoryRoot.tsx index c22a4f583e..80b0d19349 100644 --- a/scm-ui/ui-webapp/src/repos/containers/RepositoryRoot.tsx +++ b/scm-ui/ui-webapp/src/repos/containers/RepositoryRoot.tsx @@ -146,7 +146,10 @@ class RepositoryRoot extends React.Component<Props, State> { setMenuCollapsed: (collapsed: boolean) => this.setState({ menuCollapsed: collapsed }) }} > - <Page title={repository.namespace + "/" + repository.name}> + <Page + title={repository.namespace + "/" + repository.name} + afterTitle={<ExtensionPoint name={"repository.afterTitle"} props={{ repository }} />} + > <div className="columns"> <div className="column"> <Switch> From fd12464af4336fd670f4b275a2d6d4300c1be8e5 Mon Sep 17 00:00:00 2001 From: Eduard Heimbuch <eduard.heimbuch@cloudogu.com> Date: Wed, 25 Mar 2020 09:54:12 +0100 Subject: [PATCH 07/44] add RepositoryToHalMapper as interface to map a repositoryDto outside of webapp --- .../java/sonia/scm/web/api/RepositoryToHalMapper.java | 8 ++++++++ scm-ui/ui-components/src/layout/Page.tsx | 11 ++++++++--- .../java/sonia/scm/api/v2/resources/MapperModule.java | 3 +++ .../v2/resources/RepositoryToRepositoryDtoMapper.java | 6 +++++- 4 files changed, 24 insertions(+), 4 deletions(-) create mode 100644 scm-core/src/main/java/sonia/scm/web/api/RepositoryToHalMapper.java diff --git a/scm-core/src/main/java/sonia/scm/web/api/RepositoryToHalMapper.java b/scm-core/src/main/java/sonia/scm/web/api/RepositoryToHalMapper.java new file mode 100644 index 0000000000..a5ca7339d8 --- /dev/null +++ b/scm-core/src/main/java/sonia/scm/web/api/RepositoryToHalMapper.java @@ -0,0 +1,8 @@ +package sonia.scm.web.api; + +import de.otto.edison.hal.HalRepresentation; +import sonia.scm.repository.Repository; + +public interface RepositoryToHalMapper { + HalRepresentation map(Repository repository); +} diff --git a/scm-ui/ui-components/src/layout/Page.tsx b/scm-ui/ui-components/src/layout/Page.tsx index 3746ee7fbc..44880b1c50 100644 --- a/scm-ui/ui-components/src/layout/Page.tsx +++ b/scm-ui/ui-components/src/layout/Page.tsx @@ -32,6 +32,11 @@ const MarginLeft = styled.div` margin-left: 0.5rem; `; +const FlexContainer = styled.div` + display: flex; + flex-direction: row; +`; + export default class Page extends React.Component<Props> { componentDidUpdate() { const { title } = this.props; @@ -86,9 +91,9 @@ export default class Page extends React.Component<Props> { <> <div className="columns"> <div className="column"> - <div className="is-flex"> - <Title title={title} /> <MarginLeft>{afterTitle}</MarginLeft> - </div> + <FlexContainer> + <Title title={title} /> {afterTitle && <MarginLeft>{afterTitle}</MarginLeft>} + </FlexContainer> <Subtitle subtitle={subtitle} /> </div> {pageActions} diff --git a/scm-webapp/src/main/java/sonia/scm/api/v2/resources/MapperModule.java b/scm-webapp/src/main/java/sonia/scm/api/v2/resources/MapperModule.java index c7d88e7c0a..ab45d8ce28 100644 --- a/scm-webapp/src/main/java/sonia/scm/api/v2/resources/MapperModule.java +++ b/scm-webapp/src/main/java/sonia/scm/api/v2/resources/MapperModule.java @@ -3,6 +3,7 @@ package sonia.scm.api.v2.resources; import com.google.inject.AbstractModule; import com.google.inject.servlet.ServletScopes; import org.mapstruct.factory.Mappers; +import sonia.scm.web.api.RepositoryToHalMapper; public class MapperModule extends AbstractModule { @Override @@ -46,6 +47,8 @@ public class MapperModule extends AbstractModule { bind(ScmViolationExceptionToErrorDtoMapper.class).to(Mappers.getMapper(ScmViolationExceptionToErrorDtoMapper.class).getClass()); bind(ExceptionWithContextToErrorDtoMapper.class).to(Mappers.getMapper(ExceptionWithContextToErrorDtoMapper.class).getClass()); + bind(RepositoryToHalMapper.class).to(Mappers.getMapper(RepositoryToRepositoryDtoMapper.class).getClass()); + // no mapstruct required bind(MeDtoFactory.class); bind(UIPluginDtoMapper.class); diff --git a/scm-webapp/src/main/java/sonia/scm/api/v2/resources/RepositoryToRepositoryDtoMapper.java b/scm-webapp/src/main/java/sonia/scm/api/v2/resources/RepositoryToRepositoryDtoMapper.java index 9e91269b15..c650102969 100644 --- a/scm-webapp/src/main/java/sonia/scm/api/v2/resources/RepositoryToRepositoryDtoMapper.java +++ b/scm-webapp/src/main/java/sonia/scm/api/v2/resources/RepositoryToRepositoryDtoMapper.java @@ -14,6 +14,7 @@ import sonia.scm.repository.api.Command; import sonia.scm.repository.api.RepositoryService; import sonia.scm.repository.api.RepositoryServiceFactory; import sonia.scm.repository.api.ScmProtocol; +import sonia.scm.web.api.RepositoryToHalMapper; import java.util.List; @@ -25,7 +26,7 @@ import static java.util.stream.Collectors.toList; // Mapstruct does not support parameterized (i.e. non-default) constructors. Thus, we need to use field injection. @SuppressWarnings("squid:S3306") @Mapper -public abstract class RepositoryToRepositoryDtoMapper extends BaseMapper<Repository, RepositoryDto> { +public abstract class RepositoryToRepositoryDtoMapper extends BaseMapper<Repository, RepositoryDto> implements RepositoryToHalMapper { @Inject private ResourceLinks resourceLinks; @@ -34,6 +35,9 @@ public abstract class RepositoryToRepositoryDtoMapper extends BaseMapper<Reposit abstract HealthCheckFailureDto toDto(HealthCheckFailure failure); + @Override + public abstract RepositoryDto map(Repository modelObject); + @ObjectFactory RepositoryDto createDto(Repository repository) { Links.Builder linksBuilder = linkingTo().self(resourceLinks.repository().self(repository.getNamespace(), repository.getName())); From 6fb762b52f3ce532868c419062bf5f4e5263d1e0 Mon Sep 17 00:00:00 2001 From: Eduard Heimbuch <eduard.heimbuch@cloudogu.com> Date: Wed, 25 Mar 2020 10:27:38 +0100 Subject: [PATCH 08/44] move repository components from ui-webapp to ui-components // add font-awesome regular icons --- .../list => ui-components/src/repos}/RepositoryAvatar.tsx | 0 .../list => ui-components/src/repos}/RepositoryEntry.tsx | 0 .../list => ui-components/src/repos}/RepositoryEntryLink.tsx | 0 scm-ui/ui-components/src/repos/index.ts | 3 +++ scm-ui/ui-styles/src/scm.scss | 1 + .../src/repos/components/list/RepositoryGroupEntry.tsx | 3 +-- 6 files changed, 5 insertions(+), 2 deletions(-) rename scm-ui/{ui-webapp/src/repos/components/list => ui-components/src/repos}/RepositoryAvatar.tsx (100%) rename scm-ui/{ui-webapp/src/repos/components/list => ui-components/src/repos}/RepositoryEntry.tsx (100%) rename scm-ui/{ui-webapp/src/repos/components/list => ui-components/src/repos}/RepositoryEntryLink.tsx (100%) diff --git a/scm-ui/ui-webapp/src/repos/components/list/RepositoryAvatar.tsx b/scm-ui/ui-components/src/repos/RepositoryAvatar.tsx similarity index 100% rename from scm-ui/ui-webapp/src/repos/components/list/RepositoryAvatar.tsx rename to scm-ui/ui-components/src/repos/RepositoryAvatar.tsx diff --git a/scm-ui/ui-webapp/src/repos/components/list/RepositoryEntry.tsx b/scm-ui/ui-components/src/repos/RepositoryEntry.tsx similarity index 100% rename from scm-ui/ui-webapp/src/repos/components/list/RepositoryEntry.tsx rename to scm-ui/ui-components/src/repos/RepositoryEntry.tsx diff --git a/scm-ui/ui-webapp/src/repos/components/list/RepositoryEntryLink.tsx b/scm-ui/ui-components/src/repos/RepositoryEntryLink.tsx similarity index 100% rename from scm-ui/ui-webapp/src/repos/components/list/RepositoryEntryLink.tsx rename to scm-ui/ui-components/src/repos/RepositoryEntryLink.tsx diff --git a/scm-ui/ui-components/src/repos/index.ts b/scm-ui/ui-components/src/repos/index.ts index 07e270b156..d8197d4698 100644 --- a/scm-ui/ui-components/src/repos/index.ts +++ b/scm-ui/ui-components/src/repos/index.ts @@ -22,6 +22,9 @@ export { default as DiffFile } from "./DiffFile"; export { default as DiffButton } from "./DiffButton"; export { default as LoadingDiff } from "./LoadingDiff"; export { DefaultCollapsed, DefaultCollapsedFunction } from "./defaultCollapsed"; +export { default as RepositoryAvatar } from "./RepositoryAvatar"; +export { default as RepositoryEntry } from "./RepositoryEntry"; +export { default as RepositoryEntryLink } from "./RepositoryEntryLink"; export { File, diff --git a/scm-ui/ui-styles/src/scm.scss b/scm-ui/ui-styles/src/scm.scss index 3adb51da90..e799fe38e2 100644 --- a/scm-ui/ui-styles/src/scm.scss +++ b/scm-ui/ui-styles/src/scm.scss @@ -433,6 +433,7 @@ $danger-25: scale-color($danger, $lightness: 75%); @import "~@fortawesome/fontawesome-free/scss/fontawesome"; $fa-font-path: "~@fortawesome/fontawesome-free/webfonts"; @import "~@fortawesome/fontawesome-free/scss/solid"; +@import "~@fortawesome/fontawesome-free/scss/regular"; @import "~@fortawesome/fontawesome-free/scss/brands"; @import "~react-diff-view/style/index"; diff --git a/scm-ui/ui-webapp/src/repos/components/list/RepositoryGroupEntry.tsx b/scm-ui/ui-webapp/src/repos/components/list/RepositoryGroupEntry.tsx index 49de1c6645..e31580889d 100644 --- a/scm-ui/ui-webapp/src/repos/components/list/RepositoryGroupEntry.tsx +++ b/scm-ui/ui-webapp/src/repos/components/list/RepositoryGroupEntry.tsx @@ -1,7 +1,6 @@ import React from "react"; -import { CardColumnGroup } from "@scm-manager/ui-components"; +import { CardColumnGroup, RepositoryEntry } from "@scm-manager/ui-components"; import { RepositoryGroup } from "@scm-manager/ui-types"; -import RepositoryEntry from "./RepositoryEntry"; type Props = { group: RepositoryGroup; From 3a2aa7a55ca8240f18c0ac23c4e9353c698786b2 Mon Sep 17 00:00:00 2001 From: Eduard Heimbuch <eduard.heimbuch@cloudogu.com> Date: Wed, 25 Mar 2020 14:10:22 +0100 Subject: [PATCH 09/44] add stories for RepositoryEntry --- .../scm/web/api/RepositoryToHalMapper.java | 24 ++++++ .../src/__resources__/Git-Repository.ts | 67 ++++++++++++++++ .../src/__resources__/Hg-Repository.ts | 67 ++++++++++++++++ .../src/__resources__/git-logo.png | Bin 0 -> 13898 bytes .../src/__resources__/hg-logo.png | Bin 0 -> 5658 bytes .../src/repos/RepositoryEntry.stories.tsx | 72 ++++++++++++++++++ yarn.lock | 19 ++--- 7 files changed, 238 insertions(+), 11 deletions(-) create mode 100644 scm-ui/ui-components/src/__resources__/Git-Repository.ts create mode 100644 scm-ui/ui-components/src/__resources__/Hg-Repository.ts create mode 100644 scm-ui/ui-components/src/__resources__/git-logo.png create mode 100644 scm-ui/ui-components/src/__resources__/hg-logo.png create mode 100644 scm-ui/ui-components/src/repos/RepositoryEntry.stories.tsx diff --git a/scm-core/src/main/java/sonia/scm/web/api/RepositoryToHalMapper.java b/scm-core/src/main/java/sonia/scm/web/api/RepositoryToHalMapper.java index a5ca7339d8..90ca664cee 100644 --- a/scm-core/src/main/java/sonia/scm/web/api/RepositoryToHalMapper.java +++ b/scm-core/src/main/java/sonia/scm/web/api/RepositoryToHalMapper.java @@ -1,3 +1,27 @@ +/* + * 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. + */ + package sonia.scm.web.api; import de.otto.edison.hal.HalRepresentation; diff --git a/scm-ui/ui-components/src/__resources__/Git-Repository.ts b/scm-ui/ui-components/src/__resources__/Git-Repository.ts new file mode 100644 index 0000000000..b5267282f8 --- /dev/null +++ b/scm-ui/ui-components/src/__resources__/Git-Repository.ts @@ -0,0 +1,67 @@ +/* + * 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. + */ +export default { + contact: "", + creationDate: "2020-03-23T08:26:01.164Z", + description: "", + healthCheckFailures: [], + lastModified: "2020-03-23T08:26:01.876Z", + namespace: "scmadmin", + name: "Git", + type: "git", + _links: { + self: { href: "http://localhost:8081/scm/api/v2/repositories/scmadmin/Git" }, + delete: { href: "http://localhost:8081/scm/api/v2/repositories/scmadmin/Git" }, + update: { href: "http://localhost:8081/scm/api/v2/repositories/scmadmin/Git" }, + permissions: { href: "http://localhost:8081/scm/api/v2/repositories/scmadmin/Git/permissions/" }, + protocol: [ + { href: "ssh://scmadmin@localhost:4567/repo/scmadmin/Git", name: "ssh" }, + { href: "http://localhost:8081/scm/repo/scmadmin/Git", name: "http" } + ], + tags: { href: "http://localhost:8081/scm/api/v2/repositories/scmadmin/Git/tags/" }, + branches: { href: "http://localhost:8081/scm/api/v2/repositories/scmadmin/Git/branches/" }, + incomingChangesets: { + href: "http://localhost:8081/scm/api/v2/repositories/scmadmin/Git/incoming/{source}/{target}/changesets", + templated: true + }, + incomingDiff: { + href: "http://localhost:8081/scm/api/v2/repositories/scmadmin/Git/incoming/{source}/{target}/diff", + templated: true + }, + incomingDiffParsed: { + href: "http://localhost:8081/scm/api/v2/repositories/scmadmin/Git/incoming/{source}/{target}/diff/parsed", + templated: true + }, + changesets: { href: "http://localhost:8081/scm/api/v2/repositories/scmadmin/Git/changesets/" }, + sources: { href: "http://localhost:8081/scm/api/v2/repositories/scmadmin/Git/sources/" }, + authorMappingConfig: { + href: "http://localhost:8081/scm/api/v2/authormapping/configuration/scmadmin/Git" + }, + unfavorize: { href: "http://localhost:8081/scm/api/v2/unfavorize/scmadmin/Git" }, + favorites: [ + { href: "http://localhost:8081/scm/api/v2/unfavorize/scmadmin/Git", name: "unfavorize" }, + { href: "http://localhost:8081/scm/api/v2/favorize/scmadmin/Git", name: "favorize" } + ] + } +}; diff --git a/scm-ui/ui-components/src/__resources__/Hg-Repository.ts b/scm-ui/ui-components/src/__resources__/Hg-Repository.ts new file mode 100644 index 0000000000..10ef653e51 --- /dev/null +++ b/scm-ui/ui-components/src/__resources__/Hg-Repository.ts @@ -0,0 +1,67 @@ +/* + * 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. + */ +export default { + contact: "", + creationDate: "2020-03-23T08:26:01.164Z", + description: "", + healthCheckFailures: [], + lastModified: "2020-03-23T08:26:01.876Z", + namespace: "scmadmin", + name: "Mercurial", + type: "hg", + _links: { + self: { href: "http://localhost:8081/scm/api/v2/repositories/scmadmin/mercurial" }, + delete: { href: "http://localhost:8081/scm/api/v2/repositories/scmadmin/mercurial" }, + update: { href: "http://localhost:8081/scm/api/v2/repositories/scmadmin/mercurial" }, + permissions: { href: "http://localhost:8081/scm/api/v2/repositories/scmadmin/mercurial/permissions/" }, + protocol: [ + { href: "ssh://scmadmin@localhost:4567/repo/scmadmin/mercurial", name: "ssh" }, + { href: "http://localhost:8081/scm/repo/scmadmin/mercurial", name: "http" } + ], + tags: { href: "http://localhost:8081/scm/api/v2/repositories/scmadmin/mercurial/tags/" }, + branches: { href: "http://localhost:8081/scm/api/v2/repositories/scmadmin/mercurial/branches/" }, + incomingChangesets: { + href: "http://localhost:8081/scm/api/v2/repositories/scmadmin/mercurial/incoming/{source}/{target}/changesets", + templated: true + }, + incomingDiff: { + href: "http://localhost:8081/scm/api/v2/repositories/scmadmin/mercurial/incoming/{source}/{target}/diff", + templated: true + }, + incomingDiffParsed: { + href: "http://localhost:8081/scm/api/v2/repositories/scmadmin/mercurial/incoming/{source}/{target}/diff/parsed", + templated: true + }, + changesets: { href: "http://localhost:8081/scm/api/v2/repositories/scmadmin/mercurial/changesets/" }, + sources: { href: "http://localhost:8081/scm/api/v2/repositories/scmadmin/mercurial/sources/" }, + authorMappingConfig: { + href: "http://localhost:8081/scm/api/v2/authormapping/configuration/scmadmin/mercurial" + }, + unfavorize: { href: "http://localhost:8081/scm/api/v2/unfavorize/scmadmin/mercurial" }, + favorites: [ + { href: "http://localhost:8081/scm/api/v2/unfavorize/scmadmin/mercurial", name: "unfavorize" }, + { href: "http://localhost:8081/scm/api/v2/favorize/scmadmin/mercurial", name: "favorize" } + ] + } +}; diff --git a/scm-ui/ui-components/src/__resources__/git-logo.png b/scm-ui/ui-components/src/__resources__/git-logo.png new file mode 100644 index 0000000000000000000000000000000000000000..ed9393dc368a51d27f5f4a86b89aa47afe7bc9b7 GIT binary patch literal 13898 zcmW+-Ra6|y7R4>NPjGhvgG+E5++Bi&;BLX)2bbXPPH=|_?(PuWB@i6)=Dv^a{;5@~ z>h!U_Ygd%2vMdJLM>H517z~h{lsfb~^527k1bx@&*5*P#s7`Wvt}rl|kpCXoR2EDU z7#K<zkd(Nl*V;u+K&0i7_qOQvIAtid*;hSCBf3FyICiMbxsXhogIriu<v4H_-8z%I zfy}$xC~cBj2(<SR?~g1;?cP|0!orD%nwG5dZc=CxK$=m47$=%pQ_H8QV~|?YbfS?} zA|t0iQaaMI=WXxx`}RY2r_WW6&(+2cfnnVyF4rTGhtEfTTSv<ePa=igrT+GH?2`a+ z2*uDV+%+nQArOqQlNGEq$dccSw3Xl$;Q!|0b6e_L(TzCY*`l3}EfW2gWGF9@AGU)e z7WN>1kT<CwV-Dk7Cy-}m`~yk4W3y+YRswuEsZpQ`>St78gb9q>hn4`iSDf9^u)kX> zYeH+xBmK@5+8tyu$$fMM(&&VYtt7vQDows*>!nOYTl5Z4P%l~fe`piwowaqm46Rf4 z`9OcE?H(u_6r&q6lnPAfRKwqfcPYi63ZOqQ5uY<^^heblH_N!UVH<h(s1nRb?vpOY zlgE$|^{lKXf2$)~pQg&i?pQ*)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ojNRA6}CQQakjgKumj<i<-X3B7i&p9`=Q%<I!3&b#(IKTC{X0-={F z@Rsjw9?B>A5cBv5CQrDd_Wm%xr=q7;=^Pn6j?~t*sPeN*n)#y(CpvCV!+A>gd&Ti9 z!w!N511EvZo~yA0Lkvt62IMnV$vG2QH7?MLE=V;axZyM_+erROa~nS+_v*KCvm3nJ zO}qbAL&eBQbx^@SiUW)Z+<Vo9!8|2+a7#*fi&++Wg+@U*cvAQ}BHsjgnjqCffL;xy zOgXGUDvv53wLMr(rrs$No_DoED?!rfKT%s?u9PpKtB%*QrxIy;_cPkDn6ihBQT3qH zvm9Ta3E?|ll!1Jydg`8pR`4?XK!jk0!RWs%>m~XnfKwGIG@C!9S&)0F&mA=!c_@$` zRik))g=#au`*<3BaG@N)-C+s8YG<Vfi=E1VPCc|EGBAHOQz9=WReN0FJs18S4}Os_ zIa4ln=!?i8itX)yMpIRHRt=(n)AE13?n*%5+lQ83tC!E`Ir!zo$sIR67t8jdrcYdQ z|CwmN&j2^jCotZO9Pyp%n(~;xjm8=N7F>Y*igC^CWNuotoW!E|^!$%MA|}BlP0JB_ PISd9Qtt?e5@g?|w^zEk* literal 0 HcmV?d00001 diff --git a/scm-ui/ui-components/src/__resources__/hg-logo.png b/scm-ui/ui-components/src/__resources__/hg-logo.png new file mode 100644 index 0000000000000000000000000000000000000000..0f72285da6b55e48021c9068c692fc13638d529d GIT binary patch literal 5658 zcmV+#7Uk)QP)<h;3K|Lk000e1NJLTq0077U0077c0{{R3nucDi0004iP)t-s{QUgI z#l_On(km+~92*?Ey1FDJB(}D;nwpxpxVV*-m7JWMVPRqL@bLNh`Eqe`tgNiEva*hj zj)H-LprD|Uk&)EY)U>p;q@<*xqM~JGW$5VWs;a8&?CgDgeV(44g@uKQiHQLL0d{tF z!^6Y)`1tnr_Ii4HuCA^W6clZ3ZQ|nMH8nM;sHmo<rpn67>gwvSu&`QMTHfB?&d$!) z*Vp9a<Y{PW2nYzkz`*YA?p<A7R#sL@N=i{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gQ z4|4dtAmc?4ZV5~(z8>)0JSbldf&=j3^@B)DzzhGJ0w8=N3#oFD6M)7a1;V{SbO-4N zbg_$aQu)Xd5HH9h4+lXm7EQUF>0nOzUUUQTz;$rBmm#~lr*n6$)_btVJs9L_9soMX z%O?OB^#o}KCF4gqNDRzN4+Y`80C*$6I3#L&Uh{hwq!rL}dy5BS1Ba()`@hOT79Rof zfd-fABL%>co*-XAw!CguE?N%;xd5P0rv9c9=mkQ7JLfr-fNbAY_TZmE`T*@H+Kx3n zLC$W??>&$JKue3xJ0R=-BgiDk-2@_=dV=iJ;G!A`UOrpRw~t*NB(1my@)!eidV*Y| zp!^`D5)cC@gY3V3r5@2bP)&tiAW#<QV*5AZD+h4|%N7#ornUVMgaW`&w0V2Ff*ixR zYV_*uFMFgd-*U%|PXq7`Zl&hpU9zLhnLtq935WQpU{#Q#EZCG!-$gzcl^9b$5XmV= zxh6gc{~Egk66Ilp7@LmqN~kNH(|{iOIh&WG%&H4w3xFpqjs0ALZ@PR2kmlLK8Eqdo z=L)fscMn%@km1#J9Zk!s9iETfE-aBb^`)3n8bF3k#c=#k2^`&92RCM|X=_mlo!_<; z;&{_<<vr`OeY)kfkmGY}sLJ8h`^5KC;^rkTvg_(1mTT_~@na$DuqCSh|C;nlMgyb) z(g10IG(Z|44Uh&%1Ec}c0BL|UKpG$okk>i>4}7#xN{-&v@c;k-07*qoM6N<$g82N& A>Hq)$ literal 0 HcmV?d00001 diff --git a/scm-ui/ui-components/src/repos/RepositoryEntry.stories.tsx b/scm-ui/ui-components/src/repos/RepositoryEntry.stories.tsx new file mode 100644 index 0000000000..1a2862a44f --- /dev/null +++ b/scm-ui/ui-components/src/repos/RepositoryEntry.stories.tsx @@ -0,0 +1,72 @@ +/* + * 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 { storiesOf } from "@storybook/react"; +import React from "react"; +import styled from "styled-components"; +import GitRepository from "../__resources__/Git-Repository"; +import HgRepository from "../__resources__/Hg-Repository"; +// @ts-ignore ignore unknown png +import Git from "../__resources__/git-logo.png"; +// @ts-ignore ignore unknown png +import Hg from "../__resources__/hg-logo.png"; +import RepositoryEntry from "./RepositoryEntry"; +import { Binder, BinderContext } from "@scm-manager/ui-extensions"; +import { Repository } from "@scm-manager/ui-types"; + +const Container = styled.div` + padding: 2rem 6rem; +`; + +const bindAvatar = (binder: Binder, avatar: string) => { + binder.bind("repos.repository-avatar", () => { + return avatar; + }); +}; + +const bindBeforeTitle = (binder: Binder, beforeTitle: string) => { + binder.bind("repository.card.beforeTitle", () => { + return beforeTitle; + }); +}; + +const withBinder = (binder: Binder, repository: Repository) => { + return ( + <BinderContext.Provider value={binder}> + <RepositoryEntry repository={repository} /> + </BinderContext.Provider> + ); +}; + +storiesOf("RepositoryEntry", module) + .addDecorator(storyFn => <Container>{storyFn()}</Container>) + .add("Git-Repo", () => { + const binder = new Binder("git-story"); + bindAvatar(binder, "Git"); + return withBinder(binder, GitRepository); + }) + .add("Hg-Repo", () => { + const binder = new Binder("hg-story"); + bindBeforeTitle(binder, "Hg"); + return withBinder(binder, HgRepository); + }); diff --git a/yarn.lock b/yarn.lock index c81b892b90..7ebd28adce 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3656,6 +3656,11 @@ babel-code-frame@^6.22.0: esutils "^2.0.2" js-tokens "^3.0.2" +babel-core@7.0.0-bridge.0: + version "7.0.0-bridge.0" + resolved "https://registry.yarnpkg.com/babel-core/-/babel-core-7.0.0-bridge.0.tgz#95a492ddd90f9b4e9a4a1da14eb335b87b634ece" + integrity sha512-poPX9mZH/5CSanm50Q+1toVci6pv5KSRv/5TWCwtzQS5XEwn40BcCrgIeMFWP9CKKIniKXNxoIOnOq4VVlGXhg== + babel-eslint@^10.0.3: version "10.0.3" resolved "https://registry.yarnpkg.com/babel-eslint/-/babel-eslint-10.0.3.tgz#81a2c669be0f205e19462fed2482d33e4687a88a" @@ -6801,7 +6806,7 @@ fast-safe-stringify@^1.0.8, fast-safe-stringify@^1.2.1: resolved "https://registry.yarnpkg.com/fast-safe-stringify/-/fast-safe-stringify-1.2.3.tgz#9fe22c37fb2f7f86f06b8f004377dbf8f1ee7bc1" integrity sha512-QJYT/i0QYoiZBQ71ivxdyTqkwKkQ0oxACXHYxH2zYHJEgzi2LsbjgvtzTbLi1SZcF190Db2YP7I7eTsU2egOlw== -fault@^1.0.0, fault@^1.0.2: +fault@^1.0.0: version "1.0.4" resolved "https://registry.yarnpkg.com/fault/-/fault-1.0.4.tgz#eafcfc0a6d214fc94601e170df29954a4f842f13" integrity sha512-CJ0HCB5tL5fYTEA7ToAq5+kTwd++Borf1/bifxd9iT70QcXr4MRrO3Llf8Ifs70q+SJcGHFtnIE/Nw6giCtECA== @@ -7340,7 +7345,7 @@ gitconfiglocal@^1.0.0: dependencies: ini "^1.3.2" -gitdiff-parser@^0.1.2: +gitdiff-parser@^0.1.2, "gitdiff-parser@https://github.com/scm-manager/gitdiff-parser#ed3fe7de73dbb0a06c3e6adbbdf22dbae6e66351": version "0.1.2" resolved "https://github.com/scm-manager/gitdiff-parser#ed3fe7de73dbb0a06c3e6adbbdf22dbae6e66351" @@ -9649,7 +9654,7 @@ lower-case@^1.1.1: resolved "https://registry.yarnpkg.com/lower-case/-/lower-case-1.1.4.tgz#9a2cabd1b9e8e0ae993a4bf7d5875c39c42e8eac" integrity sha1-miyr0bno4K6ZOkv31YdcOcQujqw= -lowlight@^1.13.0: +lowlight@1.13.1, lowlight@^1.13.0, lowlight@~1.11.0: version "1.13.1" resolved "https://registry.yarnpkg.com/lowlight/-/lowlight-1.13.1.tgz#c4f0e03906ebd23fedf2d258f6ab2f6324cf90eb" integrity sha512-kQ71/T6RksEVz9AlPq07/2m+SU/1kGvt9k39UtvHX760u4SaWakaYH7hYgH5n6sTsCWk4MVYzUzLU59aN5CSmQ== @@ -9657,14 +9662,6 @@ lowlight@^1.13.0: fault "^1.0.0" highlight.js "~9.16.0" -lowlight@~1.11.0: - version "1.11.0" - resolved "https://registry.yarnpkg.com/lowlight/-/lowlight-1.11.0.tgz#1304d83005126d4e8b1dc0f07981e9b689ec2efc" - integrity sha512-xrGGN6XLL7MbTMdPD6NfWPwY43SNkjf/d0mecSx/CW36fUZTjRHEq0/Cdug3TWKtRXLWi7iMl1eP0olYxj/a4A== - dependencies: - fault "^1.0.2" - highlight.js "~9.13.0" - lru-cache@^5.1.1: version "5.1.1" resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-5.1.1.tgz#1da27e6710271947695daf6848e847f01d84b920" From 098142c815b6c6785e58229faad2b3d694f733b4 Mon Sep 17 00:00:00 2001 From: Eduard Heimbuch <eduard.heimbuch@cloudogu.com> Date: Wed, 25 Mar 2020 14:12:08 +0100 Subject: [PATCH 10/44] update storyshots --- .../src/__snapshots__/storyshots.test.ts.snap | 226 ++++++++++++++++++ 1 file changed, 226 insertions(+) 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 b900c277d9..abff8b5109 100644 --- a/scm-ui/ui-components/src/__snapshots__/storyshots.test.ts.snap +++ b/scm-ui/ui-components/src/__snapshots__/storyshots.test.ts.snap @@ -34188,6 +34188,232 @@ exports[`Storyshots MarkdownView Xml Code Block 1`] = ` </div> `; +exports[`Storyshots RepositoryEntry Git-Repo 1`] = ` +<div + className="RepositoryEntrystories__Container-toppdg-0 bQveHd" +> + <a + className="overlay-column" + href="/repo/scmadmin/Git" + onClick={[Function]} + /> + <article + className="CardColumn__NoEventWrapper-sc-1w6lsih-0 kZKqpc media" + > + <figure + className="CardColumn__AvatarWrapper-sc-1w6lsih-1 bZyfne media-left" + > + <p + className="image is-64x64" + > + Git + </p> + </figure> + <div + className="CardColumn__FlexFullHeight-sc-1w6lsih-2 cAdfGj media-content text-box is-flex" + > + <div + className="is-flex" + > + <div + className="CardColumn__ContentLeft-sc-1w6lsih-4 dumWkw content" + > + <p + className="shorten-text is-marginless" + > + + <strong> + Git + </strong> + </p> + <p + className="shorten-text" + > + + </p> + </div> + <div + className="CardColumn__ContentRight-sc-1w6lsih-5 kyEPRa" + /> + </div> + <div + className="CardColumn__FooterWrapper-sc-1w6lsih-3 jlTqlS level is-flex" + > + <div + className="level-left is-hidden-mobile" + > + <a + className="RepositoryEntryLink__PointerEventsLink-sc-1hpqj0w-0 gtboNN level-item" + href="/repo/scmadmin/Git/branches" + onClick={[Function]} + > + <i + className="fas fa-code-branch has-text-inherit fa-lg" + /> + </a> + <a + className="RepositoryEntryLink__PointerEventsLink-sc-1hpqj0w-0 gtboNN level-item" + href="/repo/scmadmin/Git/code/changesets/" + onClick={[Function]} + > + <i + className="fas fa-exchange-alt has-text-inherit fa-lg" + /> + </a> + <a + className="RepositoryEntryLink__PointerEventsLink-sc-1hpqj0w-0 gtboNN level-item" + href="/repo/scmadmin/Git/code/sources/" + onClick={[Function]} + > + <i + className="fas fa-code has-text-inherit fa-lg" + /> + </a> + <a + className="RepositoryEntryLink__PointerEventsLink-sc-1hpqj0w-0 gtboNN level-item" + href="/repo/scmadmin/Git/settings/general" + onClick={[Function]} + > + <i + className="fas fa-cog has-text-inherit fa-lg" + /> + </a> + </div> + <div + className="level-right is-mobile is-marginless" + > + <small + className="level-item" + > + <time + className="DateFromNow__DateElement-sc-16hnz72-0 ehlCzi" + title="2020-03-23 09:26:01" + > + 2 days ago + </time> + </small> + </div> + </div> + </div> + </article> +</div> +`; + +exports[`Storyshots RepositoryEntry Hg-Repo 1`] = ` +<div + className="RepositoryEntrystories__Container-toppdg-0 bQveHd" +> + <a + className="overlay-column" + href="/repo/scmadmin/Mercurial" + onClick={[Function]} + /> + <article + className="CardColumn__NoEventWrapper-sc-1w6lsih-0 kZKqpc media" + > + <figure + className="CardColumn__AvatarWrapper-sc-1w6lsih-1 bZyfne media-left" + > + <p + className="image is-64x64" + > + <img + alt="Logo" + src="/images/blib.jpg" + /> + </p> + </figure> + <div + className="CardColumn__FlexFullHeight-sc-1w6lsih-2 cAdfGj media-content text-box is-flex" + > + <div + className="is-flex" + > + <div + className="CardColumn__ContentLeft-sc-1w6lsih-4 dumWkw content" + > + <p + className="shorten-text is-marginless" + > + Hg + + <strong> + Mercurial + </strong> + </p> + <p + className="shorten-text" + > + + </p> + </div> + <div + className="CardColumn__ContentRight-sc-1w6lsih-5 kyEPRa" + /> + </div> + <div + className="CardColumn__FooterWrapper-sc-1w6lsih-3 jlTqlS level is-flex" + > + <div + className="level-left is-hidden-mobile" + > + <a + className="RepositoryEntryLink__PointerEventsLink-sc-1hpqj0w-0 gtboNN level-item" + href="/repo/scmadmin/Mercurial/branches" + onClick={[Function]} + > + <i + className="fas fa-code-branch has-text-inherit fa-lg" + /> + </a> + <a + className="RepositoryEntryLink__PointerEventsLink-sc-1hpqj0w-0 gtboNN level-item" + href="/repo/scmadmin/Mercurial/code/changesets/" + onClick={[Function]} + > + <i + className="fas fa-exchange-alt has-text-inherit fa-lg" + /> + </a> + <a + className="RepositoryEntryLink__PointerEventsLink-sc-1hpqj0w-0 gtboNN level-item" + href="/repo/scmadmin/Mercurial/code/sources/" + onClick={[Function]} + > + <i + className="fas fa-code has-text-inherit fa-lg" + /> + </a> + <a + className="RepositoryEntryLink__PointerEventsLink-sc-1hpqj0w-0 gtboNN level-item" + href="/repo/scmadmin/Mercurial/settings/general" + onClick={[Function]} + > + <i + className="fas fa-cog has-text-inherit fa-lg" + /> + </a> + </div> + <div + className="level-right is-mobile is-marginless" + > + <small + className="level-item" + > + <time + className="DateFromNow__DateElement-sc-16hnz72-0 ehlCzi" + title="2020-03-23 09:26:01" + > + 2 days ago + </time> + </small> + </div> + </div> + </div> + </article> +</div> +`; + exports[`Storyshots SyntaxHighlighter Go 1`] = ` <div className="SyntaxHighlighterstories__Spacing-sc-1dcldp5-0 eofOgh" From c29cbfed84f8c03ef18ccba4d843d45a6956c825 Mon Sep 17 00:00:00 2001 From: Eduard Heimbuch <eduard.heimbuch@cloudogu.com> Date: Wed, 25 Mar 2020 16:58:14 +0100 Subject: [PATCH 11/44] fix overlay column size --- scm-ui/ui-styles/src/scm.scss | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/scm-ui/ui-styles/src/scm.scss b/scm-ui/ui-styles/src/scm.scss index e799fe38e2..f828c7819a 100644 --- a/scm-ui/ui-styles/src/scm.scss +++ b/scm-ui/ui-styles/src/scm.scss @@ -491,6 +491,16 @@ ul.is-separated { } } + .column.is-half-overlay { + .overlay-column { + width: calc(50% - 3rem); + + @media screen and (max-width: 768px) { + width: calc(100% - 1.5rem); + } + } + } + .column.is-full .overlay-column { width: calc(100% - 1.5rem); } From 2438e980a71f6afd7030fcd01e2720f54e0c67ed Mon Sep 17 00:00:00 2001 From: Sebastian Sdorra <sebastian.sdorra@cloudogu.com> Date: Thu, 26 Mar 2020 10:16:26 +0100 Subject: [PATCH 12/44] improve RepositoryEntry story --- .../src/__resources__/Hg-Repository.ts | 67 ------------------ .../src/__resources__/hg-logo.png | Bin 5658 -> 0 bytes .../{Git-Repository.ts => repository.ts} | 8 +-- .../src/repos/RepositoryEntry.stories.tsx | 65 +++++++++++------ 4 files changed, 47 insertions(+), 93 deletions(-) delete mode 100644 scm-ui/ui-components/src/__resources__/Hg-Repository.ts delete mode 100644 scm-ui/ui-components/src/__resources__/hg-logo.png rename scm-ui/ui-components/src/__resources__/{Git-Repository.ts => repository.ts} (93%) diff --git a/scm-ui/ui-components/src/__resources__/Hg-Repository.ts b/scm-ui/ui-components/src/__resources__/Hg-Repository.ts deleted file mode 100644 index 10ef653e51..0000000000 --- a/scm-ui/ui-components/src/__resources__/Hg-Repository.ts +++ /dev/null @@ -1,67 +0,0 @@ -/* - * MIT License - * - * Copyright (c) 2020-present Cloudogu GmbH and Contributors - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ -export default { - contact: "", - creationDate: "2020-03-23T08:26:01.164Z", - description: "", - healthCheckFailures: [], - lastModified: "2020-03-23T08:26:01.876Z", - namespace: "scmadmin", - name: "Mercurial", - type: "hg", - _links: { - self: { href: "http://localhost:8081/scm/api/v2/repositories/scmadmin/mercurial" }, - delete: { href: "http://localhost:8081/scm/api/v2/repositories/scmadmin/mercurial" }, - update: { href: "http://localhost:8081/scm/api/v2/repositories/scmadmin/mercurial" }, - permissions: { href: "http://localhost:8081/scm/api/v2/repositories/scmadmin/mercurial/permissions/" }, - protocol: [ - { href: "ssh://scmadmin@localhost:4567/repo/scmadmin/mercurial", name: "ssh" }, - { href: "http://localhost:8081/scm/repo/scmadmin/mercurial", name: "http" } - ], - tags: { href: "http://localhost:8081/scm/api/v2/repositories/scmadmin/mercurial/tags/" }, - branches: { href: "http://localhost:8081/scm/api/v2/repositories/scmadmin/mercurial/branches/" }, - incomingChangesets: { - href: "http://localhost:8081/scm/api/v2/repositories/scmadmin/mercurial/incoming/{source}/{target}/changesets", - templated: true - }, - incomingDiff: { - href: "http://localhost:8081/scm/api/v2/repositories/scmadmin/mercurial/incoming/{source}/{target}/diff", - templated: true - }, - incomingDiffParsed: { - href: "http://localhost:8081/scm/api/v2/repositories/scmadmin/mercurial/incoming/{source}/{target}/diff/parsed", - templated: true - }, - changesets: { href: "http://localhost:8081/scm/api/v2/repositories/scmadmin/mercurial/changesets/" }, - sources: { href: "http://localhost:8081/scm/api/v2/repositories/scmadmin/mercurial/sources/" }, - authorMappingConfig: { - href: "http://localhost:8081/scm/api/v2/authormapping/configuration/scmadmin/mercurial" - }, - unfavorize: { href: "http://localhost:8081/scm/api/v2/unfavorize/scmadmin/mercurial" }, - favorites: [ - { href: "http://localhost:8081/scm/api/v2/unfavorize/scmadmin/mercurial", name: "unfavorize" }, - { href: "http://localhost:8081/scm/api/v2/favorize/scmadmin/mercurial", name: "favorize" } - ] - } -}; diff --git a/scm-ui/ui-components/src/__resources__/hg-logo.png b/scm-ui/ui-components/src/__resources__/hg-logo.png deleted file mode 100644 index 0f72285da6b55e48021c9068c692fc13638d529d..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 5658 zcmV+#7Uk)QP)<h;3K|Lk000e1NJLTq0077U0077c0{{R3nucDi0004iP)t-s{QUgI z#l_On(km+~92*?Ey1F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Fl|VA`&34Ye+A{F?V-@5O9<C7B zadq^V3M;+lAiUbw_XB`7<&rP}U5d<^0J>lJ#a9)i%~81V1P$`a>cD-f1~QBkG@<|! zT`7p)Q4TCV3y4Ym2Md5&<%^@BQ~rAt0789f0UW3xH+>6UK$kQ>R05%Ia*PF#+wmUc zpA)312;wk;fckl<x5dXcmV>;>Drk=c`K^BBbAd#PAV?m_=RF|2tf|WA186zO7XUgQ z4|4dtAmc?4ZV5~(z8>)0JSbldf&=j3^@B)DzzhGJ0w8=N3#oFD6M)7a1;V{SbO-4N zbg_$aQu)Xd5HH9h4+lXm7EQUF>0nOzUUUQTz;$rBmm#~lr*n6$)_btVJs9L_9soMX z%O?OB^#o}KCF4gqNDRzN4+Y`80C*$6I3#L&Uh{hwq!rL}dy5BS1Ba()`@hOT79Rof zfd-fABL%>co*-XAw!CguE?N%;xd5P0rv9c9=mkQ7JLfr-fNbAY_TZmE`T*@H+Kx3n zLC$W??>&$JKue3xJ0R=-BgiDk-2@_=dV=iJ;G!A`UOrpRw~t*NB(1my@)!eidV*Y| zp!^`D5)cC@gY3V3r5@2bP)&tiAW#<QV*5AZD+h4|%N7#ornUVMgaW`&w0V2Ff*ixR zYV_*uFMFgd-*U%|PXq7`Zl&hpU9zLhnLtq935WQpU{#Q#EZCG!-$gzcl^9b$5XmV= zxh6gc{~Egk66Ilp7@LmqN~kNH(|{iOIh&WG%&H4w3xFpqjs0ALZ@PR2kmlLK8Eqdo z=L)fscMn%@km1#J9Zk!s9iETfE-aBb^`)3n8bF3k#c=#k2^`&92RCM|X=_mlo!_<; z;&{_<<vr`OeY)kfkmGY}sLJ8h`^5KC;^rkTvg_(1mTT_~@na$DuqCSh|C;nlMgyb) z(g10IG(Z|44Uh&%1Ec}c0BL|UKpG$okk>i>4}7#xN{-&v@c;k-07*qoM6N<$g82N& A>Hq)$ diff --git a/scm-ui/ui-components/src/__resources__/Git-Repository.ts b/scm-ui/ui-components/src/__resources__/repository.ts similarity index 93% rename from scm-ui/ui-components/src/__resources__/Git-Repository.ts rename to scm-ui/ui-components/src/__resources__/repository.ts index b5267282f8..8facf86e57 100644 --- a/scm-ui/ui-components/src/__resources__/Git-Repository.ts +++ b/scm-ui/ui-components/src/__resources__/repository.ts @@ -22,13 +22,13 @@ * SOFTWARE. */ export default { - contact: "", + contact: "heart-of-gold@hitchhiher.com", creationDate: "2020-03-23T08:26:01.164Z", - description: "", + description: "The starship Heart of Gold was the first spacecraft to make use of the Infinite Improbability Drive", healthCheckFailures: [], lastModified: "2020-03-23T08:26:01.876Z", - namespace: "scmadmin", - name: "Git", + namespace: "hitchhiher", + name: "heartOfGold", type: "git", _links: { self: { href: "http://localhost:8081/scm/api/v2/repositories/scmadmin/Git" }, diff --git a/scm-ui/ui-components/src/repos/RepositoryEntry.stories.tsx b/scm-ui/ui-components/src/repos/RepositoryEntry.stories.tsx index 1a2862a44f..f8b9994fd0 100644 --- a/scm-ui/ui-components/src/repos/RepositoryEntry.stories.tsx +++ b/scm-ui/ui-components/src/repos/RepositoryEntry.stories.tsx @@ -21,52 +21,73 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ -import { storiesOf } from "@storybook/react"; -import React from "react"; +import {storiesOf} from "@storybook/react"; +import React, {FC, ReactNode} from "react"; import styled from "styled-components"; -import GitRepository from "../__resources__/Git-Repository"; -import HgRepository from "../__resources__/Hg-Repository"; +import repository from "../__resources__/repository"; // @ts-ignore ignore unknown png import Git from "../__resources__/git-logo.png"; -// @ts-ignore ignore unknown png -import Hg from "../__resources__/hg-logo.png"; import RepositoryEntry from "./RepositoryEntry"; -import { Binder, BinderContext } from "@scm-manager/ui-extensions"; -import { Repository } from "@scm-manager/ui-types"; +import {Binder, BinderContext} from "@scm-manager/ui-extensions"; +import {Repository} from "@scm-manager/ui-types"; +import Image from "../Image"; +import classNames from "classnames"; +import Icon from "../Icon"; -const Container = styled.div` - padding: 2rem 6rem; +const Spacing = styled.div` + margin: 2rem; `; +const Container: FC = ({children}) => ( + <Spacing className="box box-link-shadow">{children}</Spacing> +); + const bindAvatar = (binder: Binder, avatar: string) => { binder.bind("repos.repository-avatar", () => { - return avatar; + return <Image src={avatar} alt="Logo"/>; }); }; -const bindBeforeTitle = (binder: Binder, beforeTitle: string) => { +const bindBeforeTitle = (binder: Binder, extension: ReactNode) => { binder.bind("repository.card.beforeTitle", () => { - return beforeTitle; + return extension; + }); +}; + +const bindQuickLink = (binder: Binder, extension: ReactNode) => { + binder.bind("repository.card.quickLink", () => { + return extension; }); }; const withBinder = (binder: Binder, repository: Repository) => { return ( <BinderContext.Provider value={binder}> - <RepositoryEntry repository={repository} /> + <RepositoryEntry repository={repository}/> </BinderContext.Provider> ); }; +const QuickLink = <a className="level-item"><Icon className="fa-lg" name="fas fa-code-branch fa-rotate-180 fa-fw" + color="inherit"/></a>; + storiesOf("RepositoryEntry", module) .addDecorator(storyFn => <Container>{storyFn()}</Container>) - .add("Git-Repo", () => { - const binder = new Binder("git-story"); - bindAvatar(binder, "Git"); - return withBinder(binder, GitRepository); + .add("Default", () => { + return <RepositoryEntry repository={repository}/>; }) - .add("Hg-Repo", () => { - const binder = new Binder("hg-story"); - bindBeforeTitle(binder, "Hg"); - return withBinder(binder, HgRepository); + .add("Avatar EP", () => { + const binder = new Binder("avatar"); + bindAvatar(binder, Git); + return withBinder(binder, repository); + }) + .add("Before Title EP", () => { + const binder = new Binder("title"); + bindBeforeTitle(binder, <i className="fas fa-star"/>); + return withBinder(binder, repository); + }) + .add("Quick Link EP", () => { + const binder = new Binder("title"); + bindQuickLink(binder, QuickLink); + return withBinder(binder, repository); }); From 3ffece1547ee467c0b8279b3ef6679dbcb0ad9a0 Mon Sep 17 00:00:00 2001 From: Sebastian Sdorra <sebastian.sdorra@cloudogu.com> Date: Thu, 26 Mar 2020 11:34:28 +0100 Subject: [PATCH 13/44] added missing javadoc --- .../sonia/scm/web/api/RepositoryToHalMapper.java | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/scm-core/src/main/java/sonia/scm/web/api/RepositoryToHalMapper.java b/scm-core/src/main/java/sonia/scm/web/api/RepositoryToHalMapper.java index 90ca664cee..b5184fb202 100644 --- a/scm-core/src/main/java/sonia/scm/web/api/RepositoryToHalMapper.java +++ b/scm-core/src/main/java/sonia/scm/web/api/RepositoryToHalMapper.java @@ -27,6 +27,19 @@ package sonia.scm.web.api; import de.otto.edison.hal.HalRepresentation; import sonia.scm.repository.Repository; +/** + * Maps a repository to a hal representation. + * This is especially useful if a plugin would deliver a repository to the frontend. + * + * @since 2.0.0 + */ public interface RepositoryToHalMapper { + + /** + * Returns the hal representation of the repository. + * + * @param repository repository to map + * @return hal representation + */ HalRepresentation map(Repository repository); } From 1b437a4cea2b355d6dcb04020d21ccdc244863cd Mon Sep 17 00:00:00 2001 From: Sebastian Sdorra <sebastian.sdorra@cloudogu.com> Date: Thu, 26 Mar 2020 11:35:36 +0100 Subject: [PATCH 14/44] remove class which only belongs to a plugin The class gets re implemented in the landingpage plugin --- scm-ui/ui-styles/src/scm.scss | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/scm-ui/ui-styles/src/scm.scss b/scm-ui/ui-styles/src/scm.scss index f828c7819a..e799fe38e2 100644 --- a/scm-ui/ui-styles/src/scm.scss +++ b/scm-ui/ui-styles/src/scm.scss @@ -491,16 +491,6 @@ ul.is-separated { } } - .column.is-half-overlay { - .overlay-column { - width: calc(50% - 3rem); - - @media screen and (max-width: 768px) { - width: calc(100% - 1.5rem); - } - } - } - .column.is-full .overlay-column { width: calc(100% - 1.5rem); } From 38627b0574acbacc456221692cc06eea73969d68 Mon Sep 17 00:00:00 2001 From: Sebastian Sdorra <sebastian.sdorra@cloudogu.com> Date: Thu, 26 Mar 2020 11:37:42 +0100 Subject: [PATCH 15/44] update storyshots --- .../src/__snapshots__/storyshots.test.ts.snap | 284 ++++++++++++++++-- 1 file changed, 262 insertions(+), 22 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 abff8b5109..b1bebd39c8 100644 --- a/scm-ui/ui-components/src/__snapshots__/storyshots.test.ts.snap +++ b/scm-ui/ui-components/src/__snapshots__/storyshots.test.ts.snap @@ -34188,13 +34188,13 @@ exports[`Storyshots MarkdownView Xml Code Block 1`] = ` </div> `; -exports[`Storyshots RepositoryEntry Git-Repo 1`] = ` +exports[`Storyshots RepositoryEntry Avatar EP 1`] = ` <div - className="RepositoryEntrystories__Container-toppdg-0 bQveHd" + className="RepositoryEntrystories__Spacing-toppdg-0 khfzcK box box-link-shadow" > <a className="overlay-column" - href="/repo/scmadmin/Git" + href="/repo/hitchhiher/heartOfGold" onClick={[Function]} /> <article @@ -34206,7 +34206,10 @@ exports[`Storyshots RepositoryEntry Git-Repo 1`] = ` <p className="image is-64x64" > - Git + <img + alt="Logo" + src="test-file-stub" + /> </p> </figure> <div @@ -34223,13 +34226,13 @@ exports[`Storyshots RepositoryEntry Git-Repo 1`] = ` > <strong> - Git + heartOfGold </strong> </p> <p className="shorten-text" > - + The starship Heart of Gold was the first spacecraft to make use of the Infinite Improbability Drive </p> </div> <div @@ -34244,7 +34247,7 @@ exports[`Storyshots RepositoryEntry Git-Repo 1`] = ` > <a className="RepositoryEntryLink__PointerEventsLink-sc-1hpqj0w-0 gtboNN level-item" - href="/repo/scmadmin/Git/branches" + href="/repo/hitchhiher/heartOfGold/branches" onClick={[Function]} > <i @@ -34253,7 +34256,7 @@ exports[`Storyshots RepositoryEntry Git-Repo 1`] = ` </a> <a className="RepositoryEntryLink__PointerEventsLink-sc-1hpqj0w-0 gtboNN level-item" - href="/repo/scmadmin/Git/code/changesets/" + href="/repo/hitchhiher/heartOfGold/code/changesets/" onClick={[Function]} > <i @@ -34262,7 +34265,7 @@ exports[`Storyshots RepositoryEntry Git-Repo 1`] = ` </a> <a className="RepositoryEntryLink__PointerEventsLink-sc-1hpqj0w-0 gtboNN level-item" - href="/repo/scmadmin/Git/code/sources/" + href="/repo/hitchhiher/heartOfGold/code/sources/" onClick={[Function]} > <i @@ -34271,7 +34274,7 @@ exports[`Storyshots RepositoryEntry Git-Repo 1`] = ` </a> <a className="RepositoryEntryLink__PointerEventsLink-sc-1hpqj0w-0 gtboNN level-item" - href="/repo/scmadmin/Git/settings/general" + href="/repo/hitchhiher/heartOfGold/settings/general" onClick={[Function]} > <i @@ -34289,7 +34292,7 @@ exports[`Storyshots RepositoryEntry Git-Repo 1`] = ` className="DateFromNow__DateElement-sc-16hnz72-0 ehlCzi" title="2020-03-23 09:26:01" > - 2 days ago + 3 days ago </time> </small> </div> @@ -34299,13 +34302,13 @@ exports[`Storyshots RepositoryEntry Git-Repo 1`] = ` </div> `; -exports[`Storyshots RepositoryEntry Hg-Repo 1`] = ` +exports[`Storyshots RepositoryEntry Before Title EP 1`] = ` <div - className="RepositoryEntrystories__Container-toppdg-0 bQveHd" + className="RepositoryEntrystories__Spacing-toppdg-0 khfzcK box box-link-shadow" > <a className="overlay-column" - href="/repo/scmadmin/Mercurial" + href="/repo/hitchhiher/heartOfGold" onClick={[Function]} /> <article @@ -34335,16 +34338,18 @@ exports[`Storyshots RepositoryEntry Hg-Repo 1`] = ` <p className="shorten-text is-marginless" > - Hg + <i + className="fas fa-star" + /> <strong> - Mercurial + heartOfGold </strong> </p> <p className="shorten-text" > - + The starship Heart of Gold was the first spacecraft to make use of the Infinite Improbability Drive </p> </div> <div @@ -34359,7 +34364,7 @@ exports[`Storyshots RepositoryEntry Hg-Repo 1`] = ` > <a className="RepositoryEntryLink__PointerEventsLink-sc-1hpqj0w-0 gtboNN level-item" - href="/repo/scmadmin/Mercurial/branches" + href="/repo/hitchhiher/heartOfGold/branches" onClick={[Function]} > <i @@ -34368,7 +34373,7 @@ exports[`Storyshots RepositoryEntry Hg-Repo 1`] = ` </a> <a className="RepositoryEntryLink__PointerEventsLink-sc-1hpqj0w-0 gtboNN level-item" - href="/repo/scmadmin/Mercurial/code/changesets/" + href="/repo/hitchhiher/heartOfGold/code/changesets/" onClick={[Function]} > <i @@ -34377,7 +34382,7 @@ exports[`Storyshots RepositoryEntry Hg-Repo 1`] = ` </a> <a className="RepositoryEntryLink__PointerEventsLink-sc-1hpqj0w-0 gtboNN level-item" - href="/repo/scmadmin/Mercurial/code/sources/" + href="/repo/hitchhiher/heartOfGold/code/sources/" onClick={[Function]} > <i @@ -34386,7 +34391,7 @@ exports[`Storyshots RepositoryEntry Hg-Repo 1`] = ` </a> <a className="RepositoryEntryLink__PointerEventsLink-sc-1hpqj0w-0 gtboNN level-item" - href="/repo/scmadmin/Mercurial/settings/general" + href="/repo/hitchhiher/heartOfGold/settings/general" onClick={[Function]} > <i @@ -34404,7 +34409,242 @@ exports[`Storyshots RepositoryEntry Hg-Repo 1`] = ` className="DateFromNow__DateElement-sc-16hnz72-0 ehlCzi" title="2020-03-23 09:26:01" > - 2 days ago + 3 days ago + </time> + </small> + </div> + </div> + </div> + </article> +</div> +`; + +exports[`Storyshots RepositoryEntry Default 1`] = ` +<div + className="RepositoryEntrystories__Spacing-toppdg-0 khfzcK box box-link-shadow" +> + <a + className="overlay-column" + href="/repo/hitchhiher/heartOfGold" + onClick={[Function]} + /> + <article + className="CardColumn__NoEventWrapper-sc-1w6lsih-0 kZKqpc media" + > + <figure + className="CardColumn__AvatarWrapper-sc-1w6lsih-1 bZyfne media-left" + > + <p + className="image is-64x64" + > + <img + alt="Logo" + src="/images/blib.jpg" + /> + </p> + </figure> + <div + className="CardColumn__FlexFullHeight-sc-1w6lsih-2 cAdfGj media-content text-box is-flex" + > + <div + className="is-flex" + > + <div + className="CardColumn__ContentLeft-sc-1w6lsih-4 dumWkw content" + > + <p + className="shorten-text is-marginless" + > + + <strong> + heartOfGold + </strong> + </p> + <p + className="shorten-text" + > + The starship Heart of Gold was the first spacecraft to make use of the Infinite Improbability Drive + </p> + </div> + <div + className="CardColumn__ContentRight-sc-1w6lsih-5 kyEPRa" + /> + </div> + <div + className="CardColumn__FooterWrapper-sc-1w6lsih-3 jlTqlS level is-flex" + > + <div + className="level-left is-hidden-mobile" + > + <a + className="RepositoryEntryLink__PointerEventsLink-sc-1hpqj0w-0 gtboNN level-item" + href="/repo/hitchhiher/heartOfGold/branches" + onClick={[Function]} + > + <i + className="fas fa-code-branch has-text-inherit fa-lg" + /> + </a> + <a + className="RepositoryEntryLink__PointerEventsLink-sc-1hpqj0w-0 gtboNN level-item" + href="/repo/hitchhiher/heartOfGold/code/changesets/" + onClick={[Function]} + > + <i + className="fas fa-exchange-alt has-text-inherit fa-lg" + /> + </a> + <a + className="RepositoryEntryLink__PointerEventsLink-sc-1hpqj0w-0 gtboNN level-item" + href="/repo/hitchhiher/heartOfGold/code/sources/" + onClick={[Function]} + > + <i + className="fas fa-code has-text-inherit fa-lg" + /> + </a> + <a + className="RepositoryEntryLink__PointerEventsLink-sc-1hpqj0w-0 gtboNN level-item" + href="/repo/hitchhiher/heartOfGold/settings/general" + onClick={[Function]} + > + <i + className="fas fa-cog has-text-inherit fa-lg" + /> + </a> + </div> + <div + className="level-right is-mobile is-marginless" + > + <small + className="level-item" + > + <time + className="DateFromNow__DateElement-sc-16hnz72-0 ehlCzi" + title="2020-03-23 09:26:01" + > + 3 days ago + </time> + </small> + </div> + </div> + </div> + </article> +</div> +`; + +exports[`Storyshots RepositoryEntry Quick Link EP 1`] = ` +<div + className="RepositoryEntrystories__Spacing-toppdg-0 khfzcK box box-link-shadow" +> + <a + className="overlay-column" + href="/repo/hitchhiher/heartOfGold" + onClick={[Function]} + /> + <article + className="CardColumn__NoEventWrapper-sc-1w6lsih-0 kZKqpc media" + > + <figure + className="CardColumn__AvatarWrapper-sc-1w6lsih-1 bZyfne media-left" + > + <p + className="image is-64x64" + > + <img + alt="Logo" + src="/images/blib.jpg" + /> + </p> + </figure> + <div + className="CardColumn__FlexFullHeight-sc-1w6lsih-2 cAdfGj media-content text-box is-flex" + > + <div + className="is-flex" + > + <div + className="CardColumn__ContentLeft-sc-1w6lsih-4 dumWkw content" + > + <p + className="shorten-text is-marginless" + > + + <strong> + heartOfGold + </strong> + </p> + <p + className="shorten-text" + > + The starship Heart of Gold was the first spacecraft to make use of the Infinite Improbability Drive + </p> + </div> + <div + className="CardColumn__ContentRight-sc-1w6lsih-5 kyEPRa" + /> + </div> + <div + className="CardColumn__FooterWrapper-sc-1w6lsih-3 jlTqlS level is-flex" + > + <div + className="level-left is-hidden-mobile" + > + <a + className="RepositoryEntryLink__PointerEventsLink-sc-1hpqj0w-0 gtboNN level-item" + href="/repo/hitchhiher/heartOfGold/branches" + onClick={[Function]} + > + <i + className="fas fa-code-branch has-text-inherit fa-lg" + /> + </a> + <a + className="RepositoryEntryLink__PointerEventsLink-sc-1hpqj0w-0 gtboNN level-item" + href="/repo/hitchhiher/heartOfGold/code/changesets/" + onClick={[Function]} + > + <i + className="fas fa-exchange-alt has-text-inherit fa-lg" + /> + </a> + <a + className="RepositoryEntryLink__PointerEventsLink-sc-1hpqj0w-0 gtboNN level-item" + href="/repo/hitchhiher/heartOfGold/code/sources/" + onClick={[Function]} + > + <i + className="fas fa-code has-text-inherit fa-lg" + /> + </a> + <a + className="level-item" + > + <i + className="fas fa-fas fa-code-branch fa-rotate-180 fa-fw has-text-inherit fa-lg" + /> + </a> + <a + className="RepositoryEntryLink__PointerEventsLink-sc-1hpqj0w-0 gtboNN level-item" + href="/repo/hitchhiher/heartOfGold/settings/general" + onClick={[Function]} + > + <i + className="fas fa-cog has-text-inherit fa-lg" + /> + </a> + </div> + <div + className="level-right is-mobile is-marginless" + > + <small + className="level-item" + > + <time + className="DateFromNow__DateElement-sc-16hnz72-0 ehlCzi" + title="2020-03-23 09:26:01" + > + 3 days ago </time> </small> </div> From 47723c476c908f16f6979fc095a77e4615771d1f Mon Sep 17 00:00:00 2001 From: Sebastian Sdorra <sebastian.sdorra@cloudogu.com> Date: Thu, 26 Mar 2020 11:44:57 +0100 Subject: [PATCH 16/44] added new extension points to changelog --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index daee9aa86b..ef7a64521b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Libc based restart strategy for posix operating systems ([#1079](https://github.com/scm-manager/scm-manager/pull/1079)) - Simple restart strategy with System.exit ([#1079](https://github.com/scm-manager/scm-manager/pull/1079)) - Notification if restart is not supported on the underlying platform ([#1079](https://github.com/scm-manager/scm-manager/pull/1079)) +- Extension point before title in repository cards (`repository.card.beforeTitle`) +- Extension point after title on repository detail page (`repository.afterTitle`) ### Changed - Update resteasy to version 4.5.2.Final From 3ad6f2867e905cd730dd2d86379d8576a6a1798c Mon Sep 17 00:00:00 2001 From: Sebastian Sdorra <sebastian.sdorra@cloudogu.com> Date: Thu, 26 Mar 2020 11:48:34 +0100 Subject: [PATCH 17/44] added pr link to changelog --- CHANGELOG.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ef7a64521b..e767c09a5f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,8 +10,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Libc based restart strategy for posix operating systems ([#1079](https://github.com/scm-manager/scm-manager/pull/1079)) - Simple restart strategy with System.exit ([#1079](https://github.com/scm-manager/scm-manager/pull/1079)) - Notification if restart is not supported on the underlying platform ([#1079](https://github.com/scm-manager/scm-manager/pull/1079)) -- Extension point before title in repository cards (`repository.card.beforeTitle`) -- Extension point after title on repository detail page (`repository.afterTitle`) +- Extension point before title in repository cards ([#1080](https://github.com/scm-manager/scm-manager/pull/1080)) +- Extension point after title on repository detail page ([#1080](https://github.com/scm-manager/scm-manager/pull/1080)) ### Changed - Update resteasy to version 4.5.2.Final From 941f76d2f1d1b07ee3f4b31eb8dfb9e80dede2e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Pfeuffer?= <rene.pfeuffer@cloudogu.com> Date: Thu, 26 Mar 2020 16:12:12 +0100 Subject: [PATCH 18/44] develop is the new default --- docs/v2/Release process.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/v2/Release process.md b/docs/v2/Release process.md index 3ebf091572..623b61f3dd 100644 --- a/docs/v2/Release process.md +++ b/docs/v2/Release process.md @@ -7,7 +7,7 @@ To release a new version of SCM-Manager v2 you have to do the following steps (r Make sure you have no changes you want to keep! ``` -git fetch && git checkout default && git reset --hard origin/default +git fetch && git checkout develop && git reset --hard origin/develop ``` ## Modify Changelog From f3c650509fa0bbcdeb06fe5a42013fe8837e3e7d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Pfeuffer?= <rene.pfeuffer@cloudogu.com> Date: Thu, 26 Mar 2020 16:13:24 +0100 Subject: [PATCH 19/44] Adjust changelog for release 2.0.0-rc6 --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e767c09a5f..f6ce1222f5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,7 +4,7 @@ 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 +## 2.0.0-rc6 - 2020-03-26 ### Added - Extension point to add links to the repository cards from plug ins ([#1041](https://github.com/scm-manager/scm-manager/pull/1041)) - Libc based restart strategy for posix operating systems ([#1079](https://github.com/scm-manager/scm-manager/pull/1079)) From d94a2d9b7f8cd801bb7ec1297d20a68b42388c4e Mon Sep 17 00:00:00 2001 From: CES Marvin <cesmarvin@cloudogu.com> Date: Thu, 26 Mar 2020 15:23:24 +0000 Subject: [PATCH 20/44] release version 2.0.0-rc6 --- lerna.json | 2 +- pom.xml | 2 +- scm-annotation-processor/pom.xml | 6 ++--- scm-annotations/pom.xml | 4 ++-- scm-core/pom.xml | 8 +++---- scm-dao-xml/pom.xml | 8 +++---- scm-it/pom.xml | 20 ++++++++--------- scm-plugins/pom.xml | 10 ++++----- scm-plugins/scm-git-plugin/package.json | 4 ++-- scm-plugins/scm-git-plugin/pom.xml | 2 +- scm-plugins/scm-hg-plugin/package.json | 4 ++-- scm-plugins/scm-hg-plugin/pom.xml | 2 +- scm-plugins/scm-legacy-plugin/package.json | 4 ++-- scm-plugins/scm-legacy-plugin/pom.xml | 4 ++-- scm-plugins/scm-svn-plugin/package.json | 4 ++-- scm-plugins/scm-svn-plugin/pom.xml | 2 +- scm-server/pom.xml | 4 ++-- scm-test/pom.xml | 6 ++--- scm-ui/babel-preset/package.json | 2 +- scm-ui/eslint-config/package.json | 2 +- scm-ui/jest-preset/package.json | 2 +- scm-ui/pom.xml | 4 ++-- scm-ui/prettier-config/package.json | 2 +- scm-ui/tsconfig/package.json | 2 +- scm-ui/ui-components/package.json | 8 +++---- scm-ui/ui-extensions/package.json | 2 +- scm-ui/ui-plugins/package.json | 22 +++++++++--------- scm-ui/ui-polyfill/package.json | 2 +- scm-ui/ui-scripts/package.json | 2 +- scm-ui/ui-styles/package.json | 2 +- scm-ui/ui-tests/package.json | 2 +- scm-ui/ui-types/package.json | 2 +- scm-ui/ui-webapp/package.json | 8 +++---- scm-webapp/pom.xml | 26 +++++++++++----------- 34 files changed, 93 insertions(+), 93 deletions(-) diff --git a/lerna.json b/lerna.json index 405d16a397..e121e1d503 100644 --- a/lerna.json +++ b/lerna.json @@ -5,5 +5,5 @@ ], "npmClient": "yarn", "useWorkspaces": true, - "version": "2.0.0-SNAPSHOT" + "version": "2.0.0-rc6" } diff --git a/pom.xml b/pom.xml index 2054116a65..e57afa6348 100644 --- a/pom.xml +++ b/pom.xml @@ -32,7 +32,7 @@ <groupId>sonia.scm</groupId> <artifactId>scm</artifactId> <packaging>pom</packaging> - <version>2.0.0-SNAPSHOT</version> + <version>2.0.0-rc6</version> <description> The easiest way to share your Git, Mercurial and Subversion repositories over http. diff --git a/scm-annotation-processor/pom.xml b/scm-annotation-processor/pom.xml index 4881cf3110..35427c28fd 100644 --- a/scm-annotation-processor/pom.xml +++ b/scm-annotation-processor/pom.xml @@ -31,12 +31,12 @@ <parent> <groupId>sonia.scm</groupId> <artifactId>scm</artifactId> - <version>2.0.0-SNAPSHOT</version> + <version>2.0.0-rc6</version> </parent> <groupId>sonia.scm</groupId> <artifactId>scm-annotation-processor</artifactId> - <version>2.0.0-SNAPSHOT</version> + <version>2.0.0-rc6</version> <name>scm-annotation-processor</name> <dependencies> @@ -46,7 +46,7 @@ <dependency> <groupId>sonia.scm</groupId> <artifactId>scm-annotations</artifactId> - <version>2.0.0-SNAPSHOT</version> + <version>2.0.0-rc6</version> </dependency> <!-- rest api --> diff --git a/scm-annotations/pom.xml b/scm-annotations/pom.xml index dfc7b8d62a..5d1dce285f 100644 --- a/scm-annotations/pom.xml +++ b/scm-annotations/pom.xml @@ -31,11 +31,11 @@ <parent> <groupId>sonia.scm</groupId> <artifactId>scm</artifactId> - <version>2.0.0-SNAPSHOT</version> + <version>2.0.0-rc6</version> </parent> <artifactId>scm-annotations</artifactId> - <version>2.0.0-SNAPSHOT</version> + <version>2.0.0-rc6</version> <name>scm-annotations</name> <dependencies> diff --git a/scm-core/pom.xml b/scm-core/pom.xml index ac86a33f4d..8a21be8d87 100644 --- a/scm-core/pom.xml +++ b/scm-core/pom.xml @@ -31,12 +31,12 @@ <parent> <artifactId>scm</artifactId> <groupId>sonia.scm</groupId> - <version>2.0.0-SNAPSHOT</version> + <version>2.0.0-rc6</version> </parent> <groupId>sonia.scm</groupId> <artifactId>scm-core</artifactId> - <version>2.0.0-SNAPSHOT</version> + <version>2.0.0-rc6</version> <name>scm-core</name> <dependencies> @@ -55,7 +55,7 @@ <dependency> <groupId>sonia.scm</groupId> <artifactId>scm-annotations</artifactId> - <version>2.0.0-SNAPSHOT</version> + <version>2.0.0-rc6</version> </dependency> <dependency> @@ -213,7 +213,7 @@ <dependency> <groupId>sonia.scm</groupId> <artifactId>scm-annotation-processor</artifactId> - <version>2.0.0-SNAPSHOT</version> + <version>2.0.0-rc6</version> <scope>provided</scope> </dependency> diff --git a/scm-dao-xml/pom.xml b/scm-dao-xml/pom.xml index 42f49dd8f3..54dc322083 100644 --- a/scm-dao-xml/pom.xml +++ b/scm-dao-xml/pom.xml @@ -31,12 +31,12 @@ <parent> <groupId>sonia.scm</groupId> <artifactId>scm</artifactId> - <version>2.0.0-SNAPSHOT</version> + <version>2.0.0-rc6</version> </parent> <groupId>sonia.scm</groupId> <artifactId>scm-dao-xml</artifactId> - <version>2.0.0-SNAPSHOT</version> + <version>2.0.0-rc6</version> <name>scm-dao-xml</name> <dependencies> @@ -51,7 +51,7 @@ <dependency> <groupId>sonia.scm</groupId> <artifactId>scm-core</artifactId> - <version>2.0.0-SNAPSHOT</version> + <version>2.0.0-rc6</version> </dependency> <!-- test --> @@ -59,7 +59,7 @@ <dependency> <groupId>sonia.scm</groupId> <artifactId>scm-test</artifactId> - <version>2.0.0-SNAPSHOT</version> + <version>2.0.0-rc6</version> <scope>test</scope> </dependency> diff --git a/scm-it/pom.xml b/scm-it/pom.xml index 146a7b33b2..7ae6ff757a 100644 --- a/scm-it/pom.xml +++ b/scm-it/pom.xml @@ -31,40 +31,40 @@ <parent> <groupId>sonia.scm</groupId> <artifactId>scm</artifactId> - <version>2.0.0-SNAPSHOT</version> + <version>2.0.0-rc6</version> </parent> <groupId>sonia.scm</groupId> <artifactId>scm-it</artifactId> <!-- we need type war, because the jetty plugin does not work with jar or pom --> <packaging>war</packaging> - <version>2.0.0-SNAPSHOT</version> + <version>2.0.0-rc6</version> <name>scm-it</name> <dependencies> <dependency> <groupId>sonia.scm</groupId> <artifactId>scm-core</artifactId> - <version>2.0.0-SNAPSHOT</version> + <version>2.0.0-rc6</version> </dependency> <dependency> <groupId>sonia.scm</groupId> <artifactId>scm-test</artifactId> - <version>2.0.0-SNAPSHOT</version> + <version>2.0.0-rc6</version> </dependency> <dependency> <groupId>sonia.scm.plugins</groupId> <artifactId>scm-git-plugin</artifactId> - <version>2.0.0-SNAPSHOT</version> + <version>2.0.0-rc6</version> <scope>test</scope> </dependency> <dependency> <groupId>sonia.scm.plugins</groupId> <artifactId>scm-git-plugin</artifactId> - <version>2.0.0-SNAPSHOT</version> + <version>2.0.0-rc6</version> <classifier>tests</classifier> <scope>test</scope> </dependency> @@ -72,14 +72,14 @@ <dependency> <groupId>sonia.scm.plugins</groupId> <artifactId>scm-hg-plugin</artifactId> - <version>2.0.0-SNAPSHOT</version> + <version>2.0.0-rc6</version> <scope>test</scope> </dependency> <dependency> <groupId>sonia.scm.plugins</groupId> <artifactId>scm-hg-plugin</artifactId> - <version>2.0.0-SNAPSHOT</version> + <version>2.0.0-rc6</version> <classifier>tests</classifier> <scope>test</scope> </dependency> @@ -87,14 +87,14 @@ <dependency> <groupId>sonia.scm.plugins</groupId> <artifactId>scm-svn-plugin</artifactId> - <version>2.0.0-SNAPSHOT</version> + <version>2.0.0-rc6</version> <scope>test</scope> </dependency> <dependency> <groupId>sonia.scm.plugins</groupId> <artifactId>scm-svn-plugin</artifactId> - <version>2.0.0-SNAPSHOT</version> + <version>2.0.0-rc6</version> <classifier>tests</classifier> <scope>test</scope> </dependency> diff --git a/scm-plugins/pom.xml b/scm-plugins/pom.xml index 5467725199..99209421d6 100644 --- a/scm-plugins/pom.xml +++ b/scm-plugins/pom.xml @@ -31,13 +31,13 @@ <parent> <groupId>sonia.scm</groupId> <artifactId>scm</artifactId> - <version>2.0.0-SNAPSHOT</version> + <version>2.0.0-rc6</version> </parent> <groupId>sonia.scm.plugins</groupId> <artifactId>scm-plugins</artifactId> <packaging>pom</packaging> - <version>2.0.0-SNAPSHOT</version> + <version>2.0.0-rc6</version> <name>scm-plugins</name> <modules> @@ -59,7 +59,7 @@ <dependency> <groupId>sonia.scm</groupId> <artifactId>scm-core</artifactId> - <version>2.0.0-SNAPSHOT</version> + <version>2.0.0-rc6</version> <scope>provided</scope> </dependency> @@ -68,7 +68,7 @@ <dependency> <groupId>sonia.scm</groupId> <artifactId>scm-annotation-processor</artifactId> - <version>2.0.0-SNAPSHOT</version> + <version>2.0.0-rc6</version> <scope>provided</scope> </dependency> @@ -98,7 +98,7 @@ <dependency> <groupId>sonia.scm</groupId> <artifactId>scm-test</artifactId> - <version>2.0.0-SNAPSHOT</version> + <version>2.0.0-rc6</version> <scope>test</scope> </dependency> diff --git a/scm-plugins/scm-git-plugin/package.json b/scm-plugins/scm-git-plugin/package.json index 01572012d1..40d8ef6e08 100644 --- a/scm-plugins/scm-git-plugin/package.json +++ b/scm-plugins/scm-git-plugin/package.json @@ -1,7 +1,7 @@ { "name": "@scm-manager/scm-git-plugin", "private": true, - "version": "2.0.0-SNAPSHOT", + "version": "2.0.0-rc6", "license": "MIT", "main": "./src/main/js/index.ts", "scripts": { @@ -20,6 +20,6 @@ }, "prettier": "@scm-manager/prettier-config", "dependencies": { - "@scm-manager/ui-plugins": "^2.0.0-SNAPSHOT" + "@scm-manager/ui-plugins": "^2.0.0-rc6" } } diff --git a/scm-plugins/scm-git-plugin/pom.xml b/scm-plugins/scm-git-plugin/pom.xml index 6a3e2235cc..d00a89372b 100644 --- a/scm-plugins/scm-git-plugin/pom.xml +++ b/scm-plugins/scm-git-plugin/pom.xml @@ -31,7 +31,7 @@ <parent> <artifactId>scm-plugins</artifactId> <groupId>sonia.scm.plugins</groupId> - <version>2.0.0-SNAPSHOT</version> + <version>2.0.0-rc6</version> </parent> <artifactId>scm-git-plugin</artifactId> diff --git a/scm-plugins/scm-hg-plugin/package.json b/scm-plugins/scm-hg-plugin/package.json index f6bb8709f8..54ff0ca095 100644 --- a/scm-plugins/scm-hg-plugin/package.json +++ b/scm-plugins/scm-hg-plugin/package.json @@ -1,7 +1,7 @@ { "name": "@scm-manager/scm-hg-plugin", "private": true, - "version": "2.0.0-SNAPSHOT", + "version": "2.0.0-rc6", "license": "MIT", "main": "./src/main/js/index.ts", "scripts": { @@ -19,6 +19,6 @@ }, "prettier": "@scm-manager/prettier-config", "dependencies": { - "@scm-manager/ui-plugins": "^2.0.0-SNAPSHOT" + "@scm-manager/ui-plugins": "^2.0.0-rc6" } } diff --git a/scm-plugins/scm-hg-plugin/pom.xml b/scm-plugins/scm-hg-plugin/pom.xml index 37da213210..f56b804d53 100644 --- a/scm-plugins/scm-hg-plugin/pom.xml +++ b/scm-plugins/scm-hg-plugin/pom.xml @@ -31,7 +31,7 @@ <parent> <groupId>sonia.scm.plugins</groupId> <artifactId>scm-plugins</artifactId> - <version>2.0.0-SNAPSHOT</version> + <version>2.0.0-rc6</version> </parent> <artifactId>scm-hg-plugin</artifactId> diff --git a/scm-plugins/scm-legacy-plugin/package.json b/scm-plugins/scm-legacy-plugin/package.json index abd99dc69a..0ea7c9d669 100644 --- a/scm-plugins/scm-legacy-plugin/package.json +++ b/scm-plugins/scm-legacy-plugin/package.json @@ -1,7 +1,7 @@ { "name": "@scm-manager/scm-legacy-plugin", "private": true, - "version": "2.0.0-SNAPSHOT", + "version": "2.0.0-rc6", "license": "MIT", "main": "./src/main/js/index.tsx", "scripts": { @@ -19,6 +19,6 @@ }, "prettier": "@scm-manager/prettier-config", "dependencies": { - "@scm-manager/ui-plugins": "^2.0.0-SNAPSHOT" + "@scm-manager/ui-plugins": "^2.0.0-rc6" } } diff --git a/scm-plugins/scm-legacy-plugin/pom.xml b/scm-plugins/scm-legacy-plugin/pom.xml index 46bc9d99f2..6950ae966e 100644 --- a/scm-plugins/scm-legacy-plugin/pom.xml +++ b/scm-plugins/scm-legacy-plugin/pom.xml @@ -29,12 +29,12 @@ <parent> <groupId>sonia.scm.plugins</groupId> <artifactId>scm-plugins</artifactId> - <version>2.0.0-SNAPSHOT</version> + <version>2.0.0-rc6</version> </parent> <artifactId>scm-legacy-plugin</artifactId> <description>Support migrated repository urls and v1 passwords</description> - <version>2.0.0-SNAPSHOT</version> + <version>2.0.0-rc6</version> <packaging>smp</packaging> <dependencies> diff --git a/scm-plugins/scm-svn-plugin/package.json b/scm-plugins/scm-svn-plugin/package.json index 8be18995df..02151e4262 100644 --- a/scm-plugins/scm-svn-plugin/package.json +++ b/scm-plugins/scm-svn-plugin/package.json @@ -1,7 +1,7 @@ { "name": "@scm-manager/scm-svn-plugin", "private": true, - "version": "2.0.0-SNAPSHOT", + "version": "2.0.0-rc6", "license": "MIT", "main": "./src/main/js/index.ts", "scripts": { @@ -19,6 +19,6 @@ }, "prettier": "@scm-manager/prettier-config", "dependencies": { - "@scm-manager/ui-plugins": "^2.0.0-SNAPSHOT" + "@scm-manager/ui-plugins": "^2.0.0-rc6" } } diff --git a/scm-plugins/scm-svn-plugin/pom.xml b/scm-plugins/scm-svn-plugin/pom.xml index 0a75769180..7051103dd7 100644 --- a/scm-plugins/scm-svn-plugin/pom.xml +++ b/scm-plugins/scm-svn-plugin/pom.xml @@ -31,7 +31,7 @@ <parent> <artifactId>scm-plugins</artifactId> <groupId>sonia.scm.plugins</groupId> - <version>2.0.0-SNAPSHOT</version> + <version>2.0.0-rc6</version> </parent> <artifactId>scm-svn-plugin</artifactId> diff --git a/scm-server/pom.xml b/scm-server/pom.xml index 08fbe4dc39..3141d4d149 100644 --- a/scm-server/pom.xml +++ b/scm-server/pom.xml @@ -31,12 +31,12 @@ <parent> <artifactId>scm</artifactId> <groupId>sonia.scm</groupId> - <version>2.0.0-SNAPSHOT</version> + <version>2.0.0-rc6</version> </parent> <groupId>sonia.scm</groupId> <artifactId>scm-server</artifactId> - <version>2.0.0-SNAPSHOT</version> + <version>2.0.0-rc6</version> <name>scm-server</name> <packaging>jar</packaging> diff --git a/scm-test/pom.xml b/scm-test/pom.xml index a24e048f55..cf0d4e3c4c 100644 --- a/scm-test/pom.xml +++ b/scm-test/pom.xml @@ -31,12 +31,12 @@ <parent> <artifactId>scm</artifactId> <groupId>sonia.scm</groupId> - <version>2.0.0-SNAPSHOT</version> + <version>2.0.0-rc6</version> </parent> <groupId>sonia.scm</groupId> <artifactId>scm-test</artifactId> - <version>2.0.0-SNAPSHOT</version> + <version>2.0.0-rc6</version> <name>scm-test</name> <dependencies> @@ -50,7 +50,7 @@ <dependency> <groupId>sonia.scm</groupId> <artifactId>scm-core</artifactId> - <version>2.0.0-SNAPSHOT</version> + <version>2.0.0-rc6</version> </dependency> <dependency> diff --git a/scm-ui/babel-preset/package.json b/scm-ui/babel-preset/package.json index cb0ea1ac52..7729155741 100644 --- a/scm-ui/babel-preset/package.json +++ b/scm-ui/babel-preset/package.json @@ -1,6 +1,6 @@ { "name": "@scm-manager/babel-preset", - "version": "2.0.0-SNAPSHOT", + "version": "2.0.0-rc6", "license": "MIT", "description": "Babel configuration for scm-manager and its plugins", "main": "index.js", diff --git a/scm-ui/eslint-config/package.json b/scm-ui/eslint-config/package.json index ec7216fe5b..93adbb09ce 100644 --- a/scm-ui/eslint-config/package.json +++ b/scm-ui/eslint-config/package.json @@ -1,6 +1,6 @@ { "name": "@scm-manager/eslint-config", - "version": "2.0.0-SNAPSHOT", + "version": "2.0.0-rc6", "description": "ESLint configuration for scm-manager and its plugins", "main": "index.js", "author": "Sebastian Sdorra <s.sdorra@gmail.com>", diff --git a/scm-ui/jest-preset/package.json b/scm-ui/jest-preset/package.json index 4384226cd9..c183f4b44d 100644 --- a/scm-ui/jest-preset/package.json +++ b/scm-ui/jest-preset/package.json @@ -1,6 +1,6 @@ { "name": "@scm-manager/jest-preset", - "version": "2.0.0-SNAPSHOT", + "version": "2.0.0-rc6", "description": "Jest presets for SCM-Manager and its plugins", "main": "src/index.js", "author": "Sebastian Sdorra <sebastian.sdorra@cloudogu.com>", diff --git a/scm-ui/pom.xml b/scm-ui/pom.xml index f4d64a9951..8dc90ba66f 100644 --- a/scm-ui/pom.xml +++ b/scm-ui/pom.xml @@ -32,13 +32,13 @@ <parent> <groupId>sonia.scm</groupId> <artifactId>scm</artifactId> - <version>2.0.0-SNAPSHOT</version> + <version>2.0.0-rc6</version> </parent> <groupId>sonia.scm</groupId> <artifactId>scm-ui</artifactId> <packaging>war</packaging> - <version>2.0.0-SNAPSHOT</version> + <version>2.0.0-rc6</version> <name>scm-ui</name> <properties> diff --git a/scm-ui/prettier-config/package.json b/scm-ui/prettier-config/package.json index 5c5fce4869..c11eee307c 100644 --- a/scm-ui/prettier-config/package.json +++ b/scm-ui/prettier-config/package.json @@ -1,6 +1,6 @@ { "name": "@scm-manager/prettier-config", - "version": "2.0.0-SNAPSHOT", + "version": "2.0.0-rc6", "license": "MIT", "description": "Prettier configuration", "author": "Sebastian Sdorra <sebastian.sdorra@cloudogu.com>", diff --git a/scm-ui/tsconfig/package.json b/scm-ui/tsconfig/package.json index 9595f56444..0de4ab9817 100644 --- a/scm-ui/tsconfig/package.json +++ b/scm-ui/tsconfig/package.json @@ -1,6 +1,6 @@ { "name": "@scm-manager/tsconfig", - "version": "2.0.0-SNAPSHOT", + "version": "2.0.0-rc6", "license": "MIT", "description": "TypeScript configuration", "author": "Sebastian Sdorra <sebastian.sdorra@cloudogu.com>", diff --git a/scm-ui/ui-components/package.json b/scm-ui/ui-components/package.json index 8900a701e3..22dc41f132 100644 --- a/scm-ui/ui-components/package.json +++ b/scm-ui/ui-components/package.json @@ -1,6 +1,6 @@ { "name": "@scm-manager/ui-components", - "version": "2.0.0-SNAPSHOT", + "version": "2.0.0-rc6", "description": "UI Components for SCM-Manager and its plugins", "main": "src/index.ts", "files": [ @@ -18,7 +18,7 @@ "update-storyshots": "jest --testPathPattern=\"storyshots.test.ts\" --collectCoverage=false -u" }, "devDependencies": { - "@scm-manager/ui-tests": "^2.0.0-SNAPSHOT", + "@scm-manager/ui-tests": "^2.0.0-rc6", "@storybook/addon-actions": "^5.2.3", "@storybook/addon-storyshots": "^5.2.3", "@storybook/react": "^5.2.3", @@ -46,8 +46,8 @@ "worker-plugin": "^3.2.0" }, "dependencies": { - "@scm-manager/ui-extensions": "^2.0.0-SNAPSHOT", - "@scm-manager/ui-types": "^2.0.0-SNAPSHOT", + "@scm-manager/ui-extensions": "^2.0.0-rc6", + "@scm-manager/ui-types": "^2.0.0-rc6", "classnames": "^2.2.6", "date-fns": "^2.4.1", "gitdiff-parser": "^0.1.2", diff --git a/scm-ui/ui-extensions/package.json b/scm-ui/ui-extensions/package.json index a652c703f7..bfbb056bc2 100644 --- a/scm-ui/ui-extensions/package.json +++ b/scm-ui/ui-extensions/package.json @@ -1,6 +1,6 @@ { "name": "@scm-manager/ui-extensions", - "version": "2.0.0-SNAPSHOT", + "version": "2.0.0-rc6", "main": "src/index.ts", "license": "MIT", "private": false, diff --git a/scm-ui/ui-plugins/package.json b/scm-ui/ui-plugins/package.json index b88637e3f5..3a7b886a03 100644 --- a/scm-ui/ui-plugins/package.json +++ b/scm-ui/ui-plugins/package.json @@ -1,13 +1,13 @@ { "name": "@scm-manager/ui-plugins", - "version": "2.0.0-SNAPSHOT", + "version": "2.0.0-rc6", "license": "MIT", "bin": { "ui-plugins": "./bin/ui-plugins.js" }, "dependencies": { - "@scm-manager/ui-components": "^2.0.0-SNAPSHOT", - "@scm-manager/ui-extensions": "^2.0.0-SNAPSHOT", + "@scm-manager/ui-components": "^2.0.0-rc6", + "@scm-manager/ui-extensions": "^2.0.0-rc6", "classnames": "^2.2.6", "query-string": "^5.0.1", "react": "^16.10.2", @@ -18,14 +18,14 @@ "styled-components": "^4.4.0" }, "devDependencies": { - "@scm-manager/babel-preset": "^2.0.0-SNAPSHOT", - "@scm-manager/eslint-config": "^2.0.0-SNAPSHOT", - "@scm-manager/jest-preset": "^2.0.0-SNAPSHOT", - "@scm-manager/prettier-config": "^2.0.0-SNAPSHOT", - "@scm-manager/tsconfig": "^2.0.0-SNAPSHOT", - "@scm-manager/ui-scripts": "^2.0.0-SNAPSHOT", - "@scm-manager/ui-tests": "^2.0.0-SNAPSHOT", - "@scm-manager/ui-types": "^2.0.0-SNAPSHOT", + "@scm-manager/babel-preset": "^2.0.0-rc6", + "@scm-manager/eslint-config": "^2.0.0-rc6", + "@scm-manager/jest-preset": "^2.0.0-rc6", + "@scm-manager/prettier-config": "^2.0.0-rc6", + "@scm-manager/tsconfig": "^2.0.0-rc6", + "@scm-manager/ui-scripts": "^2.0.0-rc6", + "@scm-manager/ui-tests": "^2.0.0-rc6", + "@scm-manager/ui-types": "^2.0.0-rc6", "@types/classnames": "^2.2.9", "@types/enzyme": "^3.10.3", "@types/fetch-mock": "^7.3.1", diff --git a/scm-ui/ui-polyfill/package.json b/scm-ui/ui-polyfill/package.json index 8beb8d5836..b60b131c22 100644 --- a/scm-ui/ui-polyfill/package.json +++ b/scm-ui/ui-polyfill/package.json @@ -1,6 +1,6 @@ { "name": "@scm-manager/ui-polyfill", - "version": "2.0.0-SNAPSHOT", + "version": "2.0.0-rc6", "description": "Polyfills for SCM-Manager UI", "main": "src/index.js", "author": "Sebastian Sdorra <sebastian.sdorra@cloudogu.com>", diff --git a/scm-ui/ui-scripts/package.json b/scm-ui/ui-scripts/package.json index 25f5b25023..495d69aaca 100644 --- a/scm-ui/ui-scripts/package.json +++ b/scm-ui/ui-scripts/package.json @@ -1,6 +1,6 @@ { "name": "@scm-manager/ui-scripts", - "version": "2.0.0-SNAPSHOT", + "version": "2.0.0-rc6", "description": "Build scripts for SCM-Manager", "main": "src/index.js", "author": "Sebastian Sdorra <sebastian.sdorra@cloudogu.com>", diff --git a/scm-ui/ui-styles/package.json b/scm-ui/ui-styles/package.json index 15ca4c1ec4..4af4cb4ce3 100644 --- a/scm-ui/ui-styles/package.json +++ b/scm-ui/ui-styles/package.json @@ -1,6 +1,6 @@ { "name": "@scm-manager/ui-styles", - "version": "2.0.0-SNAPSHOT", + "version": "2.0.0-rc6", "description": "Styles for SCM-Manager", "main": "src/scm.scss", "license": "MIT", diff --git a/scm-ui/ui-tests/package.json b/scm-ui/ui-tests/package.json index be53c4164d..5780ae9cdb 100644 --- a/scm-ui/ui-tests/package.json +++ b/scm-ui/ui-tests/package.json @@ -1,6 +1,6 @@ { "name": "@scm-manager/ui-tests", - "version": "2.0.0-SNAPSHOT", + "version": "2.0.0-rc6", "description": "UI-Tests helpers", "author": "Sebastian Sdorra <sebastian.sdorra@cloudogu.com>", "license": "MIT", diff --git a/scm-ui/ui-types/package.json b/scm-ui/ui-types/package.json index a366ad3a1b..dda4634dad 100644 --- a/scm-ui/ui-types/package.json +++ b/scm-ui/ui-types/package.json @@ -1,6 +1,6 @@ { "name": "@scm-manager/ui-types", - "version": "2.0.0-SNAPSHOT", + "version": "2.0.0-rc6", "description": "Flow types for SCM-Manager related Objects", "main": "src/index.ts", "files": [ diff --git a/scm-ui/ui-webapp/package.json b/scm-ui/ui-webapp/package.json index ba54fb7689..77aa338be4 100644 --- a/scm-ui/ui-webapp/package.json +++ b/scm-ui/ui-webapp/package.json @@ -1,10 +1,10 @@ { "name": "@scm-manager/ui-webapp", - "version": "2.0.0-SNAPSHOT", + "version": "2.0.0-rc6", "private": true, "dependencies": { - "@scm-manager/ui-components": "^2.0.0-SNAPSHOT", - "@scm-manager/ui-extensions": "^2.0.0-SNAPSHOT", + "@scm-manager/ui-components": "^2.0.0-rc6", + "@scm-manager/ui-extensions": "^2.0.0-rc6", "classnames": "^2.2.5", "history": "^4.10.1", "i18next": "^17.3.0", @@ -29,7 +29,7 @@ "test": "jest" }, "devDependencies": { - "@scm-manager/ui-tests": "^2.0.0-SNAPSHOT", + "@scm-manager/ui-tests": "^2.0.0-rc6", "@types/classnames": "^2.2.9", "@types/enzyme": "^3.10.3", "@types/fetch-mock": "^7.3.1", diff --git a/scm-webapp/pom.xml b/scm-webapp/pom.xml index 24ba16333a..194a59b632 100644 --- a/scm-webapp/pom.xml +++ b/scm-webapp/pom.xml @@ -31,13 +31,13 @@ <parent> <groupId>sonia.scm</groupId> <artifactId>scm</artifactId> - <version>2.0.0-SNAPSHOT</version> + <version>2.0.0-rc6</version> </parent> <groupId>sonia.scm</groupId> <artifactId>scm-webapp</artifactId> <packaging>war</packaging> - <version>2.0.0-SNAPSHOT</version> + <version>2.0.0-rc6</version> <name>scm-webapp</name> <dependencies> @@ -47,7 +47,7 @@ <dependency> <groupId>sonia.scm</groupId> <artifactId>scm-annotation-processor</artifactId> - <version>2.0.0-SNAPSHOT</version> + <version>2.0.0-rc6</version> <scope>provided</scope> </dependency> @@ -72,13 +72,13 @@ <dependency> <groupId>sonia.scm</groupId> <artifactId>scm-core</artifactId> - <version>2.0.0-SNAPSHOT</version> + <version>2.0.0-rc6</version> </dependency> <dependency> <groupId>sonia.scm</groupId> <artifactId>scm-dao-xml</artifactId> - <version>2.0.0-SNAPSHOT</version> + <version>2.0.0-rc6</version> </dependency> <!-- security --> @@ -331,7 +331,7 @@ <dependency> <groupId>sonia.scm</groupId> <artifactId>scm-test</artifactId> - <version>2.0.0-SNAPSHOT</version> + <version>2.0.0-rc6</version> <scope>test</scope> <exclusions> <exclusion> @@ -393,7 +393,7 @@ <dependency> <groupId>sonia.scm.plugins</groupId> <artifactId>scm-git-plugin</artifactId> - <version>2.0.0-SNAPSHOT</version> + <version>2.0.0-rc6</version> <classifier>tests</classifier> <scope>test</scope> </dependency> @@ -401,14 +401,14 @@ <dependency> <groupId>sonia.scm.plugins</groupId> <artifactId>scm-git-plugin</artifactId> - <version>2.0.0-SNAPSHOT</version> + <version>2.0.0-rc6</version> <scope>test</scope> </dependency> <dependency> <groupId>sonia.scm.plugins</groupId> <artifactId>scm-hg-plugin</artifactId> - <version>2.0.0-SNAPSHOT</version> + <version>2.0.0-rc6</version> <classifier>tests</classifier> <scope>test</scope> </dependency> @@ -416,14 +416,14 @@ <dependency> <groupId>sonia.scm.plugins</groupId> <artifactId>scm-hg-plugin</artifactId> - <version>2.0.0-SNAPSHOT</version> + <version>2.0.0-rc6</version> <scope>test</scope> </dependency> <dependency> <groupId>sonia.scm.plugins</groupId> <artifactId>scm-svn-plugin</artifactId> - <version>2.0.0-SNAPSHOT</version> + <version>2.0.0-rc6</version> <classifier>tests</classifier> <scope>test</scope> </dependency> @@ -431,7 +431,7 @@ <dependency> <groupId>sonia.scm.plugins</groupId> <artifactId>scm-svn-plugin</artifactId> - <version>2.0.0-SNAPSHOT</version> + <version>2.0.0-rc6</version> <scope>test</scope> </dependency> @@ -704,7 +704,7 @@ <dependency> <groupId>sonia.scm</groupId> <artifactId>scm-ui</artifactId> - <version>2.0.0-SNAPSHOT</version> + <version>2.0.0-rc6</version> <type>war</type> </dependency> From 263072d68ba7aa37401513c71595af4b6fe6ad38 Mon Sep 17 00:00:00 2001 From: CES Marvin <cesmarvin@cloudogu.com> Date: Thu, 26 Mar 2020 15:59:09 +0000 Subject: [PATCH 21/44] prepare for next development iteration --- pom.xml | 2 +- scm-annotation-processor/pom.xml | 6 +++--- scm-annotations/pom.xml | 4 ++-- scm-core/pom.xml | 8 ++++---- scm-dao-xml/pom.xml | 8 ++++---- scm-it/pom.xml | 20 ++++++++++---------- scm-plugins/pom.xml | 10 +++++----- scm-plugins/scm-git-plugin/pom.xml | 2 +- scm-plugins/scm-hg-plugin/pom.xml | 2 +- scm-plugins/scm-legacy-plugin/pom.xml | 4 ++-- scm-plugins/scm-svn-plugin/pom.xml | 2 +- scm-server/pom.xml | 4 ++-- scm-test/pom.xml | 6 +++--- scm-ui/pom.xml | 4 ++-- scm-webapp/pom.xml | 26 +++++++++++++------------- 15 files changed, 54 insertions(+), 54 deletions(-) diff --git a/pom.xml b/pom.xml index e57afa6348..d70be3c96a 100644 --- a/pom.xml +++ b/pom.xml @@ -32,7 +32,7 @@ <groupId>sonia.scm</groupId> <artifactId>scm</artifactId> <packaging>pom</packaging> - <version>2.0.0-rc6</version> + <version>2.1.0-SNAPSHOT</version> <description> The easiest way to share your Git, Mercurial and Subversion repositories over http. diff --git a/scm-annotation-processor/pom.xml b/scm-annotation-processor/pom.xml index 35427c28fd..5d912ed0f0 100644 --- a/scm-annotation-processor/pom.xml +++ b/scm-annotation-processor/pom.xml @@ -31,12 +31,12 @@ <parent> <groupId>sonia.scm</groupId> <artifactId>scm</artifactId> - <version>2.0.0-rc6</version> + <version>2.1.0-SNAPSHOT</version> </parent> <groupId>sonia.scm</groupId> <artifactId>scm-annotation-processor</artifactId> - <version>2.0.0-rc6</version> + <version>2.1.0-SNAPSHOT</version> <name>scm-annotation-processor</name> <dependencies> @@ -46,7 +46,7 @@ <dependency> <groupId>sonia.scm</groupId> <artifactId>scm-annotations</artifactId> - <version>2.0.0-rc6</version> + <version>2.1.0-SNAPSHOT</version> </dependency> <!-- rest api --> diff --git a/scm-annotations/pom.xml b/scm-annotations/pom.xml index 5d1dce285f..d921d3686b 100644 --- a/scm-annotations/pom.xml +++ b/scm-annotations/pom.xml @@ -31,11 +31,11 @@ <parent> <groupId>sonia.scm</groupId> <artifactId>scm</artifactId> - <version>2.0.0-rc6</version> + <version>2.1.0-SNAPSHOT</version> </parent> <artifactId>scm-annotations</artifactId> - <version>2.0.0-rc6</version> + <version>2.1.0-SNAPSHOT</version> <name>scm-annotations</name> <dependencies> diff --git a/scm-core/pom.xml b/scm-core/pom.xml index 8a21be8d87..686b4f5afa 100644 --- a/scm-core/pom.xml +++ b/scm-core/pom.xml @@ -31,12 +31,12 @@ <parent> <artifactId>scm</artifactId> <groupId>sonia.scm</groupId> - <version>2.0.0-rc6</version> + <version>2.1.0-SNAPSHOT</version> </parent> <groupId>sonia.scm</groupId> <artifactId>scm-core</artifactId> - <version>2.0.0-rc6</version> + <version>2.1.0-SNAPSHOT</version> <name>scm-core</name> <dependencies> @@ -55,7 +55,7 @@ <dependency> <groupId>sonia.scm</groupId> <artifactId>scm-annotations</artifactId> - <version>2.0.0-rc6</version> + <version>2.1.0-SNAPSHOT</version> </dependency> <dependency> @@ -213,7 +213,7 @@ <dependency> <groupId>sonia.scm</groupId> <artifactId>scm-annotation-processor</artifactId> - <version>2.0.0-rc6</version> + <version>2.1.0-SNAPSHOT</version> <scope>provided</scope> </dependency> diff --git a/scm-dao-xml/pom.xml b/scm-dao-xml/pom.xml index 54dc322083..6f6dde92e1 100644 --- a/scm-dao-xml/pom.xml +++ b/scm-dao-xml/pom.xml @@ -31,12 +31,12 @@ <parent> <groupId>sonia.scm</groupId> <artifactId>scm</artifactId> - <version>2.0.0-rc6</version> + <version>2.1.0-SNAPSHOT</version> </parent> <groupId>sonia.scm</groupId> <artifactId>scm-dao-xml</artifactId> - <version>2.0.0-rc6</version> + <version>2.1.0-SNAPSHOT</version> <name>scm-dao-xml</name> <dependencies> @@ -51,7 +51,7 @@ <dependency> <groupId>sonia.scm</groupId> <artifactId>scm-core</artifactId> - <version>2.0.0-rc6</version> + <version>2.1.0-SNAPSHOT</version> </dependency> <!-- test --> @@ -59,7 +59,7 @@ <dependency> <groupId>sonia.scm</groupId> <artifactId>scm-test</artifactId> - <version>2.0.0-rc6</version> + <version>2.1.0-SNAPSHOT</version> <scope>test</scope> </dependency> diff --git a/scm-it/pom.xml b/scm-it/pom.xml index 7ae6ff757a..84257fd9f3 100644 --- a/scm-it/pom.xml +++ b/scm-it/pom.xml @@ -31,40 +31,40 @@ <parent> <groupId>sonia.scm</groupId> <artifactId>scm</artifactId> - <version>2.0.0-rc6</version> + <version>2.1.0-SNAPSHOT</version> </parent> <groupId>sonia.scm</groupId> <artifactId>scm-it</artifactId> <!-- we need type war, because the jetty plugin does not work with jar or pom --> <packaging>war</packaging> - <version>2.0.0-rc6</version> + <version>2.1.0-SNAPSHOT</version> <name>scm-it</name> <dependencies> <dependency> <groupId>sonia.scm</groupId> <artifactId>scm-core</artifactId> - <version>2.0.0-rc6</version> + <version>2.1.0-SNAPSHOT</version> </dependency> <dependency> <groupId>sonia.scm</groupId> <artifactId>scm-test</artifactId> - <version>2.0.0-rc6</version> + <version>2.1.0-SNAPSHOT</version> </dependency> <dependency> <groupId>sonia.scm.plugins</groupId> <artifactId>scm-git-plugin</artifactId> - <version>2.0.0-rc6</version> + <version>2.1.0-SNAPSHOT</version> <scope>test</scope> </dependency> <dependency> <groupId>sonia.scm.plugins</groupId> <artifactId>scm-git-plugin</artifactId> - <version>2.0.0-rc6</version> + <version>2.1.0-SNAPSHOT</version> <classifier>tests</classifier> <scope>test</scope> </dependency> @@ -72,14 +72,14 @@ <dependency> <groupId>sonia.scm.plugins</groupId> <artifactId>scm-hg-plugin</artifactId> - <version>2.0.0-rc6</version> + <version>2.1.0-SNAPSHOT</version> <scope>test</scope> </dependency> <dependency> <groupId>sonia.scm.plugins</groupId> <artifactId>scm-hg-plugin</artifactId> - <version>2.0.0-rc6</version> + <version>2.1.0-SNAPSHOT</version> <classifier>tests</classifier> <scope>test</scope> </dependency> @@ -87,14 +87,14 @@ <dependency> <groupId>sonia.scm.plugins</groupId> <artifactId>scm-svn-plugin</artifactId> - <version>2.0.0-rc6</version> + <version>2.1.0-SNAPSHOT</version> <scope>test</scope> </dependency> <dependency> <groupId>sonia.scm.plugins</groupId> <artifactId>scm-svn-plugin</artifactId> - <version>2.0.0-rc6</version> + <version>2.1.0-SNAPSHOT</version> <classifier>tests</classifier> <scope>test</scope> </dependency> diff --git a/scm-plugins/pom.xml b/scm-plugins/pom.xml index 99209421d6..9e8f7db2cb 100644 --- a/scm-plugins/pom.xml +++ b/scm-plugins/pom.xml @@ -31,13 +31,13 @@ <parent> <groupId>sonia.scm</groupId> <artifactId>scm</artifactId> - <version>2.0.0-rc6</version> + <version>2.1.0-SNAPSHOT</version> </parent> <groupId>sonia.scm.plugins</groupId> <artifactId>scm-plugins</artifactId> <packaging>pom</packaging> - <version>2.0.0-rc6</version> + <version>2.1.0-SNAPSHOT</version> <name>scm-plugins</name> <modules> @@ -59,7 +59,7 @@ <dependency> <groupId>sonia.scm</groupId> <artifactId>scm-core</artifactId> - <version>2.0.0-rc6</version> + <version>2.1.0-SNAPSHOT</version> <scope>provided</scope> </dependency> @@ -68,7 +68,7 @@ <dependency> <groupId>sonia.scm</groupId> <artifactId>scm-annotation-processor</artifactId> - <version>2.0.0-rc6</version> + <version>2.1.0-SNAPSHOT</version> <scope>provided</scope> </dependency> @@ -98,7 +98,7 @@ <dependency> <groupId>sonia.scm</groupId> <artifactId>scm-test</artifactId> - <version>2.0.0-rc6</version> + <version>2.1.0-SNAPSHOT</version> <scope>test</scope> </dependency> diff --git a/scm-plugins/scm-git-plugin/pom.xml b/scm-plugins/scm-git-plugin/pom.xml index d00a89372b..2f1190c4ea 100644 --- a/scm-plugins/scm-git-plugin/pom.xml +++ b/scm-plugins/scm-git-plugin/pom.xml @@ -31,7 +31,7 @@ <parent> <artifactId>scm-plugins</artifactId> <groupId>sonia.scm.plugins</groupId> - <version>2.0.0-rc6</version> + <version>2.1.0-SNAPSHOT</version> </parent> <artifactId>scm-git-plugin</artifactId> diff --git a/scm-plugins/scm-hg-plugin/pom.xml b/scm-plugins/scm-hg-plugin/pom.xml index f56b804d53..b1471fcc60 100644 --- a/scm-plugins/scm-hg-plugin/pom.xml +++ b/scm-plugins/scm-hg-plugin/pom.xml @@ -31,7 +31,7 @@ <parent> <groupId>sonia.scm.plugins</groupId> <artifactId>scm-plugins</artifactId> - <version>2.0.0-rc6</version> + <version>2.1.0-SNAPSHOT</version> </parent> <artifactId>scm-hg-plugin</artifactId> diff --git a/scm-plugins/scm-legacy-plugin/pom.xml b/scm-plugins/scm-legacy-plugin/pom.xml index 6950ae966e..842a25dbfa 100644 --- a/scm-plugins/scm-legacy-plugin/pom.xml +++ b/scm-plugins/scm-legacy-plugin/pom.xml @@ -29,12 +29,12 @@ <parent> <groupId>sonia.scm.plugins</groupId> <artifactId>scm-plugins</artifactId> - <version>2.0.0-rc6</version> + <version>2.1.0-SNAPSHOT</version> </parent> <artifactId>scm-legacy-plugin</artifactId> <description>Support migrated repository urls and v1 passwords</description> - <version>2.0.0-rc6</version> + <version>2.1.0-SNAPSHOT</version> <packaging>smp</packaging> <dependencies> diff --git a/scm-plugins/scm-svn-plugin/pom.xml b/scm-plugins/scm-svn-plugin/pom.xml index 7051103dd7..0e7f43804a 100644 --- a/scm-plugins/scm-svn-plugin/pom.xml +++ b/scm-plugins/scm-svn-plugin/pom.xml @@ -31,7 +31,7 @@ <parent> <artifactId>scm-plugins</artifactId> <groupId>sonia.scm.plugins</groupId> - <version>2.0.0-rc6</version> + <version>2.1.0-SNAPSHOT</version> </parent> <artifactId>scm-svn-plugin</artifactId> diff --git a/scm-server/pom.xml b/scm-server/pom.xml index 3141d4d149..4d08467bde 100644 --- a/scm-server/pom.xml +++ b/scm-server/pom.xml @@ -31,12 +31,12 @@ <parent> <artifactId>scm</artifactId> <groupId>sonia.scm</groupId> - <version>2.0.0-rc6</version> + <version>2.1.0-SNAPSHOT</version> </parent> <groupId>sonia.scm</groupId> <artifactId>scm-server</artifactId> - <version>2.0.0-rc6</version> + <version>2.1.0-SNAPSHOT</version> <name>scm-server</name> <packaging>jar</packaging> diff --git a/scm-test/pom.xml b/scm-test/pom.xml index cf0d4e3c4c..96a4e6c834 100644 --- a/scm-test/pom.xml +++ b/scm-test/pom.xml @@ -31,12 +31,12 @@ <parent> <artifactId>scm</artifactId> <groupId>sonia.scm</groupId> - <version>2.0.0-rc6</version> + <version>2.1.0-SNAPSHOT</version> </parent> <groupId>sonia.scm</groupId> <artifactId>scm-test</artifactId> - <version>2.0.0-rc6</version> + <version>2.1.0-SNAPSHOT</version> <name>scm-test</name> <dependencies> @@ -50,7 +50,7 @@ <dependency> <groupId>sonia.scm</groupId> <artifactId>scm-core</artifactId> - <version>2.0.0-rc6</version> + <version>2.1.0-SNAPSHOT</version> </dependency> <dependency> diff --git a/scm-ui/pom.xml b/scm-ui/pom.xml index 8dc90ba66f..ee9f40bd70 100644 --- a/scm-ui/pom.xml +++ b/scm-ui/pom.xml @@ -32,13 +32,13 @@ <parent> <groupId>sonia.scm</groupId> <artifactId>scm</artifactId> - <version>2.0.0-rc6</version> + <version>2.1.0-SNAPSHOT</version> </parent> <groupId>sonia.scm</groupId> <artifactId>scm-ui</artifactId> <packaging>war</packaging> - <version>2.0.0-rc6</version> + <version>2.1.0-SNAPSHOT</version> <name>scm-ui</name> <properties> diff --git a/scm-webapp/pom.xml b/scm-webapp/pom.xml index 194a59b632..78a87ea0be 100644 --- a/scm-webapp/pom.xml +++ b/scm-webapp/pom.xml @@ -31,13 +31,13 @@ <parent> <groupId>sonia.scm</groupId> <artifactId>scm</artifactId> - <version>2.0.0-rc6</version> + <version>2.1.0-SNAPSHOT</version> </parent> <groupId>sonia.scm</groupId> <artifactId>scm-webapp</artifactId> <packaging>war</packaging> - <version>2.0.0-rc6</version> + <version>2.1.0-SNAPSHOT</version> <name>scm-webapp</name> <dependencies> @@ -47,7 +47,7 @@ <dependency> <groupId>sonia.scm</groupId> <artifactId>scm-annotation-processor</artifactId> - <version>2.0.0-rc6</version> + <version>2.1.0-SNAPSHOT</version> <scope>provided</scope> </dependency> @@ -72,13 +72,13 @@ <dependency> <groupId>sonia.scm</groupId> <artifactId>scm-core</artifactId> - <version>2.0.0-rc6</version> + <version>2.1.0-SNAPSHOT</version> </dependency> <dependency> <groupId>sonia.scm</groupId> <artifactId>scm-dao-xml</artifactId> - <version>2.0.0-rc6</version> + <version>2.1.0-SNAPSHOT</version> </dependency> <!-- security --> @@ -331,7 +331,7 @@ <dependency> <groupId>sonia.scm</groupId> <artifactId>scm-test</artifactId> - <version>2.0.0-rc6</version> + <version>2.1.0-SNAPSHOT</version> <scope>test</scope> <exclusions> <exclusion> @@ -393,7 +393,7 @@ <dependency> <groupId>sonia.scm.plugins</groupId> <artifactId>scm-git-plugin</artifactId> - <version>2.0.0-rc6</version> + <version>2.1.0-SNAPSHOT</version> <classifier>tests</classifier> <scope>test</scope> </dependency> @@ -401,14 +401,14 @@ <dependency> <groupId>sonia.scm.plugins</groupId> <artifactId>scm-git-plugin</artifactId> - <version>2.0.0-rc6</version> + <version>2.1.0-SNAPSHOT</version> <scope>test</scope> </dependency> <dependency> <groupId>sonia.scm.plugins</groupId> <artifactId>scm-hg-plugin</artifactId> - <version>2.0.0-rc6</version> + <version>2.1.0-SNAPSHOT</version> <classifier>tests</classifier> <scope>test</scope> </dependency> @@ -416,14 +416,14 @@ <dependency> <groupId>sonia.scm.plugins</groupId> <artifactId>scm-hg-plugin</artifactId> - <version>2.0.0-rc6</version> + <version>2.1.0-SNAPSHOT</version> <scope>test</scope> </dependency> <dependency> <groupId>sonia.scm.plugins</groupId> <artifactId>scm-svn-plugin</artifactId> - <version>2.0.0-rc6</version> + <version>2.1.0-SNAPSHOT</version> <classifier>tests</classifier> <scope>test</scope> </dependency> @@ -431,7 +431,7 @@ <dependency> <groupId>sonia.scm.plugins</groupId> <artifactId>scm-svn-plugin</artifactId> - <version>2.0.0-rc6</version> + <version>2.1.0-SNAPSHOT</version> <scope>test</scope> </dependency> @@ -704,7 +704,7 @@ <dependency> <groupId>sonia.scm</groupId> <artifactId>scm-ui</artifactId> - <version>2.0.0-rc6</version> + <version>2.1.0-SNAPSHOT</version> <type>war</type> </dependency> From 63b7a1f5a4560ca6c454f3f8c0e685ff7f5d2c22 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Pfeuffer?= <rene.pfeuffer@cloudogu.com> Date: Thu, 26 Mar 2020 18:43:00 +0100 Subject: [PATCH 22/44] Fix config call --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 39173ab389..a6ca00bb51 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -48,7 +48,7 @@ node('docker') { sh "git -c user.name='CES Marvin' -c user.email='cesmarvin@cloudogu.com' commit -m 'release version ${releaseVersion}'" // we need to fetch all branches, so we can checkout master and develop later - sh "git config 'remote.origin.fetch +refs/heads/*:refs/remotes/origin/*'" + sh "git config 'remote.origin.fetch' '+refs/heads/*:refs/remotes/origin/*'" sh "git fetch --all" // merge release branch into master From 41d02b9c248b4f5d52fb133f4961ce433fce166c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Pfeuffer?= <rene.pfeuffer@cloudogu.com> Date: Thu, 26 Mar 2020 18:52:11 +0100 Subject: [PATCH 23/44] Set version back to 2.0.0-SNAPSHOT --- lerna.json | 2 +- pom.xml | 2 +- scm-annotation-processor/pom.xml | 6 ++--- scm-annotations/pom.xml | 4 ++-- scm-core/pom.xml | 8 +++---- scm-dao-xml/pom.xml | 8 +++---- scm-it/pom.xml | 20 ++++++++--------- scm-plugins/pom.xml | 10 ++++----- scm-plugins/scm-git-plugin/package.json | 4 ++-- scm-plugins/scm-git-plugin/pom.xml | 2 +- scm-plugins/scm-hg-plugin/package.json | 4 ++-- scm-plugins/scm-hg-plugin/pom.xml | 2 +- scm-plugins/scm-legacy-plugin/package.json | 4 ++-- scm-plugins/scm-legacy-plugin/pom.xml | 4 ++-- scm-plugins/scm-svn-plugin/package.json | 4 ++-- scm-plugins/scm-svn-plugin/pom.xml | 2 +- scm-server/pom.xml | 4 ++-- scm-test/pom.xml | 6 ++--- scm-ui/babel-preset/package.json | 2 +- scm-ui/eslint-config/package.json | 2 +- scm-ui/jest-preset/package.json | 2 +- scm-ui/pom.xml | 4 ++-- scm-ui/prettier-config/package.json | 2 +- scm-ui/tsconfig/package.json | 2 +- scm-ui/ui-components/package.json | 8 +++---- scm-ui/ui-extensions/package.json | 2 +- scm-ui/ui-plugins/package.json | 22 +++++++++--------- scm-ui/ui-polyfill/package.json | 2 +- scm-ui/ui-scripts/package.json | 2 +- scm-ui/ui-styles/package.json | 2 +- scm-ui/ui-tests/package.json | 2 +- scm-ui/ui-types/package.json | 2 +- scm-ui/ui-webapp/package.json | 8 +++---- scm-webapp/pom.xml | 26 +++++++++++----------- 34 files changed, 93 insertions(+), 93 deletions(-) diff --git a/lerna.json b/lerna.json index e121e1d503..405d16a397 100644 --- a/lerna.json +++ b/lerna.json @@ -5,5 +5,5 @@ ], "npmClient": "yarn", "useWorkspaces": true, - "version": "2.0.0-rc6" + "version": "2.0.0-SNAPSHOT" } diff --git a/pom.xml b/pom.xml index d70be3c96a..2054116a65 100644 --- a/pom.xml +++ b/pom.xml @@ -32,7 +32,7 @@ <groupId>sonia.scm</groupId> <artifactId>scm</artifactId> <packaging>pom</packaging> - <version>2.1.0-SNAPSHOT</version> + <version>2.0.0-SNAPSHOT</version> <description> The easiest way to share your Git, Mercurial and Subversion repositories over http. diff --git a/scm-annotation-processor/pom.xml b/scm-annotation-processor/pom.xml index 5d912ed0f0..4881cf3110 100644 --- a/scm-annotation-processor/pom.xml +++ b/scm-annotation-processor/pom.xml @@ -31,12 +31,12 @@ <parent> <groupId>sonia.scm</groupId> <artifactId>scm</artifactId> - <version>2.1.0-SNAPSHOT</version> + <version>2.0.0-SNAPSHOT</version> </parent> <groupId>sonia.scm</groupId> <artifactId>scm-annotation-processor</artifactId> - <version>2.1.0-SNAPSHOT</version> + <version>2.0.0-SNAPSHOT</version> <name>scm-annotation-processor</name> <dependencies> @@ -46,7 +46,7 @@ <dependency> <groupId>sonia.scm</groupId> <artifactId>scm-annotations</artifactId> - <version>2.1.0-SNAPSHOT</version> + <version>2.0.0-SNAPSHOT</version> </dependency> <!-- rest api --> diff --git a/scm-annotations/pom.xml b/scm-annotations/pom.xml index d921d3686b..dfc7b8d62a 100644 --- a/scm-annotations/pom.xml +++ b/scm-annotations/pom.xml @@ -31,11 +31,11 @@ <parent> <groupId>sonia.scm</groupId> <artifactId>scm</artifactId> - <version>2.1.0-SNAPSHOT</version> + <version>2.0.0-SNAPSHOT</version> </parent> <artifactId>scm-annotations</artifactId> - <version>2.1.0-SNAPSHOT</version> + <version>2.0.0-SNAPSHOT</version> <name>scm-annotations</name> <dependencies> diff --git a/scm-core/pom.xml b/scm-core/pom.xml index 686b4f5afa..ac86a33f4d 100644 --- a/scm-core/pom.xml +++ b/scm-core/pom.xml @@ -31,12 +31,12 @@ <parent> <artifactId>scm</artifactId> <groupId>sonia.scm</groupId> - <version>2.1.0-SNAPSHOT</version> + <version>2.0.0-SNAPSHOT</version> </parent> <groupId>sonia.scm</groupId> <artifactId>scm-core</artifactId> - <version>2.1.0-SNAPSHOT</version> + <version>2.0.0-SNAPSHOT</version> <name>scm-core</name> <dependencies> @@ -55,7 +55,7 @@ <dependency> <groupId>sonia.scm</groupId> <artifactId>scm-annotations</artifactId> - <version>2.1.0-SNAPSHOT</version> + <version>2.0.0-SNAPSHOT</version> </dependency> <dependency> @@ -213,7 +213,7 @@ <dependency> <groupId>sonia.scm</groupId> <artifactId>scm-annotation-processor</artifactId> - <version>2.1.0-SNAPSHOT</version> + <version>2.0.0-SNAPSHOT</version> <scope>provided</scope> </dependency> diff --git a/scm-dao-xml/pom.xml b/scm-dao-xml/pom.xml index 6f6dde92e1..42f49dd8f3 100644 --- a/scm-dao-xml/pom.xml +++ b/scm-dao-xml/pom.xml @@ -31,12 +31,12 @@ <parent> <groupId>sonia.scm</groupId> <artifactId>scm</artifactId> - <version>2.1.0-SNAPSHOT</version> + <version>2.0.0-SNAPSHOT</version> </parent> <groupId>sonia.scm</groupId> <artifactId>scm-dao-xml</artifactId> - <version>2.1.0-SNAPSHOT</version> + <version>2.0.0-SNAPSHOT</version> <name>scm-dao-xml</name> <dependencies> @@ -51,7 +51,7 @@ <dependency> <groupId>sonia.scm</groupId> <artifactId>scm-core</artifactId> - <version>2.1.0-SNAPSHOT</version> + <version>2.0.0-SNAPSHOT</version> </dependency> <!-- test --> @@ -59,7 +59,7 @@ <dependency> <groupId>sonia.scm</groupId> <artifactId>scm-test</artifactId> - <version>2.1.0-SNAPSHOT</version> + <version>2.0.0-SNAPSHOT</version> <scope>test</scope> </dependency> diff --git a/scm-it/pom.xml b/scm-it/pom.xml index 84257fd9f3..146a7b33b2 100644 --- a/scm-it/pom.xml +++ b/scm-it/pom.xml @@ -31,40 +31,40 @@ <parent> <groupId>sonia.scm</groupId> <artifactId>scm</artifactId> - <version>2.1.0-SNAPSHOT</version> + <version>2.0.0-SNAPSHOT</version> </parent> <groupId>sonia.scm</groupId> <artifactId>scm-it</artifactId> <!-- we need type war, because the jetty plugin does not work with jar or pom --> <packaging>war</packaging> - <version>2.1.0-SNAPSHOT</version> + <version>2.0.0-SNAPSHOT</version> <name>scm-it</name> <dependencies> <dependency> <groupId>sonia.scm</groupId> <artifactId>scm-core</artifactId> - <version>2.1.0-SNAPSHOT</version> + <version>2.0.0-SNAPSHOT</version> </dependency> <dependency> <groupId>sonia.scm</groupId> <artifactId>scm-test</artifactId> - <version>2.1.0-SNAPSHOT</version> + <version>2.0.0-SNAPSHOT</version> </dependency> <dependency> <groupId>sonia.scm.plugins</groupId> <artifactId>scm-git-plugin</artifactId> - <version>2.1.0-SNAPSHOT</version> + <version>2.0.0-SNAPSHOT</version> <scope>test</scope> </dependency> <dependency> <groupId>sonia.scm.plugins</groupId> <artifactId>scm-git-plugin</artifactId> - <version>2.1.0-SNAPSHOT</version> + <version>2.0.0-SNAPSHOT</version> <classifier>tests</classifier> <scope>test</scope> </dependency> @@ -72,14 +72,14 @@ <dependency> <groupId>sonia.scm.plugins</groupId> <artifactId>scm-hg-plugin</artifactId> - <version>2.1.0-SNAPSHOT</version> + <version>2.0.0-SNAPSHOT</version> <scope>test</scope> </dependency> <dependency> <groupId>sonia.scm.plugins</groupId> <artifactId>scm-hg-plugin</artifactId> - <version>2.1.0-SNAPSHOT</version> + <version>2.0.0-SNAPSHOT</version> <classifier>tests</classifier> <scope>test</scope> </dependency> @@ -87,14 +87,14 @@ <dependency> <groupId>sonia.scm.plugins</groupId> <artifactId>scm-svn-plugin</artifactId> - <version>2.1.0-SNAPSHOT</version> + <version>2.0.0-SNAPSHOT</version> <scope>test</scope> </dependency> <dependency> <groupId>sonia.scm.plugins</groupId> <artifactId>scm-svn-plugin</artifactId> - <version>2.1.0-SNAPSHOT</version> + <version>2.0.0-SNAPSHOT</version> <classifier>tests</classifier> <scope>test</scope> </dependency> diff --git a/scm-plugins/pom.xml b/scm-plugins/pom.xml index 9e8f7db2cb..5467725199 100644 --- a/scm-plugins/pom.xml +++ b/scm-plugins/pom.xml @@ -31,13 +31,13 @@ <parent> <groupId>sonia.scm</groupId> <artifactId>scm</artifactId> - <version>2.1.0-SNAPSHOT</version> + <version>2.0.0-SNAPSHOT</version> </parent> <groupId>sonia.scm.plugins</groupId> <artifactId>scm-plugins</artifactId> <packaging>pom</packaging> - <version>2.1.0-SNAPSHOT</version> + <version>2.0.0-SNAPSHOT</version> <name>scm-plugins</name> <modules> @@ -59,7 +59,7 @@ <dependency> <groupId>sonia.scm</groupId> <artifactId>scm-core</artifactId> - <version>2.1.0-SNAPSHOT</version> + <version>2.0.0-SNAPSHOT</version> <scope>provided</scope> </dependency> @@ -68,7 +68,7 @@ <dependency> <groupId>sonia.scm</groupId> <artifactId>scm-annotation-processor</artifactId> - <version>2.1.0-SNAPSHOT</version> + <version>2.0.0-SNAPSHOT</version> <scope>provided</scope> </dependency> @@ -98,7 +98,7 @@ <dependency> <groupId>sonia.scm</groupId> <artifactId>scm-test</artifactId> - <version>2.1.0-SNAPSHOT</version> + <version>2.0.0-SNAPSHOT</version> <scope>test</scope> </dependency> diff --git a/scm-plugins/scm-git-plugin/package.json b/scm-plugins/scm-git-plugin/package.json index 40d8ef6e08..01572012d1 100644 --- a/scm-plugins/scm-git-plugin/package.json +++ b/scm-plugins/scm-git-plugin/package.json @@ -1,7 +1,7 @@ { "name": "@scm-manager/scm-git-plugin", "private": true, - "version": "2.0.0-rc6", + "version": "2.0.0-SNAPSHOT", "license": "MIT", "main": "./src/main/js/index.ts", "scripts": { @@ -20,6 +20,6 @@ }, "prettier": "@scm-manager/prettier-config", "dependencies": { - "@scm-manager/ui-plugins": "^2.0.0-rc6" + "@scm-manager/ui-plugins": "^2.0.0-SNAPSHOT" } } diff --git a/scm-plugins/scm-git-plugin/pom.xml b/scm-plugins/scm-git-plugin/pom.xml index 2f1190c4ea..6a3e2235cc 100644 --- a/scm-plugins/scm-git-plugin/pom.xml +++ b/scm-plugins/scm-git-plugin/pom.xml @@ -31,7 +31,7 @@ <parent> <artifactId>scm-plugins</artifactId> <groupId>sonia.scm.plugins</groupId> - <version>2.1.0-SNAPSHOT</version> + <version>2.0.0-SNAPSHOT</version> </parent> <artifactId>scm-git-plugin</artifactId> diff --git a/scm-plugins/scm-hg-plugin/package.json b/scm-plugins/scm-hg-plugin/package.json index 54ff0ca095..f6bb8709f8 100644 --- a/scm-plugins/scm-hg-plugin/package.json +++ b/scm-plugins/scm-hg-plugin/package.json @@ -1,7 +1,7 @@ { "name": "@scm-manager/scm-hg-plugin", "private": true, - "version": "2.0.0-rc6", + "version": "2.0.0-SNAPSHOT", "license": "MIT", "main": "./src/main/js/index.ts", "scripts": { @@ -19,6 +19,6 @@ }, "prettier": "@scm-manager/prettier-config", "dependencies": { - "@scm-manager/ui-plugins": "^2.0.0-rc6" + "@scm-manager/ui-plugins": "^2.0.0-SNAPSHOT" } } diff --git a/scm-plugins/scm-hg-plugin/pom.xml b/scm-plugins/scm-hg-plugin/pom.xml index b1471fcc60..37da213210 100644 --- a/scm-plugins/scm-hg-plugin/pom.xml +++ b/scm-plugins/scm-hg-plugin/pom.xml @@ -31,7 +31,7 @@ <parent> <groupId>sonia.scm.plugins</groupId> <artifactId>scm-plugins</artifactId> - <version>2.1.0-SNAPSHOT</version> + <version>2.0.0-SNAPSHOT</version> </parent> <artifactId>scm-hg-plugin</artifactId> diff --git a/scm-plugins/scm-legacy-plugin/package.json b/scm-plugins/scm-legacy-plugin/package.json index 0ea7c9d669..abd99dc69a 100644 --- a/scm-plugins/scm-legacy-plugin/package.json +++ b/scm-plugins/scm-legacy-plugin/package.json @@ -1,7 +1,7 @@ { "name": "@scm-manager/scm-legacy-plugin", "private": true, - "version": "2.0.0-rc6", + "version": "2.0.0-SNAPSHOT", "license": "MIT", "main": "./src/main/js/index.tsx", "scripts": { @@ -19,6 +19,6 @@ }, "prettier": "@scm-manager/prettier-config", "dependencies": { - "@scm-manager/ui-plugins": "^2.0.0-rc6" + "@scm-manager/ui-plugins": "^2.0.0-SNAPSHOT" } } diff --git a/scm-plugins/scm-legacy-plugin/pom.xml b/scm-plugins/scm-legacy-plugin/pom.xml index 842a25dbfa..46bc9d99f2 100644 --- a/scm-plugins/scm-legacy-plugin/pom.xml +++ b/scm-plugins/scm-legacy-plugin/pom.xml @@ -29,12 +29,12 @@ <parent> <groupId>sonia.scm.plugins</groupId> <artifactId>scm-plugins</artifactId> - <version>2.1.0-SNAPSHOT</version> + <version>2.0.0-SNAPSHOT</version> </parent> <artifactId>scm-legacy-plugin</artifactId> <description>Support migrated repository urls and v1 passwords</description> - <version>2.1.0-SNAPSHOT</version> + <version>2.0.0-SNAPSHOT</version> <packaging>smp</packaging> <dependencies> diff --git a/scm-plugins/scm-svn-plugin/package.json b/scm-plugins/scm-svn-plugin/package.json index 02151e4262..8be18995df 100644 --- a/scm-plugins/scm-svn-plugin/package.json +++ b/scm-plugins/scm-svn-plugin/package.json @@ -1,7 +1,7 @@ { "name": "@scm-manager/scm-svn-plugin", "private": true, - "version": "2.0.0-rc6", + "version": "2.0.0-SNAPSHOT", "license": "MIT", "main": "./src/main/js/index.ts", "scripts": { @@ -19,6 +19,6 @@ }, "prettier": "@scm-manager/prettier-config", "dependencies": { - "@scm-manager/ui-plugins": "^2.0.0-rc6" + "@scm-manager/ui-plugins": "^2.0.0-SNAPSHOT" } } diff --git a/scm-plugins/scm-svn-plugin/pom.xml b/scm-plugins/scm-svn-plugin/pom.xml index 0e7f43804a..0a75769180 100644 --- a/scm-plugins/scm-svn-plugin/pom.xml +++ b/scm-plugins/scm-svn-plugin/pom.xml @@ -31,7 +31,7 @@ <parent> <artifactId>scm-plugins</artifactId> <groupId>sonia.scm.plugins</groupId> - <version>2.1.0-SNAPSHOT</version> + <version>2.0.0-SNAPSHOT</version> </parent> <artifactId>scm-svn-plugin</artifactId> diff --git a/scm-server/pom.xml b/scm-server/pom.xml index 4d08467bde..08fbe4dc39 100644 --- a/scm-server/pom.xml +++ b/scm-server/pom.xml @@ -31,12 +31,12 @@ <parent> <artifactId>scm</artifactId> <groupId>sonia.scm</groupId> - <version>2.1.0-SNAPSHOT</version> + <version>2.0.0-SNAPSHOT</version> </parent> <groupId>sonia.scm</groupId> <artifactId>scm-server</artifactId> - <version>2.1.0-SNAPSHOT</version> + <version>2.0.0-SNAPSHOT</version> <name>scm-server</name> <packaging>jar</packaging> diff --git a/scm-test/pom.xml b/scm-test/pom.xml index 96a4e6c834..a24e048f55 100644 --- a/scm-test/pom.xml +++ b/scm-test/pom.xml @@ -31,12 +31,12 @@ <parent> <artifactId>scm</artifactId> <groupId>sonia.scm</groupId> - <version>2.1.0-SNAPSHOT</version> + <version>2.0.0-SNAPSHOT</version> </parent> <groupId>sonia.scm</groupId> <artifactId>scm-test</artifactId> - <version>2.1.0-SNAPSHOT</version> + <version>2.0.0-SNAPSHOT</version> <name>scm-test</name> <dependencies> @@ -50,7 +50,7 @@ <dependency> <groupId>sonia.scm</groupId> <artifactId>scm-core</artifactId> - <version>2.1.0-SNAPSHOT</version> + <version>2.0.0-SNAPSHOT</version> </dependency> <dependency> diff --git a/scm-ui/babel-preset/package.json b/scm-ui/babel-preset/package.json index 7729155741..cb0ea1ac52 100644 --- a/scm-ui/babel-preset/package.json +++ b/scm-ui/babel-preset/package.json @@ -1,6 +1,6 @@ { "name": "@scm-manager/babel-preset", - "version": "2.0.0-rc6", + "version": "2.0.0-SNAPSHOT", "license": "MIT", "description": "Babel configuration for scm-manager and its plugins", "main": "index.js", diff --git a/scm-ui/eslint-config/package.json b/scm-ui/eslint-config/package.json index 93adbb09ce..ec7216fe5b 100644 --- a/scm-ui/eslint-config/package.json +++ b/scm-ui/eslint-config/package.json @@ -1,6 +1,6 @@ { "name": "@scm-manager/eslint-config", - "version": "2.0.0-rc6", + "version": "2.0.0-SNAPSHOT", "description": "ESLint configuration for scm-manager and its plugins", "main": "index.js", "author": "Sebastian Sdorra <s.sdorra@gmail.com>", diff --git a/scm-ui/jest-preset/package.json b/scm-ui/jest-preset/package.json index c183f4b44d..4384226cd9 100644 --- a/scm-ui/jest-preset/package.json +++ b/scm-ui/jest-preset/package.json @@ -1,6 +1,6 @@ { "name": "@scm-manager/jest-preset", - "version": "2.0.0-rc6", + "version": "2.0.0-SNAPSHOT", "description": "Jest presets for SCM-Manager and its plugins", "main": "src/index.js", "author": "Sebastian Sdorra <sebastian.sdorra@cloudogu.com>", diff --git a/scm-ui/pom.xml b/scm-ui/pom.xml index ee9f40bd70..f4d64a9951 100644 --- a/scm-ui/pom.xml +++ b/scm-ui/pom.xml @@ -32,13 +32,13 @@ <parent> <groupId>sonia.scm</groupId> <artifactId>scm</artifactId> - <version>2.1.0-SNAPSHOT</version> + <version>2.0.0-SNAPSHOT</version> </parent> <groupId>sonia.scm</groupId> <artifactId>scm-ui</artifactId> <packaging>war</packaging> - <version>2.1.0-SNAPSHOT</version> + <version>2.0.0-SNAPSHOT</version> <name>scm-ui</name> <properties> diff --git a/scm-ui/prettier-config/package.json b/scm-ui/prettier-config/package.json index c11eee307c..5c5fce4869 100644 --- a/scm-ui/prettier-config/package.json +++ b/scm-ui/prettier-config/package.json @@ -1,6 +1,6 @@ { "name": "@scm-manager/prettier-config", - "version": "2.0.0-rc6", + "version": "2.0.0-SNAPSHOT", "license": "MIT", "description": "Prettier configuration", "author": "Sebastian Sdorra <sebastian.sdorra@cloudogu.com>", diff --git a/scm-ui/tsconfig/package.json b/scm-ui/tsconfig/package.json index 0de4ab9817..9595f56444 100644 --- a/scm-ui/tsconfig/package.json +++ b/scm-ui/tsconfig/package.json @@ -1,6 +1,6 @@ { "name": "@scm-manager/tsconfig", - "version": "2.0.0-rc6", + "version": "2.0.0-SNAPSHOT", "license": "MIT", "description": "TypeScript configuration", "author": "Sebastian Sdorra <sebastian.sdorra@cloudogu.com>", diff --git a/scm-ui/ui-components/package.json b/scm-ui/ui-components/package.json index 22dc41f132..8900a701e3 100644 --- a/scm-ui/ui-components/package.json +++ b/scm-ui/ui-components/package.json @@ -1,6 +1,6 @@ { "name": "@scm-manager/ui-components", - "version": "2.0.0-rc6", + "version": "2.0.0-SNAPSHOT", "description": "UI Components for SCM-Manager and its plugins", "main": "src/index.ts", "files": [ @@ -18,7 +18,7 @@ "update-storyshots": "jest --testPathPattern=\"storyshots.test.ts\" --collectCoverage=false -u" }, "devDependencies": { - "@scm-manager/ui-tests": "^2.0.0-rc6", + "@scm-manager/ui-tests": "^2.0.0-SNAPSHOT", "@storybook/addon-actions": "^5.2.3", "@storybook/addon-storyshots": "^5.2.3", "@storybook/react": "^5.2.3", @@ -46,8 +46,8 @@ "worker-plugin": "^3.2.0" }, "dependencies": { - "@scm-manager/ui-extensions": "^2.0.0-rc6", - "@scm-manager/ui-types": "^2.0.0-rc6", + "@scm-manager/ui-extensions": "^2.0.0-SNAPSHOT", + "@scm-manager/ui-types": "^2.0.0-SNAPSHOT", "classnames": "^2.2.6", "date-fns": "^2.4.1", "gitdiff-parser": "^0.1.2", diff --git a/scm-ui/ui-extensions/package.json b/scm-ui/ui-extensions/package.json index bfbb056bc2..a652c703f7 100644 --- a/scm-ui/ui-extensions/package.json +++ b/scm-ui/ui-extensions/package.json @@ -1,6 +1,6 @@ { "name": "@scm-manager/ui-extensions", - "version": "2.0.0-rc6", + "version": "2.0.0-SNAPSHOT", "main": "src/index.ts", "license": "MIT", "private": false, diff --git a/scm-ui/ui-plugins/package.json b/scm-ui/ui-plugins/package.json index 3a7b886a03..b88637e3f5 100644 --- a/scm-ui/ui-plugins/package.json +++ b/scm-ui/ui-plugins/package.json @@ -1,13 +1,13 @@ { "name": "@scm-manager/ui-plugins", - "version": "2.0.0-rc6", + "version": "2.0.0-SNAPSHOT", "license": "MIT", "bin": { "ui-plugins": "./bin/ui-plugins.js" }, "dependencies": { - "@scm-manager/ui-components": "^2.0.0-rc6", - "@scm-manager/ui-extensions": "^2.0.0-rc6", + "@scm-manager/ui-components": "^2.0.0-SNAPSHOT", + "@scm-manager/ui-extensions": "^2.0.0-SNAPSHOT", "classnames": "^2.2.6", "query-string": "^5.0.1", "react": "^16.10.2", @@ -18,14 +18,14 @@ "styled-components": "^4.4.0" }, "devDependencies": { - "@scm-manager/babel-preset": "^2.0.0-rc6", - "@scm-manager/eslint-config": "^2.0.0-rc6", - "@scm-manager/jest-preset": "^2.0.0-rc6", - "@scm-manager/prettier-config": "^2.0.0-rc6", - "@scm-manager/tsconfig": "^2.0.0-rc6", - "@scm-manager/ui-scripts": "^2.0.0-rc6", - "@scm-manager/ui-tests": "^2.0.0-rc6", - "@scm-manager/ui-types": "^2.0.0-rc6", + "@scm-manager/babel-preset": "^2.0.0-SNAPSHOT", + "@scm-manager/eslint-config": "^2.0.0-SNAPSHOT", + "@scm-manager/jest-preset": "^2.0.0-SNAPSHOT", + "@scm-manager/prettier-config": "^2.0.0-SNAPSHOT", + "@scm-manager/tsconfig": "^2.0.0-SNAPSHOT", + "@scm-manager/ui-scripts": "^2.0.0-SNAPSHOT", + "@scm-manager/ui-tests": "^2.0.0-SNAPSHOT", + "@scm-manager/ui-types": "^2.0.0-SNAPSHOT", "@types/classnames": "^2.2.9", "@types/enzyme": "^3.10.3", "@types/fetch-mock": "^7.3.1", diff --git a/scm-ui/ui-polyfill/package.json b/scm-ui/ui-polyfill/package.json index b60b131c22..8beb8d5836 100644 --- a/scm-ui/ui-polyfill/package.json +++ b/scm-ui/ui-polyfill/package.json @@ -1,6 +1,6 @@ { "name": "@scm-manager/ui-polyfill", - "version": "2.0.0-rc6", + "version": "2.0.0-SNAPSHOT", "description": "Polyfills for SCM-Manager UI", "main": "src/index.js", "author": "Sebastian Sdorra <sebastian.sdorra@cloudogu.com>", diff --git a/scm-ui/ui-scripts/package.json b/scm-ui/ui-scripts/package.json index 495d69aaca..25f5b25023 100644 --- a/scm-ui/ui-scripts/package.json +++ b/scm-ui/ui-scripts/package.json @@ -1,6 +1,6 @@ { "name": "@scm-manager/ui-scripts", - "version": "2.0.0-rc6", + "version": "2.0.0-SNAPSHOT", "description": "Build scripts for SCM-Manager", "main": "src/index.js", "author": "Sebastian Sdorra <sebastian.sdorra@cloudogu.com>", diff --git a/scm-ui/ui-styles/package.json b/scm-ui/ui-styles/package.json index 4af4cb4ce3..15ca4c1ec4 100644 --- a/scm-ui/ui-styles/package.json +++ b/scm-ui/ui-styles/package.json @@ -1,6 +1,6 @@ { "name": "@scm-manager/ui-styles", - "version": "2.0.0-rc6", + "version": "2.0.0-SNAPSHOT", "description": "Styles for SCM-Manager", "main": "src/scm.scss", "license": "MIT", diff --git a/scm-ui/ui-tests/package.json b/scm-ui/ui-tests/package.json index 5780ae9cdb..be53c4164d 100644 --- a/scm-ui/ui-tests/package.json +++ b/scm-ui/ui-tests/package.json @@ -1,6 +1,6 @@ { "name": "@scm-manager/ui-tests", - "version": "2.0.0-rc6", + "version": "2.0.0-SNAPSHOT", "description": "UI-Tests helpers", "author": "Sebastian Sdorra <sebastian.sdorra@cloudogu.com>", "license": "MIT", diff --git a/scm-ui/ui-types/package.json b/scm-ui/ui-types/package.json index dda4634dad..a366ad3a1b 100644 --- a/scm-ui/ui-types/package.json +++ b/scm-ui/ui-types/package.json @@ -1,6 +1,6 @@ { "name": "@scm-manager/ui-types", - "version": "2.0.0-rc6", + "version": "2.0.0-SNAPSHOT", "description": "Flow types for SCM-Manager related Objects", "main": "src/index.ts", "files": [ diff --git a/scm-ui/ui-webapp/package.json b/scm-ui/ui-webapp/package.json index 77aa338be4..ba54fb7689 100644 --- a/scm-ui/ui-webapp/package.json +++ b/scm-ui/ui-webapp/package.json @@ -1,10 +1,10 @@ { "name": "@scm-manager/ui-webapp", - "version": "2.0.0-rc6", + "version": "2.0.0-SNAPSHOT", "private": true, "dependencies": { - "@scm-manager/ui-components": "^2.0.0-rc6", - "@scm-manager/ui-extensions": "^2.0.0-rc6", + "@scm-manager/ui-components": "^2.0.0-SNAPSHOT", + "@scm-manager/ui-extensions": "^2.0.0-SNAPSHOT", "classnames": "^2.2.5", "history": "^4.10.1", "i18next": "^17.3.0", @@ -29,7 +29,7 @@ "test": "jest" }, "devDependencies": { - "@scm-manager/ui-tests": "^2.0.0-rc6", + "@scm-manager/ui-tests": "^2.0.0-SNAPSHOT", "@types/classnames": "^2.2.9", "@types/enzyme": "^3.10.3", "@types/fetch-mock": "^7.3.1", diff --git a/scm-webapp/pom.xml b/scm-webapp/pom.xml index 78a87ea0be..24ba16333a 100644 --- a/scm-webapp/pom.xml +++ b/scm-webapp/pom.xml @@ -31,13 +31,13 @@ <parent> <groupId>sonia.scm</groupId> <artifactId>scm</artifactId> - <version>2.1.0-SNAPSHOT</version> + <version>2.0.0-SNAPSHOT</version> </parent> <groupId>sonia.scm</groupId> <artifactId>scm-webapp</artifactId> <packaging>war</packaging> - <version>2.1.0-SNAPSHOT</version> + <version>2.0.0-SNAPSHOT</version> <name>scm-webapp</name> <dependencies> @@ -47,7 +47,7 @@ <dependency> <groupId>sonia.scm</groupId> <artifactId>scm-annotation-processor</artifactId> - <version>2.1.0-SNAPSHOT</version> + <version>2.0.0-SNAPSHOT</version> <scope>provided</scope> </dependency> @@ -72,13 +72,13 @@ <dependency> <groupId>sonia.scm</groupId> <artifactId>scm-core</artifactId> - <version>2.1.0-SNAPSHOT</version> + <version>2.0.0-SNAPSHOT</version> </dependency> <dependency> <groupId>sonia.scm</groupId> <artifactId>scm-dao-xml</artifactId> - <version>2.1.0-SNAPSHOT</version> + <version>2.0.0-SNAPSHOT</version> </dependency> <!-- security --> @@ -331,7 +331,7 @@ <dependency> <groupId>sonia.scm</groupId> <artifactId>scm-test</artifactId> - <version>2.1.0-SNAPSHOT</version> + <version>2.0.0-SNAPSHOT</version> <scope>test</scope> <exclusions> <exclusion> @@ -393,7 +393,7 @@ <dependency> <groupId>sonia.scm.plugins</groupId> <artifactId>scm-git-plugin</artifactId> - <version>2.1.0-SNAPSHOT</version> + <version>2.0.0-SNAPSHOT</version> <classifier>tests</classifier> <scope>test</scope> </dependency> @@ -401,14 +401,14 @@ <dependency> <groupId>sonia.scm.plugins</groupId> <artifactId>scm-git-plugin</artifactId> - <version>2.1.0-SNAPSHOT</version> + <version>2.0.0-SNAPSHOT</version> <scope>test</scope> </dependency> <dependency> <groupId>sonia.scm.plugins</groupId> <artifactId>scm-hg-plugin</artifactId> - <version>2.1.0-SNAPSHOT</version> + <version>2.0.0-SNAPSHOT</version> <classifier>tests</classifier> <scope>test</scope> </dependency> @@ -416,14 +416,14 @@ <dependency> <groupId>sonia.scm.plugins</groupId> <artifactId>scm-hg-plugin</artifactId> - <version>2.1.0-SNAPSHOT</version> + <version>2.0.0-SNAPSHOT</version> <scope>test</scope> </dependency> <dependency> <groupId>sonia.scm.plugins</groupId> <artifactId>scm-svn-plugin</artifactId> - <version>2.1.0-SNAPSHOT</version> + <version>2.0.0-SNAPSHOT</version> <classifier>tests</classifier> <scope>test</scope> </dependency> @@ -431,7 +431,7 @@ <dependency> <groupId>sonia.scm.plugins</groupId> <artifactId>scm-svn-plugin</artifactId> - <version>2.1.0-SNAPSHOT</version> + <version>2.0.0-SNAPSHOT</version> <scope>test</scope> </dependency> @@ -704,7 +704,7 @@ <dependency> <groupId>sonia.scm</groupId> <artifactId>scm-ui</artifactId> - <version>2.1.0-SNAPSHOT</version> + <version>2.0.0-SNAPSHOT</version> <type>war</type> </dependency> From a314873819950a9cb37aea44f5bd5ff7934eaf43 Mon Sep 17 00:00:00 2001 From: Sebastian Sdorra <sebastian.sdorra@cloudogu.com> Date: Fri, 27 Mar 2020 07:17:35 +0100 Subject: [PATCH 24/44] fixed wrong location of shebang in ui-plugins --- scm-ui/ui-plugins/bin/ui-plugins.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scm-ui/ui-plugins/bin/ui-plugins.js b/scm-ui/ui-plugins/bin/ui-plugins.js index 5789a92036..86de15d063 100755 --- a/scm-ui/ui-plugins/bin/ui-plugins.js +++ b/scm-ui/ui-plugins/bin/ui-plugins.js @@ -1,3 +1,4 @@ +#!/usr/bin/env node /* * MIT License * @@ -21,7 +22,7 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ -#!/usr/bin/env node + /* eslint-disable no-console */ const { spawnSync } = require("child_process"); From 0c7aebb1ef0d1c6e0260ae9a1c8cb5fce4eb6867 Mon Sep 17 00:00:00 2001 From: Sebastian Sdorra <sebastian.sdorra@cloudogu.com> Date: Fri, 27 Mar 2020 12:17:20 +0100 Subject: [PATCH 25/44] fixed storyshot test which renders a DateFromNow without baseDate --- .../src/repos/RepositoryEntry.stories.tsx | 30 ++++++++++--------- .../src/repos/RepositoryEntry.tsx | 13 +++++--- 2 files changed, 25 insertions(+), 18 deletions(-) diff --git a/scm-ui/ui-components/src/repos/RepositoryEntry.stories.tsx b/scm-ui/ui-components/src/repos/RepositoryEntry.stories.tsx index f8b9994fd0..22979c631b 100644 --- a/scm-ui/ui-components/src/repos/RepositoryEntry.stories.tsx +++ b/scm-ui/ui-components/src/repos/RepositoryEntry.stories.tsx @@ -21,30 +21,29 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ -import {storiesOf} from "@storybook/react"; -import React, {FC, ReactNode} from "react"; +import { storiesOf } from "@storybook/react"; +import React, { FC, ReactNode } from "react"; import styled from "styled-components"; import repository from "../__resources__/repository"; // @ts-ignore ignore unknown png import Git from "../__resources__/git-logo.png"; import RepositoryEntry from "./RepositoryEntry"; -import {Binder, BinderContext} from "@scm-manager/ui-extensions"; -import {Repository} from "@scm-manager/ui-types"; +import { Binder, BinderContext } from "@scm-manager/ui-extensions"; +import { Repository } from "@scm-manager/ui-types"; import Image from "../Image"; -import classNames from "classnames"; import Icon from "../Icon"; +const baseDate = "2020-03-26T12:13:42+02:00"; + const Spacing = styled.div` margin: 2rem; `; -const Container: FC = ({children}) => ( - <Spacing className="box box-link-shadow">{children}</Spacing> -); +const Container: FC = ({ children }) => <Spacing className="box box-link-shadow">{children}</Spacing>; const bindAvatar = (binder: Binder, avatar: string) => { binder.bind("repos.repository-avatar", () => { - return <Image src={avatar} alt="Logo"/>; + return <Image src={avatar} alt="Logo" />; }); }; @@ -63,18 +62,21 @@ const bindQuickLink = (binder: Binder, extension: ReactNode) => { const withBinder = (binder: Binder, repository: Repository) => { return ( <BinderContext.Provider value={binder}> - <RepositoryEntry repository={repository}/> + <RepositoryEntry repository={repository} baseDate={baseDate} /> </BinderContext.Provider> ); }; -const QuickLink = <a className="level-item"><Icon className="fa-lg" name="fas fa-code-branch fa-rotate-180 fa-fw" - color="inherit"/></a>; +const QuickLink = ( + <a className="level-item"> + <Icon className="fa-lg" name="fas fa-code-branch fa-rotate-180 fa-fw" color="inherit" /> + </a> +); storiesOf("RepositoryEntry", module) .addDecorator(storyFn => <Container>{storyFn()}</Container>) .add("Default", () => { - return <RepositoryEntry repository={repository}/>; + return <RepositoryEntry repository={repository} baseDate={baseDate} />; }) .add("Avatar EP", () => { const binder = new Binder("avatar"); @@ -83,7 +85,7 @@ storiesOf("RepositoryEntry", module) }) .add("Before Title EP", () => { const binder = new Binder("title"); - bindBeforeTitle(binder, <i className="fas fa-star"/>); + bindBeforeTitle(binder, <i className="fas fa-star" />); return withBinder(binder, repository); }) .add("Quick Link EP", () => { diff --git a/scm-ui/ui-components/src/repos/RepositoryEntry.tsx b/scm-ui/ui-components/src/repos/RepositoryEntry.tsx index 8bd29309aa..80722eecfb 100644 --- a/scm-ui/ui-components/src/repos/RepositoryEntry.tsx +++ b/scm-ui/ui-components/src/repos/RepositoryEntry.tsx @@ -28,8 +28,13 @@ import RepositoryEntryLink from "./RepositoryEntryLink"; import RepositoryAvatar from "./RepositoryAvatar"; import { ExtensionPoint } from "@scm-manager/ui-extensions"; +type DateProp = Date | string; + type Props = { repository: Repository; + // @VisibleForTesting + // the baseDate is only to avoid failing snapshot tests + baseDate?: DateProp; }; class RepositoryEntry extends React.Component<Props> { @@ -77,10 +82,10 @@ class RepositoryEntry extends React.Component<Props> { ); }; - createFooterRight = (repository: Repository) => { + createFooterRight = (repository: Repository, baseDate?: DateProp) => { return ( <small className="level-item"> - <DateFromNow date={repository.creationDate} /> + <DateFromNow baseDate={baseDate} date={repository.creationDate} /> </small> ); }; @@ -95,10 +100,10 @@ class RepositoryEntry extends React.Component<Props> { }; render() { - const { repository } = this.props; + const { repository, baseDate } = this.props; const repositoryLink = this.createLink(repository); const footerLeft = this.createFooterLeft(repository, repositoryLink); - const footerRight = this.createFooterRight(repository); + const footerRight = this.createFooterRight(repository, baseDate); const title = this.createTitle(); return ( <CardColumn From 0ee2aaaa45000a7f14e6e5eaa2b9be4bd73ba0bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Pfeuffer?= <rene.pfeuffer@cloudogu.com> Date: Mon, 30 Mar 2020 12:28:57 +0200 Subject: [PATCH 26/44] Fix authentication for repositories with anonymous read access Repositories with anonymous read access could not be written any more, because for write requests there was no authentication request. This fixes the check for anonymous access and requests username and password, again. --- CHANGELOG.md | 4 ++++ .../java/sonia/scm/web/filter/PermissionFilter.java | 6 +++--- .../sonia/scm/web/filter/PermissionFilterTest.java | 13 ++++++++++++- scm-core/src/test/resources/sonia/scm/shiro.ini | 1 + 4 files changed, 20 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f6ce1222f5..846b69b283 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 +### Fixed +- Authentication for write requests for repositories with anonymous read access ([#108](https://github.com/scm-manager/scm-manager/pull/1081)) + ## 2.0.0-rc6 - 2020-03-26 ### Added - Extension point to add links to the repository cards from plug ins ([#1041](https://github.com/scm-manager/scm-manager/pull/1041)) diff --git a/scm-core/src/main/java/sonia/scm/web/filter/PermissionFilter.java b/scm-core/src/main/java/sonia/scm/web/filter/PermissionFilter.java index a254edcb41..9cfa95c1d5 100644 --- a/scm-core/src/main/java/sonia/scm/web/filter/PermissionFilter.java +++ b/scm-core/src/main/java/sonia/scm/web/filter/PermissionFilter.java @@ -21,7 +21,7 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ - + package sonia.scm.web.filter; import org.apache.shiro.SecurityUtils; @@ -35,7 +35,7 @@ import sonia.scm.repository.Repository; import sonia.scm.repository.RepositoryPermissions; import sonia.scm.repository.spi.ScmProviderHttpServlet; import sonia.scm.repository.spi.ScmProviderHttpServletDecorator; -import sonia.scm.security.Role; +import sonia.scm.security.Authentications; import sonia.scm.security.ScmSecurityException; import sonia.scm.util.HttpUtil; @@ -177,7 +177,7 @@ public abstract class PermissionFilter extends ScmProviderHttpServletDecorator HttpServletResponse response, Subject subject) throws IOException { - if (subject.hasRole(Role.USER)) + if (!Authentications.isAuthenticatedSubjectAnonymous()) { sendNotEnoughPrivilegesError(request, response); } diff --git a/scm-core/src/test/java/sonia/scm/web/filter/PermissionFilterTest.java b/scm-core/src/test/java/sonia/scm/web/filter/PermissionFilterTest.java index ad21e501e7..5ba99bd2f1 100644 --- a/scm-core/src/test/java/sonia/scm/web/filter/PermissionFilterTest.java +++ b/scm-core/src/test/java/sonia/scm/web/filter/PermissionFilterTest.java @@ -21,7 +21,7 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ - + package sonia.scm.web.filter; import com.github.sdorra.shiro.ShiroRule; @@ -82,6 +82,17 @@ public class PermissionFilterTest { permissionFilter.service(request, response, REPOSITORY); + verify(response).sendError(eq(403)); + verify(delegateServlet, never()).service(request, response, REPOSITORY); + } + + @Test + @SubjectAware(username = "_anonymous", password = "secret") + public void shouldBlockForAnonymousOnWriteRequestWithAuthenticationRequest() throws IOException, ServletException { + writeRequest = true; + + permissionFilter.service(request, response, REPOSITORY); + verify(response).sendError(eq(401), anyString()); verify(delegateServlet, never()).service(request, response, REPOSITORY); } diff --git a/scm-core/src/test/resources/sonia/scm/shiro.ini b/scm-core/src/test/resources/sonia/scm/shiro.ini index fda268ec83..4bd34d3a41 100644 --- a/scm-core/src/test/resources/sonia/scm/shiro.ini +++ b/scm-core/src/test/resources/sonia/scm/shiro.ini @@ -4,6 +4,7 @@ admin = secret, admin writer = secret, repo_write reader = secret, repo_read unpriv = secret +_anonymous = secret [roles] admin = * From 2ab2079e075933f9d1094546118cd9d3f42558be Mon Sep 17 00:00:00 2001 From: Sebastian Sdorra <sebastian.sdorra@cloudogu.com> Date: Mon, 30 Mar 2020 15:00:30 +0200 Subject: [PATCH 27/44] prop transformer and binding of react elements The ExtensionPoint component supports now the transformation of instance props and allows binding of already instantiated react components (Foo vs <Foo />). --- .../ui-extensions/src/ExtensionPoint.test.tsx | 42 ++++++++++++++++ scm-ui/ui-extensions/src/ExtensionPoint.tsx | 50 ++++++++++++++----- 2 files changed, 79 insertions(+), 13 deletions(-) diff --git a/scm-ui/ui-extensions/src/ExtensionPoint.test.tsx b/scm-ui/ui-extensions/src/ExtensionPoint.test.tsx index 3078c4c4d9..0b39817186 100644 --- a/scm-ui/ui-extensions/src/ExtensionPoint.test.tsx +++ b/scm-ui/ui-extensions/src/ExtensionPoint.test.tsx @@ -168,4 +168,46 @@ describe("ExtensionPoint test", () => { const text = rendered.text(); expect(text).toBe(""); }); + + it("should render an instance", () => { + const Label = () => { + return <label>Extension One</label>; + }; + + mockedBinder.hasExtension.mockReturnValue(true); + mockedBinder.getExtension.mockReturnValue(<Label />); + + const rendered = mount(<ExtensionPoint name="something.special" />); + expect(rendered.text()).toBe("Extension One"); + }); + + it("should render an instance with props", () => { + const Label = ({name}: {name: string}) => { + return <label>Extension {name}</label>; + }; + + mockedBinder.hasExtension.mockReturnValue(true); + mockedBinder.getExtension.mockReturnValue(<Label name="One" />); + + const rendered = mount(<ExtensionPoint name="something.special" props={{name: "Two"}} />); + expect(rendered.text()).toBe("Extension Two"); + }); + + it("should transform extension, before render", () => { + const label = ({name = "One"}: {name: string}) => { + return <label>Extension {name}</label>; + }; + mockedBinder.hasExtension.mockReturnValue(true); + mockedBinder.getExtension.mockReturnValue(label); + + const transformer = (props: object) => { + return { + ...props, + name: "Two" + } + }; + + const rendered = mount(<ExtensionPoint name="something.special" propTransformer={transformer} />); + expect(rendered.text()).toBe("Extension Two"); + }) }); diff --git a/scm-ui/ui-extensions/src/ExtensionPoint.tsx b/scm-ui/ui-extensions/src/ExtensionPoint.tsx index 0eb75509b1..aad9ca7b09 100644 --- a/scm-ui/ui-extensions/src/ExtensionPoint.tsx +++ b/scm-ui/ui-extensions/src/ExtensionPoint.tsx @@ -23,32 +23,44 @@ */ import * as React from "react"; import { Binder } from "./binder"; -import { FC, ReactNode } from "react"; +import {Component, FC, ReactNode} from "react"; import useBinder from "./useBinder"; +type PropTransformer = (props: object) => object; + type Props = { name: string; renderAll?: boolean; props?: object; + propTransformer?: PropTransformer; }; -const renderAllExtensions = (binder: Binder, name: string, props?: object) => { +const createInstance = (Component: any, props: object, key?: number) => { + const instanceProps = { + ...props, + key + }; + if (React.isValidElement(Component)) { + return React.cloneElement(Component, instanceProps); + } + return <Component {...instanceProps} />; +}; + +const renderAllExtensions = (binder: Binder, name: string, props: object) => { const extensions = binder.getExtensions(name, props); return ( <> - {extensions.map((Component, index) => { - return <Component key={index} {...props} />; - })} + {extensions.map((cmp, index) => createInstance(cmp, props, index))} </> ); }; -const renderSingleExtension = (binder: Binder, name: string, props?: object) => { - const Component = binder.getExtension(name, props); - if (!Component) { +const renderSingleExtension = (binder: Binder, name: string, props: object) => { + const cmp = binder.getExtension(name, props); + if (!cmp) { return null; } - return <Component {...props} />; + return createInstance(cmp, props, undefined); }; const renderDefault = (children: ReactNode) => { @@ -58,17 +70,29 @@ const renderDefault = (children: ReactNode) => { return null; }; +const createRenderProps = (propTransformer?: PropTransformer, props?: object) => { + const transform = (props: object) => { + if (!propTransformer) { + return props; + } + return propTransformer(props); + }; + + return transform(props || {}); +}; + /** * ExtensionPoint renders components which are bound to an extension point. */ -const ExtensionPoint: FC<Props> = ({ name, renderAll, props, children }) => { +const ExtensionPoint: FC<Props> = ({ name, propTransformer, props, renderAll, children }) => { const binder = useBinder(); - if (!binder.hasExtension(name, props)) { + const renderProps = createRenderProps(propTransformer, props); + if (!binder.hasExtension(name, renderProps)) { return renderDefault(children); } else if (renderAll) { - return renderAllExtensions(binder, name, props); + return renderAllExtensions(binder, name, renderProps); } - return renderSingleExtension(binder, name, props); + return renderSingleExtension(binder, name, renderProps); }; export default ExtensionPoint; From 23f4c3cba97446c9dc4519181d6b28e5dacdbec3 Mon Sep 17 00:00:00 2001 From: Sebastian Sdorra <sebastian.sdorra@cloudogu.com> Date: Mon, 30 Mar 2020 15:01:51 +0200 Subject: [PATCH 28/44] move router decorator into stories This makes it possible to define other routes that "/" inside each story. --- scm-ui/ui-components/.storybook/config.js | 3 --- scm-ui/ui-components/src/MarkdownView.stories.tsx | 2 ++ scm-ui/ui-components/src/buttons/index.stories.tsx | 2 ++ scm-ui/ui-components/src/layout/Footer.stories.tsx | 2 ++ scm-ui/ui-components/src/repos/RepositoryEntry.stories.tsx | 2 ++ 5 files changed, 8 insertions(+), 3 deletions(-) diff --git a/scm-ui/ui-components/.storybook/config.js b/scm-ui/ui-components/.storybook/config.js index bfaea0245c..ae409e6478 100644 --- a/scm-ui/ui-components/.storybook/config.js +++ b/scm-ui/ui-components/.storybook/config.js @@ -70,7 +70,4 @@ addDecorator( }) ); -const RoutingDecorator = (story) => <MemoryRouter initialEntries={["/"]}>{story()}</MemoryRouter>; -addDecorator(RoutingDecorator); - configure(require.context("../src", true, /\.stories\.tsx?$/), module); diff --git a/scm-ui/ui-components/src/MarkdownView.stories.tsx b/scm-ui/ui-components/src/MarkdownView.stories.tsx index 464efe42cc..6b49d10555 100644 --- a/scm-ui/ui-components/src/MarkdownView.stories.tsx +++ b/scm-ui/ui-components/src/MarkdownView.stories.tsx @@ -32,12 +32,14 @@ import MarkdownXmlCodeBlock from "./__resources__/markdown-xml-codeblock.md"; import MarkdownInlineXml from "./__resources__/markdown-inline-xml.md"; import Title from "./layout/Title"; import { Subtitle } from "./layout"; +import {MemoryRouter} from "react-router-dom"; const Spacing = styled.div` padding: 2em; `; storiesOf("MarkdownView", module) + .addDecorator(story => <MemoryRouter initialEntries={["/"]}>{story()}</MemoryRouter>) .addDecorator(story => <Spacing>{story()}</Spacing>) .add("Default", () => <MarkdownView content={TestPage} skipHtml={false} />) .add("Code without Lang", () => <MarkdownView content={MarkdownWithoutLang} skipHtml={false} />) diff --git a/scm-ui/ui-components/src/buttons/index.stories.tsx b/scm-ui/ui-components/src/buttons/index.stories.tsx index 9179cbb8a0..a0588b2dd4 100644 --- a/scm-ui/ui-components/src/buttons/index.stories.tsx +++ b/scm-ui/ui-components/src/buttons/index.stories.tsx @@ -32,6 +32,7 @@ import DownloadButton from "./DownloadButton"; import EditButton from "./EditButton"; import SubmitButton from "./SubmitButton"; import { ReactElement } from "react"; +import { MemoryRouter } from "react-router-dom"; const colors = ["primary", "link", "info", "success", "warning", "danger", "white", "light", "dark", "black", "text"]; @@ -42,6 +43,7 @@ const Spacing = styled.div` const SpacingDecorator = (story: () => ReactNode) => <Spacing>{story()}</Spacing>; storiesOf("Buttons|Button", module) + .addDecorator(story => <MemoryRouter initialEntries={["/"]}>{story()}</MemoryRouter>) .add("Colors", () => ( <div> {colors.map(color => ( diff --git a/scm-ui/ui-components/src/layout/Footer.stories.tsx b/scm-ui/ui-components/src/layout/Footer.stories.tsx index 02738f68c0..cae668ed19 100644 --- a/scm-ui/ui-components/src/layout/Footer.stories.tsx +++ b/scm-ui/ui-components/src/layout/Footer.stories.tsx @@ -33,6 +33,7 @@ import hitchhiker from "../__resources__/hitchhiker.png"; import marvin from "../__resources__/marvin.jpg"; import NavLink from "../navigation/NavLink"; import ExternalLink from "../navigation/ExternalLink"; +import {MemoryRouter} from "react-router-dom"; const trillian: Me = { name: "trillian", @@ -64,6 +65,7 @@ const withBinder = (binder: Binder) => { }; storiesOf("Layout|Footer", module) + .addDecorator(story => <MemoryRouter initialEntries={["/"]}>{story()}</MemoryRouter>) .add("Default", () => { return <Footer me={trillian} version="2.0.0" links={{}} />; }) diff --git a/scm-ui/ui-components/src/repos/RepositoryEntry.stories.tsx b/scm-ui/ui-components/src/repos/RepositoryEntry.stories.tsx index 22979c631b..250c4b18c7 100644 --- a/scm-ui/ui-components/src/repos/RepositoryEntry.stories.tsx +++ b/scm-ui/ui-components/src/repos/RepositoryEntry.stories.tsx @@ -32,6 +32,7 @@ import { Binder, BinderContext } from "@scm-manager/ui-extensions"; import { Repository } from "@scm-manager/ui-types"; import Image from "../Image"; import Icon from "../Icon"; +import {MemoryRouter} from "react-router-dom"; const baseDate = "2020-03-26T12:13:42+02:00"; @@ -74,6 +75,7 @@ const QuickLink = ( ); storiesOf("RepositoryEntry", module) + .addDecorator(story => <MemoryRouter initialEntries={["/"]}>{story()}</MemoryRouter>) .addDecorator(storyFn => <Container>{storyFn()}</Container>) .add("Default", () => { return <RepositoryEntry repository={repository} baseDate={baseDate} />; From daa272b4fc5578ff14e6ed6dca014e3f15b83e48 Mon Sep 17 00:00:00 2001 From: Sebastian Sdorra <sebastian.sdorra@cloudogu.com> Date: Mon, 30 Mar 2020 15:04:00 +0200 Subject: [PATCH 29/44] expand menu if SubNavigation is opened, even if it is inside an ExtensionPoint --- .../SecondaryNavigation.stories.tsx | 103 ++++++++++++++++++ .../src/navigation/SecondaryNavigation.tsx | 29 ++++- .../navigation/SecondaryNavigationItem.tsx | 42 ++----- scm-ui/ui-components/tsconfig.json | 8 +- 4 files changed, 144 insertions(+), 38 deletions(-) create mode 100644 scm-ui/ui-components/src/navigation/SecondaryNavigation.stories.tsx diff --git a/scm-ui/ui-components/src/navigation/SecondaryNavigation.stories.tsx b/scm-ui/ui-components/src/navigation/SecondaryNavigation.stories.tsx new file mode 100644 index 0000000000..f96909a8af --- /dev/null +++ b/scm-ui/ui-components/src/navigation/SecondaryNavigation.stories.tsx @@ -0,0 +1,103 @@ +/* + * 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 { storiesOf } from "@storybook/react"; +import React, { ReactElement } from "react"; +import SecondaryNavigation from "./SecondaryNavigation"; +import SecondaryNavigationItem from "./SecondaryNavigationItem"; +import styled from "styled-components"; +import SubNavigation from "./SubNavigation"; +import { Binder, ExtensionPoint, BinderContext } from "@scm-manager/ui-extensions"; +import { MemoryRouter } from "react-router-dom"; + +const Columns = styled.div` + margin: 2rem; +`; + +const starships = ( + <SubNavigation to="/hitchhiker/starships" label="Starships"> + <SecondaryNavigationItem + to="/hitchhiker/starships/heart-of-gold" + icon="fas fa-star" + label="Heart Of Gold" + title="Heart Of Gold" + /> + <SecondaryNavigationItem to="/hitchhiker/starships/titanic" label="Titanic" title="Starship Titanic" /> + </SubNavigation> +); + +const withRoute = (route: string) => { + return (story: ReactElement<any>) => <MemoryRouter initialEntries={[route]}>{story}</MemoryRouter>; +}; + +storiesOf("Navigation|Secondary", module) + .addDecorator(story => ( + <Columns className="columns"> + <div className="column is-3">{story()}</div> + </Columns> + )) + .add("Default", () => + withRoute("/")( + <SecondaryNavigation label="Hitchhiker" collapsed={false} onCollapse={() => {}}> + <SecondaryNavigationItem to="/" icon="fas fa-puzzle-piece" label="Puzzle 42" title="Puzzle 42" /> + <SecondaryNavigationItem to="/some" icon="fas fa-star" label="Heart Of Gold" title="Heart Of Gold" /> + </SecondaryNavigation> + ) + ) + .add("Collapsed", () => + withRoute("/")( + <SecondaryNavigation label="Hitchhiker" collapsed={true} onCollapse={() => {}}> + <SecondaryNavigationItem to="/" icon="fas fa-puzzle-piece" label="Puzzle 42" title="Puzzle 42" /> + <SecondaryNavigationItem to="/some" icon="fas fa-star" label="Heart Of Gold" title="Heart Of Gold" /> + </SecondaryNavigation> + ) + ) + .add("Sub Navigation", () => + withRoute("/")( + <SecondaryNavigation label="Hitchhiker" collapsed={false} onCollapse={() => {}}> + <SecondaryNavigationItem to="/42" icon="fas fa-puzzle-piece" label="Puzzle 42" title="Puzzle 42" /> + {starships} + </SecondaryNavigation> + ) + ) + .add("Sub Navigation Collapsed", () => + withRoute("/hitchhiker/starships/heart-of-gold")( + <SecondaryNavigation label="Hitchhiker" collapsed={true} onCollapse={() => {}}> + <SecondaryNavigationItem to="/42" icon="fas fa-puzzle-piece" label="Puzzle 42" title="Puzzle 42" /> + {starships} + </SecondaryNavigation> + ) + ) + .add("Collapsed EP Sub", () => { + const binder = new Binder("menu"); + binder.bind("subnav.sample", starships); + return withRoute("/hitchhiker/starships/titanic")( + <BinderContext.Provider value={binder}> + <SecondaryNavigation label="Hitchhiker" collapsed={true} onCollapse={() => {}}> + <SecondaryNavigationItem to="/42" icon="fas fa-puzzle-piece" label="Puzzle 42" title="Puzzle 42" /> + <ExtensionPoint name="subnav.sample" renderAll={true} /> + </SecondaryNavigation> + </BinderContext.Provider> + ); + }); diff --git a/scm-ui/ui-components/src/navigation/SecondaryNavigation.tsx b/scm-ui/ui-components/src/navigation/SecondaryNavigation.tsx index fd8e1dd3eb..b2465630a6 100644 --- a/scm-ui/ui-components/src/navigation/SecondaryNavigation.tsx +++ b/scm-ui/ui-components/src/navigation/SecondaryNavigation.tsx @@ -26,6 +26,7 @@ import styled from "styled-components"; import SubNavigation from "./SubNavigation"; import { matchPath, useLocation } from "react-router-dom"; import { isMenuCollapsed, MenuContext } from "./MenuContext"; +import { ExtensionPoint, Binder, useBinder } from "@scm-manager/ui-extensions"; type Props = { label: string; @@ -62,9 +63,10 @@ const MenuLabel = styled.p<CollapsedProps>` const SecondaryNavigation: FC<Props> = ({ label, children, collapsed, onCollapse }) => { const location = useLocation(); + const binder = useBinder(); const menuContext = useContext(MenuContext); - const subNavActive = isSubNavigationActive(children, location.pathname); + const subNavActive = isSubNavigationActive(binder, children, location.pathname); const isCollapsed = collapsed && !subNavActive; useEffect(() => { @@ -74,7 +76,16 @@ const SecondaryNavigation: FC<Props> = ({ label, children, collapsed, onCollapse }, [subNavActive]); const childrenWithProps = React.Children.map(children, (child: ReactElement) => - React.cloneElement(child, { collapsed: isCollapsed }) + React.cloneElement(child, { + collapsed: isCollapsed, + propTransformer: (props: object) => { + const np = { + ...props, + collapsed: isCollapsed + }; + return np; + } + }) ); const arrowIcon = isCollapsed ? <i className="fas fa-caret-down" /> : <i className="fas fa-caret-right" />; @@ -105,16 +116,22 @@ const createParentPath = (to: string) => { return parents.join("/"); }; -const isSubNavigationActive = (children: ReactNode, url: string): boolean => { +const isSubNavigationActive = (binder: Binder, children: ReactNode, url: string): boolean => { const childArray = React.Children.toArray(children); const match = childArray - .filter(child => { - // what about extension points? + .filter(React.isValidElement) + .flatMap(child => { // @ts-ignore + if (child.type.name === ExtensionPoint.name) { + // @ts-ignore + return binder.getExtensions(child.props.name, child.props.props); + } + return [child]; + }) + .filter(child => { return child.type.name === SubNavigation.name; }) .map(child => { - // @ts-ignore return child.props; }) .find(props => { diff --git a/scm-ui/ui-components/src/navigation/SecondaryNavigationItem.tsx b/scm-ui/ui-components/src/navigation/SecondaryNavigationItem.tsx index e35acdb386..6f846e426c 100644 --- a/scm-ui/ui-components/src/navigation/SecondaryNavigationItem.tsx +++ b/scm-ui/ui-components/src/navigation/SecondaryNavigationItem.tsx @@ -21,48 +21,28 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ -import React, { ReactElement, ReactNode } from "react"; +import React, { FC, ReactElement, ReactNode } from "react"; import { MenuContext } from "./MenuContext"; import SubNavigation from "./SubNavigation"; import NavLink from "./NavLink"; type Props = { to: string; - icon: string; + icon?: string; label: string; title: string; + collapsed?: boolean; activeWhenMatch?: (route: any) => boolean; activeOnlyWhenExact?: boolean; children?: ReactElement[]; }; -export default class SecondaryNavigationItem extends React.Component<Props> { - render() { - const { to, icon, label, title, activeWhenMatch, activeOnlyWhenExact, children } = this.props; - if (children) { - return ( - <MenuContext.Consumer> - {({ menuCollapsed }) => ( - <SubNavigation - to={to} - icon={icon} - label={label} - title={title} - activeWhenMatch={activeWhenMatch} - activeOnlyWhenExact={activeOnlyWhenExact} - collapsed={menuCollapsed} - > - {children} - </SubNavigation> - )} - </MenuContext.Consumer> - ); - } else { - return ( - <MenuContext.Consumer> - {({ menuCollapsed }) => <NavLink to={to} icon={icon} label={label} title={title} collapsed={menuCollapsed} />} - </MenuContext.Consumer> - ); - } +const SecondaryNavigationItem: FC<Props> = ({ children, ...props }) => { + if (children) { + return <SubNavigation {...props}>{children}</SubNavigation>; + } else { + return <NavLink {...props} />; } -} +}; + +export default SecondaryNavigationItem; diff --git a/scm-ui/ui-components/tsconfig.json b/scm-ui/ui-components/tsconfig.json index 7e3ee63a2d..450dc158b8 100644 --- a/scm-ui/ui-components/tsconfig.json +++ b/scm-ui/ui-components/tsconfig.json @@ -1,3 +1,9 @@ { - "extends": "@scm-manager/tsconfig" + "extends": "@scm-manager/tsconfig", + "compilerOptions": { + "lib": [ + "es2019", + "dom" + ] + } } From 3bd8534fd75a01fd7f7e6a6c4405926dba386381 Mon Sep 17 00:00:00 2001 From: Sebastian Sdorra <sebastian.sdorra@cloudogu.com> Date: Mon, 30 Mar 2020 15:08:38 +0200 Subject: [PATCH 30/44] fix broken button stories --- .../src/__snapshots__/storyshots.test.ts.snap | 341 ++++++++++++++++++ .../src/buttons/index.stories.tsx | 4 +- 2 files changed, 344 insertions(+), 1 deletion(-) 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 77aec20677..7078431b33 100644 --- a/scm-ui/ui-components/src/__snapshots__/storyshots.test.ts.snap +++ b/scm-ui/ui-components/src/__snapshots__/storyshots.test.ts.snap @@ -34188,6 +34188,347 @@ exports[`Storyshots MarkdownView Xml Code Block 1`] = ` </div> `; +exports[`Storyshots Navigation|Secondary Collapsed 1`] = ` +<div + className="SecondaryNavigationstories__Columns-fdxo4w-0 fJKROg columns" +> + <div + className="column is-3" + > + <aside + className="SecondaryNavigation__SectionContainer-sc-8p1rgi-0 bfoGdF menu" + > + <div> + <p + className="SecondaryNavigation__MenuLabel-sc-8p1rgi-2 ktrCnD menu-label" + onClick={[Function]} + > + <i + className="SecondaryNavigation__Icon-sc-8p1rgi-1 cqWEjA is-medium" + color="info" + > + <i + className="fas fa-caret-down" + /> + </i> + + </p> + <ul + className="menu-list" + > + <li + title="Puzzle 42" + > + <a + className="is-active has-text-centered" + href="/" + onClick={[Function]} + > + <i + className="fas fa-puzzle-piece fa-fw" + /> + + </a> + </li> + <li + title="Heart Of Gold" + > + <a + className="has-text-centered" + href="/some" + onClick={[Function]} + > + <i + className="fas fa-star fa-fw" + /> + + </a> + </li> + </ul> + </div> + </aside> + </div> +</div> +`; + +exports[`Storyshots Navigation|Secondary Collapsed EP Sub 1`] = ` +<div + className="SecondaryNavigationstories__Columns-fdxo4w-0 fJKROg columns" +> + <div + className="column is-3" + > + <aside + className="SecondaryNavigation__SectionContainer-sc-8p1rgi-0 bfoGdF menu" + > + <div> + <p + className="SecondaryNavigation__MenuLabel-sc-8p1rgi-2 bGijuJ menu-label" + > + Hitchhiker + </p> + <ul + className="menu-list" + > + <li> + <a + className="" + href="/42" + onClick={[Function]} + > + <i + className="fas fa-puzzle-piece fa-fw" + /> + + Puzzle 42 + </a> + </li> + <li> + <a + className="is-active" + href="/hitchhiker/starships" + onClick={[Function]} + > + <i + className="fas fa-cog fa-fw" + /> + + Starships + </a> + <ul + className="sub-menu" + > + <li> + <a + className="" + href="/hitchhiker/starships/heart-of-gold" + onClick={[Function]} + > + <i + className="fas fa-star fa-fw" + /> + + Heart Of Gold + </a> + </li> + <li> + <a + className="is-active" + href="/hitchhiker/starships/titanic" + onClick={[Function]} + > + Titanic + </a> + </li> + </ul> + </li> + </ul> + </div> + </aside> + </div> +</div> +`; + +exports[`Storyshots Navigation|Secondary Default 1`] = ` +<div + className="SecondaryNavigationstories__Columns-fdxo4w-0 fJKROg columns" +> + <div + className="column is-3" + > + <aside + className="SecondaryNavigation__SectionContainer-sc-8p1rgi-0 bfoGdF menu" + > + <div> + <p + className="SecondaryNavigation__MenuLabel-sc-8p1rgi-2 bGijuJ menu-label" + onClick={[Function]} + > + <i + className="SecondaryNavigation__Icon-sc-8p1rgi-1 SeoNL is-medium" + color="info" + > + <i + className="fas fa-caret-right" + /> + </i> + Hitchhiker + </p> + <ul + className="menu-list" + > + <li> + <a + className="is-active" + href="/" + onClick={[Function]} + > + <i + className="fas fa-puzzle-piece fa-fw" + /> + + Puzzle 42 + </a> + </li> + <li> + <a + className="" + href="/some" + onClick={[Function]} + > + <i + className="fas fa-star fa-fw" + /> + + Heart Of Gold + </a> + </li> + </ul> + </div> + </aside> + </div> +</div> +`; + +exports[`Storyshots Navigation|Secondary Sub Navigation 1`] = ` +<div + className="SecondaryNavigationstories__Columns-fdxo4w-0 fJKROg columns" +> + <div + className="column is-3" + > + <aside + className="SecondaryNavigation__SectionContainer-sc-8p1rgi-0 bfoGdF menu" + > + <div> + <p + className="SecondaryNavigation__MenuLabel-sc-8p1rgi-2 bGijuJ menu-label" + onClick={[Function]} + > + <i + className="SecondaryNavigation__Icon-sc-8p1rgi-1 SeoNL is-medium" + color="info" + > + <i + className="fas fa-caret-right" + /> + </i> + Hitchhiker + </p> + <ul + className="menu-list" + > + <li> + <a + className="" + href="/42" + onClick={[Function]} + > + <i + className="fas fa-puzzle-piece fa-fw" + /> + + Puzzle 42 + </a> + </li> + <li> + <a + className="" + href="/hitchhiker/starships" + onClick={[Function]} + > + <i + className="fas fa-cog fa-fw" + /> + + Starships + </a> + </li> + </ul> + </div> + </aside> + </div> +</div> +`; + +exports[`Storyshots Navigation|Secondary Sub Navigation Collapsed 1`] = ` +<div + className="SecondaryNavigationstories__Columns-fdxo4w-0 fJKROg columns" +> + <div + className="column is-3" + > + <aside + className="SecondaryNavigation__SectionContainer-sc-8p1rgi-0 bfoGdF menu" + > + <div> + <p + className="SecondaryNavigation__MenuLabel-sc-8p1rgi-2 bGijuJ menu-label" + > + Hitchhiker + </p> + <ul + className="menu-list" + > + <li> + <a + className="" + href="/42" + onClick={[Function]} + > + <i + className="fas fa-puzzle-piece fa-fw" + /> + + Puzzle 42 + </a> + </li> + <li> + <a + className="is-active" + href="/hitchhiker/starships" + onClick={[Function]} + > + <i + className="fas fa-cog fa-fw" + /> + + Starships + </a> + <ul + className="sub-menu" + > + <li> + <a + className="is-active" + href="/hitchhiker/starships/heart-of-gold" + onClick={[Function]} + > + <i + className="fas fa-star fa-fw" + /> + + Heart Of Gold + </a> + </li> + <li> + <a + className="" + href="/hitchhiker/starships/titanic" + onClick={[Function]} + > + Titanic + </a> + </li> + </ul> + </li> + </ul> + </div> + </aside> + </div> +</div> +`; + exports[`Storyshots RepositoryEntry Avatar EP 1`] = ` <div className="RepositoryEntrystories__Spacing-toppdg-0 khfzcK box box-link-shadow" diff --git a/scm-ui/ui-components/src/buttons/index.stories.tsx b/scm-ui/ui-components/src/buttons/index.stories.tsx index a0588b2dd4..4ce67b030e 100644 --- a/scm-ui/ui-components/src/buttons/index.stories.tsx +++ b/scm-ui/ui-components/src/buttons/index.stories.tsx @@ -41,9 +41,10 @@ const Spacing = styled.div` `; const SpacingDecorator = (story: () => ReactNode) => <Spacing>{story()}</Spacing>; +const RoutingDecorator = (story: () => ReactNode) => <MemoryRouter initialEntries={["/"]}>{story()}</MemoryRouter>; storiesOf("Buttons|Button", module) - .addDecorator(story => <MemoryRouter initialEntries={["/"]}>{story()}</MemoryRouter>) + .addDecorator(RoutingDecorator) .add("Colors", () => ( <div> {colors.map(color => ( @@ -72,6 +73,7 @@ storiesOf("Buttons|Button", module) const buttonStory = (name: string, storyFn: () => ReactElement) => { return storiesOf("Buttons|" + name, module) + .addDecorator(RoutingDecorator) .addDecorator(SpacingDecorator) .add("Default", storyFn); }; From 898eb9c7550548b7baded5090845d35db77bdab9 Mon Sep 17 00:00:00 2001 From: snyk-bot <snyk-bot@snyk.io> Date: Mon, 30 Mar 2020 22:15:56 +0000 Subject: [PATCH 31/44] fix: upgrade com.fasterxml.jackson.core:jackson-databind from 2.10.2 to 2.10.3 Snyk has created this PR to upgrade com.fasterxml.jackson.core:jackson-databind from 2.10.2 to 2.10.3. See this package in NPM: https://www.npmjs.com/package/com.fasterxml.jackson.core:jackson-databind See this project in Snyk: https://app.snyk.io/org/scm-manager/project/0397d943-538d-483e-9c87-a3f7e7665d7b?utm_source=github&utm_medium=upgrade-pr --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 2054116a65..6a56a1fd5a 100644 --- a/pom.xml +++ b/pom.xml @@ -912,7 +912,7 @@ <jaxrs.version>2.1.1</jaxrs.version> <resteasy.version>4.5.2.Final</resteasy.version> <jersey-client.version>1.19.4</jersey-client.version> - <jackson.version>2.10.2</jackson.version> + <jackson.version>2.10.3</jackson.version> <guice.version>4.2.2</guice.version> <jaxb.version>2.3.1</jaxb.version> <hibernate-validator.version>6.1.2.Final</hibernate-validator.version> @@ -944,7 +944,7 @@ <project.test.javaLevel>8</project.test.javaLevel> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <netbeans.hint.license>SCM-MIT</netbeans.hint.license> - <jdk.classifier /> + <jdk.classifier/> <org.mapstruct.version>1.3.1.Final</org.mapstruct.version> <!-- Sonar exclusions --> From 61f6b099ca31f8e56a56c3fc75af4ad08dd10c5a Mon Sep 17 00:00:00 2001 From: snyk-bot <snyk-bot@snyk.io> Date: Tue, 31 Mar 2020 04:41:39 +0000 Subject: [PATCH 32/44] fix: upgrade @pmmmwh/react-refresh-webpack-plugin from 0.1.3 to 0.2.0 Snyk has created this PR to upgrade @pmmmwh/react-refresh-webpack-plugin from 0.1.3 to 0.2.0. See this package in NPM: https://www.npmjs.com/package/@pmmmwh/react-refresh-webpack-plugin See this project in Snyk: https://app.snyk.io/org/scm-manager/project/e563ed8d-dedf-4b52-af75-5d89b1e70f44?utm_source=github&utm_medium=upgrade-pr --- scm-ui/ui-scripts/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scm-ui/ui-scripts/package.json b/scm-ui/ui-scripts/package.json index 8a26c95c41..d99b2209ae 100644 --- a/scm-ui/ui-scripts/package.json +++ b/scm-ui/ui-scripts/package.json @@ -10,7 +10,7 @@ "ui-scripts": "./bin/ui-scripts.js" }, "dependencies": { - "@pmmmwh/react-refresh-webpack-plugin": "^0.1.3", + "@pmmmwh/react-refresh-webpack-plugin": "^0.2.0", "babel-loader": "^8.0.6", "css-loader": "^3.2.0", "file-loader": "^4.2.0", From ca39a5b453669124b13397e85f3b2b8f8a1d03ee Mon Sep 17 00:00:00 2001 From: Sebastian Sdorra <sebastian.sdorra@cloudogu.com> Date: Tue, 31 Mar 2020 08:24:41 +0200 Subject: [PATCH 33/44] enable es2019 lib for all typescript modules --- scm-ui/tsconfig/tsconfig.json | 6 +++++- scm-ui/ui-components/tsconfig.json | 8 +------- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/scm-ui/tsconfig/tsconfig.json b/scm-ui/tsconfig/tsconfig.json index a2450080eb..1c3acc4351 100644 --- a/scm-ui/tsconfig/tsconfig.json +++ b/scm-ui/tsconfig/tsconfig.json @@ -59,6 +59,10 @@ /* Experimental Options */ // "experimentalDecorators": true, /* Enables experimental support for ES7 decorators. */ // "emitDecoratorMetadata": true, /* Enables experimental support for emitting type metadata for decorators. */ - "skipLibCheck": true + "skipLibCheck": true, + "lib": [ + "dom", + "es2019" + ] } } diff --git a/scm-ui/ui-components/tsconfig.json b/scm-ui/ui-components/tsconfig.json index 450dc158b8..7e3ee63a2d 100644 --- a/scm-ui/ui-components/tsconfig.json +++ b/scm-ui/ui-components/tsconfig.json @@ -1,9 +1,3 @@ { - "extends": "@scm-manager/tsconfig", - "compilerOptions": { - "lib": [ - "es2019", - "dom" - ] - } + "extends": "@scm-manager/tsconfig" } From 2821005d8cb8c92341b5f8171339d9bee28d95a9 Mon Sep 17 00:00:00 2001 From: Sebastian Sdorra <sebastian.sdorra@cloudogu.com> Date: Tue, 31 Mar 2020 08:26:01 +0200 Subject: [PATCH 34/44] handling collapse state in a more simple and consistence way --- .../src/navigation/ExternalLink.tsx | 2 + .../src/navigation/MenuContext.tsx | 73 +++++++++++++++ .../src/navigation/NavAction.tsx | 2 + .../ui-components/src/navigation/NavLink.tsx | 76 ++++++--------- .../src/navigation/Navigation.tsx | 2 + .../{MenuContext.ts => RoutingProps.ts} | 18 +--- .../SecondaryNavigation.stories.tsx | 30 ++---- .../src/navigation/SecondaryNavigation.tsx | 93 +++++++++---------- .../navigation/SecondaryNavigationItem.tsx | 15 +-- .../src/navigation/SubNavigation.tsx | 18 ++-- scm-ui/ui-components/src/navigation/index.ts | 2 +- 11 files changed, 178 insertions(+), 153 deletions(-) create mode 100644 scm-ui/ui-components/src/navigation/MenuContext.tsx rename scm-ui/ui-components/src/navigation/{MenuContext.ts => RoutingProps.ts} (73%) diff --git a/scm-ui/ui-components/src/navigation/ExternalLink.tsx b/scm-ui/ui-components/src/navigation/ExternalLink.tsx index a87b118ee3..1565f6fa79 100644 --- a/scm-ui/ui-components/src/navigation/ExternalLink.tsx +++ b/scm-ui/ui-components/src/navigation/ExternalLink.tsx @@ -30,6 +30,8 @@ type Props = { label: string; }; +// TODO is it used in the menu? should it use MenuContext for collapse state? + const ExternalLink: FC<Props> = ({ to, icon, label }) => { let showIcon; if (icon) { diff --git a/scm-ui/ui-components/src/navigation/MenuContext.tsx b/scm-ui/ui-components/src/navigation/MenuContext.tsx new file mode 100644 index 0000000000..01b28866d5 --- /dev/null +++ b/scm-ui/ui-components/src/navigation/MenuContext.tsx @@ -0,0 +1,73 @@ +/* + * MIT License + * + * Copyright (c) 2020-present Cloudogu GmbH and Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +import React, { FC, useContext, useState } from "react"; + +const MENU_COLLAPSED = "secondary-menu-collapsed"; + +export type MenuContext = { + isCollapsed: () => boolean; + setCollapsed: (collapsed: boolean) => void; +}; + +export const LocalStorageMenuContextProvider: FC = ({children}) => { + const [state, setState] = useState(localStorage.getItem(MENU_COLLAPSED) === "true"); + const context = { + isCollapsed() { + return state; + }, + setCollapsed(collapsed: boolean) { + localStorage.setItem(MENU_COLLAPSED, String(collapsed)); + setState(collapsed); + } + }; + + return <MenuContext.Provider value={context}>{children}</MenuContext.Provider>; +}; + +export const MenuContext = React.createContext<MenuContext>({ + isCollapsed() { + return false; + }, + setCollapsed() {} +}); + +export const StateMenuContextProvider: FC = ({children}) => { + const [collapsed, setCollapsed] = useState(false); + + const context = { + isCollapsed() { + return collapsed; + }, + setCollapsed + }; + + return <MenuContext.Provider value={context}>{children}</MenuContext.Provider>; +}; + +const useMenuContext = () => { + return useContext<MenuContext>(MenuContext); +}; + +export default useMenuContext; diff --git a/scm-ui/ui-components/src/navigation/NavAction.tsx b/scm-ui/ui-components/src/navigation/NavAction.tsx index dd350d1c71..394b30d961 100644 --- a/scm-ui/ui-components/src/navigation/NavAction.tsx +++ b/scm-ui/ui-components/src/navigation/NavAction.tsx @@ -29,6 +29,8 @@ type Props = { action: () => void; }; +// TODO is it used in the menu? should it use MenuContext for collapse state? + class NavAction extends React.Component<Props> { render() { const { label, icon, action } = this.props; diff --git a/scm-ui/ui-components/src/navigation/NavLink.tsx b/scm-ui/ui-components/src/navigation/NavLink.tsx index 7a527e5ab5..132590e7f6 100644 --- a/scm-ui/ui-components/src/navigation/NavLink.tsx +++ b/scm-ui/ui-components/src/navigation/NavLink.tsx @@ -23,60 +23,44 @@ */ import * as React from "react"; import classNames from "classnames"; -import { Link, Route } from "react-router-dom"; +import { Link, useRouteMatch } from "react-router-dom"; +import { RoutingProps } from "./RoutingProps"; +import { FC } from "react"; +import { useContext } from "react"; +import useMenuContext, { MenuContext } from "./MenuContext"; -// TODO mostly copy of PrimaryNavigationLink - -type Props = { - to: string; - icon?: string; +type Props = RoutingProps & { label: string; - activeOnlyWhenExact?: boolean; - activeWhenMatch?: (route: any) => boolean; - collapsed?: boolean; title?: string; + icon?: string; }; -class NavLink extends React.Component<Props> { - static defaultProps = { - activeOnlyWhenExact: true - }; +const NavLink: FC<Props> = ({ to, activeOnlyWhenExact, icon, label, title }) => { + const match = useRouteMatch({ + path: to, + exact: activeOnlyWhenExact + }); - isActive(route: any) { - const { activeWhenMatch } = this.props; - return route.match || (activeWhenMatch && activeWhenMatch(route)); - } + const context = useMenuContext(); + const collapsed = context.isCollapsed(); - renderLink = (route: any) => { - const { to, icon, label, collapsed, title } = this.props; - - let showIcon = null; - if (icon) { - showIcon = ( - <> - <i className={classNames(icon, "fa-fw")} />{" "} - </> - ); - } - - return ( - <li title={collapsed ? title : undefined}> - <Link - className={classNames(this.isActive(route) ? "is-active" : "", collapsed ? "has-text-centered" : "")} - to={to} - > - {showIcon} - {collapsed ? null : label} - </Link> - </li> + let showIcon = null; + if (icon) { + showIcon = ( + <> + <i className={classNames(icon, "fa-fw")} />{" "} + </> ); - }; - - render() { - const { to, activeOnlyWhenExact } = this.props; - - return <Route path={to} exact={activeOnlyWhenExact} children={this.renderLink} />; } -} + + return ( + <li title={collapsed ? title : undefined}> + <Link className={classNames(!!match ? "is-active" : "", collapsed ? "has-text-centered" : "")} to={to}> + {showIcon} + {collapsed ? null : label} + </Link> + </li> + ); +}; export default NavLink; diff --git a/scm-ui/ui-components/src/navigation/Navigation.tsx b/scm-ui/ui-components/src/navigation/Navigation.tsx index dc848b4d24..0ccd94e7f7 100644 --- a/scm-ui/ui-components/src/navigation/Navigation.tsx +++ b/scm-ui/ui-components/src/navigation/Navigation.tsx @@ -27,6 +27,8 @@ type Props = { children?: ReactNode; }; +// TODO it is used? + class Navigation extends React.Component<Props> { render() { return <aside className="menu">{this.props.children}</aside>; diff --git a/scm-ui/ui-components/src/navigation/MenuContext.ts b/scm-ui/ui-components/src/navigation/RoutingProps.ts similarity index 73% rename from scm-ui/ui-components/src/navigation/MenuContext.ts rename to scm-ui/ui-components/src/navigation/RoutingProps.ts index e2760da025..e34f62b97c 100644 --- a/scm-ui/ui-components/src/navigation/MenuContext.ts +++ b/scm-ui/ui-components/src/navigation/RoutingProps.ts @@ -22,18 +22,8 @@ * SOFTWARE. */ -import React from "react"; - -const MENU_COLLAPSED = "secondary-menu-collapsed"; - -export const MenuContext = React.createContext({ - menuCollapsed: isMenuCollapsed(), - setMenuCollapsed: (collapsed: boolean) => {} -}); - -export function isMenuCollapsed() { - return localStorage.getItem(MENU_COLLAPSED) === "true"; -} -export function storeMenuCollapsed(status: boolean) { - localStorage.setItem(MENU_COLLAPSED, String(status)); +export type RoutingProps = { + to: string; + activeOnlyWhenExact?: boolean; + activeWhenMatch?: (route: any) => boolean; } diff --git a/scm-ui/ui-components/src/navigation/SecondaryNavigation.stories.tsx b/scm-ui/ui-components/src/navigation/SecondaryNavigation.stories.tsx index f96909a8af..73531dcb18 100644 --- a/scm-ui/ui-components/src/navigation/SecondaryNavigation.stories.tsx +++ b/scm-ui/ui-components/src/navigation/SecondaryNavigation.stories.tsx @@ -30,6 +30,7 @@ import styled from "styled-components"; import SubNavigation from "./SubNavigation"; import { Binder, ExtensionPoint, BinderContext } from "@scm-manager/ui-extensions"; import { MemoryRouter } from "react-router-dom"; +import { StateMenuContextProvider } from "./MenuContext"; const Columns = styled.div` margin: 2rem; @@ -52,6 +53,7 @@ const withRoute = (route: string) => { }; storiesOf("Navigation|Secondary", module) + .addDecorator(story => <StateMenuContextProvider>{story()}</StateMenuContextProvider>) .addDecorator(story => ( <Columns className="columns"> <div className="column is-3">{story()}</div> @@ -59,42 +61,26 @@ storiesOf("Navigation|Secondary", module) )) .add("Default", () => withRoute("/")( - <SecondaryNavigation label="Hitchhiker" collapsed={false} onCollapse={() => {}}> - <SecondaryNavigationItem to="/" icon="fas fa-puzzle-piece" label="Puzzle 42" title="Puzzle 42" /> - <SecondaryNavigationItem to="/some" icon="fas fa-star" label="Heart Of Gold" title="Heart Of Gold" /> - </SecondaryNavigation> - ) - ) - .add("Collapsed", () => - withRoute("/")( - <SecondaryNavigation label="Hitchhiker" collapsed={true} onCollapse={() => {}}> - <SecondaryNavigationItem to="/" icon="fas fa-puzzle-piece" label="Puzzle 42" title="Puzzle 42" /> - <SecondaryNavigationItem to="/some" icon="fas fa-star" label="Heart Of Gold" title="Heart Of Gold" /> + <SecondaryNavigation label="Hitchhiker"> + <SecondaryNavigationItem to="/42" icon="fas fa-puzzle-piece" label="Puzzle 42" title="Puzzle 42" /> + <SecondaryNavigationItem to="/heart-of-gold" icon="fas fa-star" label="Heart Of Gold" title="Heart Of Gold" /> </SecondaryNavigation> ) ) .add("Sub Navigation", () => withRoute("/")( - <SecondaryNavigation label="Hitchhiker" collapsed={false} onCollapse={() => {}}> + <SecondaryNavigation label="Hitchhiker"> <SecondaryNavigationItem to="/42" icon="fas fa-puzzle-piece" label="Puzzle 42" title="Puzzle 42" /> {starships} </SecondaryNavigation> ) ) - .add("Sub Navigation Collapsed", () => - withRoute("/hitchhiker/starships/heart-of-gold")( - <SecondaryNavigation label="Hitchhiker" collapsed={true} onCollapse={() => {}}> - <SecondaryNavigationItem to="/42" icon="fas fa-puzzle-piece" label="Puzzle 42" title="Puzzle 42" /> - {starships} - </SecondaryNavigation> - ) - ) - .add("Collapsed EP Sub", () => { + .add("Extension Point", () => { const binder = new Binder("menu"); binder.bind("subnav.sample", starships); return withRoute("/hitchhiker/starships/titanic")( <BinderContext.Provider value={binder}> - <SecondaryNavigation label="Hitchhiker" collapsed={true} onCollapse={() => {}}> + <SecondaryNavigation label="Hitchhiker"> <SecondaryNavigationItem to="/42" icon="fas fa-puzzle-piece" label="Puzzle 42" title="Puzzle 42" /> <ExtensionPoint name="subnav.sample" renderAll={true} /> </SecondaryNavigation> diff --git a/scm-ui/ui-components/src/navigation/SecondaryNavigation.tsx b/scm-ui/ui-components/src/navigation/SecondaryNavigation.tsx index b2465630a6..efb925c679 100644 --- a/scm-ui/ui-components/src/navigation/SecondaryNavigation.tsx +++ b/scm-ui/ui-components/src/navigation/SecondaryNavigation.tsx @@ -21,18 +21,17 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ -import React, { FC, ReactElement, ReactNode, useContext, useEffect } from "react"; + +import React, { FC, ReactElement, ReactNode} from "react"; import styled from "styled-components"; import SubNavigation from "./SubNavigation"; import { matchPath, useLocation } from "react-router-dom"; -import { isMenuCollapsed, MenuContext } from "./MenuContext"; +import useMenuContext from "./MenuContext"; import { ExtensionPoint, Binder, useBinder } from "@scm-manager/ui-extensions"; +import { RoutingProps } from "./RoutingProps"; type Props = { label: string; - children: ReactElement[]; - collapsed: boolean; - onCollapse?: (newStatus: boolean) => void; }; type CollapsedProps = { @@ -61,32 +60,14 @@ const MenuLabel = styled.p<CollapsedProps>` cursor: pointer; `; -const SecondaryNavigation: FC<Props> = ({ label, children, collapsed, onCollapse }) => { +const SecondaryNavigation: FC<Props> = ({ label, children}) => { const location = useLocation(); const binder = useBinder(); - const menuContext = useContext(MenuContext); + const menuContext = useMenuContext(); const subNavActive = isSubNavigationActive(binder, children, location.pathname); - const isCollapsed = collapsed && !subNavActive; + const isCollapsed = menuContext.isCollapsed(); - useEffect(() => { - if (isMenuCollapsed()) { - menuContext.setMenuCollapsed(!subNavActive); - } - }, [subNavActive]); - - const childrenWithProps = React.Children.map(children, (child: ReactElement) => - React.cloneElement(child, { - collapsed: isCollapsed, - propTransformer: (props: object) => { - const np = { - ...props, - collapsed: isCollapsed - }; - return np; - } - }) - ); const arrowIcon = isCollapsed ? <i className="fas fa-caret-down" /> : <i className="fas fa-caret-right" />; return ( @@ -95,16 +76,16 @@ const SecondaryNavigation: FC<Props> = ({ label, children, collapsed, onCollapse <MenuLabel className="menu-label" collapsed={isCollapsed} - onClick={onCollapse && !subNavActive ? () => onCollapse(!isCollapsed) : undefined} + onClick={!subNavActive ? () => menuContext.setCollapsed(!isCollapsed) : undefined} > - {onCollapse && !subNavActive && ( + {!subNavActive && ( <Icon color="info" className="is-medium" collapsed={isCollapsed}> {arrowIcon} </Icon> )} {isCollapsed ? "" : label} </MenuLabel> - <ul className="menu-list">{childrenWithProps}</ul> + <ul className="menu-list">{children}</ul> </div> </SectionContainer> ); @@ -116,32 +97,42 @@ const createParentPath = (to: string) => { return parents.join("/"); }; +const expandExtensionPoints = (binder: Binder, child: ReactElement): Array<ReactElement> => { + // @ts-ignore + if (child.type.name === ExtensionPoint.name) { + // @ts-ignore + return binder.getExtensions(child.props.name, child.props.props); + } + return [child]; +}; + +const mapToProps = (child: ReactElement<RoutingProps>) => { + return child.props; +}; + +const isSubNavigation = (child: ReactElement) => { + // @ts-ignore + return child.type.name === SubNavigation.name; +}; + +const isActive = (url: string, props: RoutingProps) => { + const path = createParentPath(props.to); + const matches = matchPath(url, { + path, + exact: props.activeOnlyWhenExact + }); + return matches != null; +}; + const isSubNavigationActive = (binder: Binder, children: ReactNode, url: string): boolean => { const childArray = React.Children.toArray(children); + const match = childArray .filter(React.isValidElement) - .flatMap(child => { - // @ts-ignore - if (child.type.name === ExtensionPoint.name) { - // @ts-ignore - return binder.getExtensions(child.props.name, child.props.props); - } - return [child]; - }) - .filter(child => { - return child.type.name === SubNavigation.name; - }) - .map(child => { - return child.props; - }) - .find(props => { - const path = createParentPath(props.to); - const matches = matchPath(url, { - path, - exact: props.activeOnlyWhenExact as boolean - }); - return matches != null; - }); + .flatMap(child => expandExtensionPoints(binder, child)) + .filter(isSubNavigation) + .map(mapToProps) + .find(props => isActive(url, props)); return match != null; }; diff --git a/scm-ui/ui-components/src/navigation/SecondaryNavigationItem.tsx b/scm-ui/ui-components/src/navigation/SecondaryNavigationItem.tsx index 6f846e426c..33924c4a29 100644 --- a/scm-ui/ui-components/src/navigation/SecondaryNavigationItem.tsx +++ b/scm-ui/ui-components/src/navigation/SecondaryNavigationItem.tsx @@ -21,20 +21,15 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ -import React, { FC, ReactElement, ReactNode } from "react"; -import { MenuContext } from "./MenuContext"; +import React, {FC} from "react"; import SubNavigation from "./SubNavigation"; import NavLink from "./NavLink"; +import {RoutingProps} from "./RoutingProps"; -type Props = { - to: string; - icon?: string; +type Props = RoutingProps & { label: string; - title: string; - collapsed?: boolean; - activeWhenMatch?: (route: any) => boolean; - activeOnlyWhenExact?: boolean; - children?: ReactElement[]; + title?: string; + icon?: string; }; const SecondaryNavigationItem: FC<Props> = ({ children, ...props }) => { diff --git a/scm-ui/ui-components/src/navigation/SubNavigation.tsx b/scm-ui/ui-components/src/navigation/SubNavigation.tsx index 165f10588b..2955527d78 100644 --- a/scm-ui/ui-components/src/navigation/SubNavigation.tsx +++ b/scm-ui/ui-components/src/navigation/SubNavigation.tsx @@ -21,22 +21,19 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ -import React, { FC, ReactElement, useContext, useEffect } from "react"; +import React, { FC, useContext} from "react"; import { Link, useRouteMatch } from "react-router-dom"; import classNames from "classnames"; +import useMenuContext, {MenuContext} from "./MenuContext"; +import {RoutingProps} from "./RoutingProps"; -type Props = { - to: string; - icon?: string; +type Props = RoutingProps & { label: string; - activeOnlyWhenExact?: boolean; - activeWhenMatch?: (route: any) => boolean; - children?: ReactElement[]; - collapsed?: boolean; title?: string; + icon?: string; }; -const SubNavigation: FC<Props> = ({ to, activeOnlyWhenExact, icon, collapsed, title, label, children }) => { +const SubNavigation: FC<Props> = ({ to, activeOnlyWhenExact, icon, title, label, children }) => { const parents = to.split("/"); parents.splice(-1, 1); const parent = parents.join("/"); @@ -46,6 +43,9 @@ const SubNavigation: FC<Props> = ({ to, activeOnlyWhenExact, icon, collapsed, ti exact: activeOnlyWhenExact }); + const context = useMenuContext(); + const collapsed = context.isCollapsed(); + let defaultIcon = "fas fa-cog"; if (icon) { defaultIcon = icon; diff --git a/scm-ui/ui-components/src/navigation/index.ts b/scm-ui/ui-components/src/navigation/index.ts index b7326f6810..942beb0080 100644 --- a/scm-ui/ui-components/src/navigation/index.ts +++ b/scm-ui/ui-components/src/navigation/index.ts @@ -31,5 +31,5 @@ export { default as SubNavigation } from "./SubNavigation"; export { default as PrimaryNavigation } from "./PrimaryNavigation"; export { default as PrimaryNavigationLink } from "./PrimaryNavigationLink"; export { default as SecondaryNavigation } from "./SecondaryNavigation"; -export { MenuContext, storeMenuCollapsed, isMenuCollapsed } from "./MenuContext"; +export { MenuContext, LocalStorageMenuContextProvider } from "./MenuContext"; export { default as SecondaryNavigationItem } from "./SecondaryNavigationItem"; From 1425a4e9539b644d15fb5a15abd9e81138cd394f Mon Sep 17 00:00:00 2001 From: snyk-bot <snyk-bot@snyk.io> Date: Tue, 31 Mar 2020 06:35:06 +0000 Subject: [PATCH 35/44] fix: upgrade org.kohsuke.metainf-services:metainf-services from 1.7 to 1.8 Snyk has created this PR to upgrade org.kohsuke.metainf-services:metainf-services from 1.7 to 1.8. See this package in NPM: https://www.npmjs.com/package/org.kohsuke.metainf-services:metainf-services See this project in Snyk: https://app.snyk.io/org/scm-manager/project/31334444-8fef-42b0-9d09-7db866678fbb?utm_source=github&utm_medium=upgrade-pr --- scm-annotation-processor/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scm-annotation-processor/pom.xml b/scm-annotation-processor/pom.xml index 4881cf3110..eafc3f5c58 100644 --- a/scm-annotation-processor/pom.xml +++ b/scm-annotation-processor/pom.xml @@ -78,7 +78,7 @@ <dependency> <groupId>org.kohsuke.metainf-services</groupId> <artifactId>metainf-services</artifactId> - <version>1.7</version> + <version>1.8</version> </dependency> </dependencies> From 13633fb57e1b6f8506bc564589d63f846b1738c1 Mon Sep 17 00:00:00 2001 From: Sebastian Sdorra <sebastian.sdorra@cloudogu.com> Date: Tue, 31 Mar 2020 11:00:07 +0200 Subject: [PATCH 36/44] un collapse menu on each interaction with it --- .../src/__snapshots__/storyshots.test.ts.snap | 269 +++++------------- .../src/layout/PrimaryContentColumn.tsx | 31 +- .../src/layout/SecondaryNavigationColumn.tsx | 31 +- .../src/navigation/SecondaryNavigation.tsx | 25 +- scm-ui/ui-components/src/navigation/index.ts | 2 +- scm-ui/ui-components/src/repos/DiffFile.tsx | 10 +- .../ui-webapp/src/admin/containers/Admin.tsx | 41 +-- scm-ui/ui-webapp/src/containers/Profile.tsx | 41 +-- .../src/groups/containers/SingleGroup.tsx | 41 +-- .../src/repos/containers/RepositoryRoot.tsx | 42 +-- .../src/users/containers/SingleUser.tsx | 39 +-- 11 files changed, 154 insertions(+), 418 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 7078431b33..f76f64d754 100644 --- a/scm-ui/ui-components/src/__snapshots__/storyshots.test.ts.snap +++ b/scm-ui/ui-components/src/__snapshots__/storyshots.test.ts.snap @@ -34188,70 +34188,7 @@ exports[`Storyshots MarkdownView Xml Code Block 1`] = ` </div> `; -exports[`Storyshots Navigation|Secondary Collapsed 1`] = ` -<div - className="SecondaryNavigationstories__Columns-fdxo4w-0 fJKROg columns" -> - <div - className="column is-3" - > - <aside - className="SecondaryNavigation__SectionContainer-sc-8p1rgi-0 bfoGdF menu" - > - <div> - <p - className="SecondaryNavigation__MenuLabel-sc-8p1rgi-2 ktrCnD menu-label" - onClick={[Function]} - > - <i - className="SecondaryNavigation__Icon-sc-8p1rgi-1 cqWEjA is-medium" - color="info" - > - <i - className="fas fa-caret-down" - /> - </i> - - </p> - <ul - className="menu-list" - > - <li - title="Puzzle 42" - > - <a - className="is-active has-text-centered" - href="/" - onClick={[Function]} - > - <i - className="fas fa-puzzle-piece fa-fw" - /> - - </a> - </li> - <li - title="Heart Of Gold" - > - <a - className="has-text-centered" - href="/some" - onClick={[Function]} - > - <i - className="fas fa-star fa-fw" - /> - - </a> - </li> - </ul> - </div> - </aside> - </div> -</div> -`; - -exports[`Storyshots Navigation|Secondary Collapsed EP Sub 1`] = ` +exports[`Storyshots Navigation|Secondary Default 1`] = ` <div className="SecondaryNavigationstories__Columns-fdxo4w-0 fJKROg columns" > @@ -34264,11 +34201,75 @@ exports[`Storyshots Navigation|Secondary Collapsed EP Sub 1`] = ` <div> <p className="SecondaryNavigation__MenuLabel-sc-8p1rgi-2 bGijuJ menu-label" + onClick={[Function]} + > + <i + className="SecondaryNavigation__Icon-sc-8p1rgi-1 SeoNL is-medium" + color="info" + > + <i + className="fas fa-caret-right" + /> + </i> + Hitchhiker + </p> + <ul + className="menu-list" + onClick={[Function]} + > + <li> + <a + className="" + href="/42" + onClick={[Function]} + > + <i + className="fas fa-puzzle-piece fa-fw" + /> + + Puzzle 42 + </a> + </li> + <li> + <a + className="" + href="/heart-of-gold" + onClick={[Function]} + > + <i + className="fas fa-star fa-fw" + /> + + Heart Of Gold + </a> + </li> + </ul> + </div> + </aside> + </div> +</div> +`; + +exports[`Storyshots Navigation|Secondary Extension Point 1`] = ` +<div + className="SecondaryNavigationstories__Columns-fdxo4w-0 fJKROg columns" +> + <div + className="column is-3" + > + <aside + className="SecondaryNavigation__SectionContainer-sc-8p1rgi-0 bfoGdF menu" + > + <div> + <p + className="SecondaryNavigation__MenuLabel-sc-8p1rgi-2 bGijuJ menu-label" + onClick={[Function]} > Hitchhiker </p> <ul className="menu-list" + onClick={[Function]} > <li> <a @@ -34329,67 +34330,6 @@ exports[`Storyshots Navigation|Secondary Collapsed EP Sub 1`] = ` </div> `; -exports[`Storyshots Navigation|Secondary Default 1`] = ` -<div - className="SecondaryNavigationstories__Columns-fdxo4w-0 fJKROg columns" -> - <div - className="column is-3" - > - <aside - className="SecondaryNavigation__SectionContainer-sc-8p1rgi-0 bfoGdF menu" - > - <div> - <p - className="SecondaryNavigation__MenuLabel-sc-8p1rgi-2 bGijuJ menu-label" - onClick={[Function]} - > - <i - className="SecondaryNavigation__Icon-sc-8p1rgi-1 SeoNL is-medium" - color="info" - > - <i - className="fas fa-caret-right" - /> - </i> - Hitchhiker - </p> - <ul - className="menu-list" - > - <li> - <a - className="is-active" - href="/" - onClick={[Function]} - > - <i - className="fas fa-puzzle-piece fa-fw" - /> - - Puzzle 42 - </a> - </li> - <li> - <a - className="" - href="/some" - onClick={[Function]} - > - <i - className="fas fa-star fa-fw" - /> - - Heart Of Gold - </a> - </li> - </ul> - </div> - </aside> - </div> -</div> -`; - exports[`Storyshots Navigation|Secondary Sub Navigation 1`] = ` <div className="SecondaryNavigationstories__Columns-fdxo4w-0 fJKROg columns" @@ -34417,6 +34357,7 @@ exports[`Storyshots Navigation|Secondary Sub Navigation 1`] = ` </p> <ul className="menu-list" + onClick={[Function]} > <li> <a @@ -34451,84 +34392,6 @@ exports[`Storyshots Navigation|Secondary Sub Navigation 1`] = ` </div> `; -exports[`Storyshots Navigation|Secondary Sub Navigation Collapsed 1`] = ` -<div - className="SecondaryNavigationstories__Columns-fdxo4w-0 fJKROg columns" -> - <div - className="column is-3" - > - <aside - className="SecondaryNavigation__SectionContainer-sc-8p1rgi-0 bfoGdF menu" - > - <div> - <p - className="SecondaryNavigation__MenuLabel-sc-8p1rgi-2 bGijuJ menu-label" - > - Hitchhiker - </p> - <ul - className="menu-list" - > - <li> - <a - className="" - href="/42" - onClick={[Function]} - > - <i - className="fas fa-puzzle-piece fa-fw" - /> - - Puzzle 42 - </a> - </li> - <li> - <a - className="is-active" - href="/hitchhiker/starships" - onClick={[Function]} - > - <i - className="fas fa-cog fa-fw" - /> - - Starships - </a> - <ul - className="sub-menu" - > - <li> - <a - className="is-active" - href="/hitchhiker/starships/heart-of-gold" - onClick={[Function]} - > - <i - className="fas fa-star fa-fw" - /> - - Heart Of Gold - </a> - </li> - <li> - <a - className="" - href="/hitchhiker/starships/titanic" - onClick={[Function]} - > - Titanic - </a> - </li> - </ul> - </li> - </ul> - </div> - </aside> - </div> -</div> -`; - exports[`Storyshots RepositoryEntry Avatar EP 1`] = ` <div className="RepositoryEntrystories__Spacing-toppdg-0 khfzcK box box-link-shadow" diff --git a/scm-ui/ui-components/src/layout/PrimaryContentColumn.tsx b/scm-ui/ui-components/src/layout/PrimaryContentColumn.tsx index 76427dc4e0..73ddadd0a4 100644 --- a/scm-ui/ui-components/src/layout/PrimaryContentColumn.tsx +++ b/scm-ui/ui-components/src/layout/PrimaryContentColumn.tsx @@ -21,13 +21,9 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ -import React, { ReactNode } from "react"; +import React, { FC } from "react"; import styled from "styled-components"; - -type Props = { - children?: ReactNode; - collapsed: boolean; -}; +import useMenuContext from "../navigation/MenuContext"; const PrimaryColumn = styled.div<{ collapsed: boolean }>` /* This is the counterpart to the specific column in SecondaryNavigationColumn. */ @@ -39,18 +35,13 @@ const PrimaryColumn = styled.div<{ collapsed: boolean }>` } `; -export default class PrimaryContentColumn extends React.Component<Props> { - static defaultProps = { - collapsed: false - }; +const PrimaryContentColumn: FC = ({ children }) => { + const context = useMenuContext(); + return ( + <PrimaryColumn className="column" collapsed={context.isCollapsed()}> + {children} + </PrimaryColumn> + ); +}; - render() { - const { children, collapsed } = this.props; - - return ( - <PrimaryColumn className="column" collapsed={collapsed}> - {children} - </PrimaryColumn> - ); - } -} +export default PrimaryContentColumn; diff --git a/scm-ui/ui-components/src/layout/SecondaryNavigationColumn.tsx b/scm-ui/ui-components/src/layout/SecondaryNavigationColumn.tsx index aae722bbe3..a974c8d438 100644 --- a/scm-ui/ui-components/src/layout/SecondaryNavigationColumn.tsx +++ b/scm-ui/ui-components/src/layout/SecondaryNavigationColumn.tsx @@ -21,13 +21,9 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ -import React, { ReactNode } from "react"; +import React, { FC } from "react"; import styled from "styled-components"; - -type Props = { - children?: ReactNode; - collapsed: boolean; -}; +import useMenuContext from "../navigation/MenuContext"; const SecondaryColumn = styled.div<{ collapsed: boolean }>` /* In Bulma there is unfortunately no intermediate step between .is-1 and .is-2, hence the size. @@ -42,18 +38,13 @@ const SecondaryColumn = styled.div<{ collapsed: boolean }>` } `; -export default class SecondaryNavigationColumn extends React.Component<Props> { - static defaultProps = { - collapsed: false - }; +const SecondaryNavigationColumn: FC = ({ children }) => { + const context = useMenuContext(); + return ( + <SecondaryColumn className="column" collapsed={context.isCollapsed()}> + {children} + </SecondaryColumn> + ); +}; - render() { - const { children, collapsed } = this.props; - - return ( - <SecondaryColumn className="column" collapsed={collapsed}> - {children} - </SecondaryColumn> - ); - } -} +export default SecondaryNavigationColumn; diff --git a/scm-ui/ui-components/src/navigation/SecondaryNavigation.tsx b/scm-ui/ui-components/src/navigation/SecondaryNavigation.tsx index efb925c679..61e0860a18 100644 --- a/scm-ui/ui-components/src/navigation/SecondaryNavigation.tsx +++ b/scm-ui/ui-components/src/navigation/SecondaryNavigation.tsx @@ -22,7 +22,7 @@ * SOFTWARE. */ -import React, { FC, ReactElement, ReactNode} from "react"; +import React, {FC, ReactElement, ReactNode, useEffect, useMemo} from "react"; import styled from "styled-components"; import SubNavigation from "./SubNavigation"; import { matchPath, useLocation } from "react-router-dom"; @@ -64,10 +64,27 @@ const SecondaryNavigation: FC<Props> = ({ label, children}) => { const location = useLocation(); const binder = useBinder(); const menuContext = useMenuContext(); - const subNavActive = isSubNavigationActive(binder, children, location.pathname); const isCollapsed = menuContext.isCollapsed(); + useEffect(() => { + if (isCollapsed && subNavActive) { + menuContext.setCollapsed(false); + } + }, [subNavActive, isCollapsed]); + + const toggleCollapseState = () => { + if (!subNavActive) { + menuContext.setCollapsed(!isCollapsed); + } + }; + + const uncollapseMenu = () => { + if (isCollapsed) { + menuContext.setCollapsed(false); + } + }; + const arrowIcon = isCollapsed ? <i className="fas fa-caret-down" /> : <i className="fas fa-caret-right" />; return ( @@ -76,7 +93,7 @@ const SecondaryNavigation: FC<Props> = ({ label, children}) => { <MenuLabel className="menu-label" collapsed={isCollapsed} - onClick={!subNavActive ? () => menuContext.setCollapsed(!isCollapsed) : undefined} + onClick={toggleCollapseState} > {!subNavActive && ( <Icon color="info" className="is-medium" collapsed={isCollapsed}> @@ -85,7 +102,7 @@ const SecondaryNavigation: FC<Props> = ({ label, children}) => { )} {isCollapsed ? "" : label} </MenuLabel> - <ul className="menu-list">{children}</ul> + <ul className="menu-list" onClick={uncollapseMenu}>{children}</ul> </div> </SectionContainer> ); diff --git a/scm-ui/ui-components/src/navigation/index.ts b/scm-ui/ui-components/src/navigation/index.ts index 942beb0080..4dcce4321b 100644 --- a/scm-ui/ui-components/src/navigation/index.ts +++ b/scm-ui/ui-components/src/navigation/index.ts @@ -31,5 +31,5 @@ export { default as SubNavigation } from "./SubNavigation"; export { default as PrimaryNavigation } from "./PrimaryNavigation"; export { default as PrimaryNavigationLink } from "./PrimaryNavigationLink"; export { default as SecondaryNavigation } from "./SecondaryNavigation"; -export { MenuContext, LocalStorageMenuContextProvider } from "./MenuContext"; +export { MenuContext, StateMenuContextProvider } from "./MenuContext"; export { default as SecondaryNavigationItem } from "./SecondaryNavigationItem"; diff --git a/scm-ui/ui-components/src/repos/DiffFile.tsx b/scm-ui/ui-components/src/repos/DiffFile.tsx index 5d6381a971..981423fabe 100644 --- a/scm-ui/ui-components/src/repos/DiffFile.tsx +++ b/scm-ui/ui-components/src/repos/DiffFile.tsx @@ -34,7 +34,6 @@ import { Change, ChangeEvent, DiffObjectProps, File, Hunk as HunkType } from "./ import TokenizedDiffView from "./TokenizedDiffView"; import DiffButton from "./DiffButton"; import { MenuContext } from "@scm-manager/ui-components"; -import { storeMenuCollapsed } from "../navigation"; const EMPTY_ANNOTATION_FACTORY = {}; @@ -132,7 +131,6 @@ class DiffFile extends React.Component<Props, State> { }), () => callback() ); - storeMenuCollapsed(true); }; setCollapse = (collapsed: boolean) => { @@ -289,11 +287,15 @@ class DiffFile extends React.Component<Props, State> { <ButtonWrapper className={classNames("level-right", "is-flex")}> <ButtonGroup> <MenuContext.Consumer> - {({ setMenuCollapsed }) => ( + {({ setCollapsed }) => ( <DiffButton icon={sideBySide ? "align-left" : "columns"} tooltip={t(sideBySide ? "diff.combined" : "diff.sideBySide")} - onClick={() => this.toggleSideBySide(() => setMenuCollapsed(true))} + onClick={() => this.toggleSideBySide(() => { + if (this.state.sideBySide) { + setCollapsed(true); + } + })} /> )} </MenuContext.Consumer> diff --git a/scm-ui/ui-webapp/src/admin/containers/Admin.tsx b/scm-ui/ui-webapp/src/admin/containers/Admin.tsx index 6840808214..ebfaaa1325 100644 --- a/scm-ui/ui-webapp/src/admin/containers/Admin.tsx +++ b/scm-ui/ui-webapp/src/admin/containers/Admin.tsx @@ -35,10 +35,7 @@ import { PrimaryContentColumn, SecondaryNavigationColumn, SecondaryNavigation, - SubNavigation, - isMenuCollapsed, - MenuContext, - storeMenuCollapsed + SubNavigation } from "@scm-manager/ui-components"; import { getAvailablePluginsLink, getInstalledPluginsLink, getLinks } from "../../modules/indexResource"; import AdminDetails from "./AdminDetails"; @@ -47,6 +44,7 @@ import GlobalConfig from "./GlobalConfig"; import RepositoryRoles from "../roles/containers/RepositoryRoles"; import SingleRepositoryRole from "../roles/containers/SingleRepositoryRole"; import CreateRepositoryRole from "../roles/containers/CreateRepositoryRole"; +import {StateMenuContextProvider} from "@scm-manager/ui-components/src/navigation/MenuContext"; type Props = RouteComponentProps & WithTranslation & { @@ -55,23 +53,7 @@ type Props = RouteComponentProps & installedPluginsLink: string; }; -type State = { - menuCollapsed: boolean; -}; - -class Admin extends React.Component<Props, State> { - constructor(props: Props) { - super(props); - - this.state = { - menuCollapsed: isMenuCollapsed() - }; - } - - onCollapseAdminMenu = (collapsed: boolean) => { - this.setState({ menuCollapsed: collapsed }, () => storeMenuCollapsed(collapsed)); - }; - +class Admin extends React.Component<Props> { stripEndingSlash = (url: string) => { if (url.endsWith("/")) { if (url.includes("role")) { @@ -94,7 +76,6 @@ class Admin extends React.Component<Props, State> { render() { const { links, availablePluginsLink, installedPluginsLink, t } = this.props; - const { menuCollapsed } = this.state; const url = this.matchedUrl(); const extensionProps = { @@ -103,12 +84,10 @@ class Admin extends React.Component<Props, State> { }; return ( - <MenuContext.Provider - value={{ menuCollapsed, setMenuCollapsed: (collapsed: boolean) => this.setState({ menuCollapsed: collapsed }) }} - > + <StateMenuContextProvider> <Page> <CustomQueryFlexWrappedColumns> - <PrimaryContentColumn collapsed={menuCollapsed}> + <PrimaryContentColumn> <Switch> <Redirect exact from={url} to={`${url}/info`} /> <Route path={`${url}/info`} exact component={AdminDetails} /> @@ -147,12 +126,8 @@ class Admin extends React.Component<Props, State> { <ExtensionPoint name="admin.route" props={extensionProps} renderAll={true} /> </Switch> </PrimaryContentColumn> - <SecondaryNavigationColumn collapsed={menuCollapsed}> - <SecondaryNavigation - label={t("admin.menu.navigationLabel")} - onCollapse={() => this.onCollapseAdminMenu(!menuCollapsed)} - collapsed={menuCollapsed} - > + <SecondaryNavigationColumn> + <SecondaryNavigation label={t("admin.menu.navigationLabel")}> <NavLink to={`${url}/info`} icon="fas fa-info-circle" @@ -195,7 +170,7 @@ class Admin extends React.Component<Props, State> { </SecondaryNavigationColumn> </CustomQueryFlexWrappedColumns> </Page> - </MenuContext.Provider> + </StateMenuContextProvider> ); } } diff --git a/scm-ui/ui-webapp/src/containers/Profile.tsx b/scm-ui/ui-webapp/src/containers/Profile.tsx index 221e8974c7..8f14bed1e7 100644 --- a/scm-ui/ui-webapp/src/containers/Profile.tsx +++ b/scm-ui/ui-webapp/src/containers/Profile.tsx @@ -30,20 +30,18 @@ import { WithTranslation, withTranslation } from "react-i18next"; import { Me } from "@scm-manager/ui-types"; import { ErrorPage, - isMenuCollapsed, - MenuContext, NavLink, Page, CustomQueryFlexWrappedColumns, PrimaryContentColumn, SecondaryNavigationColumn, SecondaryNavigation, - SubNavigation + SubNavigation, + StateMenuContextProvider } from "@scm-manager/ui-components"; import ChangeUserPassword from "./ChangeUserPassword"; import ProfileInfo from "./ProfileInfo"; import { ExtensionPoint } from "@scm-manager/ui-extensions"; -import { storeMenuCollapsed } from "@scm-manager/ui-components/src"; type Props = RouteComponentProps & WithTranslation & { @@ -53,23 +51,7 @@ type Props = RouteComponentProps & match: any; }; -type State = { - menuCollapsed: boolean; -}; - -class Profile extends React.Component<Props, State> { - constructor(props: Props) { - super(props); - - this.state = { - menuCollapsed: isMenuCollapsed() - }; - } - - onCollapseProfileMenu = (collapsed: boolean) => { - this.setState({ menuCollapsed: collapsed }, () => storeMenuCollapsed(collapsed)); - }; - +class Profile extends React.Component<Props> { stripEndingSlash = (url: string) => { if (url.endsWith("/")) { return url.substring(0, url.length - 2); @@ -85,7 +67,6 @@ class Profile extends React.Component<Props, State> { const url = this.matchedUrl(); const { me, t } = this.props; - const { menuCollapsed } = this.state; if (!me) { return ( @@ -106,22 +87,16 @@ class Profile extends React.Component<Props, State> { }; return ( - <MenuContext.Provider - value={{ menuCollapsed, setMenuCollapsed: (collapsed: boolean) => this.setState({ menuCollapsed: collapsed }) }} - > + <StateMenuContextProvider> <Page title={me.displayName}> <CustomQueryFlexWrappedColumns> - <PrimaryContentColumn collapsed={menuCollapsed}> + <PrimaryContentColumn> <Route path={url} exact render={() => <ProfileInfo me={me} />} /> <Route path={`${url}/settings/password`} render={() => <ChangeUserPassword me={me} />} /> <ExtensionPoint name="profile.route" props={extensionProps} renderAll={true} /> </PrimaryContentColumn> - <SecondaryNavigationColumn collapsed={menuCollapsed}> - <SecondaryNavigation - label={t("profile.navigationLabel")} - onCollapse={() => this.onCollapseProfileMenu(!menuCollapsed)} - collapsed={menuCollapsed} - > + <SecondaryNavigationColumn> + <SecondaryNavigation label={t("profile.navigationLabel")}> <NavLink to={`${url}`} icon="fas fa-info-circle" @@ -140,7 +115,7 @@ class Profile extends React.Component<Props, State> { </SecondaryNavigationColumn> </CustomQueryFlexWrappedColumns> </Page> - </MenuContext.Provider> + </StateMenuContextProvider> ); } } diff --git a/scm-ui/ui-webapp/src/groups/containers/SingleGroup.tsx b/scm-ui/ui-webapp/src/groups/containers/SingleGroup.tsx index c7c658c059..5b5555b80c 100644 --- a/scm-ui/ui-webapp/src/groups/containers/SingleGroup.tsx +++ b/scm-ui/ui-webapp/src/groups/containers/SingleGroup.tsx @@ -29,16 +29,15 @@ import { ExtensionPoint } from "@scm-manager/ui-extensions"; import { Group } from "@scm-manager/ui-types"; import { ErrorPage, - isMenuCollapsed, Loading, - MenuContext, NavLink, Page, CustomQueryFlexWrappedColumns, PrimaryContentColumn, SecondaryNavigationColumn, SecondaryNavigation, - SubNavigation + SubNavigation, + StateMenuContextProvider } from "@scm-manager/ui-components"; import { getGroupsLink } from "../../modules/indexResource"; import { fetchGroupByName, getFetchGroupFailure, getGroupByName, isFetchGroupPending } from "../modules/groups"; @@ -46,7 +45,6 @@ import { Details } from "./../components/table"; import { EditGroupNavLink, SetPermissionsNavLink } from "./../components/navLinks"; import EditGroup from "./EditGroup"; import SetPermissions from "../../permissions/components/SetPermissions"; -import { storeMenuCollapsed } from "@scm-manager/ui-components/src"; type Props = RouteComponentProps & WithTranslation & { @@ -60,27 +58,11 @@ type Props = RouteComponentProps & fetchGroupByName: (p1: string, p2: string) => void; }; -type State = { - menuCollapsed: boolean; -}; - -class SingleGroup extends React.Component<Props, State> { - constructor(props: Props) { - super(props); - - this.state = { - menuCollapsed: isMenuCollapsed() - }; - } - +class SingleGroup extends React.Component<Props> { componentDidMount() { this.props.fetchGroupByName(this.props.groupLink, this.props.name); } - onCollapseGroupMenu = (collapsed: boolean) => { - this.setState({ menuCollapsed: collapsed }, () => storeMenuCollapsed(collapsed)); - }; - stripEndingSlash = (url: string) => { if (url.endsWith("/")) { return url.substring(0, url.length - 2); @@ -94,7 +76,6 @@ class SingleGroup extends React.Component<Props, State> { render() { const { t, loading, error, group } = this.props; - const { menuCollapsed } = this.state; if (error) { return <ErrorPage title={t("singleGroup.errorTitle")} subtitle={t("singleGroup.errorSubtitle")} error={error} />; @@ -112,12 +93,10 @@ class SingleGroup extends React.Component<Props, State> { }; return ( - <MenuContext.Provider - value={{ menuCollapsed, setMenuCollapsed: (collapsed: boolean) => this.setState({ menuCollapsed: collapsed }) }} - > + <StateMenuContextProvider> <Page title={group.name}> <CustomQueryFlexWrappedColumns> - <PrimaryContentColumn collapsed={menuCollapsed}> + <PrimaryContentColumn> <Route path={url} exact component={() => <Details group={group} />} /> <Route path={`${url}/settings/general`} exact component={() => <EditGroup group={group} />} /> <Route @@ -127,12 +106,8 @@ class SingleGroup extends React.Component<Props, State> { /> <ExtensionPoint name="group.route" props={extensionProps} renderAll={true} /> </PrimaryContentColumn> - <SecondaryNavigationColumn collapsed={menuCollapsed}> - <SecondaryNavigation - label={t("singleGroup.menu.navigationLabel")} - onCollapse={() => this.onCollapseGroupMenu(!menuCollapsed)} - collapsed={menuCollapsed} - > + <SecondaryNavigationColumn> + <SecondaryNavigation label={t("singleGroup.menu.navigationLabel")}> <NavLink to={`${url}`} icon="fas fa-info-circle" @@ -153,7 +128,7 @@ class SingleGroup extends React.Component<Props, State> { </SecondaryNavigationColumn> </CustomQueryFlexWrappedColumns> </Page> - </MenuContext.Provider> + </StateMenuContextProvider> ); } } diff --git a/scm-ui/ui-webapp/src/repos/containers/RepositoryRoot.tsx b/scm-ui/ui-webapp/src/repos/containers/RepositoryRoot.tsx index 9651cd0a0b..38b0570cb5 100644 --- a/scm-ui/ui-webapp/src/repos/containers/RepositoryRoot.tsx +++ b/scm-ui/ui-webapp/src/repos/containers/RepositoryRoot.tsx @@ -37,9 +37,7 @@ import { SecondaryNavigationColumn, SecondaryNavigation, SubNavigation, - MenuContext, - storeMenuCollapsed, - isMenuCollapsed + StateMenuContextProvider } from "@scm-manager/ui-components"; import { fetchRepoByName, getFetchRepoFailure, getRepository, isFetchRepoPending } from "../modules/repos"; import RepositoryDetails from "../components/RepositoryDetails"; @@ -70,19 +68,7 @@ type Props = RouteComponentProps & fetchRepoByName: (link: string, namespace: string, name: string) => void; }; -type State = { - menuCollapsed: boolean; -}; - -class RepositoryRoot extends React.Component<Props, State> { - constructor(props: Props) { - super(props); - - this.state = { - menuCollapsed: isMenuCollapsed() - }; - } - +class RepositoryRoot extends React.Component<Props> { componentDidMount() { const { fetchRepoByName, namespace, name, repoLink } = this.props; fetchRepoByName(repoLink, namespace, name); @@ -131,13 +117,8 @@ class RepositoryRoot extends React.Component<Props, State> { return `${url}/changesets`; }; - onCollapseRepositoryMenu = (collapsed: boolean) => { - this.setState({ menuCollapsed: collapsed }, () => storeMenuCollapsed(collapsed)); - }; - render() { const { loading, error, indexLinks, repository, t } = this.props; - const { menuCollapsed } = this.state; if (error) { return ( @@ -166,18 +147,13 @@ class RepositoryRoot extends React.Component<Props, State> { } return ( - <MenuContext.Provider - value={{ - menuCollapsed, - setMenuCollapsed: (collapsed: boolean) => this.setState({ menuCollapsed: collapsed }) - }} - > + <StateMenuContextProvider> <Page title={repository.namespace + "/" + repository.name} afterTitle={<ExtensionPoint name={"repository.afterTitle"} props={{ repository }} />} > <CustomQueryFlexWrappedColumns> - <PrimaryContentColumn collapsed={menuCollapsed}> + <PrimaryContentColumn> <Switch> <Redirect exact from={this.props.match.url} to={redirectedUrl} /> @@ -227,12 +203,8 @@ class RepositoryRoot extends React.Component<Props, State> { <ExtensionPoint name="repository.route" props={extensionProps} renderAll={true} /> </Switch> </PrimaryContentColumn> - <SecondaryNavigationColumn collapsed={menuCollapsed}> - <SecondaryNavigation - label={t("repositoryRoot.menu.navigationLabel")} - onCollapse={() => this.onCollapseRepositoryMenu(!menuCollapsed)} - collapsed={menuCollapsed} - > + <SecondaryNavigationColumn> + <SecondaryNavigation label={t("repositoryRoot.menu.navigationLabel")}> <ExtensionPoint name="repository.navigation.topLevel" props={extensionProps} renderAll={true} /> <NavLink to={`${url}/info`} @@ -274,7 +246,7 @@ class RepositoryRoot extends React.Component<Props, State> { </SecondaryNavigationColumn> </CustomQueryFlexWrappedColumns> </Page> - </MenuContext.Provider> + </StateMenuContextProvider> ); } } diff --git a/scm-ui/ui-webapp/src/users/containers/SingleUser.tsx b/scm-ui/ui-webapp/src/users/containers/SingleUser.tsx index 5050b3ea05..ff2c57f0e6 100644 --- a/scm-ui/ui-webapp/src/users/containers/SingleUser.tsx +++ b/scm-ui/ui-webapp/src/users/containers/SingleUser.tsx @@ -28,9 +28,7 @@ import { ExtensionPoint } from "@scm-manager/ui-extensions"; import { User } from "@scm-manager/ui-types"; import { ErrorPage, - isMenuCollapsed, Loading, - MenuContext, NavLink, Page, CustomQueryFlexWrappedColumns, @@ -38,7 +36,7 @@ import { SecondaryNavigationColumn, SecondaryNavigation, SubNavigation, - storeMenuCollapsed + StateMenuContextProvider } from "@scm-manager/ui-components"; import { Details } from "./../components/table"; import EditUser from "./EditUser"; @@ -61,19 +59,7 @@ type Props = RouteComponentProps & fetchUserByName: (p1: string, p2: string) => void; }; -type State = { - menuCollapsed: boolean; -}; - -class SingleUser extends React.Component<Props, State> { - constructor(props: Props) { - super(props); - - this.state = { - menuCollapsed: isMenuCollapsed() - }; - } - +class SingleUser extends React.Component<Props> { componentDidMount() { this.props.fetchUserByName(this.props.usersLink, this.props.name); } @@ -85,17 +71,12 @@ class SingleUser extends React.Component<Props, State> { return url; }; - onCollapseUserMenu = (collapsed: boolean) => { - this.setState({ menuCollapsed: collapsed }, () => storeMenuCollapsed(collapsed)); - }; - matchedUrl = () => { return this.stripEndingSlash(this.props.match.url); }; render() { const { t, loading, error, user } = this.props; - const { menuCollapsed } = this.state; if (error) { return <ErrorPage title={t("singleUser.errorTitle")} subtitle={t("singleUser.errorSubtitle")} error={error} />; @@ -113,12 +94,10 @@ class SingleUser extends React.Component<Props, State> { }; return ( - <MenuContext.Provider - value={{ menuCollapsed, setMenuCollapsed: (collapsed: boolean) => this.setState({ menuCollapsed: collapsed }) }} - > + <StateMenuContextProvider> <Page title={user.displayName}> <CustomQueryFlexWrappedColumns> - <PrimaryContentColumn collapsed={menuCollapsed}> + <PrimaryContentColumn> <Route path={url} exact component={() => <Details user={user} />} /> <Route path={`${url}/settings/general`} component={() => <EditUser user={user} />} /> <Route path={`${url}/settings/password`} component={() => <SetUserPassword user={user} />} /> @@ -128,12 +107,8 @@ class SingleUser extends React.Component<Props, State> { /> <ExtensionPoint name="user.route" props={extensionProps} renderAll={true} /> </PrimaryContentColumn> - <SecondaryNavigationColumn collapsed={menuCollapsed}> - <SecondaryNavigation - label={t("singleUser.menu.navigationLabel")} - onCollapse={() => this.onCollapseUserMenu(!menuCollapsed)} - collapsed={menuCollapsed} - > + <SecondaryNavigationColumn> + <SecondaryNavigation label={t("singleUser.menu.navigationLabel")}> <NavLink to={`${url}`} icon="fas fa-info-circle" @@ -154,7 +129,7 @@ class SingleUser extends React.Component<Props, State> { </SecondaryNavigationColumn> </CustomQueryFlexWrappedColumns> </Page> - </MenuContext.Provider> + </StateMenuContextProvider> ); } } From 5889e834c2cf06a5827447963040dc664342475a Mon Sep 17 00:00:00 2001 From: Sebastian Sdorra <sebastian.sdorra@cloudogu.com> Date: Tue, 31 Mar 2020 11:15:01 +0200 Subject: [PATCH 37/44] allow collapse on sub navigations too --- .../src/__snapshots__/storyshots.test.ts.snap | 8 ++ .../src/navigation/MenuContext.tsx | 17 ---- .../src/navigation/SecondaryNavigation.tsx | 85 +++---------------- 3 files changed, 18 insertions(+), 92 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 f76f64d754..0417014428 100644 --- a/scm-ui/ui-components/src/__snapshots__/storyshots.test.ts.snap +++ b/scm-ui/ui-components/src/__snapshots__/storyshots.test.ts.snap @@ -34265,6 +34265,14 @@ exports[`Storyshots Navigation|Secondary Extension Point 1`] = ` className="SecondaryNavigation__MenuLabel-sc-8p1rgi-2 bGijuJ menu-label" onClick={[Function]} > + <i + className="SecondaryNavigation__Icon-sc-8p1rgi-1 SeoNL is-medium" + color="info" + > + <i + className="fas fa-caret-right" + /> + </i> Hitchhiker </p> <ul diff --git a/scm-ui/ui-components/src/navigation/MenuContext.tsx b/scm-ui/ui-components/src/navigation/MenuContext.tsx index 01b28866d5..be412097b1 100644 --- a/scm-ui/ui-components/src/navigation/MenuContext.tsx +++ b/scm-ui/ui-components/src/navigation/MenuContext.tsx @@ -24,28 +24,11 @@ import React, { FC, useContext, useState } from "react"; -const MENU_COLLAPSED = "secondary-menu-collapsed"; - export type MenuContext = { isCollapsed: () => boolean; setCollapsed: (collapsed: boolean) => void; }; -export const LocalStorageMenuContextProvider: FC = ({children}) => { - const [state, setState] = useState(localStorage.getItem(MENU_COLLAPSED) === "true"); - const context = { - isCollapsed() { - return state; - }, - setCollapsed(collapsed: boolean) { - localStorage.setItem(MENU_COLLAPSED, String(collapsed)); - setState(collapsed); - } - }; - - return <MenuContext.Provider value={context}>{children}</MenuContext.Provider>; -}; - export const MenuContext = React.createContext<MenuContext>({ isCollapsed() { return false; diff --git a/scm-ui/ui-components/src/navigation/SecondaryNavigation.tsx b/scm-ui/ui-components/src/navigation/SecondaryNavigation.tsx index 61e0860a18..59e3593ef2 100644 --- a/scm-ui/ui-components/src/navigation/SecondaryNavigation.tsx +++ b/scm-ui/ui-components/src/navigation/SecondaryNavigation.tsx @@ -22,13 +22,9 @@ * SOFTWARE. */ -import React, {FC, ReactElement, ReactNode, useEffect, useMemo} from "react"; +import React, { FC } from "react"; import styled from "styled-components"; -import SubNavigation from "./SubNavigation"; -import { matchPath, useLocation } from "react-router-dom"; import useMenuContext from "./MenuContext"; -import { ExtensionPoint, Binder, useBinder } from "@scm-manager/ui-extensions"; -import { RoutingProps } from "./RoutingProps"; type Props = { label: string; @@ -60,23 +56,12 @@ const MenuLabel = styled.p<CollapsedProps>` cursor: pointer; `; -const SecondaryNavigation: FC<Props> = ({ label, children}) => { - const location = useLocation(); - const binder = useBinder(); +const SecondaryNavigation: FC<Props> = ({ label, children }) => { const menuContext = useMenuContext(); - const subNavActive = isSubNavigationActive(binder, children, location.pathname); const isCollapsed = menuContext.isCollapsed(); - useEffect(() => { - if (isCollapsed && subNavActive) { - menuContext.setCollapsed(false); - } - }, [subNavActive, isCollapsed]); - const toggleCollapseState = () => { - if (!subNavActive) { - menuContext.setCollapsed(!isCollapsed); - } + menuContext.setCollapsed(!isCollapsed); }; const uncollapseMenu = () => { @@ -90,68 +75,18 @@ const SecondaryNavigation: FC<Props> = ({ label, children}) => { return ( <SectionContainer className="menu"> <div> - <MenuLabel - className="menu-label" - collapsed={isCollapsed} - onClick={toggleCollapseState} - > - {!subNavActive && ( - <Icon color="info" className="is-medium" collapsed={isCollapsed}> - {arrowIcon} - </Icon> - )} + <MenuLabel className="menu-label" collapsed={isCollapsed} onClick={toggleCollapseState}> + <Icon color="info" className="is-medium" collapsed={isCollapsed}> + {arrowIcon} + </Icon> {isCollapsed ? "" : label} </MenuLabel> - <ul className="menu-list" onClick={uncollapseMenu}>{children}</ul> + <ul className="menu-list" onClick={uncollapseMenu}> + {children} + </ul> </div> </SectionContainer> ); }; -const createParentPath = (to: string) => { - const parents = to.split("/"); - parents.splice(-1, 1); - return parents.join("/"); -}; - -const expandExtensionPoints = (binder: Binder, child: ReactElement): Array<ReactElement> => { - // @ts-ignore - if (child.type.name === ExtensionPoint.name) { - // @ts-ignore - return binder.getExtensions(child.props.name, child.props.props); - } - return [child]; -}; - -const mapToProps = (child: ReactElement<RoutingProps>) => { - return child.props; -}; - -const isSubNavigation = (child: ReactElement) => { - // @ts-ignore - return child.type.name === SubNavigation.name; -}; - -const isActive = (url: string, props: RoutingProps) => { - const path = createParentPath(props.to); - const matches = matchPath(url, { - path, - exact: props.activeOnlyWhenExact - }); - return matches != null; -}; - -const isSubNavigationActive = (binder: Binder, children: ReactNode, url: string): boolean => { - const childArray = React.Children.toArray(children); - - const match = childArray - .filter(React.isValidElement) - .flatMap(child => expandExtensionPoints(binder, child)) - .filter(isSubNavigation) - .map(mapToProps) - .find(props => isActive(url, props)); - - return match != null; -}; - export default SecondaryNavigation; From 5015c4d1332c2260be06f0df1865fbde3953227d Mon Sep 17 00:00:00 2001 From: Sebastian Sdorra <sebastian.sdorra@cloudogu.com> Date: Tue, 31 Mar 2020 12:02:30 +0200 Subject: [PATCH 38/44] fixed missing default value for activeOnlyWhenExact on NavLink --- scm-ui/ui-components/src/navigation/NavLink.tsx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/scm-ui/ui-components/src/navigation/NavLink.tsx b/scm-ui/ui-components/src/navigation/NavLink.tsx index 132590e7f6..d9cb3c4e7e 100644 --- a/scm-ui/ui-components/src/navigation/NavLink.tsx +++ b/scm-ui/ui-components/src/navigation/NavLink.tsx @@ -26,8 +26,7 @@ import classNames from "classnames"; import { Link, useRouteMatch } from "react-router-dom"; import { RoutingProps } from "./RoutingProps"; import { FC } from "react"; -import { useContext } from "react"; -import useMenuContext, { MenuContext } from "./MenuContext"; +import useMenuContext from "./MenuContext"; type Props = RoutingProps & { label: string; @@ -63,4 +62,8 @@ const NavLink: FC<Props> = ({ to, activeOnlyWhenExact, icon, label, title }) => ); }; +NavLink.defaultProps = { + activeOnlyWhenExact: true +}; + export default NavLink; From 9e9f1bef318e2aa0fd08e51c1099b9e65dbe5901 Mon Sep 17 00:00:00 2001 From: Sebastian Sdorra <sebastian.sdorra@cloudogu.com> Date: Tue, 31 Mar 2020 14:01:14 +0200 Subject: [PATCH 39/44] update changelog --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index f6ce1222f5..2c4620fc87 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 +### Changed +- Simplified collapse state management of the secondary navigation ([#1086](https://github.com/scm-manager/scm-manager/pull/1086) + ## 2.0.0-rc6 - 2020-03-26 ### Added - Extension point to add links to the repository cards from plug ins ([#1041](https://github.com/scm-manager/scm-manager/pull/1041)) From 9c6f5e2d6005538a61208a1233912cf422201fa1 Mon Sep 17 00:00:00 2001 From: Sebastian Sdorra <sebastian.sdorra@cloudogu.com> Date: Tue, 31 Mar 2020 16:54:25 +0200 Subject: [PATCH 40/44] update smp plugin to 1.0.0-rc5 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 6a56a1fd5a..f806be11d7 100644 --- a/pom.xml +++ b/pom.xml @@ -494,7 +494,7 @@ <plugin> <groupId>sonia.scm.maven</groupId> <artifactId>smp-maven-plugin</artifactId> - <version>1.0.0-rc4</version> + <version>1.0.0-rc5</version> </plugin> <plugin> From fd94746a988a0f8d8d685adccbcb377989c69962 Mon Sep 17 00:00:00 2001 From: Eduard Heimbuch <eduard.heimbuch@cloudogu.com> Date: Tue, 31 Mar 2020 17:11:16 +0200 Subject: [PATCH 41/44] reformat components with prettier --- scm-ui/ui-components/src/CardColumn.tsx | 4 +--- scm-ui/ui-components/src/DateFromNow.test.ts | 2 -- .../ui-components/src/MarkdownView.stories.tsx | 2 +- .../src/forms/Checkbox.stories.tsx | 1 - scm-ui/ui-components/src/forms/Checkbox.tsx | 10 ++-------- scm-ui/ui-components/src/forms/Radio.tsx | 1 - .../src/forms/Textarea.stories.tsx | 2 +- .../src/layout/Footer.stories.tsx | 2 +- scm-ui/ui-components/src/layout/Page.tsx | 2 +- scm-ui/ui-components/src/layout/Title.tsx | 2 +- scm-ui/ui-components/src/layout/index.ts | 1 - .../ui-components/src/modals/ConfirmAlert.tsx | 6 +++++- .../src/navigation/MenuContext.tsx | 2 +- .../src/navigation/RoutingProps.ts | 2 +- .../src/navigation/SecondaryNavigationItem.tsx | 4 ++-- .../src/navigation/SubNavigation.tsx | 6 +++--- scm-ui/ui-components/src/repos/DiffFile.tsx | 12 +++++++----- .../src/repos/RepositoryEntry.stories.tsx | 2 +- .../ui-extensions/src/ExtensionPoint.test.tsx | 10 +++++----- scm-ui/ui-extensions/src/ExtensionPoint.tsx | 8 ++------ yarn.lock | 18 ++++++++++++++---- 21 files changed, 49 insertions(+), 50 deletions(-) diff --git a/scm-ui/ui-components/src/CardColumn.tsx b/scm-ui/ui-components/src/CardColumn.tsx index 0ff63e31dd..42c1512690 100644 --- a/scm-ui/ui-components/src/CardColumn.tsx +++ b/scm-ui/ui-components/src/CardColumn.tsx @@ -99,9 +99,7 @@ export default class CardColumn extends React.Component<Props> { <FlexFullHeight className={classNames("media-content", "text-box", "is-flex")}> <div className="is-flex"> <ContentLeft className="content"> - <p className="shorten-text is-marginless"> - {title} - </p> + <p className="shorten-text is-marginless">{title}</p> <p className="shorten-text">{description}</p> </ContentLeft> <ContentRight>{contentRight}</ContentRight> diff --git a/scm-ui/ui-components/src/DateFromNow.test.ts b/scm-ui/ui-components/src/DateFromNow.test.ts index 8571864639..19acc08fda 100644 --- a/scm-ui/ui-components/src/DateFromNow.test.ts +++ b/scm-ui/ui-components/src/DateFromNow.test.ts @@ -25,7 +25,6 @@ import { chooseLocale, supportedLocales } from "./DateFromNow"; describe("test choose locale", () => { - it("should choose de", () => { const locale = chooseLocale("de_DE", ["de", "en"]); expect(locale).toBe(supportedLocales.de); @@ -45,5 +44,4 @@ describe("test choose locale", () => { const locale = chooseLocale("af", ["af", "be"]); expect(locale).toBe(supportedLocales.en); }); - }); diff --git a/scm-ui/ui-components/src/MarkdownView.stories.tsx b/scm-ui/ui-components/src/MarkdownView.stories.tsx index 6b49d10555..e43f9afd75 100644 --- a/scm-ui/ui-components/src/MarkdownView.stories.tsx +++ b/scm-ui/ui-components/src/MarkdownView.stories.tsx @@ -32,7 +32,7 @@ import MarkdownXmlCodeBlock from "./__resources__/markdown-xml-codeblock.md"; import MarkdownInlineXml from "./__resources__/markdown-inline-xml.md"; import Title from "./layout/Title"; import { Subtitle } from "./layout"; -import {MemoryRouter} from "react-router-dom"; +import { MemoryRouter } from "react-router-dom"; const Spacing = styled.div` padding: 2em; diff --git a/scm-ui/ui-components/src/forms/Checkbox.stories.tsx b/scm-ui/ui-components/src/forms/Checkbox.stories.tsx index 32112d97a1..9f714e5af0 100644 --- a/scm-ui/ui-components/src/forms/Checkbox.stories.tsx +++ b/scm-ui/ui-components/src/forms/Checkbox.stories.tsx @@ -42,4 +42,3 @@ storiesOf("Forms|Checkbox", module) <Checkbox label="Checked but disabled" checked={true} disabled={true} /> </Spacing> )); - diff --git a/scm-ui/ui-components/src/forms/Checkbox.tsx b/scm-ui/ui-components/src/forms/Checkbox.tsx index 00f6285423..70888cf483 100644 --- a/scm-ui/ui-components/src/forms/Checkbox.tsx +++ b/scm-ui/ui-components/src/forms/Checkbox.tsx @@ -54,7 +54,7 @@ export default class Checkbox extends React.Component<Props> { if (title) { return <LabelWithHelpIcon label={title} helpText={helpText} />; } - } + }; render() { const { label, checked, disabled } = this.props; @@ -68,13 +68,7 @@ export default class Checkbox extends React.Component<Props> { but bulma does. // @ts-ignore */} <label className="checkbox" disabled={disabled}> - <input - type="checkbox" - checked={checked} - onChange={this.onCheckboxChange} - disabled={disabled} - />{" "} - {label} + <input type="checkbox" checked={checked} onChange={this.onCheckboxChange} disabled={disabled} /> {label} {this.renderHelp()} </label> </div> diff --git a/scm-ui/ui-components/src/forms/Radio.tsx b/scm-ui/ui-components/src/forms/Radio.tsx index d05e40a19a..fe6a35f4a6 100644 --- a/scm-ui/ui-components/src/forms/Radio.tsx +++ b/scm-ui/ui-components/src/forms/Radio.tsx @@ -25,7 +25,6 @@ import React, { ChangeEvent } from "react"; import { Help } from "../index"; import styled from "styled-components"; - const StyledRadio = styled.label` margin-right: 0.5em; `; diff --git a/scm-ui/ui-components/src/forms/Textarea.stories.tsx b/scm-ui/ui-components/src/forms/Textarea.stories.tsx index 2698195519..bcb638cbaa 100644 --- a/scm-ui/ui-components/src/forms/Textarea.stories.tsx +++ b/scm-ui/ui-components/src/forms/Textarea.stories.tsx @@ -21,7 +21,7 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ -import React, {useState} from "react"; +import React, { useState } from "react"; import { storiesOf } from "@storybook/react"; import styled from "styled-components"; import Textarea from "./Textarea"; diff --git a/scm-ui/ui-components/src/layout/Footer.stories.tsx b/scm-ui/ui-components/src/layout/Footer.stories.tsx index cae668ed19..c25b618a87 100644 --- a/scm-ui/ui-components/src/layout/Footer.stories.tsx +++ b/scm-ui/ui-components/src/layout/Footer.stories.tsx @@ -33,7 +33,7 @@ import hitchhiker from "../__resources__/hitchhiker.png"; import marvin from "../__resources__/marvin.jpg"; import NavLink from "../navigation/NavLink"; import ExternalLink from "../navigation/ExternalLink"; -import {MemoryRouter} from "react-router-dom"; +import { MemoryRouter } from "react-router-dom"; const trillian: Me = { name: "trillian", diff --git a/scm-ui/ui-components/src/layout/Page.tsx b/scm-ui/ui-components/src/layout/Page.tsx index 5d14d1af46..0f4b4e7b4f 100644 --- a/scm-ui/ui-components/src/layout/Page.tsx +++ b/scm-ui/ui-components/src/layout/Page.tsx @@ -52,7 +52,7 @@ const PageActionContainer = styled.div` `; const MarginLeft = styled.div` -margin-left: 0.5rem; + margin-left: 0.5rem; `; const FlexContainer = styled.div` diff --git a/scm-ui/ui-components/src/layout/Title.tsx b/scm-ui/ui-components/src/layout/Title.tsx index cd040be936..0e1024ea06 100644 --- a/scm-ui/ui-components/src/layout/Title.tsx +++ b/scm-ui/ui-components/src/layout/Title.tsx @@ -40,7 +40,7 @@ const Title: FC<Props> = ({ title, preventRefreshingPageTitle, customPageTitle, document.title = title; } } - },[title, preventRefreshingPageTitle, customPageTitle]); + }, [title, preventRefreshingPageTitle, customPageTitle]); if (title) { return <h1 className={classNames("title", className)}>{title}</h1>; diff --git a/scm-ui/ui-components/src/layout/index.ts b/scm-ui/ui-components/src/layout/index.ts index 2c9f7fba72..f1876d4ae1 100644 --- a/scm-ui/ui-components/src/layout/index.ts +++ b/scm-ui/ui-components/src/layout/index.ts @@ -34,4 +34,3 @@ export { default as Title } from "./Title"; export { default as CustomQueryFlexWrappedColumns } from "./CustomQueryFlexWrappedColumns"; export { default as PrimaryContentColumn } from "./PrimaryContentColumn"; export { default as SecondaryNavigationColumn } from "./SecondaryNavigationColumn"; - diff --git a/scm-ui/ui-components/src/modals/ConfirmAlert.tsx b/scm-ui/ui-components/src/modals/ConfirmAlert.tsx index b20f971cc2..e8671a77cb 100644 --- a/scm-ui/ui-components/src/modals/ConfirmAlert.tsx +++ b/scm-ui/ui-components/src/modals/ConfirmAlert.tsx @@ -62,7 +62,11 @@ class ConfirmAlert extends React.Component<Props> { <div className="field is-grouped"> {buttons.map((button, i) => ( <p className="control"> - <a className={classNames("button", "is-info", button.className)} key={i} onClick={() => this.handleClickButton(button)}> + <a + className={classNames("button", "is-info", button.className)} + key={i} + onClick={() => this.handleClickButton(button)} + > {button.label} </a> </p> diff --git a/scm-ui/ui-components/src/navigation/MenuContext.tsx b/scm-ui/ui-components/src/navigation/MenuContext.tsx index be412097b1..f02e5ab8d2 100644 --- a/scm-ui/ui-components/src/navigation/MenuContext.tsx +++ b/scm-ui/ui-components/src/navigation/MenuContext.tsx @@ -36,7 +36,7 @@ export const MenuContext = React.createContext<MenuContext>({ setCollapsed() {} }); -export const StateMenuContextProvider: FC = ({children}) => { +export const StateMenuContextProvider: FC = ({ children }) => { const [collapsed, setCollapsed] = useState(false); const context = { diff --git a/scm-ui/ui-components/src/navigation/RoutingProps.ts b/scm-ui/ui-components/src/navigation/RoutingProps.ts index e34f62b97c..20f9d8d900 100644 --- a/scm-ui/ui-components/src/navigation/RoutingProps.ts +++ b/scm-ui/ui-components/src/navigation/RoutingProps.ts @@ -26,4 +26,4 @@ export type RoutingProps = { to: string; activeOnlyWhenExact?: boolean; activeWhenMatch?: (route: any) => boolean; -} +}; diff --git a/scm-ui/ui-components/src/navigation/SecondaryNavigationItem.tsx b/scm-ui/ui-components/src/navigation/SecondaryNavigationItem.tsx index 33924c4a29..698eafe34a 100644 --- a/scm-ui/ui-components/src/navigation/SecondaryNavigationItem.tsx +++ b/scm-ui/ui-components/src/navigation/SecondaryNavigationItem.tsx @@ -21,10 +21,10 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ -import React, {FC} from "react"; +import React, { FC } from "react"; import SubNavigation from "./SubNavigation"; import NavLink from "./NavLink"; -import {RoutingProps} from "./RoutingProps"; +import { RoutingProps } from "./RoutingProps"; type Props = RoutingProps & { label: string; diff --git a/scm-ui/ui-components/src/navigation/SubNavigation.tsx b/scm-ui/ui-components/src/navigation/SubNavigation.tsx index 2955527d78..56a6c438d3 100644 --- a/scm-ui/ui-components/src/navigation/SubNavigation.tsx +++ b/scm-ui/ui-components/src/navigation/SubNavigation.tsx @@ -21,11 +21,11 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ -import React, { FC, useContext} from "react"; +import React, { FC, useContext } from "react"; import { Link, useRouteMatch } from "react-router-dom"; import classNames from "classnames"; -import useMenuContext, {MenuContext} from "./MenuContext"; -import {RoutingProps} from "./RoutingProps"; +import useMenuContext, { MenuContext } from "./MenuContext"; +import { RoutingProps } from "./RoutingProps"; type Props = RoutingProps & { label: string; diff --git a/scm-ui/ui-components/src/repos/DiffFile.tsx b/scm-ui/ui-components/src/repos/DiffFile.tsx index 981423fabe..4b042f0c4d 100644 --- a/scm-ui/ui-components/src/repos/DiffFile.tsx +++ b/scm-ui/ui-components/src/repos/DiffFile.tsx @@ -291,11 +291,13 @@ class DiffFile extends React.Component<Props, State> { <DiffButton icon={sideBySide ? "align-left" : "columns"} tooltip={t(sideBySide ? "diff.combined" : "diff.sideBySide")} - onClick={() => this.toggleSideBySide(() => { - if (this.state.sideBySide) { - setCollapsed(true); - } - })} + onClick={() => + this.toggleSideBySide(() => { + if (this.state.sideBySide) { + setCollapsed(true); + } + }) + } /> )} </MenuContext.Consumer> diff --git a/scm-ui/ui-components/src/repos/RepositoryEntry.stories.tsx b/scm-ui/ui-components/src/repos/RepositoryEntry.stories.tsx index 250c4b18c7..4954d765ed 100644 --- a/scm-ui/ui-components/src/repos/RepositoryEntry.stories.tsx +++ b/scm-ui/ui-components/src/repos/RepositoryEntry.stories.tsx @@ -32,7 +32,7 @@ import { Binder, BinderContext } from "@scm-manager/ui-extensions"; import { Repository } from "@scm-manager/ui-types"; import Image from "../Image"; import Icon from "../Icon"; -import {MemoryRouter} from "react-router-dom"; +import { MemoryRouter } from "react-router-dom"; const baseDate = "2020-03-26T12:13:42+02:00"; diff --git a/scm-ui/ui-extensions/src/ExtensionPoint.test.tsx b/scm-ui/ui-extensions/src/ExtensionPoint.test.tsx index 0b39817186..0f627374bb 100644 --- a/scm-ui/ui-extensions/src/ExtensionPoint.test.tsx +++ b/scm-ui/ui-extensions/src/ExtensionPoint.test.tsx @@ -182,19 +182,19 @@ describe("ExtensionPoint test", () => { }); it("should render an instance with props", () => { - const Label = ({name}: {name: string}) => { + const Label = ({ name }: { name: string }) => { return <label>Extension {name}</label>; }; mockedBinder.hasExtension.mockReturnValue(true); mockedBinder.getExtension.mockReturnValue(<Label name="One" />); - const rendered = mount(<ExtensionPoint name="something.special" props={{name: "Two"}} />); + const rendered = mount(<ExtensionPoint name="something.special" props={{ name: "Two" }} />); expect(rendered.text()).toBe("Extension Two"); }); it("should transform extension, before render", () => { - const label = ({name = "One"}: {name: string}) => { + const label = ({ name = "One" }: { name: string }) => { return <label>Extension {name}</label>; }; mockedBinder.hasExtension.mockReturnValue(true); @@ -204,10 +204,10 @@ describe("ExtensionPoint test", () => { return { ...props, name: "Two" - } + }; }; const rendered = mount(<ExtensionPoint name="something.special" propTransformer={transformer} />); expect(rendered.text()).toBe("Extension Two"); - }) + }); }); diff --git a/scm-ui/ui-extensions/src/ExtensionPoint.tsx b/scm-ui/ui-extensions/src/ExtensionPoint.tsx index aad9ca7b09..f6a1dde719 100644 --- a/scm-ui/ui-extensions/src/ExtensionPoint.tsx +++ b/scm-ui/ui-extensions/src/ExtensionPoint.tsx @@ -23,7 +23,7 @@ */ import * as React from "react"; import { Binder } from "./binder"; -import {Component, FC, ReactNode} from "react"; +import { Component, FC, ReactNode } from "react"; import useBinder from "./useBinder"; type PropTransformer = (props: object) => object; @@ -48,11 +48,7 @@ const createInstance = (Component: any, props: object, key?: number) => { const renderAllExtensions = (binder: Binder, name: string, props: object) => { const extensions = binder.getExtensions(name, props); - return ( - <> - {extensions.map((cmp, index) => createInstance(cmp, props, index))} - </> - ); + return <>{extensions.map((cmp, index) => createInstance(cmp, props, index))}</>; }; const renderSingleExtension = (binder: Binder, name: string, props: object) => { diff --git a/yarn.lock b/yarn.lock index 7ebd28adce..1f60f6bbed 100644 --- a/yarn.lock +++ b/yarn.lock @@ -10020,6 +10020,16 @@ mini-css-extract-plugin@^0.8.0: schema-utils "^1.0.0" webpack-sources "^1.1.0" +mini-css-extract-plugin@^0.9.0: + version "0.9.0" + resolved "https://registry.yarnpkg.com/mini-css-extract-plugin/-/mini-css-extract-plugin-0.9.0.tgz#47f2cf07aa165ab35733b1fc97d4c46c0564339e" + integrity sha512-lp3GeY7ygcgAmVIcRPBVhIkf8Us7FZjA+ILpal44qLdSu11wmjKQ3d9k15lfD7pO4esu9eUIAW7qiYIBppv40A== + dependencies: + loader-utils "^1.1.0" + normalize-url "1.9.1" + schema-utils "^1.0.0" + webpack-sources "^1.1.0" + minimalistic-assert@^1.0.0, minimalistic-assert@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz#2e194de044626d4a10e7f7fbc00ce73e83e4d5c7" @@ -12247,10 +12257,10 @@ react-redux@^5.0.7: react-is "^16.6.0" react-lifecycles-compat "^3.0.0" -react-refresh@^0.7.2: - version "0.7.2" - resolved "https://registry.yarnpkg.com/react-refresh/-/react-refresh-0.7.2.tgz#f30978d21eb8cac6e2f2fde056a7d04f6844dd50" - integrity sha512-u5l7fhAJXecWUJzVxzMRU2Zvw8m4QmDNHlTrT5uo3KBlYBhmChd7syAakBoay1yIiVhx/8Fi7a6v6kQZfsw81Q== +react-refresh@^0.8.0: + version "0.8.1" + resolved "https://registry.yarnpkg.com/react-refresh/-/react-refresh-0.8.1.tgz#5500506ad6fc891fdd057d0bf3581f9310abc6a2" + integrity sha512-xZIKi49RtLUUSAZ4a4ut2xr+zr4+glOD5v0L413B55MPvlg4EQ6Ctx8PD4CmjlPGoAWmSCTmmkY59TErizNsow== react-router-dom@^5.1.2: version "5.1.2" From 6c6d6c127242e4cb27c03ee963838f2f221d159b Mon Sep 17 00:00:00 2001 From: Eduard Heimbuch <eduard.heimbuch@cloudogu.com> Date: Tue, 31 Mar 2020 17:15:09 +0200 Subject: [PATCH 42/44] reformat components with prettier --- scm-ui/ui-webapp/src/admin/containers/Admin.tsx | 2 +- .../ui-webapp/src/admin/plugins/components/PluginModal.tsx | 4 +--- .../src/admin/plugins/components/ShowPendingModal.tsx | 1 - scm-ui/ui-webapp/src/repos/containers/Create.tsx | 7 ++++++- scm-ui/ui-webapp/src/repos/sources/modules/sources.ts | 2 +- 5 files changed, 9 insertions(+), 7 deletions(-) diff --git a/scm-ui/ui-webapp/src/admin/containers/Admin.tsx b/scm-ui/ui-webapp/src/admin/containers/Admin.tsx index ebfaaa1325..089cb959fb 100644 --- a/scm-ui/ui-webapp/src/admin/containers/Admin.tsx +++ b/scm-ui/ui-webapp/src/admin/containers/Admin.tsx @@ -44,7 +44,7 @@ import GlobalConfig from "./GlobalConfig"; import RepositoryRoles from "../roles/containers/RepositoryRoles"; import SingleRepositoryRole from "../roles/containers/SingleRepositoryRole"; import CreateRepositoryRole from "../roles/containers/CreateRepositoryRole"; -import {StateMenuContextProvider} from "@scm-manager/ui-components/src/navigation/MenuContext"; +import { StateMenuContextProvider } from "@scm-manager/ui-components/src/navigation/MenuContext"; type Props = RouteComponentProps & WithTranslation & { diff --git a/scm-ui/ui-webapp/src/admin/plugins/components/PluginModal.tsx b/scm-ui/ui-webapp/src/admin/plugins/components/PluginModal.tsx index 1074588e59..05ddf1f848 100644 --- a/scm-ui/ui-webapp/src/admin/plugins/components/PluginModal.tsx +++ b/scm-ui/ui-webapp/src/admin/plugins/components/PluginModal.tsx @@ -278,9 +278,7 @@ class PluginModal extends React.Component<Props, State> { </div> </div> <div className="media"> - <div className="media-content"> - {this.createRestartSectionContent()} - </div> + <div className="media-content">{this.createRestartSectionContent()}</div> </div> {this.renderNotifications()} </> diff --git a/scm-ui/ui-webapp/src/admin/plugins/components/ShowPendingModal.tsx b/scm-ui/ui-webapp/src/admin/plugins/components/ShowPendingModal.tsx index d28b51f927..c9ee5462d4 100644 --- a/scm-ui/ui-webapp/src/admin/plugins/components/ShowPendingModal.tsx +++ b/scm-ui/ui-webapp/src/admin/plugins/components/ShowPendingModal.tsx @@ -27,7 +27,6 @@ import { PendingPlugins } from "@scm-manager/ui-types"; import { useTranslation } from "react-i18next"; import PendingPluginsQueue from "./PendingPluginsQueue"; - type ModalBodyProps = { pendingPlugins: PendingPlugins; }; diff --git a/scm-ui/ui-webapp/src/repos/containers/Create.tsx b/scm-ui/ui-webapp/src/repos/containers/Create.tsx index 1c8ff8a824..0ef6121afc 100644 --- a/scm-ui/ui-webapp/src/repos/containers/Create.tsx +++ b/scm-ui/ui-webapp/src/repos/containers/Create.tsx @@ -54,7 +54,12 @@ type Props = WithTranslation & { // dispatch functions fetchNamespaceStrategiesIfNeeded: () => void; fetchRepositoryTypesIfNeeded: () => void; - createRepo: (link: string, repository: Repository, initRepository: boolean, callback: (repo: Repository) => void) => void; + createRepo: ( + link: string, + repository: Repository, + initRepository: boolean, + callback: (repo: Repository) => void + ) => void; resetForm: () => void; // context props diff --git a/scm-ui/ui-webapp/src/repos/sources/modules/sources.ts b/scm-ui/ui-webapp/src/repos/sources/modules/sources.ts index a7ffac791a..b69cadd017 100644 --- a/scm-ui/ui-webapp/src/repos/sources/modules/sources.ts +++ b/scm-ui/ui-webapp/src/repos/sources/modules/sources.ts @@ -176,7 +176,7 @@ export default function reducer( pending: false } }; - } else if (action.itemId && (action.type === FETCH_UPDATES_SUCCESS)) { + } else if (action.itemId && action.type === FETCH_UPDATES_SUCCESS) { return { ...state, [action.itemId + action.payload.hunk]: { From 57baf8a04d963e889425085a63529a94e4964132 Mon Sep 17 00:00:00 2001 From: eheimbuch <eduard.heimbuch@cloudogu.com> Date: Tue, 31 Mar 2020 18:29:36 +0200 Subject: [PATCH 43/44] Update Release process.md --- docs/v2/Release process.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/docs/v2/Release process.md b/docs/v2/Release process.md index 623b61f3dd..b996e50fbd 100644 --- a/docs/v2/Release process.md +++ b/docs/v2/Release process.md @@ -114,3 +114,9 @@ Edit `package.json`: `version` has to be set to the new development version. git commit -am "Prepare for next development iteration" git push origin develop ``` +## Attention: Creating new plugins +If you are creating a new plugin which doesn't exist in the SCM-Manager Plugin-Center yet, your plugin will not be shown after the release. First you have to create a `index.md` in the Plugin-Center Repository. + +Example: https://github.com/scm-manager/plugin-center/blob/master/src/plugins/scm-teamscale-plugin/index.md + +- From 1c21562c961c165bf9611a4f3cd74cfd25d84b3a Mon Sep 17 00:00:00 2001 From: eheimbuch <eduard.heimbuch@cloudogu.com> Date: Tue, 31 Mar 2020 18:29:58 +0200 Subject: [PATCH 44/44] Update Release process.md --- docs/v2/Release process.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/docs/v2/Release process.md b/docs/v2/Release process.md index b996e50fbd..83f4db8ce2 100644 --- a/docs/v2/Release process.md +++ b/docs/v2/Release process.md @@ -118,5 +118,3 @@ git push origin develop If you are creating a new plugin which doesn't exist in the SCM-Manager Plugin-Center yet, your plugin will not be shown after the release. First you have to create a `index.md` in the Plugin-Center Repository. Example: https://github.com/scm-manager/plugin-center/blob/master/src/plugins/scm-teamscale-plugin/index.md - --