<commit_before>import * as React from 'react';

import { PythonManagementCreateProps } from '@waldur/ansible/python-management/create/PythonManagementCreateContainer';
import { VirtualEnvironmentsForm } from '@waldur/ansible/python-management/form/VirtualEnvironmentsForm';
import { PythonManagementFormData } from '@waldur/ansible/python-management/types/PythonManagementFormData';
import { validateVirtualEnvironmentDirectory } from '@waldur/ansible/python-management/validation';
import { FieldError, FormContainer, StringField, SubmitButton } from '@waldur/form-react';
import { CheckboxField } from '@waldur/form-react/CheckboxField';
import { ListField } from '@waldur/form-react/list-field/ListField';
import { ListConfiguration } from '@waldur/form-react/list-field/types';
import { translate } from '@waldur/i18n';

export interface PythonManagementCreateFormProps extends PythonManagementCreateProps {
  instanceListProperties: ListConfiguration;
  pythonManagement: PythonManagementFormData;
}

export class PythonManagementCreateForm extends React.Component<PythonManagementCreateFormProps> {

  state = {
    publicKeyHelpCollaped: true,
  };

  unwrapOrCollapsePublicKeyHelp = () => {
    this.setState({publicKeyHelpCollaped: !this.state.publicKeyHelpCollaped});
  }

  render() {
    const waldurPublicKeyHelp = (
      <>
        Ensure that the following public key is present in authorized_keys file on the selected instance
        <br/>
        <a onClick={this.unwrapOrCollapsePublicKeyHelp}>Help</a>
        {this.state.publicKeyHelpCollaped ? null :
          <>
            <br/>
            Ensure that the following public key is present in /home/SYSTEM_DEFAULT_USER/.ssh/authorized_keys file.
            <br/>
            If not, append it there. If file is not present, create new file with the key.
            <pre style={{whiteSpace: 'pre-wrap'}}>
              {this.props.waldurPublicKey}
            </pre>
          </>
        }
      </>
    );
    return (
      <div className="wrapper wrapper-content">
        <div className="ibox-content">
          <div className="row m-md">
            <div className="col-md-6"><commit_msg>[WAL-1449] Adapted prerequisites that should be fulfilled before creating python management application<commit_after>import * as React from 'react';

import { PythonManagementCreateProps } from '@waldur/ansible/python-management/create/PythonManagementCreateContainer';
import { VirtualEnvironmentsForm } from '@waldur/ansible/python-management/form/VirtualEnvironmentsForm';
import { PythonManagementFormData } from '@waldur/ansible/python-management/types/PythonManagementFormData';
import { validateVirtualEnvironmentDirectory } from '@waldur/ansible/python-management/validation';
import { FieldError, FormContainer, StringField, SubmitButton } from '@waldur/form-react';
import { CheckboxField } from '@waldur/form-react/CheckboxField';
import { ListField } from '@waldur/form-react/list-field/ListField';
import { ListConfiguration } from '@waldur/form-react/list-field/types';
import { translate } from '@waldur/i18n';

export interface PythonManagementCreateFormProps extends PythonManagementCreateProps {
  instanceListProperties: ListConfiguration;
  pythonManagement: PythonManagementFormData;
}

export class PythonManagementCreateForm extends React.Component<PythonManagementCreateFormProps> {

  state = {
    publicKeyHelpCollaped: true,
  };

  unwrapOrCollapsePublicKeyHelp = () => {
    this.setState({publicKeyHelpCollaped: !this.state.publicKeyHelpCollaped});
  }

  render() {
    const waldurPublicKeyHelp = (
      <ul>
        <li>
          Target virtual machine should have 'SSH' security group assigned (to allow SSH connections).
        </li>
        <li>
          Ensure that the following public key is present in authorized_keys file on the selected instance
          <br/>
          <a onClick={this.unwrapOrCollapsePublicKeyHelp}>Help</a>
          {this.state.publicKeyHelpCollaped ? null :
            <>
              <br/>
              Ensure that the following public key is present in /home/TARGET_SYSTEM_USER/.ssh/authorized_keys file.
              <br/>
              If not, append it there. If file is not present, create new file with the key.
              <pre style={{whiteSpace: 'pre-wrap'}}>
                {this.props.waldurPublicKey}
              </pre>
            </>
          }
        </li>
      </ul>
    );
    return (
      <div className="wrapper wrapper-content">
        <div className="ibox-content">
          <div className="row m-md">
            <div className="col-md-6">
{'fraction_non_alphanumeric': 0.10216450216450217, 'fraction_numerical': 0.0021645021645021645, 'mean_word_length': 3.413562559694365, 'pattern_counts': {'":': 0, '<': 39, '<?xml version=': 0, '>': 41, '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': '5567320', 'n_tokens_mistral': 1237, 'n_tokens_neox': 1218, 'n_words': 293}