<commit_before>kd                        = require 'kd'
React                     = require 'kd-react'
immutable                 = require 'immutable'
SidebarList               = require 'app/components/sidebarlist'
SidebarSection            = require 'app/components/sidebarsection'
SidebarMachinesListItem   = require 'app/components/sidebarmachineslistitem'


module.exports = class SidebarStackSection extends React.Component

  @defaultProps =
    selectedId    : null
    stack         : immutable.Map()


  renderMachines: ->

    @props.stack.get('machines').map (machine) =>
      <SidebarMachinesListItem
        key={machine.get '_id'}
        machine={machine}
        active={machine.get('_id') is @props.selectedId}
        />


  render: ->

    <SidebarSection
      className={kd.utils.curry 'SidebarStackSection', @props.className}
      secondaryLink='/Settings/Stacks'
      title={@props.stack.get 'title'}
      titleLink='/Stacks'
      unreadCount={@props.stack.getIn [ '_revisionStatus', 'status', 'code' ]}
      >
      {@renderMachines()}
    </SidebarSection>


<commit_msg>Components: SidebarStackSection: Call onStackRendered props method when component did mount<commit_after>kd                        = require 'kd'
React                     = require 'kd-react'
immutable                 = require 'immutable'
SidebarList               = require 'app/components/sidebarlist'
SidebarSection            = require 'app/components/sidebarsection'
SidebarMachinesListItem   = require 'app/components/sidebarmachineslistitem'


module.exports = class SidebarStackSection extends React.Component

  @defaultProps   =
    selectedId    : null
    stack         : immutable.Map()


  componentDidMount: ->

    @props.onStackRendered()


  renderMachines: ->

    @props.stack.get('machines').map (machine) =>
      <SidebarMachinesListItem
        key={machine.get '_id'}
        machine={machine}
        active={machine.get('_id') is @props.selectedId}
        />


  render: ->

    <SidebarSection
      className={kd.utils.curry 'SidebarStackSection', @props.className}
      secondaryLink='/Settings/Stacks'
      title={@props.stack.get 'title'}
      titleLink='/Stacks'
      unreadCount={@props.stack.getIn [ '_revisionStatus', 'status', 'code' ]}
      >
      {@renderMachines()}
    </SidebarSection>



{'fraction_non_alphanumeric': 0.1157130657557643, 'fraction_numerical': 0.0, 'mean_word_length': 2.5825688073394497, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 16, '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': '1369336', 'n_tokens_mistral': 693, 'n_tokens_neox': 664, 'n_words': 117}