Skip to content
This repository has been archived by the owner on Apr 1, 2020. It is now read-only.

Commit

Permalink
Revert "rename "Companies" in menu to "Business"."
Browse files Browse the repository at this point in the history
This reverts commit 7f75c37.

 🐿 v2.12.2
  • Loading branch information
robsquires committed Dec 3, 2019
1 parent 872462c commit 5c79603
Showing 1 changed file with 0 additions and 23 deletions.
23 changes: 0 additions & 23 deletions server/models/navigation/navigationModelV2.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,22 +16,6 @@ const menuNameMap = new Map([

const clone = obj => JSON.parse(JSON.stringify(obj));

// Function to support the A/B test of renaming the "Companies" section to "Business"
// This function can be removed once the test is complete.
function renameCompaniesToBusiness ( obj ) {
if( Array.isArray(obj) ) {
obj.forEach(renameCompaniesToBusiness);
} else if( obj ) {
if( obj.label ) {
obj.label = obj.label.replace(/^Companies/, 'Business');
}
renameCompaniesToBusiness(obj.items);
renameCompaniesToBusiness(obj.data);
renameCompaniesToBusiness(obj.submenu);
renameCompaniesToBusiness(obj.meganav);
}
}

module.exports = class NavigationModelV2 {

constructor (options){
Expand Down Expand Up @@ -132,10 +116,6 @@ module.exports = class NavigationModelV2 {
NavigationModelV2.decorateSelected(menuData, currentUrl);
}

if( res.locals.flags.renameCompaniesToBusiness ) {
renameCompaniesToBusiness(menuData);
}

res.locals.navigation.menus[menuName] = menuData;
}

Expand All @@ -153,9 +133,6 @@ module.exports = class NavigationModelV2 {
.then(data => {
// We need to add the appropriate labels to this when rendered, so mark it as selected.
const currentItem = { ...data.item, selected: true };
if( res.locals.flags && res.locals.flags.renameCompaniesToBusiness ) {
renameCompaniesToBusiness(currentItem);
}
res.locals.navigation.showSubNav = true;
res.locals.navigation.hierarchy = data;
res.locals.navigation.breadcrumb = data.ancestors.concat(currentItem);
Expand Down

0 comments on commit 5c79603

Please sign in to comment.