From a75946e02b466ecfd30567059071eda5df15d268 Mon Sep 17 00:00:00 2001 From: Pawel Kaczmarek Date: Tue, 30 Dec 2014 15:02:33 +0100 Subject: [PATCH] [Contact] ContactRelationship fix [Verification] Below TCT should pass: ContactRelationship_type_attribute Change-Id: I27de448a24feebf823d060e8bec152c6390aef9f Signed-off-by: Pawel Kaczmarek --- .../js/tizen.contact.ContactDataStructures.js | 38 ++++++++++++++-------- 1 file changed, 24 insertions(+), 14 deletions(-) diff --git a/src/contact/js/tizen.contact.ContactDataStructures.js b/src/contact/js/tizen.contact.ContactDataStructures.js index 3ff7efe..fe2e62c 100644 --- a/src/contact/js/tizen.contact.ContactDataStructures.js +++ b/src/contact/js/tizen.contact.ContactDataStructures.js @@ -643,31 +643,41 @@ var ContactName = function(data) { var ContactRelationship = function(relativeName, type) { AV.isConstructorCall(this, ContactRelationship); + var _relativeName = Converter.toString(relativeName, false); + var _type = type ? Converter.toEnum(type, Object.keys(ContactRelationshipType), false) + : ContactRelationshipType.OTHER; + var _label = null; + Object.defineProperties(this, { relativeName: { - value: Type.isString(relativeName) ? relativeName : null, - writable: true, + get: function () { + return _relativeName; + }, + set: function (v) { + _relativeName = Converter.toString(v, false); + }, enumerable: true }, type: { - value: (Type.isNullOrUndefined(type) ? ContactRelationshipType.OTHER : type), - writable: true, + get: function () { + return _type; + }, + set: function (v) { + _type = v ? Converter.toEnum(v, Object.keys(ContactRelationshipType), false) + : _type; + }, enumerable: true }, label: { - value: null, - writable: true, + get: function () { + return _label; + }, + set: function (v) { + _label = Converter.toString(v, true); + }, enumerable: true } }); - - if (_editGuard.isEditEnabled()) { - for (var prop in arguments[0]) { - if (this.hasOwnProperty(prop)) { - this[prop] = arguments[0][prop]; - } - } - } }; var ContactInstantMessenger = function(imAddress, type) { -- 2.7.4