mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-11 07:55:47 +01:00
remove if else to show permission add option also in repos without any permissions
This commit is contained in:
@@ -15,7 +15,6 @@ import {
|
||||
import Loading from "../../components/Loading";
|
||||
import ErrorPage from "../../components/ErrorPage";
|
||||
import type {
|
||||
Permission,
|
||||
PermissionCollection,
|
||||
PermissionEntry
|
||||
} from "../types/Permissions";
|
||||
@@ -70,6 +69,7 @@ class Permissions extends React.Component<Props> {
|
||||
loadingCreatePermission,
|
||||
hasPermissionToCreate
|
||||
} = this.props;
|
||||
console.log(permissions);
|
||||
|
||||
if (error) {
|
||||
return (
|
||||
@@ -98,8 +98,6 @@ class Permissions extends React.Component<Props> {
|
||||
loading={loadingCreatePermission}
|
||||
/>
|
||||
) : null;
|
||||
|
||||
if (permissions.length > 0)
|
||||
return (
|
||||
<div>
|
||||
<table className="table is-hoverable is-fullwidth">
|
||||
@@ -111,10 +109,10 @@ class Permissions extends React.Component<Props> {
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{permissions.map((permission, index) => {
|
||||
{permissions.map(permission => {
|
||||
return (
|
||||
<SinglePermission
|
||||
key={index}
|
||||
key={permission.name}
|
||||
namespace={namespace}
|
||||
repoName={repoName}
|
||||
permission={permission}
|
||||
@@ -126,8 +124,6 @@ class Permissions extends React.Component<Props> {
|
||||
{createPermissionForm}
|
||||
</div>
|
||||
);
|
||||
|
||||
return <div />;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -142,7 +138,6 @@ const mapStateToProps = (state, ownProps) => {
|
||||
namespace,
|
||||
repoName
|
||||
);
|
||||
console.log(permissions);
|
||||
const hasPermissionToCreate = hasCreatePermission(state, namespace, repoName);
|
||||
return {
|
||||
namespace,
|
||||
|
||||
Reference in New Issue
Block a user