<commit_before>'use strict';

var _     = require('lodash');
var React = require('react');
var api = require('../data/api.js')

var Overview   = require('dashboard/nco/Overview.jsx');
var Breakdown  = require('dashboard/nco/Breakdown.jsx');
var ReviewPage = require('../doc-review/ReviewPage');
// var TitleMenu  = require('component/TitleMenu.jsx');
var CampaignTitleMenu   = require('component/CampaignTitleMenu.jsx');

var {
	Datascope, LocalDatascope,
	SimpleDataTable, SimpleDataTableColumn,
	Paginator, SearchBar,
	FilterPanel, FilterDateRange
	} = require('react-datascope');

// var Router = require('react-router');
// var {Route, DefaultRoute, RouteHandler,NotFoundRoute, NotFound, Redirect, Link} = Router;

var SourceDataDashboard = React.createClass({
  propTypes : {
    dashboard : React.PropTypes.object.isRequired,
    data      : React.PropTypes.object.isRequired,
    region    : React.PropTypes.object.isRequired,

    loading   : React.PropTypes.bool
  },

  getDefaultProps : function () {
    return {
      loading : false
    };
  },

  render : function () {
    var data    = this.props.data; // i should populate this with the data call from doc review
    var loading = this.props.loading;

    const fields = {
    	map_link: {
    		title: 'Master Object Name',
    		key: 'id',
    		renderer: (id) => {
    				return MapButtonFunction(id)
    			}
    	},
    };

    var doc_id = 72;
    const fieldNamesOnTable = ['id','content_type','source_object_code','master_object_id'];

    var data_fn = function(){
      return api.admin.docMap({document:doc_id},null,{'cache-control':'no-cache'})
    };

		// console.log(this.props)

		var campaign = this.props.region
		var campaigns = this.props.indicators

		var review_header =
		<div className="admin-container">
      <h1 className="admin-header"></h1>
      <ul className="admin-nav">
      <li><a className="" href="/datapoints/source-data/Alkaleri/2015/03/">Home</a></li>
      <li><a className="" href="/datapoints/source-data/Alkaleri/2015/03/">Mapping</a></li>
      <li><a className="" href="/datapoints/source-data/Alkaleri/2015/03/">Mapping</a></li>
      <li><a className="" href="/datapoints/source-data/Alkaleri/2015/03/">Validate</a></li>
      <li><a className="" href="/datapoints/source-data/Alkaleri/2015/03/">View Results</a></li>
			</ul>
    </div>;

		var refreshMasterUrl = '/source_data/refresh_master/' + doc_id
		var refreshMasterButton = refreshMasterUrl ?
			<div className="ufadmin-create-button">
				<a className="button" href={refreshMasterUrl}>Refresh Master</a>
			</div> : null;


		return (<div>
    		{review_header}
				<h2> Document ID :  </h2>
				{refreshMasterButton}
		    <ReviewPage<commit_msg>set onclick function in source data dashboard<commit_after>'use strict';

var _     = require('lodash');
var React = require('react');
var api = require('../data/api.js')

var Overview   = require('dashboard/nco/Overview.jsx');
var Breakdown  = require('dashboard/nco/Breakdown.jsx');
var ReviewPage = require('../doc-review/ReviewPage');
// var TitleMenu  = require('component/TitleMenu.jsx');
var CampaignTitleMenu   = require('component/CampaignTitleMenu.jsx');

var {
	Datascope, LocalDatascope,
	SimpleDataTable, SimpleDataTableColumn,
	Paginator, SearchBar,
	FilterPanel, FilterDateRange
	} = require('react-datascope');

// var Router = require('react-router');
// var {Route, DefaultRoute, RouteHandler,NotFoundRoute, NotFound, Redirect, Link} = Router;

var SourceDataDashboard = React.createClass({
  propTypes : {
    dashboard : React.PropTypes.object.isRequired,
    data      : React.PropTypes.object.isRequired,
    region    : React.PropTypes.object.isRequired,

    loading   : React.PropTypes.bool
  },

	logSomething : function () {
		console.log('LOAAAADING')
		return {}
	},



  getDefaultProps : function () {
    return {
      loading : false
    };
  },

  render : function () {
    var data    = this.props.data; // i should populate this with the data call from doc review
    var loading = this.props.loading;

    const fields = {
    	map_link: {
    		title: 'Master Object Name',
    		key: 'id',
    		renderer: (id) => {
    				return MapButtonFunction(id)
    			}
    	},
    };

    var doc_id = 8;
    const fieldNamesOnTable = ['id','content_type','source_object_code','master_object_id'];

    var data_fn = function(){
      return api.admin.docMap({document:doc_id},null,{'cache-control':'no-cache'})
    };

		// console.log(this.props)

		var campaign = this.props.region
		var campaigns = this.props.indicators

		var review_header =
		<div className="admin-container">
      <h1 className="admin-header"></h1>
      <ul className="admin-nav">
			<li><a href="#" onClick={this.logSomething}>Mapping</a></li>
			</ul>
    </div>;

		var refreshMasterUrl = '/source_data/refresh_master/' + doc_id
		var refreshMasterButton = refreshMasterUrl ?
			<div className="ufadmin-create-button">
				<a className="button" href={refreshMasterUrl}>Refresh Master</a>
			</div> : null;


		return (<div>
    		{review_header}
				<h2> Document ID :  </h2>
				{refreshMasterButton}
		    <ReviewPage
{'fraction_non_alphanumeric': 0.15047508241225518, 'fraction_numerical': 0.00795035873569905, 'mean_word_length': 3.50087260034904, 'pattern_counts': {'":': 0, '<': 55, '<?xml version=': 0, '>': 55, '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': '6121749', 'n_tokens_mistral': 1768, 'n_tokens_neox': 1651, 'n_words': 322}