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
2f4640ff
Commit
2f4640ff
authored
Jul 22, 2020
by
Muhammad Usman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
go back to prev question
parent
0e4837db
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
52 additions
and
15 deletions
+52
-15
work-preference.component.html
...assessment/work-preference/work-preference.component.html
+11
-2
work-preference.component.ts
...b/assessment/work-preference/work-preference.component.ts
+9
-3
work-style.component.html
...areer-web/assessment/work-style/work-style.component.html
+14
-3
work-style.component.ts
...-career-web/assessment/work-style/work-style.component.ts
+9
-3
work-preference-question.model.ts
...pp/my-career-web/models/work-preference-question.model.ts
+2
-0
work-style-question.model.ts
...src/app/my-career-web/models/work-style-question.model.ts
+1
-0
assessment.service.ts
...ular/src/app/my-career-web/services/assessment.service.ts
+6
-4
clck.png
frontend/angular/src/assets/images/clck.png
+0
-0
No files found.
frontend/angular/src/app/my-career-web/assessment/work-preference/work-preference.component.html
View file @
2f4640ff
...
@@ -19,7 +19,9 @@
...
@@ -19,7 +19,9 @@
<div
class=
"assessment-body-header"
>
<div
class=
"assessment-body-header"
>
<div
class=
"assessment-heading"
>
Workplace Preferences
</div>
<div
class=
"assessment-heading"
>
Workplace Preferences
</div>
<span
class=
"assessment-estimation"
>
<i
class=
"fa fa-clock-o"
></i>
<strong>
Estimated time to complete
</strong>
: 5 mins
</span>
<span
class=
"assessment-estimation"
>
<img
src=
"assets/images/clck.png"
alt=
""
style=
"width: 16px; margin-top: -2px;"
>
<strong>
Estimated time to complete
</strong>
: 5 mins
</span>
</div>
</div>
<div
class=
"assessment-body-description"
>
<div
class=
"assessment-body-description"
>
...
@@ -34,10 +36,17 @@
...
@@ -34,10 +36,17 @@
<div
class=
"answer-options"
>
<div
class=
"answer-options"
>
<div
class=
"answer-option"
*
ngFor=
"let question of workPreferenceQuestion?.CultureElement?.Questions"
>
<div
class=
"answer-option"
*
ngFor=
"let question of workPreferenceQuestion?.CultureElement?.Questions"
>
<p-radioButton
[
label
]="
question
.
Description
"
name=
"ANSWER"
[
value
]="
question
.
ObjectID
"
(
onClick
)="
submitAnswer
(
question
)"
>
<p-radioButton
[
(
ngModel
)]="
selectedAns
"
[
label
]="
question
.
Description
"
name=
"ANSWER"
[
value
]="
question
.
ObjectID
"
(
onClick
)="
submitAnswer
(
question
)"
>
</p-radioButton>
</p-radioButton>
</div>
</div>
</div>
</div>
<hr
class=
"mt-5"
>
<div
class=
"d-flex justify-content-center mt-5"
>
<button
class=
"ui-button-info mc-btn-primary"
(
click
)="
initiateWorkPreference
(
true
)"
*
ngIf=
"workPreferenceQuestion.QuestionNo > 1"
pButton
label=
"Go Back"
></button>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
...
...
frontend/angular/src/app/my-career-web/assessment/work-preference/work-preference.component.ts
View file @
2f4640ff
...
@@ -18,11 +18,12 @@ import { ToasterService } from '../../services/toaster.service';
...
@@ -18,11 +18,12 @@ import { ToasterService } from '../../services/toaster.service';
export
class
WorkPreferenceComponent
extends
BaseComponent
implements
OnInit
,
OnDestroy
{
export
class
WorkPreferenceComponent
extends
BaseComponent
implements
OnInit
,
OnDestroy
{
workPreferenceQuestion
=
new
WorkPreferenceQuestionModel
();
workPreferenceQuestion
=
new
WorkPreferenceQuestionModel
();
assocs
=
[
'CultureElement'
,
'CultureElement.Questions'
];
assocs
=
[
'CultureElement'
,
'CultureElement.Questions'
,
'SelectedQuestion'
];
wasUpdated
=
false
;
wasUpdated
=
false
;
autoSaveInterval
;
autoSaveInterval
;
autoSavedOn
;
autoSavedOn
;
autoSaveLabel
=
'a few seconds ago'
;
autoSaveLabel
=
'a few seconds ago'
;
selectedAns
;
constructor
(
constructor
(
private
assessmentService
:
AssessmentService
,
private
assessmentService
:
AssessmentService
,
...
@@ -38,9 +39,9 @@ export class WorkPreferenceComponent extends BaseComponent implements OnInit, On
...
@@ -38,9 +39,9 @@ export class WorkPreferenceComponent extends BaseComponent implements OnInit, On
this
.
setAutoSaveInterval
();
this
.
setAutoSaveInterval
();
}
}
initiateWorkPreference
():
void
{
initiateWorkPreference
(
previousQuestion
=
false
):
void
{
this
.
isLoading
=
true
;
this
.
isLoading
=
true
;
this
.
assessmentService
.
getWorkPreferences
(
this
.
assocs
)
this
.
assessmentService
.
getWorkPreferences
(
this
.
assocs
,
previousQuestion
)
.
pipe
(
takeUntil
(
this
.
componentInView
))
.
pipe
(
takeUntil
(
this
.
componentInView
))
.
subscribe
(
response
=>
{
.
subscribe
(
response
=>
{
this
.
isLoading
=
false
;
this
.
isLoading
=
false
;
...
@@ -49,6 +50,9 @@ export class WorkPreferenceComponent extends BaseComponent implements OnInit, On
...
@@ -49,6 +50,9 @@ export class WorkPreferenceComponent extends BaseComponent implements OnInit, On
this
.
wasUpdated
=
true
;
this
.
wasUpdated
=
true
;
if
(
response
.
length
>
0
)
{
if
(
response
.
length
>
0
)
{
this
.
workPreferenceQuestion
=
response
[
0
];
this
.
workPreferenceQuestion
=
response
[
0
];
if
(
this
.
workPreferenceQuestion
.
SelectedQuestion
)
{
this
.
selectedAns
=
this
.
workPreferenceQuestion
.
SelectedQuestion
.
ObjectID
;
}
}
else
{
}
else
{
this
.
exit
();
this
.
exit
();
}
}
...
@@ -78,6 +82,7 @@ export class WorkPreferenceComponent extends BaseComponent implements OnInit, On
...
@@ -78,6 +82,7 @@ export class WorkPreferenceComponent extends BaseComponent implements OnInit, On
}
}
submitAnswer
(
question
:
QuestionModel
):
void
{
submitAnswer
(
question
:
QuestionModel
):
void
{
this
.
selectedAns
=
question
.
ObjectID
;
const
formData
=
{
const
formData
=
{
CultureElement
:
this
.
workPreferenceQuestion
.
CultureElement
.
ObjectID
,
CultureElement
:
this
.
workPreferenceQuestion
.
CultureElement
.
ObjectID
,
SelectedQuestion
:
question
.
ObjectID
,
SelectedQuestion
:
question
.
ObjectID
,
...
@@ -86,6 +91,7 @@ export class WorkPreferenceComponent extends BaseComponent implements OnInit, On
...
@@ -86,6 +91,7 @@ export class WorkPreferenceComponent extends BaseComponent implements OnInit, On
this
.
isLoading
=
true
;
this
.
isLoading
=
true
;
this
.
assessmentService
.
saveWorkPreferences
(
formData
)
this
.
assessmentService
.
saveWorkPreferences
(
formData
)
.
subscribe
(
response
=>
{
.
subscribe
(
response
=>
{
this
.
selectedAns
=
null
;
this
.
isLoading
=
false
;
this
.
isLoading
=
false
;
this
.
autoSavedOn
=
new
Date
();
this
.
autoSavedOn
=
new
Date
();
this
.
autoSave
();
this
.
autoSave
();
...
...
frontend/angular/src/app/my-career-web/assessment/work-style/work-style.component.html
View file @
2f4640ff
...
@@ -19,7 +19,10 @@
...
@@ -19,7 +19,10 @@
<div
class=
"assessment-body-header"
>
<div
class=
"assessment-body-header"
>
<div
class=
"assessment-heading"
>
Work Style
</div>
<div
class=
"assessment-heading"
>
Work Style
</div>
<span
class=
"assessment-estimation"
>
<i
class=
"fa fa-clock-o"
></i>
<strong>
Estimated time to complete
</strong>
: 20 mins
</span>
<span
class=
"assessment-estimation"
>
<img
src=
"assets/images/clck.png"
alt=
""
style=
"width: 16px; margin-top: -2px;"
>
<strong>
Estimated time to complete
</strong>
: 20 mins
</span>
</div>
</div>
<div
class=
"assessment-body-description"
>
<div
class=
"assessment-body-description"
>
...
@@ -39,21 +42,29 @@
...
@@ -39,21 +42,29 @@
<div
class=
"answer-wrapper"
*
ngIf=
"!isMobileView"
>
<div
class=
"answer-wrapper"
*
ngIf=
"!isMobileView"
>
<span
class=
"extreme-label-left"
>
{{workStyleQuestion.LeftScaleText}}
</span>
<span
class=
"extreme-label-left"
>
{{workStyleQuestion.LeftScaleText}}
</span>
<div
class=
"answer-options"
>
<div
class=
"answer-options"
>
<span
class=
"option-value"
*
ngFor=
"let scale of answerScales;"
(
click
)="
submitAnswer
(
scale
)"
>
{{scale}}
</span>
<span
class=
"option-value"
[
class
.
selected
]="
selectedAns =
==
scale
"
*
ngFor=
"let scale of answerScales;"
(
click
)="
submitAnswer
(
scale
)"
>
{{scale}}
</span>
</div>
</div>
<span
class=
"extreme-label-right"
>
{{workStyleQuestion.RightScaleText}}
</span>
<span
class=
"extreme-label-right"
>
{{workStyleQuestion.RightScaleText}}
</span>
</div>
</div>
<div
class=
"answer-wrapper"
*
ngIf=
"isMobileView"
>
<div
class=
"answer-wrapper"
*
ngIf=
"isMobileView"
>
<div
class=
"answer-options"
>
<div
class=
"answer-options"
>
<span
class=
"option-value"
*
ngFor=
"let scale of answerScales;"
(
click
)="
submitAnswer
(
scale
)"
>
{{scale}}
</span>
<span
class=
"option-value"
[
class
.
selected
]="
selectedAns =
==
scale
"
*
ngFor=
"let scale of answerScales;"
(
click
)="
submitAnswer
(
scale
)"
>
{{scale}}
</span>
</div>
</div>
<div
class=
"answer-option-labels"
>
<div
class=
"answer-option-labels"
>
<span
class=
"extreme-label-left"
>
{{workStyleQuestion.LeftScaleText}}
</span>
<span
class=
"extreme-label-left"
>
{{workStyleQuestion.LeftScaleText}}
</span>
<span
class=
"extreme-label-right"
>
{{workStyleQuestion.RightScaleText}}
</span>
<span
class=
"extreme-label-right"
>
{{workStyleQuestion.RightScaleText}}
</span>
</div>
</div>
</div>
</div>
<hr
class=
"mt-5"
>
<div
class=
"d-flex justify-content-center mt-5"
>
<button
class=
"ui-button-info mc-btn-primary"
(
click
)="
initiateWorkStyle
(
true
)"
*
ngIf=
"workStyleQuestion.QuestionNo > 1"
pButton
label=
"Go Back"
></button>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
...
...
frontend/angular/src/app/my-career-web/assessment/work-style/work-style.component.ts
View file @
2f4640ff
...
@@ -16,12 +16,13 @@ import { ToasterService } from '../../services/toaster.service';
...
@@ -16,12 +16,13 @@ import { ToasterService } from '../../services/toaster.service';
export
class
WorkStyleComponent
extends
BaseComponent
implements
OnInit
,
OnDestroy
{
export
class
WorkStyleComponent
extends
BaseComponent
implements
OnInit
,
OnDestroy
{
workStyleQuestion
=
new
WorkStyleQuestionModel
();
workStyleQuestion
=
new
WorkStyleQuestionModel
();
assocs
=
[
'Question'
];
assocs
=
[
'Question'
,
'SelectedQuestion'
];
answerScales
=
[];
answerScales
=
[];
autoSaveInterval
;
autoSaveInterval
;
autoSavedOn
;
autoSavedOn
;
autoSaveLabel
=
'a few seconds ago'
;
autoSaveLabel
=
'a few seconds ago'
;
wasUpdated
=
false
;
wasUpdated
=
false
;
selectedAns
;
constructor
(
constructor
(
private
assessmentService
:
AssessmentService
,
private
assessmentService
:
AssessmentService
,
...
@@ -37,9 +38,9 @@ export class WorkStyleComponent extends BaseComponent implements OnInit, OnDestr
...
@@ -37,9 +38,9 @@ export class WorkStyleComponent extends BaseComponent implements OnInit, OnDestr
this
.
setAutoSaveInterval
();
this
.
setAutoSaveInterval
();
}
}
initiateWorkStyle
():
void
{
initiateWorkStyle
(
previousQuestion
=
false
):
void
{
this
.
isLoading
=
true
;
this
.
isLoading
=
true
;
this
.
assessmentService
.
getWorkStyle
(
this
.
assocs
)
this
.
assessmentService
.
getWorkStyle
(
this
.
assocs
,
previousQuestion
)
.
pipe
(
takeUntil
(
this
.
componentInView
))
.
pipe
(
takeUntil
(
this
.
componentInView
))
.
subscribe
(
response
=>
{
.
subscribe
(
response
=>
{
this
.
isLoading
=
false
;
this
.
isLoading
=
false
;
...
@@ -47,6 +48,9 @@ export class WorkStyleComponent extends BaseComponent implements OnInit, OnDestr
...
@@ -47,6 +48,9 @@ export class WorkStyleComponent extends BaseComponent implements OnInit, OnDestr
this
.
autoSave
();
this
.
autoSave
();
if
(
response
.
length
>
0
)
{
if
(
response
.
length
>
0
)
{
this
.
workStyleQuestion
=
response
[
0
];
this
.
workStyleQuestion
=
response
[
0
];
this
.
selectedAns
=
this
.
workStyleQuestion
.
Answer
?
this
.
workStyleQuestion
.
Answer
:
null
;
}
else
{
this
.
exit
();
}
}
this
.
setAnswerScales
();
this
.
setAnswerScales
();
},
err
=>
{
},
err
=>
{
...
@@ -66,6 +70,7 @@ export class WorkStyleComponent extends BaseComponent implements OnInit, OnDestr
...
@@ -66,6 +70,7 @@ export class WorkStyleComponent extends BaseComponent implements OnInit, OnDestr
}
}
submitAnswer
(
scale
):
void
{
submitAnswer
(
scale
):
void
{
this
.
selectedAns
=
scale
;
const
formData
=
{
const
formData
=
{
Question
:
this
.
workStyleQuestion
.
Question
.
ObjectID
,
Question
:
this
.
workStyleQuestion
.
Question
.
ObjectID
,
Answer
:
scale
,
Answer
:
scale
,
...
@@ -74,6 +79,7 @@ export class WorkStyleComponent extends BaseComponent implements OnInit, OnDestr
...
@@ -74,6 +79,7 @@ export class WorkStyleComponent extends BaseComponent implements OnInit, OnDestr
this
.
isLoading
=
true
;
this
.
isLoading
=
true
;
this
.
assessmentService
.
saveWorkStyle
(
formData
)
this
.
assessmentService
.
saveWorkStyle
(
formData
)
.
subscribe
(
response
=>
{
.
subscribe
(
response
=>
{
this
.
selectedAns
=
null
;
this
.
isLoading
=
false
;
this
.
isLoading
=
false
;
this
.
autoSavedOn
=
new
Date
();
this
.
autoSavedOn
=
new
Date
();
this
.
autoSave
();
this
.
autoSave
();
...
...
frontend/angular/src/app/my-career-web/models/work-preference-question.model.ts
View file @
2f4640ff
import
{
BaseModel
}
from
'./base.model'
;
import
{
BaseModel
}
from
'./base.model'
;
import
{
CLASSES
}
from
'../config/constants'
;
import
{
CLASSES
}
from
'../config/constants'
;
import
{
CultureElementModel
}
from
'./culture-element.model'
;
import
{
CultureElementModel
}
from
'./culture-element.model'
;
import
{
QuestionModel
}
from
'./question.model'
;
export
class
WorkPreferenceQuestionModel
extends
BaseModel
{
export
class
WorkPreferenceQuestionModel
extends
BaseModel
{
ObjectClass
=
CLASSES
.
WORK_PREFERENCE_QUESTION
;
ObjectClass
=
CLASSES
.
WORK_PREFERENCE_QUESTION
;
...
@@ -8,4 +9,5 @@ export class WorkPreferenceQuestionModel extends BaseModel {
...
@@ -8,4 +9,5 @@ export class WorkPreferenceQuestionModel extends BaseModel {
IntroductoryText
:
string
;
IntroductoryText
:
string
;
QuestionNo
:
number
;
QuestionNo
:
number
;
CultureElement
:
CultureElementModel
;
CultureElement
:
CultureElementModel
;
SelectedQuestion
:
QuestionModel
;
}
}
frontend/angular/src/app/my-career-web/models/work-style-question.model.ts
View file @
2f4640ff
...
@@ -12,4 +12,5 @@ export class WorkStyleQuestionModel extends BaseModel {
...
@@ -12,4 +12,5 @@ export class WorkStyleQuestionModel extends BaseModel {
RightScaleText
:
string
;
RightScaleText
:
string
;
Scalar
:
null
;
Scalar
:
null
;
Question
:
QuestionModel
;
Question
:
QuestionModel
;
Answer
:
number
;
}
}
frontend/angular/src/app/my-career-web/services/assessment.service.ts
View file @
2f4640ff
...
@@ -11,8 +11,9 @@ export class AssessmentService {
...
@@ -11,8 +11,9 @@ export class AssessmentService {
private
searchService
:
SearchService
private
searchService
:
SearchService
)
{
}
)
{
}
getWorkStyle
(
assocs
=
[]):
Observable
<
any
>
{
getWorkStyle
(
assocs
=
[],
previousQuestion
):
Observable
<
any
>
{
return
this
.
searchService
.
getObjects
(
'WorkStyle'
,
'All'
,
''
,
assocs
,
null
,
null
,
null
,
null
)
const
queryParams
=
previousQuestion
?
{
IsBack
:
true
}
:
''
;
return
this
.
searchService
.
getObjects
(
'WorkStyle'
,
'All'
,
queryParams
,
assocs
,
null
,
null
,
null
,
null
)
.
map
(
.
map
(
data
=>
{
data
=>
{
return
this
.
utilsService
.
convertResponseToObjects
(
data
,
assocs
);
return
this
.
utilsService
.
convertResponseToObjects
(
data
,
assocs
);
...
@@ -20,8 +21,9 @@ export class AssessmentService {
...
@@ -20,8 +21,9 @@ export class AssessmentService {
)
)
}
}
getWorkPreferences
(
assocs
=
[]):
Observable
<
any
>
{
getWorkPreferences
(
assocs
=
[],
previousQuestion
=
false
):
Observable
<
any
>
{
return
this
.
searchService
.
getObjects
(
'WorkPreferences'
,
'All'
,
''
,
assocs
,
null
,
null
,
null
,
null
)
const
queryParams
=
previousQuestion
?
{
IsBack
:
true
}
:
''
;
return
this
.
searchService
.
getObjects
(
'WorkPreferences'
,
'All'
,
queryParams
,
assocs
,
null
,
null
,
null
,
null
)
.
map
(
.
map
(
data
=>
{
data
=>
{
return
this
.
utilsService
.
convertResponseToObjects
(
data
,
assocs
);
return
this
.
utilsService
.
convertResponseToObjects
(
data
,
assocs
);
...
...
frontend/angular/src/assets/images/clck.png
0 → 100644
View file @
2f4640ff
4.94 KB
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