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": { "submit-button": {
"label": "Set permissions" "label": "Set permissions"
}, },
"advanced-button": {
"label": "Advanced"
},
"set-permissions-successful": "Permissions set successfully" "set-permissions-successful": "Permissions set successfully"
}, },
"advanced": { "advanced": {

View File

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

View File

@@ -91,26 +91,39 @@ class SinglePermission extends React.Component<Props, State> {
render() { render() {
const { role, permission, showAdvancedDialog } = this.state; 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( const availableRoleNames = availablePermissions.availableRoles.map(
r => r.name r => r.name
); );
const typeSelector = const typeSelector =
this.props.permission._links && this.props.permission._links.update ? ( this.props.permission._links && this.props.permission._links.update ? (
<td> <>
<TypeSelector <td>
handleTypeChange={this.handleTypeChange} <TypeSelector
availableTypes={availableRoleNames} handleTypeChange={this.handleTypeChange}
type={role} availableTypes={availableRoleNames}
loading={loading} type={role}
/> loading={loading}
<Button />
label={"..."} </td>
action={this.handleDetailedPermissionsPressed} <td>
/> <Button
</td> label={t("form.advanced-button.label")}
action={this.handleDetailedPermissionsPressed}
/>
</td>
</>
) : ( ) : (
<td>{role}</td> <>
<td>{role}</td>
<td />
</>
); );
const advancedDialg = showAdvancedDialog ? ( const advancedDialg = showAdvancedDialog ? (