<commit_before>import React, { PureComponent } from 'react';
import PropTypes from 'prop-types';
import { Components, registerComponent, getFragment, withMessages } from 'meteor/vulcan:core';

import Dialog from '@material-ui/core/Dialog';
import DialogContent from '@material-ui/core/DialogContent';

import { Posts } from '../../lib/collections/posts/collection.js'
import withUser from '../common/withUser';
import { withRouter } from '../../lib/reactRouterWrapper.js';
import withMobileDialog from '@material-ui/core/withMobileDialog';
import { withStyles } from '@material-ui/core/styles';

const styles = theme => ({
  formSubmit: {
    display: "flex",
    flexWrap: "wrap",
  }
})

class NewQuestionDialog extends PureComponent {
  render() {
    const { onClose, currentUser, router, flash, fullScreen, classes } = this.props
    const { PostSubmit, SubmitToFrontpageCheckbox } = Components
    const QuestionSubmit = (props) => {
      return <div className={classes.formSubmit}>
        <SubmitToFrontpageCheckbox {...props}/>
        <PostSubmit {...props} />
      </div>
    }
    return (
      <Dialog
        open={true}
        maxWidth={false}
        onClose={onClose}
        fullScreen={fullScreen}
      >
        <DialogContent>
          <Components.WrappedSmartForm
            collection={Posts}
            fields={['title', 'contents', 'question', 'draft', 'submitToFrontpage']}
            mutationFragment={getFragment('PostsList')}
            prefilledProps={{
              userId: currentUser._id,
              question: true
            }}
            cancelCallback={onClose}
            successCallback={post => {
              router.push({pathname: Posts.getPageUrl(post)});<commit_msg>Fix NewQuestionDialog<commit_after>import React, { PureComponent } from 'react';
import PropTypes from 'prop-types';
import { Components, registerComponent, getFragment, withMessages } from 'meteor/vulcan:core';

import Dialog from '@material-ui/core/Dialog';
import DialogContent from '@material-ui/core/DialogContent';

import { Posts } from '../../lib/collections/posts/collection.js'
import withUser from '../common/withUser';
import { withRouter } from '../../lib/reactRouterWrapper.js';
import withMobileDialog from '@material-ui/core/withMobileDialog';
import { withStyles } from '@material-ui/core/styles';

const styles = theme => ({
  formSubmit: {
    display: "flex",
    flexWrap: "wrap",
  }
})

class NewQuestionDialog extends PureComponent {
  render() {
    const { onClose, currentUser, history, flash, fullScreen, classes } = this.props
    const { PostSubmit, SubmitToFrontpageCheckbox } = Components
    const QuestionSubmit = (props) => {
      return <div className={classes.formSubmit}>
        <SubmitToFrontpageCheckbox {...props}/>
        <PostSubmit {...props} />
      </div>
    }
    return (
      <Dialog
        open={true}
        maxWidth={false}
        onClose={onClose}
        fullScreen={fullScreen}
      >
        <DialogContent>
          <Components.WrappedSmartForm
            collection={Posts}
            fields={['title', 'contents', 'question', 'draft', 'submitToFrontpage']}
            mutationFragment={getFragment('PostsList')}
            prefilledProps={{
              userId: currentUser._id,
              question: true
            }}
            cancelCallback={onClose}
            successCallback={post => {
              history.push({pathname: Posts.getPageUrl(post)});
{'fraction_non_alphanumeric': 0.13221709006928406, 'fraction_numerical': 0.0, 'mean_word_length': 2.9108352144469527, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 21, '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': '3313984', 'n_tokens_mistral': 942, 'n_tokens_neox': 937, 'n_words': 208}