enable failing tests again and use form instead of table for create permission

This commit is contained in:
Maren Süwer
2018-09-11 16:17:11 +02:00
parent fe33e55bef
commit 09924a03cb
3 changed files with 35 additions and 45 deletions

View File

@@ -1,7 +1,11 @@
// @flow
import React from "react";
import { translate } from "react-i18next";
import { Checkbox, InputField, SubmitButton } from "../../../../../scm-ui-components/packages/ui-components/src/index";
import {
Checkbox,
InputField,
SubmitButton
} from "../../../../../scm-ui-components/packages/ui-components/src/index";
import TypeSelector from "./TypeSelector";
import type {
PermissionCollection,
@@ -41,45 +45,30 @@ class CreatePermissionForm extends React.Component<Props, State> {
<h2 className="subtitle">
{t("add-permission.add-permission-heading")}
</h2>
<table className="table">
<tbody>
<tr>
<td>{t("permission.name")}</td>
<td>
<InputField
value={name ? name : ""}
onChange={this.handleNameChange}
validationError={this.currentPermissionIncludeName()}
errorMessage={t("add-permission.name-input-invalid")}
/>
</td>
</tr>
<tr>
<td>{t("permission.group-permission")}</td>
<td>
<Checkbox
checked={groupPermission ? groupPermission : false}
onChange={this.handleGroupPermissionChange}
/>
</td>
</tr>
<tr>
<td>{t("permission.type")}</td>
<td>
<TypeSelector
handleTypeChange={this.handleTypeChange}
type={type ? type : "READ"}
/>
</td>
</tr>
</tbody>
</table>
<SubmitButton
label={t("add-permission.submit-button")}
action={this.submit}
loading={loading}
disabled={this.isValid()}
/>
<form onSubmit={this.submit}>
<InputField
label={t("permission.name")}
value={name ? name : ""}
onChange={this.handleNameChange}
validationError={this.currentPermissionIncludeName()}
errorMessage={t("add-permission.name-input-invalid")}
/>
<Checkbox
label={t("permission.group-permission")}
checked={groupPermission ? groupPermission : false}
onChange={this.handleGroupPermissionChange}
/>
<TypeSelector
label={t("permission.type")}
handleTypeChange={this.handleTypeChange}
type={type ? type : "READ"}
/>
<SubmitButton
label={t("add-permission.submit-button")}
loading={loading}
disabled={this.isValid()}
/>
</form>
</div>
);
}

View File

@@ -2,10 +2,7 @@
import React from "react";
import { translate } from "react-i18next";
import type { Permission } from "../../types/Permissions";
import {
confirmAlert,
DeleteButton
} from "../../../../../../scm-ui-components/packages/ui-components/src/index";
import { confirmAlert, DeleteButton } from "@scm-manager/ui-components";
type Props = {
permission: Permission,