<commit_before>import React, { Component } from "react";
import PropTypes from "prop-types";
import { connect } from "react-redux";
import { Button, PersonaBarPageHeader, PersonaBarPage}  from "@dnnsoftware/dnn-react-common";
import RolesPanel from "./roles";
import {
    visiblePanelActions as VisiblePanelActions
} from "../actions";
import resx from "../resources";
import util from "utils";
let canEdit = false;
class Root extends Component {
    constructor() {
        super();
        canEdit = util.settings.isHost || util.settings.isAdmin || util.settings.permissions.EDIT;
    }

    navigateMap(page, index, event) {
        event.preventDefault();
        const {props} = this;
        props.dispatch(VisiblePanelActions.selectPanel(page, index));
    }

    onCreate() {
        this.rolesPanelref.getWrappedInstance().onAddRole();
    }

    render() {
        return (
            <div className="roles-app">
                <PersonaBarPage isOpen={true}>
                    <PersonaBarPageHeader title={resx.get("Roles") }>
                        {canEdit &&
                            <Button type="primary" size="large" onClick={this.onCreate.bind(this) }>{resx.get("Create") }</Button>
                        }
                    </PersonaBarPageHeader>
                    <RolesPanel ref={node => this.rolesPanelref = node} />
                </PersonaBarPage>
            </div>
        );
    }
}

Root.PropTypes = {
    dispatch: PropTypes.func.isRequired,
    selectedPage: PropTypes.number,
    selectedPageVisibleIndex: PropTypes.number
};


function mapStateToProps() {
    return {};
}


export default connect(mapStateToProps)(Root);<commit_msg>Fixed compilation warning in Roles module<commit_after>import React, { Component } from "react";
import PropTypes from "prop-types";
import { connect } from "react-redux";
import { Button, PersonaBarPageHeader, PersonaBarPage}  from "@dnnsoftware/dnn-react-common";
import RolesPanel from "./roles";
import resx from "../resources";
import util from "utils";
let canEdit = false;
class Root extends Component {
    constructor() {
        super();
        canEdit = util.settings.isHost || util.settings.isAdmin || util.settings.permissions.EDIT;
    }

    onCreate() {
        this.rolesPanelref.getWrappedInstance().onAddRole();
    }

    render() {
        return (
            <div className="roles-app">
                <PersonaBarPage isOpen={true}>
                    <PersonaBarPageHeader title={resx.get("Roles") }>
                        {canEdit &&
                            <Button type="primary" size="large" onClick={this.onCreate.bind(this) }>{resx.get("Create") }</Button>
                        }
                    </PersonaBarPageHeader>
                    <RolesPanel ref={node => this.rolesPanelref = node} />
                </PersonaBarPage>
            </div>
        );
    }
}

Root.PropTypes = {
    dispatch: PropTypes.func.isRequired,
    selectedPage: PropTypes.number,
    selectedPageVisibleIndex: PropTypes.number
};


function mapStateToProps() {
    return {};
}


export default connect(mapStateToProps)(Root);
{'fraction_non_alphanumeric': 0.1256377551020408, 'fraction_numerical': 0.0, 'mean_word_length': 2.398699891657638, 'pattern_counts': {'":': 0, '<': 21, '<?xml version=': 0, '>': 23, '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': '2278011', 'n_tokens_mistral': 878, 'n_tokens_neox': 862, 'n_words': 181}