Sandata templates for the sign up form. Removed a few test scripts I don't need anymore. Created an Acatble dir.
This commit is contained in:
@ -150,13 +150,15 @@
|
||||
<i class="np-header-search-icon far fa-search"></i>
|
||||
</form>
|
||||
{% for website_navigation in navigations.header_navigations %}
|
||||
<a
|
||||
href="{{ website_navigation.path }}"
|
||||
class="np-header-mobile-menu-content-button"
|
||||
{% if website_navigation.external? %} target="_blank" {% endif %}
|
||||
>
|
||||
{{ website_navigation.name }}
|
||||
</a>
|
||||
{% unless website_navigation.name == 'Home' %}
|
||||
<a
|
||||
href="{{ website_navigation.path }}"
|
||||
class="np-header-mobile-menu-content-button"
|
||||
{% if website_navigation.external? %} target="_blank" {% endif %}
|
||||
>
|
||||
{{ website_navigation.name }}
|
||||
</a>
|
||||
{% endunless %}
|
||||
{% endfor %}
|
||||
<div class="np-header-mobile-menu-content-line"></div>
|
||||
{% unless current_school.sso_active? %}
|
||||
@ -178,3 +180,13 @@
|
||||
</div>
|
||||
|
||||
{% include "messages" %}
|
||||
|
||||
{% if current_person.signed_in? %}
|
||||
{% unless current_person.properties.successfully_completed_secondary_registration %}
|
||||
<script>
|
||||
if(!localStorage.getItem('completed-second-registration')){
|
||||
window.location.href = '/app/sign-up-follow-up';
|
||||
}
|
||||
</script>
|
||||
{% endunless %}
|
||||
{% endif %}
|
||||
@ -0,0 +1,14 @@
|
||||
<select
|
||||
class="sign-up-dropdown np-input"
|
||||
type="text"
|
||||
name="role-dropdown"
|
||||
id="sign-up-role-dropdown"
|
||||
required
|
||||
>
|
||||
<option class="second-login-role-option" value="" selected>Select a role</option>
|
||||
<option class="second-login-role-option" value="Agency Admin/Manager">Agency Admin/Manager</option>
|
||||
<option class="second-login-role-option" value="Agency Staff">Agency Staff</option>
|
||||
<option class="second-login-role-option" value="Agency Billing">Agency Billing</option>
|
||||
<option class="second-login-role-option" value="Agency Scheduling">Agency Scheduling</option>
|
||||
<option class="second-login-role-option" value="Agency Billing & Scheduling">Agency Billing & Scheduling</option>
|
||||
</select>
|
||||
@ -0,0 +1,30 @@
|
||||
<select
|
||||
class="sign-up-dropdown np-input"
|
||||
type="text"
|
||||
name="state-dropdown"
|
||||
id="sign-up-state-dropdown"
|
||||
required
|
||||
>
|
||||
<option class="second-login-state-option" value="" selected>Select a state</option>
|
||||
<option class="second-login-state-option" value="Arizona">Arizona</option>
|
||||
<option class="second-login-state-option" value="California">California</option>
|
||||
<option class="second-login-state-option" value="Colorado">Colorado</option>
|
||||
<option class="second-login-state-option" value="Connecticut">Connecticut</option>
|
||||
<option class="second-login-state-option" value="Delaware">Delaware</option>
|
||||
<option class="second-login-state-option" value="District Of Columbia">District Of Columbia</option>
|
||||
<option class="second-login-state-option" value="Hawaii">Hawaii</option>
|
||||
<option class="second-login-state-option" value="Idaho">Idaho</option>
|
||||
<option class="second-login-state-option" value="Indiana">Indiana</option>
|
||||
<option class="second-login-state-option" value="Missouri">Missouri</option>
|
||||
<option class="second-login-state-option" value="Montana">Montana</option>
|
||||
<option class="second-login-state-option" value="Nevada">Nevada</option>
|
||||
<option class="second-login-state-option" value="North Carolina">North Carolina</option>
|
||||
<option class="second-login-state-option" value="North Dakota">North Dakota</option>
|
||||
<option class="second-login-state-option" value="Ohio">Ohio</option>
|
||||
<option class="second-login-state-option" value="Oklahoma">Oklahoma</option>
|
||||
<option class="second-login-state-option" value="Pennsylvania">Pennsylvania</option>
|
||||
<option class="second-login-state-option" value="Rhode Island">Rhode Island</option>
|
||||
<option class="second-login-state-option" value="Tennessee">Tennessee</option>
|
||||
<option class="second-login-state-option" value="Vermont">Vermont</option>
|
||||
<option class="second-login-state-option" value="Wisconsin">Wisconsin</option>
|
||||
</select>
|
||||
@ -1,13 +1,15 @@
|
||||
<nav class="np-sub-navigation">
|
||||
<div class="np-sub-navigation-content">
|
||||
{% for link in navigations.sub_navigation %}
|
||||
<div class="np-sub-navigation-content-item {{ link.active_class }}">
|
||||
<a class="np-sub-navigation-content-item-link" href="{{ link.url }}">
|
||||
<i class="{{ link.icon }} np-button-color np-sub-navigation-content-item-icon"></i>
|
||||
{{ link.label }}
|
||||
</a>
|
||||
<div class="np-sub-navigation-content-item-bar np-button-background-color"></div>
|
||||
</div>
|
||||
{% unless link.label == 'Home' %}
|
||||
<div class="np-sub-navigation-content-item {{ link.active_class }}">
|
||||
<a class="np-sub-navigation-content-item-link" href="{{ link.url }}">
|
||||
<i class="{{ link.icon }} np-button-color np-sub-navigation-content-item-icon"></i>
|
||||
{{ link.label }}
|
||||
</a>
|
||||
<div class="np-sub-navigation-content-item-bar np-button-background-color"></div>
|
||||
</div>
|
||||
{% endunless %}
|
||||
{% endfor %}
|
||||
</div>
|
||||
</nav>
|
||||
|
||||
@ -1,4 +1,7 @@
|
||||
{% include "header" %}
|
||||
<script>
|
||||
window.location.href = '/app/dashboard'
|
||||
</script>
|
||||
{% comment %} {% include "header" %}
|
||||
{% include "course_version_outdated_alert", courses: courses.featured %}
|
||||
<main class="np-main np-homepage">
|
||||
<div class="np-homepage-hero">
|
||||
@ -13,11 +16,6 @@
|
||||
<div class="np-homepage-subheadline np-header-font-color">
|
||||
{{ homepage.subheadline }}
|
||||
</div>
|
||||
{% comment %}
|
||||
<a class="np-homepage-hero-cta np-button" href="{% route catalog %}">
|
||||
{% t .discover %}
|
||||
</a>
|
||||
{% endcomment %}
|
||||
</div>
|
||||
</div>
|
||||
{% include "sub_navigation" %}
|
||||
@ -51,4 +49,4 @@
|
||||
{% endif %}
|
||||
</div>
|
||||
</main>
|
||||
{% include "footer" %}
|
||||
{% include "footer" %} {% endcomment %}
|
||||
|
||||
@ -0,0 +1,487 @@
|
||||
{% comment %} {% assign groupValidator = false %}
|
||||
{% for group in current_person.groups %}
|
||||
{% if group %}
|
||||
{% assign groupValidator = true %}
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
|
||||
{% if current_person.signed_in? %}
|
||||
{% if groupValidator == true %}
|
||||
<script>
|
||||
if (window.location.pathname != '/app/dashboard'){
|
||||
window.location.replace('/app/dashboard');
|
||||
}
|
||||
</script>
|
||||
{% endif %}
|
||||
{% endif %} {% endcomment %}
|
||||
|
||||
<main class="np-main np-box-container">
|
||||
<div class="np-box">
|
||||
{% include "header_minimal" %}
|
||||
<div class="np-box-content-container">
|
||||
<form class="np-form np-box-content" name="secondaryRegistrationForm" onsubmit(return false)>
|
||||
<input class="sign-up-follow-up-input" placeholder="Agency Name"/>
|
||||
<input class="sign-up-follow-up-input" placeholder="Agency ID # (Optional)" id="agency-id-input"/>
|
||||
<input class="sign-up-follow-up-input" placeholder="Medicaid ID #" id="medicaid-id-input"/>
|
||||
<span class="sign-up-follow-up-error-label" id="medicaid-id-label">Please enter a valid, 5-12 digit Medicaid ID number</span>
|
||||
<input class="sign-up-follow-up-input" placeholder="Provider ID #" id="provider-id-input"/>
|
||||
<span class="sign-up-follow-up-error-label" id="provider-id-label">Please enter a valid, 10 digit Provider ID number</span>
|
||||
|
||||
{% comment %} <h1 class="sign-up-follow-up-prompt">Role: </h1> {% endcomment %}
|
||||
{% include "sign_up_follow_up_roles_dropdown" %}
|
||||
|
||||
{% comment %} <h1 class="sign-up-follow-up-prompt">State: </h1> {% endcomment %}
|
||||
{% include "sign_up_follow_up_states_dropdown" %}
|
||||
<input class="sign-up-follow-up-input" id="calEVV-input" placeholder="CalEVV Identifier" style="display: none;"/>
|
||||
<span class="sign-up-follow-up-error-label" id="calEVV-label">Please enter a valid, 10 digit California EVV ID Number</span>
|
||||
|
||||
{% comment %} <input class="sign-up-follow-up-input" id="oh-input" placeholder="OH Identifier" style="display: none;"/> {% endcomment %}
|
||||
<div id="oh-input" placeholder="OH Identifier" style="display: none;">
|
||||
<div class='oh-button' type="radio" value="ST - OH ODM Agency Provider"
|
||||
onclick="validateForm()">Ohio EVV</div>
|
||||
<div class='oh-button' type="radio" value="ST - OH ODM AGENCY PROVIDER ALT EVV"
|
||||
onclick="validateForm()">Ohio Alt EVV</div>
|
||||
</div>
|
||||
<div id="ca-input" placeholder="CA Identifier" style="display: none;">
|
||||
<div class='ca-button' type="radio" value="ST - CA CHHS BOTH (PCS & HHCS)"
|
||||
onclick="validateForm()">Sandata EVV</div>
|
||||
<div class='ca-button' type="radio" value="ST - CA CHHS JE & ST - CA CHHS STATE"
|
||||
onclick="validateForm()">Sandata ATL EVV Aggregator</div>
|
||||
</div>
|
||||
<span class="sign-up-follow-up-error-label" id="oh-label">Please select your affiliation</span>
|
||||
|
||||
{% comment %} <button class="sign-up-follow-up-button" onclick="submitData()">Submit</button> {% endcomment %}
|
||||
<div class="sign-up-follow-up-button" onclick="submitData()">Submit</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</main>
|
||||
|
||||
<style>
|
||||
.sign-up-follow-up-image{
|
||||
max-width: 50%;
|
||||
}
|
||||
|
||||
#medcaid-id-input,
|
||||
#provider-id-input,
|
||||
#calEVV-input{
|
||||
border: 1px solid light-dark(rgb(118, 118, 118), rgb(133, 133, 133));
|
||||
border-radius: 2px;
|
||||
}
|
||||
|
||||
#oh-input,
|
||||
#ca-input {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
border: 0;
|
||||
margin-top: 10px;
|
||||
}
|
||||
|
||||
|
||||
#medicaid-id-label,
|
||||
#provider-id-label,
|
||||
#calEVV-label,
|
||||
#oh-label {
|
||||
color: red;
|
||||
display: none;
|
||||
}
|
||||
|
||||
.oh-button,
|
||||
.ca-button {
|
||||
border: 1px solid grey;
|
||||
border-radius: 2px;
|
||||
font-family: inherit;
|
||||
font-size: 100%;
|
||||
line-height: 1.15;
|
||||
margin: 0;
|
||||
margin-bottom: 5px;
|
||||
padding: 5px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.oh-button:hover,
|
||||
.ca-button:hover {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.oh-button:focus,
|
||||
.ca-button:focus {
|
||||
background: pink;
|
||||
}
|
||||
|
||||
.sign-up-dropdown,
|
||||
.sign-up-follow-up-input{
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.sign-up-dropdown{
|
||||
margin-top: 20px;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.sign-up-follow-up-input{
|
||||
height: 30px;
|
||||
margin-top: 1.1rem;
|
||||
}
|
||||
|
||||
.sign-up-follow-up-button{
|
||||
align-items: center;
|
||||
align-self: flex-end;
|
||||
background: #f2f4f5;
|
||||
border: 1px solid black;
|
||||
border-radius: 5px;
|
||||
cursor: pointer;
|
||||
display: flex;
|
||||
font-family: inherit;
|
||||
font-size: 100%;
|
||||
height: 30px;
|
||||
justify-content: center;
|
||||
margin-top: 10px;
|
||||
width: 90px;
|
||||
}
|
||||
|
||||
@media screen and (min-width: 768px){
|
||||
.np-box-header{
|
||||
height: 120px;
|
||||
padding-top: 30px;
|
||||
}
|
||||
|
||||
.np-box-content-container{
|
||||
margin-top: 0;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
<script>
|
||||
let fullPropsObj = {};
|
||||
let revisedPropsObj = {};
|
||||
|
||||
document.getElementById("sign-up-state-dropdown").addEventListener('change', (event) => {
|
||||
if(event.target.value == 'California'){
|
||||
document.querySelector('#calEVV-input').style.display = 'block';
|
||||
document.querySelector('#ca-input').style.display = 'block';
|
||||
} else {
|
||||
document.querySelector('#calEVV-input').style.display = 'none';
|
||||
document.querySelector('#calEVV-label').style.display = 'none';
|
||||
document.querySelector('#ca-input').style.display = 'none';
|
||||
document.querySelector('#ca-label').style.display = 'none';
|
||||
}
|
||||
if(event.target.value == 'Ohio'){
|
||||
document.querySelector('#oh-input').style.display = 'block';
|
||||
} else {
|
||||
document.querySelector('#oh-input').style.display = 'none';
|
||||
document.querySelector('#oh-label').style.display = 'none';
|
||||
}
|
||||
});
|
||||
|
||||
let digits = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9];
|
||||
|
||||
let validateForm = () => {
|
||||
let validForm = false;
|
||||
|
||||
if(event.target.placeholder){
|
||||
if(event.target.placeholder == 'Agency Name'){
|
||||
if(event.target.value == ''){
|
||||
fullPropsObj['agency_name'] = undefined;
|
||||
} else {
|
||||
fullPropsObj['agency_name'] = event.target.value;
|
||||
}
|
||||
}
|
||||
|
||||
if(event.target.placeholder == 'Agency ID # (Optional)'){
|
||||
if(event.target.value == ''){
|
||||
fullPropsObj['agency_id'] = undefined;
|
||||
} else {
|
||||
fullPropsObj['agency_id'] = event.target.value;
|
||||
}
|
||||
}
|
||||
|
||||
if(event.target.placeholder == 'Medicaid ID #'){
|
||||
if(event.target.value == ''){
|
||||
fullPropsObj['medicaid_id'] = undefined;
|
||||
document.querySelector('#medicaid-id-input').style.border = '1px solid light-dark(rgb(118, 118, 118), rgb(133, 133, 133))';
|
||||
document.querySelector('#medicaid-id-label').style.display = 'none';
|
||||
} else {
|
||||
let splitID = event.target.value.split('');
|
||||
let valid = true;
|
||||
|
||||
if(splitID.length >= 5 && splitID.length <= 12){
|
||||
for(let i = 0; i < splitID.length; i++){
|
||||
if(digits[splitID[i]] != splitID[i]){
|
||||
valid = false;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
valid = false;
|
||||
}
|
||||
|
||||
if(valid){
|
||||
fullPropsObj['medicaid_id'] = event.target.value;
|
||||
document.querySelector('#medicaid-id-input').style.border = '1px solid light-dark(rgb(118, 118, 118), rgb(133, 133, 133))';
|
||||
document.querySelector('#medicaid-id-label').style.display = 'none';
|
||||
} else {
|
||||
fullPropsObj['medicaid_id'] = undefined;
|
||||
document.querySelector('#medicaid-id-input').style.border = '1px solid red';
|
||||
document.querySelector('#medicaid-id-input').style.borderRadius = '2px';
|
||||
document.querySelector('#medicaid-id-label').style.display = 'block';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(event.target.placeholder == 'Provider ID #'){
|
||||
if(event.target.value == ''){
|
||||
fullPropsObj['provider_id'] = undefined;
|
||||
document.querySelector('#provider-id-input').style.border = '1px solid light-dark(rgb(118, 118, 118), rgb(133, 133, 133))';
|
||||
document.querySelector('#provider-id-label').style.display = 'none';
|
||||
} else {
|
||||
let splitID = event.target.value.split('');
|
||||
let valid = true;
|
||||
|
||||
if(splitID.length == 10){
|
||||
for(let i = 0; i < splitID.length; i++){
|
||||
if(digits[splitID[i]] != splitID[i]){
|
||||
valid = false;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
valid = false;
|
||||
}
|
||||
|
||||
if(valid){
|
||||
fullPropsObj['provider_id'] = event.target.value;
|
||||
document.querySelector('#provider-id-input').style.border = '1px solid light-dark(rgb(118, 118, 118), rgb(133, 133, 133))';
|
||||
document.querySelector('#provider-id-label').style.display = 'none';
|
||||
} else {
|
||||
fullPropsObj['provider_id'] = undefined;
|
||||
document.querySelector('#provider-id-input').style.border = '1px solid red';
|
||||
document.querySelector('#provider-id-input').style.borderRadius = '2px';
|
||||
document.querySelector('#provider-id-label').style.display = 'block';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(event.target.placeholder == 'CalEVV Identifier'){
|
||||
if(fullPropsObj['learner_state'] == 'California'){
|
||||
if(event.target.value == ''){
|
||||
fullPropsObj['cal_evv_id'] = undefined;
|
||||
document.querySelector('#calEVV-input').style.border = '1px solid light-dark(rgb(118, 118, 118), rgb(133, 133, 133))';
|
||||
document.querySelector('#calEVV-label').style.display = 'none';
|
||||
} else {
|
||||
let splitID = event.target.value.split('');
|
||||
let valid = true;
|
||||
|
||||
if(splitID.length == 10){
|
||||
for(let i = 0; i < splitID.length; i++){
|
||||
if(digits[splitID[i]] != splitID[i]){
|
||||
valid = false;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
valid = false;
|
||||
}
|
||||
|
||||
if(valid){
|
||||
fullPropsObj['cal_evv_id'] = event.target.value;
|
||||
document.querySelector('#calEVV-input').style.border = '1px solid light-dark(rgb(118, 118, 118), rgb(133, 133, 133))';
|
||||
document.querySelector('#calEVV-label').style.display = 'none';
|
||||
} else {
|
||||
fullPropsObj['cal_evv_id'] = undefined;
|
||||
document.querySelector('#calEVV-input').style.border = '1px solid red';
|
||||
document.querySelector('#calEVV-input').style.borderRadius = '2px';
|
||||
document.querySelector('#calEVV-label').style.display = 'block';
|
||||
}
|
||||
}
|
||||
} else {
|
||||
document.querySelector('#calEVV-input').style.border = '1px solid light-dark(rgb(118, 118, 118), rgb(133, 133, 133))';
|
||||
document.querySelector('#calEVV-label').style.display = 'none';
|
||||
}
|
||||
}
|
||||
}
|
||||
// Ohio Additional Options
|
||||
if(event.target.parentNode.getAttribute('placeholder') == 'OH Identifier'){
|
||||
if(fullPropsObj['learner_state'] == 'Ohio'){
|
||||
if(event.target.getAttribute('value') == ''){
|
||||
fullPropsObj['oh_group_name'] = undefined;
|
||||
document.querySelector('#oh-label').style.display = 'none';
|
||||
} else {
|
||||
for(let i = 0; i < event.target.parentNode.children.length; i++){
|
||||
event.target.parentNode.children[i].style.background = '#f2f4f5';
|
||||
}
|
||||
|
||||
event.target.style.background = 'rgb(242, 169, 0)';
|
||||
event.target.style.color = '#000';
|
||||
|
||||
let valid = true;
|
||||
|
||||
if(valid){
|
||||
fullPropsObj['oh_group_name'] = event.target.getAttribute('value');
|
||||
document.querySelector('#oh-label').style.display = 'none';
|
||||
} else {
|
||||
fullPropsObj['oh_group_name'] = undefined;
|
||||
document.querySelector('#oh-label').style.display = 'block';
|
||||
}
|
||||
}
|
||||
} else {
|
||||
fullPropsObj['oh_group_name'] = undefined;
|
||||
document.querySelector('#oh-label').style.display = 'none';
|
||||
}
|
||||
}
|
||||
|
||||
// California Additional Options
|
||||
if(event.target.parentNode.getAttribute('placeholder') == 'CA Identifier'){
|
||||
if(fullPropsObj['learner_state'] == 'California'){
|
||||
if(event.target.getAttribute('value') == ''){
|
||||
fullPropsObj['ca_group_name'] = undefined;
|
||||
document.querySelector('#ca-label').style.display = 'none';
|
||||
} else {
|
||||
for(let i = 0; i < event.target.parentNode.children.length; i++){
|
||||
event.target.parentNode.children[i].style.background = '#f2f4f5';
|
||||
}
|
||||
|
||||
event.target.style.background = 'rgb(242, 169, 0)';
|
||||
event.target.style.color = '#000';
|
||||
|
||||
let valid = true;
|
||||
|
||||
if(valid){
|
||||
fullPropsObj['ca_group_name'] = event.target.getAttribute('value');
|
||||
document.querySelector('#ca-label').style.display = 'none';
|
||||
} else {
|
||||
fullPropsObj['ca_group_name'] = undefined;
|
||||
document.querySelector('#ca-label').style.display = 'block';
|
||||
}
|
||||
}
|
||||
} else {
|
||||
fullPropsObj['ca_group_name'] = undefined;
|
||||
document.querySelector('#ca-label').style.display = 'none';
|
||||
}
|
||||
}
|
||||
|
||||
if(event.target.children[0]){
|
||||
if(event.target.children[0].textContent == 'Select a state'){
|
||||
// console.log(event.target.value)
|
||||
if(event.target.value == ''){
|
||||
fullPropsObj['learner_state'] = undefined;
|
||||
} else {
|
||||
fullPropsObj['learner_state'] = event.target.value;
|
||||
}
|
||||
}
|
||||
|
||||
if(event.target.children[0].textContent == 'Select a role'){
|
||||
if(event.target.value == ''){
|
||||
fullPropsObj['learner_role'] = undefined;
|
||||
} else {
|
||||
fullPropsObj['learner_role'] = event.target.value;
|
||||
}
|
||||
}
|
||||
}
|
||||
revisedPropsObj = {};
|
||||
let fullPropsObjKeyMap = Object.keys(fullPropsObj);
|
||||
|
||||
for(let i = 0; i < fullPropsObjKeyMap.length; i++){
|
||||
let currentKey = fullPropsObjKeyMap[i];
|
||||
if(fullPropsObj[currentKey] != undefined){
|
||||
revisedPropsObj[currentKey] = fullPropsObj[currentKey];
|
||||
}
|
||||
}
|
||||
|
||||
if(Object.keys(revisedPropsObj).length > 0){
|
||||
let validationFlag = true;
|
||||
let allRequiredFields = ['agency_name', 'medicaid_id', 'provider_id', 'learner_state', 'learner_role'];
|
||||
|
||||
for(let i = 0; i < allRequiredFields.length; i++){
|
||||
if(Object.keys(revisedPropsObj).indexOf(allRequiredFields[i]) == -1){
|
||||
validationFlag = false;
|
||||
} else {
|
||||
if(allRequiredFields[i] == 'learner_state' && revisedPropsObj[allRequiredFields[i]] == 'California'){
|
||||
if(Object.keys(revisedPropsObj).indexOf('cal_evv_id') == -1){
|
||||
validationFlag = false;
|
||||
document.querySelector('#calEVV-input').style.border = '1px solid red';
|
||||
document.querySelector('#calEVV-input').style.borderRadius = '2px';
|
||||
document.querySelector('#calEVV-label').style.display = 'block';
|
||||
} else {
|
||||
document.querySelector('#calEVV-input').style.border = '1px solid light-dark(rgb(118, 118, 118), rgb(133, 133, 133))';
|
||||
document.querySelector('#calEVV-label').style.display = 'none';
|
||||
}
|
||||
} else if(allRequiredFields[i] == 'learner_state' && revisedPropsObj[allRequiredFields[i]] == 'Ohio'){
|
||||
if(Object.keys(revisedPropsObj).indexOf('oh_group_name') == -1){
|
||||
validationFlag = false;
|
||||
document.querySelector('#oh-label').style.display = 'block';
|
||||
} else {
|
||||
document.querySelector('#oh-label').style.display = 'none';
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if(validationFlag){
|
||||
document.querySelector('.sign-up-follow-up-button').style.background = '#f2a900';
|
||||
document.querySelector('.sign-up-follow-up-button').style.color = '#4964a2';
|
||||
revisedPropsObj['successfully_completed_secondary_registration'] = true;
|
||||
|
||||
validForm = true;
|
||||
} else {
|
||||
document.querySelector('.sign-up-follow-up-button').style.background = '#f2f4f5';
|
||||
document.querySelector('.sign-up-follow-up-button').style.color = '#000';
|
||||
}
|
||||
} else {
|
||||
document.querySelector('.sign-up-follow-up-button').style.background = '#f2f4f5';
|
||||
document.querySelector('.sign-up-follow-up-button').style.color = '#000';
|
||||
}
|
||||
return validForm;
|
||||
}
|
||||
document.addEventListener('keyup', validateForm);
|
||||
document.getElementsByClassName("sign-up-follow-up-input")[0].addEventListener('change', validateForm);
|
||||
document.getElementById("sign-up-role-dropdown").addEventListener('change', validateForm);
|
||||
document.getElementById("sign-up-state-dropdown").addEventListener('change', validateForm);
|
||||
|
||||
let submitData = async () => {
|
||||
event.preventDefault();
|
||||
|
||||
if(validateForm()){
|
||||
let userID = '{{ current_person.id }}'
|
||||
let email = '{{ current_person.email }}'
|
||||
console.log('SUBMIT!')
|
||||
console.log(userID);
|
||||
|
||||
if(revisedPropsObj['learner_state'] != 'Ohio'){
|
||||
revisedPropsObj['oh_group_name'] = null;
|
||||
}
|
||||
|
||||
if(revisedPropsObj['learner_state'] != 'California'){
|
||||
revisedPropsObj['cal_evv_id'] = null;
|
||||
}
|
||||
|
||||
console.log(revisedPropsObj);
|
||||
|
||||
|
||||
function webhookCaller(){
|
||||
return new Promise(function(res, rej) {
|
||||
let xhr = new XMLHttpRequest();
|
||||
url = "https://webhooks.workato.com/webhooks/rest/0a1d61c1-421c-4160-a1ab-d29e79aee50e/secondary-registration-submitted";
|
||||
|
||||
xhr.addEventListener("load", e => {
|
||||
localStorage.setItem('completed-second-registration', true);
|
||||
window.location.replace('/app/dashboard');
|
||||
});
|
||||
|
||||
xhr.open("POST", url, true);
|
||||
xhr.send(JSON.stringify([{
|
||||
id: userID,
|
||||
email: email,
|
||||
type:'person_properties',
|
||||
attributes: {
|
||||
'properties': revisedPropsObj
|
||||
},
|
||||
}]))
|
||||
})
|
||||
}
|
||||
|
||||
try {
|
||||
await webhookCaller();
|
||||
} catch(err) {
|
||||
console.log(err)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
</script>
|
||||
@ -9,3 +9,17 @@
|
||||
{{ color_palette.header_font_hover_color }}
|
||||
{{ color_palette.header_color }}
|
||||
*/
|
||||
|
||||
|
||||
@media screen and (min-width: 768px){
|
||||
header{
|
||||
background: url(https://s3.amazonaws.com/static.northpass.com/sandata/sandataBanner.jpg) !important;
|
||||
background-color: #fff !important;
|
||||
background-position: center !important;
|
||||
background-repeat: no-repeat !important;
|
||||
}
|
||||
|
||||
.np-box-header{
|
||||
background: #FFF !important;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user