Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
CS699-Project
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Meet Narendra
CS699-Project
Commits
6ef45bc5
Commit
6ef45bc5
authored
Nov 22, 2022
by
Abuhujair Javed
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Comments added for JIRA Component
parent
12283dfe
Pipeline
#1726
canceled with stages
Changes
1
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
30 deletions
+27
-30
frontend/sitcomm/src/app/jira/jira.component.ts
frontend/sitcomm/src/app/jira/jira.component.ts
+27
-30
No files found.
frontend/sitcomm/src/app/jira/jira.component.ts
View file @
6ef45bc5
import
{
DialogRef
}
from
'
@angular/cdk/dialog
'
;
import
{
Component
,
Inject
,
OnInit
}
from
'
@angular/core
'
;
import
{
MatDialog
,
MatDialogRef
,
MAT_DIALOG_DATA
}
from
'
@angular/material/dialog
'
;
import
{
Observable
,
Observer
}
from
'
rxjs
'
;
import
{
Observable
}
from
'
rxjs
'
;
import
{
FetcherService
}
from
'
../fetcher.service
'
;
import
{
GET_JIRA_TICKETS_API
,
CREATE_JIRA_TICKET_API
,
UPDATE_JIRA_TICKET_API
}
from
'
../urls
'
;
import
{
getJiraTicketsResponse
,
createJiraTicketResponse
,
updateJiraTicketResponse
}
from
'
../responses
'
;
...
...
@@ -22,6 +21,9 @@ export interface ListData{
content
:
string
;
}
/**
* This component list the JIRA tickets in four columns as TO DO, IN PROGRESS, DONE, and BACKLOG.
*/
@
Component
({
selector
:
'
app-jira
'
,
templateUrl
:
'
./jira.component.html
'
,
...
...
@@ -39,6 +41,10 @@ export class JiraComponent implements OnInit {
in_prog
=
new
Array
<
ListData
>
();
done
=
new
Array
<
ListData
>
();
backlog
=
new
Array
<
ListData
>
();
/**
* Creating observable component to get, update and create tickets.
*/
getJira_stat$
=
new
Observable
<
getJiraTicketsResponse
>
();
updateJira_stat$
=
new
Observable
<
updateJiraTicketResponse
>
();
createJira_stat$
=
new
Observable
<
createJiraTicketResponse
>
();
...
...
@@ -58,6 +64,9 @@ export class JiraComponent implements OnInit {
}
}
/**
* Open dialog box to create JIRA tickets. and Post the same to DB.
*/
openDialog
(){
const
dialogRef
=
this
.
dialog
.
open
(
CreateTicketDialog
,
{
data
:
{
tid
:
this
.
temp_tid
,
pname
:
this
.
name
,
tname
:
this
.
temp_tname
,
tcontent
:
this
.
temp_tcontent
,
...
...
@@ -65,8 +74,6 @@ export class JiraComponent implements OnInit {
});
dialogRef
.
afterClosed
().
subscribe
(
result
=>
{
console
.
log
(
'
Dialog result:
'
,
result
.
tname
,
result
.
tcontent
);
this
.
to_do
.
push
({
tid
:
'
10
'
,
name
:
result
.
tname
,
content
:
result
.
tcontent
});
this
.
createJira_stat$
=
this
.
http
.
post
<
createJiraTicketResponse
>
(
CREATE_JIRA_TICKET_API
,
{
pid
:
this
.
pid
.
replace
(
"
'
"
,
''
),
name
:
result
.
tname
,
...
...
@@ -77,7 +84,7 @@ export class JiraComponent implements OnInit {
(
response
)
=>
{
console
.
log
(
response
);
if
(
response
.
status
==
true
){
console
.
log
(
'
success
'
);
this
.
to_do
.
push
({
tid
:
response
.
tid
,
name
:
result
.
tname
,
content
:
result
.
tcontent
}
);
}
else
{
console
.
log
(
'
fail
'
);
...
...
@@ -93,8 +100,10 @@ export class JiraComponent implements OnInit {
return
str
;
}
/**
* Returns list to HTML page
*/
fetchList
(
id
:
number
)
{
//return dummy data of type entry
if
(
id
==
1
){
return
this
.
to_do
;
}
...
...
@@ -110,6 +119,10 @@ export class JiraComponent implements OnInit {
}
/**
* Update the status Jira Ticket and Post the same to Backend Server.
* This is called from the move to button, and their respective function calls in the next the three functions.
*/
updateStatus
(
tid
:
string
,
updated_status
:
string
){
this
.
updateJira_stat$
=
this
.
http
.
post
<
updateJiraTicketResponse
>
(
UPDATE_JIRA_TICKET_API
,
{
tid
:
tid
,
...
...
@@ -117,12 +130,9 @@ export class JiraComponent implements OnInit {
});
this
.
updateJira_stat$
.
subscribe
(
(
response
)
=>
{
console
.
log
(
response
);
if
(
response
.
status
==
true
){
console
.
log
(
'
success
'
);
}
else
{
console
.
log
(
'
fail
'
);
}
}
);
...
...
@@ -135,7 +145,6 @@ export class JiraComponent implements OnInit {
if
(
this
.
to_do
[
i
].
tid
==
tid
){
this
.
in_prog
.
push
(
this
.
to_do
[
i
]);
this
.
to_do
.
splice
(
i
,
1
);
console
.
log
(
this
.
to_do
);
break
;
}
}
...
...
@@ -144,7 +153,6 @@ export class JiraComponent implements OnInit {
if
(
this
.
done
[
i
].
tid
==
tid
){
this
.
in_prog
.
push
(
this
.
done
[
i
]);
this
.
done
.
splice
(
i
,
1
);
console
.
log
(
this
.
done
);
break
;
}
}
...
...
@@ -153,15 +161,10 @@ export class JiraComponent implements OnInit {
if
(
this
.
backlog
[
i
].
tid
==
tid
){
this
.
in_prog
.
push
(
this
.
backlog
[
i
]);
this
.
backlog
.
splice
(
i
,
1
);
console
.
log
(
this
.
backlog
);
break
;
}
}
}
console
.
log
(
list_name
);
console
.
log
(
tid
);
console
.
log
(
'
Move to In Progress
'
);
}
moveToDone
(
tid
:
string
,
list_name
:
string
){
...
...
@@ -171,7 +174,6 @@ export class JiraComponent implements OnInit {
if
(
this
.
to_do
[
i
].
tid
==
tid
){
this
.
done
.
push
(
this
.
to_do
[
i
]);
this
.
to_do
.
splice
(
i
,
1
);
console
.
log
(
this
.
to_do
);
break
;
}
}
...
...
@@ -180,7 +182,6 @@ export class JiraComponent implements OnInit {
if
(
this
.
in_prog
[
i
].
tid
==
tid
){
this
.
done
.
push
(
this
.
in_prog
[
i
]);
this
.
in_prog
.
splice
(
i
,
1
);
console
.
log
(
this
.
in_prog
);
break
;
}
}
...
...
@@ -189,7 +190,6 @@ export class JiraComponent implements OnInit {
if
(
this
.
backlog
[
i
].
tid
==
tid
){
this
.
done
.
push
(
this
.
backlog
[
i
]);
this
.
backlog
.
splice
(
i
,
1
);
console
.
log
(
this
.
backlog
);
break
;
}
}
...
...
@@ -203,7 +203,6 @@ export class JiraComponent implements OnInit {
if
(
this
.
in_prog
[
i
].
tid
==
tid
){
this
.
to_do
.
push
(
this
.
in_prog
[
i
]);
this
.
in_prog
.
splice
(
i
,
1
);
console
.
log
(
this
.
in_prog
);
break
;
}
}
...
...
@@ -212,7 +211,6 @@ export class JiraComponent implements OnInit {
if
(
this
.
done
[
i
].
tid
==
tid
){
this
.
to_do
.
push
(
this
.
done
[
i
]);
this
.
done
.
splice
(
i
,
1
);
console
.
log
(
this
.
done
);
break
;
}
}
...
...
@@ -221,15 +219,15 @@ export class JiraComponent implements OnInit {
if
(
this
.
backlog
[
i
].
tid
==
tid
){
this
.
to_do
.
push
(
this
.
backlog
[
i
]);
this
.
backlog
.
splice
(
i
,
1
);
console
.
log
(
this
.
backlog
);
break
;
}
}
}
console
.
log
(
list_name
);
console
.
log
(
tid
);
console
.
log
(
'
Move to ToDo
'
);
}
/**
* On initialization, fetch JIRA tickets for the respective project from DB and divide them into TO DO, IN PROGRESS, DONE and BACKLOG.
*/
ngOnInit
():
void
{
this
.
fetcherService
.
setCurrentProjectId
(
this
.
id
);
this
.
pid
=
this
.
cookieService
.
get
(
'
pid
'
);
...
...
@@ -257,15 +255,14 @@ export class JiraComponent implements OnInit {
}
}
);
console
.
log
(
this
.
to_do
);
console
.
log
(
this
.
in_prog
);
console
.
log
(
this
.
done
);
console
.
log
(
this
.
backlog
);
}
}
/**
* This component handles the dialog box for Create Ticket. It injects the data items to be modified.
* It modifies the TicketData and return the same.
*/
@
Component
({
selector
:
'
create-ticket-dialog
'
,
templateUrl
:
'
./create-ticket-dialog.html
'
,
...
...
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