Skip to content

Commit e0a5c75

Browse files
committed
Release Candidate ~ Version 1.0
1 parent 77a0997 commit e0a5c75

File tree

7 files changed

+223
-43
lines changed

7 files changed

+223
-43
lines changed

backend/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "active_collab",
3-
"version": "0.1.2",
3+
"version": "1.0.0",
44
"description": "Active Collab Pro 17_Backend",
55
"main": "index.js",
66
"scripts": {

frontend/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "bluebox",
3-
"version": "0.0.0",
3+
"version": "1.0.0",
44
"license": "MIT",
55
"scripts": {
66
"ng": "ng",

frontend/src/app/dashboard-components/teammembers/teammembers.component.ts

Lines changed: 4 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -119,8 +119,6 @@ validate = true;
119119
.subscribe(res => {
120120
const teamData = res;
121121

122-
123-
if(teamData.data.teamDetails[0] == null){
124122
this.httpService.createNewTeam(this.teamid,this.username,this.projectid,this.doj);
125123
this.httpService.sendRequest(window.localStorage.getItem('user'),this.username,this.projectid,this.teamid,"pending");
126124

@@ -129,21 +127,10 @@ validate = true;
129127
document.getElementById("message").classList.add("alert-success");
130128
document.getElementById("message").classList.remove("alert-danger");
131129
document.getElementById('message').style.visibility = 'visible';
132-
133-
}else{
134-
if(teamData.data.teamDetails[0].teamId == this.teamid){
135-
document.getElementById("teamid").classList.add("invalid-input");
136-
this.action = "Oh snap!";
137-
this.details = "Change your Team Handle it is already taken, and try submitting again.";
138-
139-
document.getElementById("message").classList.remove("alert-success");
140-
document.getElementById("message").classList.add("alert-danger");
141-
document.getElementById('message').style.visibility = 'visible';
142-
143-
this.validate = false;
144-
}
145-
}
146-
130+
131+
},
132+
error => {
133+
this.router.navigate(['forbidden']);
147134
});
148135

149136

frontend/src/app/dashboard-components/update-profile/update-profile.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ <h2>Personal Details</h2>
7373
<input type="text" id="state" name="state" [(ngModel)]="state" class="form-control" placeholder="State">
7474
</div>
7575
<div class="form-group">
76-
<label for="country">Phone Number</label>
76+
<label for="country">Country</label>
7777
<input type="text" id="country" name="country" [(ngModel)]="country" class="form-control" placeholder="Country">
7878
</div>
7979
<div class="form-group">

frontend/src/app/signup-form/signup-form.component.css

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,3 +131,20 @@ label{
131131
}
132132

133133

134+
.csp:focus{
135+
border: 2px solid #1A237E;
136+
}
137+
138+
.invalid-input{
139+
border-bottom: 2px solid red;
140+
}
141+
142+
143+
.errorDetect{
144+
font-weight: 400;
145+
}
146+
147+
148+
.hidebutt{
149+
visibility: hidden;
150+
}

frontend/src/app/signup-form/signup-form.component.html

Lines changed: 26 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,16 @@ <h2>User Account Details</h2>
1212

1313
<div class="form-group">
1414
<label for="InputEmail">Email address</label>
15-
<input type="email" name="username" [(ngModel)]="username" class="form-control" aria-describedby="emailHelp" placeholder="Enter email">
15+
<input type="email" id="username" name="username" [(ngModel)]="username" class="form-control csp" aria-describedby="emailHelp" placeholder="Enter email">
1616
<small id="emailHelp" class="form-text text-muted">We'll never share your email with anyone else.</small>
1717
</div>
1818
<div class="form-group">
1919
<label for="password">Password</label>
20-
<input type="password" name="password" [(ngModel)]="password" class="form-control" placeholder="Password" >
20+
<input type="password" id="password" name="password" [(ngModel)]="password" class="form-control csp" placeholder="Password" >
2121
</div>
2222
<div class="form-group">
2323
<label for="confirm">Confirm Password</label>
24-
<input type="password" name="confirm" [(ngModel)]="confirm" class="form-control" placeholder="Confirm Password" >
24+
<input type="password" id="cpassword" name="confirm" [(ngModel)]="confirm" class="form-control csp" placeholder="Confirm Password" >
2525
</div>
2626

2727
<br>
@@ -32,20 +32,20 @@ <h2>Commercial Details</h2>
3232

3333
<div class="form-group">
3434
<label for="InputEmail">User Id</label>
35-
<input type="text" name="userid" [(ngModel)]="userid" class="form-control" aria-describedby="useridHelp" placeholder="User Id">
35+
<input type="text" id="userid" name="userid" [(ngModel)]="userid" class="form-control csp" aria-describedby="useridHelp" placeholder="User Id">
3636
<small id="useridHelp" class="form-text text-muted">Please enter your Employee ID or Customer ID.</small>
3737
</div>
3838
<div class="form-group">
3939
<label for="usertype">Service</label>
40-
<input type="text" name="usertype" [(ngModel)]="usertype" class="form-control" placeholder="User Type(Project Manager, Frontend Developer, etc)">
40+
<input type="text" id="usertype" name="usertype" [(ngModel)]="usertype" class="form-control csp" placeholder="User Type(Project Manager, Frontend Developer, etc)">
4141
</div>
4242
<div class="form-group">
43-
<label for="department">Last Name</label>
44-
<input type="text" name="department" [(ngModel)]="department" class="form-control" placeholder="Department">
43+
<label for="department">Department</label>
44+
<input type="text" id="department" name="department" [(ngModel)]="department" class="form-control csp" placeholder="Department">
4545
</div>
4646
<div class="form-group">
4747
<label for="company">Company</label>
48-
<input type="text" name="company" [(ngModel)]="company" class="form-control" placeholder="Company Name">
48+
<input type="text" id="company" name="company" [(ngModel)]="company" class="form-control csp" placeholder="Company Name">
4949
</div>
5050
</div>
5151
<!-- Flex Item -->
@@ -55,39 +55,39 @@ <h2>Personal Details</h2>
5555

5656
<div class="form-group">
5757
<label for="firstName">First Name</label>
58-
<input type="text" name="firstname" [(ngModel)]="firstname" class="form-control" placeholder="First Name">
58+
<input type="text" id="firstname" name="firstname" [(ngModel)]="firstname" class="form-control csp" placeholder="First Name">
5959
</div>
6060
<div class="form-group">
6161
<label for="lastName">Last Name</label>
62-
<input type="text" name="lastname" [(ngModel)]="lastname" class="form-control" placeholder="Last Name">
62+
<input type="text" id="lastname" name="lastname" [(ngModel)]="lastname" class="form-control csp" placeholder="Last Name">
6363
</div>
6464
<div class="form-group">
6565
<label for="dob">Date Of Birth</label>
66-
<input type="text" name="dob" [(ngModel)]="dob" class="form-control" placeholder="Please enter date in this format YYYY-MM-DDTHH:MM:SS.SSSSZ">
66+
<input type="text" id="dob" name="dob" [(ngModel)]="dob" class="form-control csp" placeholder="Please enter date in this format YYYY-MM-DDTHH:MM:SS.SSSSZ">
6767
</div>
6868
<div class="form-group">
6969
<label for="phone">Phone Number</label>
70-
<input type="text" name="phone" [(ngModel)]="phone" class="form-control" placeholder="Phone Number">
70+
<input type="text" id="phone" name="phone" [(ngModel)]="phone" class="form-control csp" placeholder="Phone Number">
7171
</div>
7272
<div class="form-group">
7373
<label for="address">Address Line 1</label>
74-
<input type="text" name="address" [(ngModel)]="address" class="form-control" placeholder="Address Line 1">
74+
<input type="text" id="address" name="address" [(ngModel)]="address" class="form-control csp" placeholder="Address Line 1">
7575
</div>
7676
<div class="form-group">
7777
<label for="city">City</label>
78-
<input type="text" name="city" [(ngModel)]="city" class="form-control" placeholder="City">
78+
<input type="text" id="city" name="city" [(ngModel)]="city" class="form-control csp" placeholder="City">
7979
</div>
8080
<div class="form-group">
8181
<label for="state">State</label>
82-
<input type="text" name="state" [(ngModel)]="state" class="form-control" placeholder="State">
82+
<input type="text" id="state" name="state" [(ngModel)]="state" class="form-control csp" placeholder="State">
8383
</div>
8484
<div class="form-group">
85-
<label for="country">Phone Number</label>
86-
<input type="text" name="country" [(ngModel)]="country" class="form-control" placeholder="Country">
85+
<label for="country">Country</label>
86+
<input type="text" id="country" name="country" [(ngModel)]="country" class="form-control csp" placeholder="Country">
8787
</div>
8888
<div class="form-group">
8989
<label for="zip">PIN/ZIP Code</label>
90-
<input type="text" name="zip" [(ngModel)]="zip" class="form-control" placeholder="PIN/ZIP Code">
90+
<input type="text" id="zip" name="zip" [(ngModel)]="zip" class="form-control csp" placeholder="PIN/ZIP Code">
9191
</div>
9292
</div>
9393
<!-- Flex Item -->
@@ -97,13 +97,19 @@ <h2>Personal Details</h2>
9797
<br>
9898
<div class="form-check was-validated">
9999
<label class="form-check-label custom-control custom-checkbox">
100-
<input type="checkbox" class="form-check-input custom-control-input" required>
100+
<input type="checkbox" id="chek" class="form-check-input custom-control-input" required>
101101
<span class="custom-control-indicator"></span>
102102
<span class="custom-control-description">I have read the all the <a class="terms" href="#">terms and conditions</a> carefully, as stated by your company and will abide by them.</span>
103103
</label>
104104
</div>
105105
<br>
106-
<button type="button" class="btn btn-primary" (click)='validateSignUp()' >Sign Up</button>
106+
<p class="errorDetect">{{action}}</p>
107+
<br>
108+
<p style="padding-left: 450px;">
109+
<re-captcha (resolved)="resolved($event)" siteKey="6Lc_LzUUAAAAAJaPaGSXt3-_u9nhBYP0t9kx0C3_"></re-captcha>
110+
</p>
111+
<br>
112+
<button type="button" id="signup" class="btn btn-primary hidebutt" (click)='validateSignUp()' >Sign Up</button>
107113

108114
<!-- Sign Up Form Ends Here -->
109115
</form>

frontend/src/app/signup-form/signup-form.component.ts

Lines changed: 173 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,16 +31,186 @@ export class SignupFormComponent{
3131
state:string;
3232
country:string;
3333
zip:string;
34+
35+
d:any = new Date();
36+
formattedDate:any = this.d.toISOString();
37+
action:string;
38+
details:string;
39+
validate = true;
40+
errors:any;
3441

35-
constructor(private _httpWebService: HttpWebApiService, private router: Router) { }
42+
constructor(private _httpWebService: HttpWebApiService, private router: Router) {
43+
this.action = "";
44+
}
45+
46+
47+
48+
resolved(captchaResponse: string) {
49+
if(captchaResponse != null){
50+
document.getElementById("signup").classList.remove("hidebutt");
51+
}else{
52+
document.getElementById("signup").classList.add("hidebutt");
53+
}
54+
}
3655

3756

3857

3958

4059
validateSignUp(){
4160

42-
this.router.navigate(['signupsuccess']);
61+
document.getElementById("username").classList.remove("invalid-input");
62+
document.getElementById("password").classList.remove("invalid-input");
63+
document.getElementById("cpassword").classList.remove("invalid-input");
64+
document.getElementById("userid").classList.remove("invalid-input");
65+
document.getElementById("usertype").classList.remove("invalid-input");
66+
document.getElementById("company").classList.remove("invalid-input");
67+
68+
document.getElementById("department").classList.remove("invalid-input");
69+
document.getElementById("firstname").classList.remove("invalid-input");
70+
document.getElementById("lastname").classList.remove("invalid-input");
71+
document.getElementById("dob").classList.remove("invalid-input");
72+
document.getElementById("phone").classList.remove("invalid-input");
73+
document.getElementById("address").classList.remove("invalid-input");
74+
document.getElementById("city").classList.remove("invalid-input");
75+
document.getElementById("state").classList.remove("invalid-input");
76+
document.getElementById("country").classList.remove("invalid-input");
77+
document.getElementById("zip").classList.remove("invalid-input");
78+
79+
80+
81+
if(this.username == null || this.username == ""){
82+
document.getElementById("username").classList.add("invalid-input");
83+
84+
this.action = "Oh snap! Provide an Email id and try submitting again.";
85+
this.validate = false;
86+
}
87+
else{
88+
if(EMAIL_REGEX.test(this.username))
89+
this.validate = true;
90+
91+
else{
92+
document.getElementById("username").classList.add("invalid-input");
93+
94+
this.action = "Oh snap! Change your email id and try submitting again.";
95+
this.validate = false;
96+
}
97+
}
98+
99+
console.log(this.username);
100+
101+
if(this.password == null || this.password == ""){
102+
document.getElementById("password").classList.add("invalid-input");
103+
this.action = "Enter a Valid password.";
104+
this.validate = false;
105+
}else{
106+
if(this.confirm == null || this.confirm == ""){
107+
document.getElementById("cpassword").classList.add("invalid-input");
108+
this.action = "Enter a Valid password.";
109+
this.validate = false;
110+
}else{
111+
if(this.password != this.confirm){
112+
document.getElementById("password").classList.add("invalid-input");
113+
document.getElementById("cpassword").classList.add("invalid-input");
114+
this.action = "The passwords do not match.";
115+
this.validate = false;
116+
}
117+
}
118+
}
119+
120+
121+
if(this.department == null || this.department == ""){
122+
document.getElementById("department").classList.add("invalid-input");
123+
124+
this.action = "Oh snap! Enter your department and try submitting again.";
125+
this.validate = false;
126+
}
127+
if(this.firstname == null || this.firstname == ""){
128+
document.getElementById("firstname").classList.add("invalid-input");
129+
130+
this.action = "Oh snap! Enter your first name and try submitting again.";
131+
this.validate = false;
132+
}
133+
if(this.lastname == null || this.lastname == ""){
134+
document.getElementById("lastname").classList.add("invalid-input");
135+
136+
this.action = "Oh snap! Enter your last name and try submitting again.";
137+
this.validate = false;
138+
}
139+
if(this.dob == null || this.dob == ""){
140+
document.getElementById("dob").classList.add("invalid-input");
141+
142+
this.action = "Oh snap! Enter your date of birth and try submitting again.";
143+
this.validate = false;
144+
}
145+
if(this.phone == null || this.phone == ""){
146+
document.getElementById("phone").classList.add("invalid-input");
147+
148+
this.action = "Oh snap! Enter your phone number and try submitting again.";
149+
this.validate = false;
150+
}
151+
if(this.address == null || this.address == ""){
152+
document.getElementById("address").classList.add("invalid-input");
153+
154+
this.action = "Oh snap! Enter your address and try submitting again.";
155+
this.validate = false;
156+
}
157+
if(this.city == null || this.city == ""){
158+
document.getElementById("city").classList.add("invalid-input");
159+
160+
this.action = "Oh snap! Enter your city and try submitting again.";
161+
this.validate = false;
162+
}
163+
if(this.state == null || this.state == ""){
164+
document.getElementById("state").classList.add("invalid-input");
165+
166+
this.action = "Oh snap! Enter your state and try submitting again.";
167+
this.validate = false;
168+
}
169+
if(this.country == null || this.country == ""){
170+
document.getElementById("country").classList.add("invalid-input");
171+
172+
this.action = "Oh snap! Enter your country and try submitting again.";
173+
this.validate = false;
174+
}
175+
if(this.zip == null || this.zip == ""){
176+
document.getElementById("zip").classList.add("invalid-input");
177+
178+
this.action = "Oh snap! Enter your zip and try submitting again.";
179+
this.validate = false;
180+
}
181+
182+
if(this.userid == null || this.userid == ""){
183+
document.getElementById("userid").classList.add("invalid-input");
184+
185+
this.action = "Oh snap! Enter your userid and try submitting again.";
186+
this.validate = false;
187+
}
188+
if(this.usertype == null || this.usertype == ""){
189+
document.getElementById("usertype").classList.add("invalid-input");
190+
191+
this.action = "Oh snap! Enter your usertype and try submitting again.";
192+
this.validate = false;
193+
}
194+
if(this.company == null || this.company == ""){
195+
document.getElementById("company").classList.add("invalid-input");
196+
197+
this.action = "Oh snap! Enter your company and try submitting again.";
198+
this.validate = false;
199+
}
200+
201+
202+
if(((<HTMLInputElement>document.getElementById('chek')).checked == false)&&(this.validate == true)){
203+
this.action = "Oh snap! Please accept the terms and conditions.";
204+
this.validate = false;
205+
}
206+
43207

44-
//this._httpWebService.createNewUser(this.userid, this.username, this.password, this.firstname, this.lastname, this.dob, this.phone, this.company, this.department, this.usertype, this.address, this.city, this.state, this.country, this.zip);
208+
if(this.validate){
209+
210+
this._httpWebService.createNewUser(this.userid, this.username, this.password, this.firstname, this.lastname, this.dob, this.phone, this.company, this.department, this.usertype, this.address, this.city, this.state, this.country, this.zip);
211+
this._httpWebService.createNews(window.localStorage.getItem('user'),this.firstname,this.formattedDate,"Profile Update ", "Updated profile");
212+
this.router.navigate(['signupsuccess']);
213+
214+
}
45215
}
46216
}

0 commit comments

Comments
 (0)