filterPersonasByText(filterText) {
      let fText = filterText.toLowerCase();
      let filteredList = this.state.suggestionList.filter(
         function (persona) {
            let name = persona.text.toLowerCase();
            let line2 = persona.secondaryText.toLowerCase();

            let includedInName = name.includes(fText);

            //Checking if it's in Line 2, which is often but not always an email address
            var includedInLine2 = false;
            var secondaryTxt = line2;

            if (line2.includes('@')) {
               let index = line2.indexOf("@");
               if (index > -1) {
                  secondaryTxt = line2.slice(0, index);
               }
            }
            includedInLine2 = secondaryTxt.includes(fText);

            return (includedInName || includedInLine2);
         });

      return filteredList;
   }
/**
    * Returns a filtered list of Persona params objects where the full name or email address contains the given filter text.
    * REQUIRED - Supports the onResolveSuggestions workflow.
    * @param {string} filterText Some text entered by the user at runtime
    * @returns {Array} A filtered array of Personas suitable for displaying in the Suggestions list.
    */
Returns a filtered list of Persona params objects where the full name or email address contains the given filter text.
REQUIRED - Supports the onResolveSuggestions workflow.
@param {string} filterText Some text entered by the user at runtime
@returns {Array} A filtered array of Personas suitable for displaying in the Suggestions list.
Returns a filtered list of Persona params objects where the full name or email address contains the given filter text . REQUIRED - Supports the onResolveSuggestions workflow . @param { string } filterText Some text entered by the user at runtime @returns { Array } A filtered array of Personas suitable for displaying in the Suggestions list .
filterPersonasByText(filterText) {
      let fText = filterText.toLowerCase();
      let filteredList = this.state.suggestionList.filter(
         function (persona) {
            let name = persona.text.toLowerCase();
            let line2 = persona.secondaryText.toLowerCase();
            let includedInName = name.includes(fText);
            var includedInLine2 = false;
            var secondaryTxt = line2;
            if (line2.includes('@')) {
               let index = line2.indexOf("@");
               if (index > -1) {
                  secondaryTxt = line2.slice(0, index);
               }
            }
            includedInLine2 = secondaryTxt.includes(fText);
            return (includedInName || includedInLine2);
         });
      return filteredList;
   }
filterPersonasByText ( filterText ) { let fText = filterText . toLowerCase ( ) ; let filteredList = this . state . suggestionList . filter ( function ( persona ) { let name = persona . text . toLowerCase ( ) ; let line2 = persona . secondaryText . toLowerCase ( ) ; let includedInName = name . includes ( fText ) ; var includedInLine2 = false ; var secondaryTxt = line2 ; if ( line2 . includes ( '@' ) ) { let index = line2 . indexOf ( "@" ) ; if ( index > - 1 ) { secondaryTxt = line2 . slice ( 0 , index ) ; } } includedInLine2 = secondaryTxt . includes ( fText ) ; return ( includedInName || includedInLine2 ) ; } ) ; return filteredList ; }
Returns a filtered list of Persona params objects where the full name or email address contains the given filter text.
Returns a filtered list of Persona params objects where the full name or email address contains the given filter text .
//Checking if it's in Line 2, which is often but not always an email address