mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-02 11:35:57 +01:00
Merge branch 'develop' into feature/commit_mention_links_markdown
This commit is contained in:
@@ -4,10 +4,17 @@ 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/),
|
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).
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
||||||
|
|
||||||
|
|
||||||
## Unreleased
|
## Unreleased
|
||||||
### Added
|
### Added
|
||||||
- enrich commit mentions in markdown viewer by internal links ([#1210](https://github.com/scm-manager/scm-manager/pull/1210))
|
- enrich commit mentions in markdown viewer by internal links ([#1210](https://github.com/scm-manager/scm-manager/pull/1210))
|
||||||
|
|
||||||
|
## [2.1.1] - 2020-06-23
|
||||||
|
### Fixed
|
||||||
|
- Wait until recommended java installation is available for deb packages ([#1209](https://github.com/scm-manager/scm-manager/pull/1209))
|
||||||
|
- Do not force java home of recommended java dependency for rpm and deb packages ([#1195](https://github.com/scm-manager/scm-manager/issues/1195) and [#1208](https://github.com/scm-manager/scm-manager/pull/1208))
|
||||||
|
- Migration of non-bare repositories ([#1213](https://github.com/scm-manager/scm-manager/pull/1213))
|
||||||
|
|
||||||
## [2.1.0] - 2020-06-18
|
## [2.1.0] - 2020-06-18
|
||||||
### Added
|
### Added
|
||||||
- Option to configure jvm parameter of docker container with env JAVA_OPTS or with arguments ([#1175](https://github.com/scm-manager/scm-manager/pull/1175))
|
- Option to configure jvm parameter of docker container with env JAVA_OPTS or with arguments ([#1175](https://github.com/scm-manager/scm-manager/pull/1175))
|
||||||
@@ -29,6 +36,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||||||
- Fixed active state of sub navigation items, which are using activeWhenMatch ([#1199](https://github.com/scm-manager/scm-manager/pull/1199))
|
- Fixed active state of sub navigation items, which are using activeWhenMatch ([#1199](https://github.com/scm-manager/scm-manager/pull/1199))
|
||||||
- Handles repositories in custom directories correctly in migration from 1.x ([#1201](https://github.com/scm-manager/scm-manager/pull/1201))
|
- Handles repositories in custom directories correctly in migration from 1.x ([#1201](https://github.com/scm-manager/scm-manager/pull/1201))
|
||||||
- Usage of short git commit ids in changeset urls ([#1200](https://github.com/scm-manager/scm-manager/pull/1200))
|
- Usage of short git commit ids in changeset urls ([#1200](https://github.com/scm-manager/scm-manager/pull/1200))
|
||||||
|
- Fixes linebreaks in multiline tooltip ([#1207](https://github.com/scm-manager/scm-manager/pull/1207))
|
||||||
|
|
||||||
## [2.0.0] - 2020-06-04
|
## [2.0.0] - 2020-06-04
|
||||||
### Added
|
### Added
|
||||||
|
|||||||
@@ -33,10 +33,6 @@ title: Intellij IDEA Configuration
|
|||||||
* Languages & Frameworks / Node.js and NPM
|
* Languages & Frameworks / Node.js and NPM
|
||||||
* Package Manager: yarn
|
* Package Manager: yarn
|
||||||
|
|
||||||
* Languages & Frameworks / Javascript
|
|
||||||
* JavaScript language version: Flow
|
|
||||||
* Flow package or executable: .../node_modules/flow-bin
|
|
||||||
|
|
||||||
* Languages & Frameworks / Javascript / Code Quality Tools / ESLint
|
* Languages & Frameworks / Javascript / Code Quality Tools / ESLint
|
||||||
* Enable
|
* Enable
|
||||||
* ESLint package: .../node_modules/eslint
|
* ESLint package: .../node_modules/eslint
|
||||||
|
|||||||
@@ -5,5 +5,5 @@
|
|||||||
],
|
],
|
||||||
"npmClient": "yarn",
|
"npmClient": "yarn",
|
||||||
"useWorkspaces": true,
|
"useWorkspaces": true,
|
||||||
"version": "2.1.0"
|
"version": "2.1.1"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -36,4 +36,8 @@ systemctl daemon-reload
|
|||||||
|
|
||||||
# enable and start the service
|
# enable and start the service
|
||||||
sudo systemctl enable scm-server
|
sudo systemctl enable scm-server
|
||||||
sudo systemctl start scm-server
|
|
||||||
|
# we start scm-manager after 5 seconds
|
||||||
|
# this is required, because if we install scm-manager with recommend java
|
||||||
|
# java is not fully setup if we ran our postint script
|
||||||
|
echo "sleep 5; sudo systemctl start scm-server" | at now
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ USER=scm
|
|||||||
export SCM_HOME=/var/lib/scm
|
export SCM_HOME=/var/lib/scm
|
||||||
|
|
||||||
# force jvm path
|
# force jvm path
|
||||||
JAVA_HOME="/usr/lib/jvm/java-11-openjdk-amd64"
|
# JAVA_HOME="/usr/lib/jvm/java-11-openjdk-amd64"
|
||||||
|
|
||||||
# path to pid
|
# path to pid
|
||||||
PIDFILE=/var/run/scm/scm.pid
|
PIDFILE=/var/run/scm/scm.pid
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ USER=scm
|
|||||||
export SCM_HOME=/var/lib/scm
|
export SCM_HOME=/var/lib/scm
|
||||||
|
|
||||||
# force jvm path
|
# force jvm path
|
||||||
JAVA_HOME="/usr/lib/jvm/jre-11"
|
# JAVA_HOME="/usr/lib/jvm/jre-11"
|
||||||
|
|
||||||
# path to pid
|
# path to pid
|
||||||
PIDFILE=/var/run/scm/scm.pid
|
PIDFILE=/var/run/scm/scm.pid
|
||||||
|
|||||||
@@ -71,11 +71,11 @@
|
|||||||
<goal>wget</goal>
|
<goal>wget</goal>
|
||||||
</goals>
|
</goals>
|
||||||
<configuration>
|
<configuration>
|
||||||
<url>https://github.com/winsw/winsw/releases/download/v2.8.0/WinSW.NETCore31.x64.exe</url>
|
<url>https://github.com/winsw/winsw/releases/download/v2.9.0/WinSW.NETCore31.x64.exe</url>
|
||||||
<unpack>false</unpack>
|
<unpack>false</unpack>
|
||||||
<outputFileName>scm-server.exe</outputFileName>
|
<outputFileName>scm-server.exe</outputFileName>
|
||||||
<outputDirectory>${project.build.directory}/windows</outputDirectory>
|
<outputDirectory>${project.build.directory}/windows</outputDirectory>
|
||||||
<sha256>ebb2bb0ab0746ff5a20f65c76855a71c53aa806eb55ebd08fd18ded51ea23b58</sha256>
|
<sha256>59d29a41652cfc9a564c9c05d77976391833a6fb686bce941ad89f8f8dff120b</sha256>
|
||||||
</configuration>
|
</configuration>
|
||||||
</execution>
|
</execution>
|
||||||
</executions>
|
</executions>
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "@scm-manager/scm-git-plugin",
|
"name": "@scm-manager/scm-git-plugin",
|
||||||
"private": true,
|
"private": true,
|
||||||
"version": "2.1.0",
|
"version": "2.1.1",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"main": "./src/main/js/index.ts",
|
"main": "./src/main/js/index.ts",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
@@ -20,6 +20,6 @@
|
|||||||
},
|
},
|
||||||
"prettier": "@scm-manager/prettier-config",
|
"prettier": "@scm-manager/prettier-config",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@scm-manager/ui-plugins": "^2.1.0"
|
"@scm-manager/ui-plugins": "^2.1.1"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -38,6 +38,7 @@ import sonia.scm.version.Version;
|
|||||||
import javax.inject.Inject;
|
import javax.inject.Inject;
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
import java.nio.file.Files;
|
||||||
import java.nio.file.Path;
|
import java.nio.file.Path;
|
||||||
|
|
||||||
import static sonia.scm.version.Version.parse;
|
import static sonia.scm.version.Version.parse;
|
||||||
@@ -60,7 +61,8 @@ public class GitV2UpdateStep implements UpdateStep {
|
|||||||
(repositoryId, path) -> {
|
(repositoryId, path) -> {
|
||||||
Repository repository = repositoryMetadataAccess.read(path);
|
Repository repository = repositoryMetadataAccess.read(path);
|
||||||
if (isGitDirectory(repository)) {
|
if (isGitDirectory(repository)) {
|
||||||
try (org.eclipse.jgit.lib.Repository gitRepository = build(path.resolve("data").toFile())) {
|
final Path effectiveGitPath = determineEffectiveGitFolder(path);
|
||||||
|
try (org.eclipse.jgit.lib.Repository gitRepository = build(effectiveGitPath.toFile())) {
|
||||||
new GitConfigHelper().createScmmConfig(repository, gitRepository);
|
new GitConfigHelper().createScmmConfig(repository, gitRepository);
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
throw new UpdateException("could not update repository with id " + repositoryId + " in path " + path, e);
|
throw new UpdateException("could not update repository with id " + repositoryId + " in path " + path, e);
|
||||||
@@ -70,6 +72,18 @@ public class GitV2UpdateStep implements UpdateStep {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Path determineEffectiveGitFolder(Path path) {
|
||||||
|
Path bareGitFolder = path.resolve("data");
|
||||||
|
Path nonBareGitFolder = bareGitFolder.resolve(".git");
|
||||||
|
final Path effectiveGitPath;
|
||||||
|
if (Files.exists(nonBareGitFolder)) {
|
||||||
|
effectiveGitPath = nonBareGitFolder;
|
||||||
|
} else {
|
||||||
|
effectiveGitPath = bareGitFolder;
|
||||||
|
}
|
||||||
|
return effectiveGitPath;
|
||||||
|
}
|
||||||
|
|
||||||
private org.eclipse.jgit.lib.Repository build(File directory) throws IOException {
|
private org.eclipse.jgit.lib.Repository build(File directory) throws IOException {
|
||||||
return new FileRepositoryBuilder()
|
return new FileRepositoryBuilder()
|
||||||
.setGitDir(directory)
|
.setGitDir(directory)
|
||||||
|
|||||||
@@ -0,0 +1,92 @@
|
|||||||
|
/*
|
||||||
|
* 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.repository.update;
|
||||||
|
|
||||||
|
import org.junit.jupiter.api.BeforeEach;
|
||||||
|
import org.junit.jupiter.api.Test;
|
||||||
|
import org.junit.jupiter.api.extension.ExtendWith;
|
||||||
|
import org.junit.jupiter.api.io.TempDir;
|
||||||
|
import org.mockito.InjectMocks;
|
||||||
|
import org.mockito.Mock;
|
||||||
|
import org.mockito.junit.jupiter.MockitoExtension;
|
||||||
|
import sonia.scm.repository.Repository;
|
||||||
|
import sonia.scm.repository.RepositoryLocationResolver;
|
||||||
|
import sonia.scm.update.UpdateStepRepositoryMetadataAccess;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.nio.file.Files;
|
||||||
|
import java.nio.file.Path;
|
||||||
|
import java.util.function.BiConsumer;
|
||||||
|
|
||||||
|
import static org.assertj.core.api.Assertions.assertThat;
|
||||||
|
import static org.mockito.ArgumentMatchers.any;
|
||||||
|
import static org.mockito.Mockito.doAnswer;
|
||||||
|
import static org.mockito.Mockito.when;
|
||||||
|
|
||||||
|
@ExtendWith(MockitoExtension.class)
|
||||||
|
class GitV2UpdateStepTest {
|
||||||
|
|
||||||
|
@Mock
|
||||||
|
RepositoryLocationResolver locationResolver;
|
||||||
|
@Mock
|
||||||
|
RepositoryLocationResolver.RepositoryLocationResolverInstance<Path> locationResolverInstance;
|
||||||
|
@Mock
|
||||||
|
UpdateStepRepositoryMetadataAccess<Path> repositoryMetadataAccess;
|
||||||
|
|
||||||
|
@InjectMocks
|
||||||
|
GitV2UpdateStep updateStep;
|
||||||
|
|
||||||
|
@BeforeEach
|
||||||
|
void createDataDirectory(@TempDir Path temp) throws IOException {
|
||||||
|
Files.createDirectories(temp.resolve("data"));
|
||||||
|
}
|
||||||
|
|
||||||
|
@BeforeEach
|
||||||
|
void initRepositoryFolder(@TempDir Path temp) {
|
||||||
|
when(locationResolver.forClass(Path.class)).thenReturn(locationResolverInstance);
|
||||||
|
when(repositoryMetadataAccess.read(temp)).thenReturn(new Repository("123", "git", "space", "X"));
|
||||||
|
doAnswer(invocation -> {
|
||||||
|
invocation.getArgument(0, BiConsumer.class).accept("123", temp);
|
||||||
|
return null;
|
||||||
|
}).when(locationResolverInstance).forAllLocations(any());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
void shouldWriteConfigFileForBareRepositories(@TempDir Path temp) {
|
||||||
|
updateStep.doUpdate();
|
||||||
|
|
||||||
|
assertThat(temp.resolve("data").resolve("config")).exists();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
void shouldWriteConfigFileForNonBareRepositories(@TempDir Path temp) throws IOException {
|
||||||
|
Files.createDirectories(temp.resolve("data").resolve(".git"));
|
||||||
|
|
||||||
|
updateStep.doUpdate();
|
||||||
|
|
||||||
|
assertThat(temp.resolve("data").resolve("config")).doesNotExist();
|
||||||
|
assertThat(temp.resolve("data").resolve(".git").resolve("config")).exists();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "@scm-manager/scm-hg-plugin",
|
"name": "@scm-manager/scm-hg-plugin",
|
||||||
"private": true,
|
"private": true,
|
||||||
"version": "2.1.0",
|
"version": "2.1.1",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"main": "./src/main/js/index.ts",
|
"main": "./src/main/js/index.ts",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
@@ -19,6 +19,6 @@
|
|||||||
},
|
},
|
||||||
"prettier": "@scm-manager/prettier-config",
|
"prettier": "@scm-manager/prettier-config",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@scm-manager/ui-plugins": "^2.1.0"
|
"@scm-manager/ui-plugins": "^2.1.1"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "@scm-manager/scm-legacy-plugin",
|
"name": "@scm-manager/scm-legacy-plugin",
|
||||||
"private": true,
|
"private": true,
|
||||||
"version": "2.1.0",
|
"version": "2.1.1",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"main": "./src/main/js/index.tsx",
|
"main": "./src/main/js/index.tsx",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
@@ -19,6 +19,6 @@
|
|||||||
},
|
},
|
||||||
"prettier": "@scm-manager/prettier-config",
|
"prettier": "@scm-manager/prettier-config",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@scm-manager/ui-plugins": "^2.1.0"
|
"@scm-manager/ui-plugins": "^2.1.1"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "@scm-manager/scm-svn-plugin",
|
"name": "@scm-manager/scm-svn-plugin",
|
||||||
"private": true,
|
"private": true,
|
||||||
"version": "2.1.0",
|
"version": "2.1.1",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"main": "./src/main/js/index.ts",
|
"main": "./src/main/js/index.ts",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
@@ -19,6 +19,6 @@
|
|||||||
},
|
},
|
||||||
"prettier": "@scm-manager/prettier-config",
|
"prettier": "@scm-manager/prettier-config",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@scm-manager/ui-plugins": "^2.1.0"
|
"@scm-manager/ui-plugins": "^2.1.1"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -76,6 +76,7 @@ public class SvnRepositoryHandler
|
|||||||
|
|
||||||
private static final Logger logger =
|
private static final Logger logger =
|
||||||
LoggerFactory.getLogger(SvnRepositoryHandler.class);
|
LoggerFactory.getLogger(SvnRepositoryHandler.class);
|
||||||
|
private SvnRepositoryHook hook;
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
public SvnRepositoryHandler(ConfigurationStoreFactory storeFactory,
|
public SvnRepositoryHandler(ConfigurationStoreFactory storeFactory,
|
||||||
@@ -94,7 +95,8 @@ public class SvnRepositoryHandler
|
|||||||
// register hook
|
// register hook
|
||||||
if (eventFacade != null)
|
if (eventFacade != null)
|
||||||
{
|
{
|
||||||
FSHooks.registerHook(new SvnRepositoryHook(eventFacade, this));
|
hook = new SvnRepositoryHook(eventFacade, this);
|
||||||
|
FSHooks.registerHook(hook);
|
||||||
}
|
}
|
||||||
else if (logger.isWarnEnabled())
|
else if (logger.isWarnEnabled())
|
||||||
{
|
{
|
||||||
@@ -212,4 +214,12 @@ public class SvnRepositoryHandler
|
|||||||
String getRepositoryId(File directory) {
|
String getRepositoryId(File directory) {
|
||||||
return new SvnConfigHelper().getRepositoryId(directory);
|
return new SvnConfigHelper().getRepositoryId(directory);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void close() throws IOException {
|
||||||
|
if (hook != null) {
|
||||||
|
FSHooks.unregisterHook(hook);
|
||||||
|
}
|
||||||
|
super.close();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -59,6 +59,8 @@ public class SvnRepositoryHandlerTest extends SimpleRepositoryHandlerTestBase {
|
|||||||
|
|
||||||
private HookEventFacade facade = new HookEventFacade(repositoryManagerProvider, hookContextFactory);
|
private HookEventFacade facade = new HookEventFacade(repositoryManagerProvider, hookContextFactory);
|
||||||
|
|
||||||
|
private SvnRepositoryHandler handler;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void postSetUp() throws IOException, RepositoryPathNotFoundException {
|
protected void postSetUp() throws IOException, RepositoryPathNotFoundException {
|
||||||
initMocks(this);
|
initMocks(this);
|
||||||
@@ -82,7 +84,7 @@ public class SvnRepositoryHandlerTest extends SimpleRepositoryHandlerTestBase {
|
|||||||
protected RepositoryHandler createRepositoryHandler(ConfigurationStoreFactory factory,
|
protected RepositoryHandler createRepositoryHandler(ConfigurationStoreFactory factory,
|
||||||
RepositoryLocationResolver locationResolver,
|
RepositoryLocationResolver locationResolver,
|
||||||
File directory) {
|
File directory) {
|
||||||
SvnRepositoryHandler handler = new SvnRepositoryHandler(factory, null, locationResolver, null);
|
SvnRepositoryHandler handler = new SvnRepositoryHandler(factory, facade, locationResolver, null);
|
||||||
|
|
||||||
handler.init(contextProvider);
|
handler.init(contextProvider);
|
||||||
|
|
||||||
@@ -95,16 +97,20 @@ public class SvnRepositoryHandlerTest extends SimpleRepositoryHandlerTestBase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void getDirectory() {
|
public void getDirectory() throws IOException {
|
||||||
when(factory.withType(any())).thenCallRealMethod();
|
when(factory.withType(any())).thenCallRealMethod();
|
||||||
SvnRepositoryHandler repositoryHandler = new SvnRepositoryHandler(factory,
|
SvnRepositoryHandler repositoryHandler = new SvnRepositoryHandler(factory,
|
||||||
facade, locationResolver, null);
|
facade, locationResolver, null);
|
||||||
|
|
||||||
|
try {
|
||||||
SvnConfig svnConfig = new SvnConfig();
|
SvnConfig svnConfig = new SvnConfig();
|
||||||
repositoryHandler.setConfig(svnConfig);
|
repositoryHandler.setConfig(svnConfig);
|
||||||
|
|
||||||
initRepository();
|
initRepository();
|
||||||
File path = repositoryHandler.getDirectory(repository.getId());
|
File path = repositoryHandler.getDirectory(repository.getId());
|
||||||
assertEquals(repoPath.toString() + File.separator + RepositoryDirectoryHandler.REPOSITORIES_NATIVE_DIRECTORY, path.getAbsolutePath());
|
assertEquals(repoPath.toString() + File.separator + RepositoryDirectoryHandler.REPOSITORIES_NATIVE_DIRECTORY, path.getAbsolutePath());
|
||||||
|
} finally {
|
||||||
|
repositoryHandler.close();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@scm-manager/ui-components",
|
"name": "@scm-manager/ui-components",
|
||||||
"version": "2.1.0",
|
"version": "2.1.1",
|
||||||
"description": "UI Components for SCM-Manager and its plugins",
|
"description": "UI Components for SCM-Manager and its plugins",
|
||||||
"main": "src/index.ts",
|
"main": "src/index.ts",
|
||||||
"files": [
|
"files": [
|
||||||
|
|||||||
@@ -32,24 +32,38 @@ import Button from "./buttons/Button";
|
|||||||
|
|
||||||
const Wrapper = styled.div`
|
const Wrapper = styled.div`
|
||||||
margin: 2rem;
|
margin: 2rem;
|
||||||
max-width: 400px;
|
width: 100%;
|
||||||
`;
|
`;
|
||||||
|
|
||||||
const Spacing = styled.div`
|
const Spacing = styled.div`
|
||||||
padding: 2em 6em;
|
padding: 2em 6em;
|
||||||
|
width: 50%;
|
||||||
|
margin: 0 auto;
|
||||||
`;
|
`;
|
||||||
|
|
||||||
const positions = ["right", "top", "left", "bottom"];
|
const positions = ["right", "top", "left", "bottom"];
|
||||||
|
|
||||||
const message = "Heart of Gold";
|
const message = "Heart of Gold";
|
||||||
|
|
||||||
|
const mutltiline = `Characters:
|
||||||
|
|
||||||
|
- Arthur Dent
|
||||||
|
- Ford Prefect
|
||||||
|
- Zaphod Beeblebrox
|
||||||
|
- Marvin the Paranoid Android
|
||||||
|
- Trillian
|
||||||
|
- Slartibartfast`;
|
||||||
|
|
||||||
|
const shortMultiline = `* a
|
||||||
|
* b
|
||||||
|
* c`;
|
||||||
|
|
||||||
const RoutingDecorator = (story: () => ReactNode) => <MemoryRouter initialEntries={["/"]}>{story()}</MemoryRouter>;
|
const RoutingDecorator = (story: () => ReactNode) => <MemoryRouter initialEntries={["/"]}>{story()}</MemoryRouter>;
|
||||||
|
|
||||||
storiesOf("Tooltip", module)
|
storiesOf("Tooltip", module)
|
||||||
.addDecorator(RoutingDecorator)
|
.addDecorator(RoutingDecorator)
|
||||||
.addDecorator(storyFn => <Wrapper>{storyFn()}</Wrapper>)
|
|
||||||
.add("Default", () => (
|
.add("Default", () => (
|
||||||
<div>
|
<Wrapper>
|
||||||
{positions.map(position => (
|
{positions.map(position => (
|
||||||
<Spacing>
|
<Spacing>
|
||||||
<Tooltip message={message} location={position}>
|
<Tooltip message={message} location={position}>
|
||||||
@@ -57,5 +71,27 @@ storiesOf("Tooltip", module)
|
|||||||
</Tooltip>
|
</Tooltip>
|
||||||
</Spacing>
|
</Spacing>
|
||||||
))}
|
))}
|
||||||
</div>
|
</Wrapper>
|
||||||
|
))
|
||||||
|
.add("Multiline", () => (
|
||||||
|
<Wrapper>
|
||||||
|
{positions.map(position => (
|
||||||
|
<Spacing>
|
||||||
|
<Tooltip message={mutltiline} location={position}>
|
||||||
|
<Button label={position} color="info" />{" "}
|
||||||
|
</Tooltip>
|
||||||
|
</Spacing>
|
||||||
|
))}
|
||||||
|
</Wrapper>
|
||||||
|
))
|
||||||
|
.add("Short Multiline", () => (
|
||||||
|
<Wrapper>
|
||||||
|
{positions.map(position => (
|
||||||
|
<Spacing>
|
||||||
|
<Tooltip message={shortMultiline} location={position}>
|
||||||
|
<Button label={position} color="info" />{" "}
|
||||||
|
</Tooltip>
|
||||||
|
</Spacing>
|
||||||
|
))}
|
||||||
|
</Wrapper>
|
||||||
));
|
));
|
||||||
|
|||||||
@@ -38,9 +38,8 @@ class Tooltip extends React.Component<Props> {
|
|||||||
|
|
||||||
render() {
|
render() {
|
||||||
const { className, message, location, children } = this.props;
|
const { className, message, location, children } = this.props;
|
||||||
const multiline = message.length > 60 ? "has-tooltip-multiline" : "";
|
|
||||||
return (
|
return (
|
||||||
<span className={classNames("tooltip", "has-tooltip-" + location, multiline, className)} data-tooltip={message}>
|
<span className={classNames("tooltip", "has-tooltip-" + location, className)} data-tooltip={message}>
|
||||||
{children}
|
{children}
|
||||||
</span>
|
</span>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -17281,7 +17281,7 @@ exports[`Storyshots Diff File Controls 1`] = `
|
|||||||
className="control"
|
className="control"
|
||||||
>
|
>
|
||||||
<span
|
<span
|
||||||
className="tooltip has-tooltip-top has-tooltip-multiline"
|
className="tooltip has-tooltip-top"
|
||||||
data-tooltip="A skull and crossbones or death's head is a symbol consisting of a human skull and two long bones crossed together under or behind the skull. The design originates in the Late Middle Ages as a symbol of death and especially as a memento mori on tombstones."
|
data-tooltip="A skull and crossbones or death's head is a symbol consisting of a human skull and two long bones crossed together under or behind the skull. The design originates in the Late Middle Ages as a symbol of death and especially as a memento mori on tombstones."
|
||||||
>
|
>
|
||||||
<a
|
<a
|
||||||
@@ -17862,7 +17862,7 @@ exports[`Storyshots Diff File Controls 1`] = `
|
|||||||
className="control"
|
className="control"
|
||||||
>
|
>
|
||||||
<span
|
<span
|
||||||
className="tooltip has-tooltip-top has-tooltip-multiline"
|
className="tooltip has-tooltip-top"
|
||||||
data-tooltip="A skull and crossbones or death's head is a symbol consisting of a human skull and two long bones crossed together under or behind the skull. The design originates in the Late Middle Ages as a symbol of death and especially as a memento mori on tombstones."
|
data-tooltip="A skull and crossbones or death's head is a symbol consisting of a human skull and two long bones crossed together under or behind the skull. The design originates in the Late Middle Ages as a symbol of death and especially as a memento mori on tombstones."
|
||||||
>
|
>
|
||||||
<a
|
<a
|
||||||
@@ -18720,7 +18720,7 @@ exports[`Storyshots Diff File Controls 1`] = `
|
|||||||
className="control"
|
className="control"
|
||||||
>
|
>
|
||||||
<span
|
<span
|
||||||
className="tooltip has-tooltip-top has-tooltip-multiline"
|
className="tooltip has-tooltip-top"
|
||||||
data-tooltip="A skull and crossbones or death's head is a symbol consisting of a human skull and two long bones crossed together under or behind the skull. The design originates in the Late Middle Ages as a symbol of death and especially as a memento mori on tombstones."
|
data-tooltip="A skull and crossbones or death's head is a symbol consisting of a human skull and two long bones crossed together under or behind the skull. The design originates in the Late Middle Ages as a symbol of death and especially as a memento mori on tombstones."
|
||||||
>
|
>
|
||||||
<a
|
<a
|
||||||
@@ -19174,7 +19174,7 @@ exports[`Storyshots Diff File Controls 1`] = `
|
|||||||
className="control"
|
className="control"
|
||||||
>
|
>
|
||||||
<span
|
<span
|
||||||
className="tooltip has-tooltip-top has-tooltip-multiline"
|
className="tooltip has-tooltip-top"
|
||||||
data-tooltip="A skull and crossbones or death's head is a symbol consisting of a human skull and two long bones crossed together under or behind the skull. The design originates in the Late Middle Ages as a symbol of death and especially as a memento mori on tombstones."
|
data-tooltip="A skull and crossbones or death's head is a symbol consisting of a human skull and two long bones crossed together under or behind the skull. The design originates in the Late Middle Ages as a symbol of death and especially as a memento mori on tombstones."
|
||||||
>
|
>
|
||||||
<a
|
<a
|
||||||
@@ -19628,7 +19628,7 @@ exports[`Storyshots Diff File Controls 1`] = `
|
|||||||
className="control"
|
className="control"
|
||||||
>
|
>
|
||||||
<span
|
<span
|
||||||
className="tooltip has-tooltip-top has-tooltip-multiline"
|
className="tooltip has-tooltip-top"
|
||||||
data-tooltip="A skull and crossbones or death's head is a symbol consisting of a human skull and two long bones crossed together under or behind the skull. The design originates in the Late Middle Ages as a symbol of death and especially as a memento mori on tombstones."
|
data-tooltip="A skull and crossbones or death's head is a symbol consisting of a human skull and two long bones crossed together under or behind the skull. The design originates in the Late Middle Ages as a symbol of death and especially as a memento mori on tombstones."
|
||||||
>
|
>
|
||||||
<a
|
<a
|
||||||
@@ -20689,7 +20689,7 @@ exports[`Storyshots Diff File Controls 1`] = `
|
|||||||
className="control"
|
className="control"
|
||||||
>
|
>
|
||||||
<span
|
<span
|
||||||
className="tooltip has-tooltip-top has-tooltip-multiline"
|
className="tooltip has-tooltip-top"
|
||||||
data-tooltip="A skull and crossbones or death's head is a symbol consisting of a human skull and two long bones crossed together under or behind the skull. The design originates in the Late Middle Ages as a symbol of death and especially as a memento mori on tombstones."
|
data-tooltip="A skull and crossbones or death's head is a symbol consisting of a human skull and two long bones crossed together under or behind the skull. The design originates in the Late Middle Ages as a symbol of death and especially as a memento mori on tombstones."
|
||||||
>
|
>
|
||||||
<a
|
<a
|
||||||
@@ -43584,11 +43584,10 @@ exports[`Storyshots Toast Warning 1`] = `null`;
|
|||||||
|
|
||||||
exports[`Storyshots Tooltip Default 1`] = `
|
exports[`Storyshots Tooltip Default 1`] = `
|
||||||
<div
|
<div
|
||||||
className="Tooltipstories__Wrapper-sc-1c34uq-0 kMYfDl"
|
className="Tooltipstories__Wrapper-sc-1c34uq-0 QoXmo"
|
||||||
>
|
>
|
||||||
<div>
|
|
||||||
<div
|
<div
|
||||||
className="Tooltipstories__Spacing-sc-1c34uq-1 loCuMv"
|
className="Tooltipstories__Spacing-sc-1c34uq-1 fFVjYs"
|
||||||
>
|
>
|
||||||
<span
|
<span
|
||||||
className="tooltip has-tooltip-right"
|
className="tooltip has-tooltip-right"
|
||||||
@@ -43606,7 +43605,7 @@ exports[`Storyshots Tooltip Default 1`] = `
|
|||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div
|
||||||
className="Tooltipstories__Spacing-sc-1c34uq-1 loCuMv"
|
className="Tooltipstories__Spacing-sc-1c34uq-1 fFVjYs"
|
||||||
>
|
>
|
||||||
<span
|
<span
|
||||||
className="tooltip has-tooltip-top"
|
className="tooltip has-tooltip-top"
|
||||||
@@ -43624,7 +43623,7 @@ exports[`Storyshots Tooltip Default 1`] = `
|
|||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div
|
||||||
className="Tooltipstories__Spacing-sc-1c34uq-1 loCuMv"
|
className="Tooltipstories__Spacing-sc-1c34uq-1 fFVjYs"
|
||||||
>
|
>
|
||||||
<span
|
<span
|
||||||
className="tooltip has-tooltip-left"
|
className="tooltip has-tooltip-left"
|
||||||
@@ -43642,7 +43641,7 @@ exports[`Storyshots Tooltip Default 1`] = `
|
|||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div
|
||||||
className="Tooltipstories__Spacing-sc-1c34uq-1 loCuMv"
|
className="Tooltipstories__Spacing-sc-1c34uq-1 fFVjYs"
|
||||||
>
|
>
|
||||||
<span
|
<span
|
||||||
className="tooltip has-tooltip-bottom"
|
className="tooltip has-tooltip-bottom"
|
||||||
@@ -43660,5 +43659,198 @@ exports[`Storyshots Tooltip Default 1`] = `
|
|||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
`;
|
||||||
|
|
||||||
|
exports[`Storyshots Tooltip Multiline 1`] = `
|
||||||
|
<div
|
||||||
|
className="Tooltipstories__Wrapper-sc-1c34uq-0 QoXmo"
|
||||||
|
>
|
||||||
|
<div
|
||||||
|
className="Tooltipstories__Spacing-sc-1c34uq-1 fFVjYs"
|
||||||
|
>
|
||||||
|
<span
|
||||||
|
className="tooltip has-tooltip-right"
|
||||||
|
data-tooltip="Characters:
|
||||||
|
|
||||||
|
- Arthur Dent
|
||||||
|
- Ford Prefect
|
||||||
|
- Zaphod Beeblebrox
|
||||||
|
- Marvin the Paranoid Android
|
||||||
|
- Trillian
|
||||||
|
- Slartibartfast"
|
||||||
|
>
|
||||||
|
<button
|
||||||
|
className="button is-info"
|
||||||
|
onClick={[Function]}
|
||||||
|
type="button"
|
||||||
|
>
|
||||||
|
right
|
||||||
|
|
||||||
|
</button>
|
||||||
|
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
<div
|
||||||
|
className="Tooltipstories__Spacing-sc-1c34uq-1 fFVjYs"
|
||||||
|
>
|
||||||
|
<span
|
||||||
|
className="tooltip has-tooltip-top"
|
||||||
|
data-tooltip="Characters:
|
||||||
|
|
||||||
|
- Arthur Dent
|
||||||
|
- Ford Prefect
|
||||||
|
- Zaphod Beeblebrox
|
||||||
|
- Marvin the Paranoid Android
|
||||||
|
- Trillian
|
||||||
|
- Slartibartfast"
|
||||||
|
>
|
||||||
|
<button
|
||||||
|
className="button is-info"
|
||||||
|
onClick={[Function]}
|
||||||
|
type="button"
|
||||||
|
>
|
||||||
|
top
|
||||||
|
|
||||||
|
</button>
|
||||||
|
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
<div
|
||||||
|
className="Tooltipstories__Spacing-sc-1c34uq-1 fFVjYs"
|
||||||
|
>
|
||||||
|
<span
|
||||||
|
className="tooltip has-tooltip-left"
|
||||||
|
data-tooltip="Characters:
|
||||||
|
|
||||||
|
- Arthur Dent
|
||||||
|
- Ford Prefect
|
||||||
|
- Zaphod Beeblebrox
|
||||||
|
- Marvin the Paranoid Android
|
||||||
|
- Trillian
|
||||||
|
- Slartibartfast"
|
||||||
|
>
|
||||||
|
<button
|
||||||
|
className="button is-info"
|
||||||
|
onClick={[Function]}
|
||||||
|
type="button"
|
||||||
|
>
|
||||||
|
left
|
||||||
|
|
||||||
|
</button>
|
||||||
|
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
<div
|
||||||
|
className="Tooltipstories__Spacing-sc-1c34uq-1 fFVjYs"
|
||||||
|
>
|
||||||
|
<span
|
||||||
|
className="tooltip has-tooltip-bottom"
|
||||||
|
data-tooltip="Characters:
|
||||||
|
|
||||||
|
- Arthur Dent
|
||||||
|
- Ford Prefect
|
||||||
|
- Zaphod Beeblebrox
|
||||||
|
- Marvin the Paranoid Android
|
||||||
|
- Trillian
|
||||||
|
- Slartibartfast"
|
||||||
|
>
|
||||||
|
<button
|
||||||
|
className="button is-info"
|
||||||
|
onClick={[Function]}
|
||||||
|
type="button"
|
||||||
|
>
|
||||||
|
bottom
|
||||||
|
|
||||||
|
</button>
|
||||||
|
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
`;
|
||||||
|
|
||||||
|
exports[`Storyshots Tooltip Short Multiline 1`] = `
|
||||||
|
<div
|
||||||
|
className="Tooltipstories__Wrapper-sc-1c34uq-0 QoXmo"
|
||||||
|
>
|
||||||
|
<div
|
||||||
|
className="Tooltipstories__Spacing-sc-1c34uq-1 fFVjYs"
|
||||||
|
>
|
||||||
|
<span
|
||||||
|
className="tooltip has-tooltip-right"
|
||||||
|
data-tooltip="* a
|
||||||
|
* b
|
||||||
|
* c"
|
||||||
|
>
|
||||||
|
<button
|
||||||
|
className="button is-info"
|
||||||
|
onClick={[Function]}
|
||||||
|
type="button"
|
||||||
|
>
|
||||||
|
right
|
||||||
|
|
||||||
|
</button>
|
||||||
|
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
<div
|
||||||
|
className="Tooltipstories__Spacing-sc-1c34uq-1 fFVjYs"
|
||||||
|
>
|
||||||
|
<span
|
||||||
|
className="tooltip has-tooltip-top"
|
||||||
|
data-tooltip="* a
|
||||||
|
* b
|
||||||
|
* c"
|
||||||
|
>
|
||||||
|
<button
|
||||||
|
className="button is-info"
|
||||||
|
onClick={[Function]}
|
||||||
|
type="button"
|
||||||
|
>
|
||||||
|
top
|
||||||
|
|
||||||
|
</button>
|
||||||
|
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
<div
|
||||||
|
className="Tooltipstories__Spacing-sc-1c34uq-1 fFVjYs"
|
||||||
|
>
|
||||||
|
<span
|
||||||
|
className="tooltip has-tooltip-left"
|
||||||
|
data-tooltip="* a
|
||||||
|
* b
|
||||||
|
* c"
|
||||||
|
>
|
||||||
|
<button
|
||||||
|
className="button is-info"
|
||||||
|
onClick={[Function]}
|
||||||
|
type="button"
|
||||||
|
>
|
||||||
|
left
|
||||||
|
|
||||||
|
</button>
|
||||||
|
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
<div
|
||||||
|
className="Tooltipstories__Spacing-sc-1c34uq-1 fFVjYs"
|
||||||
|
>
|
||||||
|
<span
|
||||||
|
className="tooltip has-tooltip-bottom"
|
||||||
|
data-tooltip="* a
|
||||||
|
* b
|
||||||
|
* c"
|
||||||
|
>
|
||||||
|
<button
|
||||||
|
className="button is-info"
|
||||||
|
onClick={[Function]}
|
||||||
|
type="button"
|
||||||
|
>
|
||||||
|
bottom
|
||||||
|
|
||||||
|
</button>
|
||||||
|
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
`;
|
`;
|
||||||
|
|||||||
@@ -1,12 +1,12 @@
|
|||||||
{
|
{
|
||||||
"name": "@scm-manager/ui-plugins",
|
"name": "@scm-manager/ui-plugins",
|
||||||
"version": "2.1.0",
|
"version": "2.1.1",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"bin": {
|
"bin": {
|
||||||
"ui-plugins": "./bin/ui-plugins.js"
|
"ui-plugins": "./bin/ui-plugins.js"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@scm-manager/ui-components": "^2.1.0",
|
"@scm-manager/ui-components": "^2.1.1",
|
||||||
"@scm-manager/ui-extensions": "^2.1.0",
|
"@scm-manager/ui-extensions": "^2.1.0",
|
||||||
"classnames": "^2.2.6",
|
"classnames": "^2.2.6",
|
||||||
"query-string": "^5.0.1",
|
"query-string": "^5.0.1",
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
{
|
{
|
||||||
"name": "@scm-manager/ui-webapp",
|
"name": "@scm-manager/ui-webapp",
|
||||||
"version": "2.1.0",
|
"version": "2.1.1",
|
||||||
"private": true,
|
"private": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@scm-manager/ui-components": "^2.1.0",
|
"@scm-manager/ui-components": "^2.1.1",
|
||||||
"@scm-manager/ui-extensions": "^2.1.0",
|
"@scm-manager/ui-extensions": "^2.1.0",
|
||||||
"classnames": "^2.2.5",
|
"classnames": "^2.2.5",
|
||||||
"history": "^4.10.1",
|
"history": "^4.10.1",
|
||||||
|
|||||||
Reference in New Issue
Block a user