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
894abd73
Commit
894abd73
authored
Nov 27, 2019
by
GD-A-150752
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bug-Fix S52544051 # Sprint 1 Issues #Getting error when removing stages
parent
41311a2b
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
41 additions
and
15 deletions
+41
-15
edit-workflow-template.component.html
...t-workflow-template/edit-workflow-template.component.html
+7
-6
edit-workflow-template.component.ts
...dit-workflow-template/edit-workflow-template.component.ts
+34
-9
No files found.
frontend/angular/src/app/components/admin-portal/edit-workflow-template/edit-workflow-template.component.html
View file @
894abd73
...
@@ -183,17 +183,18 @@
...
@@ -183,17 +183,18 @@
<p-panel
[
toggleable
]="
true
"
#
panel
[
collapsed
]="
true
"
toggler=
"header"
>
<p-panel
[
toggleable
]="
true
"
#
panel
[
collapsed
]="
true
"
toggler=
"header"
>
<p-header>
<p-header>
<span
(
click
)="
toggleInput
($
event
,
'
StageName
'+
stage
.
SortOrder
,
true
)"
<span
(
click
)="
toggleInput
($
event
,
'
StageName
'+
stage
.
ObjectID
,
true
)"
*
ngIf=
"showLabel('StageName'+stage.SortOrder)"
*
ngIf=
"showLabel('StageName'+stage.ObjectID)"
id=
"StageName{{stage.ObjectID}}"
class=
"ui-panel-title"
>
class=
"ui-panel-title"
>
{{getStageHeader(stage)}}
{{getStageHeader(stage)}}
</span>
</span>
<input
(
blur
)="
toggleInput
($
event
,
'
StageName
'+
stage
.
SortOrder
,
false
)"
<input
(
blur
)="
toggleInput
($
event
,
'
StageName
'+
stage
.
ObjectID
,
false
)"
*
ngIf=
"!showLabel('StageName'+stage.
SortOrder
)"
*
ngIf=
"!showLabel('StageName'+stage.
ObjectID
)"
[(
ngModel
)]="
stage
.
Name
"
[
disabled
]="
showLoader
"
[(
ngModel
)]="
stage
.
Name
"
[
disabled
]="
showLoader
"
class=
"form-control panel-header-input"
class=
"form-control panel-header-input"
id=
"StageName{{stage.
SortOrder
}}Id"
id=
"StageName{{stage.
ObjectID
}}Id"
name=
"StageName{{stage.
SortOrder
}}"
name=
"StageName{{stage.
ObjectID
}}"
pInputText
required
/>
pInputText
required
/>
</p-header>
</p-header>
<div
class=
"ui-g form-group"
*
ngIf=
"!panel.collapsed"
>
<div
class=
"ui-g form-group"
*
ngIf=
"!panel.collapsed"
>
...
...
frontend/angular/src/app/components/admin-portal/edit-workflow-template/edit-workflow-template.component.ts
View file @
894abd73
...
@@ -278,7 +278,7 @@ export class EditWorkflowTemplateComponent extends BaseComponent implements OnIn
...
@@ -278,7 +278,7 @@ export class EditWorkflowTemplateComponent extends BaseComponent implements OnIn
* number of days, hours and minutes.
* number of days, hours and minutes.
* Input mask gets values in the form of __:__:__
* Input mask gets values in the form of __:__:__
* Parsing of this value takes place in this function, moreover it sorts the messages as well
* Parsing of this value takes place in this function, moreover it sorts the messages as well
* @
param
message
* @
WorkflowMessageModel
message
*/
*/
generateDelayString
(
message
:
WorkflowMessageModel
):
void
{
generateDelayString
(
message
:
WorkflowMessageModel
):
void
{
...
@@ -351,8 +351,8 @@ export class EditWorkflowTemplateComponent extends BaseComponent implements OnIn
...
@@ -351,8 +351,8 @@ export class EditWorkflowTemplateComponent extends BaseComponent implements OnIn
/**
/**
* This function sets the parameters to be sent to edit-message-template component
* This function sets the parameters to be sent to edit-message-template component
* @param $event
* @param $event
Browser Event
* @param message
* @param message
WorkflowMessageModel
*/
*/
showMessageTemplateDialog
(
$event
,
message
:
WorkflowMessageModel
):
void
{
showMessageTemplateDialog
(
$event
,
message
:
WorkflowMessageModel
):
void
{
const
template
=
$event
.
value
;
const
template
=
$event
.
value
;
...
@@ -378,7 +378,7 @@ export class EditWorkflowTemplateComponent extends BaseComponent implements OnIn
...
@@ -378,7 +378,7 @@ export class EditWorkflowTemplateComponent extends BaseComponent implements OnIn
/**
/**
* When the dialog is closed, whether a template is created or updated, it is fetched by sending request to API.
* When the dialog is closed, whether a template is created or updated, it is fetched by sending request to API.
* Newly created or updated template is selected and shown in the dropdown of message in message scheduling section.
* Newly created or updated template is selected and shown in the dropdown of message in message scheduling section.
* @param value
* @param value
number
*/
*/
closeDialog
(
value
):
void
{
closeDialog
(
value
):
void
{
if
(
value
===
-
1
)
{
if
(
value
===
-
1
)
{
...
@@ -417,6 +417,14 @@ export class EditWorkflowTemplateComponent extends BaseComponent implements OnIn
...
@@ -417,6 +417,14 @@ export class EditWorkflowTemplateComponent extends BaseComponent implements OnIn
this
.
removeStepType
(
selectedStepType
);
this
.
removeStepType
(
selectedStepType
);
}
}
stepRemovalProcess
(
step
:
WorkflowStepModel
,
stage
:
WorkflowStageModel
):
void
{
const
stepType
=
step
.
StepType
;
this
.
utilsService
.
removeMultiRefObject
(
step
,
stage
,
'Steps'
,
this
.
createdObjs
,
this
.
updatedObjs
,
this
.
deletedObjs
);
stage
.
Steps
.
map
((
stageStep
,
index
)
=>
stageStep
.
SortOrder
=
index
+
1
);
this
.
addStepType
(
stepType
);
}
removeStep
(
step
:
WorkflowStepModel
,
stage
:
WorkflowStageModel
):
void
{
removeStep
(
step
:
WorkflowStepModel
,
stage
:
WorkflowStageModel
):
void
{
this
.
confirmationService
.
confirm
({
this
.
confirmationService
.
confirm
({
message
:
'Are you sure you want to delete this record?'
,
message
:
'Are you sure you want to delete this record?'
,
...
@@ -424,11 +432,7 @@ export class EditWorkflowTemplateComponent extends BaseComponent implements OnIn
...
@@ -424,11 +432,7 @@ export class EditWorkflowTemplateComponent extends BaseComponent implements OnIn
icon
:
'fa fa-trash'
,
icon
:
'fa fa-trash'
,
key
:
'RemoveRow'
,
key
:
'RemoveRow'
,
accept
:
()
=>
{
accept
:
()
=>
{
const
stepType
=
step
.
StepType
;
this
.
stepRemovalProcess
(
step
,
stage
);
this
.
utilsService
.
removeMultiRefObject
(
step
,
stage
,
'Steps'
,
this
.
createdObjs
,
this
.
updatedObjs
,
this
.
deletedObjs
);
stage
.
Steps
.
map
((
step
,
index
)
=>
step
.
SortOrder
=
index
+
1
);
this
.
addStepType
(
stepType
);
}
}
});
});
}
}
...
@@ -473,6 +477,15 @@ export class EditWorkflowTemplateComponent extends BaseComponent implements OnIn
...
@@ -473,6 +477,15 @@ export class EditWorkflowTemplateComponent extends BaseComponent implements OnIn
this
.
reOrderStages
();
this
.
reOrderStages
();
}
}
/**
* Removal of stage is done in three steps
* removal of its Workflow messages
* removal of its Steps and adding steps back to original stepsEnum array
* removal of stage itself
* Using for loop instead of forEach to restrict the number of iterations
* Keeping the index 0 in order to make sure always first item is being deleted.
* @param stage WorkflowStageModel
*/
removeStage
(
stage
:
WorkflowStageModel
):
void
{
removeStage
(
stage
:
WorkflowStageModel
):
void
{
this
.
confirmationService
.
confirm
({
this
.
confirmationService
.
confirm
({
message
:
'Are you sure you want to delete this record?'
,
message
:
'Are you sure you want to delete this record?'
,
...
@@ -480,6 +493,18 @@ export class EditWorkflowTemplateComponent extends BaseComponent implements OnIn
...
@@ -480,6 +493,18 @@ export class EditWorkflowTemplateComponent extends BaseComponent implements OnIn
icon
:
'fa fa-trash'
,
icon
:
'fa fa-trash'
,
key
:
'RemoveRow'
,
key
:
'RemoveRow'
,
accept
:
()
=>
{
accept
:
()
=>
{
// Removing messages of stage
stage
.
WorkFlowMessages
.
forEach
(
message
=>
{
this
.
utilsService
.
removeMultiRefObject
(
message
,
stage
,
'WorkFlowMessages'
,
this
.
createdObjs
,
this
.
updatedObjs
,
this
.
deletedObjs
);
});
// Adding steps in dropdown followed by removing Steps of stage
const
stepsLength
=
stage
.
Steps
.
length
;
for
(
let
i
=
0
;
i
<
stepsLength
;
i
++
)
{
this
.
stepRemovalProcess
(
stage
.
Steps
[
0
],
stage
);
}
this
.
utilsService
.
removeMultiRefObject
(
stage
,
this
.
workflow
,
'WorkFlowStages'
,
this
.
createdObjs
,
this
.
utilsService
.
removeMultiRefObject
(
stage
,
this
.
workflow
,
'WorkFlowStages'
,
this
.
createdObjs
,
this
.
updatedObjs
,
this
.
deletedObjs
);
this
.
updatedObjs
,
this
.
deletedObjs
);
this
.
workflow
.
WorkFlowStages
.
forEach
((
stag
,
index
)
=>
stag
.
SortOrder
=
index
+
1
);
this
.
workflow
.
WorkFlowStages
.
forEach
((
stag
,
index
)
=>
stag
.
SortOrder
=
index
+
1
);
...
...
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