<commit_before>import React , { Component } from 'react';
import { connect } from 'react-redux';
import { Link } from 'react-router-dom';

import { getPublicationDetails } from '../actions/resolvedGetPublicationDetails';
/*
{"response":{"publication_id":"10","book_id":"10","title":"Kral\u0131n D\u00f6n\u00fc\u015f\u00fc","writers":"<NAME>","description":"\nY\u00fcz\u00fcklerin Efendisi son y\u00fczy\u0131l\u0131n en \u00e7ok okunan y\u00fcz kitab\u0131 aras\u0131nda en ba\u015fta geliyor. T\u00fcrk\u00e7e bas\u0131m\u0131n\u0131n ilk iki kitab\u0131 Y\u00fcz\u00fck Karde\u015fli\u011fi ve \u0130ki Kule, bu ilginin evrenselli\u011fini kan\u0131tlad\u0131. Polisiye ya da bilimkurgu merakl\u0131lar\u0131, \u015fiir, roman ve \u00f6yk\u00fc okurlar\u0131, hep birlikte Frodo, Sam, Merry, Pippin, Aragorn ve Gandalf'\u0131n maceralar\u0131n\u0131 okumaya, 'Orta D\u00fcnya'da ya\u015famaya ba\u015flad\u0131lar.\u00dc\u00e7\u00fcnc\u00fc kitap Kral\u0131n D\u00f6n\u00fc\u015f\u00fc ile birlikte Y\u00fcz\u00fcklerin Efendisi tamamlan\u0131yor: Bu k\u0131s\u0131mda Karanl\u0131klar Efendisi ile Y\u00fcz\u00fck Karde\u015fli\u011fi, iki cephede kar\u015f\u0131 kar\u015f\u0131ya geliyorlar. Frodo ve Sam ellerinde hepsine h\u00fckmedecek Tek Y\u00fcz\u00fck ile Mordor'un i\u00e7ine, karanl\u0131\u011f\u0131n kalbine do\u011fru bir yolculuk yaparken, di\u011ferleri de karanl\u0131\u011fa kar\u015f\u0131 son cephe olan Gondor'da umutsuz bir savunmaya giri\u015fiyorlar...\n","cover_no":"1","language":"tr","page_number":"408","publisher_name":"Unknown","publisher_id":"0"},"error":false}
*/
class PublicationDetailsPage extends Component {

	constructor(props) {
    super(props);

    this.state = props;
		this.setWriters = this.setWriters.bind(this);
  }

	componentDidMount() {
		this.props.getPublicationDetails(this.state.publicationId);
	}

	setWriters(writers) {

		if(!writers) return null;
		let writerArr = writers.split(",");
		const rowLen = writerArr.length;

		return writerArr = writerArr.map((w,i)=>{
			return <span key={w}><Link to={`/writers/${w}`}>{w}</Link>{rowLen === i+1 ? null : ', '}</span>
		});
	}

	render() {
		let publication = this.props.publication;
		return(
			<div className="publication-details-page">
				<div className="publication-details-container">
					<div className="col-md-3 col-sm-3 publication-info image-container">
						<img
							className="publication-image"
							src={`http://mustafaarikan.net/mylibrary/cover/${ publication.publication_id }.jpg`} />
					</div>
					<div className="col-md-9 col-sm-9 publication-info">
						<div className="publication-title">
							<span>{ publication.title }</span>
						</div>
						<div className="publication-writers">
							{ this.setWriters(publication.writers) }
						</div>
						<div className="publication-publisher">
							<span>{ publication.publisher_name }</span>
						</div>
						<p className="publication-description">
							{ publication.description }
						</p>
						<div className="publication-table">
							<table className="table table-responsive">
								<tbody>
									<tr>
										<td>ISBN</td>
										<td>{ publication.isbn }</td>
									</tr>
									<tr>
										<td>Cilt Numarası</td>
										<td>{ publication.cover_no }</td>
									</tr>
									<tr>
										<td>Ekleyen</td>
										<td>{ publication.added_by }</td>
									</tr>
								</tbody>
							</table>
						</div>
					</div>
					<div className="clearfix"></div>
					<div className="col-md-12">

					</div>
				</div>
			</div>
			)
	}<commit_msg>writer ids added to publication details.<commit_after>import React , { Component } from 'react';
import { connect } from 'react-redux';
import { Link } from 'react-router-dom';

import { getPublicationDetails } from '../actions/resolvedGetPublicationDetails';
/*
{"response":{"publication_id":"10","book_id":"10","title":"Kral\u0131n D\u00f6n\u00fc\u015f\u00fc","writers":"<NAME>","description":"\nY\u00fcz\u00fcklerin Efendisi son y\u00fczy\u0131l\u0131n en \u00e7ok okunan y\u00fcz kitab\u0131 aras\u0131nda en ba\u015fta geliyor. T\u00fcrk\u00e7e bas\u0131m\u0131n\u0131n ilk iki kitab\u0131 Y\u00fcz\u00fck Karde\u015fli\u011fi ve \u0130ki Kule, bu ilginin evrenselli\u011fini kan\u0131tlad\u0131. Polisiye ya da bilimkurgu merakl\u0131lar\u0131, \u015fiir, roman ve \u00f6yk\u00fc okurlar\u0131, hep birlikte Frodo, Sam, Merry, Pippin, Aragorn ve Gandalf'\u0131n maceralar\u0131n\u0131 okumaya, 'Orta D\u00fcnya'da ya\u015famaya ba\u015flad\u0131lar.\u00dc\u00e7\u00fcnc\u00fc kitap Kral\u0131n D\u00f6n\u00fc\u015f\u00fc ile birlikte Y\u00fcz\u00fcklerin Efendisi tamamlan\u0131yor: Bu k\u0131s\u0131mda Karanl\u0131klar Efendisi ile Y\u00fcz\u00fck Karde\u015fli\u011fi, iki cephede kar\u015f\u0131 kar\u015f\u0131ya geliyorlar. Frodo ve Sam ellerinde hepsine h\u00fckmedecek Tek Y\u00fcz\u00fck ile Mordor'un i\u00e7ine, karanl\u0131\u011f\u0131n kalbine do\u011fru bir yolculuk yaparken, di\u011ferleri de karanl\u0131\u011fa kar\u015f\u0131 son cephe olan Gondor'da umutsuz bir savunmaya giri\u015fiyorlar...\n","cover_no":"1","language":"tr","page_number":"408","publisher_name":"Unknown","publisher_id":"0"},"error":false}
*/
class PublicationDetailsPage extends Component {

	constructor(props) {
    super(props);

    this.state = props;
  }

	componentDidMount() {
		this.props.getPublicationDetails(this.state.publicationId);
	}

	setWriters(writers,writer_ids) {

		if(!writers) return null;
		let writerArr = writers.split(",");
		let writerIdsArr = writer_ids.split(",");
		const rowLen = writerArr.length;

		return writerArr = writerArr.map((w,i)=>{
			return <span key={w}><Link to={`/writers/${writerIdsArr[i]}`}>{w}</Link>{rowLen === i+1 ? null : ', '}</span>
		});
	}

	render() {
		let publication = this.props.publication;
		return publication && (
			<div className="publication-details-page">
				<div className="publication-details-container">
					<div className="col-md-3 col-sm-3 publication-info image-container">
						<img
							className="publication-image"
							src={`http://mustafaarikan.net/mylibrary/cover/${ publication.publication_id }.jpg`} />
					</div>
					<div className="col-md-9 col-sm-9 publication-info">
						<div className="publication-title">
							<span>{ publication.title }</span>
						</div>
						<div className="publication-writers">
							{ this.setWriters(publication.writers, publication.writer_ids) }
						</div>
						<div className="publication-publisher">
							<span>{ publication.publisher_name }</span>
						</div>
						<p className="publication-description">
							{ publication.description }
						</p>
						<div className="publication-table">
							<table className="table table-responsive">
								<tbody>
									{ publication.isbn &&
									<tr>
										<td>ISBN</td>
										<td>{ publication.isbn }</td>
									</tr> }
									<tr>
										<td>Cilt Numarası</td>
										<td>{ publication.cover_no }</td>
									</tr>
									<tr>
										<td>Ekleyen</td>
										<td>{ publication.added_by }</td>
									</tr>
								</tbody>
							</table>
						</div>
					</div>
					<div className="clearfix"></div>
					<div className="col-md-12">

					</div>
				</div>
			</div>
		)
	}
{'fraction_non_alphanumeric': 0.1519648255015114, 'fraction_numerical': 0.07144820005496015, 'mean_word_length': 3.4987639060568605, 'pattern_counts': {'":': 24, '<': 111, '<?xml version=': 0, '>': 113, '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': '3132181', 'n_tokens_mistral': 3655, 'n_tokens_neox': 2782, 'n_words': 471}