<commit_before>import React from 'react';
import Webiny from 'webiny';
import _ from 'lodash';
import './style.scss'
import imgInfinify from 'Assets/images/infinity.png';
import Updates from './Components/Updates';

/**
 * @i18n.namespace Webiny.Backend.Dashboard.Dashboard
 */
class Dashboard extends Webiny.Ui.View {
    constructor(props) {
        super(props);

        this.state = {
            user: {}
        };
    }

    componentDidMount() {
        super.componentDidMount();
        this.watch('User', user => {
            this.setState({user});
        });
    }

    getUserName() {
        const user = this.state.user;
        if (_.get(user, 'firstName', '') === '') {
            return null;
        }

        return _.get(user, 'firstName', '');
    }

}

Dashboard.defaultProps = {
    renderer() {

        const {View, Gravatar, Button, Grid, Icon, Link} = this.props;

        return (
            <View.Dashboard>
                <View.Header title={this.i18n('Dashboard')}>
                    <View.Header.Center>
                        <div className="user-welcome">
                            <div className="user-welcome__avatar">
                                <div className="avatar avatar--inline avatar--small">
                                    <span className="avatar-placeholder avatar-placeholder--no-border">
                                        <Gravatar className="avatar img-responsive" hash={this.state.user.gravatar} size="50"/>
                                    </span>
                                </div>
                            </div>
                            <h3 className="user-welcome__message">Hi {this.getUserName()}</h3>
                        </div>
                    </View.Header.Center>
                    <Button onClick={() => Webiny.Router.goToRoute('Me.Account')}>{this.i18n('Manage Account')}</Button>
                </View.Header>

                <View.Body>
                    <Updates/>
                    
                    <Grid.Row>
                        <Grid.Col all={4}>
                            <View.InfoBlock title={this.i18n('GET STARTED')}>
                                <ul>
                                    <li>
                                        <div className="block-list__item-image">
                                            <Icon icon="icon-keys" size="2x"/>
                                        </div>
                                        <a href="https://www.webiny.com/docs/current/components/must-know"
                                           className="block-list__item-text" target="_blank">
                                            <strong>{this.i18n('React Components')}</strong>
                                            {this.i18n(' - Learn what they do and how to implement them.')}

                                        </a>
                                    </li>
                                    <li>
                                        <div className="block-list__item-image">
                                            <Icon icon="fa-book " size="2x"/>
                                        </div>
                                        <a href="https://www.webiny.com/hub/tutorials" className="block-list__item-text"
                                           target="_blank">
                                            <strong>{this.i18n('Tutorials')}</strong>
                                            {this.i18n(' - How to setup Webiny and other applications.')}
                                        </a><commit_msg>Minor link update to dashboard learning resources.<commit_after>import React from 'react';
import Webiny from 'webiny';
import _ from 'lodash';
import './style.scss'
import imgInfinify from 'Assets/images/infinity.png';
import Updates from './Components/Updates';

/**
 * @i18n.namespace Webiny.Backend.Dashboard.Dashboard
 */
class Dashboard extends Webiny.Ui.View {
    constructor(props) {
        super(props);

        this.state = {
            user: {}
        };
    }

    componentDidMount() {
        super.componentDidMount();
        this.watch('User', user => {
            this.setState({user});
        });
    }

    getUserName() {
        const user = this.state.user;
        if (_.get(user, 'firstName', '') === '') {
            return null;
        }

        return _.get(user, 'firstName', '');
    }

}

Dashboard.defaultProps = {
    renderer() {

        const {View, Gravatar, Button, Grid, Icon, Link} = this.props;

        return (
            <View.Dashboard>
                <View.Header title={this.i18n('Dashboard')}>
                    <View.Header.Center>
                        <div className="user-welcome">
                            <div className="user-welcome__avatar">
                                <div className="avatar avatar--inline avatar--small">
                                    <span className="avatar-placeholder avatar-placeholder--no-border">
                                        <Gravatar className="avatar img-responsive" hash={this.state.user.gravatar} size="50"/>
                                    </span>
                                </div>
                            </div>
                            <h3 className="user-welcome__message">Hi {this.getUserName()}</h3>
                        </div>
                    </View.Header.Center>
                    <Button onClick={() => Webiny.Router.goToRoute('Me.Account')}>{this.i18n('Manage Account')}</Button>
                </View.Header>

                <View.Body>
                    <Updates/>
                    
                    <Grid.Row>
                        <Grid.Col all={4}>
                            <View.InfoBlock title={this.i18n('GET STARTED')}>
                                <ul>
                                    <li>
                                        <div className="block-list__item-image">
                                            <Icon icon="icon-keys" size="2x"/>
                                        </div>
                                        <a href="https://www.webiny.com/docs/current/guides/components"
                                           className="block-list__item-text" target="_blank">
                                            <strong>{this.i18n('React Components')}</strong>
                                            {this.i18n(' - Learn what they do and how to implement them.')}

                                        </a>
                                    </li>
                                    <li>
                                        <div className="block-list__item-image">
                                            <Icon icon="fa-book " size="2x"/>
                                        </div>
                                        <a href="https://www.webiny.com/hub/tutorials" className="block-list__item-text"
                                           target="_blank">
                                            <strong>{this.i18n('Tutorials')}</strong>
                                            {this.i18n(' - How to setup Webiny and other applications.')}
                                        </a>
{'fraction_non_alphanumeric': 0.11862068965517242, 'fraction_numerical': 0.006344827586206896, 'mean_word_length': 0.9903925336261323, 'pattern_counts': {'":': 0, '<': 85, '<?xml version=': 0, '>': 89, 'https://': 4, 'lorem ipsum': 0, 'www.': 4, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 68, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3741483', 'n_tokens_mistral': 1697, 'n_tokens_neox': 1639, 'n_words': 299}