Iniit
This commit is contained in:
@@ -0,0 +1,319 @@
|
||||
var Unibase;
|
||||
(function (Unibase) {
|
||||
let Themes;
|
||||
(function (Themes) {
|
||||
let Compact;
|
||||
(function (Compact) {
|
||||
let Components;
|
||||
(function (Components) {
|
||||
class CreateContact extends Unibase.Platform.Core.BaseComponent {
|
||||
jsFiles() {
|
||||
return ["tenants/themes/compact/index.anonymous.js", "platform/membership/managers/accountmanager.js", "platform/tag/managers/tagmanager.js", "platform/core/helpers/autocomplete/autocompletehelper.js", "libs/select2/js/select2.min.js", "libs/passwordrequirement/passwordrequirement.js"];
|
||||
}
|
||||
cssFiles() {
|
||||
return ["libs/passwordrequirement/passwordrequirement.css"];
|
||||
}
|
||||
html(id, containerid) {
|
||||
if (jQuery("#external-form").length === 0) {
|
||||
var index = new Components.Index_Anonymous();
|
||||
index.init(null);
|
||||
}
|
||||
const html = `<div><form id="frm_Signup" default="" data-validate="parsley" data-isdynamic="false" style=""><h1 class="display-4 mb-10 ml-10 mr-10">Sign up for free</h1><p class="mb-30 ml-10 mr-10">
|
||||
Create your account and start your free trial today</p><div class="" id="UserInfo" style=""><div id="div_ValidationSummary" class="clear ml-20 mr-20"></div>
|
||||
<div class="form-row"><div class="col-md-12 form-group"><input class="form-control required" id="txt_registerfirmname" placeholder="Firm name" value="" type="text" required="">
|
||||
</div><div class="col-md-6 form-group"><input class="form-control required" id="txt_registercontactname" placeholder="First name" value="" type="text" required="">
|
||||
</div><div class="form-group floating-label-form-group floating-label-form-group-with-value focus col-sm-6" id="div_tagsauto">
|
||||
<select id="ddl_Tags" class="form-control value-control" data-isdynamic="false"><option value="0">Im A</option><option value="100021580000007">Retailers</option><option value="100021580000275">Retailer</option><option value="100021580000276">RFW</option><option value="100021580000277">EOW</option><option value="100021580000278">EBW</option><option value="100021580000279">HRW</option></select></div>
|
||||
</div><div class="form-group floating-label-form-group floating-label-form-group-with-value focus hidden" id="div_TenantsAutoComplete">
|
||||
<select id="ddl_Tenant" class="form-control value-control" data-isdynamic="false" disabled=""><option value="0">Select Tenant</option><option value="2" selected="selected">Shriram Pistons & Rings Limited</option><option value="1">templatetenant</option></select></div>
|
||||
<div class="row">
|
||||
<div class="form-group col-6"><input class="form-control required" minlength="10" maxlength="10" id="txt_registercontactnumber" placeholder="Mobile" type="textbox" required=""></div><div class="form-group col-6"><input class="form-control required" id="txt_registercontactmail" placeholder="Email" type="text" required="">
|
||||
</div></div><div class="form-row hidden"><div class="col-md-6 form-group"><input class="form-control required" id="txt_TenantName" placeholder="Tenant Name" type="text" required=""></div><div class=" col-md-6 form-group " id="div_Industry"><select id="ddl_Industry" class="form-control value-control required" data-isdynamic="false"></select>
|
||||
</div></div><div id="passwordbox" class="row"><div class="form-group mb-20 col-6"><input class="form-control pr-password" id="confirmpass" placeholder="Password" type="password" autocomplete="new-password" aria-autocomplete="list"><span toggle="#InputPassword" id="PasswordHide"><i class="fa fa-eye-slash font-15 mr-10 field-icon" id="Password_eye"></i></span><div class="showpwsdreq"></div></div><div class="form-group mb-20 col-6"><input class="form-control pr-password" id="contacttPassword" placeholder="Confirm Password" type="password" autocomplete="new-password"><span toggle="#InputPassword" id="cfmPasswordHide"><i class="fa fa-eye-slash font-15 mr-10 field-icon" id="Password_eye"></i></span></div></div></div><div class="custom-control custom-checkbox mb-25 ml-10 mr-10 hidden"><input class="custom-control-input" id="chk_ReadTerms" type="checkbox"><label class="custom-control-label font-14" for="chk_ReadTerms">I have read and agree to the <a href=""><u>term and conditions</u></a></label>
|
||||
</div><div class="ml-10 mr-10 mb-25 text-center"><a class="btn btn-primary btn-block text-white hidden" id="btn_nextt">Next</a></div><div class="ml-10 mr-10 mb-25 text-center"><a class="btn btn-primary btn-block text-white" id="btn_registercontact">Register</a><div class="option-sep">or</div><p class="text-center">Already have an account?<a href="index.html#/login">Sign In</a></p></div></form><div id="modal_Otp" class="modal fade hide"><div class="modal-dialog">
|
||||
<div class="modal-content"><div class="modal-header mt-2 mb-2"><h5 class="modal-title pull-left">Mobile or Email Verification</h5><button type="button" class="close pull-right" data-dismiss="modal" aria-hidden="true">×</button></div><div class="modal-body" id="div_modalbody" style="height: 607px; overflow: hidden auto;"><div class="mb-10">
|
||||
<p class="lbl_Otp">We have sent OTP on your Mobile Number and Email!</p></div><div class="floating-label-form-group mb-2"><input class="form-control" id="txt_Otp" placeholder="Enter Mobile OTP/Email OTP" type="text"></div></div><div class="modal-footer mb-2" style="display:block">
|
||||
<button type="button" class="btn btn-primary pull-left" id="btn_ResendOtp">Resend</button><button type="button" class="btn btn-primary pull-right" id="btn_VerifyOtp">Verify</button></div></div></div></div></div>`;
|
||||
return html;
|
||||
}
|
||||
loadlobdata(containerid, datass, data) {
|
||||
var response = data.result.taggroups;
|
||||
var html = '<div class="section_LoBTags card Section"><div class="card-header">LoB Tags</div><div id="divLobWiseTags" class="card-body form-group floating-label focus divtags mb-30" data-lobtagindex="1"><ul id="ulLobTags" class="list-group"><input type="hidden" id="hf_LobContactIds" value="">';
|
||||
for (var i = 0; i < response.length; i++) {
|
||||
var data = response[i];
|
||||
html +=
|
||||
'<li class="list-group-item" id="liLobTags_' + data.tagGroupId + '"><div class="lobtag"><a href="#" onclick="javascript:return Unibase.Themes.Compact.Components.CreateContact.Instance().tags(' + false + ',' + data.tagGroupId + ',\'' + data.groupName + '\',null,' + data.tagCategoryId + ')"; id="spn_Lobs_' + data.tagGroupId + '" class="spn_Lobs_' + data.tagGroupId + ' pl-20" style="text-decoration:underline;color:deepskyblue">' + data.groupName + '</a><input type="checkbox" name="lobs[]" value="' + data.tagGroupId + '" id="chkContactLob_' + data.tagGroupId + '" class="pull-right chkbx" onclick="_bizgaze_control_AutomationLobTags.selectedtags(' + data.tagGroupId + ')" title="Applied for All Included Tags">' +
|
||||
'<input type = "hidden" id = "hdn_customcontrol" class="value-control" value = "Unibase.Forms.Controls.AutomationLobTagControl.Instance().loaddata(\'' + containerid + '\');"' +
|
||||
'<div class="hidden lobtags_' + data.tagGroupId + ' row col-sm-12">' +
|
||||
'<div class="div_IncludedTags col-sm-12" id="div_IncludedTags_' + data.tagGroupId + '">' +
|
||||
'<div class="divTagSelectorContainer_' + data.tagGroupId + '"></div></div>' +
|
||||
'<div class="div_ExcludedTags col-sm-6" id="div_ExcludedTags_' + data.tagGroupId + '">' +
|
||||
'<div class="divTagSelectorContaine_' + data.tagGroupId + '"></div>' +
|
||||
'</div></div></li>';
|
||||
}
|
||||
html += '</div></ul></div>';
|
||||
return html;
|
||||
}
|
||||
tags(tags, LobId, LobName, res, categoryid) {
|
||||
var instance = this;
|
||||
instance.Includetags('div_IncludedTags_' + LobId, LobId, LobName, categoryid, null, res);
|
||||
}
|
||||
Includetags(containerid, LobId, LobName, categoryid, includetagids, tag) {
|
||||
var res1 = tag;
|
||||
var incltag = tag;
|
||||
var instance = this;
|
||||
var html = "<div class='row'>";
|
||||
html += '<div class="col-sm-12"><div class="lobtag">' +
|
||||
'<label>' + 'Included Tags' + '</label>' +
|
||||
'<select style="width:100%" id="txtBizgazeNotifications_Tags_' + LobId + '" class="txtBizgazeNotifications_Tags_' + LobId + ' no-border form-control includedtag"></select>' +
|
||||
'<input type="hidden" class="hfBizgazeNotifications_Tags_' + LobId + '" value="' + LobName + '" />' +
|
||||
'<input type="hidden" class="hfTags_LobName" value="' + LobName + '" />' +
|
||||
'<input type="hidden" class="hfTags_LobId" value="' + LobId + '" />' +
|
||||
'<input type="hidden" class="hfTags_CategoryId" value="' + categoryid + '" />' +
|
||||
'</div></div>';
|
||||
html += '</div>';
|
||||
$("#" + containerid).find(".divTagSelectorContainer_" + LobId).html(html);
|
||||
$("#" + containerid).find(".lobtag").each(function () {
|
||||
var element = $(this);
|
||||
if (incltag == null) {
|
||||
instance.refreshincludeTags(element, categoryid, incltag, LobId);
|
||||
}
|
||||
});
|
||||
}
|
||||
;
|
||||
refreshincludeTags(element, categoryid, incltag, LobId) {
|
||||
var includetags = [];
|
||||
var Ids = [];
|
||||
if (incltag == undefined) {
|
||||
incltag = [];
|
||||
}
|
||||
for (var i = 0; i < incltag.length; i++) {
|
||||
var tag = incltag[i];
|
||||
if (tag.LobId == LobId) {
|
||||
includetags.push({ id: tag.TagId, text: tag.TagName });
|
||||
Ids.push(tag.TagId);
|
||||
}
|
||||
}
|
||||
var selectedtags = [];
|
||||
var multitags = $("#liLobTags_" + LobId).find(".lobtag").find(".lobtags_" + LobId).find(".lobtag").find("#txtBizgazeNotifications_Tag_" + LobId);
|
||||
for (i = 0; i < multitags.length; i++) {
|
||||
var inctags = $("#txtBizgazeNotifications_Tags_" + LobId).val();
|
||||
var exctags = $("#txtBizgazeNotifications_Tag_" + LobId).val();
|
||||
selectedtags += inctags + ',' + exctags + ',';
|
||||
}
|
||||
selectedtags = undefined;
|
||||
Unibase.Platform.Membership.Managers.AccountManager.Instance().childlobs(LobId, Number($("#ddl_Tenant").val())).then(function (response) {
|
||||
var controlData = [];
|
||||
for (let i = 0; i < response.result.length; i++) {
|
||||
var controls = response.result[i];
|
||||
controlData.push({ id: controls.value, text: controls.selectText });
|
||||
}
|
||||
$(".txtBizgazeNotifications_Tags_" + LobId).select2({
|
||||
placeholder: 'Select Control',
|
||||
data: controlData,
|
||||
});
|
||||
});
|
||||
}
|
||||
;
|
||||
loaddata(containerid) {
|
||||
var array = [];
|
||||
var checkboxes = document.getElementsByName('lobs[]');
|
||||
var vals = "";
|
||||
for (var i = 0, n = checkboxes.length; i < n; i++) {
|
||||
if (checkboxes[i].checked) {
|
||||
vals += "|" + checkboxes[i].value + '|';
|
||||
}
|
||||
}
|
||||
if (vals)
|
||||
vals = vals.substring(1);
|
||||
var tags = new Array();
|
||||
var selcteddata = "";
|
||||
var excludedata = "";
|
||||
$(".div_IncludedTags").find(".lobtag").each(function () {
|
||||
var element = $(this);
|
||||
var data = element.find('.includedtag').select2("data");
|
||||
for (var i = 0; i < data.length; i++) {
|
||||
selcteddata = selcteddata + data[i].id + '|';
|
||||
tags.push({ TagId: data[i].id });
|
||||
}
|
||||
});
|
||||
array.push({ "lobtags": vals, "includedtags": selcteddata, "excludedata": excludedata });
|
||||
return array;
|
||||
}
|
||||
load(id, containerid, callback) {
|
||||
$(".pr-password").click(function () {
|
||||
var signUpPswd = $(".pr-password");
|
||||
signUpPswd.passwordRequirements({
|
||||
numCharacters: 8,
|
||||
useLowercase: true,
|
||||
useUppercase: true,
|
||||
useNumbers: true,
|
||||
useSpecial: true
|
||||
});
|
||||
});
|
||||
$("#passwordbox").removeClass('hidden');
|
||||
$("#btn_nextt").addClass('hidden');
|
||||
$("#btn_registercontact").removeClass('hidden');
|
||||
var instance = this;
|
||||
$('#PasswordHide').click(function () {
|
||||
var input = $('#confirmpass');
|
||||
input.attr('type') == "password" ? input.attr('type', 'text') : input.attr('type', 'password');
|
||||
$('#Password_eye').toggleClass('fa-eye-slash fa-eye');
|
||||
});
|
||||
$('#cfmPasswordHide').click(function () {
|
||||
var input = $('#contacttPassword');
|
||||
input.attr('type') == "password" ? input.attr('type', 'text') : input.attr('type', 'password');
|
||||
$('#Password_eye').toggleClass('fa-eye-slash fa-eye');
|
||||
});
|
||||
$("#ddl_Tenant").change(function () {
|
||||
Unibase.Platform.Membership.Managers.AccountManager.Instance().getchildtags(Number($("#ddl_Tenant").val())).then(function (response) {
|
||||
$("#ddl_Tags").empty();
|
||||
let cmbLob = document.getElementById('ddl_Tags');
|
||||
$("#ddl_Tags").append('<option value=0>Im A</option>');
|
||||
for (var i = 0; i < response.result.length; i++) {
|
||||
var data = response.result[i];
|
||||
var opt = document.createElement("option");
|
||||
var Name = data.tagName;
|
||||
var id = data.tagId;
|
||||
opt.text = Name;
|
||||
opt.value = id;
|
||||
cmbLob.append(opt);
|
||||
}
|
||||
});
|
||||
});
|
||||
$("#txt_registercontactnumber").keypress(function (e) {
|
||||
if (e.which != 8 && e.which != 0 && (e.which < 48 || e.which > 57)) {
|
||||
MessageHelper.Instance().showError("Numbers only allowed", "div_ValidationSummary");
|
||||
return false;
|
||||
}
|
||||
});
|
||||
$("#btn_nextt").click(function () {
|
||||
$("#UserInfo").addClass("hidden");
|
||||
$("#passwordbox").removeClass('hidden');
|
||||
$("#divLobWiseTags").addClass('hidden');
|
||||
$("#btn_registercontact").removeClass('hidden');
|
||||
$("#btn_nextt").addClass('hidden');
|
||||
$(".section_LoBTags").addClass('hidden');
|
||||
});
|
||||
$("#btn_registercontact").click(function () {
|
||||
var number = $("#txt_registercontactnumber").val();
|
||||
if ($("#txt_registercontactname").val() == "") {
|
||||
MessageHelper.Instance().showError("Please Enter Name", "div_ValidationSummary");
|
||||
return false;
|
||||
}
|
||||
if ($("#txt_registerfirmname").val() == "") {
|
||||
MessageHelper.Instance().showError("Please Enter Firm Name", "div_ValidationSummary");
|
||||
return false;
|
||||
}
|
||||
if ($("#txt_registercontactnumber").val() == "") {
|
||||
MessageHelper.Instance().showError("Please Enter Phone Number", "div_ValidationSummary");
|
||||
return false;
|
||||
}
|
||||
if (number.length < 10) {
|
||||
MessageHelper.Instance().showError("Please Check Your Number", "div_ValidationSummary");
|
||||
return false;
|
||||
}
|
||||
if ($("#ddl_Tags").val() == "0") {
|
||||
MessageHelper.Instance().showError("Please Select Tag", "div_ValidationSummary");
|
||||
return false;
|
||||
}
|
||||
if ($("#txt_registercontactmail").val() != "") {
|
||||
var test = /^[a-zA-Z0-9+_.-]+@[a-zA-Z0-9.-]+(com|COM|in|IN)+$/;
|
||||
var value = $("#txt_registercontactmail").val();
|
||||
if (!value.match(test)) {
|
||||
MessageHelper.Instance().showError("Please Enter Valid Email", "div_ValidationSummary");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
var includes = $("#ddl_Tags").val();
|
||||
;
|
||||
if ($("#confirmpass").val() == "") {
|
||||
MessageHelper.Instance().showError("Please Enter PassWord", "div_ValidationSummary");
|
||||
return false;
|
||||
}
|
||||
var number1 = Number($("#txt_registercontactnumber").val());
|
||||
var contactname = $("#txt_registercontactname").val();
|
||||
var firmname = $("#txt_registerfirmname").val();
|
||||
var contactmail = $("#txt_registercontactmail").val();
|
||||
var passwords = $("#confirmpass").val();
|
||||
var decimal = /^(?=.*\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[^a-zA-Z0-9])(?!.*\s).{8,15}$/;
|
||||
var checkpassword = passwords.match(decimal) ? true : false;
|
||||
if (checkpassword == false) {
|
||||
$(".pr-password").focus();
|
||||
MessageHelper.Instance().showError("Please Match the Password in requested Format", "div_ValidationSummary");
|
||||
return false;
|
||||
}
|
||||
if (($("#contacttPassword").val()) == "") {
|
||||
MessageHelper.Instance().showError("Please Enter Confirm Password", "div_ValidationSummary");
|
||||
return false;
|
||||
}
|
||||
let checklength = $("#confirmpass").val();
|
||||
if (checklength.length < 8) {
|
||||
MessageHelper.Instance().showError("Your password length is " + checklength.length + ", Password must be atleast minimum 8 characters!", 'div_ValidationSummary');
|
||||
return false;
|
||||
}
|
||||
if ($("#confirmpass").val() != $("#contacttPassword").val()) {
|
||||
MessageHelper.Instance().showError("Password and Confirm Password Does Not Match", "div_ValidationSummary");
|
||||
return null;
|
||||
}
|
||||
else {
|
||||
var password = $("#contacttPassword").val();
|
||||
if (contactmail == "") {
|
||||
contactmail = null;
|
||||
}
|
||||
$("#btn_registercontact").addClass("disabled");
|
||||
Unibase.Platform.Membership.Managers.AccountManager.Instance().registercontact(contactname, number1, contactmail, includes, Number($("#ddl_Tenant").val()), password, firmname).then(function (response) {
|
||||
$("#btn_registercontact").removeClass("disabled");
|
||||
var res = response;
|
||||
if (res.code == "3") {
|
||||
MessageHelper.Instance().showError(response.message, "div_ValidationSummary");
|
||||
}
|
||||
else {
|
||||
window.location.href = '#/login';
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
Unibase.Platform.Helpers.FileCacheHelper.Instance().loadJsFile("platform/membership/managers/accountmanager.js", function () {
|
||||
Unibase.Platform.Membership.Managers.AccountManager.Instance().getTenants().then(function (response) {
|
||||
var res = response;
|
||||
let cmbLob = document.getElementById('ddl_Tenant');
|
||||
$('#ddl_Tenant').empty();
|
||||
$('#ddl_Tenant').append('<option value=0>Select Tenant</option>');
|
||||
for (var i = 0; i < response.result.length; i++) {
|
||||
var data = response.result[i];
|
||||
var opt = document.createElement("option");
|
||||
var Name = data.tenantName;
|
||||
var id = data.tenantId;
|
||||
opt.text = Name;
|
||||
opt.value = id;
|
||||
cmbLob.append(opt);
|
||||
}
|
||||
if (res.result.filter(x => x.isTemplateDb == false).length == 1) {
|
||||
var id = $('#ddl_Tenant option[value=' + res.result.filter(x => x.isTemplateDb == false)[0].tenantId + ']');
|
||||
id.attr("selected", true);
|
||||
$("#ddl_Tenant").prop("disabled", true);
|
||||
$("#ddl_Tenant").change();
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
loadIndustries() {
|
||||
}
|
||||
validate() {
|
||||
}
|
||||
sendOtp(isResend) {
|
||||
}
|
||||
verifyOtp() {
|
||||
}
|
||||
saveSignUp(ContactConfirmed, EmailConfirmed) {
|
||||
}
|
||||
static Instance() {
|
||||
return new CreateContact();
|
||||
}
|
||||
}
|
||||
Components.CreateContact = CreateContact;
|
||||
})(Components = Compact.Components || (Compact.Components = {}));
|
||||
})(Compact = Themes.Compact || (Themes.Compact = {}));
|
||||
})(Themes = Unibase.Themes || (Unibase.Themes = {}));
|
||||
})(Unibase || (Unibase = {}));
|
||||
File diff suppressed because one or more lines are too long
+16
File diff suppressed because one or more lines are too long
@@ -0,0 +1,311 @@
|
||||
var Unibase;
|
||||
(function (Unibase) {
|
||||
let Themes;
|
||||
(function (Themes) {
|
||||
let Compact;
|
||||
(function (Compact) {
|
||||
let Components;
|
||||
(function (Components) {
|
||||
class Signup extends Unibase.Platform.Core.BaseComponent {
|
||||
jsFiles() {
|
||||
return ["tenants/themes/compact/index.anonymous.js", "platform/membership/managers/accountmanager.js", "libs/passwordrequirement/passwordrequirement.js"];
|
||||
}
|
||||
cssFiles() {
|
||||
return ["libs/passwordrequirement/passwordrequirement.css"];
|
||||
}
|
||||
html(id, containerid) {
|
||||
if (jQuery("#external-form").length === 0) {
|
||||
var index = new Components.Index_Anonymous();
|
||||
index.init(null);
|
||||
}
|
||||
const html = `<div><form id="frm_Signup" default="" data-validate="parsley" data-isdynamic="false"><h1 class="display-4 mb-10 ml-10 mr-10">Sign up for free</h1><p class="mb-30 ml-10 mr-10">Create your account and start your free trial today</p><div><div id="div_ValidationSummary" class="clear ml-20 mr-20"></div><div class="form-row"><div class="col-md-6 form-group"><input class="form-control required" id="txt_FirstName" placeholder="First name" value="" type="text" required></div><div class="col-md-6 form-group"><input class="form-control required" id="txt_LastName" placeholder="Last name" value="" type="text" required></div></div><div class="form-group"><input class="form-control required" maxlength="10" id="txt_PhoneNum" placeholder="Mobile" type="tel" required></div><div class="form-group"><input class="form-control required" id="txt_Email" placeholder="Email" type="text" required></div><div class="form-group"><input class="form-control required pr-password " id="txt_Password" placeholder="Password" type="password" autocomplete="new-password" required><span toggle="#txt_Password" id="passwordHide" class="fa fa-eye-slash font-15 mr-10 field-icon"/></span><div class="showpwsdreq"></div></div><div class="form-group"><input class="form-control required" id="txt_ConfirmPassword" placeholder="Confirm Password" type="password" autocomplete="new-password" required><span toggle="#txtConfirmPassword" id="confirmPasswordHide" class="fa fa-eye-slash font-15 mr-10 field-icon"/></div><div class="form-row"><div class="col-md-6 form-group"><input class="form-control required" id="txt_TenantName" placeholder="Tenant Name" type="text" required></div>
|
||||
<div class=" col-md-6 form-group " id="div_Industry"><select id="ddl_Industry" class="form-control value-control" data-isdynamic="false"></select><input class="form-control" id="txt_IndustryName" placeholder="Industry Name" type="text" class="hidden"></div>
|
||||
</div></div><div class="custom-control custom-checkbox mb-25 ml-10 mr-10"><input class="custom-control-input" id="chk_ReadTerms" type="checkbox"><label class="custom-control-label font-14" for="chk_ReadTerms">I have read and agree to the <a href=""><u>term and conditions</u></a></label></div><div class="ml-10 mr-10 mb-25 text-center"><a class="btn btn-primary btn-block text-white disabled" id="btn_Register">Register</a><div class="option-sep">or</div><p class="text-center">Already have an account?<a href="index.html#/login">Sign In</a></p></div></form><div id="modal_Otp" class="modal fade hide"><div class="modal-dialog"><div class="modal-content"><div class="modal-header mt-2 mb-2"><h5 class="modal-title pull-left">Mobile or Email Verification</h5><button type="button" class="close pull-right" data-dismiss="modal" aria-hidden="true" >×</button></div><div class="modal-body" id="div_modalbody"><div class="mb-10"><p class="lbl_Otp">We have sent OTP on your Mobile Number and Email!</p></div><div class="floating-label-form-group mb-2"><input class="form-control" id ="txt_Otp" placeholder="Enter Mobile OTP/Email OTP" type="text"></div></div><div class="modal-footer mb-2" style="display:block"><button type = "button" class="btn btn-primary pull-left" id="btn_ResendOtp">Resend</button><button type = "button" class="btn btn-primary pull-right" id="btn_VerifyOtp">Verify</button></div></div></div></div></div>`;
|
||||
return html;
|
||||
}
|
||||
load(id, containerid, callback) {
|
||||
$(".pr-password").click(function () {
|
||||
var signUpPswd = $(".pr-password");
|
||||
signUpPswd.passwordRequirements({
|
||||
numCharacters: 8,
|
||||
useLowercase: true,
|
||||
useUppercase: true,
|
||||
useNumbers: true,
|
||||
useSpecial: true
|
||||
});
|
||||
});
|
||||
this._accountManager = Unibase.Platform.Membership.Managers.AccountManager.Instance();
|
||||
var instance = this;
|
||||
instance.loadIndustries();
|
||||
jQuery(".preloader-it").delay(500).fadeOut("slow");
|
||||
jQuery("#external-container").delay(500).fadeIn("slow");
|
||||
jQuery("#bizgaze_body").css("background-color", "#f4f6f7");
|
||||
$("#div_modalbody").removeAttr("style");
|
||||
$('#chk_ReadTerms').change(function () {
|
||||
if ($(this).prop("checked"))
|
||||
$("#btn_Register").removeClass('disabled');
|
||||
else
|
||||
$("#btn_Register").addClass('disabled');
|
||||
});
|
||||
$('#passwordHide').click(function () {
|
||||
var input = $('#txt_Password');
|
||||
input.attr('type') == "password" ? input.attr('type', 'text') : input.attr('type', 'password');
|
||||
$('#passwordHide').toggleClass('fa-eye-slash fa-eye');
|
||||
});
|
||||
$('#confirmPasswordHide').click(function () {
|
||||
var input = $('#txt_ConfirmPassword');
|
||||
input.attr('type') == "password" ? input.attr('type', 'text') : input.attr('type', 'password');
|
||||
$('#confirmPasswordHide').toggleClass('fa-eye-slash fa-eye');
|
||||
});
|
||||
$("#txt_Otp").keypress(function (e) {
|
||||
if (e.which == 13)
|
||||
document.getElementById("btn_VerifyOtp").click();
|
||||
});
|
||||
$("#txt_PhoneNum").keypress(function (e) {
|
||||
if (e.which != 8 && e.which != 0 && (e.which < 48 || e.which > 57)) {
|
||||
MessageHelper.Instance().showError("Numbers only allowed", "div_ValidationSummary");
|
||||
return false;
|
||||
}
|
||||
});
|
||||
$("#btn_Register").click(function () {
|
||||
instance.validate();
|
||||
});
|
||||
$("#btn_VerifyOtp").click(function () {
|
||||
instance.verifyOtp();
|
||||
});
|
||||
$("#btn_ResendOtp").click(function () {
|
||||
instance.sendOtp(instance.OtpId);
|
||||
});
|
||||
}
|
||||
loadIndustries() {
|
||||
var instance = this;
|
||||
this._accountManager.getIndustries().then(function (response) {
|
||||
if (response.result.length > 0) {
|
||||
$('#ddl_Industry').removeClass("hidden");
|
||||
$('#txt_IndustryName').addClass("hidden");
|
||||
let cmbLob = document.getElementById('ddl_Industry');
|
||||
$('#ddl_Industry').empty();
|
||||
$('#ddl_Industry').append('<option value=0>Select Industry</option>');
|
||||
instance.IndustryLength = response.result.length;
|
||||
for (var i = 0; i < response.result.length; i++) {
|
||||
var data = response.result[i];
|
||||
var opt = document.createElement("option");
|
||||
var Name = data.industryName;
|
||||
var id = data.industryId + "|" + data.industryTenantId + "|" + data.isDefaultData;
|
||||
opt.text = Name;
|
||||
opt.value = id;
|
||||
cmbLob.append(opt);
|
||||
}
|
||||
}
|
||||
else {
|
||||
$('#ddl_Industry').addClass("hidden");
|
||||
$('#txt_IndustryName').removeClass("hidden");
|
||||
}
|
||||
});
|
||||
}
|
||||
validate() {
|
||||
var instance = this;
|
||||
var confirmPassword = $("#txt_ConfirmPassword").val();
|
||||
var password = $("#txt_Password").val();
|
||||
var phone = $("#txt_PhoneNum").val();
|
||||
var email = $("#txt_Email").val();
|
||||
var regex = /^([a-zA-Z0-9_.+-])+\@(([a-zA-Z0-9-])+\.)+((com|COM|in|IN))+$/;
|
||||
var signUpForm = document.getElementById('frm_Signup');
|
||||
var isValid = signUpForm.checkValidity();
|
||||
if (!isValid) {
|
||||
MessageHelper.Instance().showError("Mandatory fields are missing!", 'div_ValidationSummary');
|
||||
return false;
|
||||
}
|
||||
if (password.length < 8 || confirmPassword.length < 8) {
|
||||
MessageHelper.Instance().showError("Password must be atleast 8 characters!", 'div_ValidationSummary');
|
||||
return false;
|
||||
}
|
||||
var password = $("#txt_Password").val();
|
||||
var decimal = /^(?=.*\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[^a-zA-Z0-9])(?!.*\s).{8,15}$/;
|
||||
var checkpassword = password.match(decimal) ? true : false;
|
||||
if (checkpassword == false) {
|
||||
$(".pr-password").focus();
|
||||
MessageHelper.Instance().showError("Please Match the Password in requested Format", "div_ValidationSummary");
|
||||
return false;
|
||||
}
|
||||
if (password != confirmPassword) {
|
||||
MessageHelper.Instance().showError("New and Confirm Passwords doesn't match!", "div_ValidationSummary");
|
||||
return false;
|
||||
}
|
||||
if (regex.test(email) == false) {
|
||||
MessageHelper.Instance().showError("Email is not provided in correct format", "div_ValidationSummary");
|
||||
return false;
|
||||
}
|
||||
if (instance.IndustryLength != 0) {
|
||||
if ($('#ddl_Industry option:selected').val() == 0) {
|
||||
MessageHelper.Instance().showError("Select an Industry!", "div_ValidationSummary");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else {
|
||||
if ($("#txt_IndustryName").val() == "") {
|
||||
MessageHelper.Instance().showError("Industry Name cannot be empty!", "div_ValidationSummary");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
instance._accountManager.getUser(phone, email).then(function (response) {
|
||||
if (response.result != null) {
|
||||
if (response.result.contactNumber == phone && response.result.email == email) {
|
||||
MessageHelper.Instance().showError("Phone Number & Email already exists!", "div_ValidationSummary");
|
||||
return false;
|
||||
}
|
||||
else if (response.result.contactNumber == phone) {
|
||||
MessageHelper.Instance().showError("Phone Number already exists!", "div_ValidationSummary");
|
||||
return false;
|
||||
}
|
||||
else if (response.result.email == email) {
|
||||
MessageHelper.Instance().showError("Email already exists!", "div_ValidationSummary");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else {
|
||||
$(".lbl_Otp").removeClass('text-danger text-success').text("We have sent OTP on your Mobile Number and Email !");
|
||||
$("#txt_Otp").val('');
|
||||
$("#div_ValidationSummary").empty();
|
||||
instance.sendOtp(0);
|
||||
}
|
||||
}, function () {
|
||||
MessageHelper.Instance().showError("Some Error has occurred!", 'div_ValidationSummary');
|
||||
});
|
||||
}
|
||||
sendOtp(isResend) {
|
||||
var instance = this;
|
||||
$(".preloader-it").fadeIn();
|
||||
var postData = {
|
||||
FirstName: $("#txt_FirstName").val(),
|
||||
LastName: $("#txt_LastName").val(),
|
||||
ContactNumber: $("#txt_PhoneNum").val(),
|
||||
Email: $("#txt_Email").val(),
|
||||
TenantName: $("#txt_TenantName").val(),
|
||||
ContactOrEmail: "",
|
||||
IsForgotPswd: false,
|
||||
IsRegisterUser: false,
|
||||
IsSignup: true,
|
||||
UnibaseId: "",
|
||||
OtpId: isResend,
|
||||
UserOtp: ""
|
||||
};
|
||||
instance._accountManager.sendOtp(postData).then(function (response) {
|
||||
if (isResend != 0) {
|
||||
$(".lbl_Otp").text("OTP has been Resent!").removeClass('text-danger', '').addClass('text-success', '');
|
||||
}
|
||||
if (response == 0) {
|
||||
$(".preloader-it").delay(200).fadeOut("slow");
|
||||
MessageHelper.Instance().showError("Some Error has occurred!", 'div_ValidationSummary');
|
||||
}
|
||||
else {
|
||||
instance.OtpId = response;
|
||||
$(".preloader-it").delay(200).fadeOut("slow");
|
||||
$("#modal_Otp").modal("show");
|
||||
}
|
||||
}, function () {
|
||||
$(".preloader-it").delay(200).fadeOut("slow");
|
||||
$("#signup-container").show();
|
||||
MessageHelper.Instance().showError("Some Error has occurred!", 'div_ValidationSummary');
|
||||
});
|
||||
}
|
||||
verifyOtp() {
|
||||
var instance = this;
|
||||
if ($("#txt_Otp").val() == "")
|
||||
$(".lbl_Otp").text("Please Enter OTP!").addClass('text-danger', '');
|
||||
else {
|
||||
var postData = {
|
||||
FirstName: "",
|
||||
LastName: "",
|
||||
ContactNumber: "",
|
||||
Email: "",
|
||||
TenantName: "",
|
||||
ContactOrEmail: "",
|
||||
IsForgotPswd: false,
|
||||
IsRegisterUser: false,
|
||||
IsSignup: true,
|
||||
UnibaseId: "",
|
||||
OtpId: instance.OtpId,
|
||||
UserOtp: $("#txt_Otp").val(),
|
||||
};
|
||||
instance._accountManager.verifyOtp(postData).then(function (response) {
|
||||
if (response.result != null) {
|
||||
if (response.result.contactConfirmed == false && response.result.emailConfirmed == false) {
|
||||
$("#modal_Otp").modal("show");
|
||||
$(".lbl_Otp").text("Invalid OTP!").addClass('text-danger', '');
|
||||
$("#txt_Otp").val('');
|
||||
}
|
||||
else {
|
||||
$("#modal_Otp").modal("hide");
|
||||
instance.saveSignUp(response.result.contactConfirmed, response.result.emailConfirmed);
|
||||
}
|
||||
}
|
||||
else if (response.code.toString() == "2") {
|
||||
$("#modal_Otp").modal("show");
|
||||
$(".lbl_Otp").text(response.errors.toString()).addClass('text-danger', '');
|
||||
$("#txt_Otp").val('');
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
saveSignUp(ContactConfirmed, EmailConfirmed) {
|
||||
var instance = this;
|
||||
$(".preloader-it").fadeIn();
|
||||
var industryId = 0;
|
||||
var industryTenantId = 0;
|
||||
var isDefaultData = false;
|
||||
var industryName = "";
|
||||
if ($("#txt_IndustryName").val() == "" && $("#ddl_Industry option:selected").val() != "0") {
|
||||
var value = $("#ddl_Industry option:selected").val().toString().split('|');
|
||||
industryId = parseInt(value[0]);
|
||||
industryTenantId = parseInt(value[1]);
|
||||
isDefaultData = JSON.parse(value[2]);
|
||||
industryName = $("#ddl_Industry option:selected").text();
|
||||
}
|
||||
else
|
||||
industryName = $("#txt_IndustryName").val();
|
||||
var postData = {
|
||||
FirstName: $("#txt_FirstName").val(),
|
||||
LastName: $("#txt_LastName").val(),
|
||||
ContactNumber: $("#txt_PhoneNum").val(),
|
||||
Email: $("#txt_Email").val(),
|
||||
Password: $("#txt_Password").val(),
|
||||
TenantName: $("#txt_TenantName").val(),
|
||||
TenantId: 0,
|
||||
ContactNumberConfirmed: ContactConfirmed,
|
||||
EmailConfirmed: EmailConfirmed,
|
||||
IndustryId: industryId,
|
||||
IndustryTenantId: industryTenantId,
|
||||
IndustryName: industryName,
|
||||
IsDefaultData: isDefaultData,
|
||||
};
|
||||
instance._accountManager.signUp(postData).then(function (response) {
|
||||
$("#frm_Signup").find("input,textarea").val('');
|
||||
$("#frm_Signup").find("input").prop("checked", false);
|
||||
$(".preloader-it").delay(200).fadeOut("slow");
|
||||
if (response.errors == null) {
|
||||
MessageHelper.Instance().showSuccess("Tenant Created Successfully", 'div_ValidationSummary');
|
||||
instance.fileCacheHelper.loadJsFileAsync('tenants/themes/compact/components/signup/signupsuccesspage.js', function () {
|
||||
Unibase.Themes.Compact.Components.SignupSuccessPage.Instance().init("#bizgaze_body");
|
||||
});
|
||||
}
|
||||
else {
|
||||
MessageHelper.Instance().showError(response.message, 'div_ValidationSummary');
|
||||
$(".preloader-it").delay(200).fadeOut("slow");
|
||||
return false;
|
||||
}
|
||||
}, function () {
|
||||
$(".preloader-it").delay(200).fadeOut("slow");
|
||||
$("#signup-container").show();
|
||||
MessageHelper.Instance().showError("Some Error has occurred!", 'div_ValidationSummary');
|
||||
});
|
||||
}
|
||||
static Instance() {
|
||||
return new Signup();
|
||||
}
|
||||
}
|
||||
Components.Signup = Signup;
|
||||
})(Components = Compact.Components || (Compact.Components = {}));
|
||||
})(Compact = Themes.Compact || (Themes.Compact = {}));
|
||||
})(Themes = Unibase.Themes || (Unibase.Themes = {}));
|
||||
})(Unibase || (Unibase = {}));
|
||||
File diff suppressed because one or more lines are too long
+3
File diff suppressed because one or more lines are too long
@@ -0,0 +1,35 @@
|
||||
var Unibase;
|
||||
(function (Unibase) {
|
||||
let Themes;
|
||||
(function (Themes) {
|
||||
let Compact;
|
||||
(function (Compact) {
|
||||
let Components;
|
||||
(function (Components) {
|
||||
class SignupSuccessPage extends Unibase.Platform.Core.BaseComponent {
|
||||
init(container) {
|
||||
this.render(container, null);
|
||||
}
|
||||
render(container, callback) {
|
||||
const html = '<form><div id="div_TenantSuccess" ><div class="d-62 bg-white rounded-circle mb-10 d-flex align-items-center justify-content-center mx-auto" ><i class="fa fa-check font-50 text-success" ></i></div><h1 class="display-4 mb-20 text-center" > Tenant Created Successfully </h1><p class="text-center" ><a href="/Index.html" > Click here to Login </a></p></div></form>';
|
||||
const cacheHelper = this.fileCacheHelper;
|
||||
cacheHelper.loadJsFile("tenants/themes/compact/index.anonymous.js", function () {
|
||||
if (jQuery("#external-form").length === 0) {
|
||||
jQuery(".preloader-it").delay(500).fadeOut("slow");
|
||||
jQuery("#external-container").delay(500).fadeIn("slow");
|
||||
jQuery("#bizgaze_body").css("background-color", "#f4f6f7");
|
||||
}
|
||||
jQuery("#external-form").html(html);
|
||||
if (callback != null)
|
||||
callback();
|
||||
});
|
||||
}
|
||||
static Instance() {
|
||||
return new SignupSuccessPage();
|
||||
}
|
||||
}
|
||||
Components.SignupSuccessPage = SignupSuccessPage;
|
||||
})(Components = Compact.Components || (Compact.Components = {}));
|
||||
})(Compact = Themes.Compact || (Themes.Compact = {}));
|
||||
})(Themes = Unibase.Themes || (Unibase.Themes = {}));
|
||||
})(Unibase || (Unibase = {}));
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"signupsuccesspage.js","sourceRoot":"","sources":["signupsuccesspage.ts"],"names":[],"mappings":"AAAA,IAAU,OAAO,CAkChB;AAlCD,WAAU,OAAO;IACb,IAAiB,MAAM,CAgCtB;IAhCD,WAAiB,MAAM;QACnB,IAAiB,OAAO,CA8BvB;QA9BD,WAAiB,OAAO;YACpB,IAAiB,UAAU,CA4B1B;YA5BD,WAAiB,UAAU;gBACvB,MAAa,iBAAkB,SAAQ,QAAA,QAAQ,CAAC,IAAI,CAAC,aAAa;oBAC9D,IAAI,CAAC,SAAS;wBACV,IAAI,CAAC,MAAM,CAAC,SAAS,EAAE,IAAI,CAAC,CAAC;oBACjC,CAAC;oBAED,MAAM,CAAC,SAAS,EAAE,QAAQ;wBACtB,MAAM,IAAI,GAAG,0WAA0W,CAAC;wBAExX,MAAM,WAAW,GAAG,IAAI,CAAC,eAAe,CAAC;wBACzC,WAAW,CAAC,UAAU,CAAC,2CAA2C,EAAE;4BAChE,IAAI,MAAM,CAAC,gBAAgB,CAAC,CAAC,MAAM,KAAK,CAAC,EAAE;gCAEvC,MAAM,CAAC,eAAe,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;gCACnD,MAAM,CAAC,qBAAqB,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;gCACxD,MAAM,CAAC,eAAe,CAAC,CAAC,GAAG,CAAC,kBAAkB,EAAE,SAAS,CAAC,CAAC;6BAC9D;4BACD,MAAM,CAAC,gBAAgB,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;4BACpC,IAAI,QAAQ,IAAI,IAAI;gCAChB,QAAQ,EAAE,CAAC;wBACnB,CAAC,CAAC,CAAC;oBAEP,CAAC;oBACD,MAAM,CAAC,QAAQ;wBACX,OAAO,IAAI,iBAAiB,EAAE,CAAC;oBACnC,CAAC;iBAEJ;gBA1BY,4BAAiB,oBA0B7B,CAAA;YACL,CAAC,EA5BgB,UAAU,GAAV,kBAAU,KAAV,kBAAU,QA4B1B;QACL,CAAC,EA9BgB,OAAO,GAAP,cAAO,KAAP,cAAO,QA8BvB;IACL,CAAC,EAhCgB,MAAM,GAAN,cAAM,KAAN,cAAM,QAgCtB;AACL,CAAC,EAlCS,OAAO,KAAP,OAAO,QAkChB"}
|
||||
+1
@@ -0,0 +1 @@
|
||||
var Unibase;(function(n){let t;(function(t){let i;(function(t){let i;(function(t){class i extends n.Platform.Core.BaseComponent{init(n){this.render(n,null)}render(n,t){const i='<form><div id="div_TenantSuccess" ><div class="d-62 bg-white rounded-circle mb-10 d-flex align-items-center justify-content-center mx-auto" ><i class="fa fa-check font-50 text-success" ><\/i><\/div><h1 class="display-4 mb-20 text-center" > Tenant Created Successfully <\/h1><p class="text-center" ><a href="/Index.html" > Click here to Login <\/a><\/p><\/div><\/form>',r=this.fileCacheHelper;r.loadJsFile("tenants/themes/compact/index.anonymous.js",function(){jQuery("#external-form").length===0&&(jQuery(".preloader-it").delay(500).fadeOut("slow"),jQuery("#external-container").delay(500).fadeIn("slow"),jQuery("#bizgaze_body").css("background-color","#f4f6f7"));jQuery("#external-form").html(i);t!=null&&t()})}static Instance(){return new i}}t.SignupSuccessPage=i})(i=t.Components||(t.Components={}))})(i=t.Compact||(t.Compact={}))})(t=n.Themes||(n.Themes={}))})(Unibase||(Unibase={}));
|
||||
Reference in New Issue
Block a user