Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix warnings during development #108

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 4 additions & 6 deletions tensormap-client/src/pages/adddata/AddData.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import {withStyles} from '@material-ui/core'
import PropTypes from 'prop-types'
import * as React from 'react'
import styles from './AddData.styles'
import { withRouter } from 'react-router-dom';

class AddData extends React.Component {

Expand All @@ -19,16 +18,15 @@ class AddData extends React.Component {

validateFileType(e)
{
var name = null
let filepath= e.target.value;
var ext = filepath.substring(filepath.lastIndexOf('.') + 1);
this.setState({fileData:e.target.files[0]})
if(this.state.fileType == "null"){
if(this.state.fileType === "null"){
e.target.value = ""
alert("Select File Type");
}
else{
if(ext != this.state.fileType ) {
if(ext !== this.state.fileType ) {
e.target.value = ""
alert("Unsupported File Type");
}
Expand All @@ -44,7 +42,7 @@ class AddData extends React.Component {
{
e.preventDefault();

if(this.state.fileType == "null" || this.state.fileData == "null"){
if(this.state.fileType === "null" || this.state.fileData === "null"){
alert("Select File Type And Upload File")
}
else{
Expand All @@ -58,7 +56,7 @@ class AddData extends React.Component {
}).then((response) => {
return response.text();
}).then((responseText) => {
if(responseText == "error"){
if(responseText === "error"){
alert ("Dataset with identical name already exists");
}
else{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
import { Theme } from "@material-ui/core/styles";
import { red, grey, green, blue } from "@material-ui/core/colors";
import { flexbox } from "@material-ui/system";
const styles = theme => ({
root: {
display: "flex",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -454,7 +454,7 @@ class BodyWidget extends React.Component<BodyWidgetProps, BodyWidgetState> {
</SidebarWidget>
</Paper>
</Grid>
<Grid item xs={8} spacing={5}>
<Grid item xs={8}>
<Grid item xs style={{paddingBottom:10}}>
<Paper square>
<Button variant= "contained" onClick = {this.handledelete} style={{backgroundColor:"#fff",boxShadow:"none"}}> <DeleteIcon /></Button>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,9 @@ export class TrayWidget extends React.Component<TrayWidgetProps, TrayWidgetState
<Typography>{this.props.nntype}</Typography>
</ExpansionPanelSummary>
<ExpansionPanelDetails>
<Typography>
<List component="nav" aria-label="Main mailbox folders">
{this.props.children}
</List>
</Typography>
<List component="nav" aria-label="Main mailbox folders">
{this.props.children}
</List>
</ExpansionPanelDetails>
</ExpansionPanel>);

Expand Down
7 changes: 2 additions & 5 deletions tensormap-client/src/pages/dashboard/scenes/b/assets/Tabs.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
import React from 'react';
import PropTypes from 'prop-types';
import AppBar from '@material-ui/core/AppBar';
import Paper from '@material-ui/core/Paper';
import Tabs from '@material-ui/core/Tabs';
import Tab from '@material-ui/core/Tab';
import Typography from '@material-ui/core/Typography';
import AddData from '../../../../adddata/AddData';
import ViewData from '../../../../viewdata/ViewData';
import VisualizeData from '../../../../visualizedata/VisualizeData';



interface TabContainerProps {
Expand Down Expand Up @@ -60,6 +57,6 @@ export default function SimpleTabs(props: SimpleTabsProps) {
}

SimpleTabs.propTypes = {
code: PropTypes.string.isRequired,
runtimeData: PropTypes.string.isRequired,
code: PropTypes.string,
runtimeData: PropTypes.string,
};
1 change: 0 additions & 1 deletion tensormap-client/src/pages/viewdata/ViewData.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ class ViewData extends React.Component {

render() {
console.log(this.state.data);
const {classes} = this.props

return (
<Table data={this.state.data}/>
Expand Down
12 changes: 5 additions & 7 deletions tensormap-client/src/pages/viewdata/assets/Table.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,7 @@ import OpenInNew from '@material-ui/icons/OpenInNew';
import FilterListIcon from '@material-ui/icons/FilterList';
import { lighten } from '@material-ui/core/styles/colorManipulator';

let counter = 0;
function createData(id, name, dtype) {
counter += 1;
return { id: id, name, dtype};
}

Expand Down Expand Up @@ -177,7 +175,7 @@ EnhancedTableToolbar = withStyles(toolbarStyles)(EnhancedTableToolbar);
const styles = theme => ({
root: {
width: '100%',
marginTop: theme.spacing.unit * 3,
marginTop: theme.spacing(3),
},
table: {
minWidth: 540,
Expand Down Expand Up @@ -217,7 +215,7 @@ class EnhancedTable extends React.Component {
id.forEach((x) =>{
getDeleteHandler(x);
this.state.data.forEach((y) => {
if(y.id == x){
if(y.id === x){
console.log(x, "deleted")
}
else{
Expand Down Expand Up @@ -291,7 +289,7 @@ class EnhancedTable extends React.Component {


return (
<Grid container spacing={24}>
<Grid container spacing={10}>
<Grid item xs={2}>
</Grid>
<Grid item xs={8}>
Expand All @@ -302,8 +300,8 @@ class EnhancedTable extends React.Component {
<Table className={classes.table} aria-labelledby="tableTitle">
<EnhancedTableHead
numSelected={selected.length}
order={order}
orderBy={orderBy}
order={order?order:'asc'}
orderBy={orderBy?orderBy:'name'}
onSelectAllClick={this.handleSelectAllClick}
onRequestSort={this.handleRequestSort}
rowCount={data.length}
Expand Down
21 changes: 8 additions & 13 deletions tensormap-client/src/pages/visualizedata/VisualizeData.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@ import Search from '@material-ui/icons/Search';
import ViewColumn from '@material-ui/icons/ViewColumn';
import { saveAs } from 'file-saver';
import { forwardRef } from 'react';
import { template } from '@babel/core';
import {Button,ButtonGroup,Collapse,Tabs,Tab} from 'react-bootstrap';
import {Button,Tabs,Tab} from 'react-bootstrap';


const tableIcons = {
Expand Down Expand Up @@ -290,7 +289,7 @@ class VisualizeData extends React.Component {
console.log(e.target.value);
var tempData = [...this.state.columnCheckBoxes]
for (var column in tempData) {
if (e.target.value == tempData[column].title){
if (e.target.value === tempData[column].title){
tempData[column].checked = !(tempData[column].checked)
break;
}
Expand All @@ -303,7 +302,7 @@ class VisualizeData extends React.Component {
console.log(e.target.value);
var tempData = [...this.state.labels]
for (var column in tempData) {
if (e.target.value == tempData[column].title){
if (e.target.value === tempData[column].title){
tempData[column].checked = !(tempData[column].checked)
break;
}
Expand All @@ -323,7 +322,7 @@ class VisualizeData extends React.Component {
var featureColumn = null
for (var column in tempFeatureData) {
console.log(tempFeatureData[column].title)
if (e.target.value == tempFeatureData[column].title){
if (e.target.value === tempFeatureData[column].title){
tempFeatureData[column].checked = !(tempFeatureData[column].checked)
featureColumn = tempFeatureData[column]
console.log(featureColumn)
Expand All @@ -337,17 +336,17 @@ class VisualizeData extends React.Component {
console.log(featureColumn.checked)
var currentLabels = [...this.state.labels]

if(featureColumn.checked == true){
if(featureColumn.checked === true){
console.log("y")
for(var labeldata in currentLabels){
if (e.target.value == currentLabels[labeldata].title){
if (e.target.value === currentLabels[labeldata].title){
currentLabels.splice(currentLabels.indexOf(currentLabels[labeldata]), 1);
this.setState({labels:currentLabels});
break;
}
}
}
else if(featureColumn.checked == false){
else if(featureColumn.checked === false){
console.log("else")
var labelCheckBoxAlter = featureColumn
labelCheckBoxAlter.checked = false
Expand Down Expand Up @@ -415,11 +414,7 @@ class VisualizeData extends React.Component {


render() {
const {sampleData} = this.state;
const {classes} = this.props;
const {match} = this.props;


const {classes} = this.props;

return (
<div className={classes.container}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const styles = theme => ({
backgroundColor: 'green'
},
table: {
fontFamily: '\"Trebuchet MS\", Arial, Helvetica, sans-serif',
fontFamily: '"Trebuchet MS", Arial, Helvetica, sans-serif',
borderCollapse: 'collapse',
width: '100%',
},
Expand All @@ -33,7 +33,6 @@ const styles = theme => ({
border: 'none',
color: 'white',
padding: '5px 10px',
textAlign: 'center',
textDecoration: 'none',
display: 'inline-block',
fontSize: '15px',
Expand Down