<commit_before>Ext.define('CustomApp', {
    extend: 'Rally.app.App',      // The parent class manages the app 'lifecycle' and calls launch() when ready
    componentCls: 'app',          // CSS styles found in app.css


    defectStore: undefined,       // app level references to the store and grid for easy access in various methods
    defectGrid: undefined,

    // Entry Point to App
    launch: function() {

      console.log('our second app');     // see console api: https://developers.google.com/chrome-developer-tools/docs/console-api

      this.pulldownContainer = Ext.create('Ext.container.Container', {    // this container lets us control the layout of the pulldowns; they'll be added below
        id: 'pulldown-container-id',
        layout: {
                type: 'hbox',           // 'horizontal' layout
                align: 'stretch'
            }
      });

      this.add(this.pulldownContainer); // must add the pulldown container to the app to be part of the rendering lifecycle, even though it's empty at the moment

      this._loadIterations();
    },

    // create iteration pulldown and load iterations
    _loadIterations: function() {
        this.iterComboBox = Ext.create('Rally.ui.combobox.FieldValueComboBox', {
          model: 'portfolioItem/Capability',
          field: 'Owner',
          fieldLabel: 'Owner',
          labelAlign: 'right',
          width: 300,
          listeners: {
            ready: function(combobox) {             // on ready: during initialization of the app, once Iterations are loaded, lets go get Defect Severities
                 this._loadSeverities();
                console.log('look', combobox.getRecord().get('value'));
           },
        select: function(combobox, records) {   // on select: after the app has fully loaded, when the user 'select's an iteration, lets just relaod the data
                 this._loadData();
           },
           scope: this
         }
        });

        this.pulldownContainer.add(this.iterComboBox);   // add the iteration list to the pulldown container so it lays out horiz, not the app!
     },

    // create defect severity pulldown then load data
    _loadSeverities: function() {
        this.severityComboBox = Ext.create('Rally.ui.combobox.FieldValueComboBox', {
          model: 'portfolioItem/Capability',
          field: 'InvestmentCategory',
          fieldLabel: 'InvestmentCategory',
          labelAlign: 'right',
          listeners: {
            ready: function(combobox) {             // this is the last 'data' pulldown we're loading so both events go to just load the actual defect data
                 this._loadData();
                console.log('look2', combobox.getRecord());

           },
            select: function(combobox, records) {
                 this._loadData();
           },
           scope: this                              // <--- don't for get to pass the 'app' level scope into the combo box so the async event functions can call app-level func's!
         }

        });

        this.pulldownContainer.add(this.severityComboBox);    // add the severity list to the pulldown container so it lays out horiz, not the app!
     },

    // Get data from Rally
    _loadData: function() {

      var selectedIterRef = this.iterComboBox.getRecord().get('value');              // the _ref is unique, unlike the iteration name that can change; lets query on it instead!
      var selectedSeverityValue = this.severityComboBox.getRecord().get('value');   // remember to console log the record to see the raw data and relize what you can pluck out

      console.log('selected iter', selectedIterRef);
      console.log('selected severity', selectedSeverityValue);

      var myFilters = [                   // in this format, these are AND'ed together; use Rally.data.wsapi.Filter to create programatic AND/OR constructs
            {
              property: 'Owner',
              operation: '=',
              value: selectedIterRef
            },
            {
              property: 'InvestmentCategory',
              operation: '=',
              value: selectedSeverityValue
            }
          ];

      // if store exists, just load new data
      if (this.defectStore) {
        console.log('store exists');
        this.defectStore.setFilter(myFilters);
        this.defectStore.load();
<commit_msg>Ability to filter on c_ECPPlatformRelease<commit_after>Ext.define('CustomApp', {
    extend: 'Rally.app.App',      // The parent class manages the app 'lifecycle' and calls launch() when ready
    componentCls: 'app',          // CSS styles found in app.css


    defectStore: undefined,       // app level references to the store and grid for easy access in various methods
    defectGrid: undefined,

    // Entry Point to App
    launch: function() {

      console.log('our second app');     // see console api: https://developers.google.com/chrome-developer-tools/docs/console-api

      this.pulldownContainer = Ext.create('Ext.container.Container', {    // this container lets us control the layout of the pulldowns; they'll be added below
        id: 'pulldown-container-id',
        layout: {
                type: 'hbox',           // 'horizontal' layout
                align: 'stretch'
            }
      });

      this.add(this.pulldownContainer); // must add the pulldown container to the app to be part of the rendering lifecycle, even though it's empty at the moment

      this._loadIterations();
    },

    // create iteration pulldown and load iterations
    _loadIterations: function() {
        this.iterComboBox = Ext.create('Rally.ui.combobox.FieldValueComboBox', {
          model: 'portfolioItem/Capability',
          field: 'c_ECPPlatformRelease',
          fieldLabel: 'Release',
          labelAlign: 'right',
          width: 300,
          listeners: {
            ready: function(combobox) {             // on ready: during initialization of the app, once Iterations are loaded, lets go get Defect Severities
                 this._loadSeverities();
                console.log('look', combobox.getRecord().get('value'));
           },
        select: function(combobox, records) {   // on select: after the app has fully loaded, when the user 'select's an iteration, lets just relaod the data
                 this._loadData();
           },
           scope: this
         }
        });

        this.pulldownContainer.add(this.iterComboBox);   // add the iteration list to the pulldown container so it lays out horiz, not the app!
     },

    // create defect severity pulldown then load data
    _loadSeverities: function() {
        this.severityComboBox = Ext.create('Rally.ui.combobox.FieldValueComboBox', {
          model: 'portfolioItem/Capability',
          field: 'InvestmentCategory',
          fieldLabel: 'InvestmentCategory',
          labelAlign: 'right',
          listeners: {
            ready: function(combobox) {             // this is the last 'data' pulldown we're loading so both events go to just load the actual defect data
                 this._loadData();
                console.log('look2', combobox.getRecord());

           },
            select: function(combobox, records) {
                 this._loadData();
           },
           scope: this                              // <--- don't for get to pass the 'app' level scope into the combo box so the async event functions can call app-level func's!
         }

        });

        this.pulldownContainer.add(this.severityComboBox);    // add the severity list to the pulldown container so it lays out horiz, not the app!
     },

    // Get data from Rally
    _loadData: function() {

      var selectedIterRef = this.iterComboBox.getRecord().get('value');              // the _ref is unique, unlike the iteration name that can change; lets query on it instead!
      var selectedSeverityValue = this.severityComboBox.getRecord().get('value');   // remember to console log the record to see the raw data and relize what you can pluck out

      console.log('selected iter', selectedIterRef);
      console.log('selected severity', selectedSeverityValue);

      var myFilters = [                   // in this format, these are AND'ed together; use Rally.data.wsapi.Filter to create programatic AND/OR constructs
            {
              property: 'c_ECPPlatformRelease',
              operation: '=',
              value: selectedIterRef
            },
            {
              property: 'InvestmentCategory',
              operation: '=',
              value: selectedSeverityValue
            }
          ];

      // if store exists, just load new data
      if (this.defectStore) {
        console.log('store exists');
        this.defectStore.setFilter(myFilters);
        this.defectStore.load();

{'fraction_non_alphanumeric': 0.09662054887729644, 'fraction_numerical': 0.0009072352007257881, 'mean_word_length': 2.05684575389948, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '147285', 'n_tokens_mistral': 2325, 'n_tokens_neox': 2230, 'n_words': 736}