From 3a3663a457dc31efbbee5d8ae24ec6ae2165c10e Mon Sep 17 00:00:00 2001 From: Coleman Watts Date: Sat, 1 Aug 2015 12:46:44 -0400 Subject: [PATCH] CRM-14647 - Add maxlength to profile titles --- js/model/crm.uf.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/js/model/crm.uf.js b/js/model/crm.uf.js index 78f87c2d18..095acddc0d 100644 --- a/js/model/crm.uf.js +++ b/js/model/crm.uf.js @@ -197,7 +197,8 @@ }, 'label': { title: ts('Field Label'), - type: 'Text' + type: 'Text', + editorAttrs: {maxlength: 255} }, 'location_type_id': { title: ts('Location Type'), @@ -487,6 +488,7 @@ title: ts('Profile Name'), help: ts(''), type: 'Text', + editorAttrs: {maxlength: 64}, validators: ['required'] }, 'group_type': { @@ -668,9 +670,8 @@ return _.omit(ufFieldModel.toStrictJSON(), ['id', 'uf_group_id']); }) ); - copy.set('title', ts('%1 (Copy)', { - 1: copy.get('title') - })); + var copyLabel = ' ' + ts('(Copy)'); + copy.set('title', copy.get('title').slice(0, 64 - copyLabel.length) + copyLabel); return copy; }, getModelClass: function(entity_name) { -- 2.25.1