From 91b8fc54c425c13532d9c56f0015bc754acddf01 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?John=20Molakvo=C3=A6=20=28skjnldsv=29?= Date: Wed, 4 Oct 2017 10:57:35 +0200 Subject: [PATCH 1/2] To uppercase for labels too MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: John Molakvoæ (skjnldsv) --- js/components/detailsItem/detailsItem_controller.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/js/components/detailsItem/detailsItem_controller.js b/js/components/detailsItem/detailsItem_controller.js index 9c76367ed..30dd5032e 100644 --- a/js/components/detailsItem/detailsItem_controller.js +++ b/js/components/detailsItem/detailsItem_controller.js @@ -38,20 +38,23 @@ angular.module('contactsApp') var displayName = array.map(function (element) { return element.charAt(0).toUpperCase() + element.slice(1).toLowerCase(); }).join(' '); + console.log(ctrl.availableOptions, ctrl.type); // in case the type is not yet in the default list of available options we add it if (!ctrl.availableOptions.some(function(e) { return e.id === ctrl.type; } )) { + console.log('test1'); ctrl.availableOptions = ctrl.availableOptions.concat([{id: ctrl.type, name: displayName}]); } } if (!_.isUndefined(ctrl.data) && !_.isUndefined(ctrl.data.namespace)) { if (!_.isUndefined(ctrl.model.contact.props['X-ABLABEL'])) { var val = _.find(this.model.contact.props['X-ABLABEL'], function(x) { return x.namespace === ctrl.data.namespace; }); - ctrl.type = val.value; + ctrl.type = val.value.toUpperCase(); if (!_.isUndefined(val)) { // in case the type is not yet in the default list of available options we add it if (!ctrl.availableOptions.some(function(e) { return e.id === val.value; } )) { - ctrl.availableOptions = ctrl.availableOptions.concat([{id: val.value, name: val.value}]); + console.log(val); + ctrl.availableOptions = ctrl.availableOptions.concat([{id: val.value.toUpperCase(), name: val.value.toUpperCase()}]); } } } From 08e491618dd517d45785708f4ef5d31e3a45144b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?John=20Molakvo=C3=A6=20=28skjnldsv=29?= Date: Wed, 4 Oct 2017 11:27:35 +0200 Subject: [PATCH 2/2] removed console MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: John Molakvoæ (skjnldsv) --- js/components/detailsItem/detailsItem_controller.js | 4 ---- 1 file changed, 4 deletions(-) diff --git a/js/components/detailsItem/detailsItem_controller.js b/js/components/detailsItem/detailsItem_controller.js index 30dd5032e..a9ab1c7b1 100644 --- a/js/components/detailsItem/detailsItem_controller.js +++ b/js/components/detailsItem/detailsItem_controller.js @@ -38,11 +38,8 @@ angular.module('contactsApp') var displayName = array.map(function (element) { return element.charAt(0).toUpperCase() + element.slice(1).toLowerCase(); }).join(' '); - console.log(ctrl.availableOptions, ctrl.type); - // in case the type is not yet in the default list of available options we add it if (!ctrl.availableOptions.some(function(e) { return e.id === ctrl.type; } )) { - console.log('test1'); ctrl.availableOptions = ctrl.availableOptions.concat([{id: ctrl.type, name: displayName}]); } } @@ -53,7 +50,6 @@ angular.module('contactsApp') if (!_.isUndefined(val)) { // in case the type is not yet in the default list of available options we add it if (!ctrl.availableOptions.some(function(e) { return e.id === val.value; } )) { - console.log(val); ctrl.availableOptions = ctrl.availableOptions.concat([{id: val.value.toUpperCase(), name: val.value.toUpperCase()}]); } }