mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-15 09:46:16 +01:00
Replace sources collection with file in frontend
This commit is contained in:
@@ -3,7 +3,7 @@ import React from "react";
|
||||
import { translate } from "react-i18next";
|
||||
import injectSheet from "react-jss";
|
||||
import FileTreeLeaf from "./FileTreeLeaf";
|
||||
import type { SourcesCollection } from "@scm-manager/ui-types";
|
||||
import type { File } from "@scm-manager/ui-types";
|
||||
|
||||
const styles = {
|
||||
iconColumn: {
|
||||
@@ -12,7 +12,7 @@ const styles = {
|
||||
};
|
||||
|
||||
type Props = {
|
||||
tree: SourcesCollection,
|
||||
tree: File,
|
||||
revision: string,
|
||||
path: string,
|
||||
baseUrl: string,
|
||||
@@ -53,7 +53,7 @@ class FileTree extends React.Component<Props> {
|
||||
directory: true
|
||||
});
|
||||
}
|
||||
files.push(...tree._embedded.files);
|
||||
files.push(...tree._embedded.children);
|
||||
|
||||
return (
|
||||
<table className="table table-hover table-sm is-fullwidth">
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// @flow
|
||||
import React from "react";
|
||||
import { connect } from "react-redux";
|
||||
import type { Repository, SourcesCollection } from "@scm-manager/ui-types";
|
||||
import type { Repository, File } from "@scm-manager/ui-types";
|
||||
import FileTree from "../components/FileTree";
|
||||
import { ErrorNotification, Loading } from "@scm-manager/ui-components";
|
||||
import {
|
||||
@@ -13,7 +13,7 @@ import {
|
||||
|
||||
type Props = {
|
||||
repository: Repository,
|
||||
sources: SourcesCollection,
|
||||
sources: File,
|
||||
loading: boolean,
|
||||
error: Error,
|
||||
revision: string,
|
||||
|
||||
@@ -1,11 +1,7 @@
|
||||
// @flow
|
||||
|
||||
import * as types from "../../../modules/types";
|
||||
import type {
|
||||
Repository,
|
||||
SourcesCollection,
|
||||
Action
|
||||
} from "@scm-manager/ui-types";
|
||||
import type { Repository, File, Action } from "@scm-manager/ui-types";
|
||||
import { apiClient } from "@scm-manager/ui-components";
|
||||
import { isPending } from "../../../modules/pending";
|
||||
import { getFailure } from "../../../modules/failure";
|
||||
@@ -61,7 +57,7 @@ export function fetchSourcesSuccess(
|
||||
repository: Repository,
|
||||
revision: string,
|
||||
path: string,
|
||||
sources: SourcesCollection
|
||||
sources: File
|
||||
) {
|
||||
return {
|
||||
type: FETCH_SOURCES_SUCCESS,
|
||||
@@ -111,7 +107,7 @@ export function getSources(
|
||||
repository: Repository,
|
||||
revision: string,
|
||||
path: string
|
||||
): ?SourcesCollection {
|
||||
): ?File {
|
||||
if (state.sources) {
|
||||
return state.sources[createItemId(repository, revision, path)];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user