<commit_before>import React, { Component } from 'react';
import AlbumSelector from './AlbumSelector.js';
import '../css/AlbumManagerOverlay.css';

// AlbumManagerOverlay
export default class AlbumManagerOverlay extends Component {
  render() {
    return (
      <div className="modal fade" id="albumManagerOverlay" tabIndex="-1" role="dialog" aria-labelledby="album-manager-overlay-label">
        <div className="modal-dialog" role="document">
          <div className="modal-content">
            <div className="modal-header">
              <button type="button" className="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                <h4 className="modal-title" id="album-manager-overlay-label">Add to Album</h4>
            </div>
            <div className="modal-body">
              <AlbumManager albums={this.props.albums}/>
            </div>
            <div className="modal-footer">
              <button type="button" className="btn btn-default" data-dismiss="modal">Cancel</button>
              <button type="button" className="btn btn-primary">Save</button>
            </div>
          </div>
        </div>
      </div>
    );
  }
}

// AlbumManager
class AlbumManager extends Component {

  constructor(props) {
    super(props);
    // Keep our state here so NewAlbumInput will receive 
    // updates when the AlbumSelector/state changes
    this.state = {
      selectedAlbum: {name: "", id: "" }
    };
  }

  updateSelectedAlbum(album) {
    this.setState({ selectedAlbum: album });
  }

  render() {
    var albumManager;<commit_msg>Clear album manager on modal close<commit_after>import React, { Component } from 'react';
import AlbumSelector from './AlbumSelector.js';
import '../css/AlbumManagerOverlay.css';

// AlbumManagerOverlay
export default class AlbumManagerOverlay extends Component {
  constructor(props) {
    super(props);
    this.state = {
      selectedAlbum: {name: "", id: "" }
    };
  }

  close(save){
    // Clear the album for the next modal open
    this.setState({selectedAlbum: {name: "", id: ""} });
  }

  render() {
    return (
      <div className="modal fade" id="albumManagerOverlay" tabIndex="-1" role="dialog" aria-labelledby="album-manager-overlay-label">
        <div className="modal-dialog" role="document">
          <div className="modal-content">
            <div className="modal-header">
              <button type="button" className="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
              <h4 className="modal-title" id="album-manager-overlay-label">Add to Album</h4>
            </div>
            <div className="modal-body">
              <AlbumManager albums={this.props.albums} selectedAlbum={this.state.selectedAlbum}/>
            </div>
            <div className="modal-footer">
              <button type="button" className="btn btn-default" data-dismiss="modal" onClick={this.close.bind(this, false)}>Cancel</button>
              <button type="button" className="btn btn-primary" onClick={this.close.bind(this, true)}>Save</button>
            </div>
          </div>
        </div>
      </div>
    );
  }
}

// AlbumManager
class AlbumManager extends Component {

  constructor(props) {
    super(props);
    this.state = {
      selectedAlbum: {name: "", id: "" }
    };
  }

  // AlbumManagerOverlay is resetting the album 
  componentWillReceiveProps(nextProps) {
    this.setState({
      selectedAlbum: nextProps.selectedAlbum
    });
  }

  // We received an album from AlbumSelector
  updateSelectedAlbum(album) {
    this.setState({ selectedAlbum: album });
  }

  render() {
    var albumManager;
{'fraction_non_alphanumeric': 0.14652608813192755, 'fraction_numerical': 0.0016220600162206002, 'mean_word_length': 2.842159916926272, 'pattern_counts': {'":': 0, '<': 49, '<?xml version=': 0, '>': 49, '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': '5501226', 'n_tokens_mistral': 1041, 'n_tokens_neox': 1014, 'n_words': 223}