Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
PERFORMA_REPLICA
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Muhammad Usman
PERFORMA_REPLICA
Commits
7113eeee
Commit
7113eeee
authored
Jun 28, 2020
by
chamath
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
View career user Invitation tab completed.
parent
781dee2a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
97 additions
and
28 deletions
+97
-28
view-career-user.component.html
...y-career/view-career-user/view-career-user.component.html
+13
-10
view-career-user.component.ts
.../my-career/view-career-user/view-career-user.component.ts
+84
-18
No files found.
frontend/angular/src/app/components/my-career/view-career-user/view-career-user.component.html
View file @
7113eeee
...
@@ -6,7 +6,7 @@
...
@@ -6,7 +6,7 @@
View User
View User
</div>
</div>
<div
class=
"ui-toolbar-group-right"
>
<div
class=
"ui-toolbar-group-right"
>
<button
pButton
type=
"button"
label=
"Save"
icon=
"ui-icon-save"
(
click
)="
saveUser
(
fals
e
)"
></button>
<button
pButton
type=
"button"
label=
"Save"
icon=
"ui-icon-save"
(
click
)="
saveUser
(
tru
e
)"
></button>
</div>
</div>
<div
class=
"ui-toolbar-group-right"
>
<div
class=
"ui-toolbar-group-right"
>
<button
pButton
type=
"button"
icon=
"ui-icon-cancel"
label=
"Cancel"
[
routerLink
]="['/
my-career
/
my-career-users
']"
<button
pButton
type=
"button"
icon=
"ui-icon-cancel"
label=
"Cancel"
[
routerLink
]="['/
my-career
/
my-career-users
']"
...
@@ -58,11 +58,11 @@
...
@@ -58,11 +58,11 @@
<p-tabPanel
header=
"Invitations"
[
selected
]="
true
"
>
<p-tabPanel
header=
"Invitations"
[
selected
]="
true
"
>
<div
class=
"ui-g-12 ui-md-12"
>
<div
class=
"ui-g-12 ui-md-12"
>
<div
class=
"tab-content"
id=
"v-pills-tabContent"
>
<div
class=
"tab-content"
id=
"v-pills-tabContent"
>
<div
class=
"tab-pane
fade
show active"
id=
"v-pills-details"
role=
"tabpanel"
aria-labelledby=
"v-pills-details-tab"
>
<div
class=
"tab-pane show active"
id=
"v-pills-details"
role=
"tabpanel"
aria-labelledby=
"v-pills-details-tab"
>
<h
2
class=
"tab-header"
>
Invitations
</h2
>
<h
3
class=
"tab-header"
>
Invitations
</h3
>
<h4>
Successful Invites
</h4><br/>
<h4>
Successful Invites
</h4><br/>
<button
pButton
type=
"button"
label=
"Add"
(
click
)="
addSuccessfulInvites
()"
style=
"text-align: center; "
></button>
<button
pButton
type=
"button"
label=
"Add"
(
click
)="
addSuccessfulInvites
()"
style=
"text-align: center; "
></button>
<p-table
#
successfulInvitesTable
[
columns
]="
successfulInvitesCols
"
[
value
]="
successfulInvit
es
"
[
paginator
]="
false
"
>
<p-table
#
successfulInvitesTable
[
columns
]="
successfulInvitesCols
"
[
value
]="
invite
es
"
[
paginator
]="
false
"
>
<ng-template
pTemplate=
"colgroup"
let-columns
>
<ng-template
pTemplate=
"colgroup"
let-columns
>
<colgroup>
<colgroup>
<col
*
ngFor=
"let col of columns"
[
style
.
width
]="
col
.
width
"
>
<col
*
ngFor=
"let col of columns"
[
style
.
width
]="
col
.
width
"
>
...
@@ -79,16 +79,17 @@
...
@@ -79,16 +79,17 @@
<ng-template
pTemplate=
"body"
let-rowData
let-rowIndex=
"rowIndex"
>
<ng-template
pTemplate=
"body"
let-rowData
let-rowIndex=
"rowIndex"
>
<tr>
<tr>
<td>
<td>
{{rowData.Email}}
<input
pInputText
*
ngIf=
"rowData.IsNew"
type=
"text"
class=
"form-control"
[(
ngModel
)]="
rowData
.
Email
"
name=
"Email{{rowIndex}}"
style=
"height: 30px;"
>
{{rowData.IsNew ? "" : rowData?.Email}}
</td>
</td>
<td>
<td>
{{rowData.Name}}
{{rowData
?
.Name}}
</td>
</td>
<td>
<td>
{{rowData
.JoinedDate
}}
{{rowData
?.JoinedDate | oneitdate : 'dd-MMM-yyyy'
}}
</td>
</td>
<td>
<td
style=
"text-align: center;"
>
<button
pButton
type=
"button"
icon=
"ui-icon-edit"
title=
"Edit"
(
click
)="
onRowSelect
(
rowData
)"
></button>
<button
*
ngIf=
"rowData.IsNew"
pButton
type=
"button"
icon=
"ui-icon-delete"
title=
"Remove"
(
click
)="
deleteRow
(
rowData
)"
></button>
</td>
</td>
</tr>
</tr>
</ng-template>
</ng-template>
...
@@ -216,5 +217,6 @@
...
@@ -216,5 +217,6 @@
</p-tabPanel>
</p-tabPanel>
</p-tabView>
</p-tabView>
</div>
</div>
<p-confirmDialog
header=
"Confirmation"
icon=
"pi pi-exclamation-triangle"
appendTo=
"body"
></p-confirmDialog>
<p-progressSpinner
*
ngIf=
"showLoader"
></p-progressSpinner>
<p-progressSpinner
*
ngIf=
"showLoader"
></p-progressSpinner>
</form>
</form>
\ No newline at end of file
frontend/angular/src/app/components/my-career/view-career-user/view-career-user.component.ts
View file @
7113eeee
import
{
Component
,
OnDestroy
,
OnInit
}
from
'@angular/core'
;
import
{
Component
,
OnDestroy
,
OnInit
,
ViewChild
}
from
'@angular/core'
;
import
{
NgForm
}
from
'@angular/forms'
;
import
{
ActivatedRoute
,
Params
,
Router
}
from
'@angular/router'
;
import
{
ActivatedRoute
,
Params
,
Router
}
from
'@angular/router'
;
import
{
ConfirmationService
}
from
'primeng/api'
;
import
{
Subscription
}
from
'rxjs/Subscription'
;
import
{
Subscription
}
from
'rxjs/Subscription'
;
import
{
AppService
}
from
'../../../app.service'
;
import
{
SaveService
}
from
'../../../oneit/services/save.service'
;
import
{
SaveService
}
from
'../../../oneit/services/save.service'
;
import
{
UtilsService
}
from
'../../../oneit/services/utils.service'
;
import
{
UtilsService
}
from
'../../../oneit/services/utils.service'
;
import
{
ViewCareerUserService
}
from
'./view-career-user.service'
;
import
{
ViewCareerUserService
}
from
'./view-career-user.service'
;
...
@@ -14,12 +15,13 @@ import { ViewCareerUserService } from './view-career-user.service';
...
@@ -14,12 +15,13 @@ import { ViewCareerUserService } from './view-career-user.service';
export
class
ViewCareerUserComponent
implements
OnInit
,
OnDestroy
{
export
class
ViewCareerUserComponent
implements
OnInit
,
OnDestroy
{
subscriptions
:
Array
<
Subscription
>
=
[];
subscriptions
:
Array
<
Subscription
>
=
[];
@
ViewChild
(
'form'
)
form
:
NgForm
;
successfulInvitesCols
=
[
successfulInvitesCols
=
[
{
field
:
'Email'
,
header
:
'Email'
,
width
:
'3
2
%'
,
noSort
:
true
,
noFilter
:
true
},
{
field
:
'Email'
,
header
:
'Email'
,
width
:
'3
1
%'
,
noSort
:
true
,
noFilter
:
true
},
{
field
:
'Name'
,
header
:
'Name'
,
width
:
'3
2
%'
,
noSort
:
true
,
noFilter
:
true
},
{
field
:
'Name'
,
header
:
'Name'
,
width
:
'3
1
%'
,
noSort
:
true
,
noFilter
:
true
},
{
field
:
'JoinedDate'
,
header
:
'Joined Date'
,
width
:
'3
2
%'
,
noSort
:
true
,
noFilter
:
true
},
{
field
:
'JoinedDate'
,
header
:
'Joined Date'
,
width
:
'3
1
%'
,
noSort
:
true
,
noFilter
:
true
},
{
field
:
''
,
header
:
''
,
width
:
'
3
%'
,
noSort
:
true
,
noFilter
:
true
}
{
field
:
''
,
header
:
''
,
width
:
'
7
%'
,
noSort
:
true
,
noFilter
:
true
}
];
];
bosCols
=
[
bosCols
=
[
...
@@ -31,13 +33,14 @@ export class ViewCareerUserComponent implements OnInit, OnDestroy {
...
@@ -31,13 +33,14 @@ export class ViewCareerUserComponent implements OnInit, OnDestroy {
careerUser
:
any
;
careerUser
:
any
;
showLoader
:
boolean
=
false
;
showLoader
:
boolean
=
false
;
invitees
:
any
[]
=
[];
constructor
(
constructor
(
private
router
:
Router
,
private
router
:
Router
,
private
activatedRoute
:
ActivatedRoute
,
private
activatedRoute
:
ActivatedRoute
,
private
utilsService
:
UtilsService
,
private
utilsService
:
UtilsService
,
private
saveService
:
SaveService
,
private
saveService
:
SaveService
,
private
appService
:
App
Service
,
private
confirmationService
:
Confirmation
Service
,
private
viewUserService
:
ViewCareerUserService
private
viewUserService
:
ViewCareerUserService
){
){
...
@@ -59,12 +62,21 @@ export class ViewCareerUserComponent implements OnInit, OnDestroy {
...
@@ -59,12 +62,21 @@ export class ViewCareerUserComponent implements OnInit, OnDestroy {
getCareerUserByID
(
id
:
string
)
{
getCareerUserByID
(
id
:
string
)
{
this
.
showLoader
=
true
;
this
.
showLoader
=
true
;
let
assocs
=
[
'Candidate'
,
'Candidate.User'
,
'Candidate.ReferredBy'
];
let
assocs
=
[
'Candidate'
,
'Candidate.User'
,
'Candidate.ReferredBy'
,
'Candidate.Invitees'
,
'Candidate.Invitees.User'
];
this
.
subscriptions
.
push
(
this
.
viewUserService
.
getCareerUserByID
(
id
,
assocs
)
this
.
subscriptions
.
push
(
this
.
viewUserService
.
getCareerUserByID
(
id
,
assocs
)
.
subscribe
(
.
subscribe
(
data
=>
{
data
=>
{
this
.
careerUser
=
data
;
this
.
careerUser
=
data
;
this
.
invitees
=
[];
if
(
this
.
careerUser
.
Candidate
&&
this
.
careerUser
.
Candidate
.
Invitees
)
{
for
(
let
invitee
of
this
.
careerUser
.
Candidate
.
Invitees
)
{
this
.
invitees
.
push
({
Email
:
invitee
.
User
.
Email
,
Name
:
invitee
.
User
.
Name
,
JoinedDate
:
invitee
.
ObjectCreated
,
IsNew
:
false
});
}
}
this
.
careerUser
.
Candidate
.
NewInvitationEmails
=
[];
this
.
showLoader
=
false
;
this
.
showLoader
=
false
;
},
},
error
=>
{
error
=>
{
...
@@ -75,6 +87,45 @@ export class ViewCareerUserComponent implements OnInit, OnDestroy {
...
@@ -75,6 +87,45 @@ export class ViewCareerUserComponent implements OnInit, OnDestroy {
);
);
}
}
saveUser
(
reload
:
boolean
)
{
this
.
utilsService
.
clearErrorMessages
();
if
(
this
.
form
.
invalid
)
{
this
.
utilsService
.
showAllErrorMessages
();
}
else
{
this
.
showLoader
=
true
;
let
updatedObjs
=
{};
this
.
careerUser
.
Candidate
.
NewInvitationEmails
=
[];
for
(
let
invitee
of
this
.
invitees
)
{
if
(
invitee
.
IsNew
)
{
this
.
careerUser
.
Candidate
.
NewInvitationEmails
.
push
(
invitee
.
Email
);
}
}
this
.
utilsService
.
addObjsToJSONByObjectID
(
updatedObjs
,
[
this
.
careerUser
.
Candidate
]);
this
.
subscriptions
.
push
(
this
.
saveService
.
saveObjectsWithDefaultSvc
({},
updatedObjs
,
{})
.
subscribe
(
data
=>
{
this
.
utilsService
.
handleSuccess
();
if
(
reload
)
{
let
idToNavigate
=
this
.
careerUser
.
ObjectID
;
this
.
getCareerUserByID
(
idToNavigate
);
}
else
{
this
.
router
.
navigate
([
"/my-career/my-career-users"
]);
}
this
.
showLoader
=
false
;
},
error
=>
{
this
.
showLoader
=
false
;
this
.
utilsService
.
handleError
(
error
);
}
)
);
}
}
removeReferredBy
()
{
removeReferredBy
()
{
this
.
showLoader
=
true
;
this
.
showLoader
=
true
;
const
params
=
{
const
params
=
{
...
@@ -82,18 +133,33 @@ export class ViewCareerUserComponent implements OnInit, OnDestroy {
...
@@ -82,18 +133,33 @@ export class ViewCareerUserComponent implements OnInit, OnDestroy {
};
};
this
.
utilsService
.
processObjects
(
'RemoveReferredBy'
,
params
).
subscribe
(
this
.
utilsService
.
processObjects
(
'RemoveReferredBy'
,
params
).
subscribe
(
()
=>
{
()
=>
{
this
.
getCareerUserByID
(
this
.
careerUser
.
ObjectID
);
this
.
getCareerUserByID
(
this
.
careerUser
.
ObjectID
);
this
.
showLoader
=
false
;
this
.
showLoader
=
false
;
},
},
err
=>
{
err
=>
{
this
.
utilsService
.
handleError
(
err
);
this
.
utilsService
.
handleError
(
err
);
this
.
showLoader
=
false
;
this
.
showLoader
=
false
;
}
}
);
);
}
}
addSuccessfulInvites
(){
addSuccessfulInvites
()
{
this
.
invitees
.
push
({
Email
:
''
,
IsNew
:
true
});
}
deleteRow
(
invitee
:
any
)
{
this
.
utilsService
.
clearErrorMessages
();
this
.
confirmationService
.
confirm
({
message
:
'Are you sure you want to delete this record?'
,
header
:
'Delete Confirmation'
,
icon
:
'fa fa-trash'
,
accept
:
()
=>
{
const
index
=
this
.
invitees
.
indexOf
(
invitee
);
this
.
invitees
.
splice
(
index
,
1
);
}
});
}
}
ngOnDestroy
(){
ngOnDestroy
(){
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment