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
1594c8a9
Commit
1594c8a9
authored
Nov 25, 2019
by
GD-A-150752
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bug-fixes
parent
5ce2c8c8
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
38 additions
and
24 deletions
+38
-24
edit-message-template.component.html
...dit-message-template/edit-message-template.component.html
+1
-1
edit-message-template.component.ts
.../edit-message-template/edit-message-template.component.ts
+22
-6
edit-workflow-template.component.html
...t-workflow-template/edit-workflow-template.component.html
+0
-0
edit-workflow-template.component.ts
...dit-workflow-template/edit-workflow-template.component.ts
+11
-16
custom.scss
frontend/angular/src/assets/css/custom.scss
+4
-1
No files found.
frontend/angular/src/app/components/edit-message-template/edit-message-template.component.html
View file @
1594c8a9
...
...
@@ -84,7 +84,7 @@
</p-editor>
<textarea
id=
"messageContentTxtAreaId"
*
ngIf=
"smsTemplateType()"
pInputTextarea
[(
ngModel
)]="
messageTemplate
.
MessageContent
"
name=
"MessageContent
{{messageTemplate.ObjectID}}
"
name=
"MessageContent"
fieldLabel=
"Message Content"
style=
"width: 100%"
placeholder=
"Message Content"
></textarea>
</div>
...
...
frontend/angular/src/app/components/edit-message-template/edit-message-template.component.ts
View file @
1594c8a9
import
{
Component
,
EventEmitter
,
Input
,
OnInit
,
Output
,
ViewChild
}
from
'@angular/core'
;
import
{
Component
,
EventEmitter
,
Input
,
NgZone
,
OnInit
,
Output
,
ViewChild
}
from
'@angular/core'
;
import
{
NgForm
}
from
'@angular/forms'
;
import
{
ActivatedRoute
,
Params
,
Router
}
from
'@angular/router'
;
import
{
Editor
}
from
'primeng/editor'
;
...
...
@@ -53,7 +53,8 @@ export class EditMessageTemplateComponent extends BaseComponent implements OnIni
private
utilsService
:
UtilsService
,
private
saveService
:
SaveService
,
private
appService
:
AppService
,
private
adminPortalLayoutService
:
AdminPortalLayoutService
private
adminPortalLayoutService
:
AdminPortalLayoutService
,
public
ngZone
:
NgZone
)
{
super
(
utilsService
);
}
...
...
@@ -202,14 +203,20 @@ export class EditMessageTemplateComponent extends BaseComponent implements OnIni
};
if
(
this
.
contentCursorPoint
===
0
)
{
this
.
ngZone
.
run
(()
=>
{
this
.
messageContentEditor
.
getQuill
()
.
insertText
(
this
.
contentCursorPoint
,
' '
);
this
.
contentCursorPoint
++
;
this
.
assignContent
();
});
}
try
{
this
.
ngZone
.
run
(()
=>
{
this
.
messageContentEditor
.
getQuill
()
.
updateContents
(
delta
);
this
.
assignContent
();
});
}
catch
(
e
)
{
this
.
utilsService
.
handleError
(
e
);
}
...
...
@@ -218,6 +225,14 @@ export class EditMessageTemplateComponent extends BaseComponent implements OnIni
this
.
contentLinkModal
.
hide
();
}
assignContent
():
void
{
const
editor
=
this
.
messageContentEditor
.
getQuill
().
container
;
if
(
editor
)
{
const
editElement
=
editor
.
getElementsByClassName
(
'ql-editor'
)[
0
];
this
.
messageTemplate
.
MessageContent
=
editElement
.
innerHTML
;
}
}
addPlaceholderInMessageContent
(
$event
):
void
{
if
(
!
$event
)
{
...
...
@@ -241,11 +256,12 @@ export class EditMessageTemplateComponent extends BaseComponent implements OnIni
}
else
{
this
.
messageContentEditor
.
getQuill
()
.
insertText
(
this
.
contentCursorPoint
,
this
.
contentPlaceholder
.
Placeholder
);
this
.
assignContent
();
}
}
else
{
const
textarea
:
HTMLTextAreaElement
=
document
.
getElementById
(
'messageContentTxtAreaId'
)
as
HTMLTextAreaElement
;
this
.
setValueAndFocus
(
textarea
,
'messageContentTxtArea'
,
this
.
contentPlaceholder
.
Placeholder
);
this
.
setValueAndFocus
(
textarea
,
'messageContentTxtArea'
,
this
.
contentPlaceholder
.
Placeholder
,
'MessageContent'
);
}
this
.
resetSelect
(
'contentPlaceholderOptions'
);
...
...
@@ -295,7 +311,7 @@ export class EditMessageTemplateComponent extends BaseComponent implements OnIni
this
.
subjectPlaceholder
=
$event
;
if
(
this
.
emailTemplateType
()
&&
this
.
subjectPlaceholder
&&
this
.
subjectPlaceholder
.
Value
)
{
const
input
:
HTMLInputElement
=
document
.
getElementById
(
'subjectInputId'
)
as
HTMLInputElement
;
this
.
setValueAndFocus
(
input
,
'subjectInput'
,
this
.
subjectPlaceholder
.
Placeholder
);
this
.
setValueAndFocus
(
input
,
'subjectInput'
,
this
.
subjectPlaceholder
.
Placeholder
,
'Subject'
);
}
this
.
resetSelect
(
'subjectPlaceholderOptions'
);
}
...
...
@@ -434,10 +450,10 @@ export class EditMessageTemplateComponent extends BaseComponent implements OnIni
false
;
}
setValueAndFocus
(
element
,
elementId
,
placeholder
):
void
{
setValueAndFocus
(
element
,
elementId
,
placeholder
,
modelKey
):
void
{
const
start
=
element
.
selectionStart
;
const
end
=
element
.
selectionEnd
;
element
.
value
=
`
${
element
.
value
.
substring
(
0
,
start
)}${
placeholder
}${
element
.
value
.
substring
(
end
)}
`
;
this
.
messageTemplate
[
modelKey
]
=
`
${
element
.
value
.
substring
(
0
,
start
)}${
placeholder
}${
element
.
value
.
substring
(
end
)}
`
;
this
.
focusField
(
elementId
);
...
...
frontend/angular/src/app/components/edit-workflow-template/edit-workflow-template.component.html
View file @
1594c8a9
This diff is collapsed.
Click to expand it.
frontend/angular/src/app/components/edit-workflow-template/edit-workflow-template.component.ts
View file @
1594c8a9
...
...
@@ -70,6 +70,7 @@ export class EditWorkflowTemplateComponent extends BaseComponent implements OnIn
}
ngOnInit
():
void
{
window
.
scrollTo
(
0
,
0
);
this
.
showLoader
=
true
;
if
(
this
.
adminPortalLayoutService
.
userData
)
{
this
.
initComponent
();
...
...
@@ -149,6 +150,9 @@ export class EditWorkflowTemplateComponent extends BaseComponent implements OnIn
const
stageObject
=
new
WorkflowStageModel
(
`
${
stage
.
Description
}
Stage`
,
false
,
stage
,
index
,
false
,
this
.
workflow
.
ObjectID
);
this
.
utilsService
.
addMultiRefObject
(
stageObject
,
this
.
workflow
,
'WorkFlowStages'
,
this
.
createdObjs
);
const
withdrawalMessage
=
new
WorkflowMessageModel
(
stageObject
.
ObjectID
);
withdrawalMessage
.
IsWithdrawalMessage
=
true
;
this
.
utilsService
.
addMultiRefObject
(
withdrawalMessage
,
stageObject
,
'WorkFlowMessages'
,
this
.
createdObjs
);
});
this
.
reOrderStages
();
}
...
...
@@ -172,8 +176,8 @@ export class EditWorkflowTemplateComponent extends BaseComponent implements OnIn
filterStages
():
void
{
this
.
preStages
=
this
.
filteredStages
(
true
,
false
);
this
.
genericStages
=
this
.
filteredStages
(
false
,
false
)
.
sort
((
a
,
b
)
=>
a
.
SortOrder
>
b
.
SortOrder
?
-
1
:
a
.
SortOrder
<
b
.
SortOrder
?
1
:
0
);
this
.
genericStages
=
this
.
filteredStages
(
false
,
false
)
;
// .sort((a, b) => a.SortOrder < b.SortOrder ? -1 : a.SortOrder > b.SortOrder ? 1 : 0)
this
.
postStages
=
this
.
filteredStages
(
false
,
true
);
}
...
...
@@ -437,6 +441,9 @@ export class EditWorkflowTemplateComponent extends BaseComponent implements OnIn
const
stage
=
new
WorkflowStageModel
(
`
${
stageType
.
Description
}
Stage`
,
false
,
stageType
,
this
.
getStageOrder
(),
false
,
this
.
workflow
.
ObjectID
);
this
.
utilsService
.
addMultiRefObject
(
stage
,
this
.
workflow
,
'WorkFlowStages'
,
this
.
createdObjs
);
const
withdrawalMessage
=
new
WorkflowMessageModel
(
stage
.
ObjectID
);
withdrawalMessage
.
IsWithdrawalMessage
=
true
;
this
.
utilsService
.
addMultiRefObject
(
withdrawalMessage
,
stage
,
'WorkFlowMessages'
,
this
.
createdObjs
);
this
.
reOrderStages
();
}
...
...
@@ -447,20 +454,9 @@ export class EditWorkflowTemplateComponent extends BaseComponent implements OnIn
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
.
utilsService
.
removeMultiRefObject
(
stage
,
this
.
workflow
,
'WorkFlowStages'
,
this
.
createdObjs
,
this
.
updatedObjs
,
this
.
deletedObjs
);
this
.
workflow
.
WorkFlowStages
.
forEach
((
stag
,
index
)
=>
stag
.
SortOrder
=
index
+
1
);
}
});
}
...
...
@@ -588,9 +584,8 @@ export class EditWorkflowTemplateComponent extends BaseComponent implements OnIn
}
list
.
forEach
((
item
,
i
)
=>
{
item
.
SortOrder
=
i
;
item
.
SortOrder
=
i
+
1
;
});
console
.
log
(
this
.
workflow
.
WorkFlowStages
);
}
// tslint:disable-next-line:max-file-line-count
...
...
frontend/angular/src/assets/css/custom.scss
View file @
1594c8a9
...
...
@@ -246,7 +246,10 @@
}
.ui-dialog
{
left
:
100px
!
important
;
&
.ui-dialog-draggable
{
left
:
20px
!
important
;
right
:
20px
!
important
;
overflow-y
:
scroll
;
height
:
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