Commit 42cdf297 by Nilu

invite button visibility issue

parent 0b56da0c
......@@ -40,6 +40,7 @@ public class SendUserInvitationFP extends SaveFP
else
{
BusinessObjectParser.assertFieldCondition(company.getUserEmail()!=null, company, Company.FIELD_UserEmail, "mandatory", exceptions, true, request);
BusinessObjectParser.assertFieldCondition(StringUtils.isEmailAddress(company.getUserEmail()), company, Company.FIELD_UserEmail, "invalidEmail", exceptions, true, request);
BusinessObjectParser.assertFieldCondition(!Utils.isCompanyUserEmailFound(process.getTransaction(), company.getUserEmail()), company, Company.FIELD_UserEmail, "emailExists", exceptions, true, request);
BusinessObjectParser.assertFieldCondition(company.getRoleType()!=null, company, Company.FIELD_RoleType, "mandatory", exceptions, true, request);
}
......
......@@ -240,7 +240,6 @@ public abstract class BaseCompany extends BaseBusinessClass
metaInfo.put ("name", "UserEmail");
metaInfo.put ("type", "String");
metaInfo.put ("validators", "Email");
LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG2, "Metadata for Company.UserEmail:", metaInfo);
ATTRIBUTES_METADATA_Company.put (FIELD_UserEmail, Collections.unmodifiableMap (metaInfo));
......
......@@ -64,7 +64,7 @@ public class Company extends BaseCompany
public Boolean isEmailCorrect()
{
return StringUtils.isEmailAddress(getUserEmail());
return StringUtils.isEmailAddress(StringUtils.subBlanks(getUserEmail()));
}
......
......@@ -11,7 +11,7 @@
<MULTIPLEREFERENCE name="Users" type="CompanyUser" backreferenceName="Company"/>
<MULTIPLEREFERENCE name="Clients" type="Client" backreferenceName="Company"/>
<TRANSIENT name="UserEmail" type="String" validators="Email" />
<TRANSIENT name="UserEmail" type="String"/>
<TRANSIENT name="FirstName" type="String"/>
<TRANSIENT name="LastName" type="String"/>
<TRANSIENT name="RoleType" type="RoleType" defaultValue="RoleType.STANDARD" attribHelper="EnumeratedAttributeHelper"/>
......
......@@ -64,7 +64,24 @@
validate();
$('input[name$=UserEmail]').keyup(function() {
addPostRecalcHandler(function ($fieldThatChanged)
{
if (! $fieldThatChanged)
{
return;
}
var name = $fieldThatChanged.attr('name');
if (typeof name !== typeof undefined && name !== false)
{
if ( name.indexOf('UserEmail') >= 0 )
{
validate();
recalcFunction();
}
}
});
$('input[name$=UserEmail]').on("keyup", function() {
recalcFunction();
validate();
});
......@@ -208,6 +225,10 @@
<label><oneit:label GUIName="Role" /></label>
<oneit:ormEnum obj="<%= company %>" attributeName="RoleType" cssClass="form-control"/>
</div>
<div class="correctEmail" >
<oneit:recalc mode="Boolean" script="company.isEmailCorrect()" company="<%= company %>" />
</div>
<oneit:recalcClass htmlTag="div" classScript="company.isEmailCorrect() ? 'invite-btn enabled': 'invite-btn disabled'" company="<%= company %>">
<oneit:button value="Invite" name="sendUserInvites" cssClass="btn btn-invite"
requestAttribs="<%= CollectionUtils.mapEntry("nextPage", currentPage)
......
......@@ -160,7 +160,7 @@
<div class="rate-background">
<span class="arrow-up-gray"></span>
<span class="rate-label">
<oneit:ormlabel obj="<%= criteria %>" field="Importance" />
<oneit:label GUIName="Rate Importance" />
</span>
<span class="rate-toggle">
<ul class="nav nav-pills nav-justified">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment