<commit_before>import React, { Component } from 'react';

import Navigation from '../components/Navigation';
import Footer from '../components/Footer';
import Comments from '../components/Comments';
import Mapa from '../components/Mapa';
import UnsafeRender from '../components/UnsafeRender';
import LandUseVocabulary from '../components/LandUseVocabulary'

import api from '../services/api';
import '../assets/bootstrap.css';

import Moment from 'react-moment';

class SinglePlan extends Component {
  state = {
    plan: {},
  };

  componentDidMount() {
    const { id } = this.props.match.params;
    this.setState({ planId: id });
    return api
      .get('/plan/' + id)
      .then((plan) => this.setState({ plan: plan.data }))
      .catch((error) => {
        if (error.response.status === 404) {
          window.location = '/404';
        }

        this.setState({ error });
      });
  }

  render() {
    const { plan } = this.state;
    const { me } = this.props;

    return (
      <React.Fragment>
        <Navigation me={me} />
        <div className="container">
          {plan.PL_NAME && (
            <div className="container">
              <h1>{plan.PL_NAME}</h1>
              <div className="row">
                <div className="col">
                  <div className="rectangle">
                    <h4>מטרות התוכנית</h4>
                    <UnsafeRender html={plan.goals_from_mavat} />
                  </div>
                  <div className="rectangle">
                    <h4>תיאור התוכנית</h4>
                    <UnsafeRender html={plan.main_details_from_mavat} />
                  </div>
                  <div className="rectangle">
                    <h4>נתוני התוכנית</h4><commit_msg>fixed a twithch in error handling<commit_after>import React, { Component } from 'react';

import Navigation from '../components/Navigation';
import Footer from '../components/Footer';
import Comments from '../components/Comments';
import Mapa from '../components/Mapa';
import UnsafeRender from '../components/UnsafeRender';
import LandUseVocabulary from '../components/LandUseVocabulary'

import api from '../services/api';
import '../assets/bootstrap.css';

import Moment from 'react-moment';

class SinglePlan extends Component {
  state = {
    plan: {},
  };

  componentDidMount() {
    const { id } = this.props.match.params;
    this.setState({ planId: id });
    return api
      .get('/plan/' + id)
      .then((plan) => this.setState({ plan: plan.data }))
      .catch((error) => {
        if (error.response && error.response.status === 404) {
          window.location = '/404';
        }

        this.setState({ error });
      });
  }

  render() {
    const { plan } = this.state;
    const { me } = this.props;

    return (
      <React.Fragment>
        <Navigation me={me} />
        <div className="container">
          {plan.PL_NAME && (
            <div className="container">
              <h1>{plan.PL_NAME}</h1>
              <div className="row">
                <div className="col">
                  <div className="rectangle">
                    <h4>מטרות התוכנית</h4>
                    <UnsafeRender html={plan.goals_from_mavat} />
                  </div>
                  <div className="rectangle">
                    <h4>תיאור התוכנית</h4>
                    <UnsafeRender html={plan.main_details_from_mavat} />
                  </div>
                  <div className="rectangle">
                    <h4>נתוני התוכנית</h4>
{'fraction_non_alphanumeric': 0.14657142857142857, 'fraction_numerical': 0.008, 'mean_word_length': 1.9395465994962218, 'pattern_counts': {'":': 0, '<': 45, '<?xml version=': 0, '>': 49, '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': '326523', 'n_tokens_mistral': 1065, 'n_tokens_neox': 1016, 'n_words': 219}