<commit_before>// dependencies -------------------------------------------------------

import React        from 'react';
import Reflux       from 'reflux';
import Actions      from './dataset.actions.js';
import ClickToEdit  from '../common/forms/click-to-edit.jsx';
import datasetStore from './dataset.store';

let MetaData = React.createClass({

    mixins: [Reflux.connect(datasetStore)],

// life cycle events --------------------------------------------------

	render() {
		let dataset     = this.props.dataset;
		let userOwns    = dataset ? dataset.userOwns : null;
		let canEdit     = this.props.editable;
		let description = dataset ? dataset.description : null;
		let README      = dataset ? dataset.README : null;
		let metatdata = [
			{
				key:      'Authors',
				label:    'Authors',
				type:     'authors',
				value:    description.Authors,
				onChange: this._updateDescription.bind(this, 'Authors')
			},
			{
				key:      'README',
				label:    'README',
				value:    README,
				onChange: this._updateREADME
			},
			{
				key:      'DatasetDOI',
				label:    'Dataset DOI',
				value:    description.DatasetDOI,
				onChange: this._updateDescription.bind(this, 'DatasetDOI'),
			},
			{
				key:      'License',
				label:    'License',
				value:    description.License,
				onChange: this._updateDescription.bind(this, 'License'),
			},
			{
				key:      'Acknowledgements',
				label:    'Acknowledgements',
				value:    description.Acknowledgements,
				onChange: this._updateDescription.bind(this, 'Acknowledgements'),
			},
			{
				key:      'HowToAcknowledge',
				label:    'How to Acknowledge',
				value:    description.HowToAcknowledge,
				onChange: this._updateDescription.bind(this, 'HowToAcknowledge'),
			},
			{
				key:      'Funding',
				label:    'Funding',
				value:    description.Funding,
				onChange: this._updateDescription.bind(this, 'Funding'),
			},
			{
				key:      'ReferencesAndLinks',
				label:    'References and Links',
				value:    description.ReferencesAndLinks,
				onChange: this._updateDescription.bind(this, 'ReferencesAndLinks'),
			},
			{
				key:         'DigitalDocuments',
				label:       'Digital Documents',
				type:        'fileArray',
				value:       dataset.attachments,
				onChange:    this._uploadAttachment,
				onDelete:    this._deleteAttachment,
				onFileClick: this._downloadAttachment
			},
		];

		let fields = metatdata.map((item) => {
			return (
				<div className="description-item" key={item.key}>
					<ClickToEdit
						value={item.value}
						label={item.label}
						type={item.type}
						editable={canEdit}
						onChange={item.onChange}
						onDelete={item.onDelete}
						onFileClick={item.onFileClick} />
				</div>
			);
		});

		return <div className="dataset-readme">{fields}</div>;
	},

// custon methods -----------------------------------------------------

	_updateDescription: Actions.updateDescription,

	_updateAuthors: Actions.updateAuthors,

	_uploadAttachment: Actions.uploadAttachment,

	_deleteAttachment: Actions.deleteAttachment,

	_downloadAttachment: Actions.getAttachmentDownloadTicket,

	_updateREADME: Actions.updateREADME

});

export default MetaData;<commit_msg>simplified references<commit_after>// dependencies -------------------------------------------------------

import React        from 'react';
import Reflux       from 'reflux';
import actions      from './dataset.actions.js';
import ClickToEdit  from '../common/forms/click-to-edit.jsx';
import datasetStore from './dataset.store';

let MetaData = React.createClass({

    mixins: [Reflux.connect(datasetStore)],

// life cycle events --------------------------------------------------

	render() {
		let dataset     = this.props.dataset;
		let description = dataset.description;

		let metatdata = [
			{
				key:      'Authors',
				label:    'Authors',
				type:     'authors',
				value:    description.Authors,
				onChange: this._updateDescription.bind(this, 'Authors')
			},
			{
				key:      'README',
				label:    'README',
				value:    dataset.README,
				onChange: this._updateREADME
			},
			{
				key:      'DatasetDOI',
				label:    'Dataset DOI',
				value:    description.DatasetDOI,
				onChange: this._updateDescription.bind(this, 'DatasetDOI'),
			},
			{
				key:      'License',
				label:    'License',
				value:    description.License,
				onChange: this._updateDescription.bind(this, 'License'),
			},
			{
				key:      'Acknowledgements',
				label:    'Acknowledgements',
				value:    description.Acknowledgements,
				onChange: this._updateDescription.bind(this, 'Acknowledgements'),
			},
			{
				key:      'HowToAcknowledge',
				label:    'How to Acknowledge',
				value:    description.HowToAcknowledge,
				onChange: this._updateDescription.bind(this, 'HowToAcknowledge'),
			},
			{
				key:      'Funding',
				label:    'Funding',
				value:    description.Funding,
				onChange: this._updateDescription.bind(this, 'Funding'),
			},
			{
				key:      'ReferencesAndLinks',
				label:    'References and Links',
				value:    description.ReferencesAndLinks,
				onChange: this._updateDescription.bind(this, 'ReferencesAndLinks'),
			},
			{
				key:         'DigitalDocuments',
				label:       'Digital Documents',
				type:        'fileArray',
				value:       dataset.attachments,
				onChange:    this._uploadAttachment,
				onDelete:    this._deleteAttachment,
				onFileClick: this._downloadAttachment
			},
		];

		let fields = metatdata.map((item) => {
			return (
				<div className="description-item" key={item.key}>
					<ClickToEdit
						value={item.value}
						label={item.label}
						type={item.type}
						editable={this.props.editable}
						onChange={item.onChange}
						onDelete={item.onDelete}
						onFileClick={item.onFileClick} />
				</div>
			);
		});

		return <div className="dataset-readme">{fields}</div>;
	},

// custon methods -----------------------------------------------------

	_updateDescription: actions.updateDescription,

	_updateAuthors: actions.updateAuthors,

	_uploadAttachment: actions.uploadAttachment,

	_deleteAttachment: actions.deleteAttachment,

	_downloadAttachment: actions.getAttachmentDownloadTicket,

	_updateREADME: actions.updateREADME

});

export default MetaData;
{'fraction_non_alphanumeric': 0.16839254420901706, 'fraction_numerical': 0.0, 'mean_word_length': 2.3898488120950323, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 6, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1775314', 'n_tokens_mistral': 2323, 'n_tokens_neox': 1801, 'n_words': 351}