mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-13 17:05:43 +01:00
reformat components with prettier
This commit is contained in:
@@ -99,9 +99,7 @@ export default class CardColumn extends React.Component<Props> {
|
|||||||
<FlexFullHeight className={classNames("media-content", "text-box", "is-flex")}>
|
<FlexFullHeight className={classNames("media-content", "text-box", "is-flex")}>
|
||||||
<div className="is-flex">
|
<div className="is-flex">
|
||||||
<ContentLeft className="content">
|
<ContentLeft className="content">
|
||||||
<p className="shorten-text is-marginless">
|
<p className="shorten-text is-marginless">{title}</p>
|
||||||
{title}
|
|
||||||
</p>
|
|
||||||
<p className="shorten-text">{description}</p>
|
<p className="shorten-text">{description}</p>
|
||||||
</ContentLeft>
|
</ContentLeft>
|
||||||
<ContentRight>{contentRight}</ContentRight>
|
<ContentRight>{contentRight}</ContentRight>
|
||||||
|
|||||||
@@ -25,7 +25,6 @@
|
|||||||
import { chooseLocale, supportedLocales } from "./DateFromNow";
|
import { chooseLocale, supportedLocales } from "./DateFromNow";
|
||||||
|
|
||||||
describe("test choose locale", () => {
|
describe("test choose locale", () => {
|
||||||
|
|
||||||
it("should choose de", () => {
|
it("should choose de", () => {
|
||||||
const locale = chooseLocale("de_DE", ["de", "en"]);
|
const locale = chooseLocale("de_DE", ["de", "en"]);
|
||||||
expect(locale).toBe(supportedLocales.de);
|
expect(locale).toBe(supportedLocales.de);
|
||||||
@@ -45,5 +44,4 @@ describe("test choose locale", () => {
|
|||||||
const locale = chooseLocale("af", ["af", "be"]);
|
const locale = chooseLocale("af", ["af", "be"]);
|
||||||
expect(locale).toBe(supportedLocales.en);
|
expect(locale).toBe(supportedLocales.en);
|
||||||
});
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ import MarkdownXmlCodeBlock from "./__resources__/markdown-xml-codeblock.md";
|
|||||||
import MarkdownInlineXml from "./__resources__/markdown-inline-xml.md";
|
import MarkdownInlineXml from "./__resources__/markdown-inline-xml.md";
|
||||||
import Title from "./layout/Title";
|
import Title from "./layout/Title";
|
||||||
import { Subtitle } from "./layout";
|
import { Subtitle } from "./layout";
|
||||||
import {MemoryRouter} from "react-router-dom";
|
import { MemoryRouter } from "react-router-dom";
|
||||||
|
|
||||||
const Spacing = styled.div`
|
const Spacing = styled.div`
|
||||||
padding: 2em;
|
padding: 2em;
|
||||||
|
|||||||
@@ -42,4 +42,3 @@ storiesOf("Forms|Checkbox", module)
|
|||||||
<Checkbox label="Checked but disabled" checked={true} disabled={true} />
|
<Checkbox label="Checked but disabled" checked={true} disabled={true} />
|
||||||
</Spacing>
|
</Spacing>
|
||||||
));
|
));
|
||||||
|
|
||||||
|
|||||||
@@ -54,7 +54,7 @@ export default class Checkbox extends React.Component<Props> {
|
|||||||
if (title) {
|
if (title) {
|
||||||
return <LabelWithHelpIcon label={title} helpText={helpText} />;
|
return <LabelWithHelpIcon label={title} helpText={helpText} />;
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
const { label, checked, disabled } = this.props;
|
const { label, checked, disabled } = this.props;
|
||||||
@@ -68,13 +68,7 @@ export default class Checkbox extends React.Component<Props> {
|
|||||||
but bulma does.
|
but bulma does.
|
||||||
// @ts-ignore */}
|
// @ts-ignore */}
|
||||||
<label className="checkbox" disabled={disabled}>
|
<label className="checkbox" disabled={disabled}>
|
||||||
<input
|
<input type="checkbox" checked={checked} onChange={this.onCheckboxChange} disabled={disabled} /> {label}
|
||||||
type="checkbox"
|
|
||||||
checked={checked}
|
|
||||||
onChange={this.onCheckboxChange}
|
|
||||||
disabled={disabled}
|
|
||||||
/>{" "}
|
|
||||||
{label}
|
|
||||||
{this.renderHelp()}
|
{this.renderHelp()}
|
||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -25,7 +25,6 @@ import React, { ChangeEvent } from "react";
|
|||||||
import { Help } from "../index";
|
import { Help } from "../index";
|
||||||
import styled from "styled-components";
|
import styled from "styled-components";
|
||||||
|
|
||||||
|
|
||||||
const StyledRadio = styled.label`
|
const StyledRadio = styled.label`
|
||||||
margin-right: 0.5em;
|
margin-right: 0.5em;
|
||||||
`;
|
`;
|
||||||
|
|||||||
@@ -21,7 +21,7 @@
|
|||||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
* SOFTWARE.
|
* SOFTWARE.
|
||||||
*/
|
*/
|
||||||
import React, {useState} from "react";
|
import React, { useState } from "react";
|
||||||
import { storiesOf } from "@storybook/react";
|
import { storiesOf } from "@storybook/react";
|
||||||
import styled from "styled-components";
|
import styled from "styled-components";
|
||||||
import Textarea from "./Textarea";
|
import Textarea from "./Textarea";
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ import hitchhiker from "../__resources__/hitchhiker.png";
|
|||||||
import marvin from "../__resources__/marvin.jpg";
|
import marvin from "../__resources__/marvin.jpg";
|
||||||
import NavLink from "../navigation/NavLink";
|
import NavLink from "../navigation/NavLink";
|
||||||
import ExternalLink from "../navigation/ExternalLink";
|
import ExternalLink from "../navigation/ExternalLink";
|
||||||
import {MemoryRouter} from "react-router-dom";
|
import { MemoryRouter } from "react-router-dom";
|
||||||
|
|
||||||
const trillian: Me = {
|
const trillian: Me = {
|
||||||
name: "trillian",
|
name: "trillian",
|
||||||
|
|||||||
@@ -52,7 +52,7 @@ const PageActionContainer = styled.div`
|
|||||||
`;
|
`;
|
||||||
|
|
||||||
const MarginLeft = styled.div`
|
const MarginLeft = styled.div`
|
||||||
margin-left: 0.5rem;
|
margin-left: 0.5rem;
|
||||||
`;
|
`;
|
||||||
|
|
||||||
const FlexContainer = styled.div`
|
const FlexContainer = styled.div`
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ const Title: FC<Props> = ({ title, preventRefreshingPageTitle, customPageTitle,
|
|||||||
document.title = title;
|
document.title = title;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},[title, preventRefreshingPageTitle, customPageTitle]);
|
}, [title, preventRefreshingPageTitle, customPageTitle]);
|
||||||
|
|
||||||
if (title) {
|
if (title) {
|
||||||
return <h1 className={classNames("title", className)}>{title}</h1>;
|
return <h1 className={classNames("title", className)}>{title}</h1>;
|
||||||
|
|||||||
@@ -34,4 +34,3 @@ export { default as Title } from "./Title";
|
|||||||
export { default as CustomQueryFlexWrappedColumns } from "./CustomQueryFlexWrappedColumns";
|
export { default as CustomQueryFlexWrappedColumns } from "./CustomQueryFlexWrappedColumns";
|
||||||
export { default as PrimaryContentColumn } from "./PrimaryContentColumn";
|
export { default as PrimaryContentColumn } from "./PrimaryContentColumn";
|
||||||
export { default as SecondaryNavigationColumn } from "./SecondaryNavigationColumn";
|
export { default as SecondaryNavigationColumn } from "./SecondaryNavigationColumn";
|
||||||
|
|
||||||
|
|||||||
@@ -62,7 +62,11 @@ class ConfirmAlert extends React.Component<Props> {
|
|||||||
<div className="field is-grouped">
|
<div className="field is-grouped">
|
||||||
{buttons.map((button, i) => (
|
{buttons.map((button, i) => (
|
||||||
<p className="control">
|
<p className="control">
|
||||||
<a className={classNames("button", "is-info", button.className)} key={i} onClick={() => this.handleClickButton(button)}>
|
<a
|
||||||
|
className={classNames("button", "is-info", button.className)}
|
||||||
|
key={i}
|
||||||
|
onClick={() => this.handleClickButton(button)}
|
||||||
|
>
|
||||||
{button.label}
|
{button.label}
|
||||||
</a>
|
</a>
|
||||||
</p>
|
</p>
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ export const MenuContext = React.createContext<MenuContext>({
|
|||||||
setCollapsed() {}
|
setCollapsed() {}
|
||||||
});
|
});
|
||||||
|
|
||||||
export const StateMenuContextProvider: FC = ({children}) => {
|
export const StateMenuContextProvider: FC = ({ children }) => {
|
||||||
const [collapsed, setCollapsed] = useState(false);
|
const [collapsed, setCollapsed] = useState(false);
|
||||||
|
|
||||||
const context = {
|
const context = {
|
||||||
|
|||||||
@@ -26,4 +26,4 @@ export type RoutingProps = {
|
|||||||
to: string;
|
to: string;
|
||||||
activeOnlyWhenExact?: boolean;
|
activeOnlyWhenExact?: boolean;
|
||||||
activeWhenMatch?: (route: any) => boolean;
|
activeWhenMatch?: (route: any) => boolean;
|
||||||
}
|
};
|
||||||
|
|||||||
@@ -21,10 +21,10 @@
|
|||||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
* SOFTWARE.
|
* SOFTWARE.
|
||||||
*/
|
*/
|
||||||
import React, {FC} from "react";
|
import React, { FC } from "react";
|
||||||
import SubNavigation from "./SubNavigation";
|
import SubNavigation from "./SubNavigation";
|
||||||
import NavLink from "./NavLink";
|
import NavLink from "./NavLink";
|
||||||
import {RoutingProps} from "./RoutingProps";
|
import { RoutingProps } from "./RoutingProps";
|
||||||
|
|
||||||
type Props = RoutingProps & {
|
type Props = RoutingProps & {
|
||||||
label: string;
|
label: string;
|
||||||
|
|||||||
@@ -21,11 +21,11 @@
|
|||||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
* SOFTWARE.
|
* SOFTWARE.
|
||||||
*/
|
*/
|
||||||
import React, { FC, useContext} from "react";
|
import React, { FC, useContext } from "react";
|
||||||
import { Link, useRouteMatch } from "react-router-dom";
|
import { Link, useRouteMatch } from "react-router-dom";
|
||||||
import classNames from "classnames";
|
import classNames from "classnames";
|
||||||
import useMenuContext, {MenuContext} from "./MenuContext";
|
import useMenuContext, { MenuContext } from "./MenuContext";
|
||||||
import {RoutingProps} from "./RoutingProps";
|
import { RoutingProps } from "./RoutingProps";
|
||||||
|
|
||||||
type Props = RoutingProps & {
|
type Props = RoutingProps & {
|
||||||
label: string;
|
label: string;
|
||||||
|
|||||||
@@ -291,11 +291,13 @@ class DiffFile extends React.Component<Props, State> {
|
|||||||
<DiffButton
|
<DiffButton
|
||||||
icon={sideBySide ? "align-left" : "columns"}
|
icon={sideBySide ? "align-left" : "columns"}
|
||||||
tooltip={t(sideBySide ? "diff.combined" : "diff.sideBySide")}
|
tooltip={t(sideBySide ? "diff.combined" : "diff.sideBySide")}
|
||||||
onClick={() => this.toggleSideBySide(() => {
|
onClick={() =>
|
||||||
if (this.state.sideBySide) {
|
this.toggleSideBySide(() => {
|
||||||
setCollapsed(true);
|
if (this.state.sideBySide) {
|
||||||
}
|
setCollapsed(true);
|
||||||
})}
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
</MenuContext.Consumer>
|
</MenuContext.Consumer>
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ import { Binder, BinderContext } from "@scm-manager/ui-extensions";
|
|||||||
import { Repository } from "@scm-manager/ui-types";
|
import { Repository } from "@scm-manager/ui-types";
|
||||||
import Image from "../Image";
|
import Image from "../Image";
|
||||||
import Icon from "../Icon";
|
import Icon from "../Icon";
|
||||||
import {MemoryRouter} from "react-router-dom";
|
import { MemoryRouter } from "react-router-dom";
|
||||||
|
|
||||||
const baseDate = "2020-03-26T12:13:42+02:00";
|
const baseDate = "2020-03-26T12:13:42+02:00";
|
||||||
|
|
||||||
|
|||||||
@@ -182,19 +182,19 @@ describe("ExtensionPoint test", () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it("should render an instance with props", () => {
|
it("should render an instance with props", () => {
|
||||||
const Label = ({name}: {name: string}) => {
|
const Label = ({ name }: { name: string }) => {
|
||||||
return <label>Extension {name}</label>;
|
return <label>Extension {name}</label>;
|
||||||
};
|
};
|
||||||
|
|
||||||
mockedBinder.hasExtension.mockReturnValue(true);
|
mockedBinder.hasExtension.mockReturnValue(true);
|
||||||
mockedBinder.getExtension.mockReturnValue(<Label name="One" />);
|
mockedBinder.getExtension.mockReturnValue(<Label name="One" />);
|
||||||
|
|
||||||
const rendered = mount(<ExtensionPoint name="something.special" props={{name: "Two"}} />);
|
const rendered = mount(<ExtensionPoint name="something.special" props={{ name: "Two" }} />);
|
||||||
expect(rendered.text()).toBe("Extension Two");
|
expect(rendered.text()).toBe("Extension Two");
|
||||||
});
|
});
|
||||||
|
|
||||||
it("should transform extension, before render", () => {
|
it("should transform extension, before render", () => {
|
||||||
const label = ({name = "One"}: {name: string}) => {
|
const label = ({ name = "One" }: { name: string }) => {
|
||||||
return <label>Extension {name}</label>;
|
return <label>Extension {name}</label>;
|
||||||
};
|
};
|
||||||
mockedBinder.hasExtension.mockReturnValue(true);
|
mockedBinder.hasExtension.mockReturnValue(true);
|
||||||
@@ -204,10 +204,10 @@ describe("ExtensionPoint test", () => {
|
|||||||
return {
|
return {
|
||||||
...props,
|
...props,
|
||||||
name: "Two"
|
name: "Two"
|
||||||
}
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
const rendered = mount(<ExtensionPoint name="something.special" propTransformer={transformer} />);
|
const rendered = mount(<ExtensionPoint name="something.special" propTransformer={transformer} />);
|
||||||
expect(rendered.text()).toBe("Extension Two");
|
expect(rendered.text()).toBe("Extension Two");
|
||||||
})
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -23,7 +23,7 @@
|
|||||||
*/
|
*/
|
||||||
import * as React from "react";
|
import * as React from "react";
|
||||||
import { Binder } from "./binder";
|
import { Binder } from "./binder";
|
||||||
import {Component, FC, ReactNode} from "react";
|
import { Component, FC, ReactNode } from "react";
|
||||||
import useBinder from "./useBinder";
|
import useBinder from "./useBinder";
|
||||||
|
|
||||||
type PropTransformer = (props: object) => object;
|
type PropTransformer = (props: object) => object;
|
||||||
@@ -48,11 +48,7 @@ const createInstance = (Component: any, props: object, key?: number) => {
|
|||||||
|
|
||||||
const renderAllExtensions = (binder: Binder, name: string, props: object) => {
|
const renderAllExtensions = (binder: Binder, name: string, props: object) => {
|
||||||
const extensions = binder.getExtensions(name, props);
|
const extensions = binder.getExtensions(name, props);
|
||||||
return (
|
return <>{extensions.map((cmp, index) => createInstance(cmp, props, index))}</>;
|
||||||
<>
|
|
||||||
{extensions.map((cmp, index) => createInstance(cmp, props, index))}
|
|
||||||
</>
|
|
||||||
);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const renderSingleExtension = (binder: Binder, name: string, props: object) => {
|
const renderSingleExtension = (binder: Binder, name: string, props: object) => {
|
||||||
|
|||||||
18
yarn.lock
18
yarn.lock
@@ -10020,6 +10020,16 @@ mini-css-extract-plugin@^0.8.0:
|
|||||||
schema-utils "^1.0.0"
|
schema-utils "^1.0.0"
|
||||||
webpack-sources "^1.1.0"
|
webpack-sources "^1.1.0"
|
||||||
|
|
||||||
|
mini-css-extract-plugin@^0.9.0:
|
||||||
|
version "0.9.0"
|
||||||
|
resolved "https://registry.yarnpkg.com/mini-css-extract-plugin/-/mini-css-extract-plugin-0.9.0.tgz#47f2cf07aa165ab35733b1fc97d4c46c0564339e"
|
||||||
|
integrity sha512-lp3GeY7ygcgAmVIcRPBVhIkf8Us7FZjA+ILpal44qLdSu11wmjKQ3d9k15lfD7pO4esu9eUIAW7qiYIBppv40A==
|
||||||
|
dependencies:
|
||||||
|
loader-utils "^1.1.0"
|
||||||
|
normalize-url "1.9.1"
|
||||||
|
schema-utils "^1.0.0"
|
||||||
|
webpack-sources "^1.1.0"
|
||||||
|
|
||||||
minimalistic-assert@^1.0.0, minimalistic-assert@^1.0.1:
|
minimalistic-assert@^1.0.0, minimalistic-assert@^1.0.1:
|
||||||
version "1.0.1"
|
version "1.0.1"
|
||||||
resolved "https://registry.yarnpkg.com/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz#2e194de044626d4a10e7f7fbc00ce73e83e4d5c7"
|
resolved "https://registry.yarnpkg.com/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz#2e194de044626d4a10e7f7fbc00ce73e83e4d5c7"
|
||||||
@@ -12247,10 +12257,10 @@ react-redux@^5.0.7:
|
|||||||
react-is "^16.6.0"
|
react-is "^16.6.0"
|
||||||
react-lifecycles-compat "^3.0.0"
|
react-lifecycles-compat "^3.0.0"
|
||||||
|
|
||||||
react-refresh@^0.7.2:
|
react-refresh@^0.8.0:
|
||||||
version "0.7.2"
|
version "0.8.1"
|
||||||
resolved "https://registry.yarnpkg.com/react-refresh/-/react-refresh-0.7.2.tgz#f30978d21eb8cac6e2f2fde056a7d04f6844dd50"
|
resolved "https://registry.yarnpkg.com/react-refresh/-/react-refresh-0.8.1.tgz#5500506ad6fc891fdd057d0bf3581f9310abc6a2"
|
||||||
integrity sha512-u5l7fhAJXecWUJzVxzMRU2Zvw8m4QmDNHlTrT5uo3KBlYBhmChd7syAakBoay1yIiVhx/8Fi7a6v6kQZfsw81Q==
|
integrity sha512-xZIKi49RtLUUSAZ4a4ut2xr+zr4+glOD5v0L413B55MPvlg4EQ6Ctx8PD4CmjlPGoAWmSCTmmkY59TErizNsow==
|
||||||
|
|
||||||
react-router-dom@^5.1.2:
|
react-router-dom@^5.1.2:
|
||||||
version "5.1.2"
|
version "5.1.2"
|
||||||
|
|||||||
Reference in New Issue
Block a user