Skip to content

Commit

Permalink
Merge pull request #3771 from cbarnes0/develop
Browse files Browse the repository at this point in the history
replace '.replace' with '.replaceAll' for WV-129
  • Loading branch information
DaleMcGrew authored Nov 10, 2023
2 parents b407fc9 + 8692ead commit bf9d9d7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions src/js/pages/Campaigns/CampaignsHome.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ class CampaignsHome extends Component {
}
}
if (stateName) {
stateName = stateName.replace('-', ' ');
stateName = stateName.replaceAll('-', ' ');
let newStateCode = convertStateTextToStateCode(stateName);
if (newStateCode.toLowerCase() === 'na') {
newStateCode = 'all';
Expand Down Expand Up @@ -183,7 +183,7 @@ class CampaignsHome extends Component {
}

if (stateName) {
stateName = stateName.replace('-', ' ');
stateName = stateName.replaceAll('-', ' ');
const { stateCode } = this.state;
let newStateCode = convertStateTextToStateCode(stateName);
// console.log('stateCode:', stateCode, ', newStateCode:', newStateCode);
Expand Down Expand Up @@ -561,7 +561,7 @@ class CampaignsHome extends Component {
getStateNamePathnameFromStateCode = (stateCode) => {
const stateName = convertStateCodeToStateText(stateCode);
const stateNamePhrase = `${stateName}-candidates`;
const stateNamePhraseLowerCase = stateNamePhrase.replace(/\s+/g, '-').toLowerCase();
const stateNamePhraseLowerCase = stateNamePhrase.replaceAll(/\s+/g, '-').toLowerCase();
return `/${stateNamePhraseLowerCase}/cs/`;
}

Expand Down
6 changes: 3 additions & 3 deletions src/js/pages/Campaigns/CampaignsHomeLoader.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class CampaignsHomeLoader extends Component {
// }
}
if (stateName) {
stateName = stateName.replace('-', ' ');
stateName = stateName.replaceAll('-', ' ');
let newStateCode = convertStateTextToStateCode(stateName);
if (newStateCode.toLowerCase() === 'na') {
newStateCode = 'all';
Expand Down Expand Up @@ -85,7 +85,7 @@ class CampaignsHomeLoader extends Component {
// }

if (stateName) {
stateName = stateName.replace('-', ' ');
stateName = stateName.replaceAll('-', ' ');
const { stateCode } = this.state;
let newStateCode = convertStateTextToStateCode(stateName);
// console.log('stateCode:', stateCode, ', newStateCode:', newStateCode);
Expand Down Expand Up @@ -119,7 +119,7 @@ class CampaignsHomeLoader extends Component {
getStateNamePathnameFromStateCode = (stateCode) => {
const stateName = convertStateCodeToStateText(stateCode);
const stateNamePhrase = `${stateName}-candidates`;
const stateNamePhraseLowerCase = stateNamePhrase.replace(/\s+/g, '-').toLowerCase();
const stateNamePhraseLowerCase = stateNamePhrase.replaceAll(/\s+/g, '-').toLowerCase();
return `/${stateNamePhraseLowerCase}/cs/`;
}

Expand Down

0 comments on commit bf9d9d7

Please sign in to comment.