mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-10 15:35:49 +01:00
Only count files in frontend
This commit is contained in:
@@ -130,7 +130,7 @@
|
|||||||
"notBound": "Keine Erweiterung angebunden."
|
"notBound": "Keine Erweiterung angebunden."
|
||||||
},
|
},
|
||||||
"loadMore": "Laden",
|
"loadMore": "Laden",
|
||||||
"moreEntriesAvailable": "Es werden nur die ersten {{count}} Einträge angezeigt. Es sind weitere Einträge vorhanden."
|
"moreFilesAvailable": "Es werden nur die ersten {{count}} Dateien angezeigt. Es sind weitere Dateien vorhanden."
|
||||||
},
|
},
|
||||||
"permission": {
|
"permission": {
|
||||||
"title": "Berechtigungen bearbeiten",
|
"title": "Berechtigungen bearbeiten",
|
||||||
|
|||||||
@@ -130,7 +130,7 @@
|
|||||||
"notBound": "No extension bound."
|
"notBound": "No extension bound."
|
||||||
},
|
},
|
||||||
"loadMore": "Load",
|
"loadMore": "Load",
|
||||||
"moreEntriesAvailable": "These are just the first {{count}} entries. There are more entries available."
|
"moreFilesAvailable": "These are just the first {{count}} files. There are more files available."
|
||||||
},
|
},
|
||||||
"permission": {
|
"permission": {
|
||||||
"title": "Edit Permissions",
|
"title": "Edit Permissions",
|
||||||
|
|||||||
@@ -92,15 +92,15 @@ class FileTree extends React.Component<Props, State> {
|
|||||||
renderTruncatedInfo = () => {
|
renderTruncatedInfo = () => {
|
||||||
const { hunks, t } = this.props;
|
const { hunks, t } = this.props;
|
||||||
const lastHunk = hunks[hunks.length - 1];
|
const lastHunk = hunks[hunks.length - 1];
|
||||||
const entryCount = hunks
|
const fileCount = hunks
|
||||||
.filter(hunk => hunk?.tree?._embedded?.children)
|
.filter(hunk => hunk?.tree?._embedded?.children)
|
||||||
.map(hunk => hunk.tree._embedded.children.length)
|
.map(hunk => hunk.tree._embedded.children.filter(c => !c.directory).length)
|
||||||
.reduce((a, b) => a + b, 0);
|
.reduce((a, b) => a + b, 0);
|
||||||
if (lastHunk.tree?.truncated) {
|
if (lastHunk.tree?.truncated) {
|
||||||
return (
|
return (
|
||||||
<Notification type={"info"}>
|
<Notification type={"info"}>
|
||||||
<div className={"columns is-centered"}>
|
<div className={"columns is-centered"}>
|
||||||
<div className={"column"}>{t("sources.moreEntriesAvailable", { count: entryCount })}</div>
|
<div className={"column"}>{t("sources.moreFilesAvailable", { count: fileCount })}</div>
|
||||||
<Button label={t("sources.loadMore")} action={this.loadMore} />
|
<Button label={t("sources.loadMore")} action={this.loadMore} />
|
||||||
</div>
|
</div>
|
||||||
</Notification>
|
</Notification>
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ export function fetchSources(repository: Repository, revision: string, path: str
|
|||||||
for (let i = 0; i < hunk; ++i) {
|
for (let i = 0; i < hunk; ++i) {
|
||||||
const sources = getSources(state, repository, revision, path, i);
|
const sources = getSources(state, repository, revision, path, i);
|
||||||
if (sources?._embedded.children) {
|
if (sources?._embedded.children) {
|
||||||
offset += sources._embedded.children.length;
|
offset += sources._embedded.children.filter(c => !c.directory).length;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user