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
47b1776e
Commit
47b1776e
authored
Jun 19, 2020
by
Muhammad Usman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
work style api integrated & completed
parent
36e197ec
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
139 additions
and
26 deletions
+139
-26
work-style.component.html
...areer-web/assessment/work-style/work-style.component.html
+11
-16
work-style.component.scss
...areer-web/assessment/work-style/work-style.component.scss
+2
-0
work-style.component.ts
...-career-web/assessment/work-style/work-style.component.ts
+87
-4
constants.ts
...ular/src/app/components/my-career-web/config/constants.ts
+3
-1
profile-tasks.component.ts
...er-web/dashboard/profile-tasks/profile-tasks.component.ts
+1
-1
question.model.ts
...src/app/components/my-career-web/models/question.model.ts
+7
-0
work-style-question.model.ts
...ponents/my-career-web/models/work-style-question.model.ts
+15
-0
assessment.service.ts
...p/components/my-career-web/services/assessment.service.ts
+13
-4
No files found.
frontend/angular/src/app/components/my-career-web/assessment/work-style/work-style.component.html
View file @
47b1776e
...
...
@@ -7,12 +7,12 @@
</div>
<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>
<p-progressBar
[
value
]="
20
"
></p-progressBar>
<p-progressBar
[
value
]="
workStyleQuestion
.
Percentage
"
></p-progressBar>
<div
class=
"assessment-body container"
>
...
...
@@ -23,33 +23,28 @@
</div>
<div
class=
"assessment-body-description"
>
Using the scale given, indicate how important to you are the following aspects in your work life.
{{workStyleQuestion.IntroductoryText}}
</div>
<div
class=
"assessment-body-question-wrapper mc-card"
>
<app-overlay
[
isActive
]="
isLoading
"
></app-overlay>
<div
class=
"question-title"
>
How important to you is the following in your work life?
</div>
<div
class=
"question-completed"
>
0
%
</div>
<div
class=
"question-title"
>
{{workStyleQuestion.Title}}
</div>
<div
class=
"question-completed"
>
{{workStyleQuestion.Percentage}}
%
</div>
<div
class=
"question-tag"
>
FLEXIBILITY AT WORK
</div>
<div
class=
"question-tag"
>
{{workStyleQuestion.Question?.Description}}
</div>
<div
class=
"answer-wrapper"
>
<span
class=
"extreme-label-left"
>
Not very important
</span>
<span
class=
"extreme-label-left"
>
{{workStyleQuestion.LeftScaleText}}
</span>
<div
class=
"answer-options"
>
<span
class=
"option-value"
>
1
</span>
<span
class=
"option-value"
>
2
</span>
<span
class=
"option-value"
>
3
</span>
<span
class=
"option-value"
>
4
</span>
<span
class=
"option-value"
>
5
</span>
<span
class=
"option-value"
>
6
</span>
<span
class=
"option-value"
>
7
</span>
<span
class=
"option-value"
*
ngFor=
"let scale of answerScales;"
(
click
)="
submitAnswer
(
scale
)"
>
{{scale}}
</span>
</div>
<span
class=
"extreme-label-right"
>
Very important
</span>
<span
class=
"extreme-label-right"
>
{{workStyleQuestion.RightScaleText}}
</span>
</div>
</div>
</div>
...
...
frontend/angular/src/app/components/my-career-web/assessment/work-style/work-style.component.scss
View file @
47b1776e
...
...
@@ -104,6 +104,7 @@
background
:
$primaryColor
;
padding
:
12px
;
margin-bottom
:
56px
;
text-transform
:
uppercase
;
}
&
-completed
{
...
...
@@ -217,6 +218,7 @@
.question-tag
{
margin-bottom
:
24px
!
important
;
text-transform
:
uppercase
;
}
.answer-wrapper
{
...
...
frontend/angular/src/app/components/my-career-web/assessment/work-style/work-style.component.ts
View file @
47b1776e
import
{
Component
,
OnInit
}
from
'@angular/core'
;
import
{
Component
,
On
Destroy
,
On
Init
}
from
'@angular/core'
;
import
{
BaseComponent
}
from
'../../base/base.component'
;
import
{
AssessmentService
}
from
'../../services/assessment.service'
;
import
{
takeUntil
}
from
'rxjs/operators'
;
import
{
HelperService
}
from
'../../services/helper.service'
;
import
{
WorkStyleQuestionModel
}
from
'../../models/work-style-question.model'
;
import
{
Router
}
from
'@angular/router'
;
import
*
as
moment
from
'moment'
;
@
Component
({
selector
:
'app-work-style'
,
templateUrl
:
'./work-style.component.html'
,
styleUrls
:
[
'./work-style.component.scss'
]
})
export
class
WorkStyleComponent
extends
BaseComponent
implements
OnInit
{
export
class
WorkStyleComponent
extends
BaseComponent
implements
OnInit
,
OnDestroy
{
workStyleQuestion
=
new
WorkStyleQuestionModel
();
assocs
=
[
'Question'
];
answerScales
=
[];
autoSaveInterval
;
autoSavedOn
;
autoSaveLabel
=
''
;
constructor
(
private
as
:
AssessmentService
private
as
:
AssessmentService
,
private
hs
:
HelperService
,
private
r
:
Router
)
{
super
();
}
ngOnInit
()
{
//
this
.
initiateWorkStyle
();
this
.
setAutoSaveInterval
();
}
initiateWorkStyle
():
void
{
this
.
isLoading
=
true
;
this
.
as
.
getWorkStyle
(
this
.
assocs
)
.
pipe
(
takeUntil
(
this
.
componentInView
))
.
subscribe
(
response
=>
{
this
.
isLoading
=
false
;
this
.
autoSavedOn
=
new
Date
();
if
(
response
.
length
>
0
)
{
this
.
workStyleQuestion
=
response
[
0
];
}
this
.
setAnswerScales
();
},
err
=>
{
this
.
isLoading
=
false
;
this
.
hs
.
handleHttpError
(
err
);
});
}
setAnswerScales
():
void
{
this
.
answerScales
=
[];
for
(
let
i
=
1
;
i
<=
(
this
.
workStyleQuestion
.
Scalar
||
1
);
i
++
)
{
this
.
answerScales
.
push
(
i
);
}
}
submitAnswer
(
scale
):
void
{
const
formData
=
{
Question
:
this
.
workStyleQuestion
.
Question
.
ObjectID
,
Answer
:
scale
,
Continue
:
true
};
this
.
isLoading
=
true
;
this
.
as
.
saveWorkStyle
(
formData
)
.
subscribe
(
response
=>
{
this
.
isLoading
=
false
;
this
.
autoSavedOn
=
new
Date
();
this
.
autoSave
();
if
(
response
.
NextQuestion
)
{
this
.
workStyleQuestion
=
response
.
NextQuestion
;
this
.
setAnswerScales
();
}
},
err
=>
{
this
.
isLoading
=
false
;
this
.
hs
.
handleHttpError
(
err
);
});
}
exit
():
void
{
this
.
r
.
navigate
([
'/my-career-web/dashboard/home'
]);
}
setAutoSaveInterval
():
void
{
if
(
!
this
.
autoSaveInterval
)
{
setInterval
(()
=>
{
this
.
autoSave
();
},
60000
);
}
}
autoSave
():
void
{
this
.
autoSaveLabel
=
moment
(
this
.
autoSavedOn
).
fromNow
();
}
ngOnDestroy
():
void
{
super
.
ngOnDestroy
();
if
(
this
.
autoSaveInterval
)
{
clearInterval
(
this
.
autoSaveInterval
);
}
}
}
frontend/angular/src/app/components/my-career-web/config/constants.ts
View file @
47b1776e
...
...
@@ -14,7 +14,9 @@ export const CLASSES = {
CANDIDATE
:
'performa.orm.Candidate'
,
USER
:
'oneit.security.SecUser'
,
JOB
:
'performa.orm.Job'
,
CAREER_PROFILE
:
'performa.orm.CareerProfile'
CAREER_PROFILE
:
'performa.orm.CareerProfile'
,
WORK_STYLE_QUESTION
:
'performa.orm.WorkStyleQuestionNP'
,
QUESTION
:
'performa.orm.Question'
};
export
const
SERVICES
=
{
...
...
frontend/angular/src/app/components/my-career-web/dashboard/profile-tasks/profile-tasks.component.ts
View file @
47b1776e
...
...
@@ -19,7 +19,7 @@ export class ProfileTasksComponent extends BaseComponent {
assocs
=
[
'Candidate.User'
,
'Candidate.OccupationPreference'
];
profileTasks
=
[
{
label
:
'Personal Details'
,
link
:
'/my-career-web/dashboard/personal-details'
,
key
:
'CompletedPercentage'
,
active
:
false
},
{
label
:
'Work Strengths'
,
link
:
'/my-career-web/assessment/work-style'
,
key
:
''
,
active
:
false
},
{
label
:
'Work Strengths'
,
link
:
'/my-career-web/assessment
s
/work-style'
,
key
:
''
,
active
:
false
},
{
label
:
'Career Values'
,
link
:
''
,
key
:
''
,
active
:
false
},
{
label
:
'Career History'
,
link
:
''
,
key
:
''
,
active
:
false
},
{
label
:
'Diversity'
,
link
:
''
,
key
:
''
,
active
:
false
}
...
...
frontend/angular/src/app/components/my-career-web/models/question.model.ts
0 → 100644
View file @
47b1776e
import
{
BaseModel
}
from
'./base.model'
;
import
{
CLASSES
}
from
'../config/constants'
;
export
class
QuestionModel
extends
BaseModel
{
Description
:
string
;
ObjectClass
=
CLASSES
.
QUESTION
}
frontend/angular/src/app/components/my-career-web/models/work-style-question.model.ts
0 → 100644
View file @
47b1776e
import
{
BaseModel
}
from
'./base.model'
;
import
{
CLASSES
}
from
'../config/constants'
;
import
{
QuestionModel
}
from
'./question.model'
;
export
class
WorkStyleQuestionModel
extends
BaseModel
{
ObjectClass
=
CLASSES
.
WORK_STYLE_QUESTION
;
QuestionNo
:
string
;
Percentage
:
number
;
IntroductoryText
:
string
;
Title
:
null
;
LeftScaleText
:
string
;
RightScaleText
:
string
;
Scalar
:
null
;
Question
:
QuestionModel
;
}
frontend/angular/src/app/components/my-career-web/services/assessment.service.ts
View file @
47b1776e
import
{
Injectable
}
from
'@angular/core'
;
import
{
ApiService
}
from
'../../../oneit/services/api.service'
;
import
{
Observable
}
from
'rxjs'
;
import
{
SearchService
}
from
'../../../oneit/services/search.service'
;
import
{
UtilsService
}
from
'../../../oneit/services/utils.service'
;
@
Injectable
()
export
class
AssessmentService
{
constructor
(
private
as
:
Api
Service
,
private
us
:
Utils
Service
,
private
ss
:
SearchService
)
{
}
getWorkStyles
():
Observable
<
any
>
{
return
this
.
ss
.
getObjects
(
'WorkStyle'
,
'ALL'
,
''
,
[],
null
,
null
,
null
,
null
)
getWorkStyle
(
assocs
=
[]):
Observable
<
any
>
{
return
this
.
ss
.
getObjects
(
'WorkStyle'
,
'All'
,
''
,
assocs
,
null
,
null
,
null
,
null
)
.
map
(
data
=>
{
return
this
.
us
.
convertResponseToObjects
(
data
,
assocs
);
}
)
}
saveWorkStyle
(
params
):
Observable
<
any
>
{
return
this
.
us
.
processObjects
(
'SaveWorkStyle'
,
params
);
}
...
...
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