Commit 49987265 by Muhammad Usman

Code Review Fixes - admin guard fix pending

parent 9b4b9581
...@@ -7,6 +7,7 @@ import { ApiService } from './oneit/services/api.service'; ...@@ -7,6 +7,7 @@ import { ApiService } from './oneit/services/api.service';
import { EnumService } from './oneit/services/enum.service'; import { EnumService } from './oneit/services/enum.service';
import { SearchService } from './oneit/services/search.service'; import { SearchService } from './oneit/services/search.service';
import { UtilsService } from './oneit/services/utils.service'; import { UtilsService } from './oneit/services/utils.service';
import { environment } from '../environments/environment';
@Injectable() @Injectable()
...@@ -56,7 +57,12 @@ export class AppService { ...@@ -56,7 +57,12 @@ export class AppService {
); );
} }
socicalMediaLogin(svc, params) { socicalMediaLogin(type) {
const params = {
environment: environment.envName,
nextPage: window.location.href.split('/#/')[0] + '/#/my-career-web/dashboard/home'
};
const svc = type === 'linkedIn' ? 'LoginWithLinkedIn' : 'LoginWithGoogle';
return this.apiService.post('svc/' + svc , params).map( return this.apiService.post('svc/' + svc , params).map(
data => { data => {
if (this.utilsService.isSuccessfulResponse(data)) { if (this.utilsService.isSuccessfulResponse(data)) {
......
...@@ -7,12 +7,12 @@ ...@@ -7,12 +7,12 @@
</div> </div>
<div class="header-actions"> <div class="header-actions">
<span class="auto-saved">Auto saved 1 min ago</span> <span class="auto-saved" *ngIf="autoSaveLabel">Auto saved {{autoSaveLabel}}</span>
<button pButton label="Save & exit" class="ui-button-info"></button> <button pButton label="Save & exit" (click)="exit()" class="ui-button-info"></button>
</div> </div>
</div> </div>
<p-progressBar [value]="20"></p-progressBar> <p-progressBar [value]="workPreferenceQuestion.Percentage"></p-progressBar>
<div class="assessment-body container"> <div class="assessment-body container">
...@@ -23,13 +23,14 @@ ...@@ -23,13 +23,14 @@
</div> </div>
<div class="assessment-body-description"> <div class="assessment-body-description">
A job isn't just about what one does, but the environment where one does it. This questionnaire will help us both learn what's most important to you in a workplace environment. There are no right or wrong answers, so please choose what best fits you (not what you think might be right for a particular job). {{workPreferenceQuestion?.IntroductoryText}}
</div> </div>
<div class="assessment-body-question-wrapper mc-card"> <div class="assessment-body-question-wrapper mc-card">
<app-overlay [isActive]="isLoading"></app-overlay>
<div class="question-completed">0%</div> <div class="question-completed">{{workPreferenceQuestion?.Percentage}}%</div>
<div class="answer-options"> <div class="answer-options">
<div class="answer-option"> <div class="answer-option">
......
import { Component, OnInit } from '@angular/core'; import { Component, OnDestroy, OnInit } from '@angular/core';
import { BaseComponent } from '../../base/base.component'; import { BaseComponent } from '../../base/base.component';
import * as moment from 'moment';
import { WorkPreferenceQuestionModel } from '../../models/work-preference-question.model';
import { takeUntil } from 'rxjs/operators';
import { AssessmentService } from '../../services/assessment.service';
import { Router } from '@angular/router';
import { HelperService } from '../../services/helper.service';
@Component({ @Component({
selector: 'app-work-preference', selector: 'app-work-preference',
...@@ -7,13 +13,66 @@ import { BaseComponent } from '../../base/base.component'; ...@@ -7,13 +13,66 @@ import { BaseComponent } from '../../base/base.component';
styleUrls: ['./work-preference.component.scss'] styleUrls: ['./work-preference.component.scss']
}) })
export class WorkPreferenceComponent extends BaseComponent implements OnInit { export class WorkPreferenceComponent extends BaseComponent implements OnInit, OnDestroy {
constructor() { workPreferenceQuestion = new WorkPreferenceQuestionModel();
assocs = ['CultureElement'];
answerScales = [];
autoSaveInterval;
autoSavedOn;
autoSaveLabel = '';
constructor(
private as: AssessmentService,
private hs: HelperService,
private r: Router
) {
super(); super();
} }
ngOnInit() { ngOnInit() {
this.initiateWorkPreference();
this.setAutoSaveInterval();
} }
initiateWorkPreference(): void {
this.isLoading = true;
this.as.getWorkPreferences(this.assocs)
.pipe(takeUntil(this.componentInView))
.subscribe(response => {
console.log(response);
this.isLoading = false;
this.autoSavedOn = new Date();
if (response.length > 0) {
this.workPreferenceQuestion = response[0];
}
}, err => {
this.isLoading = false;
this.hs.handleHttpError(err);
});
}
setAutoSaveInterval(): void {
if (!this.autoSaveInterval) {
setInterval(() => {
this.autoSave();
}, 60000);
}
}
autoSave(): void {
this.autoSaveLabel = moment(this.autoSavedOn).fromNow();
}
exit(): void {
this.r.navigate(['/my-career-web/dashboard/home']);
}
ngOnDestroy(): void {
super.ngOnDestroy();
if (this.autoSaveInterval) {
clearInterval(this.autoSaveInterval);
}
}
} }
<div class="bck-link mc-nav-link" routerLink="/my-career-web/auth/login"><i class="fa fa-chevron-left"></i><span>Back</span></div> <div class="bck-link mc-nav-link" routerLink="/my-career-web/auth/login"><i class="fa fa-chevron-left"></i><span>Back</span></div>
<div class="row login-wrapper"> <div class="row auth-wrapper">
<div class="col-md-offset-4 col-md-4"> <div class="col-md-offset-4 col-md-4">
<div class="mc-login-logo d-flex justify-content-center"> <div class="mc-auth-logo d-flex justify-content-center">
<img src="assets/my-career-web/images/MATCHD_LOGO.jpg" alt=""> <img src="assets/my-career-web/images/MATCHD_LOGO.jpg" alt="">
</div> </div>
<div class="title-goes-here">Know your natural strengths.</div> <div class="title-goes-here">Know your natural strengths.</div>
<div class="subtitle-giving-cont">Empowering career seekers to get the right job and thrive.</div> <div class="subtitle-giving-cont">Empowering career seekers to get the right job and thrive.</div>
<form class="login-form position-relative" #form="ngForm"> <form class="auth-form position-relative" #form="ngForm">
<div class="form-group" *ngIf="!emailSent"> <div class="form-group" *ngIf="!emailSent">
<label>Email Address</label> <label>Email Address</label>
<app-form-control> <app-form-control>
......
@import "~styles/my-career-styles/variables";
/* @CodeReview : G002 : Rather than creating same css again, please reuse it, (duplicate css classes in here and login.component.scss & register.component.scss, reset-password.component.scss)
*/
.bck-link {
position: absolute;
color: #12A8DE;
line-height: 21px;
z-index: 1000;
top: 15px;
left: 25px;
border: 0;
display: flex;
align-items: center;
span {
font-family: $bodyFont;
font-size: 14px;
letter-spacing: 0;
padding-left: 10px;
}
.fa {
font-size: 18px;
}
}
.login-wrapper {
position: relative;
.mc-login-logo {
margin-top: 96px;
img {
height: 60px;
}
}
.title-goes-here {
color: #58595B;
font-family: $headingFont;
font-size: 24px;
font-weight: bold;
letter-spacing: 0;
line-height: 36px;
text-align: center;
margin: 32px 0 8px;
}
.subtitle-giving-cont {
color: #58595B;
font-family: $bodyFont;
font-size: 18px;
letter-spacing: 0;
line-height: 27px;
text-align: center;
margin-bottom: 32px;
padding: 0 26px;
}
.action-btn {
height: 50px;
width: 260px;
border-radius: 73px;
background-color: #12A8DE;
padding: 15px;
text-align: center;
color: #fff;
margin: 24px auto 8px;
cursor: pointer;
transition: .3s;
font-weight: bold;
border: 0;
box-shadow: none;
&:hover {
background: #127BAD;
}
}
.login-form {
border-radius: 4px;
background-color: #FFFFFF;
box-shadow: 0 0 20px 0 rgba(128,130,133,0.13);
padding: 24px 26px;
.forgot-password {
font-family: $bodyFont;
font-size: 14px;
letter-spacing: 0;
line-height: 21px;
text-align: center;
}
.signup-link {
color: #58595B;
font-family: $bodyFont;
font-size: 14px;
letter-spacing: 0;
line-height: 21px;
text-align: center;
}
}
}
.mc-footer-label {
position: absolute;
width: 100%;
bottom: 10px;
color: #808285;
font-family: $bodyFont;
font-size: 11px;
letter-spacing: 0;
line-height: 13px;
left: 0;
span {
cursor: pointer;
}
}
@media only screen and (max-width: 768px) {
.login-wrapper {
.mc-login-logo {
margin-top: 77px;
img {
height: 40px;
}
}
.subtitle-giving-cont {
margin-bottom: 0;
}
.login-form {
box-shadow: none;
.action-btn {
width: 100%;
}
}
}
}
...@@ -38,15 +38,15 @@ export class ForgotPasswordComponent extends BaseComponent { ...@@ -38,15 +38,15 @@ export class ForgotPasswordComponent extends BaseComponent {
this.as.forgot(this.forgotForm) this.as.forgot(this.forgotForm)
.pipe(takeUntil(this.componentInView)) .pipe(takeUntil(this.componentInView))
.subscribe(response => { .subscribe(response => {
this.isLoading = false;
this.hs.oneItHttpResponse(response); this.hs.oneItHttpResponse(response);
if (response.emailSent) { if (response.emailSent) {
this.emailSent = true; this.emailSent = true;
this.ts.success('Please check your email for instructions.'); this.ts.success('Please check your email for instructions.');
} }
this.isLoading = false;
}, err => { }, err => {
this.hs.handleHttpError(err);
this.isLoading = false; this.isLoading = false;
this.hs.handleHttpError(err);
}); });
} }
......
<div class="bck-link mc-nav-link" routerLink="/my-career-web"><i class="fa fa-chevron-left"></i><span>Back</span></div> <div class="bck-link mc-nav-link" routerLink="/my-career-web"><i class="fa fa-chevron-left"></i><span>Back</span></div>
<div class="row login-wrapper"> <div class="row auth-wrapper">
<div class="col-md-offset-4 col-md-4"> <div class="col-md-offset-4 col-md-4">
<div class="mc-login-logo d-flex justify-content-center"> <div class="mc-auth-logo d-flex justify-content-center">
<img src="assets/my-career-web/images/MATCHD_LOGO.jpg" alt=""> <img src="assets/my-career-web/images/MATCHD_LOGO.jpg" alt="">
</div> </div>
<div class="title-goes-here">Know your natural strengths.</div> <div class="title-goes-here">Know your natural strengths.</div>
<div class="subtitle-giving-cont">Empowering career seekers to get the right job and thrive.</div> <div class="subtitle-giving-cont">Empowering career seekers to get the right job and thrive.</div>
<form class="login-form position-relative" #form="ngForm"> <form class="auth-form position-relative" #form="ngForm">
<div class="form-group"> <div class="form-group">
<label>Email Address</label> <label>Email Address</label>
<app-form-control> <app-form-control>
......
...@@ -2,142 +2,13 @@ ...@@ -2,142 +2,13 @@
.bck-link { .bck-link {
position: absolute;
color: #12A8DE;
line-height: 21px;
z-index: 1000;
top: 15px;
left: 25px;
border: 0;
align-items: center;
display: none; display: none;
span {
font-family: $bodyFont;
font-size: 14px;
letter-spacing: 0;
padding-left: 10px;
}
.fa {
font-size: 18px;
}
} }
.login-wrapper { .auth-wrapper {
position: relative;
margin-bottom: 45px; margin-bottom: 45px;
.mc-login-logo {
margin-top: 96px;
img {
height: 60px;
}
}
.title-goes-here {
color: #58595B;
font-family: $headingFont;
font-size: 24px;
font-weight: bold;
letter-spacing: 0;
line-height: 36px;
text-align: center;
margin: 32px 0 8px;
}
.subtitle-giving-cont {
color: #58595B;
font-family: $bodyFont;
font-size: 18px;
letter-spacing: 0;
line-height: 27px;
text-align: center;
margin-bottom: 32px;
padding: 0 26px;
}
.action-btn {
height: 50px;
width: 260px;
border-radius: 73px;
background-color: #12A8DE;
padding: 15px;
text-align: center;
color: #fff;
margin: 24px auto 8px;
cursor: pointer;
transition: .3s;
font-weight: bold;
border: 0;
box-shadow: none;
&:hover {
background-color: #127BAD;
}
&.google-login {
background-color: #de5246;
&:hover {
background-color: #C34C41;
}
}
&.linkedin-login {
background-color: #0072b1;
margin: 0;
&:hover {
background-color: #005A8D;
}
}
}
.login-form {
border-radius: 4px;
background-color: #FFFFFF;
box-shadow: 0 0 20px 0 rgba(128,130,133,0.13);
padding: 24px 26px;
.forgot-password {
font-family: $bodyFont;
font-size: 14px;
letter-spacing: 0;
line-height: 21px;
text-align: center;
}
.signup-link {
color: #58595B;
font-family: $bodyFont;
font-size: 14px;
letter-spacing: 0;
line-height: 21px;
text-align: center;
}
}
} }
.mc-footer-label {
position: absolute;
width: 100%;
bottom: 10px;
left: 0;
color: #808285;
font-family: $bodyFont;
font-size: 11px;
letter-spacing: 0;
line-height: 13px;
span {
cursor: pointer;
}
}
@media only screen and (max-width: 768px) { @media only screen and (max-width: 768px) {
...@@ -145,26 +16,4 @@ ...@@ -145,26 +16,4 @@
display: flex; display: flex;
} }
.login-wrapper {
.mc-login-logo {
margin-top: 77px;
img {
height: 40px;
}
}
.subtitle-giving-cont {
margin-bottom: 0;
}
.login-form {
box-shadow: none;
.action-btn {
width: 100%;
}
}
}
} }
...@@ -57,15 +57,8 @@ export class LoginComponent extends BaseComponent { ...@@ -57,15 +57,8 @@ export class LoginComponent extends BaseComponent {
} }
socialMediaLogin(type: 'google' | 'linkedIn') { socialMediaLogin(type: 'google' | 'linkedIn') {
const params = {
environment: environment.envName,
nextPage: window.location.href.split('/#/')[0] + '/#/my-career-web/dashboard/home'
};
/* @CodeReview : : As all API names defined in constatns.ts, better to have these API names also to be defined there
*/
const svc = type === 'linkedIn' ? 'LoginWithLinkedIn' : 'LoginWithGoogle';
this.isLoading = true; this.isLoading = true;
this.aps.socicalMediaLogin(svc, params) this.aps.socicalMediaLogin(type)
.pipe(takeUntil(this.componentInView)) .pipe(takeUntil(this.componentInView))
.subscribe(data => { .subscribe(data => {
this.isLoading = false; this.isLoading = false;
...@@ -75,8 +68,8 @@ export class LoginComponent extends BaseComponent { ...@@ -75,8 +68,8 @@ export class LoginComponent extends BaseComponent {
} }
}, },
err => { err => {
this.hs.handleHttpError(err);
this.isLoading = false; this.isLoading = false;
this.hs.handleHttpError(err);
} }
) )
} }
......
<div class="bck-link mc-nav-link" routerLink="/my-career-web"><i class="fa fa-chevron-left"></i><span>Back</span></div> <div class="bck-link mc-nav-link" routerLink="/my-career-web"><i class="fa fa-chevron-left"></i><span>Back</span></div>
<div class="row signup-wrapper"> <div class="row auth-wrapper">
<div class="col-md-offset-4 col-md-4"> <div class="col-md-offset-4 col-md-4">
<div class="mc-signup-logo d-flex justify-content-center"> <div class="mc-auth-logo d-flex justify-content-center">
<img src="assets/my-career-web/images/MATCHD_LOGO.jpg" alt=""> <img src="assets/my-career-web/images/MATCHD_LOGO.jpg" alt="">
</div> </div>
<div class="title-goes-here">Know your natural strengths.</div> <div class="title-goes-here">Know your natural strengths.</div>
<div class="subtitle-giving-cont">Empowering career seekers to get the right job and thrive.</div> <div class="subtitle-giving-cont">Empowering career seekers to get the right job and thrive.</div>
<form class="signup-form position-relative" #form="ngForm"> <form class="auth-form position-relative" #form="ngForm">
<div class="form-group"> <div class="form-group">
<label>Email Address</label> <label>Email Address</label>
<app-form-control> <app-form-control>
......
@import "~styles/my-career-styles/variables"; @import "~styles/my-career-styles/variables";
.bck-link { .auth-wrapper {
position: absolute;
color: #12A8DE;
line-height: 21px;
z-index: 1000;
top: 15px;
left: 25px;
border: 0;
display: flex;
align-items: center;
span {
font-family: $bodyFont;
font-size: 14px;
letter-spacing: 0;
padding-left: 10px;
}
.fa {
font-size: 18px;
}
}
.signup-wrapper {
position: relative;
margin-bottom: 85px; margin-bottom: 85px;
.mc-signup-logo { .mc-auth-logo {
margin-top: 96px; margin-top: 96px;
img {
height: 60px;
}
}
.title-goes-here {
color: #58595B;
font-family: $headingFont;
font-size: 24px;
font-weight: bold;
letter-spacing: 0;
line-height: 36px;
text-align: center;
margin: 32px 0 8px;
}
.subtitle-giving-cont {
color: #58595B;
font-family: $bodyFont;
font-size: 18px;
letter-spacing: 0;
line-height: 27px;
text-align: center;
margin-bottom: 32px;
padding: 0 26px;
}
.password-wrapper {
.fa {
position: absolute;
right: 20px;
top: 18px;
cursor: pointer;
}
}
small.text-danger {
position: absolute;
bottom: -15px;
font-size: 10px;
}
.action-btn {
height: 50px;
width: 260px;
border-radius: 73px;
background-color: #12A8DE;
padding: 15px;
text-align: center;
color: #fff;
margin: 32px auto 8px;
cursor: pointer;
transition: .3s;
font-weight: bold;
border: 0;
box-shadow: none;
&:disabled {
pointer-events: none;
background: #83b7ca;
}
&:hover {
background: #127BAD;
}
}
.signup-form {
border-radius: 4px;
background-color: #FFFFFF;
box-shadow: 0 0 20px 0 rgba(128,130,133,0.13);
padding: 24px 26px;
.was-referred {
display: flex;
align-items: center;
justify-content: space-between;
}
.forgot-password {
font-family: $bodyFont;
font-size: 14px;
letter-spacing: 0;
line-height: 21px;
text-align: center;
}
.signup-link {
color: #58595B;
font-family: $bodyFont;
font-size: 14px;
letter-spacing: 0;
line-height: 21px;
text-align: center;
}
} }
} }
.mc-footer-label {
position: absolute;
width: 100%;
bottom: 10px;
color: #808285;
font-family: $bodyFont;
font-size: 11px;
letter-spacing: 0;
line-height: 13px;
left: 0;
span {
cursor: pointer;
}
}
@media only screen and (max-width: 768px) { @media only screen and (max-width: 768px) {
.signup-wrapper { .was-referred {
display: block;
.mc-signup-logo { }
margin-top: 77px;
img {
height: 40px;
}
}
.subtitle-giving-cont {
margin-bottom: 0;
}
.signup-form {
box-shadow: none;
.action-btn {
width: 100%;
}
.was-referred { .mt-sm-top {
display: block; margin-top: 15px;
}
}
.mt-sm-top {
margin-top: 15px;
}
} }
} }
import { Component, OnInit, ViewChild } from '@angular/core'; import { Component, ViewChild } from '@angular/core';
import { NgForm } from '@angular/forms'; import { NgForm } from '@angular/forms';
import { takeUntil } from 'rxjs/operators'; import { takeUntil } from 'rxjs/operators';
import { BaseComponent } from '../../base/base.component'; import { BaseComponent } from '../../base/base.component';
...@@ -13,7 +13,7 @@ import { EXTERNAL_LINKS } from '../../config/constants'; ...@@ -13,7 +13,7 @@ import { EXTERNAL_LINKS } from '../../config/constants';
templateUrl: './register.component.html', templateUrl: './register.component.html',
styleUrls: ['./register.component.scss'] styleUrls: ['./register.component.scss']
}) })
export class RegisterComponent extends BaseComponent implements OnInit { export class RegisterComponent extends BaseComponent {
registerForm = { registerForm = {
username: '', username: '',
...@@ -40,18 +40,13 @@ export class RegisterComponent extends BaseComponent implements OnInit { ...@@ -40,18 +40,13 @@ export class RegisterComponent extends BaseComponent implements OnInit {
super(); super();
} }
ngOnInit(): void {
//
}
register(): void { register(): void {
if (this.form.invalid) { if (this.form.invalid) {
return this.hs.validateAllFormFields(this.form); return this.hs.validateAllFormFields(this.form);
} }
// @CodeReview : G002 : Have to grab firstname & lastname from email (part before '@') this.registerForm.firstname = this.registerForm.username.split('@').pop();
this.registerForm.firstname = 'AA'; this.registerForm.lastname = this.registerForm.firstname;
this.registerForm.lastname = 'BB';
this.registerForm.email = this.registerForm.username; this.registerForm.email = this.registerForm.username;
if (!this.registerForm.was_referred) { if (!this.registerForm.was_referred) {
delete this.registerForm.ReferralCode; delete this.registerForm.ReferralCode;
......
<div class="bck-link mc-nav-link" routerLink="/my-career-web/auth/login"><i class="fa fa-chevron-left"></i><span>Back</span></div> <div class="bck-link mc-nav-link" routerLink="/my-career-web/auth/login"><i class="fa fa-chevron-left"></i><span>Back</span></div>
<div class="row login-wrapper"> <div class="row auth-wrapper">
<div class="col-md-offset-4 col-md-4"> <div class="col-md-offset-4 col-md-4">
<div class="mc-login-logo d-flex justify-content-center"> <div class="mc-auth-logo d-flex justify-content-center">
<img src="assets/my-career-web/images/MATCHD_LOGO.jpg" alt=""> <img src="assets/my-career-web/images/MATCHD_LOGO.jpg" alt="">
</div> </div>
<div class="title-goes-here">Know your natural strengths.</div> <div class="title-goes-here">Know your natural strengths.</div>
<div class="subtitle-giving-cont">Empowering career seekers to get the right job and thrive.</div> <div class="subtitle-giving-cont">Empowering career seekers to get the right job and thrive.</div>
<form class="login-form position-relative" #form="ngForm"> <form class="auth-form position-relative" #form="ngForm">
<div class="form-group"> <div class="form-group">
<label>Choose your password</label> <label>Choose your password</label>
......
@import "~styles/my-career-styles/variables";
.bck-link {
position: absolute;
color: #12A8DE;
line-height: 21px;
z-index: 1000;
top: 15px;
left: 25px;
border: 0;
display: flex;
align-items: center;
span {
font-family: $bodyFont;
font-size: 14px;
letter-spacing: 0;
padding-left: 10px;
}
.fa {
font-size: 18px;
}
}
.login-wrapper {
position: relative;
.mc-login-logo {
margin-top: 96px;
img {
height: 60px;
}
}
.title-goes-here {
color: #58595B;
font-family: $headingFont;
font-size: 24px;
font-weight: bold;
letter-spacing: 0;
line-height: 36px;
text-align: center;
margin: 32px 0 8px;
}
.subtitle-giving-cont {
color: #58595B;
font-family: $bodyFont;
font-size: 18px;
letter-spacing: 0;
line-height: 27px;
text-align: center;
margin-bottom: 32px;
padding: 0 26px;
}
.password-wrapper {
.fa {
position: absolute;
right: 20px;
top: 18px;
cursor: pointer;
}
}
small.text-danger {
position: absolute;
bottom: -15px;
font-size: 10px;
}
.action-btn {
height: 50px;
width: 260px;
border-radius: 73px;
background-color: #12A8DE;
padding: 15px;
text-align: center;
color: #fff;
margin: 24px auto 8px;
cursor: pointer;
transition: .3s;
font-weight: bold;
border: 0;
box-shadow: none;
&:disabled {
pointer-events: none;
background: #83b7ca;
}
&:hover {
background: #127BAD;
}
}
.login-form {
border-radius: 4px;
background-color: #FFFFFF;
box-shadow: 0 0 20px 0 rgba(128, 130, 133, 0.13);
padding: 24px 26px;
.forgot-password {
font-family: $bodyFont;
font-size: 14px;
letter-spacing: 0;
line-height: 21px;
text-align: center;
}
.signup-link {
color: #58595B;
font-family: $bodyFont;
font-size: 14px;
letter-spacing: 0;
line-height: 21px;
text-align: center;
}
}
}
.mc-footer-label {
position: absolute;
width: 100%;
bottom: 10px;
color: #808285;
font-family: $bodyFont;
font-size: 11px;
letter-spacing: 0;
line-height: 13px;
left: 0;
span {
cursor: pointer;
}
}
@media only screen and (max-width: 768px) {
.login-wrapper {
.mc-login-logo {
margin-top: 77px;
img {
height: 40px;
}
}
.subtitle-giving-cont {
margin-bottom: 0;
}
.login-form {
box-shadow: none;
.action-btn {
width: 100%;
}
}
}
}
...@@ -16,6 +16,7 @@ export const CLASSES = { ...@@ -16,6 +16,7 @@ export const CLASSES = {
JOB: 'performa.orm.Job', JOB: 'performa.orm.Job',
CAREER_PROFILE: 'performa.orm.CareerProfile', CAREER_PROFILE: 'performa.orm.CareerProfile',
WORK_STYLE_QUESTION: 'performa.orm.WorkStyleQuestionNP', WORK_STYLE_QUESTION: 'performa.orm.WorkStyleQuestionNP',
WORK_PREFERENCE_QUESTION: 'performa.orm.WorkPreferencesQuestionNP',
QUESTION: 'performa.orm.Question' QUESTION: 'performa.orm.Question'
}; };
...@@ -28,6 +29,8 @@ export const SERVICES = { ...@@ -28,6 +29,8 @@ export const SERVICES = {
SAVE: 'Save', SAVE: 'Save',
CAREER_PROFILES: 'CareerProfiles', CAREER_PROFILES: 'CareerProfiles',
JOB_TITLES: 'JobTitles', JOB_TITLES: 'JobTitles',
LOGIN_LINKEDIN: 'LoginWithLinkedIn',
LOGIN_GOOGLE: 'LoginWithGoogle',
}; };
export const SEARCH = { export const SEARCH = {
......
import { ChangeDetectorRef, Component, OnInit, ViewChild } from '@angular/core'; import { Component, OnInit, ViewChild } from '@angular/core';
import { NgForm } from '@angular/forms'; import { NgForm } from '@angular/forms';
import { takeUntil } from 'rxjs/operators'; import { takeUntil } from 'rxjs/operators';
import { environment } from '../../../../../environments/environment';
import { AppService } from '../../../../app.service'; import { AppService } from '../../../../app.service';
import { UtilsService } from '../../../../oneit/services/utils.service';
import { BaseComponent } from '../../base/base.component'; import { BaseComponent } from '../../base/base.component';
import { CareerProfileModel } from '../../models/career-profile.model'; import { CareerProfileModel } from '../../models/career-profile.model';
import { HelperService } from '../../services/helper.service'; import { HelperService } from '../../services/helper.service';
...@@ -133,14 +131,8 @@ export class PersonalDetailsComponent extends BaseComponent implements OnInit { ...@@ -133,14 +131,8 @@ export class PersonalDetailsComponent extends BaseComponent implements OnInit {
this.careerProfile.GoogleAddress = $event.formatted; this.careerProfile.GoogleAddress = $event.formatted;
} }
// @CodeReview : G002 : can reuse alreayd created method
connectWithSocial(type): void { connectWithSocial(type): void {
const params = { this.aps.socicalMediaLogin(type)
environment: environment.envName,
nextPage: window.location.href.split('/#/')[0] + '/#/my-career-web/dashboard/home'
};
const svc = type === 'LINKEDIN' ? 'LoginWithLinkedIn' : 'LoginWithGoogle';
this.aps.socicalMediaLogin(svc, params)
.pipe(takeUntil(this.componentInView)) .pipe(takeUntil(this.componentInView))
.subscribe(data => { .subscribe(data => {
this.isLoading = false; this.isLoading = false;
...@@ -150,6 +142,7 @@ export class PersonalDetailsComponent extends BaseComponent implements OnInit { ...@@ -150,6 +142,7 @@ export class PersonalDetailsComponent extends BaseComponent implements OnInit {
} }
}, },
err => { err => {
this.isLoading = false;
this.hs.handleHttpError(err); this.hs.handleHttpError(err);
} }
) )
......
...@@ -20,7 +20,7 @@ export class ProfileTasksComponent extends BaseComponent { ...@@ -20,7 +20,7 @@ export class ProfileTasksComponent extends BaseComponent {
profileTasks = [ profileTasks = [
{label: 'Personal Details', link: '/my-career-web/dashboard/personal-details', key: 'CompletedPercentage', active: false}, {label: 'Personal Details', link: '/my-career-web/dashboard/personal-details', key: 'CompletedPercentage', active: false},
{label: 'Work Strengths', link: '/my-career-web/assessments/work-style', key: 'CompletedPercentageWS', active: false}, {label: 'Work Strengths', link: '/my-career-web/assessments/work-style', key: 'CompletedPercentageWS', active: false},
{label: 'Career Values', link: '', key: 'CompletedPercentageWS', active: false}, {label: 'Career Values', link: '/my-career-web/assessments/work-preference', key: 'CompletedPercentageWP', active: false},
{label: 'Career History', link: '', key: '', active: false}, {label: 'Career History', link: '', key: '', active: false},
{label: 'Diversity', link: '', key: '', active: false} {label: 'Diversity', link: '', key: '', active: false}
]; ];
......
export class CultureElementModel {
Description?: string;
DetailedDescription?: string;
CultureClass?: string;
}
import { BaseModel } from './base.model';
import { CLASSES } from '../config/constants';
import { CultureElementModel } from './culture-element.model';
export class WorkPreferenceQuestionModel extends BaseModel {
ObjectClass = CLASSES.WORK_PREFERENCE_QUESTION;
Percentage: number;
IntroductoryText: string;
QuestionNo: number;
CultureElement: CultureElementModel;
}
...@@ -20,6 +20,15 @@ export class AssessmentService { ...@@ -20,6 +20,15 @@ export class AssessmentService {
) )
} }
getWorkPreferences(assocs = []): Observable<any> {
return this.ss.getObjects('WorkPreferences', 'All', '', assocs, null, null, null, null)
.map(
data => {
return this.us.convertResponseToObjects(data, assocs);
}
)
}
saveWorkStyle(params): Observable<any> { saveWorkStyle(params): Observable<any> {
return this.us.processObjects('SaveWorkStyle', params); return this.us.processObjects('SaveWorkStyle', params);
} }
......
.bck-link {
position: absolute;
color: #12A8DE;
line-height: 21px;
z-index: 1000;
top: 15px;
left: 25px;
border: 0;
display: flex;
align-items: center;
span {
font-family: $bodyFont;
font-size: 14px;
letter-spacing: 0;
padding-left: 10px;
}
.fa {
font-size: 18px;
}
}
.auth-wrapper {
position: relative;
.mc-auth-logo {
margin-top: 96px;
img {
height: 60px;
}
}
.title-goes-here {
color: #58595B;
font-family: $headingFont;
font-size: 24px;
font-weight: bold;
letter-spacing: 0;
line-height: 36px;
text-align: center;
margin: 32px 0 8px;
}
.subtitle-giving-cont {
color: #58595B;
font-family: $bodyFont;
font-size: 18px;
letter-spacing: 0;
line-height: 27px;
text-align: center;
margin-bottom: 32px;
padding: 0 26px;
}
.action-btn {
height: 50px;
width: 260px;
border-radius: 73px;
background-color: #12A8DE;
padding: 15px;
text-align: center;
color: #fff;
margin: 24px auto 8px;
cursor: pointer;
transition: .3s;
font-weight: bold;
border: 0;
box-shadow: none;
&:hover {
background: #127BAD;
}
&.google-login {
background-color: #de5246;
&:hover {
background-color: #C34C41;
}
}
&.linkedin-login {
background-color: #0072b1;
margin: 0;
&:hover {
background-color: #005A8D;
}
}
}
.auth-form {
border-radius: 4px;
background-color: #FFFFFF;
box-shadow: 0 0 20px 0 rgba(128,130,133,0.13);
padding: 24px 26px;
.password-wrapper {
.fa {
position: absolute;
right: 20px;
top: 18px;
cursor: pointer;
}
}
small.text-danger {
position: absolute;
bottom: -15px;
font-size: 10px;
}
.was-referred {
display: flex;
align-items: center;
justify-content: space-between;
}
.forgot-password {
font-family: $bodyFont;
font-size: 14px;
letter-spacing: 0;
line-height: 21px;
text-align: center;
}
.signup-link {
color: #58595B;
font-family: $bodyFont;
font-size: 14px;
letter-spacing: 0;
line-height: 21px;
text-align: center;
}
}
}
.mc-footer-label {
position: absolute;
width: 100%;
bottom: 10px;
color: #808285;
font-family: $bodyFont;
font-size: 11px;
letter-spacing: 0;
line-height: 13px;
left: 0;
span {
cursor: pointer;
}
}
@media only screen and (max-width: 768px) {
.auth-wrapper {
.mc-auth-logo {
margin-top: 77px;
img {
height: 40px;
}
}
.subtitle-giving-cont {
margin-bottom: 0;
}
.auth-form {
box-shadow: none;
.action-btn {
width: 100%;
}
}
}
}
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
@import "flex-helpers"; @import "flex-helpers";
@import "form"; @import "form";
@import "misc"; @import "misc";
@import "auth";
@import "primeng/radio"; @import "primeng/radio";
@import "primeng/checkbox"; @import "primeng/checkbox";
@import "primeng/toast"; @import "primeng/toast";
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment