Michiel Eggermont pushed to branch feature/terminology-improvements at 
cms-community / hippo-addon-channel-manager


Commits:
b0eb08c5 by Michiel Eggermont at 2016-09-15T11:21:40+02:00
CHANNELMGR-870 Change segment rendering in viewAs

Put variant group in braces instead of putting an infix between
the variant name and group.

- - - - -


3 changed files:

- frontend-ng/src/angularjs/channel/relevance/viewAs.controller.js
- frontend-ng/src/angularjs/channel/relevance/viewAs.controller.spec.js
- frontend-ng/src/i18n/en.json


Changes:

=====================================
frontend-ng/src/angularjs/channel/relevance/viewAs.controller.js
=====================================
--- a/frontend-ng/src/angularjs/channel/relevance/viewAs.controller.js
+++ b/frontend-ng/src/angularjs/channel/relevance/viewAs.controller.js
@@ -82,8 +82,7 @@ export class ViewAsCtrl {
 
   makeDisplayName(variant) {
     if (variant.group) {
-      const infix = this.$translate.instant('TOOLBAR_VIEW_AS_INFIX');
-      return `${variant.name}${infix}${variant.group}`;
+      return `${variant.name} (${variant.group})`;
     }
     return variant.name;
   }


=====================================
frontend-ng/src/angularjs/channel/relevance/viewAs.controller.spec.js
=====================================
--- a/frontend-ng/src/angularjs/channel/relevance/viewAs.controller.spec.js
+++ b/frontend-ng/src/angularjs/channel/relevance/viewAs.controller.spec.js
@@ -236,7 +236,7 @@ describe('ViewAsCtrl', () => {
     });
 
     expect(ViewAsCtrl.makeDisplayName(variant1)).toBe('name-only');
-    
expect(ViewAsCtrl.makeDisplayName(variant2)).toBe('nameTOOLBAR_VIEW_AS_INFIXgroup');
+    expect(ViewAsCtrl.makeDisplayName(variant2)).toBe('name (group)');
   });
 
   it('formats the selectable display name', () => {
@@ -251,12 +251,12 @@ describe('ViewAsCtrl', () => {
 
     ViewAsCtrl.selectedVariant = variant1;
     expect(ViewAsCtrl.makeSelectableDisplayName(variant1)).toBe('name-only');
-    
expect(ViewAsCtrl.makeSelectableDisplayName(variant2)).toBe('nameTOOLBAR_VIEW_AS_INFIXgroup');
+    expect(ViewAsCtrl.makeSelectableDisplayName(variant2)).toBe('name 
(group)');
     expect(ViewAsCtrl.makeSelectableDisplayName(alterEgo)).toBe('Alter Ego');
 
     ViewAsCtrl.selectedVariant = alterEgo;
     expect(ViewAsCtrl.makeSelectableDisplayName(variant1)).toBe('name-only');
-    
expect(ViewAsCtrl.makeSelectableDisplayName(variant2)).toBe('nameTOOLBAR_VIEW_AS_INFIXgroup');
+    expect(ViewAsCtrl.makeSelectableDisplayName(variant2)).toBe('name 
(group)');
     
expect(ViewAsCtrl.makeSelectableDisplayName(alterEgo)).toBe('TOOLBAR_EDIT_ALTER_EGO');
   });
 


=====================================
frontend-ng/src/i18n/en.json
=====================================
--- a/frontend-ng/src/i18n/en.json
+++ b/frontend-ng/src/i18n/en.json
@@ -136,7 +136,6 @@
   "TOOLBAR_SWITCH_VIEWER_MODE": "Viewer mode",
   "TOOLBAR_SWITCH_VIEWER_MODE_EDIT": "Edit",
   "TOOLBAR_SWITCH_VIEWER_MODE_VIEW": "View",
-  "TOOLBAR_VIEW_AS_INFIX": ", the ",
   "TOOLBAR_VIEW_AS_LABEL": "As viewed by:",
   "TOOLBAR_VIEW_ON_LABEL": "On:",
   "VALIDATION_ILLEGAL_CHARACTERS": "One or more invalid characters 
({{characters}}) have been entered",



View it on GitLab: 
https://code.onehippo.org/cms-community/hippo-addon-channel-manager/commit/b0eb08c5bb8ebb6fac5685f3afc5c99156406e54
_______________________________________________
Hippocms-svn mailing list
Hippocms-svn@lists.onehippo.org
https://lists.onehippo.org/mailman/listinfo/hippocms-svn

Reply via email to