mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-01 19:15:52 +01:00
fix formatting with prettier
This commit is contained in:
@@ -47,7 +47,7 @@ const Container = styled.div`
|
||||
|
||||
const RoutingDecorator = (story: () => ReactNode) => <MemoryRouter initialEntries={["/"]}>{story()}</MemoryRouter>;
|
||||
|
||||
const fileControlFactory: (changeset: Changeset) => FileControlFactory = (changeset) => (file) => {
|
||||
const fileControlFactory: (changeset: Changeset) => FileControlFactory = changeset => file => {
|
||||
const baseUrl = "/repo/hitchhiker/heartOfGold/code/changeset";
|
||||
const sourceLink = {
|
||||
url: `${baseUrl}/${changeset.id}/${file.newPath}/`,
|
||||
@@ -76,10 +76,7 @@ const fileControlFactory: (changeset: Changeset) => FileControlFactory = (change
|
||||
}
|
||||
}
|
||||
|
||||
return links.map(({url, label}) => <JumpToFileButton
|
||||
tooltip={label}
|
||||
link={url}
|
||||
/>);
|
||||
return links.map(({ url, label }) => <JumpToFileButton tooltip={label} link={url} />);
|
||||
};
|
||||
|
||||
storiesOf("Diff", module)
|
||||
@@ -164,8 +161,4 @@ storiesOf("Diff", module)
|
||||
});
|
||||
return <Diff diff={filesWithLanguage} />;
|
||||
})
|
||||
.add("WithLinkToFile", () => (
|
||||
<Diff
|
||||
diff={diffFiles}
|
||||
/>
|
||||
));
|
||||
.add("WithLinkToFile", () => <Diff diff={diffFiles} />);
|
||||
|
||||
@@ -415,7 +415,8 @@ class DiffFile extends React.Component<Props, State> {
|
||||
}
|
||||
const collapseIcon = this.hasContent(file) ? <Icon name={icon} color="inherit" /> : null;
|
||||
const fileControls = fileControlFactory ? fileControlFactory(file, this.setCollapse) : null;
|
||||
const sideBySideToggle = file.hunks && file.hunks.length && <MenuContext.Consumer>
|
||||
const sideBySideToggle = file.hunks && file.hunks.length && (
|
||||
<MenuContext.Consumer>
|
||||
{({ setCollapsed }) => (
|
||||
<DiffButton
|
||||
icon={sideBySide ? "align-left" : "columns"}
|
||||
@@ -429,7 +430,8 @@ class DiffFile extends React.Component<Props, State> {
|
||||
}
|
||||
/>
|
||||
)}
|
||||
</MenuContext.Consumer>;
|
||||
</MenuContext.Consumer>
|
||||
);
|
||||
const headerButtons = (
|
||||
<ButtonWrapper className={classNames("level-right", "is-flex")}>
|
||||
<ButtonGroup>
|
||||
|
||||
@@ -54,7 +54,14 @@ class ChangesetDiff extends React.Component<Props> {
|
||||
return <Notification type="danger">{t("changeset.diffNotSupported")}</Notification>;
|
||||
} else {
|
||||
const url = createUrl(changeset);
|
||||
return <LoadingDiff url={url} defaultCollapse={defaultCollapse} sideBySide={false} fileControlFactory={fileControlFactory}/>;
|
||||
return (
|
||||
<LoadingDiff
|
||||
url={url}
|
||||
defaultCollapse={defaultCollapse}
|
||||
sideBySide={false}
|
||||
fileControlFactory={fileControlFactory}
|
||||
/>
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -70,8 +70,13 @@ class ChangesetView extends React.Component<Props> {
|
||||
|
||||
if (!changeset || loading) return <Loading />;
|
||||
|
||||
return <ChangesetDetails changeset={changeset} repository={repository}
|
||||
fileControlFactory={fileControlFactoryFactory && fileControlFactoryFactory(changeset)}/>;
|
||||
return (
|
||||
<ChangesetDetails
|
||||
changeset={changeset}
|
||||
repository={repository}
|
||||
fileControlFactory={fileControlFactoryFactory && fileControlFactoryFactory(changeset)}
|
||||
/>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -154,7 +154,7 @@ class RepositoryRoot extends React.Component<Props> {
|
||||
redirectedUrl = url + "/info";
|
||||
}
|
||||
|
||||
const fileControlFactoryFactory: (changeset: Changeset) => FileControlFactory = (changeset) => (file) => {
|
||||
const fileControlFactoryFactory: (changeset: Changeset) => FileControlFactory = changeset => file => {
|
||||
const baseUrl = `${url}/code/sources`;
|
||||
const sourceLink = {
|
||||
url: `${baseUrl}/${changeset.id}/${file.newPath}/`,
|
||||
@@ -183,10 +183,7 @@ class RepositoryRoot extends React.Component<Props> {
|
||||
}
|
||||
}
|
||||
|
||||
return links.map(({url, label}) => <JumpToFileButton
|
||||
tooltip={label}
|
||||
link={url}
|
||||
/>);
|
||||
return links.map(({ url, label }) => <JumpToFileButton tooltip={label} link={url} />);
|
||||
};
|
||||
|
||||
return (
|
||||
@@ -218,8 +215,9 @@ class RepositoryRoot extends React.Component<Props> {
|
||||
<Route
|
||||
exact
|
||||
path={`${url}/code/changeset/:id`}
|
||||
render={() => <ChangesetView repository={repository}
|
||||
fileControlFactoryFactory={fileControlFactoryFactory}/>}
|
||||
render={() => (
|
||||
<ChangesetView repository={repository} fileControlFactoryFactory={fileControlFactoryFactory} />
|
||||
)}
|
||||
/>
|
||||
<Route
|
||||
path={`${url}/code/sourceext/:extension`}
|
||||
|
||||
Reference in New Issue
Block a user