restructure scm-ui and use ui-components and ui-types

This commit is contained in:
Sebastian Sdorra
2018-09-05 14:32:49 +02:00
parent 6a4f3a8cf6
commit c64a5a74d6
275 changed files with 12693 additions and 11311 deletions

View File

@@ -1,10 +1,13 @@
// @flow
import React from "react";
import { translate } from "react-i18next";
import type { User } from "../types/User";
import { Checkbox, InputField } from "../../components/forms";
import { SubmitButton } from "../../components/buttons";
import * as validator from "../../components/validation";
import type { User } from "@scm-manager/ui-types";
import {
Checkbox,
InputField,
SubmitButton,
validation as validator
} from "@scm-manager/ui-components";
import * as userValidator from "./userValidation";
type Props = {

View File

@@ -1,7 +1,7 @@
//@flow
import React from "react";
import { translate } from "react-i18next";
import { CreateButton } from "../../../components/buttons";
import { CreateButton } from "@scm-manager/ui-components";
// TODO remove
type Props = {

View File

@@ -1,9 +1,8 @@
// @flow
import React from "react";
import { translate } from "react-i18next";
import type { User } from "../../types/User";
import { confirmAlert } from "../../../components/modals/ConfirmAlert";
import { NavAction } from "../../../components/navigation";
import type { User } from "@scm-manager/ui-types";
import { NavAction, confirmAlert } from "@scm-manager/ui-components";
type Props = {
user: User,

View File

@@ -4,8 +4,11 @@ import "../../../tests/enzyme";
import "../../../tests/i18n";
import DeleteUserNavLink from "./DeleteUserNavLink";
import { confirmAlert } from "../../../components/modals/ConfirmAlert";
jest.mock("../../../components/modals/ConfirmAlert");
import { confirmAlert } from "@scm-manager/ui-components";
jest.mock("@scm-manager/ui-components", () => ({
confirmAlert: jest.fn(),
NavAction: require.requireActual("@scm-manager/ui-components").NavAction
}));
describe("DeleteUserNavLink", () => {
it("should render nothing, if the delete link is missing", () => {

View File

@@ -1,8 +1,8 @@
//@flow
import React from "react";
import { translate } from "react-i18next";
import type { User } from "../../types/User";
import { NavLink } from "../../../components/navigation";
import type { User } from "@scm-manager/ui-types";
import { NavLink } from "@scm-manager/ui-components";
type Props = {
t: string => string,

View File

@@ -1,10 +1,8 @@
//@flow
import React from "react";
import type { User } from "../../types/User";
import type { User } from "@scm-manager/ui-types";
import { translate } from "react-i18next";
import { Checkbox } from "../../../components/forms";
import MailLink from "../../../components/MailLink";
import DateFromNow from "../../../components/DateFromNow";
import { Checkbox, MailLink, DateFromNow } from "@scm-manager/ui-components";
type Props = {
user: User,

View File

@@ -1,7 +1,7 @@
// @flow
import React from "react";
import { Link } from "react-router-dom";
import type { User } from "../../types/User";
import type { User } from "@scm-manager/ui-types";
type Props = {
user: User

View File

@@ -2,7 +2,7 @@
import React from "react";
import { translate } from "react-i18next";
import UserRow from "./UserRow";
import type { User } from "../../types/User";
import type { User } from "@scm-manager/ui-types";
type Props = {
t: string => string,

View File

@@ -1,6 +1,8 @@
// @flow
import { isNameValid, isMailValid } from "../../components/validation";
import { validation } from "@scm-manager/ui-components";
const { isNameValid, isMailValid } = validation;
export { isNameValid, isMailValid };