Add Clinical Meteor packages to Lesion Tracker
This commit is contained in:
1 parent
383b4ff4c0
commit
b2fa6ead3b
56 files changed
+2355
-9
No files matched your search
@@ -0,0 +1,22 @@
|
||||
// async version calls method on the server
|
||||
exports.command = function () {
|
||||
var client = this;
|
||||
|
||||
this
|
||||
.timeoutsAsyncScript(5000)
|
||||
.executeAsync(function (data, meteorCallback) {
|
||||
//return HipaaLogger.logEventObject(data);
|
||||
Meteor.call("dropEntryUsers", data, function (meteorError, meteorResult) {
|
||||
var response = (meteorError ? {
|
||||
error: meteorError
|
||||
} : {
|
||||
result: meteorResult
|
||||
});
|
||||
meteorCallback(response);
|
||||
});
|
||||
}, [], function (result) {
|
||||
//console.log("result.value", result.value);
|
||||
//client.assert.ok(result.value);
|
||||
}).pause(1000);
|
||||
return this;
|
||||
};
|
||||
@@ -0,0 +1,11 @@
|
||||
|
||||
// resetEntry.js
|
||||
exports.command = function () {
|
||||
|
||||
this
|
||||
.timeoutsAsyncScript(5000)
|
||||
.executeAsync(function (data, meteorCallback) {
|
||||
ActiveEntry.reset();
|
||||
}, []).pause(1000);
|
||||
return this;
|
||||
};
|
||||
@@ -0,0 +1,37 @@
|
||||
exports.command = function (email, password, fullName) {
|
||||
|
||||
this.verify.elementPresent("#entrySignUp");
|
||||
|
||||
if (email) {
|
||||
this
|
||||
.verify.elementPresent("#signUpPageEmailInput")
|
||||
.clearValue("#signUpPageEmailInput")
|
||||
.setValue("#signUpPageEmailInput", email);
|
||||
}
|
||||
|
||||
|
||||
if (password) {
|
||||
this
|
||||
.verify.elementPresent("#signUpPagePasswordInput")
|
||||
.clearValue("#signUpPagePasswordInput")
|
||||
.setValue("#signUpPagePasswordInput", password)
|
||||
|
||||
.verify.elementPresent("#signUpPagePasswordConfirmInput")
|
||||
.clearValue("#signUpPagePasswordConfirmInput")
|
||||
.setValue("#signUpPagePasswordConfirmInput", password);
|
||||
}
|
||||
|
||||
|
||||
if (fullName) {
|
||||
this
|
||||
.verify.elementPresent("#signUpPageFullNameInput")
|
||||
.clearValue("#signUpPageFullNameInput")
|
||||
.setValue("#signUpPageFullNameInput", fullName);
|
||||
}
|
||||
|
||||
|
||||
this.click("#signUpPageJoinNowButton").pause(300);
|
||||
|
||||
|
||||
return this;
|
||||
};
|
||||
@@ -0,0 +1,31 @@
|
||||
exports.command = function (email, password, fullName, message) {
|
||||
this
|
||||
.verify.elementPresent("#entrySignUp")
|
||||
.verify.elementPresent("#signUpPageTitle")
|
||||
.verify.elementPresent("#signUpPageMessage")
|
||||
.verify.elementPresent("#signUpPageFullNameInput")
|
||||
.verify.elementPresent("#signUpPageEmailInput")
|
||||
.verify.elementPresent("#signUpPagePasswordInput")
|
||||
.verify.elementPresent("#signUpPagePasswordConfirmInput")
|
||||
|
||||
.verify.elementPresent("#signUpPageJoinNowButton")
|
||||
.verify.elementPresent("#signUpPageSignInButton");
|
||||
|
||||
if (email) {
|
||||
this.verify.containsText("#signUpPageEmailInput", email);
|
||||
}
|
||||
if (password) {
|
||||
this.verify.containsText("#signUpPagePasswordInput", password)
|
||||
.verify.containsText("#signUpPagePasswordConfirmInput", password);
|
||||
}
|
||||
if (fullName) {
|
||||
this.verify.containsText("#signUpPageFullNameInput", fullName);
|
||||
}
|
||||
if (message) {
|
||||
this.verify.elementPresent("#errorMessages")
|
||||
.verify.containsText("#errorMessages", message);
|
||||
}
|
||||
|
||||
|
||||
return this;
|
||||
};
|
||||
@@ -0,0 +1,63 @@
|
||||
<template name="entrySignUp">
|
||||
<div id="entrySignUp" class="page entryPage" style="{{getOpacityWithCorner}}">
|
||||
|
||||
<div class="content-scrollable">
|
||||
<div class="wrapper-auth">
|
||||
{{#if logoIsDisplayed}}
|
||||
<div id="entryAppLogo" class="entryLogo" style="background-image: url('{{logoUrl}}')"></div>
|
||||
{{/if}}
|
||||
|
||||
<h1 id="signUpPageTitle" class="title-auth">Join.</h1>
|
||||
<div id="signUpPageMessage" class="subtitle-auth" style="{{getSignUpMessageColor}}">{{getSignUpMessage}}</div>
|
||||
|
||||
<form>
|
||||
{{#if errorMessages}}
|
||||
<div id="errorMessages" class="list-errors">
|
||||
{{#each errorMessages}}
|
||||
<div class="alert alert-danger list-item">{{this}}</div>
|
||||
{{/each}}
|
||||
</div>
|
||||
{{/if}}
|
||||
|
||||
<div class="input-symbol ">
|
||||
<input id="signUpPageFullNameInput" type="text" name="fullName" placeholder="Full Name" style="{{getFullNameStyling}}" />
|
||||
<i class="fa fa-user" title="Full Name"></i>
|
||||
</div>
|
||||
<br>
|
||||
<br>
|
||||
|
||||
<div class="input-symbol">
|
||||
<input id="signUpPageEmailInput" type="email" name="email" placeholder="Email Address" style="{{getEmailStyling}}" />
|
||||
<i class="fa fa-envelope-o" title="Your Email"></i>
|
||||
</div>
|
||||
<br>
|
||||
<br>
|
||||
|
||||
<div class="input-symbol ">
|
||||
<input id="signUpPagePasswordInput" type="password" name="password" placeholder="Password" style="{{getPasswordStyling}}" />
|
||||
<span class="fa fa-lock" title="Password"></span>
|
||||
<!-- <span class="icon-lock" title="Password"></span> -->
|
||||
</div>
|
||||
<br>
|
||||
<br>
|
||||
|
||||
<div class="input-symbol">
|
||||
<input id="signUpPagePasswordConfirmInput" type="password" name="confirm" placeholder="Confirm Password" style="{{getConfirmPasswordStyling}}" />
|
||||
<span class="fa fa-lock" title="Confirm Password"></span>
|
||||
<!-- <span class="icon-lock" title="Confirm Password"></span> -->
|
||||
</div>
|
||||
</form>
|
||||
<br>
|
||||
<br>
|
||||
<button id="signUpPageJoinNowButton" type="submit" class="btn-primary btn-main btn-large" style="{{getButtonColor}}">Join Now</button>
|
||||
|
||||
<br>
|
||||
<br>
|
||||
<button id="signUpPageSignInButton" class="btn-gray btn-main btn-large">Have an account? Sign in</button>
|
||||
|
||||
</div>
|
||||
|
||||
<!-- <a id="signUpPageSignInButton" href="{{pathFor 'entrySignIn'}}" class="link-auth-alt">Have an account? Sign in</a> -->
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
+139
@@ -0,0 +1,139 @@
|
||||
//==================================================================================================
|
||||
// ROUTER
|
||||
|
||||
Router.route('/entrySignUp', {
|
||||
template: 'entrySignUp',
|
||||
name: 'entrySignUp'
|
||||
});
|
||||
Router.route('/sign-up', {
|
||||
template: 'entrySignUp',
|
||||
name: 'signUpRoute'
|
||||
});
|
||||
|
||||
//==================================================================================================
|
||||
|
||||
|
||||
|
||||
Template.entrySignUp.helpers({
|
||||
getSignUpMessageColor: function (){
|
||||
if (ActiveEntry.errorMessages.get('signInError')) {
|
||||
return "color: #a94442; background-color: #f2dede; border-color: #ebccd1;"
|
||||
} else {
|
||||
return "color: black;"
|
||||
}
|
||||
},
|
||||
getSignUpMessage: function (){
|
||||
if (ActiveEntry.errorMessages.get('signInError')) {
|
||||
return ActiveEntry.errorMessages.get('signInError');
|
||||
} else {
|
||||
return Session.get('defaultSignInMessage');
|
||||
}
|
||||
},
|
||||
getButtonText: function () {
|
||||
if (ActiveEntry.errorMessages.get('signInError')) {
|
||||
return ActiveEntry.errorMessages.get('signInError').message;
|
||||
} else {
|
||||
return "Sign In";
|
||||
}
|
||||
},
|
||||
getEmailStyling: function () {
|
||||
if (ActiveEntry.errorMessages.equals('email', "Email is required")) {
|
||||
return "border: 1px solid #a94442";
|
||||
} else if (ActiveEntry.errorMessages.equals('email', "Email is poorly formatted")) {
|
||||
return "border: 1px solid #f2dede";
|
||||
} else if (ActiveEntry.errorMessages.equals('email', "Email present")) {
|
||||
return "border: 1px solid green";
|
||||
} else {
|
||||
return "border: 1px solid gray";
|
||||
}
|
||||
},
|
||||
getPasswordStyling: function () {
|
||||
if (ActiveEntry.errorMessages.equals('password', "Password is required")) {
|
||||
return "border: 1px solid #a94442";
|
||||
} else if (ActiveEntry.errorMessages.equals('password', "Password is weak")) {
|
||||
return "border: 1px solid #f2dede";
|
||||
} else if (ActiveEntry.errorMessages.equals('password', "Password present")) {
|
||||
return "border: 1px solid green";
|
||||
} else {
|
||||
return "border: 1px solid gray";
|
||||
}
|
||||
},
|
||||
getConfirmPasswordStyling: function () {
|
||||
if (ActiveEntry.errorMessages.equals('confirm', "Password is required")) {
|
||||
return "border: 1px solid #a94442";
|
||||
} else if (ActiveEntry.errorMessages.equals('confirm', "Password is weak")) {
|
||||
return "border: 1px solid #f2dede";
|
||||
} else if (ActiveEntry.errorMessages.equals('confirm', "Passwords match")) {
|
||||
return "border: 1px solid green";
|
||||
} else {
|
||||
return "border: 1px solid gray";
|
||||
}
|
||||
},
|
||||
getFullNameStyling: function () {
|
||||
if (ActiveEntry.errorMessages.equals('fullName', "Name is required")) {
|
||||
return "border: 1px solid #a94442";
|
||||
} else if (ActiveEntry.errorMessages.equals('fullName', "Name is probably not complete")) {
|
||||
return "border: 1px solid #f2dede";
|
||||
} else if (ActiveEntry.errorMessages.equals('fullName', "Name present")) {
|
||||
return "border: 1px solid green";
|
||||
} else {
|
||||
return "border: 1px solid gray";
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
Template.entrySignUp.events({
|
||||
"click #signUpPageSignInButton": function (event) {
|
||||
event.preventDefault();
|
||||
Router.go('/entrySignIn');
|
||||
},
|
||||
'change, keyup #signUpPageEmailInput': function (event, template) {
|
||||
var email = $('[name="email"]').val();
|
||||
|
||||
ActiveEntry.verifyEmail(email);
|
||||
ActiveEntry.errorMessages.set('signInError', null);
|
||||
},
|
||||
'change, keyup #signUpPagePasswordInput': function (event, template) {
|
||||
var password = $('[name="password"]').val();
|
||||
|
||||
ActiveEntry.verifyPassword(password);
|
||||
ActiveEntry.errorMessages.set('signInError', null);
|
||||
},
|
||||
'change, keyup #signUpPagePasswordConfirmInput': function (event, template) {
|
||||
|
||||
var password = $('[name="password"]').val();
|
||||
var confirmPassword = $('[name="confirm"]').val();
|
||||
// var password = $('#signUpPagePasswordInput').val();
|
||||
// var confirmPassword = $('#signUpPagePasswordConfirmInput').val();
|
||||
|
||||
ActiveEntry.verifyConfirmPassword(password, confirmPassword);
|
||||
ActiveEntry.errorMessages.set('signInError', null);
|
||||
},
|
||||
'change, keyup #signUpPageFullNameInput': function (event, template) {
|
||||
var fullName = template.$('[name="fullName"]').val();
|
||||
|
||||
ActiveEntry.verifyFullName(fullName);
|
||||
ActiveEntry.errorMessages.set('signInError', null);
|
||||
},
|
||||
// TODO: this is outdated, and should be changed to match the signature/pattern in entrySignIn
|
||||
'click #signUpPageJoinNowButton': function (event, template) {
|
||||
event.preventDefault();
|
||||
|
||||
ActiveEntry.errorMessages.set('signInError', null);
|
||||
ActiveEntry.verifyPassword(event, template);
|
||||
|
||||
var newUser = {
|
||||
fullName: template.$('[name="fullName"]').val(),
|
||||
email: template.$('[name="email"]').val(),
|
||||
password: template.$('[name="password"]').val(),
|
||||
confirm: template.$('[name="confirm"]').val()
|
||||
};
|
||||
|
||||
ActiveEntry.signUp(
|
||||
newUser.email,
|
||||
newUser.password,
|
||||
newUser.confirm,
|
||||
newUser.fullName
|
||||
);
|
||||
}
|
||||
});
|
||||
@@ -0,0 +1,7 @@
|
||||
#entrySignUp{
|
||||
padding: 40px;
|
||||
input{
|
||||
padding-left: 40px !important;
|
||||
color: black;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user