Commit cc790641 by Muhammad Usman

feedback component added

parent 8c720bc7
import { CommonModule, DatePipe } from '@angular/common';
import { HttpClientModule } from '@angular/common/http';
import { NgModule } from '@angular/core';
import { APP_INITIALIZER, NgModule } from '@angular/core';
import { FormBuilder, FormsModule } from '@angular/forms';
import { BrowserModule } from '@angular/platform-browser';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
......@@ -40,7 +40,8 @@ import { SelectTwoComponent } from './components/select-2/select-2.component';
import { FullLayoutComponent } from './oneit/components/full-layout/full-layout.component';
import { OneITModule } from './oneit/oneit.module';
import { GoogleTagManagerService } from './services/google-tag-manager.service';
import { StartUpService } from './oneit/services/startup.service';
import { ConfigService } from './oneit/services/config.service';
@NgModule({
imports: [
......@@ -84,6 +85,12 @@ import { GoogleTagManagerService } from './services/google-tag-manager.service';
MatricsReportComponent
],
providers: [
{
provide: APP_INITIALIZER,
useFactory: startup,
deps: [StartUpService],
multi: true
},
FormBuilder,
ConfirmationService,
AdminPortalLayoutService,
......@@ -92,6 +99,8 @@ import { GoogleTagManagerService } from './services/google-tag-manager.service';
EditWorkflowTemplateService,
MessageEngineService,
DatePipe,
StartUpService,
ConfigService,
SearchApplicantService,
GoogleTagManagerService,
MyCareerUsersService,
......@@ -106,3 +115,9 @@ export class AppModule {
constructor() {
}
}
export function startup(startUpService: StartUpService) {
return () => {
return startUpService.start();
}
}
......@@ -180,7 +180,7 @@ export const routes: Routes = [
{
path: 'my-career-web',
// @ts-ignore
loadChildren: "./components/my-career-web/my-career-web.module#MyCareerWebModule"
loadChildren: "./my-career-web/my-career-web.module#MyCareerWebModule"
}
];
......
@import "~styles/my-career-styles/variables";
@import "../../../../styles/my-career-styles/variables";
.assessment-wrapper {
background: #FAFCFD;
......
@import "~styles/my-career-styles/variables";
@import "../../../../styles/my-career-styles/variables";
.auth-wrapper {
margin-bottom: 45px;
......
......@@ -2,12 +2,12 @@ import { Component, ViewChild } from '@angular/core';
import { NgForm } from '@angular/forms';
import { Router } from '@angular/router';
import { takeUntil } from 'rxjs/operators';
import { environment } from '../../../../../environments/environment';
import { AppService } from '../../../../app.service';
import { AppService } from '../../../app.service';
import { BaseComponent } from '../../base/base.component';
import { EXTERNAL_LINKS } from '../../config/constants';
import { AuthService } from '../../services/auth.service';
import { HelperService } from '../../services/helper.service';
import { UtilsService } from '../../../oneit/services/utils.service';
@Component({
selector: 'app-login',
......@@ -29,14 +29,15 @@ export class LoginComponent extends BaseComponent {
private hs: HelperService,
private as: AuthService,
private r: Router,
private aps: AppService
private aps: AppService,
private us: UtilsService
) {
super();
}
login(): void {
if (this.form.invalid) {
return this.hs.validateAllFormFields(this.form);
return this.us.showAllErrorMessages();
}
this.isLoading = true;
this.as.login(this.loginForm)
......
@import "~styles/my-career-styles/variables";
@import "../../../../styles/my-career-styles/variables";
.auth-wrapper {
margin-bottom: 85px;
......
......@@ -7,6 +7,7 @@ import { AuthService } from '../../services/auth.service';
import { HelperService } from '../../services/helper.service';
import { ToasterService } from '../../services/toaster.service';
import { EXTERNAL_LINKS } from '../../config/constants';
import { UtilsService } from '../../../oneit/services/utils.service';
@Component({
selector: 'app-reset-password',
......@@ -26,17 +27,18 @@ export class ResetPasswordComponent extends BaseComponent implements OnInit {
@ViewChild('form') form: NgForm;
constructor(
private hs: HelperService,
private ar: ActivatedRoute,
private ts: ToasterService,
private as: AuthService,
private r: Router
private helperService: HelperService,
private activatedRoute: ActivatedRoute,
private toasterService: ToasterService,
private authService: AuthService,
private utilsService: UtilsService,
private router: Router
) {
super();
}
ngOnInit(): void {
this.ar.params
this.activatedRoute.params
.pipe(takeUntil(this.componentInView))
.subscribe(params => {
if (params.token) {
......@@ -47,22 +49,22 @@ export class ResetPasswordComponent extends BaseComponent implements OnInit {
reset(): void {
if (this.form.invalid) {
return this.hs.validateAllFormFields(this.form);
return this.utilsService.showAllErrorMessages();
}
const formData = {resetToken: this.resetToken, newPassword: this.resetForm.password};
this.isLoading = true;
this.as.reset(formData)
this.authService.reset(formData)
.pipe(takeUntil(this.componentInView))
.subscribe(response => {
this.isLoading = false;
this.hs.oneItHttpResponse(response);
this.helperService.oneItHttpResponse(response);
if (response.passwordChanged) {
this.ts.success('Password changed.');
this.r.navigate(['/my-career-web/auth/login']);
this.toasterService.success('Password changed.');
this.router.navigate(['/my-career-web/auth/login']);
}
}, err => {
this.hs.handleHttpError(err);
this.isLoading = false;
this.utilsService.handleError(err);
});
}
......
......@@ -2,13 +2,13 @@ import { Component, EventEmitter, OnInit, Output, ViewChild } from '@angular/cor
import { PersonalDetailsService } from '../../../services/personal-details.service';
import { CareerProfileModel } from '../../../models/career-profile.model';
import { HelperService } from '../../../services/helper.service';
import { UtilsService } from '../../../../../oneit/services/utils.service';
import { UtilsService } from '../../../../oneit/services/utils.service';
import { ConfirmationService } from 'primeng/api';
import { NgForm } from '@angular/forms';
import { BaseComponent } from '../../../base/base.component';
import { takeUntil } from 'rxjs/operators';
import { EducationModel } from '../../../models/education.model';
import { environment } from '../../../../../../environments/environment';
import { environment } from '../../../../../environments/environment';
@Component({
selector: 'app-education',
......
......@@ -2,7 +2,7 @@ import { Component, OnInit } from '@angular/core';
import { PersonalDetailsService } from '../../../services/personal-details.service';
import { CareerProfileModel } from '../../../models/career-profile.model';
import { HelperService } from '../../../services/helper.service';
import { UtilsService } from '../../../../../oneit/services/utils.service';
import { UtilsService } from '../../../../oneit/services/utils.service';
import { BaseComponent } from '../../../base/base.component';
import { takeUntil } from 'rxjs/operators';
......
......@@ -2,13 +2,13 @@ import { Component, EventEmitter, OnInit, Output, ViewChild } from '@angular/cor
import { PersonalDetailsService } from '../../../services/personal-details.service';
import { HelperService } from '../../../services/helper.service';
import { CareerProfileModel } from '../../../models/career-profile.model';
import { UtilsService } from '../../../../../oneit/services/utils.service';
import { UtilsService } from '../../../../oneit/services/utils.service';
import { ConfirmationService } from 'primeng/api';
import { NgForm } from '@angular/forms';
import { BaseComponent } from '../../../base/base.component';
import { takeUntil } from 'rxjs/operators';
import { RefereeModel } from '../../../models/referee.model';
import { environment } from '../../../../../../environments/environment';
import { environment } from '../../../../../environments/environment';
@Component({
selector: 'app-references',
......
......@@ -3,7 +3,7 @@ import { BaseComponent } from '../../../base/base.component';
import { CareerProfileModel } from '../../../models/career-profile.model';
import { NgForm } from '@angular/forms';
import { PersonalDetailsService } from '../../../services/personal-details.service';
import { UtilsService } from '../../../../../oneit/services/utils.service';
import { UtilsService } from '../../../../oneit/services/utils.service';
import { ConfirmationService } from 'primeng/api';
import { HelperService } from '../../../services/helper.service';
import { takeUntil } from 'rxjs/operators';
......
......@@ -2,7 +2,7 @@ import { Component, OnInit } from '@angular/core';
import { BaseComponent } from '../../../base/base.component';
import { CareerProfileModel } from '../../../models/career-profile.model';
import { PersonalDetailsService } from '../../../services/personal-details.service';
import { UtilsService } from '../../../../../oneit/services/utils.service';
import { UtilsService } from '../../../../oneit/services/utils.service';
import { HelperService } from '../../../services/helper.service';
import { takeUntil } from 'rxjs/operators';
......
......@@ -4,7 +4,7 @@ import { takeUntil } from 'rxjs/operators';
import { CareerProfileModel } from '../../../models/career-profile.model';
import { PersonalDetailsService } from '../../../services/personal-details.service';
import { HelperService } from '../../../services/helper.service';
import { UtilsService } from '../../../../../oneit/services/utils.service';
import { UtilsService } from '../../../../oneit/services/utils.service';
import { WorkExperienceModel } from '../../../models/work-experience.model';
import { NgForm } from '@angular/forms';
import { ConfirmationService } from 'primeng/api';
......
@import "~styles/my-career-styles/variables";
@import "../../../../styles/my-career-styles/variables";
.dashboard-wrapper {
display: flex;
......
......@@ -5,7 +5,7 @@ import { AuthService } from '../../services/auth.service';
import { takeUntil } from 'rxjs/operators';
import { PersonalDetailsService } from '../../services/personal-details.service';
import { CareerProfileModel } from '../../models/career-profile.model';
import { environment } from '../../../../../environments/environment';
import { environment } from '../../../../environments/environment';
@Component({
selector: 'app-dashboard',
......
@import "~styles/my-career-styles/variables";
@import "../../../../styles/my-career-styles/variables";
.content-wrapper {
padding: 20px 118px;
......
@import "~styles/my-career-styles/variables";
@import "../../../../styles/my-career-styles/variables";
.home-wrapper {
.home-header {
......
......@@ -3,7 +3,7 @@ import { BaseComponent } from '../../base/base.component';
import { takeUntil } from 'rxjs/operators';
import { PersonalDetailsService } from '../../services/personal-details.service';
import { CareerProfileModel } from '../../models/career-profile.model';
import { UtilsService } from '../../../../oneit/services/utils.service';
import { UtilsService } from '../../../oneit/services/utils.service';
import { HelperService } from '../../services/helper.service';
@Component({
......
@import "~styles/my-career-styles/variables";
@import "../../../../styles/my-career-styles/variables";
.left-sidebar {
padding: 26px 26px 0 0;
......
......@@ -6,7 +6,7 @@ import { BaseComponent } from '../../base/base.component';
import { EXTERNAL_LINKS } from '../../config/constants';
import { PersonalDetailsService } from '../../services/personal-details.service';
import { CareerProfileModel } from '../../models/career-profile.model';
import { environment } from '../../../../../environments/environment';
import { environment } from '../../../../environments/environment';
@Component({
selector: 'app-left-sidebar',
......
......@@ -2,7 +2,7 @@ import { Component } from '@angular/core';
import { BaseComponent } from '../../base/base.component';
import { PersonalDetailsService } from '../../services/personal-details.service';
import { takeUntil } from 'rxjs/operators';
import { UtilsService } from '../../../../oneit/services/utils.service';
import { UtilsService } from '../../../oneit/services/utils.service';
import { CareerProfileModel } from '../../models/career-profile.model';
import { HelperService } from '../../services/helper.service';
......
......@@ -2,9 +2,9 @@ import { Injectable } from '@angular/core';
import { ActivatedRouteSnapshot, CanActivate, Router, RouterStateSnapshot } from '@angular/router';
import { Observable } from 'rxjs/Observable';
import { of } from 'rxjs/observable/of';
import { environment } from '../../../../environments/environment';
import { ApiService } from '../../../oneit/services/api.service';
import { UtilsService } from '../../../oneit/services/utils.service';
import { environment } from '../../../environments/environment';
import { ApiService } from '../../oneit/services/api.service';
import { UtilsService } from '../../oneit/services/utils.service';
@Injectable()
export class HomeGuard implements CanActivate {
......@@ -26,7 +26,8 @@ export class HomeGuard implements CanActivate {
return this.as.post('svc/EnvironmentInformation', params)
.map(
data => {
if (this.us.isSuccessfulResponse(data)) {
// if (this.us.isSuccessfulResponse(data)) {
if (data.result === 'ok') {
if (data.UserName !== 'noprivauthtoken') {
return true;
}
......
......@@ -2,9 +2,9 @@ import { Injectable } from '@angular/core';
import { ActivatedRouteSnapshot, CanActivate, Router, RouterStateSnapshot } from '@angular/router';
import { Observable } from 'rxjs/Observable';
import { of } from 'rxjs/observable/of';
import { environment } from '../../../../environments/environment';
import { ApiService } from '../../../oneit/services/api.service';
import { UtilsService } from '../../../oneit/services/utils.service';
import { environment } from '../../../environments/environment';
import { ApiService } from '../../oneit/services/api.service';
import { UtilsService } from '../../oneit/services/utils.service';
@Injectable()
......
......@@ -3,7 +3,7 @@ import { BaseComponent } from '../../base/base.component';
import { IntroductionLetterModel } from '../../models/introduction-letter.model';
import { ActivatedRoute, Router } from '@angular/router';
import { takeUntil } from 'rxjs/operators';
import { UtilsService } from '../../../../oneit/services/utils.service';
import { UtilsService } from '../../../oneit/services/utils.service';
import { PersonalDetailsService } from '../../services/personal-details.service';
import { CareerProfileModel } from '../../models/career-profile.model';
import { HelperService } from '../../services/helper.service';
......
@import "../../../../../styles/my-career-styles/variables";
@import "../../../../styles/my-career-styles/variables";
.intro-letters {
margin-top: 24px;
......
import { animate, style, transition, trigger } from '@angular/animations';
import { Component, OnInit } from '@angular/core';
import { MsgsService } from '../../../oneit/services/msgs.service';
import { takeUntil } from 'rxjs/operators';
import { BaseComponent } from '../../base/base.component';
@Component({
selector: 'app-wrapper',
......@@ -15,14 +18,20 @@ import { Component, OnInit } from '@angular/core';
)
]
})
export class WrapperComponent implements OnInit {
export class WrapperComponent extends BaseComponent implements OnInit {
constructor() {
//
constructor(
private msgService: MsgsService
) {
super();
}
ngOnInit() {
//
this.msgService.errorMsgsUpdated
.pipe(takeUntil(this.componentInView))
.subscribe(error => {
// console.log(error);
});
}
}
import { CommonModule } from '@angular/common';
import { NgModule } from '@angular/core';
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
import { PrimeNGModules } from '../../../utils/common.modules.import';
import { PrimeNGModules } from '../../utils/common.modules.import';
import { AssessmentService } from '../services/assessment.service';
import { HelperService } from '../services/helper.service';
import { PersonalDetailsService } from '../services/personal-details.service';
......
import { Component, EventEmitter, Input, OnInit, Output, ViewChild } from '@angular/core';
import { NgForm } from '@angular/forms';
import { takeUntil } from 'rxjs/operators';
import { AppService } from '../../../../app.service';
import { AppService } from '../../../app.service';
import { BaseComponent } from '../../base/base.component';
import { CareerProfileModel } from '../../models/career-profile.model';
import { HelperService } from '../../services/helper.service';
......
......@@ -9,12 +9,14 @@ import { McSharedModule } from './mc-shared/mc-shared.module';
import { MyCareerWebRouting } from './my-career-web.routing';
import { AuthService } from './services/auth.service';
import { WelcomeComponent } from './welcome/welcome.component';
import { OneITModule } from '../oneit/oneit.module';
@NgModule({
imports: [
CommonModule,
McSharedModule,
MyCareerWebRouting
MyCareerWebRouting,
OneITModule
],
providers: [
AuthService,
......
import { Injectable } from '@angular/core';
import { Observable } from 'rxjs';
import { SearchService } from '../../../oneit/services/search.service';
import { UtilsService } from '../../../oneit/services/utils.service';
import { SearchService } from '../../oneit/services/search.service';
import { UtilsService } from '../../oneit/services/utils.service';
@Injectable()
export class AssessmentService {
......
import { Injectable } from '@angular/core';
import { Observable } from 'rxjs';
import { environment } from '../../../../environments/environment';
import { ApiService } from '../../../oneit/services/api.service';
import { environment } from '../../../environments/environment';
import { ApiService } from '../../oneit/services/api.service';
import { UtilsService } from '../../oneit/services/utils.service';
@Injectable()
export class AuthService {
......@@ -9,50 +10,46 @@ export class AuthService {
env = environment.envName;
constructor(
private as: ApiService
private apiService: ApiService,
private utilsService: UtilsService
) {
}
login(formData): Observable<any> {
formData.environment = this.env;
return this.as.post('svc/Login', formData);
}
googleLogin(formData = {} as any): Observable<any> {
formData.environment = this.env;
return this.as.post('svc/LoginWithGoogle', formData);
}
linkedinLogin(formData = {} as any): Observable<any> {
formData.environment = this.env;
return this.as.post('svc/LoginWithGoogle', formData);
return this.apiService.post('svc/Login', formData);
}
forgot(formData): Observable<any> {
formData.environment = this.env;
return this.as.post('svc/RequestPasswordReset', formData);
return this.apiService.post('svc/RequestPasswordReset', formData);
}
register(formData): Observable<any> {
formData.environment = this.env;
return this.as.post('svc/RegisterMyCareerUser', formData);
return this.apiService.post('svc/RegisterMyCareerUser', formData);
}
reset(formData): Observable<any> {
formData.environment = this.env;
return this.as.post('svc/PasswordChange', formData);
return this.apiService.post('svc/PasswordChange', formData);
}
logout(formData = {} as any): Observable<any> {
formData.environment = this.env;
return this.as.post('svc/Logout', formData);
return this.apiService.post('svc/Logout', formData)
.map(
data => {
if (this.utilsService.isSuccessfulResponse(data)) {
return data;
}
}
);
}
}
import { Injectable } from '@angular/core';
import { UtilsService } from '../../../oneit/services/utils.service';
import { SearchService } from '../../../oneit/services/search.service';
import { UtilsService } from '../../oneit/services/utils.service';
import { SearchService } from '../../oneit/services/search.service';
import { Observable } from 'rxjs';
import { SERVICES } from '../config/constants';
import { SaveService } from '../../../oneit/services/save.service';
import { SaveService } from '../../oneit/services/save.service';
import { IntroductionLetterModel } from '../models/introduction-letter.model';
@Injectable()
......
import { Injectable } from '@angular/core';
import { Observable, Subject } from 'rxjs';
import { EnumService } from '../../../oneit/services/enum.service';
import { SaveService } from '../../../oneit/services/save.service';
import { SearchService } from '../../../oneit/services/search.service';
import { UtilsService } from '../../../oneit/services/utils.service';
import { EnumService } from '../../oneit/services/enum.service';
import { SaveService } from '../../oneit/services/save.service';
import { SearchService } from '../../oneit/services/search.service';
import { UtilsService } from '../../oneit/services/utils.service';
import { SERVICES } from '../config/constants';
import { CareerProfileModel } from '../models/career-profile.model';
......
@import "~styles/my-career-styles/variables";
@import "../../../styles/my-career-styles/variables";
.login-wrapper {
position: relative;
......
import { CommonModule, DecimalPipe } from '@angular/common';
import { HTTP_INTERCEPTORS } from '@angular/common/http';
import { APP_INITIALIZER, NgModule } from '@angular/core';
import { NgModule } from '@angular/core';
import { PrimeNGModules } from './../utils/common.modules.import';
import { AccessDeniedComponent } from './components/access-denied/access-denied.component';
import { BreadcrumbComponent } from './components/breadcrumb/breadcrumb.component';
......@@ -32,14 +32,13 @@ import { ShortenPipe } from './pipes/shorten.pipe';
import { SortPipe } from './pipes/sort.pipe';
import { TranslatePipe } from './pipes/translate.pipe';
import { ApiService } from './services/api.service';
import { ConfigService } from './services/config.service';
import { EnumService } from './services/enum.service';
import { IframeMsgHandlingService } from './services/iframe-msg-handling.service';
import { MenuService } from './services/menu.service';
import { MsgsService } from './services/msgs.service';
import { SaveService } from './services/save.service';
import { SearchService } from './services/search.service';
import { StartUpService } from './services/startup.service';
import { TranslateService } from './services/translate.service';
import { UserService } from './services/user.service';
import { UtilsService } from './services/utils.service';
......@@ -52,18 +51,11 @@ import { UtilsService } from './services/utils.service';
],
providers: [
{
provide: APP_INITIALIZER,
useFactory: startup,
deps: [StartUpService],
multi: true
},
{
provide: HTTP_INTERCEPTORS,
multi: true,
useClass: NoopHttpInterceptor
},
ApiService,
ConfigService,
UtilsService,
SearchService,
EnumService,
......@@ -75,7 +67,6 @@ import { UtilsService } from './services/utils.service';
MessageSourceConfig,
MsgsService,
MenuService,
StartUpService,
TranslateService,
UserService,
DecimalPipe,
......@@ -131,9 +122,3 @@ import { UtilsService } from './services/utils.service';
]
})
export class OneITModule { }
export function startup(startUpService: StartUpService) {
return () => {
return startUpService.start();
}
}
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