mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-02 11:35:57 +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 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 baseUrl = "/repo/hitchhiker/heartOfGold/code/changeset";
|
||||||
const sourceLink = {
|
const sourceLink = {
|
||||||
url: `${baseUrl}/${changeset.id}/${file.newPath}/`,
|
url: `${baseUrl}/${changeset.id}/${file.newPath}/`,
|
||||||
@@ -76,10 +76,7 @@ const fileControlFactory: (changeset: Changeset) => FileControlFactory = (change
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return links.map(({url, label}) => <JumpToFileButton
|
return links.map(({ url, label }) => <JumpToFileButton tooltip={label} link={url} />);
|
||||||
tooltip={label}
|
|
||||||
link={url}
|
|
||||||
/>);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
storiesOf("Diff", module)
|
storiesOf("Diff", module)
|
||||||
@@ -164,8 +161,4 @@ storiesOf("Diff", module)
|
|||||||
});
|
});
|
||||||
return <Diff diff={filesWithLanguage} />;
|
return <Diff diff={filesWithLanguage} />;
|
||||||
})
|
})
|
||||||
.add("WithLinkToFile", () => (
|
.add("WithLinkToFile", () => <Diff diff={diffFiles} />);
|
||||||
<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 collapseIcon = this.hasContent(file) ? <Icon name={icon} color="inherit" /> : null;
|
||||||
const fileControls = fileControlFactory ? fileControlFactory(file, this.setCollapse) : 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 }) => (
|
{({ setCollapsed }) => (
|
||||||
<DiffButton
|
<DiffButton
|
||||||
icon={sideBySide ? "align-left" : "columns"}
|
icon={sideBySide ? "align-left" : "columns"}
|
||||||
@@ -429,7 +430,8 @@ class DiffFile extends React.Component<Props, State> {
|
|||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
</MenuContext.Consumer>;
|
</MenuContext.Consumer>
|
||||||
|
);
|
||||||
const headerButtons = (
|
const headerButtons = (
|
||||||
<ButtonWrapper className={classNames("level-right", "is-flex")}>
|
<ButtonWrapper className={classNames("level-right", "is-flex")}>
|
||||||
<ButtonGroup>
|
<ButtonGroup>
|
||||||
|
|||||||
@@ -54,7 +54,14 @@ class ChangesetDiff extends React.Component<Props> {
|
|||||||
return <Notification type="danger">{t("changeset.diffNotSupported")}</Notification>;
|
return <Notification type="danger">{t("changeset.diffNotSupported")}</Notification>;
|
||||||
} else {
|
} else {
|
||||||
const url = createUrl(changeset);
|
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 />;
|
if (!changeset || loading) return <Loading />;
|
||||||
|
|
||||||
return <ChangesetDetails changeset={changeset} repository={repository}
|
return (
|
||||||
fileControlFactory={fileControlFactoryFactory && fileControlFactoryFactory(changeset)}/>;
|
<ChangesetDetails
|
||||||
|
changeset={changeset}
|
||||||
|
repository={repository}
|
||||||
|
fileControlFactory={fileControlFactoryFactory && fileControlFactoryFactory(changeset)}
|
||||||
|
/>
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -154,7 +154,7 @@ class RepositoryRoot extends React.Component<Props> {
|
|||||||
redirectedUrl = url + "/info";
|
redirectedUrl = url + "/info";
|
||||||
}
|
}
|
||||||
|
|
||||||
const fileControlFactoryFactory: (changeset: Changeset) => FileControlFactory = (changeset) => (file) => {
|
const fileControlFactoryFactory: (changeset: Changeset) => FileControlFactory = changeset => file => {
|
||||||
const baseUrl = `${url}/code/sources`;
|
const baseUrl = `${url}/code/sources`;
|
||||||
const sourceLink = {
|
const sourceLink = {
|
||||||
url: `${baseUrl}/${changeset.id}/${file.newPath}/`,
|
url: `${baseUrl}/${changeset.id}/${file.newPath}/`,
|
||||||
@@ -183,10 +183,7 @@ class RepositoryRoot extends React.Component<Props> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return links.map(({url, label}) => <JumpToFileButton
|
return links.map(({ url, label }) => <JumpToFileButton tooltip={label} link={url} />);
|
||||||
tooltip={label}
|
|
||||||
link={url}
|
|
||||||
/>);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@@ -218,8 +215,9 @@ class RepositoryRoot extends React.Component<Props> {
|
|||||||
<Route
|
<Route
|
||||||
exact
|
exact
|
||||||
path={`${url}/code/changeset/:id`}
|
path={`${url}/code/changeset/:id`}
|
||||||
render={() => <ChangesetView repository={repository}
|
render={() => (
|
||||||
fileControlFactoryFactory={fileControlFactoryFactory}/>}
|
<ChangesetView repository={repository} fileControlFactoryFactory={fileControlFactoryFactory} />
|
||||||
|
)}
|
||||||
/>
|
/>
|
||||||
<Route
|
<Route
|
||||||
path={`${url}/code/sourceext/:extension`}
|
path={`${url}/code/sourceext/:extension`}
|
||||||
|
|||||||
Reference in New Issue
Block a user