Bug fix: render folderless sequences

folders
Rick Carlino 2019-12-09 17:35:29 -06:00
parent 897ed8206a
commit f54fb07d61
3 changed files with 12 additions and 4 deletions

View File

@ -25,7 +25,7 @@ const addToIndex: AddToIndex = (accumulator, item) => {
const emptyIndex: FoldersIndexedByParentId = {};
const PARENTLESS = -1;
export const PARENTLESS = -1;
type IngestFn =
(props: IngestFnProps) => RootFolderNode;

View File

@ -120,6 +120,7 @@ export class RawFolders extends React.Component<Props, State> {
<Col xs={12} sm={6} smOffset={3}>
<Row>
<this.Graph />
<hr />
<ul> {rootSequences} </ul>
</Row>
</Col>

View File

@ -31,7 +31,7 @@ import { ActionHandler } from "../redux/generate_reducer";
import { get } from "lodash";
import { Actions } from "../constants";
import { getFbosConfig } from "./getters";
import { ingest } from "../folders/data_transfer";
import { ingest, PARENTLESS as NO_PARENT } from "../folders/data_transfer";
import { FolderNode, FolderMeta, FolderNodeTerminal, FolderNodeMedial } from "../folders/constants";
import { climb } from "../folders/climb";
@ -72,9 +72,16 @@ export const reindexFolders = (i: ResourceIndex) => {
allSequences.map((s) => {
const { folder_id } = s.body;
if (folder_id) {
(localMetaAttributes[folder_id]?.sequences || []).push(s.uuid);
const parentId = folder_id || NO_PARENT;
if (!localMetaAttributes[parentId]) {
localMetaAttributes[parentId] = {
sequences: [],
open: true,
editing: false
};
}
localMetaAttributes[parentId].sequences.push(s.uuid);
});
const { searchTerm } = i.sequenceFolders;