<commit_before>import React from 'react';
import createReactClass from 'create-react-class';
import _ from 'lodash';

import ArticleViewer from '@components/common/ArticleViewer/containers/ArticleViewer.jsx';

import { fetchStates, ASSIGNED_ROLE, STUDENT_ROLE } from '../../constants';
import { PageAssessmentGrades, ORESSupportedWiki, PageAssessmentSupportedWiki } from '../../utils/article_finder_language_mappings.js';

const ArticleFinderRow = createReactClass({
  getInitialState() {
    return {
      isLoading: false,
    };
  },

  componentDidUpdate(prevProps, prevState) {<commit_msg>Added comment explaining the working of isLoading.<commit_after>import React from 'react';
import createReactClass from 'create-react-class';
import _ from 'lodash';

import ArticleViewer from '@components/common/ArticleViewer/containers/ArticleViewer.jsx';

import { fetchStates, ASSIGNED_ROLE, STUDENT_ROLE } from '../../constants';
import { PageAssessmentGrades, ORESSupportedWiki, PageAssessmentSupportedWiki } from '../../utils/article_finder_language_mappings.js';

const ArticleFinderRow = createReactClass({
  getInitialState() {
    return {
      isLoading: false,
    };
  },

  // Note: This is comment is applicable for the article finder row of a course
  // There are two scenarios in which we use isLoading:
  // In the first one, when this.props.assignment is not null, it means the article
  // is assigned. In the second one, when this.props.assignment is undefined, it means
  // that the article is unassigned. When the request to either assign or unassign an
  // article is made, for that time isLoading is set to true and the corresponding
  // button is disabled. On completion of request, this.props.assignment changes and
  // button is enabled again after isLoading is set to false
  componentDidUpdate(prevProps, prevState) {
{'fraction_non_alphanumeric': 0.09194159004867496, 'fraction_numerical': 0.0, 'mean_word_length': 4.522388059701493, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '1695520', 'n_tokens_mistral': 513, 'n_tokens_neox': 511, 'n_words': 174}