mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-17 10:41:06 +01:00
merge
This commit is contained in:
6
Jenkinsfile
vendored
6
Jenkinsfile
vendored
@@ -51,9 +51,9 @@ node('docker') {
|
|||||||
|
|
||||||
if (isMainBranch()) {
|
if (isMainBranch()) {
|
||||||
|
|
||||||
stage('Lifecycle') {
|
// stage('Lifecycle') {
|
||||||
nexusPolicyEvaluation iqApplication: selectedApplication('scm'), iqScanPatterns: [[scanPattern: 'scm-server/target/scm-server-app.zip']], iqStage: 'build'
|
// nexusPolicyEvaluation iqApplication: selectedApplication('scm'), iqScanPatterns: [[scanPattern: 'scm-server/target/scm-server-app.zip']], iqStage: 'build'
|
||||||
}
|
// }
|
||||||
|
|
||||||
stage('Archive') {
|
stage('Archive') {
|
||||||
archiveArtifacts 'scm-webapp/target/scm-webapp.war'
|
archiveArtifacts 'scm-webapp/target/scm-webapp.war'
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import com.fasterxml.jackson.databind.JsonNode;
|
|||||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||||
import sonia.scm.config.ConfigurationPermissions;
|
import sonia.scm.config.ConfigurationPermissions;
|
||||||
import sonia.scm.plugin.Extension;
|
import sonia.scm.plugin.Extension;
|
||||||
|
import sonia.scm.repository.GitConfig;
|
||||||
import sonia.scm.web.JsonEnricherBase;
|
import sonia.scm.web.JsonEnricherBase;
|
||||||
import sonia.scm.web.JsonEnricherContext;
|
import sonia.scm.web.JsonEnricherContext;
|
||||||
|
|
||||||
@@ -26,7 +27,7 @@ public class GitConfigInIndexResource extends JsonEnricherBase {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void enrich(JsonEnricherContext context) {
|
public void enrich(JsonEnricherContext context) {
|
||||||
if (resultHasMediaType(INDEX, context) && ConfigurationPermissions.list().isPermitted()) {
|
if (resultHasMediaType(INDEX, context) && ConfigurationPermissions.read(GitConfig.PERMISSION).isPermitted()) {
|
||||||
String gitConfigUrl = new LinkBuilder(scmPathInfoStore.get().get(), GitConfigResource.class)
|
String gitConfigUrl = new LinkBuilder(scmPathInfoStore.get().get(), GitConfigResource.class)
|
||||||
.method("get")
|
.method("get")
|
||||||
.parameters()
|
.parameters()
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ import java.net.URI;
|
|||||||
|
|
||||||
import static org.junit.Assert.assertEquals;
|
import static org.junit.Assert.assertEquals;
|
||||||
import static org.junit.Assert.assertFalse;
|
import static org.junit.Assert.assertFalse;
|
||||||
|
import static org.junit.Assert.assertTrue;
|
||||||
|
|
||||||
@SubjectAware(configuration = "classpath:sonia/scm/configuration/shiro.ini")
|
@SubjectAware(configuration = "classpath:sonia/scm/configuration/shiro.ini")
|
||||||
public class GitConfigInIndexResourceTest {
|
public class GitConfigInIndexResourceTest {
|
||||||
@@ -50,7 +51,7 @@ public class GitConfigInIndexResourceTest {
|
|||||||
|
|
||||||
gitConfigInIndexResource.enrich(context);
|
gitConfigInIndexResource.enrich(context);
|
||||||
|
|
||||||
assertFalse(root.get("_links").iterator().hasNext());
|
assertTrue(root.get("_links").iterator().hasNext());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import com.fasterxml.jackson.databind.JsonNode;
|
|||||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||||
import sonia.scm.config.ConfigurationPermissions;
|
import sonia.scm.config.ConfigurationPermissions;
|
||||||
import sonia.scm.plugin.Extension;
|
import sonia.scm.plugin.Extension;
|
||||||
|
import sonia.scm.repository.HgConfig;
|
||||||
import sonia.scm.web.JsonEnricherBase;
|
import sonia.scm.web.JsonEnricherBase;
|
||||||
import sonia.scm.web.JsonEnricherContext;
|
import sonia.scm.web.JsonEnricherContext;
|
||||||
|
|
||||||
@@ -26,7 +27,7 @@ public class HgConfigInIndexResource extends JsonEnricherBase {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void enrich(JsonEnricherContext context) {
|
public void enrich(JsonEnricherContext context) {
|
||||||
if (resultHasMediaType(INDEX, context) && ConfigurationPermissions.list().isPermitted()) {
|
if (resultHasMediaType(INDEX, context) && ConfigurationPermissions.read(HgConfig.PERMISSION).isPermitted()) {
|
||||||
String hgConfigUrl = new LinkBuilder(scmPathInfoStore.get().get(), HgConfigResource.class)
|
String hgConfigUrl = new LinkBuilder(scmPathInfoStore.get().get(), HgConfigResource.class)
|
||||||
.method("get")
|
.method("get")
|
||||||
.parameters()
|
.parameters()
|
||||||
|
|||||||
@@ -98,10 +98,6 @@ def callback(ui, repo, hooktype, node=None):
|
|||||||
return abort
|
return abort
|
||||||
|
|
||||||
def preHook(ui, repo, hooktype, node=None, source=None, pending=None, **kwargs):
|
def preHook(ui, repo, hooktype, node=None, source=None, pending=None, **kwargs):
|
||||||
log_file = open("/tmp/hg_callback.log", "a")
|
|
||||||
log_file.write("in callHookUrl\n")
|
|
||||||
log_file.close()
|
|
||||||
|
|
||||||
# older mercurial versions
|
# older mercurial versions
|
||||||
if pending != None:
|
if pending != None:
|
||||||
pending()
|
pending()
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ import java.net.URI;
|
|||||||
|
|
||||||
import static org.junit.Assert.assertEquals;
|
import static org.junit.Assert.assertEquals;
|
||||||
import static org.junit.Assert.assertFalse;
|
import static org.junit.Assert.assertFalse;
|
||||||
|
import static org.junit.Assert.assertTrue;
|
||||||
|
|
||||||
@SubjectAware(configuration = "classpath:sonia/scm/configuration/shiro.ini")
|
@SubjectAware(configuration = "classpath:sonia/scm/configuration/shiro.ini")
|
||||||
public class HgConfigInIndexResourceTest {
|
public class HgConfigInIndexResourceTest {
|
||||||
@@ -50,7 +51,7 @@ public class HgConfigInIndexResourceTest {
|
|||||||
|
|
||||||
hgConfigInIndexResource.enrich(context);
|
hgConfigInIndexResource.enrich(context);
|
||||||
|
|
||||||
assertFalse(root.get("_links").iterator().hasNext());
|
assertTrue(root.get("_links").iterator().hasNext());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import com.fasterxml.jackson.databind.JsonNode;
|
|||||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||||
import sonia.scm.config.ConfigurationPermissions;
|
import sonia.scm.config.ConfigurationPermissions;
|
||||||
import sonia.scm.plugin.Extension;
|
import sonia.scm.plugin.Extension;
|
||||||
|
import sonia.scm.repository.SvnConfig;
|
||||||
import sonia.scm.web.JsonEnricherBase;
|
import sonia.scm.web.JsonEnricherBase;
|
||||||
import sonia.scm.web.JsonEnricherContext;
|
import sonia.scm.web.JsonEnricherContext;
|
||||||
|
|
||||||
@@ -26,7 +27,7 @@ public class SvnConfigInIndexResource extends JsonEnricherBase {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void enrich(JsonEnricherContext context) {
|
public void enrich(JsonEnricherContext context) {
|
||||||
if (resultHasMediaType(INDEX, context) && ConfigurationPermissions.list().isPermitted()) {
|
if (resultHasMediaType(INDEX, context) && ConfigurationPermissions.read(SvnConfig.PERMISSION).isPermitted()) {
|
||||||
String svnConfigUrl = new LinkBuilder(scmPathInfoStore.get().get(), SvnConfigResource.class)
|
String svnConfigUrl = new LinkBuilder(scmPathInfoStore.get().get(), SvnConfigResource.class)
|
||||||
.method("get")
|
.method("get")
|
||||||
.parameters()
|
.parameters()
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ import java.net.URI;
|
|||||||
|
|
||||||
import static org.junit.Assert.assertEquals;
|
import static org.junit.Assert.assertEquals;
|
||||||
import static org.junit.Assert.assertFalse;
|
import static org.junit.Assert.assertFalse;
|
||||||
|
import static org.junit.Assert.assertTrue;
|
||||||
|
|
||||||
@SubjectAware(configuration = "classpath:sonia/scm/configuration/shiro.ini")
|
@SubjectAware(configuration = "classpath:sonia/scm/configuration/shiro.ini")
|
||||||
public class SvnConfigInIndexResourceTest {
|
public class SvnConfigInIndexResourceTest {
|
||||||
@@ -50,7 +51,7 @@ public class SvnConfigInIndexResourceTest {
|
|||||||
|
|
||||||
svnConfigInIndexResource.enrich(context);
|
svnConfigInIndexResource.enrich(context);
|
||||||
|
|
||||||
assertFalse(root.get("_links").iterator().hasNext());
|
assertTrue(root.get("_links").iterator().hasNext());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
|||||||
@@ -86,7 +86,7 @@ class ConfigurationBinder {
|
|||||||
});
|
});
|
||||||
|
|
||||||
// bind navigation link to extension point
|
// bind navigation link to extension point
|
||||||
binder.bind("repository.subnavigation", RepoNavLink, repoPredicate);
|
binder.bind("repository.setting", RepoNavLink, repoPredicate);
|
||||||
|
|
||||||
|
|
||||||
// route for global configuration, passes the current repository to component
|
// route for global configuration, passes the current repository to component
|
||||||
|
|||||||
@@ -22,8 +22,7 @@ class Radio extends React.Component<Props> {
|
|||||||
|
|
||||||
render() {
|
render() {
|
||||||
return (
|
return (
|
||||||
<div className="field is-grouped">
|
|
||||||
<div className="control">
|
|
||||||
<label className="radio" disabled={this.props.disabled}>
|
<label className="radio" disabled={this.props.disabled}>
|
||||||
<input
|
<input
|
||||||
type="radio"
|
type="radio"
|
||||||
@@ -36,8 +35,6 @@ class Radio extends React.Component<Props> {
|
|||||||
{this.props.label}
|
{this.props.label}
|
||||||
{this.renderHelp()}
|
{this.renderHelp()}
|
||||||
</label>
|
</label>
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,6 +4,9 @@ import Loading from "./../Loading";
|
|||||||
import ErrorNotification from "./../ErrorNotification";
|
import ErrorNotification from "./../ErrorNotification";
|
||||||
import Title from "./Title";
|
import Title from "./Title";
|
||||||
import Subtitle from "./Subtitle";
|
import Subtitle from "./Subtitle";
|
||||||
|
import injectSheet from "react-jss";
|
||||||
|
import classNames from "classnames";
|
||||||
|
import PageActions from "./PageActions";
|
||||||
|
|
||||||
type Props = {
|
type Props = {
|
||||||
title?: string,
|
title?: string,
|
||||||
@@ -11,17 +14,26 @@ type Props = {
|
|||||||
loading?: boolean,
|
loading?: boolean,
|
||||||
error?: Error,
|
error?: Error,
|
||||||
showContentOnError?: boolean,
|
showContentOnError?: boolean,
|
||||||
children: React.Node
|
children: React.Node,
|
||||||
|
|
||||||
|
// context props
|
||||||
|
classes: Object
|
||||||
|
};
|
||||||
|
|
||||||
|
const styles = {
|
||||||
|
spacing: {
|
||||||
|
marginTop: "1.25rem",
|
||||||
|
textAlign: "right"
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
class Page extends React.Component<Props> {
|
class Page extends React.Component<Props> {
|
||||||
render() {
|
render() {
|
||||||
const { title, error, subtitle } = this.props;
|
const { error } = this.props;
|
||||||
return (
|
return (
|
||||||
<section className="section">
|
<section className="section">
|
||||||
<div className="container">
|
<div className="container">
|
||||||
<Title title={title} />
|
{this.renderPageHeader()}
|
||||||
<Subtitle subtitle={subtitle} />
|
|
||||||
<ErrorNotification error={error} />
|
<ErrorNotification error={error} />
|
||||||
{this.renderContent()}
|
{this.renderContent()}
|
||||||
</div>
|
</div>
|
||||||
@@ -29,16 +41,64 @@ class Page extends React.Component<Props> {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
renderPageHeader() {
|
||||||
|
const { title, subtitle, children, classes } = this.props;
|
||||||
|
|
||||||
|
let pageActions = null;
|
||||||
|
let pageActionsExists = false;
|
||||||
|
React.Children.forEach(children, child => {
|
||||||
|
if (child && child.type.name === PageActions.name) {
|
||||||
|
pageActions = (
|
||||||
|
<div className="column is-two-fifths">
|
||||||
|
<div
|
||||||
|
className={classNames(
|
||||||
|
classes.spacing,
|
||||||
|
"is-mobile-create-button-spacing"
|
||||||
|
)}
|
||||||
|
>
|
||||||
|
{child}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
pageActionsExists = true;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
let underline = pageActionsExists ? (
|
||||||
|
<hr className="header-with-actions" />
|
||||||
|
) : null;
|
||||||
|
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<div className="columns">
|
||||||
|
<div className="column">
|
||||||
|
<Title title={title} />
|
||||||
|
<Subtitle subtitle={subtitle} />
|
||||||
|
</div>
|
||||||
|
{pageActions}
|
||||||
|
</div>
|
||||||
|
{underline}
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
renderContent() {
|
renderContent() {
|
||||||
const { loading, children, showContentOnError, error } = this.props;
|
const { loading, children, showContentOnError, error } = this.props;
|
||||||
|
|
||||||
if (error && !showContentOnError) {
|
if (error && !showContentOnError) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
if (loading) {
|
if (loading) {
|
||||||
return <Loading />;
|
return <Loading />;
|
||||||
}
|
}
|
||||||
return children;
|
|
||||||
|
let content = [];
|
||||||
|
React.Children.forEach(children, child => {
|
||||||
|
if (child && child.type.name !== PageActions.name) {
|
||||||
|
content.push(child);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
return content;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export default Page;
|
export default injectSheet(styles)(Page);
|
||||||
|
|||||||
@@ -0,0 +1,28 @@
|
|||||||
|
//@flow
|
||||||
|
import * as React from "react";
|
||||||
|
import Loading from "./../Loading";
|
||||||
|
|
||||||
|
type Props = {
|
||||||
|
loading?: boolean,
|
||||||
|
error?: Error,
|
||||||
|
children: React.Node
|
||||||
|
};
|
||||||
|
|
||||||
|
class PageActions extends React.Component<Props> {
|
||||||
|
render() {
|
||||||
|
return <>{this.renderContent()}</>;
|
||||||
|
}
|
||||||
|
|
||||||
|
renderContent() {
|
||||||
|
const { loading, children, error } = this.props;
|
||||||
|
if (error) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
if (loading) {
|
||||||
|
return <Loading />;
|
||||||
|
}
|
||||||
|
return children;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export default PageActions;
|
||||||
@@ -9,7 +9,7 @@ class Subtitle extends React.Component<Props> {
|
|||||||
render() {
|
render() {
|
||||||
const { subtitle } = this.props;
|
const { subtitle } = this.props;
|
||||||
if (subtitle) {
|
if (subtitle) {
|
||||||
return <h1 className="subtitle">{subtitle}</h1>;
|
return <h2 className="subtitle">{subtitle}</h2>;
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,6 +3,7 @@
|
|||||||
export { default as Footer } from "./Footer.js";
|
export { default as Footer } from "./Footer.js";
|
||||||
export { default as Header } from "./Header.js";
|
export { default as Header } from "./Header.js";
|
||||||
export { default as Page } from "./Page.js";
|
export { default as Page } from "./Page.js";
|
||||||
|
export { default as PageActions } from "./PageActions.js";
|
||||||
export { default as Subtitle } from "./Subtitle.js";
|
export { default as Subtitle } from "./Subtitle.js";
|
||||||
export { default as Title } from "./Title.js";
|
export { default as Title } from "./Title.js";
|
||||||
|
|
||||||
|
|||||||
@@ -55,12 +55,19 @@ class PluginLoader extends React.Component<Props, State> {
|
|||||||
});
|
});
|
||||||
|
|
||||||
const promises = [];
|
const promises = [];
|
||||||
for (let plugin of plugins) {
|
const sortedPlugins = plugins.sort(comparePluginsByName);
|
||||||
|
for (let plugin of sortedPlugins) {
|
||||||
promises.push(this.loadPlugin(plugin));
|
promises.push(this.loadPlugin(plugin));
|
||||||
}
|
}
|
||||||
return Promise.all(promises);
|
return promises.reduce((chain, current) => {
|
||||||
|
return chain.then(chainResults => {
|
||||||
|
return current.then(currentResult => [...chainResults, currentResult])
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}, Promise.resolve([]));
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
loadPlugin = (plugin: Plugin) => {
|
loadPlugin = (plugin: Plugin) => {
|
||||||
this.setState({
|
this.setState({
|
||||||
message: `loading ${plugin.name}`
|
message: `loading ${plugin.name}`
|
||||||
@@ -94,7 +101,15 @@ class PluginLoader extends React.Component<Props, State> {
|
|||||||
return <Loading message={message} />;
|
return <Loading message={message} />;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
const comparePluginsByName = (a: Plugin, b: Plugin) => {
|
||||||
|
if (a.name < b.name) {
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
if (a.name > b.name) {
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
};
|
||||||
const mapStateToProps = state => {
|
const mapStateToProps = state => {
|
||||||
const link = getUiPluginsLink(state);
|
const link = getUiPluginsLink(state);
|
||||||
return {
|
return {
|
||||||
|
|||||||
@@ -96,7 +96,7 @@ class Profile extends React.Component<Props, State> {
|
|||||||
label={t("profile.changePasswordNavLink")}
|
label={t("profile.changePasswordNavLink")}
|
||||||
/>
|
/>
|
||||||
<ExtensionPoint
|
<ExtensionPoint
|
||||||
name="profile.subnavigation"
|
name="profile.setting"
|
||||||
props={extensionProps}
|
props={extensionProps}
|
||||||
renderAll={true}
|
renderAll={true}
|
||||||
/>
|
/>
|
||||||
|
|||||||
@@ -5,7 +5,12 @@ import { translate } from "react-i18next";
|
|||||||
import type { Group } from "@scm-manager/ui-types";
|
import type { Group } from "@scm-manager/ui-types";
|
||||||
import type { PagedCollection } from "@scm-manager/ui-types";
|
import type { PagedCollection } from "@scm-manager/ui-types";
|
||||||
import type { History } from "history";
|
import type { History } from "history";
|
||||||
import { Page, Paginator } from "@scm-manager/ui-components";
|
import {
|
||||||
|
Page,
|
||||||
|
PageActions,
|
||||||
|
Button,
|
||||||
|
Paginator
|
||||||
|
} from "@scm-manager/ui-components";
|
||||||
import { GroupTable } from "./../components/table";
|
import { GroupTable } from "./../components/table";
|
||||||
import CreateGroupButton from "../components/buttons/CreateGroupButton";
|
import CreateGroupButton from "../components/buttons/CreateGroupButton";
|
||||||
|
|
||||||
@@ -87,7 +92,18 @@ class Groups extends React.Component<Props> {
|
|||||||
|
|
||||||
renderCreateButton() {
|
renderCreateButton() {
|
||||||
if (this.props.canAddGroups) {
|
if (this.props.canAddGroups) {
|
||||||
return <CreateGroupButton />;
|
return (
|
||||||
|
<>
|
||||||
|
<CreateGroupButton />
|
||||||
|
<PageActions>
|
||||||
|
<Button
|
||||||
|
label={this.props.t("create-group-button.label")}
|
||||||
|
link="/groups/add"
|
||||||
|
color="primary"
|
||||||
|
/>
|
||||||
|
</PageActions>
|
||||||
|
</>
|
||||||
|
);
|
||||||
} else {
|
} else {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -142,7 +142,7 @@ class SingleGroup extends React.Component<Props> {
|
|||||||
permissionsUrl={`${url}/settings/permissions`}
|
permissionsUrl={`${url}/settings/permissions`}
|
||||||
/>
|
/>
|
||||||
<ExtensionPoint
|
<ExtensionPoint
|
||||||
name="group.subnavigation"
|
name="group.setting"
|
||||||
props={extensionProps}
|
props={extensionProps}
|
||||||
renderAll={true}
|
renderAll={true}
|
||||||
/>
|
/>
|
||||||
|
|||||||
@@ -14,7 +14,13 @@ import {
|
|||||||
isFetchReposPending
|
isFetchReposPending
|
||||||
} from "../modules/repos";
|
} from "../modules/repos";
|
||||||
import { translate } from "react-i18next";
|
import { translate } from "react-i18next";
|
||||||
import { CreateButton, Page, Paginator } from "@scm-manager/ui-components";
|
import {
|
||||||
|
Page,
|
||||||
|
PageActions,
|
||||||
|
Button,
|
||||||
|
CreateButton,
|
||||||
|
Paginator
|
||||||
|
} from "@scm-manager/ui-components";
|
||||||
import RepositoryList from "../components/list";
|
import RepositoryList from "../components/list";
|
||||||
import { withRouter } from "react-router-dom";
|
import { withRouter } from "react-router-dom";
|
||||||
import type { History } from "history";
|
import type { History } from "history";
|
||||||
@@ -89,10 +95,19 @@ class Overview extends React.Component<Props> {
|
|||||||
const { showCreateButton, t } = this.props;
|
const { showCreateButton, t } = this.props;
|
||||||
if (showCreateButton) {
|
if (showCreateButton) {
|
||||||
return (
|
return (
|
||||||
<CreateButton
|
<>
|
||||||
label={t("overview.createButton")}
|
<CreateButton
|
||||||
link="/repos/create"
|
label={t("overview.createButton")}
|
||||||
/>
|
link="/repos/create"
|
||||||
|
/>
|
||||||
|
<PageActions>
|
||||||
|
<Button
|
||||||
|
label={t("overview.createButton")}
|
||||||
|
link="/repos/create"
|
||||||
|
color="primary"
|
||||||
|
/>
|
||||||
|
</PageActions>
|
||||||
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
|
|||||||
@@ -214,7 +214,7 @@ class RepositoryRoot extends React.Component<Props> {
|
|||||||
repository={repository}
|
repository={repository}
|
||||||
/>
|
/>
|
||||||
<ExtensionPoint
|
<ExtensionPoint
|
||||||
name="repository.subnavigation"
|
name="repository.setting"
|
||||||
props={extensionProps}
|
props={extensionProps}
|
||||||
renderAll={true}
|
renderAll={true}
|
||||||
/>
|
/>
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
import React from "react";
|
import React from "react";
|
||||||
import { translate } from "react-i18next";
|
import { translate } from "react-i18next";
|
||||||
import type { Permission } from "@scm-manager/ui-types";
|
import type { Permission } from "@scm-manager/ui-types";
|
||||||
import { confirmAlert, DeleteButton } from "@scm-manager/ui-components";
|
import { confirmAlert } from "@scm-manager/ui-components";
|
||||||
|
|
||||||
type Props = {
|
type Props = {
|
||||||
permission: Permission,
|
permission: Permission,
|
||||||
@@ -54,18 +54,18 @@ class DeletePermissionButton extends React.Component<Props> {
|
|||||||
};
|
};
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
const { confirmDialog, loading, t } = this.props;
|
const { confirmDialog } = this.props;
|
||||||
const action = confirmDialog ? this.confirmDelete : this.deletePermission;
|
const action = confirmDialog ? this.confirmDelete : this.deletePermission;
|
||||||
|
|
||||||
if (!this.isDeletable()) {
|
if (!this.isDeletable()) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
return (
|
return (
|
||||||
<DeleteButton
|
<a className="level-item" onClick={action}>
|
||||||
label={t("permission.delete-permission-button.label")}
|
<span className="icon is-small">
|
||||||
action={action}
|
<i className="fas fa-trash" />
|
||||||
loading={loading}
|
</span>
|
||||||
/>
|
</a>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ describe("DeletePermissionButton", () => {
|
|||||||
expect(navLink.text()).toBe("");
|
expect(navLink.text()).toBe("");
|
||||||
});
|
});
|
||||||
|
|
||||||
it("should render the navLink", () => {
|
it("should render the delete icon", () => {
|
||||||
const permission = {
|
const permission = {
|
||||||
_links: {
|
_links: {
|
||||||
delete: {
|
delete: {
|
||||||
@@ -38,14 +38,14 @@ describe("DeletePermissionButton", () => {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const navLink = mount(
|
const deleteIcon = mount(
|
||||||
<DeletePermissionButton
|
<DeletePermissionButton
|
||||||
permission={permission}
|
permission={permission}
|
||||||
deletePermission={() => {}}
|
deletePermission={() => {}}
|
||||||
/>,
|
/>,
|
||||||
options.get()
|
options.get()
|
||||||
);
|
);
|
||||||
expect(navLink.text()).not.toBe("");
|
expect(deleteIcon.html()).not.toBe("");
|
||||||
});
|
});
|
||||||
|
|
||||||
it("should open the confirm dialog on button click", () => {
|
it("should open the confirm dialog on button click", () => {
|
||||||
@@ -64,7 +64,7 @@ describe("DeletePermissionButton", () => {
|
|||||||
/>,
|
/>,
|
||||||
options.get()
|
options.get()
|
||||||
);
|
);
|
||||||
button.find("button").simulate("click");
|
button.find(".fa-trash").simulate("click");
|
||||||
|
|
||||||
expect(confirmAlert.mock.calls.length).toBe(1);
|
expect(confirmAlert.mock.calls.length).toBe(1);
|
||||||
});
|
});
|
||||||
@@ -91,7 +91,7 @@ describe("DeletePermissionButton", () => {
|
|||||||
/>,
|
/>,
|
||||||
options.get()
|
options.get()
|
||||||
);
|
);
|
||||||
button.find("button").simulate("click");
|
button.find(".fa-trash").simulate("click");
|
||||||
|
|
||||||
expect(calledUrl).toBe("/permission");
|
expect(calledUrl).toBe("/permission");
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -50,18 +50,20 @@ class AdvancedPermissionsDialog extends React.Component<Props, State> {
|
|||||||
<SubmitButton label={t("permission.advanced.dialog.submit")} />
|
<SubmitButton label={t("permission.advanced.dialog.submit")} />
|
||||||
) : null;
|
) : null;
|
||||||
|
|
||||||
|
const body = <>{verbSelectBoxes}</>;
|
||||||
|
|
||||||
const body = (
|
const footer = (
|
||||||
<>
|
<form onSubmit={this.onSubmit}>
|
||||||
<div className="content">{verbSelectBoxes}</div>
|
<div className="field is-grouped">
|
||||||
<form onSubmit={this.onSubmit}>
|
<p className="control">{submitButton}</p>
|
||||||
{submitButton}
|
<p className="control">
|
||||||
<Button
|
<Button
|
||||||
label={t("permission.advanced.dialog.abort")}
|
label={t("permission.advanced.dialog.abort")}
|
||||||
action={onClose}
|
action={onClose}
|
||||||
/>
|
/>
|
||||||
</form>
|
</p>
|
||||||
</>
|
</div>
|
||||||
|
</form>
|
||||||
);
|
);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@@ -69,6 +71,7 @@ class AdvancedPermissionsDialog extends React.Component<Props, State> {
|
|||||||
title={t("permission.advanced.dialog.title")}
|
title={t("permission.advanced.dialog.title")}
|
||||||
closeFunction={() => onClose()}
|
closeFunction={() => onClose()}
|
||||||
body={body}
|
body={body}
|
||||||
|
footer={footer}
|
||||||
active={true}
|
active={true}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -5,7 +5,8 @@ import {
|
|||||||
Autocomplete,
|
Autocomplete,
|
||||||
SubmitButton,
|
SubmitButton,
|
||||||
Button,
|
Button,
|
||||||
LabelWithHelpIcon
|
LabelWithHelpIcon,
|
||||||
|
Radio
|
||||||
} from "@scm-manager/ui-components";
|
} from "@scm-manager/ui-components";
|
||||||
import RoleSelector from "../components/RoleSelector";
|
import RoleSelector from "../components/RoleSelector";
|
||||||
import type {
|
import type {
|
||||||
@@ -54,14 +55,11 @@ class CreatePermissionForm extends React.Component<Props, State> {
|
|||||||
permissionScopeChanged = event => {
|
permissionScopeChanged = event => {
|
||||||
const groupPermission = event.target.value === "GROUP_PERMISSION";
|
const groupPermission = event.target.value === "GROUP_PERMISSION";
|
||||||
this.setState({
|
this.setState({
|
||||||
|
value: undefined,
|
||||||
|
name: "",
|
||||||
groupPermission: groupPermission,
|
groupPermission: groupPermission,
|
||||||
valid: validator.isPermissionValid(
|
valid: false
|
||||||
this.state.name,
|
|
||||||
groupPermission,
|
|
||||||
this.props.currentPermissions
|
|
||||||
)
|
|
||||||
});
|
});
|
||||||
this.setState({ ...this.state, groupPermission });
|
|
||||||
};
|
};
|
||||||
|
|
||||||
loadUserAutocompletion = (inputValue: string) => {
|
loadUserAutocompletion = (inputValue: string) => {
|
||||||
@@ -98,7 +96,7 @@ class CreatePermissionForm extends React.Component<Props, State> {
|
|||||||
<Autocomplete
|
<Autocomplete
|
||||||
loadSuggestions={this.loadGroupAutocompletion}
|
loadSuggestions={this.loadGroupAutocompletion}
|
||||||
valueSelected={this.groupOrUserSelected}
|
valueSelected={this.groupOrUserSelected}
|
||||||
value={this.state.value}
|
value={this.state.value ? this.state.value : ""}
|
||||||
label={t("permission.group")}
|
label={t("permission.group")}
|
||||||
noOptionsMessage={t("permission.autocomplete.no-group-options")}
|
noOptionsMessage={t("permission.autocomplete.no-group-options")}
|
||||||
loadingMessage={t("permission.autocomplete.loading")}
|
loadingMessage={t("permission.autocomplete.loading")}
|
||||||
@@ -110,7 +108,7 @@ class CreatePermissionForm extends React.Component<Props, State> {
|
|||||||
<Autocomplete
|
<Autocomplete
|
||||||
loadSuggestions={this.loadUserAutocompletion}
|
loadSuggestions={this.loadUserAutocompletion}
|
||||||
valueSelected={this.groupOrUserSelected}
|
valueSelected={this.groupOrUserSelected}
|
||||||
value={this.state.value}
|
value={this.state.value ? this.state.value : ""}
|
||||||
label={t("permission.user")}
|
label={t("permission.user")}
|
||||||
noOptionsMessage={t("permission.autocomplete.no-user-options")}
|
noOptionsMessage={t("permission.autocomplete.no-user-options")}
|
||||||
loadingMessage={t("permission.autocomplete.loading")}
|
loadingMessage={t("permission.autocomplete.loading")}
|
||||||
@@ -158,36 +156,31 @@ class CreatePermissionForm extends React.Component<Props, State> {
|
|||||||
</h2>
|
</h2>
|
||||||
{advancedDialog}
|
{advancedDialog}
|
||||||
<form onSubmit={this.submit}>
|
<form onSubmit={this.submit}>
|
||||||
<div className="control">
|
<div className="field is-grouped">
|
||||||
<label className="radio">
|
<div className="control">
|
||||||
<input
|
<Radio
|
||||||
type="radio"
|
|
||||||
name="permission_scope"
|
name="permission_scope"
|
||||||
checked={!this.state.groupPermission}
|
|
||||||
value="USER_PERMISSION"
|
value="USER_PERMISSION"
|
||||||
|
checked={!this.state.groupPermission}
|
||||||
|
label={t("permission.user-permission")}
|
||||||
onChange={this.permissionScopeChanged}
|
onChange={this.permissionScopeChanged}
|
||||||
/>
|
/>
|
||||||
{t("permission.user-permission")}
|
<Radio
|
||||||
</label>
|
|
||||||
<label className="radio">
|
|
||||||
<input
|
|
||||||
type="radio"
|
|
||||||
name="permission_scope"
|
name="permission_scope"
|
||||||
value="GROUP_PERMISSION"
|
value="GROUP_PERMISSION"
|
||||||
checked={this.state.groupPermission}
|
checked={this.state.groupPermission}
|
||||||
|
label={t("permission.group-permission")}
|
||||||
onChange={this.permissionScopeChanged}
|
onChange={this.permissionScopeChanged}
|
||||||
/>
|
/>
|
||||||
{t("permission.group-permission")}
|
</div>
|
||||||
</label>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="columns">
|
<div className="columns">
|
||||||
<div className="column is-two-thirds">
|
<div className="column is-three-fifths">
|
||||||
{this.renderAutocompletionField()}
|
{this.renderAutocompletionField()}
|
||||||
</div>
|
</div>
|
||||||
<div className="column is-one-third">
|
<div className="column is-two-fifths">
|
||||||
<div className="columns">
|
<div className="columns">
|
||||||
<div className="column is-half">
|
<div className="column is-narrow">
|
||||||
<RoleSelector
|
<RoleSelector
|
||||||
availableRoles={availableRoleNames}
|
availableRoles={availableRoleNames}
|
||||||
label={t("permission.role")}
|
label={t("permission.role")}
|
||||||
@@ -196,7 +189,7 @@ class CreatePermissionForm extends React.Component<Props, State> {
|
|||||||
role={matchingRole}
|
role={matchingRole}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div className="column is-half">
|
<div className="column">
|
||||||
<LabelWithHelpIcon
|
<LabelWithHelpIcon
|
||||||
label={t("permission.permissions")}
|
label={t("permission.permissions")}
|
||||||
helpText={t("permission.help.permissionsHelpText")}
|
helpText={t("permission.help.permissionsHelpText")}
|
||||||
@@ -252,13 +245,16 @@ class CreatePermissionForm extends React.Component<Props, State> {
|
|||||||
this.setState({
|
this.setState({
|
||||||
name: "",
|
name: "",
|
||||||
verbs: this.props.availablePermissions.availableRoles[0].verbs,
|
verbs: this.props.availablePermissions.availableRoles[0].verbs,
|
||||||
groupPermission: false,
|
valid: true,
|
||||||
valid: true
|
value: undefined
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
handleRoleChange = (role: string) => {
|
handleRoleChange = (role: string) => {
|
||||||
const selectedRole = this.findAvailableRole(role);
|
const selectedRole = this.findAvailableRole(role);
|
||||||
|
if (!selectedRole) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
this.setState({
|
this.setState({
|
||||||
verbs: selectedRole.verbs
|
verbs: selectedRole.verbs
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -74,6 +74,7 @@ type Props = {
|
|||||||
history: History
|
history: History
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
class Permissions extends React.Component<Props> {
|
class Permissions extends React.Component<Props> {
|
||||||
componentDidMount() {
|
componentDidMount() {
|
||||||
const {
|
const {
|
||||||
@@ -154,12 +155,6 @@ class Permissions extends React.Component<Props> {
|
|||||||
helpText={t("permission.help.nameHelpText")}
|
helpText={t("permission.help.nameHelpText")}
|
||||||
/>
|
/>
|
||||||
</th>
|
</th>
|
||||||
<th className="is-hidden-mobile">
|
|
||||||
<LabelWithHelpIcon
|
|
||||||
label={t("permission.group-permission")}
|
|
||||||
helpText={t("permission.help.groupPermissionHelpText")}
|
|
||||||
/>
|
|
||||||
</th>
|
|
||||||
<th>
|
<th>
|
||||||
<LabelWithHelpIcon
|
<LabelWithHelpIcon
|
||||||
label={t("permission.role")}
|
label={t("permission.role")}
|
||||||
|
|||||||
@@ -14,15 +14,21 @@ import {
|
|||||||
} from "../modules/permissions";
|
} from "../modules/permissions";
|
||||||
import { connect } from "react-redux";
|
import { connect } from "react-redux";
|
||||||
import type { History } from "history";
|
import type { History } from "history";
|
||||||
import { Button, Checkbox } from "@scm-manager/ui-components";
|
import { Button } from "@scm-manager/ui-components";
|
||||||
import DeletePermissionButton from "../components/buttons/DeletePermissionButton";
|
import DeletePermissionButton from "../components/buttons/DeletePermissionButton";
|
||||||
import RoleSelector from "../components/RoleSelector";
|
import RoleSelector from "../components/RoleSelector";
|
||||||
import AdvancedPermissionsDialog from "./AdvancedPermissionsDialog";
|
import AdvancedPermissionsDialog from "./AdvancedPermissionsDialog";
|
||||||
|
import classNames from "classnames";
|
||||||
|
import injectSheet from "react-jss";
|
||||||
|
|
||||||
type Props = {
|
type Props = {
|
||||||
availablePermissions: AvailableRepositoryPermissions,
|
availablePermissions: AvailableRepositoryPermissions,
|
||||||
submitForm: Permission => void,
|
submitForm: Permission => void,
|
||||||
modifyPermission: (permission: Permission, namespace: string, name: string) => void,
|
modifyPermission: (
|
||||||
|
permission: Permission,
|
||||||
|
namespace: string,
|
||||||
|
name: string
|
||||||
|
) => void,
|
||||||
permission: Permission,
|
permission: Permission,
|
||||||
t: string => string,
|
t: string => string,
|
||||||
namespace: string,
|
namespace: string,
|
||||||
@@ -30,8 +36,13 @@ type Props = {
|
|||||||
match: any,
|
match: any,
|
||||||
history: History,
|
history: History,
|
||||||
loading: boolean,
|
loading: boolean,
|
||||||
deletePermission: (permission: Permission, namespace: string, name: string) => void,
|
deletePermission: (
|
||||||
deleteLoading: boolean
|
permission: Permission,
|
||||||
|
namespace: string,
|
||||||
|
name: string
|
||||||
|
) => void,
|
||||||
|
deleteLoading: boolean,
|
||||||
|
classes: any
|
||||||
};
|
};
|
||||||
|
|
||||||
type State = {
|
type State = {
|
||||||
@@ -40,6 +51,19 @@ type State = {
|
|||||||
showAdvancedDialog: boolean
|
showAdvancedDialog: boolean
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const styles = {
|
||||||
|
iconColor: {
|
||||||
|
color: "#9a9a9a"
|
||||||
|
},
|
||||||
|
centerMiddle: {
|
||||||
|
display: "table-cell",
|
||||||
|
verticalAlign: "middle !important"
|
||||||
|
},
|
||||||
|
columnWidth: {
|
||||||
|
width: "100%"
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
class SinglePermission extends React.Component<Props, State> {
|
class SinglePermission extends React.Component<Props, State> {
|
||||||
constructor(props: Props) {
|
constructor(props: Props) {
|
||||||
super(props);
|
super(props);
|
||||||
@@ -96,7 +120,8 @@ class SinglePermission extends React.Component<Props, State> {
|
|||||||
availablePermissions,
|
availablePermissions,
|
||||||
loading,
|
loading,
|
||||||
namespace,
|
namespace,
|
||||||
repoName
|
repoName,
|
||||||
|
classes
|
||||||
} = this.props;
|
} = this.props;
|
||||||
const availableRoleNames = availablePermissions.availableRoles.map(
|
const availableRoleNames = availablePermissions.availableRoles.map(
|
||||||
r => r.name
|
r => r.name
|
||||||
@@ -125,23 +150,26 @@ class SinglePermission extends React.Component<Props, State> {
|
|||||||
/>
|
/>
|
||||||
) : null;
|
) : null;
|
||||||
|
|
||||||
|
const iconType =
|
||||||
|
permission && permission.groupPermission ? (
|
||||||
|
<i title={t("permission.group")} className={classNames("fas fa-user-friends", classes.iconColor)} />
|
||||||
|
) : (
|
||||||
|
<i title={t("permission.user")} className={classNames("fas fa-user", classes.iconColor)} />
|
||||||
|
);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<tr>
|
<tr className={classes.columnWidth}>
|
||||||
<td>{permission.name}</td>
|
<td className={classes.centerMiddle}>
|
||||||
<td>
|
{iconType} {permission.name}
|
||||||
<Checkbox
|
|
||||||
checked={permission ? permission.groupPermission : false}
|
|
||||||
disabled={true}
|
|
||||||
/>
|
|
||||||
</td>
|
</td>
|
||||||
{roleSelector}
|
{roleSelector}
|
||||||
<td>
|
<td className={classes.centerMiddle}>
|
||||||
<Button
|
<Button
|
||||||
label={t("permission.advanced-button.label")}
|
label={t("permission.advanced-button.label")}
|
||||||
action={this.handleDetailedPermissionsPressed}
|
action={this.handleDetailedPermissionsPressed}
|
||||||
/>
|
/>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td className={classes.centerMiddle}>
|
||||||
<DeletePermissionButton
|
<DeletePermissionButton
|
||||||
permission={permission}
|
permission={permission}
|
||||||
namespace={namespace}
|
namespace={namespace}
|
||||||
@@ -253,4 +281,4 @@ const mapDispatchToProps = dispatch => {
|
|||||||
export default connect(
|
export default connect(
|
||||||
mapStateToProps,
|
mapStateToProps,
|
||||||
mapDispatchToProps
|
mapDispatchToProps
|
||||||
)(translate("repos")(SinglePermission));
|
)(translate("repos")(injectSheet(styles)(SinglePermission)));
|
||||||
|
|||||||
@@ -136,7 +136,7 @@ class SingleUser extends React.Component<Props> {
|
|||||||
permissionsUrl={`${url}/settings/permissions`}
|
permissionsUrl={`${url}/settings/permissions`}
|
||||||
/>
|
/>
|
||||||
<ExtensionPoint
|
<ExtensionPoint
|
||||||
name="user.subnavigation"
|
name="user.setting"
|
||||||
props={extensionProps}
|
props={extensionProps}
|
||||||
renderAll={true}
|
renderAll={true}
|
||||||
/>
|
/>
|
||||||
|
|||||||
@@ -14,7 +14,13 @@ import {
|
|||||||
getFetchUsersFailure
|
getFetchUsersFailure
|
||||||
} from "../modules/users";
|
} from "../modules/users";
|
||||||
|
|
||||||
import { Page, CreateButton, Paginator } from "@scm-manager/ui-components";
|
import {
|
||||||
|
Page,
|
||||||
|
PageActions,
|
||||||
|
Button,
|
||||||
|
CreateButton,
|
||||||
|
Paginator
|
||||||
|
} from "@scm-manager/ui-components";
|
||||||
import { UserTable } from "./../components/table";
|
import { UserTable } from "./../components/table";
|
||||||
import type { User, PagedCollection } from "@scm-manager/ui-types";
|
import type { User, PagedCollection } from "@scm-manager/ui-types";
|
||||||
import { getUsersLink } from "../../modules/indexResource";
|
import { getUsersLink } from "../../modules/indexResource";
|
||||||
@@ -87,7 +93,18 @@ class Users extends React.Component<Props> {
|
|||||||
renderCreateButton() {
|
renderCreateButton() {
|
||||||
const { t } = this.props;
|
const { t } = this.props;
|
||||||
if (this.props.canAddUsers) {
|
if (this.props.canAddUsers) {
|
||||||
return <CreateButton label={t("users.createButton")} link="/users/add" />;
|
return (
|
||||||
|
<>
|
||||||
|
<CreateButton label={t("users.createButton")} link="/users/add" />
|
||||||
|
<PageActions>
|
||||||
|
<Button
|
||||||
|
label={t("users.createButton")}
|
||||||
|
link="/users/add"
|
||||||
|
color="primary"
|
||||||
|
/>
|
||||||
|
</PageActions>
|
||||||
|
</>
|
||||||
|
);
|
||||||
} else {
|
} else {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -40,6 +40,25 @@ $info: $blue;
|
|||||||
.main {
|
.main {
|
||||||
min-height: calc(100vh - 260px);
|
min-height: calc(100vh - 260px);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// shown in top section when pageactions set
|
||||||
|
hr.header-with-actions {
|
||||||
|
margin-top: -10px;
|
||||||
|
|
||||||
|
@media screen and (max-width: 768px) {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.is-mobile-create-button-spacing {
|
||||||
|
@media screen and (max-width: 768px) {
|
||||||
|
border: 2px solid #e9f7fd;
|
||||||
|
padding: 1em 1em;
|
||||||
|
margin-top: 0 !important;
|
||||||
|
width: 100%;
|
||||||
|
text-align: center !important;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
.footer {
|
.footer {
|
||||||
height: 50px;
|
height: 50px;
|
||||||
}
|
}
|
||||||
@@ -221,7 +240,7 @@ $fa-font-path: "webfonts";
|
|||||||
}
|
}
|
||||||
|
|
||||||
// forms
|
// forms
|
||||||
.field:not(.is-grouped) {
|
form .field:not(.is-grouped) {
|
||||||
margin-bottom: 1rem;
|
margin-bottom: 1rem;
|
||||||
}
|
}
|
||||||
.input,
|
.input,
|
||||||
@@ -231,6 +250,15 @@ $fa-font-path: "webfonts";
|
|||||||
box-shadow: none;
|
box-shadow: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// label with help-icon compensation
|
||||||
|
.label-icon-spacing {
|
||||||
|
margin-top: 30px;
|
||||||
|
|
||||||
|
@media screen and (max-width: 768px) {
|
||||||
|
margin-top: 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// pagination
|
// pagination
|
||||||
.pagination-next,
|
.pagination-next,
|
||||||
.pagination-link,
|
.pagination-link,
|
||||||
|
|||||||
@@ -19,6 +19,7 @@ import java.util.Enumeration;
|
|||||||
import java.util.LinkedHashSet;
|
import java.util.LinkedHashSet;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
|
import java.util.Set;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
import static java.util.Collections.unmodifiableCollection;
|
import static java.util.Collections.unmodifiableCollection;
|
||||||
@@ -126,7 +127,7 @@ public class RepositoryPermissionProvider {
|
|||||||
@XmlRootElement(name = "verbs")
|
@XmlRootElement(name = "verbs")
|
||||||
private static class VerbListDescriptor {
|
private static class VerbListDescriptor {
|
||||||
@XmlElement(name = "verb")
|
@XmlElement(name = "verb")
|
||||||
private List<String> verbs = new ArrayList<>();
|
private Set<String> verbs = new LinkedHashSet<>();
|
||||||
}
|
}
|
||||||
|
|
||||||
@XmlRootElement(name = "roles")
|
@XmlRootElement(name = "roles")
|
||||||
|
|||||||
@@ -55,15 +55,15 @@
|
|||||||
"verbs": {
|
"verbs": {
|
||||||
"repository": {
|
"repository": {
|
||||||
"read": {
|
"read": {
|
||||||
"displayName": "Lesen",
|
"displayName": "Repository Lesen",
|
||||||
"description": "Darf das Repository im SCM-Manager sehen."
|
"description": "Darf das Repository im SCM-Manager sehen."
|
||||||
},
|
},
|
||||||
"modify": {
|
"modify": {
|
||||||
"displayName": "Modifizieren",
|
"displayName": "Repository Modifizieren",
|
||||||
"description": "Darf die Eigenschaften des Repository verändern."
|
"description": "Darf die Eigenschaften des Repository verändern."
|
||||||
},
|
},
|
||||||
"delete": {
|
"delete": {
|
||||||
"displayName": "Löschen",
|
"displayName": "Repository Löschen",
|
||||||
"description": "Darf das Repository löschen."
|
"description": "Darf das Repository löschen."
|
||||||
},
|
},
|
||||||
"pull": {
|
"pull": {
|
||||||
|
|||||||
@@ -55,23 +55,23 @@
|
|||||||
"verbs": {
|
"verbs": {
|
||||||
"repository": {
|
"repository": {
|
||||||
"read": {
|
"read": {
|
||||||
"displayName": "read",
|
"displayName": "read repository",
|
||||||
"description": "May see the repository inside the SCM-Manager"
|
"description": "May see the repository inside the SCM-Manager"
|
||||||
},
|
},
|
||||||
"modify": {
|
"modify": {
|
||||||
"displayName": "modify",
|
"displayName": "modify repository metadata",
|
||||||
"description": "May modify the properties of the repository"
|
"description": "May modify the basic properties of the repository"
|
||||||
},
|
},
|
||||||
"delete": {
|
"delete": {
|
||||||
"displayName": "delete",
|
"displayName": "delete repository",
|
||||||
"description": "May delete the repository"
|
"description": "May delete the repository"
|
||||||
},
|
},
|
||||||
"pull": {
|
"pull": {
|
||||||
"displayName": "pull/checkout",
|
"displayName": "pull/checkout repository",
|
||||||
"description": "May pull/checkout the repository"
|
"description": "May pull/checkout the repository"
|
||||||
},
|
},
|
||||||
"push": {
|
"push": {
|
||||||
"displayName": "push/commit",
|
"displayName": "push/commit repository",
|
||||||
"description": "May change the content of the repository (push/commit)"
|
"description": "May change the content of the repository (push/commit)"
|
||||||
},
|
},
|
||||||
"permissionRead": {
|
"permissionRead": {
|
||||||
@@ -83,7 +83,7 @@
|
|||||||
"description": "May modify the permissions of the repository"
|
"description": "May modify the permissions of the repository"
|
||||||
},
|
},
|
||||||
"*": {
|
"*": {
|
||||||
"displayName": "overall",
|
"displayName": "own repository",
|
||||||
"description": "May change everything for the repository (includes all other permissions)"
|
"description": "May change everything for the repository (includes all other permissions)"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user