Bug fix: render folderless sequences
parent
897ed8206a
commit
f54fb07d61
|
@ -25,7 +25,7 @@ const addToIndex: AddToIndex = (accumulator, item) => {
|
|||
|
||||
const emptyIndex: FoldersIndexedByParentId = {};
|
||||
|
||||
const PARENTLESS = -1;
|
||||
export const PARENTLESS = -1;
|
||||
type IngestFn =
|
||||
(props: IngestFnProps) => RootFolderNode;
|
||||
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue