<commit_before>/** @jsx React.DOM */

var CONSTANTS = require('../constants');
var Dispatcher = require('../dispatcher');
var EventMixin = require('../mixins/event.js.jsx');
var NewsFeedMixin = require('../mixins/news_feed.js.jsx');
var NewsFeedStore = require('../stores/news_feed_store');
var Avatar = require('./avatar.js.jsx');

(function() {
  var NF = CONSTANTS.NEWS_FEED;

  var DropdownNewsFeed = React.createClass({
    mixins: [NewsFeedMixin],

    markAllAsRead: function() {
      Dispatcher.dispatch({
        action: NF.ACTIONS.MARK_ALL_AS_READ,
        data: null
      });

      this.optimisticallyMarkStories();
    },

    optimisticallyMarkStories: function() {
      var stories = this.state.stories;

      for (var i = 0, l = stories.length; i < l; i++) {
        stories[i].last_read_at = 1;
      }

      this.setState({
        stories: stories
      });
    },

    render: function() {
      return (
        <ul className="dropdown-menu" style={{ 'min-width': '380px', width: '380px' }}>
          <li style={{ 'overflow-y': 'scroll', 'min-height': '60px' }} ref="spinner">
            {this.state.stories ? this.rows(this.state.stories) : null}
          </li>

          <li className="divider" style={{ 'margin-top': '0px' }} />

          <li>
            <a href={this.props.editUserPath} className="text-small">Settings</a>
          </li>

          <li>
            <a href="#mark-as-read" className="text-small" onClick={this.markAllAsRead}>Mark all as read</a>
          </li>

          <li>
            <a href='/notifications' className="text-small">All Notifications</a>
          </li>

        </ul>
      );
    },

    rows: function(stories) {
      var self = this;

      var firstTen = _.first(stories, 10);<commit_msg>Link users to the dashboard for all notifications<commit_after>/** @jsx React.DOM */

var CONSTANTS = require('../constants');
var Dispatcher = require('../dispatcher');
var EventMixin = require('../mixins/event.js.jsx');
var NewsFeedMixin = require('../mixins/news_feed.js.jsx');
var NewsFeedStore = require('../stores/news_feed_store');
var Avatar = require('./avatar.js.jsx');

(function() {
  var NF = CONSTANTS.NEWS_FEED;

  var DropdownNewsFeed = React.createClass({
    mixins: [NewsFeedMixin],

    markAllAsRead: function() {
      Dispatcher.dispatch({
        action: NF.ACTIONS.MARK_ALL_AS_READ,
        data: null
      });

      this.optimisticallyMarkStories();
    },

    optimisticallyMarkStories: function() {
      var stories = this.state.stories;

      for (var i = 0, l = stories.length; i < l; i++) {
        stories[i].last_read_at = 1;
      }

      this.setState({
        stories: stories
      });
    },

    render: function() {
      return (
        <ul className="dropdown-menu" style={{ 'min-width': '380px', width: '380px' }}>
          <li style={{ 'overflow-y': 'scroll', 'min-height': '60px' }} ref="spinner">
            {this.state.stories ? this.rows(this.state.stories) : null}
          </li>

          <li className="divider" style={{ 'margin-top': '0px' }} />

          <li>
            <a href={this.props.editUserPath} className="text-small">Settings</a>
          </li>

          <li>
            <a href="#mark-as-read" className="text-small" onClick={this.markAllAsRead}>Mark all as read</a>
          </li>

          <li>
            <a href='/dashboard' className="text-small">All Notifications</a>
          </li>

        </ul>
      );
    },

    rows: function(stories) {
      var self = this;

      var firstTen = _.first(stories, 10);
{'fraction_non_alphanumeric': 0.16955791829882486, 'fraction_numerical': 0.007274762171236709, 'mean_word_length': 2.366290018832392, 'pattern_counts': {'":': 0, '<': 39, '<?xml version=': 0, '>': 37, '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': '371725', 'n_tokens_mistral': 1195, 'n_tokens_neox': 1151, 'n_words': 232}