<commit_before>import Radium from "radium";
import React, {PropTypes} from "react";

import components from "components";

import assetsPathTo from "lib/assets-path-to";
import string from "lib/string-it";
import {defaultTheme} from "lib/theme";

const backgroundKeyFrames = Radium.keyframes({
    "0%": {
        backgroundPosition: "100% 0%"
    },
    "50%": {
        backgroundPosition: "0% 100%"
    },
    "100%": {
        backgroundPosition: "100% 0%"
    }
});

const stylesFunction = ({colors}) => ({
    backgroundImageOverlay: {
        position: "fixed",
        top: "0px",
        left: "0px",
        height: "100%",
        width: "100%",
        zIndex: 100000000000,
        overflowY: "scroll",
        backgroundImage: `url(${assetsPathTo("images/logo_big.png")})`,
        backgroundSize: "cover"
    },
    overlay: {
        animation: "x 30s ease infinite",
        animationName: backgroundKeyFrames,
        animationDirection: "normal",
        backgroundImage: colors.backgroundLogin,
        backgroundSize: "4000% 4000%",
        position: "absolute",
        display: "block",
        top: "0px",
        left: "0px",
        height: "100%",
        width: "100%",
        zIndex: 10000000000,
        overflowY: "scroll"
    },
    body: {
        width: "100%",
        color: colors.white,
        fontWeight: "lighter",
        position: "absolute",
        top: "10%"
    },
    title: {
        container: {
            width: "100%",
            textAlign: "center"
        },
        logo: {
            width: "220px"
        },
        firstLine: {
            fontSize: "48px",
            fontWeight: "400"
        },
        secondLine: {
            fontSize: "26px",
            lineHeight: "24px"
        }
    },
    content: {
        width: "50%",
        height: "40%",
        position: "relative",
        margin: "auto",
        textAlign: "center"
    }
});

var UnauthorizedModal = React.createClass({
    propTypes: {
        isOpen: PropTypes.bool.isRequired
    },
    contextTypes: {
        theme: PropTypes.object
    },
    getTheme: function () {
        return this.context.theme || defaultTheme;
    },
    render: function () {
        const styles = stylesFunction(this.getTheme());
        return this.props.isOpen ? (
            <div style={styles.overlay}>
                <div style={styles.backgroundImageOverlay}>
                    <div style={styles.body}>
                        <div style={styles.title.container}>
                            <div>
                                <components.Icon
                                    color={this.getTheme().colors.iconLogoInnowatio}
                                    icon={"innowatio-logo"}
                                    size={"180px"}
                                    style={{
                                        display: "inline-block",
                                        height: "170px",
                                        margin: "0 0 0 20px",
                                        verticalAlign: "middle"
                                    }}
                                />
                            </div>
                            <div style={styles.title.firstLine}>{string.appName}</div>
                            <div style={styles.title.secondLine}>{string.innowatio}</div>
                        </div>
                        <components.Spacer direction="v" size={64} />
                        <div style={styles.content}>
                            <h2>
                                {"Siamo spiacenti ma la sua utenza non è autorizzata ad accedere."}
                                <br />
                                {"Si prega di contattare l'amministratore per ottenere i permessi."}
                            </h2>
                        </div>
                    </div>
                </div>
            </div>
        ) : null;
    }
});

module.exports = Radium(UnauthorizedModal);<commit_msg>[IWWA-941]: Add button logout when is shown unauthorized user message<commit_after>import Radium from "radium";
import React, {PropTypes} from "react";

import components from "components";

import asteroid from "lib/asteroid";
import assetsPathTo from "lib/assets-path-to";
import string from "lib/string-it";
import {defaultTheme} from "lib/theme";

const backgroundKeyFrames = Radium.keyframes({
    "0%": {
        backgroundPosition: "100% 0%"
    },
    "50%": {
        backgroundPosition: "0% 100%"
    },
    "100%": {
        backgroundPosition: "100% 0%"
    }
});

const stylesFunction = ({colors}) => ({
    backgroundImageOverlay: {
        position: "fixed",
        top: "0px",
        left: "0px",
        height: "100%",
        width: "100%",
        zIndex: 100000000000,
        overflowY: "scroll",
        backgroundImage: `url(${assetsPathTo("images/logo_big.png")})`,
        backgroundSize: "cover"
    },
    overlay: {
        animation: "x 30s ease infinite",
        animationName: backgroundKeyFrames,
        animationDirection: "normal",
        backgroundImage: colors.backgroundLogin,
        backgroundSize: "4000% 4000%",
        position: "absolute",
        display: "block",
        top: "0px",
        left: "0px",
        height: "100%",
        width: "100%",
        zIndex: 10000000000,
        overflowY: "scroll"
    },
    body: {
        width: "100%",
        color: colors.white,
        fontWeight: "lighter",
        position: "absolute",
        top: "10%"
    },
    title: {
        container: {
            width: "100%",
            textAlign: "center"
        },
        logo: {
            width: "220px"
        },
        firstLine: {
            fontSize: "48px",
            fontWeight: "400"
        },
        secondLine: {
            fontSize: "26px",
            lineHeight: "24px"
        }
    },
    content: {
        width: "90%",
        height: "40%",
        position: "relative",
        margin: "auto",
        textAlign: "center"
    },
    logoutButton: {
        background: colors.buttonPrimary,
        color: colors.white,
        height: "78px",
        width: "300px",
        margin: "auto",
        borderRadius: "30px",
        border: "0px none",
        fontSize: "30px",
        marginTop: "40px"
    }
});

var UnauthorizedModal = React.createClass({
    propTypes: {
        isOpen: PropTypes.bool.isRequired
    },
    contextTypes: {
        theme: PropTypes.object
    },
    logout: function () {
        asteroid.logout();
    },
    getTheme: function () {
        return this.context.theme || defaultTheme;
    },
    render: function () {
        const styles = stylesFunction(this.getTheme());
        return this.props.isOpen ? (
            <div style={styles.overlay}>
                <div style={styles.backgroundImageOverlay}>
                    <div style={styles.body}>
                        <div style={styles.title.container}>
                            <div>
                                <components.Icon
                                    color={this.getTheme().colors.iconLogoInnowatio}
                                    icon={"innowatio-logo"}
                                    size={"180px"}
                                    style={{
                                        display: "inline-block",
                                        height: "170px",
                                        margin: "0 0 0 20px",
                                        verticalAlign: "middle"
                                    }}
                                />
                            </div>
                            <div style={styles.title.firstLine}>{string.appName}</div>
                            <div style={styles.title.secondLine}>{string.innowatio}</div>
                        </div>
                        <components.Spacer direction="v" size={64} />
                        <div style={styles.content}>
                            <h2>
                                {"Siamo spiacenti ma la sua utenza non è autorizzata ad accedere."}
                                <br />
                                {"Si prega di contattare l'amministratore per ottenere i permessi."}
                            </h2>
                            <components.Button
                                block={true}
                                bsSize="large"
                                onClick={this.logout}
                                style={styles.logoutButton}
                            >
                                {"LOGOUT"}
                            </components.Button>
                        </div>
                    </div>
                </div>
            </div>
        ) : null;
    }
});

module.exports = Radium(UnauthorizedModal);
{'fraction_non_alphanumeric': 0.11963677639046538, 'fraction_numerical': 0.025766174801362087, 'mean_word_length': 1.2149321266968325, 'pattern_counts': {'":': 6, '<': 47, '<?xml version=': 0, '>': 49, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 4, 'word_list_counts': {'cursed_substrings.json': 18, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6949480', 'n_tokens_mistral': 2436, 'n_tokens_neox': 2240, 'n_words': 484}