<commit_before>'use strict'

import React              from 'react'
import PropTypes          from 'prop-types'
import Component          from 'react-pure-render/component'
import {observer, inject} from 'mobx-react'

import RaisedButton       from 'material-ui/RaisedButton'
import Dialog             from 'material-ui/Dialog'

@inject('view', 'messages')
@observer
export default class ConfirmationDialog extends Component {

    static propTypes = {
        messages:           PropTypes.object.isRequired,
        view:               PropTypes.object.isRequired
    };

    closeConfirmationDialog() {
        this.props.view.confirmationDialog.open = false
    }

    render() {
        console.log(this.props.view.confirmationDialog)
        const {
            messages: {ui: {confirmationDialog: msg}},
            view: {confirmationDialog: {
                open, action, title, content,
                buttonLabels: {
                    confirm:    labelConfirm,
                    cancel:     labelCancel
                }
            }}
        } = this.props

        const closeConfirmationDialog = this.closeConfirmationDialog.bind(this)

        return (
            <Dialog
                open={open}
                modal={true}
                onRequestClose={closeConfirmationDialog}
                actions={[
                    <RaisedButton
                        label={labelCancel != null ? labelCancel : msg.cancel}
                        style={{margin: '0 1rem 1rem 0'}}
                        backgroundColor="#666"
                        hoverColor="#999"
                        onClick={closeConfirmationDialog}
                    />,
                    <RaisedButton
                        label={labelConfirm != null ? labelConfirm : msg.confirm}
                        backgroundColor="#666"
                        hoverColor="#999"
                        onClick={action}
                    />
                ]}
                title={title}
            >
                {content}
            </Dialog>
        )
    }

}<commit_msg>refactored confirmationDialog: allow users to overwrite button-labels<commit_after>'use strict'

import React              from 'react'
import PropTypes          from 'prop-types'
import Component          from 'react-pure-render/component'
import {observer, inject} from 'mobx-react'

import RaisedButton       from 'material-ui/RaisedButton'
import Dialog             from 'material-ui/Dialog'

@inject('view', 'messages')
@observer
export default class ConfirmationDialog extends Component {

    static propTypes = {
        messages:           PropTypes.object.isRequired,
        view:               PropTypes.object.isRequired
    };

    closeConfirmationDialog() {
        this.props.view.confirmationDialog.open = false
    }

    render() {
        console.log(this.props.view.confirmationDialog)
        const {
            messages:   {ui: {confirmationDialog: msg}},
            view:       {confirmationDialog: {
                open, action, title, content,
                buttonLabels: {
                    confirm:    labelConfirm,
                    cancel:     labelCancel
                }
            }}
        } = this.props

        const closeConfirmationDialog = this.closeConfirmationDialog.bind(this)

        return (
            <Dialog
                open={open}
                modal={true}
                onRequestClose={closeConfirmationDialog}
                actions={[
                    <RaisedButton // CANCEL
                        label={labelCancel != null ? labelCancel : msg.cancel}
                        style={{margin: '0 1rem 1rem 0'}}
                        backgroundColor="#666"
                        hoverColor="#999"
                        onClick={closeConfirmationDialog}
                    />,
                    <RaisedButton // CONFIRM
                        label={labelConfirm != null ? labelConfirm : msg.confirm}
                        backgroundColor="#666"
                        hoverColor="#999"
                        onClick={action}
                    />
                ]}
                title={title}
            >
                {content}
            </Dialog>
        )
    }

}
{'fraction_non_alphanumeric': 0.086834076507862, 'fraction_numerical': 0.007509974184463741, 'mean_word_length': 1.316304347826087, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, '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': '5093593', 'n_tokens_mistral': 1038, 'n_tokens_neox': 950, 'n_words': 202}