mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-10 23:45:44 +01:00
fixed small review findings
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import React from "react";
|
||||
import { Changeset, File, PagedCollection, Repository } from "@scm-manager/ui-types";
|
||||
import { Changeset, File, PagedCollection, Repository, Link } from "@scm-manager/ui-types";
|
||||
import { ChangesetList, ErrorNotification, Loading, StatePaginator } from "@scm-manager/ui-components";
|
||||
import { getHistory } from "./history";
|
||||
|
||||
@@ -31,14 +31,16 @@ class HistoryView extends React.Component<Props, State> {
|
||||
|
||||
componentDidMount() {
|
||||
const { file } = this.props;
|
||||
file && this.updateHistory(file._links.history.href);
|
||||
if (file) {
|
||||
this.updateHistory((file._links.history as Link).href);
|
||||
}
|
||||
}
|
||||
|
||||
componentDidUpdate() {
|
||||
const { file } = this.props;
|
||||
const { currentRevision } = this.state;
|
||||
if (file?.revision !== currentRevision) {
|
||||
this.updateHistory(file._links.history.href);
|
||||
this.updateHistory((file._links.history as Link).href);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -67,7 +69,7 @@ class HistoryView extends React.Component<Props, State> {
|
||||
updatePage(page: number) {
|
||||
const { file } = this.props;
|
||||
const internalPage = page - 1;
|
||||
this.updateHistory(file._links.history.href + "?page=" + internalPage.toString());
|
||||
this.updateHistory((file._links.history as Link).href + "?page=" + internalPage.toString());
|
||||
}
|
||||
|
||||
showHistory() {
|
||||
|
||||
@@ -24,7 +24,7 @@ type Props = WithTranslation &
|
||||
sources?: File | null;
|
||||
|
||||
// dispatch props
|
||||
fetchSources: (repository: Repository, revision: string | undefined, path: string | undefined) => void;
|
||||
fetchSources: (repository: Repository, revision?: string, path?: string) => void;
|
||||
};
|
||||
|
||||
const extensionPointName = "repos.sources.extensions";
|
||||
|
||||
@@ -25,7 +25,7 @@ type Props = WithTranslation &
|
||||
selectedBranch: string;
|
||||
|
||||
// dispatch props
|
||||
fetchSources: (p1: Repository, p2: string, p3: string) => void;
|
||||
fetchSources: (repository: Repository, revision: string, path: string) => void;
|
||||
};
|
||||
|
||||
class Sources extends React.Component<Props> {
|
||||
|
||||
Reference in New Issue
Block a user