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
7d463ed7
Commit
7d463ed7
authored
Nov 22, 2019
by
GD-A-150752
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
edit-workflow-template 85%
parent
5121545b
Show whitespace changes
Inline
Side-by-side
Showing
18 changed files
with
644 additions
and
181 deletions
+644
-181
app.module.ts
frontend/angular/src/app/app.module.ts
+5
-2
app.service.ts
frontend/angular/src/app/app.service.ts
+3
-2
edit-message-template.component.html
...dit-message-template/edit-message-template.component.html
+14
-16
edit-message-template.component.ts
.../edit-message-template/edit-message-template.component.ts
+2
-0
edit-workflow-template.component.html
...t-workflow-template/edit-workflow-template.component.html
+0
-0
edit-workflow-template.component.scss
...t-workflow-template/edit-workflow-template.component.scss
+63
-0
edit-workflow-template.component.ts
...dit-workflow-template/edit-workflow-template.component.ts
+386
-92
edit-workflow-template.model.ts
...ts/edit-workflow-template/edit-workflow-template.model.ts
+0
-23
edit-workflow-template.service.ts
.../edit-workflow-template/edit-workflow-template.service.ts
+5
-4
error-message.component.ts
...c/app/components/error-message/error-message.component.ts
+1
-1
list-message-template.component.ts
.../list-message-template/list-message-template.component.ts
+31
-21
list-work-flows.component.ts
...p/components/list-work-flows/list-work-flows.component.ts
+37
-17
constants.ts
frontend/angular/src/app/constants.ts
+4
-1
workflowMessage.model.ts
frontend/angular/src/app/models/workflowMessage.model.ts
+18
-0
workflowStage.model.ts
frontend/angular/src/app/models/workflowStage.model.ts
+29
-0
workflowStep.model.ts
frontend/angular/src/app/models/workflowStep.model.ts
+16
-0
workflowTemplate.model.ts
frontend/angular/src/app/models/workflowTemplate.model.ts
+3
-2
custom.scss
frontend/angular/src/assets/css/custom.scss
+27
-0
No files found.
frontend/angular/src/app/app.module.ts
View file @
7d463ed7
...
@@ -4,7 +4,7 @@ import { Select2Module } from 'ng2-select2';
...
@@ -4,7 +4,7 @@ import { Select2Module } from 'ng2-select2';
import
{
BsDropdownModule
}
from
'ngx-bootstrap/dropdown'
;
import
{
BsDropdownModule
}
from
'ngx-bootstrap/dropdown'
;
import
{
ModalModule
}
from
'ngx-bootstrap/modal'
;
import
{
ModalModule
}
from
'ngx-bootstrap/modal'
;
import
{
DeviceDetectorModule
}
from
'ngx-device-detector'
;
import
{
DeviceDetectorModule
}
from
'ngx-device-detector'
;
import
{
ConfirmationService
}
from
'primeng/primeng'
;
import
{
ConfirmationService
,
DragDropModule
,
InputMaskModule
,
OrderListModule
}
from
'primeng/primeng'
;
import
{
AppComponent
}
from
'./app.component'
;
import
{
AppComponent
}
from
'./app.component'
;
import
{
AppRoutingModule
}
from
'./app.routing'
;
import
{
AppRoutingModule
}
from
'./app.routing'
;
import
{
AppService
}
from
'./app.service'
;
import
{
AppService
}
from
'./app.service'
;
...
@@ -31,7 +31,10 @@ import { OneITModule } from './oneit/oneit.module';
...
@@ -31,7 +31,10 @@ import { OneITModule } from './oneit/oneit.module';
DeviceDetectorModule
.
forRoot
(),
DeviceDetectorModule
.
forRoot
(),
Select2Module
,
Select2Module
,
ModalModule
.
forRoot
(),
ModalModule
.
forRoot
(),
BsDropdownModule
.
forRoot
()
BsDropdownModule
.
forRoot
(),
InputMaskModule
,
DragDropModule
,
OrderListModule
],
],
declarations
:
[
declarations
:
[
AppComponent
,
AppComponent
,
...
...
frontend/angular/src/app/app.service.ts
View file @
7d463ed7
...
@@ -26,8 +26,9 @@ export class AppService {
...
@@ -26,8 +26,9 @@ export class AppService {
return
this
.
enumService
.
getEnumsWithNULLOptionLabel
(
'PlaceholderOptions'
,
'Select variable'
);
return
this
.
enumService
.
getEnumsWithNULLOptionLabel
(
'PlaceholderOptions'
,
'Select variable'
);
}
}
getTypes
(
serviceName
:
string
):
Observable
<
Array
<
any
>>
{
getTypes
(
serviceName
:
string
,
includeNull
=
false
,
blankLabel
=
null
):
Observable
<
Array
<
any
>>
{
return
this
.
enumService
.
getEnums
(
serviceName
,
true
);
return
includeNull
?
this
.
enumService
.
getEnumsWithNULLOptionLabel
(
serviceName
,
blankLabel
)
:
this
.
enumService
.
getEnums
(
serviceName
,
true
);
}
}
getSearchListing
(
serviceName
:
string
,
queryType
:
string
,
queryParams
,
assocs
,
searchName
):
Observable
<
Array
<
any
>>
{
getSearchListing
(
serviceName
:
string
,
queryType
:
string
,
queryParams
,
assocs
,
searchName
):
Observable
<
Array
<
any
>>
{
...
...
frontend/angular/src/app/components/edit-message-template/edit-message-template.component.html
View file @
7d463ed7
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
<app-error-message></app-error-message>
<app-error-message></app-error-message>
<form
#
form=
"ngForm"
>
<form
#
form=
"ngForm"
>
<div
class=
"ui-g ui-fluid"
>
<div
class=
"ui-g ui-fluid"
>
<div
class=
"ui-g-10 listing-title pt-0 pb-0"
>
{{editMode ? "Edit" : "Add"}}
Message
Template
</div>
<div
class=
"ui-g-10 listing-title pt-0 pb-0"
>
{{editMode ? "Edit" : "Add"}}
Workflow
Template
</div>
</div>
</div>
<div
class=
"ui-g form-group"
>
<div
class=
"ui-g form-group"
>
<div
class=
"ui-g-12 ui-md-12"
>
<div
class=
"ui-g-12 ui-md-12"
>
...
@@ -100,21 +100,19 @@
...
@@ -100,21 +100,19 @@
</div>
</div>
<div
class=
"ui-g form-group"
>
<div
class=
"ui-g form-group"
>
<div
class=
"ui-g-12 ui-md-12"
>
<div
class=
"ui-g-12 ui-md-12"
>
<div
class=
"ui-g form-group"
>
<div
class=
"text-center form-group"
>
<div
class=
"ui-g-12 ui-md-3 ui-fluid"
>
<button
type=
"button"
value=
"Cancel"
class=
"btn btn-primary largeBtn greyBtn"
<p-button
label=
"Cancel"
[
disabled
]="
showLoader
"
routerLink=
"/admin/list-message-templates"
>
Cancel
routerLink=
"/admin/list-message-templates"
></p-button>
</button>
</div>
<button
*
ngIf=
"showSaveBtn()"
type=
"button"
value=
"Save"
class=
"btn btn-primary largeBtn"
<div
class=
"ui-g-12 ui-md-3 ui-fluid"
>
(
click
)="
saveMessageTemplate
()"
[
disabled
]="
showLoader
"
>
<p-button
*
ngIf=
"showSaveBtn()"
label=
"Save"
[
disabled
]="
showLoader
"
Save
(
onClick
)="
saveMessageTemplate
()"
>
</button>
</p-button>
<button
*
ngIf=
"showSaveCopyBtn()"
type=
"button"
value=
"Save As a Copy"
</div>
class=
"btn btn-primary largeBtn"
<div
class=
"ui-g-12 ui-md-3 ui-fluid"
>
(
click
)="
saveMessageTemplate
(
true
)"
[
disabled
]="
showLoader
"
>
<p-button
*
ngIf=
"showSaveCopyBtn()"
label=
"Save As a Copy"
[
disabled
]="
showLoader
"
Save As a Copy
(
onClick
)="
saveMessageTemplate
(
true
)"
>
</button>
</p-button>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
...
...
frontend/angular/src/app/components/edit-message-template/edit-message-template.component.ts
View file @
7d463ed7
...
@@ -400,4 +400,6 @@ export class EditMessageTemplateComponent extends BaseComponent implements OnIni
...
@@ -400,4 +400,6 @@ export class EditMessageTemplateComponent extends BaseComponent implements OnIni
createdExists
():
boolean
{
createdExists
():
boolean
{
return
Object
.
keys
(
this
.
createdObjs
).
length
>
0
;
return
Object
.
keys
(
this
.
createdObjs
).
length
>
0
;
}
}
// tslint:disable-next-line:max-file-line-count
}
}
frontend/angular/src/app/components/edit-workflow-template/edit-workflow-template.component.html
View file @
7d463ed7
This source diff could not be displayed because it is too large. You can
view the blob
instead.
frontend/angular/src/app/components/edit-workflow-template/edit-workflow-template.component.scss
0 → 100644
View file @
7d463ed7
p-dropdown
{
::ng-deep
{
.ui-dropdown
{
width
:
100%
!
important
;
}
.dropdown-text
{
top
:
0
;
font-size
:
14px
;
margin-top
:
4px
;
position
:
absolute
;
left
:
30px
;
text-overflow
:
ellipsis
;
white-space
:
nowrap
;
overflow
:
hidden
;
width
:
180px
;
}
}
}
p-inputMask
{
::ng-deep
{
input
{
width
:
100%
;
height
:
100%
;
}
}
}
::ng-deep
{
.ui-orderlist-controls
{
display
:
none
!
important
;
}
.ui-orderlist-list-container
{
width
:
100%
;
border
:
0
;
.ui-orderlist-caption
{
border
:
0
;
}
.ui-orderlist-list
{
border
:
0
;
height
:
auto
;
.ui-orderlist-item
{
cursor
:
auto
;
min-height
:
50px
;
&
:hover
{
background-color
:
transparent
!
important
;
}
}
}
}
}
.drag-block
{
cursor
:
pointer
;
}
frontend/angular/src/app/components/edit-workflow-template/edit-workflow-template.component.ts
View file @
7d463ed7
import
{
Component
,
OnInit
,
ViewChild
}
from
'@angular/core'
;
import
{
Component
,
OnInit
,
ViewChild
}
from
'@angular/core'
;
import
{
NgForm
}
from
'@angular/forms'
;
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
{
combineLatest
}
from
'rxjs/observable/combineLatest'
;
import
{
Subscription
}
from
'rxjs/Subscription'
;
import
{
Subscription
}
from
'rxjs/Subscription'
;
import
{
AppService
}
from
'../../app.service'
;
import
{
AppService
}
from
'../../app.service'
;
import
{
SERVICES
}
from
'../../constants'
;
import
{
MessageTemplateModel
}
from
'../../models/messageTemplate.model'
;
import
{
ResponseActionEnum
}
from
'../../models/responseAction.enum'
;
import
{
ResponseActionEnum
}
from
'../../models/responseAction.enum'
;
import
{
StageTypeEnum
}
from
'../../models/stageType.enum'
;
import
{
StageTypeEnum
}
from
'../../models/stageType.enum'
;
import
{
StepTypeEnum
}
from
'../../models/stepType.enum'
;
import
{
StepTypeEnum
}
from
'../../models/stepType.enum'
;
import
{
WorkflowMessageModel
}
from
'../../models/workflowMessage.model'
;
import
{
WorkflowStageModel
}
from
'../../models/workflowStage.model'
;
import
{
WorkflowStepModel
}
from
'../../models/workflowStep.model'
;
import
{
WorkflowTemplateModel
}
from
'../../models/workflowTemplate.model'
;
import
{
WorkflowTemplateModel
}
from
'../../models/workflowTemplate.model'
;
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
{
AdminPortalLayoutService
}
from
'../admin-portal/admin-portal-layout/admin-portal-layout.service'
;
import
{
BaseComponent
}
from
'../base/base.component'
;
import
{
BaseComponent
}
from
'../base/base.component'
;
import
{
WorkflowTemplate
}
from
'./edit-workflow-template.model'
;
import
{
EditWorkflowTemplateService
}
from
'./edit-workflow-template.service'
;
import
{
EditWorkflowTemplateService
}
from
'./edit-workflow-template.service'
;
@
Component
({
@
Component
({
selector
:
'app-edit-workflow-template'
,
selector
:
'app-edit-workflow-template'
,
templateUrl
:
'./edit-workflow-template.component.html'
templateUrl
:
'./edit-workflow-template.component.html'
,
styleUrls
:
[
'./edit-workflow-template.component.scss'
]
})
})
export
class
EditWorkflowTemplateComponent
extends
BaseComponent
implements
OnInit
{
export
class
EditWorkflowTemplateComponent
extends
BaseComponent
implements
OnInit
{
subscriptions
:
Array
<
Subscription
>
=
[];
subscriptions
:
Array
<
Subscription
>
=
[];
@
ViewChild
(
'form'
)
form
:
NgForm
;
@
ViewChild
(
'form'
)
form
:
NgForm
;
createdObjs
=
{}
;
createdObjs
;
updatedObjs
=
{}
;
updatedObjs
;
deletedObjs
=
{}
;
deletedObjs
;
workflow
=
new
WorkflowTemplateModel
();
workflow
=
new
WorkflowTemplateModel
();
preStages
:
Array
<
WorkflowStageModel
>
=
[];
genericStages
:
Array
<
WorkflowStageModel
>
=
[];
postStages
:
Array
<
WorkflowStageModel
>
=
[];
stageTypes
:
Array
<
StageTypeEnum
>
;
stageTypes
:
Array
<
StageTypeEnum
>
;
stepTypeOptions
:
Array
<
StepTypeEnum
>
;
stepTypes
:
Array
<
StepTypeEnum
>
;
stepTypes
:
Array
<
StepTypeEnum
>
;
responseActions
:
Array
<
ResponseActionEnum
>
;
responseActions
:
Array
<
ResponseActionEnum
>
;
messageTemplates
:
Array
<
MessageTemplateModel
>
=
[];
editField
:
any
=
{};
editField
:
any
=
{};
showLoader
=
false
;
showLoader
=
false
;
editMode
=
false
;
editMode
=
false
;
displayNewMessageTemplate
=
false
;
workflowTemplate
=
new
WorkflowTemplate
();
s
:
Array
<
any
>
=
[];
messagetemplates
:
Array
<
any
>
=
[];
messagetemplate_withdraws
:
Array
<
any
>
=
[];
Automatically_progress_to_next_stages
=
[];
Use_messagings
=
[];
constructor
(
constructor
(
private
router
:
Router
,
private
router
:
Router
,
...
@@ -46,7 +53,9 @@ export class EditWorkflowTemplateComponent extends BaseComponent implements OnIn
...
@@ -46,7 +53,9 @@ export class EditWorkflowTemplateComponent extends BaseComponent implements OnIn
private
utilsService
:
UtilsService
,
private
utilsService
:
UtilsService
,
private
saveService
:
SaveService
,
private
saveService
:
SaveService
,
private
appService
:
AppService
,
private
appService
:
AppService
,
private
editWorkflowTemplateService
:
EditWorkflowTemplateService
private
editWorkflowTemplateService
:
EditWorkflowTemplateService
,
private
adminPortalLayoutService
:
AdminPortalLayoutService
,
private
confirmationService
:
ConfirmationService
)
{
)
{
super
(
utilsService
);
super
(
utilsService
);
}
}
...
@@ -55,28 +64,65 @@ export class EditWorkflowTemplateComponent extends BaseComponent implements OnIn
...
@@ -55,28 +64,65 @@ export class EditWorkflowTemplateComponent extends BaseComponent implements OnIn
this
.
createdObjs
=
{};
this
.
createdObjs
=
{};
this
.
updatedObjs
=
{};
this
.
updatedObjs
=
{};
this
.
deletedObjs
=
{};
this
.
deletedObjs
=
{};
this
.
utilsService
.
resetCounter
();
this
.
showLoader
=
true
;
this
.
showLoader
=
true
;
this
.
utilsService
.
resetCounter
();
this
.
startComponent
();
this
.
subscriptions
.
push
(
this
.
adminPortalLayoutService
.
userDataUpdated
.
subscribe
(
()
=>
{
this
.
startComponent
();
}
));
}
startComponent
():
void
{
if
(
!
this
.
adminPortalLayoutService
.
userData
||
this
.
alreadyExists
())
{
return
;
}
this
.
subscriptions
.
push
(
this
.
activatedRoute
.
params
this
.
subscriptions
.
push
(
this
.
activatedRoute
.
params
.
subscribe
(
.
subscribe
(
(
params
:
Params
)
=>
{
(
params
:
Params
)
=>
{
this
.
showLoader
=
true
;
this
.
subscriptions
.
push
(
this
.
getStageTypes
();
combineLatest
(
this
.
getStepTypes
();
this
.
appService
.
getTypes
(
'StageTypes'
),
this
.
getResponseActions
();
this
.
appService
.
getTypes
(
'StepTypes'
,
true
,
'Add Step'
),
this
.
appService
.
getTypes
(
'ResponseActions'
)
)
.
subscribe
(
response
=>
{
if
(
this
.
alreadyExists
())
{
return
;
}
this
.
stageTypes
=
response
[
0
];
this
.
stepTypeOptions
=
response
[
1
];
if
(
!
this
.
adminPortalLayoutService
.
getHiringTeamID
().
HasDiversity
)
{
this
.
stepTypeOptions
=
this
.
stepTypeOptions
.
filter
(
type
=>
type
.
Value
!==
'DIVERSITY'
);
}
this
.
responseActions
=
response
[
2
];
if
(
params
.
id
&&
params
.
id
!==
'0'
)
{
if
(
params
.
id
&&
params
.
id
!==
'0'
)
{
this
.
editMode
=
true
;
this
.
editMode
=
true
;
this
.
getWorkflowTemplateByID
(
params
.
id
);
this
.
getWorkflowTemplateByID
(
params
.
id
);
}
else
{
}
else
{
this
.
editMode
=
false
;
this
.
utilsService
.
createObject
(
this
.
workflow
,
this
.
createdObjs
);
this
.
utilsService
.
createObject
(
this
.
workflow
,
this
.
createdObjs
);
this
.
setDefaults
();
this
.
setDefaults
();
this
.
addDefaultStages
();
this
.
stepTypes
=
[...
this
.
stepTypeOptions
];
this
.
showLogs
();
this
.
showLogs
();
this
.
showLoader
=
false
;
this
.
showLoader
=
false
;
}
}
})
);
}
}
));
));
this
.
gets
();
this
.
get
MessageTemplate
s
();
}
}
setDefaults
():
void
{
setDefaults
():
void
{
...
@@ -86,56 +132,157 @@ export class EditWorkflowTemplateComponent extends BaseComponent implements OnIn
...
@@ -86,56 +132,157 @@ export class EditWorkflowTemplateComponent extends BaseComponent implements OnIn
this
.
workflow
.
ThankYouHeaderText
=
'Thank You for your application to:'
;
this
.
workflow
.
ThankYouHeaderText
=
'Thank You for your application to:'
;
this
.
workflow
.
ThankYouSecondaryText
=
'We will get in touch with you soon'
;
this
.
workflow
.
ThankYouSecondaryText
=
'We will get in touch with you soon'
;
this
.
workflow
.
ApplicationButtonText
=
'Submit'
;
this
.
workflow
.
ApplicationButtonText
=
'Submit'
;
this
.
workflow
.
JobOutlineButtonText
=
'Continue'
;
this
.
workflow
.
CaptureCV
=
true
;
this
.
workflow
.
CaptureCV
=
true
;
this
.
workflow
.
CaptureCL
=
true
;
this
.
workflow
.
HiringTeam
=
this
.
adminPortalLayoutService
.
getHiringTeamID
().
ObjectID
;
}
}
getStageTypes
():
void
{
addDefaultStages
():
void
{
this
.
subscriptions
.
push
(
this
.
workflow
.
WorkFlowStages
=
[];
this
.
appService
.
getTypes
(
'StageTypes'
)
let
topIndex
=
1
;
.
subscribe
((
types
:
Array
<
StageTypeEnum
>
)
=>
{
this
.
stageTypes
.
forEach
(
stage
=>
{
this
.
stageTypes
=
types
;
const
index
=
(
!
stage
.
IsPostStage
&&
!
stage
.
IsPreStage
)
?
topIndex
++
:
-
1
;
})
const
stageObject
=
new
WorkflowStageModel
(
`
${
stage
.
Description
}
Stage`
,
false
,
stage
,
index
,
);
false
,
this
.
workflow
.
ObjectID
);
this
.
utilsService
.
addMultiRefObject
(
stageObject
,
this
.
workflow
,
'WorkFlowStages'
,
this
.
createdObjs
);
});
this
.
reOrderStages
(
this
.
filterStages
(
true
,
true
,
true
));
}
}
getStepTypes
():
void
{
reOrderStages
(
callback
):
void
{
this
.
subscriptions
.
push
(
this
.
showLoader
=
true
;
this
.
appService
.
getTypes
(
'StepTypes'
)
this
.
workflow
.
WorkFlowStages
.
subscribe
((
types
:
Array
<
StepTypeEnum
>
)
=>
{
.
sort
((
a
,
b
)
=>
a
.
SortOrder
<
b
.
SortOrder
?
-
1
:
a
.
SortOrder
>
b
.
SortOrder
?
1
:
0
);
this
.
stepTypes
=
types
;
if
(
callback
)
{
})
callback
();
);
}
this
.
showLoader
=
false
;
}
}
getResponseActions
():
void
{
isGeneric
(
stage
:
WorkflowStageModel
):
boolean
{
this
.
subscriptions
.
push
(
return
!
stage
.
StageType
.
IsPostStage
&&
!
stage
.
StageType
.
IsPreStage
;
this
.
appService
.
getTypes
(
'ResponseActions'
)
}
.
subscribe
((
types
:
Array
<
ResponseActionEnum
>
)
=>
{
this
.
responseActions
=
types
;
filterStages
(
pre
=
false
,
generic
=
false
,
post
=
false
):
void
{
})
if
(
pre
)
{
);
this
.
preStages
=
this
.
filteredStages
(
true
,
false
);
}
if
(
generic
)
{
this
.
genericStages
=
this
.
filteredStages
(
false
,
false
)
.
sort
((
a
,
b
)
=>
a
.
SortOrder
>
b
.
SortOrder
?
-
1
:
a
.
SortOrder
<
b
.
SortOrder
?
1
:
0
);
}
if
(
post
)
{
this
.
postStages
=
this
.
filteredStages
(
false
,
true
);
}
}
showSaveBtn
():
boolean
{
return
this
.
workflow
&&
this
.
workflow
.
ObjectID
?
(
this
.
workflow
.
HiringTeam
===
this
.
adminPortalLayoutService
.
getHiringTeamID
().
ObjectID
||
!
this
.
editMode
)
:
false
;
}
showSaveCopyBtn
():
boolean
{
return
this
.
workflow
&&
this
.
workflow
.
ObjectID
?
(
!!
this
.
workflow
.
HiringTeam
)
:
false
;
}
getStageHeader
(
stage
:
WorkflowStageModel
):
string
{
return
`
${
stage
.
Name
}
(
${
stage
.
Steps
?
stage
.
Steps
.
length
:
0
}
)`
;
}
}
showLabel
(
id
:
string
):
boolean
{
showLabel
(
id
:
string
):
boolean
{
return
(
this
.
editField
[
id
]
===
undefined
||
this
.
editField
[
id
]
===
false
);
return
(
this
.
editField
[
id
]
===
undefined
||
this
.
editField
[
id
]
===
false
);
}
}
showStageLabel
(
id
:
string
,
stage
:
WorkflowStageModel
):
boolean
{
if
(
stage
.
StageType
.
IsPreStage
||
stage
.
StageType
.
IsPostStage
)
{
return
true
;
}
else
{
return
this
.
showLabel
(
id
);
}
}
showStageInput
(
id
:
string
,
stage
:
WorkflowStageModel
):
boolean
{
if
(
stage
.
StageType
.
IsPreStage
||
stage
.
StageType
.
IsPostStage
)
{
return
false
;
}
else
{
return
this
.
showInput
(
id
);
}
}
showDelayInput
(
id
:
string
,
message
:
WorkflowMessageModel
):
boolean
{
if
(
!
message
.
Delay
||
message
.
Delay
===
''
)
{
return
true
;
}
else
{
return
this
.
editField
?
(
this
.
editField
[
id
]
?
this
.
editField
[
id
]
:
true
)
:
true
;
}
}
showDelayLabel
(
id
:
string
,
message
:
WorkflowMessageModel
):
boolean
{
if
(
!
message
.
Delay
||
message
.
Delay
===
''
)
{
return
false
;
}
else
{
return
this
.
editField
?
(
this
.
editField
[
id
]
?
this
.
editField
[
id
]
:
false
)
:
false
;
}
}
filteredStages
(
isPreStage
:
boolean
,
isPostStage
:
boolean
):
Array
<
WorkflowStageModel
>
{
return
this
.
workflow
&&
this
.
workflow
.
WorkFlowStages
?
(
(
!
isPreStage
&&
!
isPostStage
)
?
this
.
workflow
.
WorkFlowStages
.
filter
(
stage
=>
!
stage
.
StageType
.
IsPreStage
&&
!
stage
.
StageType
.
IsPostStage
)
:
isPreStage
?
this
.
workflow
.
WorkFlowStages
.
filter
(
stage
=>
stage
.
StageType
.
IsPreStage
)
:
isPostStage
?
this
.
workflow
.
WorkFlowStages
.
filter
(
stage
=>
stage
.
StageType
.
IsPostStage
)
:
[])
:
[];
}
emailResponseSelected
():
boolean
{
return
this
.
workflow
.
ApplicationResponseAction
&&
this
.
workflow
.
ApplicationResponseAction
.
Value
===
'EMAIL_RESPONSE'
;
}
showInput
(
id
:
string
):
boolean
{
showInput
(
id
:
string
):
boolean
{
return
this
.
editField
&&
!!
this
.
editField
[
id
];
return
this
.
editField
&&
!!
this
.
editField
[
id
];
}
}
toggleInput
(
event
,
fieldName
,
save
=
true
):
void
{
toggleInput
(
event
,
fieldName
):
void
{
this
.
utilsService
.
clearErrorMessages
();
this
.
utilsService
.
clearErrorMessages
();
if
(
event
.
type
===
'blur'
)
{
if
(
event
.
type
===
'blur'
)
{
if
(
!
this
.
form
.
controls
[
fieldName
].
invalid
)
{
if
(
!
this
.
form
.
controls
[
fieldName
].
invalid
)
{
this
.
editField
[
fieldName
]
=
false
;
this
.
editField
[
fieldName
]
=
false
;
if
(
save
)
{
}
else
{
// save call to be sent
this
.
utilsService
.
showAllErrorMessages
();
}
}
else
{
this
.
editField
[
fieldName
]
=
true
;
setTimeout
(()
=>
{
try
{
document
.
getElementById
(
`
${
fieldName
}
Id`
)
.
focus
();
document
.
getElementById
(
`
${
fieldName
}
Id`
)
.
getElementsByTagName
(
'input'
)[
0
]
.
focus
();
}
catch
(
e
)
{
// ignore this.
}
},
0
);
}
}
}
toggleStageInput
(
event
,
fieldName
,
stage
:
WorkflowStageModel
):
void
{
this
.
utilsService
.
clearErrorMessages
();
if
(
event
.
type
===
'blur'
)
{
if
(
!
this
.
form
.
controls
[
fieldName
].
invalid
)
{
this
.
editField
[
fieldName
]
=
false
;
}
else
{
}
else
{
this
.
utilsService
.
showAllErrorMessages
();
this
.
utilsService
.
showAllErrorMessages
();
}
}
}
else
{
}
else
{
if
(
stage
.
StageType
.
IsPreStage
||
stage
.
StageType
.
IsPostStage
)
{
return
;
}
this
.
editField
[
fieldName
]
=
true
;
this
.
editField
[
fieldName
]
=
true
;
setTimeout
(()
=>
{
setTimeout
(()
=>
{
try
{
try
{
...
@@ -151,11 +298,59 @@ export class EditWorkflowTemplateComponent extends BaseComponent implements OnIn
...
@@ -151,11 +298,59 @@ export class EditWorkflowTemplateComponent extends BaseComponent implements OnIn
}
}
}
}
gets
():
void
{
toggleDelayInput
(
event
,
fieldName
,
message
:
WorkflowMessageModel
):
void
{
this
.
subscriptions
.
push
(
this
.
editWorkflowTemplateService
.
getDummy456s
([])
this
.
utilsService
.
clearErrorMessages
();
if
(
event
.
type
===
'blur'
)
{
if
(
!
message
.
Delay
||
message
.
Delay
===
''
)
{
return
;
}
if
(
!
this
.
form
.
controls
[
fieldName
].
invalid
)
{
this
.
editField
[
fieldName
]
=
false
;
}
else
{
this
.
utilsService
.
showAllErrorMessages
();
}
}
else
{
this
.
editField
[
fieldName
]
=
true
;
setTimeout
(()
=>
{
try
{
document
.
getElementById
(
`
${
fieldName
}
Id`
)
.
focus
();
document
.
getElementById
(
`
${
fieldName
}
Id`
)
.
getElementsByTagName
(
'input'
)[
0
]
.
focus
();
}
catch
(
e
)
{
// ignore this.
}
},
0
);
}
}
getMessageTemplates
():
void
{
const
sharedMsgParams
=
{
OnlyGlobalTemplate
:
true
,
attribsByName
:
'Autocomplete'
};
const
myMsgParams
=
{
OnlyGlobalTemplate
:
false
,
attribsByName
:
'Autocomplete'
};
this
.
subscriptions
.
push
(
combineLatest
(
this
.
editWorkflowTemplateService
.
getMessageTemplates
([],
myMsgParams
),
this
.
editWorkflowTemplateService
.
getMessageTemplates
([],
sharedMsgParams
)
)
.
subscribe
(
.
subscribe
(
data
=>
{
(
response
:
[
Array
<
MessageTemplateModel
>
,
Array
<
MessageTemplateModel
>
])
=>
{
this
.
s
=
data
;
const
myTemplates
=
response
[
0
].
filter
(
message
=>
message
.
HiringTeam
===
this
.
adminPortalLayoutService
.
getHiringTeamID
().
ObjectID
);
this
.
messageTemplates
=
[...
myTemplates
,
...
response
[
1
]];
const
newTemplate
=
new
MessageTemplateModel
();
newTemplate
.
TemplateName
=
'New Template'
;
newTemplate
.
id
=
'0'
;
this
.
messageTemplates
.
push
(
newTemplate
);
},
},
error
=>
{
error
=>
{
this
.
utilsService
.
handleError
(
error
);
this
.
utilsService
.
handleError
(
error
);
...
@@ -164,54 +359,146 @@ export class EditWorkflowTemplateComponent extends BaseComponent implements OnIn
...
@@ -164,54 +359,146 @@ export class EditWorkflowTemplateComponent extends BaseComponent implements OnIn
);
);
}
}
autoCompleteMessagetemplate
(
event
):
void
{
showMessageTemplateDialog
(
$event
):
void
{
this
.
subscriptions
.
push
(
this
.
editWorkflowTemplateService
.
getmessagetemplatesForAutocomplete
(
event
.
query
,
[])
const
template
=
$event
.
value
;
.
subscribe
(
if
(
template
.
id
&&
template
.
id
===
'0'
)
{
data
=>
{
this
.
displayNewMessageTemplate
=
true
;
for
(
const
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
.
messagetemplates
=
data
;
},
error
=>
{
this
.
utilsService
.
handleError
(
error
);
}
}
)
);
availableStepTypes
():
Array
<
StepTypeEnum
>
{
const
availableStepTypes
=
this
.
stepTypeOptions
;
if
(
this
.
workflow
.
WorkFlowStages
)
{
this
.
workflow
.
WorkFlowStages
.
forEach
(
stage
=>
{
if
(
stage
.
Steps
)
{
stage
.
Steps
.
forEach
(
step
=>
{
if
(
availableStepTypes
.
indexOf
(
step
.
StepType
)
>
-
1
)
{
availableStepTypes
.
slice
(
availableStepTypes
.
indexOf
(
step
.
StepType
),
0
);
}
});
}
});
}
}
autoCompleteMessagetemplate_withdraw
(
event
):
void
{
return
availableStepTypes
;
this
.
subscriptions
.
push
(
this
.
editWorkflowTemplateService
.
getmessagetemplate_withdrawsForAutocomplete
(
event
.
query
,
[])
.
subscribe
(
data
=>
{
for
(
const
obj
of
data
)
{
// sd
}
}
this
.
messagetemplate_withdraws
=
data
;
},
stageMessagesCount
(
stage
:
WorkflowStageModel
):
string
{
error
=>
{
return
`Message Schedule (
${
stage
.
WorkFlowMessages
.
length
}
)`
;
this
.
utilsService
.
handleError
(
error
);
}
}
)
);
addStep
(
$event
,
stage
:
WorkflowStageModel
):
void
{
if
(
!
$event
.
data
[
0
]
&&
$event
.
data
[
0
].
Value
!==
null
)
{
return
;
}
}
getWorkflowTemplateByID
(
id
):
void
{
const
selectedStepType
=
this
.
stepTypeOptions
.
find
(
step
=>
step
.
Value
===
$event
.
data
[
0
].
Value
);
const
step
=
new
WorkflowStepModel
(
stage
.
Steps
.
length
+
1
,
selectedStepType
,
stage
.
ObjectID
);
this
.
utilsService
.
addMultiRefObject
(
step
,
stage
,
'Steps'
,
this
.
createdObjs
);
this
.
removeStepType
(
selectedStepType
);
}
removeStep
(
step
:
WorkflowStepModel
,
stage
:
WorkflowStageModel
):
void
{
const
stepType
=
step
.
StepType
;
this
.
utilsService
.
removeMultiRefObject
(
step
,
stage
,
'Steps'
,
this
.
createdObjs
,
this
.
updatedObjs
,
this
.
deletedObjs
);
this
.
reAssignStepOrders
(
stage
);
this
.
addStepType
(
stepType
);
}
removeStepType
(
step
:
StepTypeEnum
):
void
{
this
.
stepTypes
.
splice
(
this
.
stepTypes
.
findIndex
(
elem
=>
elem
.
Value
===
step
.
Value
),
1
);
this
.
resetSelect
(
'stepTypes'
);
}
addStepType
(
step
:
StepTypeEnum
):
void
{
this
.
stepTypes
.
push
(
step
);
this
.
resetSelect
(
'stepTypes'
);
}
reAssignStepOrders
(
stage
:
WorkflowStageModel
):
void
{
stage
.
Steps
.
map
((
step
,
index
)
=>
step
.
SortOrder
=
index
+
1
);
}
addMessage
(
stage
:
WorkflowStageModel
):
void
{
const
message
=
new
WorkflowMessageModel
(
stage
.
ObjectID
);
this
.
utilsService
.
addMultiRefObject
(
message
,
stage
,
'WorkFlowMessages'
,
this
.
createdObjs
);
}
removeMessage
(
message
:
WorkflowMessageModel
,
stage
:
WorkflowStageModel
):
void
{
this
.
confirmationService
.
confirm
({
message
:
'Are you sure you want to delete this record?'
,
header
:
'Delete Confirmation'
,
icon
:
'fa fa-trash'
,
key
:
'RemoveRow'
,
accept
:
()
=>
{
this
.
utilsService
.
removeMultiRefObject
(
message
,
stage
,
'WorkFlowMessages'
,
this
.
createdObjs
,
this
.
updatedObjs
,
this
.
deletedObjs
);
}
});
}
addStage
():
void
{
const
stageType
=
this
.
stageTypes
.
find
(
type
=>
!
type
.
IsPreStage
&&
!
type
.
IsPostStage
);
const
stage
=
new
WorkflowStageModel
(
`
${
stageType
.
Description
}
Stage`
,
false
,
stageType
,
this
.
getStageOrder
(),
false
,
this
.
workflow
.
ObjectID
);
this
.
utilsService
.
addMultiRefObject
(
stage
,
this
.
workflow
,
'WorkFlowStages'
,
this
.
createdObjs
);
this
.
filterStages
(
false
,
true
,
false
);
}
removeStage
(
stage
:
WorkflowStageModel
):
void
{
this
.
confirmationService
.
confirm
({
message
:
'Are you sure you want to delete this record?'
,
header
:
'Delete Confirmation'
,
icon
:
'fa fa-trash'
,
key
:
'RemoveRow'
,
accept
:
()
=>
{
if
(
this
.
isGeneric
(
stage
))
{
const
decrement
=
this
.
workflow
.
WorkFlowStages
.
filter
(
stg
=>
this
.
isGeneric
(
stg
))
.
length
-
stage
.
SortOrder
;
if
(
decrement
>
0
)
{
this
.
workflow
.
WorkFlowStages
.
map
(
stg
=>
{
if
(
this
.
isGeneric
(
stg
)
&&
stg
.
SortOrder
>
decrement
)
{
stg
.
SortOrder
=
stg
.
SortOrder
-
decrement
;
}
});
}
this
.
reOrderStages
(
this
.
filterStages
(
false
,
true
,
false
));
}
this
.
utilsService
.
removeMultiRefObject
(
stage
,
this
.
workflow
,
'WorkFlowStages'
,
this
.
createdObjs
,
this
.
updatedObjs
,
this
.
deletedObjs
);
}
});
}
getStageOrder
():
number
{
return
this
.
workflow
&&
this
.
workflow
.
WorkFlowStages
?
(
this
.
workflow
.
WorkFlowStages
.
filter
(
stage
=>
this
.
isGeneric
(
stage
))
.
length
+
1
)
:
0
;
}
resetSelect
(
key
:
string
):
void
{
const
temp
=
this
[
key
];
this
[
key
]
=
[];
setTimeout
(()
=>
(
this
[
key
]
=
temp
),
0
);
}
getWorkflowTemplateByID
(
id
):
void
{
this
.
showLoader
=
true
;
this
.
showLoader
=
true
;
this
.
createdObjs
=
{};
this
.
createdObjs
=
{};
this
.
updatedObjs
=
{};
this
.
updatedObjs
=
{};
this
.
deletedObjs
=
{};
this
.
deletedObjs
=
{};
this
.
utilsService
.
resetCounter
();
this
.
utilsService
.
resetCounter
();
this
.
utilsService
.
clearErrorMessages
();
this
.
utilsService
.
clearErrorMessages
();
this
.
subscriptions
.
push
(
this
.
editWorkflowTemplateService
.
getWorkflowTemplateByID
(
id
,
[])
this
.
subscriptions
.
push
(
this
.
editWorkflowTemplateService
.
getWorkflowTemplateByID
(
id
,
[])
.
subscribe
(
.
subscribe
(
data
=>
{
data
=>
{
this
.
workflowTemplate
=
data
;
this
.
workflow
=
data
;
this
.
updatedObjs
[
this
.
workflowTemplate
.
ObjectID
]
=
this
.
workflowTemplate
;
this
.
updatedObjs
[
this
.
workflow
.
ObjectID
]
=
this
.
workflow
;
this
.
showLoader
=
false
;
this
.
showLoader
=
false
;
},
},
error
=>
{
error
=>
{
...
@@ -222,29 +509,30 @@ export class EditWorkflowTemplateComponent extends BaseComponent implements OnIn
...
@@ -222,29 +509,30 @@ export class EditWorkflowTemplateComponent extends BaseComponent implements OnIn
);
);
}
}
saveWorkflowTemplate
(
reload
:
boolean
):
void
{
getMessageClass
(
message
:
MessageTemplateModel
):
string
{
return
message
.
TemplateType
?
`ui-icon-
${
message
.
TemplateType
.
Value
.
toLowerCase
()}
`
:
'ui-icon-sms'
;
}
saveWorkflowTemplate
(
saveCopy
=
false
,
testing
=
true
):
void
{
this
.
utilsService
.
clearErrorMessages
();
this
.
utilsService
.
clearErrorMessages
();
const
service
=
`svc/
${
saveCopy
?
SERVICES
.
SAVE_MESSAGE_AS_COPY
:
SERVICES
.
SAVE
}
`
;
if
(
testing
)
{
this
.
showLogs
();
return
;
}
if
(
this
.
form
.
invalid
)
{
if
(
this
.
form
.
invalid
)
{
this
.
utilsService
.
showAllErrorMessages
();
this
.
utilsService
.
showAllErrorMessages
();
}
else
{
}
else
{
this
.
showLoader
=
true
;
this
.
showLoader
=
true
;
this
.
subscriptions
.
push
(
this
.
saveService
.
saveObjects
WithDefaultSvc
(
this
.
createdObjs
,
this
.
updatedObjs
,
this
.
deletedObjs
)
this
.
subscriptions
.
push
(
this
.
saveService
.
saveObjects
(
service
,
this
.
createdObjs
,
this
.
updatedObjs
,
this
.
deletedObjs
)
.
subscribe
(
.
subscribe
(
data
=>
{
()
=>
{
this
.
utilsService
.
handleSuccess
();
this
.
utilsService
.
handleSuccess
();
if
(
reload
)
{
this
.
router
.
navigate
([
'/admin/list-workflow-templates'
]);
let
idToNavigate
=
this
.
workflowTemplate
.
ObjectID
;
if
(
data
.
created
[
idToNavigate
])
{
idToNavigate
=
data
.
created
[
idToNavigate
];
this
.
router
.
navigate
([
'/edit-workflow-template'
,
idToNavigate
]);
return
;
}
this
.
getWorkflowTemplateByID
(
idToNavigate
);
}
else
{
this
.
router
.
navigate
([
''
]);
}
},
},
error
=>
{
error
=>
{
this
.
showLoader
=
false
;
this
.
showLoader
=
false
;
...
@@ -256,6 +544,12 @@ export class EditWorkflowTemplateComponent extends BaseComponent implements OnIn
...
@@ -256,6 +544,12 @@ export class EditWorkflowTemplateComponent extends BaseComponent implements OnIn
}
}
showLogs
():
void
{
showLogs
():
void
{
console
.
log
(
this
.
workflow
);
console
.
log
(
this
.
workflow
.
WorkFlowStages
);
}
}
alreadyExists
():
boolean
{
return
Object
.
keys
(
this
.
createdObjs
).
length
>
0
||
Object
.
keys
(
this
.
updatedObjs
).
length
>
0
;
}
// tslint:disable-next-line:max-file-line-count
}
}
frontend/angular/src/app/components/edit-workflow-template/edit-workflow-template.model.ts
deleted
100644 → 0
View file @
5121545b
export
class
WorkflowTemplate
{
ObjectID
:
string
;
ButtonText
:
string
;
HeaderText
:
string
;
CaptureCV
:
boolean
;
MandatoryCV
:
boolean
;
CaptureCoverLetter
:
boolean
;
Mandatorycoverletter
:
boolean
;
HeaderTextforThankYoupage
:
string
;
SecondaryText
:
string
;
Automaticallyprogresstonextstage
:
boolean
;
Hrs1
:
string
;
BusinessHrsOnly
:
boolean
;
Messagetemplate
:
any
;
Hrswithdraw
:
string
;
Variationwithdraw
:
string
;
Messagetemplate_withdraw
:
any
;
Usemessaging
:
boolean
;
Dummy457
:
string
;
messagetemplate_withdraw
:
string
;
messagetemplate
:
string
;
Dummy461
:
string
;
}
frontend/angular/src/app/components/edit-workflow-template/edit-workflow-template.service.ts
View file @
7d463ed7
import
{
Injectable
}
from
'@angular/core'
;
import
{
Injectable
}
from
'@angular/core'
;
import
{
Observable
}
from
'rxjs/Observable'
;
import
{
Observable
}
from
'rxjs/Observable'
;
import
{
SERVICES
}
from
"../../constants"
;
import
{
MessageTemplateModel
}
from
"../../models/messageTemplate.model"
;
import
{
SearchService
}
from
'../../oneit/services/search.service'
;
import
{
SearchService
}
from
'../../oneit/services/search.service'
;
import
{
UtilsService
}
from
'../../oneit/services/utils.service'
;
import
{
UtilsService
}
from
'../../oneit/services/utils.service'
;
...
@@ -12,11 +14,10 @@ export class EditWorkflowTemplateService {
...
@@ -12,11 +14,10 @@ export class EditWorkflowTemplateService {
)
{
)
{
}
}
get
Dummy456s
(
assocs
):
Observable
<
any
>
{
get
MessageTemplates
(
assocs
,
queryParam
):
Observable
<
Array
<
MessageTemplateModel
>
>
{
return
this
.
searchService
.
getObjects
(
'MessageTemplates'
,
'All'
,
{},
assocs
,
null
,
null
,
null
,
null
)
return
this
.
searchService
.
getObjects
(
SERVICES
.
MESSAGE_TEMPLATES
,
'All'
,
queryParam
,
assocs
,
'Autocomplete'
,
null
,
null
,
null
)
.
map
(
.
map
(
data
=>
data
=>
this
.
utilsService
.
convertResponseToObjects
(
data
,
assocs
)
this
.
utilsService
.
convertResponseToObjects
(
data
,
assocs
)
);
);
}
}
...
...
frontend/angular/src/app/components/error-message/error-message.component.ts
View file @
7d463ed7
...
@@ -24,7 +24,7 @@ export class ErrorMessageComponent implements OnInit {
...
@@ -24,7 +24,7 @@ export class ErrorMessageComponent implements OnInit {
this
.
subscriptions
.
push
(
this
.
subscriptions
.
push
(
this
.
msgsService
.
errorMsgsUpdated
.
subscribe
(
this
.
msgsService
.
errorMsgsUpdated
.
subscribe
(
data
=>
{
data
=>
{
console
.
log
(
data
);
//
console.log(data);
this
.
errorMsgs
=
data
;
this
.
errorMsgs
=
data
;
}
}
)
)
...
...
frontend/angular/src/app/components/list-message-template/list-message-template.component.ts
View file @
7d463ed7
import
{
Component
,
OnInit
}
from
'@angular/core'
;
import
{
Component
,
OnInit
}
from
'@angular/core'
;
import
{
ActivatedRoute
,
Router
}
from
'@angular/router'
;
import
{
ActivatedRoute
,
Router
}
from
'@angular/router'
;
import
{
combineLatest
}
from
'rxjs/observable/combineLatest'
;
import
{
Subscription
}
from
'rxjs/Subscription'
;
import
{
Subscription
}
from
'rxjs/Subscription'
;
import
{
AppService
}
from
'../../app.service'
;
import
{
AppService
}
from
'../../app.service'
;
import
{
SEARCH
,
SERVICES
}
from
'../../constants'
;
import
{
SEARCH
,
SERVICES
}
from
'../../constants'
;
...
@@ -7,6 +8,7 @@ import { MessageTemplateModel } from '../../models/messageTemplate.model';
...
@@ -7,6 +8,7 @@ import { MessageTemplateModel } from '../../models/messageTemplate.model';
import
{
SorterModel
}
from
'../../models/sorterModel'
;
import
{
SorterModel
}
from
'../../models/sorterModel'
;
import
{
SearchService
}
from
'../../oneit/services/search.service'
;
import
{
SearchService
}
from
'../../oneit/services/search.service'
;
import
{
UtilsService
}
from
'../../oneit/services/utils.service'
;
import
{
UtilsService
}
from
'../../oneit/services/utils.service'
;
import
{
AdminPortalLayoutService
}
from
'../admin-portal/admin-portal-layout/admin-portal-layout.service'
;
import
{
BaseComponent
}
from
'../base/base.component'
;
import
{
BaseComponent
}
from
'../base/base.component'
;
@
Component
({
@
Component
({
...
@@ -20,13 +22,15 @@ export class ListMessageTemplateComponent extends BaseComponent implements OnIni
...
@@ -20,13 +22,15 @@ export class ListMessageTemplateComponent extends BaseComponent implements OnIni
sharedTemplates
:
Array
<
MessageTemplateModel
>
=
[];
sharedTemplates
:
Array
<
MessageTemplateModel
>
=
[];
sortOptions
:
Array
<
SorterModel
>
;
sortOptions
:
Array
<
SorterModel
>
;
showLoader
=
false
;
showLoader
=
false
;
processing
=
false
;
constructor
(
constructor
(
private
router
:
Router
,
private
router
:
Router
,
private
activatedRoute
:
ActivatedRoute
,
private
activatedRoute
:
ActivatedRoute
,
private
utilsService
:
UtilsService
,
private
utilsService
:
UtilsService
,
private
searchService
:
SearchService
,
private
searchService
:
SearchService
,
private
appService
:
AppService
private
appService
:
AppService
,
private
adminPortalLayoutService
:
AdminPortalLayoutService
)
{
)
{
super
(
utilsService
);
super
(
utilsService
);
}
}
...
@@ -37,6 +41,24 @@ export class ListMessageTemplateComponent extends BaseComponent implements OnIni
...
@@ -37,6 +41,24 @@ export class ListMessageTemplateComponent extends BaseComponent implements OnIni
new
SorterModel
(
'Alphabetical (Z-A)'
,
false
)
new
SorterModel
(
'Alphabetical (Z-A)'
,
false
)
];
];
this
.
showLoader
=
true
;
this
.
showLoader
=
true
;
this
.
processing
=
true
;
this
.
startComponent
();
this
.
subscriptions
.
push
(
this
.
adminPortalLayoutService
.
userDataUpdated
.
subscribe
(
()
=>
{
this
.
startComponent
();
}
));
}
startComponent
():
void
{
if
(
!
this
.
processing
)
{
return
;
}
this
.
processing
=
false
;
const
sharedMsgParams
=
{
const
sharedMsgParams
=
{
OnlyGlobalTemplate
:
true
OnlyGlobalTemplate
:
true
};
};
...
@@ -45,33 +67,21 @@ export class ListMessageTemplateComponent extends BaseComponent implements OnIni
...
@@ -45,33 +67,21 @@ export class ListMessageTemplateComponent extends BaseComponent implements OnIni
};
};
this
.
subscriptions
.
push
(
this
.
subscriptions
.
push
(
this
.
appService
.
getSearchListing
(
SERVICES
.
MESSAGE_TEMPLATES
,
'All'
,
myMsgParams
,
[],
SEARCH
.
MESSAGE_TEMPLATE
)
combineLatest
(
.
subscribe
(
this
.
appService
.
getSearchListing
(
SERVICES
.
MESSAGE_TEMPLATES
,
'All'
,
myMsgParams
,
[],
SEARCH
.
MESSAGE_TEMPLATE
),
messages
=>
{
this
.
appService
.
getSearchListing
(
SERVICES
.
MESSAGE_TEMPLATES
,
'All'
,
sharedMsgParams
,
[],
SEARCH
.
MESSAGE_TEMPLATE
)
this
.
myTemplates
=
messages
;
this
.
sortSpecificTemplate
(
'myTemplates'
);
},
error
=>
{
this
.
showLoader
=
false
;
this
.
utilsService
.
handleError
(
error
);
}
)
)
);
this
.
subscriptions
.
push
(
this
.
appService
.
getSearchListing
(
SERVICES
.
MESSAGE_TEMPLATES
,
'All'
,
sharedMsgParams
,
[],
SEARCH
.
MESSAGE_TEMPLATE
)
.
subscribe
(
.
subscribe
(
messages
=>
{
(
response
:
[
Array
<
MessageTemplateModel
>
,
Array
<
MessageTemplateModel
>
])
=>
{
this
.
sharedTemplates
=
messages
;
this
.
myTemplates
=
response
[
0
].
filter
(
message
=>
message
.
HiringTeam
===
this
.
adminPortalLayoutService
.
getHiringTeamID
().
ObjectID
);
this
.
sharedTemplates
=
response
[
1
];
this
.
sortSpecificTemplate
(
'myTemplates'
);
this
.
sortSpecificTemplate
(
'sharedTemplates'
);
this
.
sortSpecificTemplate
(
'sharedTemplates'
);
},
error
=>
{
this
.
showLoader
=
false
;
this
.
showLoader
=
false
;
this
.
utilsService
.
handleError
(
error
);
}
}
)
)
);
);
setTimeout
(()
=>
(
this
.
showLoader
=
false
),
0
);
}
}
sortSpecificTemplate
(
arrayName
:
string
):
void
{
sortSpecificTemplate
(
arrayName
:
string
):
void
{
...
...
frontend/angular/src/app/components/list-work-flows/list-work-flows.component.ts
View file @
7d463ed7
import
{
Component
,
OnInit
}
from
'@angular/core'
;
import
{
Component
,
OnInit
}
from
'@angular/core'
;
import
{
Router
}
from
'@angular/router'
;
import
{
Router
}
from
'@angular/router'
;
import
{
combineLatest
}
from
'rxjs/observable/combineLatest'
;
import
{
Subscription
}
from
'rxjs/Subscription'
;
import
{
Subscription
}
from
'rxjs/Subscription'
;
import
{
AppService
}
from
'../../app.service'
;
import
{
AppService
}
from
'../../app.service'
;
import
{
SEARCH
,
SERVICES
}
from
'../../constants'
;
import
{
SEARCH
,
SERVICES
}
from
'../../constants'
;
import
{
SorterModel
}
from
'../../models/sorterModel'
;
import
{
SorterModel
}
from
'../../models/sorterModel'
;
import
{
WorkflowTemplateModel
}
from
'../../models/workflowTemplate.model'
;
import
{
WorkflowTemplateModel
}
from
'../../models/workflowTemplate.model'
;
import
{
UtilsService
}
from
'../../oneit/services/utils.service'
;
import
{
UtilsService
}
from
'../../oneit/services/utils.service'
;
import
{
AdminPortalLayoutService
}
from
'../admin-portal/admin-portal-layout/admin-portal-layout.service'
;
import
{
BaseComponent
}
from
'../base/base.component'
;
import
{
BaseComponent
}
from
'../base/base.component'
;
@
Component
({
@
Component
({
...
@@ -19,11 +21,13 @@ export class ListWorkFlowsComponent extends BaseComponent implements OnInit {
...
@@ -19,11 +21,13 @@ export class ListWorkFlowsComponent extends BaseComponent implements OnInit {
sharedTemplates
:
Array
<
WorkflowTemplateModel
>
=
[];
sharedTemplates
:
Array
<
WorkflowTemplateModel
>
=
[];
sortOptions
:
Array
<
SorterModel
>
;
sortOptions
:
Array
<
SorterModel
>
;
showLoader
=
false
;
showLoader
=
false
;
processing
=
false
;
constructor
(
constructor
(
private
router
:
Router
,
private
router
:
Router
,
private
utilsService
:
UtilsService
,
private
utilsService
:
UtilsService
,
private
appService
:
AppService
private
appService
:
AppService
,
private
adminPortalLayoutService
:
AdminPortalLayoutService
)
{
)
{
super
(
utilsService
);
super
(
utilsService
);
}
}
...
@@ -33,31 +37,48 @@ export class ListWorkFlowsComponent extends BaseComponent implements OnInit {
...
@@ -33,31 +37,48 @@ export class ListWorkFlowsComponent extends BaseComponent implements OnInit {
new
SorterModel
(
'Alphabetical (A-Z)'
,
true
),
new
SorterModel
(
'Alphabetical (A-Z)'
,
true
),
new
SorterModel
(
'Alphabetical (Z-A)'
,
false
)
new
SorterModel
(
'Alphabetical (Z-A)'
,
false
)
];
];
this
.
showLoader
=
true
;
this
.
processing
=
true
;
this
.
startComponent
();
this
.
subscriptions
.
push
(
this
.
adminPortalLayoutService
.
userDataUpdated
.
subscribe
(
()
=>
{
this
.
startComponent
();
}
));
}
startComponent
():
void
{
if
(
!
this
.
processing
)
{
return
;
}
this
.
processing
=
false
;
const
sharedParams
=
{
const
sharedParams
=
{
OnlyGlobalTemplates
:
true
OnlyGlobalTemplates
:
true
};
};
const
myParams
=
{
const
myParams
=
{
OnlyGlobalTemplates
:
false
OnlyGlobalTemplates
:
false
};
};
this
.
subscriptions
.
push
(
this
.
subscriptions
.
push
(
this
.
appService
.
getSearchListing
(
SERVICES
.
WORKFLOW_TEMPLATES
,
'All'
,
myParams
,
[],
SEARCH
.
WORKFLOW_TEMPLATE
)
combineLatest
(
.
subscribe
(
this
.
appService
.
getSearchListing
(
SERVICES
.
WORKFLOW_TEMPLATES
,
'All'
,
myParams
,
[],
SEARCH
.
WORKFLOW_TEMPLATE
),
messages
=>
{
this
.
myTemplates
=
messages
;
this
.
sortSpecificTemplate
(
'myTemplates'
);
},
error
=>
{
this
.
showLoader
=
false
;
this
.
utilsService
.
handleError
(
error
);
}
)
);
this
.
subscriptions
.
push
(
this
.
appService
.
getSearchListing
(
SERVICES
.
WORKFLOW_TEMPLATES
,
'All'
,
sharedParams
,
[],
SEARCH
.
WORKFLOW_TEMPLATE
)
this
.
appService
.
getSearchListing
(
SERVICES
.
WORKFLOW_TEMPLATES
,
'All'
,
sharedParams
,
[],
SEARCH
.
WORKFLOW_TEMPLATE
)
)
.
subscribe
(
.
subscribe
(
messages
=>
{
(
response
:
[
Array
<
WorkflowTemplateModel
>
,
Array
<
WorkflowTemplateModel
>
])
=>
{
this
.
sharedTemplates
=
messages
;
this
.
myTemplates
=
response
[
0
].
filter
(
wf
=>
wf
.
HiringTeam
===
this
.
adminPortalLayoutService
.
getHiringTeamID
().
ObjectID
);
this
.
sortSpecificTemplate
(
'myTemplates'
);
this
.
sharedTemplates
=
response
[
1
];
this
.
sortSpecificTemplate
(
'sharedTemplates'
);
this
.
sortSpecificTemplate
(
'sharedTemplates'
);
const
val
=
this
.
myTemplates
.
map
(
m
=>
m
.
ObjectID
)
.
join
(
','
);
console
.
log
(
val
);
this
.
showLoader
=
false
;
},
},
error
=>
{
error
=>
{
this
.
showLoader
=
false
;
this
.
showLoader
=
false
;
...
@@ -65,7 +86,6 @@ export class ListWorkFlowsComponent extends BaseComponent implements OnInit {
...
@@ -65,7 +86,6 @@ export class ListWorkFlowsComponent extends BaseComponent implements OnInit {
}
}
)
)
);
);
setTimeout
(()
=>
(
this
.
showLoader
=
false
),
0
);
}
}
sortSpecificTemplate
(
arrayName
:
string
):
void
{
sortSpecificTemplate
(
arrayName
:
string
):
void
{
...
...
frontend/angular/src/app/constants.ts
View file @
7d463ed7
...
@@ -4,7 +4,10 @@ export const CLASSES = {
...
@@ -4,7 +4,10 @@ export const CLASSES = {
APPLICATION_STATUS
:
'performa.orm.types.ApplicationStatus'
,
APPLICATION_STATUS
:
'performa.orm.types.ApplicationStatus'
,
HIRING_TEAM
:
'performa.orm.HiringTeam'
,
HIRING_TEAM
:
'performa.orm.HiringTeam'
,
PLACEHOLDER_OPTIONS
:
'performa.orm.types.PlaceholderOptions'
,
PLACEHOLDER_OPTIONS
:
'performa.orm.types.PlaceholderOptions'
,
WORKFLOW_TEMPLATE
:
'performa.orm.WorkFlowTemplate'
WORKFLOW_TEMPLATE
:
'performa.orm.WorkFlowTemplate'
,
WORKFLOW_MESSAGE
:
'performa.orm.WorkFlowMessage'
,
WORKFLOW_STAGE
:
'performa.orm.WorkFlowStage'
,
WORKFLOW_STEP
:
'performa.orm.WorkFlowStep'
};
};
export
const
SERVICES
=
{
export
const
SERVICES
=
{
...
...
frontend/angular/src/app/models/workflowMessage.model.ts
0 → 100644
View file @
7d463ed7
import
{
CLASSES
}
from
'../constants'
;
import
{
MessageTemplateModel
}
from
'./messageTemplate.model'
;
export
class
WorkflowMessageModel
{
ObjectID
:
string
;
ObjectClass
=
CLASSES
.
WORKFLOW_MESSAGE
;
Delay
:
string
;
Variance
:
string
;
BusinessHoursOnly
:
boolean
;
IsWithdrawalMessage
:
boolean
;
ApplicantSources
:
any
;
MessageTemplate
:
MessageTemplateModel
|
string
;
WorkFlowStage
:
string
;
constructor
(
wfStageID
:
string
)
{
this
.
WorkFlowStage
=
wfStageID
;
}
}
frontend/angular/src/app/models/workflowStage.model.ts
0 → 100644
View file @
7d463ed7
import
{
CLASSES
}
from
'../constants'
;
import
{
StageTypeEnum
}
from
'./stageType.enum'
;
import
{
WorkflowMessageModel
}
from
'./workflowMessage.model'
;
import
{
WorkflowStepModel
}
from
'./workflowStep.model'
;
export
class
WorkflowStageModel
{
ObjectID
:
string
;
ObjectClass
=
CLASSES
.
WORKFLOW_STAGE
;
Name
:
string
;
UseMessaging
:
boolean
;
StageType
:
StageTypeEnum
;
SortOrder
:
number
;
AutoProgress
:
boolean
;
WorkFlowTemplate
:
string
;
// ID of WorkflowTemplateModel
WorkFlowMessages
:
Array
<
WorkflowMessageModel
>
;
Steps
:
Array
<
WorkflowStepModel
>
;
constructor
(
name
:
string
,
useMsg
:
boolean
,
stage
:
StageTypeEnum
,
order
:
number
,
autoProgress
:
boolean
,
templateID
:
string
)
{
this
.
Name
=
name
;
this
.
UseMessaging
=
useMsg
;
this
.
StageType
=
stage
;
this
.
SortOrder
=
order
;
this
.
AutoProgress
=
autoProgress
;
this
.
WorkFlowTemplate
=
templateID
;
this
.
Steps
=
[];
this
.
WorkFlowMessages
=
[];
}
}
frontend/angular/src/app/models/workflowStep.model.ts
0 → 100644
View file @
7d463ed7
import
{
CLASSES
}
from
'../constants'
;
import
{
StepTypeEnum
}
from
'./stepType.enum'
;
export
class
WorkflowStepModel
{
ObjectID
:
string
;
ObjectClass
=
CLASSES
.
WORKFLOW_STEP
;
SortOrder
:
number
;
StepType
:
StepTypeEnum
;
WorkFlowStage
:
string
;
// ID of WorkflowStageModel
constructor
(
order
:
number
,
step
:
StepTypeEnum
,
stageID
:
string
)
{
this
.
SortOrder
=
order
;
this
.
StepType
=
step
;
this
.
WorkFlowStage
=
stageID
;
}
}
frontend/angular/src/app/models/workflowTemplate.model.ts
View file @
7d463ed7
import
{
CLASSES
}
from
'../constants'
;
import
{
CLASSES
}
from
'../constants'
;
import
{
HiringTeamModel
}
from
'./hiringTeam.model'
;
import
{
HiringTeamModel
}
from
'./hiringTeam.model'
;
import
{
ResponseActionEnum
}
from
'./responseAction.enum'
;
import
{
ResponseActionEnum
}
from
'./responseAction.enum'
;
import
{
WorkflowMessageModel
}
from
'./workflowMessage.model'
;
import
{
WorkflowStageModel
}
from
'./workflowStage.model'
;
export
class
WorkflowTemplateModel
{
export
class
WorkflowTemplateModel
{
ObjectID
:
string
;
ObjectID
:
string
;
...
@@ -19,8 +21,7 @@ export class WorkflowTemplateModel {
...
@@ -19,8 +21,7 @@ export class WorkflowTemplateModel {
JobOutlineButtonText
:
string
;
JobOutlineButtonText
:
string
;
RelatedToJob
:
boolean
;
RelatedToJob
:
boolean
;
IsSystemGenerated
:
boolean
;
IsSystemGenerated
:
boolean
;
WithdrawalMessage
:
string
;
HiringTeam
:
HiringTeamModel
|
string
;
HiringTeam
:
HiringTeamModel
|
string
;
WorkFlowStages
:
Array
<
string
>
;
WorkFlowStages
:
Array
<
WorkflowStageModel
>
;
Jobs
:
Array
<
string
>
;
Jobs
:
Array
<
string
>
;
}
}
frontend/angular/src/assets/css/custom.scss
View file @
7d463ed7
...
@@ -10,6 +10,33 @@
...
@@ -10,6 +10,33 @@
white-space
:
nowrap
;
white-space
:
nowrap
;
}
}
::ng-deep
{
.ui-inputswitch
{
height
:
18px
;
width
:
36px
!
important
;
overflow
:
visible
;
background-color
:
#9e9e9e
;
border-color
:
#9e9e9e
;
-moz-border-radius
:
8px
;
-webkit-border-radius
:
8px
;
border-radius
:
8px
;
}
.ui-inputswitch-slider
{
&
:before
{
border-radius
:
50%
;
position
:
absolute
;
content
:
""
;
height
:
15px
;
width
:
15px
;
left
:
1px
;
bottom
:
0
;
background-color
:
white
;
transition
:
.4s
;
}
}
}
.w-80
{
.w-80
{
width
:
80%
!
important
;
width
:
80%
!
important
;
}
}
...
...
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