<commit_before>import React, {Component} from "react";
import GridCell from "dnn-grid-cell";
import { PropTypes } from "prop-types";
import {DragSource} from 'react-dnd';


import "./styles.less";

import PersonaBarPageIcon from "./_PersonaBarPageIcon";
import PersonaBarSelectionArrow from "./_PersonaBarSelectionArrow";
import PersonaBarExpandCollapseIcon from "./_PersonaBarExpandCollapseIcon";

export class PersonaBarPageTreeview extends Component {

    constructor(){
        super();
        this.state = {};
    }

    trimName(item){
        let maxLength = 20;
        let {name, url} = item;
        let path = url.split(/.com\//);
        let newLength = path[1].split(/\//).length*2+1;
        let depth =( newLength < 20) ?  newLength: 19;
        console.log('item depth', depth);
        return (item.name.length > maxLength-depth) ? `${item.name.substring(0,maxLength-depth)}...` : item.name;
    }

    render_tree(childListItems){
        const {
                draggedItem,
                droppedItem,
                dragOverItem,
                getChildListItems,
                onSelection,
                onDrop,
                onDrag,
                onDragStart,
                onDragOver,
                onDragLeave,
                onDragEnd,
                onMovePage

        } = this.props;

        return (
             <PersonaBarPageTreeview
                draggedItem={draggedItem}
                droppedItem={droppedItem}
                dragOverItem={dragOverItem}
                getChildListItems={getChildListItems}
                listItems={childListItems}<commit_msg>DNN-9995 - remove console.log<commit_after>import React, {Component} from "react";
import GridCell from "dnn-grid-cell";
import { PropTypes } from "prop-types";
import {DragSource} from 'react-dnd';


import "./styles.less";

import PersonaBarPageIcon from "./_PersonaBarPageIcon";
import PersonaBarSelectionArrow from "./_PersonaBarSelectionArrow";
import PersonaBarExpandCollapseIcon from "./_PersonaBarExpandCollapseIcon";

export class PersonaBarPageTreeview extends Component {

    constructor(){
        super();
        this.state = {};
    }

    trimName(item){
        let maxLength = 20;
        let {name, url} = item;
        let path = url.split(/.com\//);
        let newLength = path[1].split(/\//).length*2+1;
        let depth =( newLength < 20) ?  newLength: 19;
        return (item.name.length > maxLength-depth) ? `${item.name.substring(0,maxLength-depth)}...` : item.name;
    }

    render_tree(childListItems){
        const {
                draggedItem,
                droppedItem,
                dragOverItem,
                getChildListItems,
                onSelection,
                onDrop,
                onDrag,
                onDragStart,
                onDragOver,
                onDragLeave,
                onDragEnd,
                onMovePage

        } = this.props;

        return (
             <PersonaBarPageTreeview
                draggedItem={draggedItem}
                droppedItem={droppedItem}
                dragOverItem={dragOverItem}
                getChildListItems={getChildListItems}
                listItems={childListItems}
{'fraction_non_alphanumeric': 0.10372670807453416, 'fraction_numerical': 0.007453416149068323, 'mean_word_length': 1.8991899189918993, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3147381', 'n_tokens_mistral': 919, 'n_tokens_neox': 869, 'n_words': 176}