Commit d76e5e14 by chamath

Search career users and view user components added.

parent 8410736c
......@@ -6,14 +6,7 @@ import { BsDropdownModule } from 'ngx-bootstrap/dropdown';
import { ModalModule } from 'ngx-bootstrap/modal';
import { DeviceDetectorModule } from 'ngx-device-detector';
import { DndModule } from 'ngx-drag-drop';
import {
ConfirmationService,
DragDropModule, FileUploadModule,
InputMaskModule, KeyFilterModule,
MultiSelectModule,
OrderListModule
} from 'primeng/primeng';
import { ConfirmationService, DragDropModule, FileUploadModule, InputMaskModule, KeyFilterModule, MultiSelectModule, OrderListModule } from 'primeng/primeng';
import { AppComponent } from './app.component';
import { AppRoutingModule } from './app.routing';
import { AppService } from './app.service';
......@@ -27,17 +20,22 @@ import { ListMessageTemplateComponent } from './components/admin-portal/list-mes
import { ListWorkFlowsComponent } from './components/admin-portal/list-work-flows/list-work-flows.component';
import { ApplicantPortalLayoutComponent } from './components/applicant-portal/applicant-portal-layout/applicant-portal-layout.component';
import { ApplicantPortalLayoutService } from './components/applicant-portal/applicant-portal-layout/applicant-portal-layout.service';
import { EditApplicantComponent } from './components/edit-applicant/edit-applicant.component';
import { ErrorMessageComponent } from './components/error-message/error-message.component';
import { MessageEngineComponent } from './components/message-engine/message-engine.component';
import { MessageEngineService } from './components/message-engine/message-engine.service';
import { MyCareerUsersComponent } from './components/my-career/my-career-users/my-career-users.component';
import { MyCareerUsersService } from './components/my-career/my-career-users/my-career-users.service';
import { ViewCareerUserComponent } from './components/my-career/view-career-user/view-career-user.component';
import { ViewCareerUserService } from './components/my-career/view-career-user/view-career-user.service';
import { SearchApplicantsComponent } from './components/search-applicants/search-applicants.component';
import { SearchApplicantService } from './components/search-applicants/search-applicants.service';
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 { SearchApplicantsComponent } from './components/search-applicants/search-applicants.component';
import { SearchApplicantService } from './components/search-applicants/search-applicants.service';
import { EditApplicantComponent } from './components/edit-applicant/edit-applicant.component';
import { GoogleTagManagerService } from './services/google-tag-manager.service';
@NgModule({
imports: [
AppRoutingModule,
......@@ -68,7 +66,9 @@ import { GoogleTagManagerService } from './services/google-tag-manager.service';
ApplicantPortalLayoutComponent,
MessageEngineComponent,
SearchApplicantsComponent,
EditApplicantComponent
EditApplicantComponent,
MyCareerUsersComponent,
ViewCareerUserComponent
],
providers: [
FormBuilder,
......@@ -80,7 +80,9 @@ import { GoogleTagManagerService } from './services/google-tag-manager.service';
MessageEngineService,
DatePipe,
SearchApplicantService,
GoogleTagManagerService
GoogleTagManagerService,
MyCareerUsersService,
ViewCareerUserService
],
bootstrap: [AppComponent]
})
......
......@@ -9,6 +9,8 @@ import { ListWorkFlowsComponent } from './components/admin-portal/list-work-flow
import { ApplicantPortalLayoutComponent } from './components/applicant-portal/applicant-portal-layout/applicant-portal-layout.component';
import { EditApplicantComponent } from './components/edit-applicant/edit-applicant.component';
import { MessageEngineComponent } from './components/message-engine/message-engine.component';
import { MyCareerUsersComponent } from './components/my-career/my-career-users/my-career-users.component';
import { ViewCareerUserComponent } from './components/my-career/view-career-user/view-career-user.component';
import { SearchApplicantsComponent } from './components/search-applicants/search-applicants.component';
import { AccessDeniedComponent } from './oneit/components/access-denied/access-denied.component';
import { FullLayoutComponent } from './oneit/components/full-layout/full-layout.component';
......@@ -155,6 +157,24 @@ export const routes: Routes = [
component: MessageEngineComponent
}
]
},
{
path: 'my-career',
component: FullLayoutComponent,
canActivate: [AuthGuard],
data: {
redirectPage: 'editor/index.jsp'
},
children: [
{
path: 'my-career-users',
component: MyCareerUsersComponent
},
{
path: 'view-career-user/:id',
component: ViewCareerUserComponent
}
]
}
];
......
<form #form="ngForm">
<div class="ui-g ui-fluid">
<div class="ui-g-12 nopad">
<p-toolbar>
<div class="ui-toolbar-group-left">
Matrices Report
</div>
</p-toolbar>
</div>
</div>
<div class="ui-g form-group">
<div class="ui-g-12 ui-md-1">
<label>Date</label>
</div>
<div class="ui-g-12 ui-md-3 ui-fluid">
<p-calendar [(ngModel)]="report.Date" name="Date{{report.ObjectID}}" fieldLabel="Date" [showIcon]="true" dataType="string" dateFormat="dd-mm-yy" [showTime]="false"></p-calendar>
</div>
<div class="ui-g-12 ui-md-1">
<label>To</label>
</div>
<div class="ui-g-12 ui-md-3 ui-fluid">
<p-calendar [(ngModel)]="report.To" name="To{{report.ObjectID}}" fieldLabel="To" [showIcon]="true" dataType="string" dateFormat="dd-mm-yy" [showTime]="false"></p-calendar>
</div>
</div>
<div class="ui-g form-group">
<div class="ui-g-12 ui-md-1">
<label>Coupon</label>
</div>
<div class="ui-g-12 ui-md-3 ui-fluid">
<p-autoComplete [(ngModel)]="report.Coupon" name="Coupon{{report.ObjectID}}" fieldLabel="Coupon" field="XXXX" [suggestions]="coupons" (completeMethod)="autoCompleteCoupon($event)"
(onClear)="this.report.Coupon = null" [forceSelection]="true" [minLength]="0"></p-autoComplete>
</div>
<div class="ui-g-12 ui-md-4">
<label> The coupon filter is applies only to Subscription Revenue & One-Off Revenue values </label>
</div>
</div>
<div class="ui-g form-group">
<div class="ui-g-12 ui-md-1 ui-fluid">
<p-button label="Export"></p-button>
</div>
<div class="ui-g-12 ui-md-3 ui-fluid">
<p-button label="Clear"></p-button>
</div>
<div class="ui-g-12 ui-md-1 ui-fluid">
<p-button label="Search"></p-button>
</div>
</div>
<h4></h4><br/>
<p-table #bosTable [columns]="bosCols" [value]="bos" [paginator]="false" >
<ng-template pTemplate="colgroup" let-columns>
<colgroup>
<col *ngFor="let col of columns" [style.width]="col.width">
</colgroup>
</ng-template>
<ng-template pTemplate="header" let-columns>
<tr>
<th *ngFor="let col of columns" [pSortableColumn]="col.field" [pSortableColumnDisabled]="col.noSort">
{{col.header}}
<p-sortIcon [field]="col.field" *ngIf="!col.noSort"></p-sortIcon>
</th>
</tr>
<tr>
<th *ngFor="let col of columns">
<input *ngIf="!col.noFilter" pInputText type="text" (input)="bosTable.filter($event.target.value, col.field, 'contains')">
</th>
</tr>
</ng-template>
<ng-template pTemplate="body" let-rowData let-rowIndex="rowIndex">
<tr>
<td>
{{rowData.Date}}
</td>
<td>
{{rowData.NumberofCareerSeekers}}
</td>
<td>
{{rowData.NumberofPremiumCareerSeekers}}
</td>
<td>
{{rowData.RenewalsDue}}
</td>
<td>
{{rowData.SubscriptionRevenue}}
</td>
<td>
{{rowData.OneOffRevenue}}
</td>
</tr>
</ng-template>
</p-table>
<p-progressSpinner *ngIf="showLoader"></p-progressSpinner>
</form>
\ No newline at end of file
import { Component, OnDestroy, OnInit } from '@angular/core';
import { ActivatedRoute, Router } from '@angular/router';
import { Subscription } from 'rxjs/Subscription';
import { AppService } from '../../../app.service';
import { SaveService } from '../../../oneit/services/save.service';
import { UtilsService } from '../../../oneit/services/utils.service';
import { MatricsReportService } from './matrics-report.service';
@Component({
selector: 'app-matrics-report',
templateUrl: './matrics-report.component.html'
})
export class MatricsReportComponent implements OnInit, OnDestroy {
subscriptions: Array<Subscription> = [];
coupons: any[] = [];
bosCols = [
{ field: 'Date', header: 'Date', width: '17%', noSort: false, noFilter: false},
{ field: 'NumberofCareerSeekers', header: 'Number of Career Seekers', width: '17%', noSort: false, noFilter: false},
{ field: 'NumberofPremiumCareerSeekers', header: 'Number of Premium Career Seekers', width: '17%', noSort: false, noFilter: false},
{ field: 'RenewalsDue', header: 'Renewals Due', width: '17%', noSort: false, noFilter: false},
{ field: 'SubscriptionRevenue', header: 'Subscription Revenue', width: '17%', noSort: false, noFilter: false},
{ field: 'OneOffRevenue', header: 'One-Off Revenue', width: '17%', noSort: false, noFilter: false}
];
showLoader: boolean = false;
constructor(
private router: Router,
private activatedRoute: ActivatedRoute,
private utilsService: UtilsService,
private saveService: SaveService,
private appService: AppService,
private matricsReportService: MatricsReportService
){
}
ngOnInit() {
}
autoCompleteCoupon(event) {
this.subscriptions.push(this.matricsReportService.getCouponsForAutocomplete(event.query, [])
.subscribe(
data => {
for(let obj of data){
//If you need to display anything complex in autocomplete label, put that code here
//e.g. obj.Name = obj.FirstName + ' ' + obj.LastName. So that you can use "Name" attribute in HTML
}
this.coupons = data;
},
error => {
this.utilsService.handleError(error);
}
)
);
}
ngOnDestroy(){
this.utilsService.unsubscribeSubscriptions(this.subscriptions);
}
}
\ No newline at end of file
import { Injectable } from '@angular/core';
import { Observable } from 'rxjs/Observable';
import { SearchService } from '../../../oneit/services/search.service';
import { UtilsService } from '../../../oneit/services/utils.service';
@Injectable()
export class MatricsReportService {
constructor(
private searchService: SearchService,
private utilsService: UtilsService
) {
}
getCouponsForAutocomplete(searchTerm, assocs): Observable<any> {
return this.searchService.getObjects("", "All", {}, assocs, null, null, null, null)
.map(
data => {
return this.utilsService.convertResponseToObjects(data, assocs);
}
);
}
}
\ No newline at end of file
<form #form="ngForm">
<div class="ui-g ui-fluid">
<div class="ui-g-12 nopad">
<p-toolbar>
<div class="ui-toolbar-group-left">
My Career Users
</div>
</p-toolbar>
</div>
</div>
<div class="ui-g form-group" style="margin-bottom: 0px;">
<div class="ui-g-12 ui-md-2">
<label> Search </label>
</div>
<div class="ui-g-12 ui-md-8">
<input [(ngModel)]="myCareerUser.Details" name="Search" fieldLabel="Search" type="text" pInputText class="ui-inputtext" style="width: 90%;"
placeholder="Search for First Name, Last Name, Email and Mobile of the User">
</div>
</div>
<div class="ui-g form-group" style="margin-bottom: 0px;">
<div class="ui-g-12 ui-md-2">
<label>Include Inactive</label>
</div>
<div class="ui-g-12 ui-md-3 ui-fluid">
<p-checkbox [(ngModel)]="myCareerUser.IncludeDisabled" name="IncludeInactive" fieldLabel="Include Inactive" binary="true"></p-checkbox>
</div>
</div>
<div class="ui-g form-group">
<div class="ui-g-12 ui-md-2 ui-fluid">
<p-button label="Clear" (onClick)="onClear()" icon="ui-icon-clear"></p-button>
</div>
<div class="ui-g-12 ui-md-2 ui-fluid">
<p-button label="Search" (onClick)="getCareerUsers(true)" icon="ui-icon-search"></p-button>
</div>
</div>
<span *ngIf="showResults">
<p-table #careerUsersTable [columns]="careerUsersCols" [value]="careerUsers" [paginator]="true" [rows]="50" selectionMode="single" (onRowSelect)="onRowSelect($event.data)">
<ng-template pTemplate="colgroup" let-columns>
<colgroup>
<col *ngFor="let col of columns" [style.width]="col.width">
</colgroup>
</ng-template>
<ng-template pTemplate="header" let-columns>
<tr>
<th *ngFor="let col of columns" [pSortableColumn]="col.field" [pSortableColumnDisabled]="col.noSort">
{{col.header}}
<p-sortIcon [field]="col.field" *ngIf="!col.noSort"></p-sortIcon>
</th>
</tr>
<tr>
<th *ngFor="let col of columns">
<input *ngIf="!col.noFilter" pInputText type="text" (input)="careerUsersTable.filter($event.target.value, col.field, 'contains')">
</th>
</tr>
</ng-template>
<ng-template pTemplate="body" let-rowData>
<tr [pSelectableRow]="rowData">
<td>
{{rowData.FirstName}}
</td>
<td>
{{rowData.LastName}}
</td>
<td>
{{rowData.Email}}
</td>
<td>
{{rowData.Mobile}}
</td>
<td>
{{rowData.Active}}
</td>
<td>
<p-button label="Login as User" (onClick)="loginAsUser(rowData.Candidate.User)" icon="ui-icon-input"></p-button>
</td>
<td>
<button pButton type="button" icon="ui-icon-edit" title="Edit" (click)="onRowSelect(rowData)"></button>
</td>
</tr>
</ng-template>
<ng-template pTemplate="emptymessage" let-columns >
<tr>
<td [attr.colspan]="columns.length">
No CareerUsers found - please try again.
</td>
</tr>
</ng-template>
</p-table>
</span>
<p-progressSpinner *ngIf="showLoader"></p-progressSpinner>
</form>
\ No newline at end of file
import { Component, OnDestroy, OnInit } from '@angular/core';
import { Router } from '@angular/router';
import { Subscription } from 'rxjs/Subscription';
import { SearchService } from '../../../oneit/services/search.service';
import { UtilsService } from '../../../oneit/services/utils.service';
import { MyCareerUser } from './my-career-users.model';
import { MyCareerUsersService } from './my-career-users.service';
@Component({
selector: 'app-my-career-users',
templateUrl: './my-career-users.component.html'
})
export class MyCareerUsersComponent implements OnInit, OnDestroy {
subscriptions: Array<Subscription> = [];
myCareerUser : MyCareerUser = new MyCareerUser();
careerUsers: any[] = [];
showResults: boolean = false;
careerUsersCols = [
{ field: 'FirstName', header: 'First Name', width: '20%', noSort: false, noFilter: false},
{ field: 'LastName', header: 'Last Name', width: '20%', noSort: false, noFilter: false},
{ field: 'Email', header: 'Email', width: '20%', noSort: false, noFilter: false},
{ field: 'Mobile', header: 'Mobile', width: '20%', noSort: false, noFilter: false},
{ field: 'Active', header: 'Active', width: '5%', noSort: false, noFilter: false},
{ field: '', header: '', width: '11%', noSort: true, noFilter: true},
{ field: '', header: '', width: '4%', noSort: true, noFilter: true}
];
showLoader: boolean = false;
constructor(
private router: Router,
private utilsService: UtilsService,
private searchService: SearchService,
private myCareerUsersService: MyCareerUsersService
){
}
ngOnInit() {
this.searchService.getLastSearchRequest("CareerProfiles").subscribe(
data => {
if (data != null) {
this.myCareerUser = data.queryParams;
this.getCareerUsers(false);
}
}
);
}
getCareerUsers(saveSearch: boolean) {
this.showResults = true;
this.showLoader = true;
let assocs = ['Candidate', 'Candidate.User'];
this.subscriptions.push(this.myCareerUsersService.getCareerUsers(this.myCareerUser, assocs, saveSearch)
.subscribe(
data => {
this.careerUsers = data;
this.showLoader = false;
},
error => {
this.showLoader = false;
this.utilsService.handleError(error);
}
)
);
}
loginAsUser(user: any) {
this.showLoader = true;
const params = {
User: user.ObjectID
};
this.utilsService.processObjects('AssumeMCUser', params).subscribe(
() => {
this.showLoader = false;
},
err => {
this.utilsService.handleError(err);
this.showLoader = false;
}
);
}
onClear() {
this.myCareerUser = new MyCareerUser();
this.careerUsers = [];
}
onRowSelect(data) {
this.router.navigate(['/my-career/view-career-user', data.ObjectID]);
}
ngOnDestroy(){
this.utilsService.unsubscribeSubscriptions(this.subscriptions);
}
}
\ No newline at end of file
export class MyCareerUser {
Details: string;
IncludeDisabled: boolean;
}
import { Injectable } from '@angular/core';
import { Observable } from 'rxjs/Observable';
import { SearchService } from '../../../oneit/services/search.service';
import { UtilsService } from '../../../oneit/services/utils.service';
@Injectable()
export class MyCareerUsersService {
constructor(
private searchService: SearchService,
private utilsService: UtilsService
) {
}
getCareerUsers(queryParams, assocs, saveSearch: boolean): Observable<any> {
return this.searchService.searchAndSaveSearchRequest("CareerProfiles", "All", queryParams, assocs, null, null, null, null, "CareerProfiles", saveSearch)
.map(
data => {
return this.utilsService.convertResponseToObjects(data, assocs);
}
);
}
}
\ No newline at end of file
import { Component, OnDestroy, OnInit } from '@angular/core';
import { ActivatedRoute, Params, Router } from '@angular/router';
import { Subscription } from 'rxjs/Subscription';
import { AppService } from '../../../app.service';
import { SaveService } from '../../../oneit/services/save.service';
import { UtilsService } from '../../../oneit/services/utils.service';
import { ViewCareerUserService } from './view-career-user.service';
@Component({
selector: 'app-view-user',
templateUrl: './view-career-user.component.html'
})
export class ViewCareerUserComponent implements OnInit, OnDestroy {
subscriptions: Array<Subscription> = [];
successfulInvitesCols = [
{ field: 'Email', header: 'Email', width: '32%', noSort: true, noFilter: true},
{ field: 'Name', header: 'Name', width: '32%', noSort: true, noFilter: true},
{ field: 'JoinedDate', header: 'Joined Date', width: '32%', noSort: true, noFilter: true},
{ field: '', header: '', width: '3%', noSort: true, noFilter: true}
];
bosCols = [
{ field: 'Field', header: 'Field', width: '25%', noSort: true, noFilter: true},
{ field: 'ChangeType', header: 'Change Type', width: '25%', noSort: true, noFilter: true},
{ field: 'Old', header: 'Old', width: '25%', noSort: true, noFilter: true},
{ field: 'New', header: 'New', width: '25%', noSort: true, noFilter: true}
];
careerUser: any;
showLoader: boolean = false;
constructor(
private router: Router,
private activatedRoute: ActivatedRoute,
private utilsService: UtilsService,
private saveService: SaveService,
private appService: AppService,
private viewUserService: ViewCareerUserService
){
}
ngOnInit() {
this.subscriptions.push(this.activatedRoute.params
.subscribe(
(params: Params) => {
this.showLoader = true;
if (params.id && params.id !== '0') {
this.showLoader = false;
this.getCareerUserByID(params.id);
}
}
));
}
getCareerUserByID(id: string) {
this.showLoader = true;
let assocs = ['Candidate', 'Candidate.User', 'Candidate.ReferredBy'];
this.subscriptions.push(this.viewUserService.getCareerUserByID(id, assocs)
.subscribe(
data => {
this.careerUser = data;
this.showLoader = false;
},
error => {
this.showLoader = false;
this.utilsService.handleError(error);
}
)
);
}
removeReferredBy() {
this.showLoader = true;
const params = {
CareerProfile: this.careerUser
};
this.utilsService.processObjects('RemoveReferredBy', params).subscribe(
() => {
this.getCareerUserByID(this.careerUser.ObjectID);
this.showLoader = false;
},
err => {
this.utilsService.handleError(err);
this.showLoader = false;
}
);
}
addSuccessfulInvites(){
}
ngOnDestroy(){
this.utilsService.unsubscribeSubscriptions(this.subscriptions);
}
}
\ No newline at end of file
import { Injectable } from '@angular/core';
import { Observable } from 'rxjs';
import { SearchService } from '../../../oneit/services/search.service';
import { UtilsService } from '../../../oneit/services/utils.service';
@Injectable()
export class ViewCareerUserService {
constructor(
private searchService: SearchService,
private utilsService: UtilsService
) {
}
getCareerUserByID(id, assocs): Observable<any> {
return this.searchService.getObjectById("CareerProfiles", id, assocs)
.map(
data => {
let objs = this.utilsService.convertResponseToObjects(data, assocs);
if(objs && objs.length > 0){
return objs[0];
}
}
);
}
}
\ No newline at end of file
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