Skip to content

Commit

Permalink
Merge branch 'development' into feature/SDSV-18
Browse files Browse the repository at this point in the history
  • Loading branch information
jrmartin committed Mar 14, 2024
2 parents 7aac4c1 + f5684e6 commit d724c91
Show file tree
Hide file tree
Showing 8 changed files with 386 additions and 400 deletions.
378 changes: 21 additions & 357 deletions src/components/GraphViewer/GraphViewer.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/components/NodeDetailView/Details/SubjectDetails.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ const SubjectDetails = (props) => {
if ( property.isGroup ){
return (<Box className="tab-content-row">
<Typography component="label">{property.label}</Typography>
<SimpleLinkedChip chips={[{ value : node.graph_node.attributes[property.property]}]} node={getGroupNode(node.graph_node.attributes[property.property][0], node)} />
<SimpleLinkedChip chips={[{ value : node.graph_node.attributes[property.property]}]} node={getGroupNode(node.graph_node.attributes[property.property]?.[0], node)} />
</Box>)
}

Expand Down
11 changes: 3 additions & 8 deletions src/components/NodeDetailView/settings/Settings.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,9 @@
import { Box, Button, Typography } from "@material-ui/core";
import React from "react";
import { Box, Button } from "@material-ui/core";
import SettingsGroup from "./SettingsGroup";
import FolderIcon from "@material-ui/icons/Folder";
import { useSelector, useDispatch } from 'react-redux'
import { toggleSettingsPanelVisibility } from '../../../redux/actions';
import React, {useEffect, useState} from "react";
import {DragDropContext, Droppable} from "react-beautiful-dnd";
import SettingsListItems from "./SettingsListItems";


const Settings = props => {
const Settings = () => {
const dispatch = useDispatch();
const showSettingsContent = useSelector(state => state.sdsState.settings_panel_visible);
const metaDataPropertiesModel = useSelector(state => state.sdsState.metadata_model);
Expand Down
2 changes: 1 addition & 1 deletion src/components/NodeDetailView/settings/SettingsItem.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, {useEffect} from "react";
import React from "react";
import { useDispatch } from 'react-redux';
import { toggleMetadataItemVisibility } from '../../../redux/actions';

Expand Down
18 changes: 2 additions & 16 deletions src/components/NodeDetailView/settings/SettingsListItems.js
Original file line number Diff line number Diff line change
@@ -1,25 +1,11 @@
import React, {useEffect, useState} from "react";
import React from "react";
import {
Box,
Typography,
List,
ListItemText,
ListItem,
ListItemIcon,
ListItemSecondaryAction,
IconButton,
ListSubheader,
Button
} from "@material-ui/core";
import { DragDropContext, Droppable, Draggable } from "react-beautiful-dnd";
import ReorderIcon from "@material-ui/icons/Reorder";
import RemoveCircleOutlineIcon from "@material-ui/icons/RemoveCircleOutline";
import AddCircleOutlineIcon from "@material-ui/icons/AddCircleOutline";
import VisibilityIcon from "@material-ui/icons/Visibility";
import { TuneRounded } from "@material-ui/icons";
import FolderIcon from "@material-ui/icons/Folder";
import VisibilityOffRoundedIcon from "@material-ui/icons/VisibilityOffRounded";
import { SPARC_DATASETS } from "../../../constants";
import { Draggable } from "react-beautiful-dnd";
import SettingsItem from "./SettingsItem";
const SettingsListItems = props => {
const { provided, items, title } = props;
Expand Down
5 changes: 1 addition & 4 deletions src/components/Sidebar/List.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,11 @@ import React, {useEffect} from 'react';
import {Box, IconButton} from '@material-ui/core';
import Typography from '@material-ui/core/Typography';
import InstancesTreeView from './TreeView/InstancesTreeView';
import {useDispatch, useSelector} from 'react-redux';
import {useSelector} from 'react-redux';
import SearchRoundedIcon from '@material-ui/icons/SearchRounded';
import {selectInstance} from "../../redux/actions";
import {TREE_SOURCE} from "../../constants";

const SidebarContent = (props) => {
const { expand, setExpand, searchTerm } = props;
const dispatch = useDispatch();

const datasets = useSelector((state) => state.sdsState.datasets);
const nodeSelected = useSelector((state) => state.sdsState.instance_selected);
Expand Down
31 changes: 18 additions & 13 deletions src/redux/initialState.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,15 @@ import * as LayoutActions from '@metacell/geppetto-meta-client/common/layout/act
import { rdfTypes } from "../utils/graphModel";
import {TOGGLE_METADATA_ITEM_VISIBILITY, UPDATE_METADATA_ITEMS_ORDER} from "./actions";

const savedMetadataModel = localStorage.getItem("metadata_model");
const initialMetadataModel = savedMetadataModel ? JSON.parse(savedMetadataModel) : {
dataset: [...rdfTypes.Dataset.properties],
subject: [...rdfTypes.Subject.properties],
sample: [...rdfTypes.Sample.properties],
collection : [...rdfTypes.Collection.properties],
group: [...rdfTypes.Group.properties],
file: [...rdfTypes.File.properties]
};
export const sdsInitialState = {
"sdsState": {
datasets: [],
Expand All @@ -23,14 +32,7 @@ export const sdsInitialState = {
},
layout : {},
settings_panel_visible : false,
metadata_model : {
dataset : [...rdfTypes.Dataset.properties],
subject : [...rdfTypes.Subject.properties],
sample : [...rdfTypes.Sample.properties],
collection : [...rdfTypes.Collection.properties],
group : [...rdfTypes.Group.properties],
file : [...rdfTypes.File.properties]
}
metadata_model : initialMetadataModel
}
};

Expand Down Expand Up @@ -136,19 +138,22 @@ export default function sdsClientReducer(state = {}, action) {
}
});
}
localStorage.setItem("metadata_model", JSON.stringify(updatedMetadataModel));

return {
...state,
metadata_model: { ...updatedMetadataModel }
};
case UPDATE_METADATA_ITEMS_ORDER:
const { title, newItemsOrder } = action.payload;

const updatedMetadataModelOrder = {
...state.metadata_model,
[title]: newItemsOrder,
};
localStorage.setItem("metadata_model", JSON.stringify(updatedMetadataModelOrder));
return {
...state,
metadata_model: {
...state.metadata_model,
[title]: newItemsOrder,
},
metadata_model: updatedMetadataModelOrder,
};
case LayoutActions.layoutActions.SET_LAYOUT:
return { ...state, layout : action.data.layout};
Expand Down
Loading

0 comments on commit d724c91

Please sign in to comment.