Skip to content

Commit

Permalink
fixes for indexes and remove console logs
Browse files Browse the repository at this point in the history
  • Loading branch information
bryanph committed May 10, 2017
1 parent 70d9a72 commit 81643a1
Show file tree
Hide file tree
Showing 43 changed files with 4 additions and 153 deletions.
2 changes: 0 additions & 2 deletions client/app/actions/async.js
Original file line number Diff line number Diff line change
Expand Up @@ -414,8 +414,6 @@ export function fetchRemoveEdge(id, start, end) {
}
export function removeEdge(id) {
// i need to know the from. and to properties of the edge, how to pass?
console.log("removing edge with id ", id);

return (dispatch, getState) => {
// get from, to edge id's then dispatch them to fetchRemoveEdge
const edge = getEdge(getState(), id)
Expand Down
4 changes: 0 additions & 4 deletions client/app/components/AddCollectionRelationWindow/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,6 @@ class AddCollectionRelationWindow extends React.Component {
addCollectionWithRelation() {
const { editorState } = this.props

console.log("is Content Link: ", isContentLink);
console.log(this.props);


if (this.props.fromBatch) {
this.props.createCollection()
.then(action => action.response.entities.nodes[action.response.result])
Expand Down
2 changes: 0 additions & 2 deletions client/app/components/CollectionDetailGraph/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,6 @@ class CollectionDetailGraph extends React.Component {
*/
let { nodes, links } = nextProps

// console.log(`in update with ${nodes.length} nodes and ${links.length} links`);

const nodeById = d3.map()

// set extra properties here
Expand Down
3 changes: 0 additions & 3 deletions client/app/components/CollectionOverviewGraph/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,6 @@ class CollectionExploreGraph extends React.Component {

let { nodes, links } = nextProps

// console.log(`in update with ${nodes.length} nodes and ${links.length} links`);

const maxNodeCount = d3.max(nodes, (d) => d.count)
const radiusScale = d3.scaleLinear().domain([0, maxNodeCount]).range([10, 20])

Expand Down Expand Up @@ -137,7 +135,6 @@ class CollectionExploreGraph extends React.Component {
}

setTimeout(() => {
console.log(this.props.selected);
colorNode(d3.select(`#node-${this.props.selected}`))
}, 0)
}
Expand Down
3 changes: 0 additions & 3 deletions client/app/components/ConnectWindow/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,6 @@ class ConnectWindow extends React.Component {

const selection = editorState.getSelection();

console.log("Creating content link entity...");

const entityKey = Entity.create(ENTITY_TYPE, 'IMMUTABLE', { nodeId, edgeId });
setEditorState(RichUtils.toggleLink(editorState, selection, entityKey));
}
Expand Down Expand Up @@ -69,7 +67,6 @@ class ConnectWindow extends React.Component {

// TODO: how do we handle links from non-text? - 2016-07-08

console.log('in connectWindow...');
this.props.addEdge(this.props.id, node._id, text)
.then(action => {
this.createContentLinkEntity(node._id, action.response.result)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,6 @@ class BlockControlButton extends React.Component {
const editorState = props.getEditorState();
const selection = editorState.getSelection();

// console.log(selection.getStartKey());
// console.log(selection.getAnchorKey());

const blockType = editorState
.getCurrentContent()
.getBlockForKey(selection.getStartKey() || selection.getAnchorKey())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,9 @@ function keyBindingFn(e) {

export default (config = {}) => {
function handleKeyCommand(command, { getEditorState, setEditorState }) {
// console.log('called handleKeyCommand...');
const editorState = getEditorState()

// let newState = RichUtils.handleKeyCommand(editorState, command)
// console.log(newState);

if (command === 'insert-header-three') {
const nextState = RichUtils.toggleBlockType(
Expand Down Expand Up @@ -117,8 +115,6 @@ export default (config = {}) => {

// const afterSplit = Modifier.splitBlock(afterRemoval, targetSelection);

// console.log(blockType);

const afterRemoval = Modifier.removeRange(
contentState,
selectionState,
Expand Down Expand Up @@ -155,9 +151,6 @@ export default (config = {}) => {

if (blockTypesNoNewLine.includes(blockType)) {
// remove the blocktype
// console.log('removing blockType...');
// console.log(RichUtils.tryToRemoveBlockStyle(editorState));
// console.log(removeSelectedBlocksStyle(editorState))
// const newState = removeSelectedBlocksStyle(editorState)
const newState = RichUtils.toggleBlockType(
newEditorState,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,6 @@ export default class TeXBlock extends React.Component {
};
this._startEdit = () => {
// TODO: why is a timeout needed here? - 2016-08-22
console.log(this.refs.textarea);
setTimeout(() => this.refs.textarea.textarea.focus(), 0)
const onStartEdit = this.props.onStartEdit || this.props.blockProps.onStartEdit
onStartEdit(this.props.entityKey || this.props.block.getKey(), this.props.inline);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,12 +64,8 @@ function texHandleKeyCommand(command: string, { getEditorState, setEditorState }

// const fragments = getFragmentFromSelection(editorState)

// console.log("setting fragments...", fragments);

// const rawBlocks = convertBlocksToRaw(contentState, fragments)

// console.log("raw blocks...", rawBlocks);


// window.localStorage.setItem('draftjs-copyState', JSON.stringify(rawBlocks))

Expand Down Expand Up @@ -100,8 +96,6 @@ export default (config = {}) => {
let rawBlocks = convertBlocksToRaw(contentState, fragments)
rawBlocks.editorKey = getEditorKey()

// console.log(rawBlocks);

window.localStorage.setItem('draftjs-copyState', JSON.stringify(rawBlocks))

// set clipboard to null, must happen after draft sets it - 2016-11-16
Expand Down Expand Up @@ -283,7 +277,6 @@ export default (config = {}) => {
};
}
// if (block.getType() === 'inline-latex') {
// console.log('with inline...');
// return {
// component: TeXBlock,
// editable: false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,6 @@ export function isActive(editorState) {

const called = false

// console.log(getSelectionEntity(editorState))

// TODO: write a helper method for this - 2016-09-23
return getSelectionEntity(editorState)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,6 @@ export default (config = {}) => {
}
}
// } else if (type === 'atomic') {
// console.log("Returning atomic!!!");
// console.log(contentBlock.getData());
// return {
// component: Media,
// editable: false,
Expand Down
5 changes: 0 additions & 5 deletions client/app/components/ContentEditor/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -252,8 +252,6 @@ class RichEditor extends React.Component {
}

return selectedBlocks.every(block => {
// console.log(block.getType());
// console.log(blockContainsEntityType(block, 'inline-latex'));
return ['unstyled', 'header-three', 'header-four', 'header-five', 'blockquote', 'code-block', 'unordered-list-item', 'ordered-list-item'].includes(block.getType()) && block.getText() !== ''
// return !blockContainsEntityType(block, 'inline-latex')
// && block.getType() === 'unstyled'
Expand Down Expand Up @@ -285,7 +283,6 @@ class RichEditor extends React.Component {
// editorState set globally
// by default, force this state transition
if (this.props.globalEditorState !== nextProps.globalEditorState) {
console.log('globalEditorState was changed!!!');
this.onChange(nextProps.globalEditorState, null, true)
}
}
Expand Down Expand Up @@ -326,8 +323,6 @@ class RichEditor extends React.Component {
const added = _.difference(entities, prevEntities)
const removed = _.difference(prevEntities, entities)

// console.log('added!', added);

const addedPromises = added.map((entityKey) => {
// add this entity remotely on the server

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ export default function cloneEntitiesInFragment(fragment, customEntityMap) {
block.getCharacterList().forEach(character => {
const key = character.getEntity();
if (key !== null) {
// console.log(key);
// entities[key] = Entity.get(key);
entities[key] = customEntityMap ? customEntityMap[key] : Entity.get(key);
}
Expand Down
2 changes: 0 additions & 2 deletions client/app/components/EditableTitle/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ import './styles.css'
// type='text' {...props}
// ref={(input) => {
// if (input) {
// console.log(input.refs.textarea);
// input.refs.textarea.select()
// }
// }}
Expand Down Expand Up @@ -83,7 +82,6 @@ class EditableTitle extends React.Component {

onClick(e) {
this.setState({ editable: true }, () => {
console.log(this.refs.input);
// this.refs.input.select()
})
}
Expand Down
2 changes: 0 additions & 2 deletions client/app/components/Input/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,7 @@ export function controlled(InputComponent) {
}

// componentWillReceiveProps(nextProps) {
// console.log(nextProps);
// if (nextProps.value !== this.state.value) {
// console.log(nextProps.value);
// this.setState({ value: nextProps.value })
// }
// }
Expand Down
4 changes: 0 additions & 4 deletions client/app/components/NodeExploreGraph/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,16 +38,12 @@ class NodeExploreGraph extends React.Component {

let { nodes, links } = nextProps

// console.log(`in update with ${nodes.length} nodes and ${links.length} links`);

const nodeById = d3.map()

nodes.forEach(node => {
nodeById.set(node.id, node)
})

// console.log(_.map(nodes, x => x.id));

links.forEach(link => {
link.source = nodeById.get(link.start)
link.target = nodeById.get(link.end)
Expand Down
2 changes: 0 additions & 2 deletions client/app/components/NodeGraph/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,6 @@ class NodeOverviewGraph extends React.Component {

let { nodes, links } = nextProps

// console.log(`in update with ${nodes.length} nodes and ${links.length} links`);

const nodeById = d3.map()

// set extra properties here
Expand Down
2 changes: 0 additions & 2 deletions client/app/components/Topbar/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -160,8 +160,6 @@ class Topbar extends React.Component {
}

navigate(result) {
console.log('called!');
console.log(result);
const id = result._id
if(result._index === "collections2") { // TODO: do this differently - 2017-05-10
this.props.router.push(`/app/collections/${id}`)
Expand Down
2 changes: 0 additions & 2 deletions client/app/containers/CollectionEditor/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,12 @@ import Spinner from '../../components/Spinner'
class CollectionEditor extends React.Component {

componentWillMount() {
console.log('loading collection..');
this.props.loadCollection(this.props.id)
}

componentWillReceiveProps(nextProps) {
// TODO: set active collection if id is set - 2016-10-05
if (nextProps.id && this.props.id !== nextProps.id) {
console.log('loading collection...');
this.props.loadCollection(nextProps.id)
}
}
Expand Down
1 change: 0 additions & 1 deletion client/app/containers/CollectionSearch/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@ class extends React.Component {
/>
))

console.log(searchResults);
const directMatch = _.find(searchResults, (r) => r._source.title === searchValue)

// TODO: make this div free-floating relative to some defined block - 2016-07-11
Expand Down
1 change: 0 additions & 1 deletion client/app/containers/Inbox/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,6 @@ export class NodeBatchCreateGraph extends React.Component { // eslint-disable-li
render() {
const { nodes, links, selectedNode, loadingStates } = this.props

// console.log(loadingStates.GET_ALL_BATCH_NODES);
if (loadingStates.GET_ALL_BATCH_NODES) {
return <Spinner style={{ height: '80%' }} />
}
Expand Down
3 changes: 0 additions & 3 deletions client/app/containers/NodeExplore/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ export class NodeExplore extends React.Component { // eslint-disable-line react/

connectNodes(from, to) {
// TODO: temporarity until we get a better solution... - 2016-07-29
console.log(`called connectNodes from ${from} to ${to}`);

this.props.connectNodes(from, to)
.then(() => loadData(this.props))
Expand Down Expand Up @@ -126,8 +125,6 @@ import { getNode, getL2Nodes, getL2Edges } from '../../reducers'
function mapStateToProps(state, props) {
const id = (props.params && props.params.id) || props.id

// console.log('changed route? ', id);

return {
id: id,
node: getNode(state, id),
Expand Down
1 change: 1 addition & 0 deletions client/app/containers/NodeSearch/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,5 @@
top: 50%;
left: 50%;
transform: translateX(-50%) translateY(-50%);
color: black;
}
4 changes: 0 additions & 4 deletions client/app/containers/NodeToolbar/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,6 @@ export class NodeToolbar extends React.Component { // eslint-disable-line react/
render() {
const { node, loadingStates } = this.props

console.log(this.props);

// loading state on changing component
if (loadingStates.GET_NODE || !node) {
return <Spinner style={{ height: '190px' }} />
Expand All @@ -93,8 +91,6 @@ export class NodeToolbar extends React.Component { // eslint-disable-line react/
'trash': this.removeNode,
}

console.log(this.props.page, 'called');

return (
<HotKeys focused={true} attach={document.getElementById('app')} handlers={handlers} style={{ width: '100%' }}>
<div className="nodeToolbar">
Expand Down
2 changes: 0 additions & 2 deletions client/app/containers/Sidebar/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@ import { Link } from 'react-router'

import { primaryColor, lightTextColor } from '../App/muitheme.js'

console.log(lightTextColor);

const styles = {
drawer: {
backgroundColor: primaryColor,
Expand Down
5 changes: 0 additions & 5 deletions client/app/graph/drag.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,6 @@ export default (simulation) => (actions, clickNoDrag) => {

const { nodes } = this.props

console.log('calling dragstart...');
console.log(nodes);

// simulation.stop()
nodes.forEach(node => {
node.fx = node.x
Expand All @@ -40,7 +37,6 @@ export default (simulation) => (actions, clickNoDrag) => {
d.fy = d3.event.y;

// TODO: instead just stop simulation, update node position and call tick manually - 2016-08-24
// console.log('calling tick...');
// simulation.tick()

const { nodes } = this.props
Expand Down Expand Up @@ -113,7 +109,6 @@ export default (simulation) => (actions, clickNoDrag) => {
})

if (!d3.event.active) {
console.log('restarting!');
simulation.alphaTarget(0);
simulation.alpha(0.8).restart();
}
Expand Down
2 changes: 0 additions & 2 deletions client/app/graph/events.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@ export default (zoom, actions) => {

const data = node.datum()

console.log('called nodeClickNoDrag in graph/events.js...');

actions.loadNode(data.id, true)
.then(() => actions.showGraphSideBar(data.id))
.then(() => window.scrollTo(0, 0))
Expand Down
2 changes: 0 additions & 2 deletions client/app/graph/node.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,6 @@ export default (options={}) => (enter=[], update=[], exit=[]) => {
return selection
},
exitNode: (selection) => {
// console.log('called removeNode');
// console.log(selection.size());
selection.remove()

return selection
Expand Down
3 changes: 0 additions & 3 deletions client/app/graph/simulation.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,6 @@ function linkArc(d, curved=false) {
// distance from source node to edge of target node
// const nodeDistance = lineDistance - d.target.r

// console.log(d);

const sourceRadius = d.source.radius || NODE_RADIUS
const targetRadius = d.target.radius || NODE_RADIUS

Expand All @@ -68,7 +66,6 @@ function drawPath(d) {
'Z'
].join(' ')

console.log(path);
return path
}

Expand Down
Loading

0 comments on commit 81643a1

Please sign in to comment.