mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-15 09:46:16 +01:00
Merge with 2.0.0-m3
This commit is contained in:
@@ -4,7 +4,8 @@ import DiffFile from "./DiffFile";
|
||||
import type {DiffObjectProps, File} from "./DiffTypes";
|
||||
|
||||
type Props = DiffObjectProps & {
|
||||
diff: File[]
|
||||
diff: File[],
|
||||
defaultCollapse?: boolean
|
||||
};
|
||||
|
||||
class Diff extends React.Component<Props> {
|
||||
@@ -17,7 +18,7 @@ class Diff extends React.Component<Props> {
|
||||
return (
|
||||
<>
|
||||
{diff.map((file, index) => (
|
||||
<DiffFile key={index} file={file} {...fileProps} />
|
||||
<DiffFile key={index} file={file} {...fileProps} {...this.props} />
|
||||
))}
|
||||
</>
|
||||
);
|
||||
|
||||
@@ -9,7 +9,8 @@ import Diff from "./Diff";
|
||||
import type {DiffObjectProps, File} from "./DiffTypes";
|
||||
|
||||
type Props = DiffObjectProps & {
|
||||
url: string
|
||||
url: string,
|
||||
defaultCollapse?: boolean
|
||||
};
|
||||
|
||||
type State = {
|
||||
|
||||
@@ -7,6 +7,7 @@ import {translate} from "react-i18next";
|
||||
|
||||
type Props = {
|
||||
changeset: Changeset,
|
||||
defaultCollapse?: boolean,
|
||||
|
||||
// context props
|
||||
t: string => string
|
||||
@@ -23,12 +24,12 @@ class ChangesetDiff extends React.Component<Props> {
|
||||
}
|
||||
|
||||
render() {
|
||||
const { changeset, t } = this.props;
|
||||
const { changeset, defaultCollapse, t } = this.props;
|
||||
if (!this.isDiffSupported(changeset)) {
|
||||
return <Notification type="danger">{t("changeset.diffNotSupported")}</Notification>;
|
||||
} else {
|
||||
const url = this.createUrl(changeset);
|
||||
return <LoadingDiff url={url} />;
|
||||
return <LoadingDiff url={url} defaultCollapse={defaultCollapse} />;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user