Move advanced button to new column

This commit is contained in:
René Pfeuffer
2019-01-24 13:34:05 +01:00
parent 84fe142346
commit d76d1706aa
3 changed files with 31 additions and 14 deletions

View File

@@ -3,6 +3,9 @@
"submit-button": {
"label": "Set permissions"
},
"advanced-button": {
"label": "Advanced"
},
"set-permissions-successful": "Permissions set successfully"
},
"advanced": {

View File

@@ -148,6 +148,7 @@ class Permissions extends React.Component<Props> {
</th>
<th>{t("permission.type")}</th>
<th />
<th />
</tr>
</thead>
<tbody>

View File

@@ -91,12 +91,19 @@ class SinglePermission extends React.Component<Props, State> {
render() {
const { role, permission, showAdvancedDialog } = this.state;
const { availablePermissions, loading, namespace, repoName } = this.props;
const {
t,
availablePermissions,
loading,
namespace,
repoName
} = this.props;
const availableRoleNames = availablePermissions.availableRoles.map(
r => r.name
);
const typeSelector =
this.props.permission._links && this.props.permission._links.update ? (
<>
<td>
<TypeSelector
handleTypeChange={this.handleTypeChange}
@@ -104,13 +111,19 @@ class SinglePermission extends React.Component<Props, State> {
type={role}
loading={loading}
/>
</td>
<td>
<Button
label={"..."}
label={t("form.advanced-button.label")}
action={this.handleDetailedPermissionsPressed}
/>
</td>
</>
) : (
<>
<td>{role}</td>
<td />
</>
);
const advancedDialg = showAdvancedDialog ? (