merge 2.0.0-m3

This commit is contained in:
Maren Süwer
2018-10-09 08:11:40 +02:00
31 changed files with 2419 additions and 230 deletions

View File

@@ -1,5 +1,6 @@
//@flow
import React from "react";
import classNames from "classnames";
import { LabelWithHelpIcon } from "../index";
export type SelectItem = {
@@ -12,6 +13,7 @@ type Props = {
options: SelectItem[],
value?: SelectItem,
onChange: string => void,
loading?: boolean,
helpText?: string
};
@@ -31,12 +33,17 @@ class Select extends React.Component<Props> {
};
render() {
const { options, value, label, helpText } = this.props;
const { options, value, label, helpText, loading } = this.props;
const loadingClass = loading ? "is-loading" : "";
return (
<div className="field">
<LabelWithHelpIcon label={label} helpText={helpText} />
<div className="control select">
<div className={classNames(
"control select",
loadingClass
)}>
<select
ref={input => {
this.field = input;

View File

@@ -1,5 +1,5 @@
// @flow
const nameRegex = /^([A-z0-9.\-_@]|[^ ]([A-z0-9.\-_@ ]*[A-z0-9.\-_@]|[^\s])?)$/;
const nameRegex = /^[A-Za-z0-9\.\-_][A-Za-z0-9\.\-_@]*$/;
export const isNameValid = (name: string) => {
return nameRegex.test(name);

View File

@@ -5,6 +5,7 @@ describe("test name validation", () => {
it("should return false", () => {
// invalid names taken from ValidationUtilTest.java
const invalidNames = [
"@test",
" test 123",
" test 123 ",
"test 123 ",
@@ -35,10 +36,9 @@ describe("test name validation", () => {
"Test123-git",
"Test_user-123.git",
"test@scm-manager.de",
"test 123",
"test123",
"tt",
"t",
"valid_name",
"another1",
"stillValid",