<commit_before>import React, { Component } from 'react'
import axios from 'axios'
import classNames from 'classnames'
import update from 'immutability-helper'

import { path } from '../Routes'

import ProductForm from './ProductForm'
import Images from '../Images/Images'

import buttons from '../Buttons.module.css'
import page from '../Page.module.css'
import form from '../Form.module.css'
import styles from './Variant.module.css'

class Form extends React.Component {
  state = {
    variant: null,
    values: {
      color_id: '',
      state: '',
      created_at: null,
      latest: false,
      sale: false,
      soon: false,
      pinned: false,
      desc: '',
      comp: '',
      price: '',
      price_last: '',
      product_id: this.props.product ? this.props.product.id : [],
      product_attributes: this.props.product || null,
      availabilities_attributes: [],
      images: [],
      image_ids: null,
      images_attributes: [],

    },
    dictionaries: {
      colors: this.props.colors || [],
      stores: this.props.stores || [],
      sizes: this.props.sizes || [],
      categories: this.props.categories || [],
    },
  }

  componentDidMount() {
    if (this.props.id) {
      this._loadAsyncData(this.props.id);<commit_msg>Начальное значение state<commit_after>import React, { Component } from 'react'
import axios from 'axios'
import classNames from 'classnames'
import update from 'immutability-helper'

import { path } from '../Routes'

import ProductForm from './ProductForm'
import Images from '../Images/Images'

import buttons from '../Buttons.module.css'
import page from '../Page.module.css'
import form from '../Form.module.css'
import styles from './Variant.module.css'

class Form extends React.Component {
  state = {
    variant: null,
    values: {
      color_id: '',
      state: 'active',
      created_at: null,
      latest: false,
      sale: false,
      soon: false,
      pinned: false,
      desc: '',
      comp: '',
      price: '',
      price_last: '',
      product_id: this.props.product ? this.props.product.id : [],
      product_attributes: this.props.product || null,
      availabilities_attributes: [],
      images: [],
      image_ids: null,
      images_attributes: [],

    },
    dictionaries: {
      colors: this.props.colors || [],
      stores: this.props.stores || [],
      sizes: this.props.sizes || [],
      categories: this.props.categories || [],
    },
  }

  componentDidMount() {
    if (this.props.id) {
      this._loadAsyncData(this.props.id);
{'fraction_non_alphanumeric': 0.14561196379378197, 'fraction_numerical': 0.0, 'mean_word_length': 2.6681096681096683, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '5819582', 'n_tokens_mistral': 757, 'n_tokens_neox': 757, 'n_words': 188}