Commit 12283dfe authored by Meet Narendra's avatar Meet Narendra 💬

confluence

parent e6aa3f2e
Pipeline #1725 canceled with stages
APIs List of APIs
Login Page api/isAuthenticated - Returns true if the user is authenticated, false otherwise.
GET api/authenticate - Authenticates the user with the given credentials.
/login/isAuthenticated?uid=zzz api/register - Registers a new user with the given credentials.
api/getRepos - Get List of All Repositories.
api/getGitFiles - Get List of Github Files.
api/getJiraTickets - Get List of Jira Tickets for a given Repository.
api/getJiraBoards - Get List of Jira Boards.
api/createJiraTicket - Create a Jira Ticket.
api/updateJiraTicket - Update a Jira Ticket.
api/postFileChanges - Post File Changes to Github.
api/postFileCreate - Post File Create to Github.
api/getConfluencePages - Get the Confluence page of a given Repository.
api/getUserDetails - Get the User Details.
api/postUserDetails - Post User Details.
api/getProjectDetails - Get the Project Details.
POST DB Access APIs
/login/authenticate?email=zz&pass=
/login/register?email=zzz&pass=zzz&role=zzz
Home Page api/users/
/home/getRepos?uid=zzz api/projects/
api/access/
Github Page api/jira/
/github/getRepo?uid=zzz&repoId=zzz \ No newline at end of file
/github/getFile?uid=zzz&fileName=zzz
Confluence Page
/confluence/getPage?uid=zzz&repoId=zzz
JIRA Page
/jira/getTickets?uid=zzz&repoId=zzz
/jira/createTicket?uid=zzz&repoId=zzz
/jira/updateTicket?uid=zzz&repoId=zzz
Slack Page
/slack/getChannel?uid=zzz
/slack/sendMessage?uid=zzz
f12320ab-5537-4606-907d-920c1436b5bb,project1,3,3cfbafb7-3bf1-46eb-9d2e-e64897589688,83cad31f-075a-4ec5-8066-e38102385eda
97651460-7fa2-4673-a0a3-319f4a334d2a,project2,3,f38c9161-5c2f-4be7-a764-08bca6b6d868,050a7d00-d091-4861-bdd2-e40e3c890e01
6bc5081e-3315-4fed-9b79-64b30b1e4e72,project3,3,d7d91889-58c8-461b-9a8c-b727ded64d7f,c756a862-749e-4a90-bc03-7e77a8176dc2
957b4421-1de8-436b-b6d8-df2cf69f33e8,project 4,2,3cfbafb7-3bf1-46eb-9d2e-e64897589688,9e44df35-5258-48e9-9e66-daa40d621e34
3cfbafb7-3bf1-46eb-9d2e-e64897589688,project1,2022-11-21 12:28:22.1512+05:30,meet,uid-1.html,uid-1.csv,"",Project Content,This project is about...
f38c9161-5c2f-4be7-a764-08bca6b6d868,project2,2022-11-21 12:28:30.625149+05:30,abu,uid-1.html,uid-1.csv,"",Project Content,This project is about...
d7d91889-58c8-461b-9a8c-b727ded64d7f,project3,2022-11-21 15:27:13.522878+05:30,meet,uid-1.html,uid-1.csv,"",Project Content,This project is about...
03e358c2-3131-476a-9aad-dcc471bbeb04,Ticket 1,Data Cleanup,in_progress,3cfbafb7-3bf1-46eb-9d2e-e64897589688
14b9b94c-9689-44dc-9192-a4620129b163,Ticket 1,Data Cleanup,in_progress,3cfbafb7-3bf1-46eb-9d2e-e64897589688
dec472e5-33ef-4153-8aef-4d30c527f78c,Ticket 2,Data Filter,done,3cfbafb7-3bf1-46eb-9d2e-e64897589688
050a7d00-d091-4861-bdd2-e40e3c890e01,abc@test.com,test2,SM,2022-11-22 11:55:08.427938+05:30,t,dog.jpg,Some catchy bio.,John,Doe
c756a862-749e-4a90-bc03-7e77a8176dc2,abu@iitb.ac.in,test3,SDE,2022-11-22 11:55:36.389814+05:30,t,dog.jpg,Some catchy bio.,John,Doe
47274414-37ff-4b7a-b358-3aa1ec129539,check1@gmail.com,check1,FTE,2022-11-22 12:12:13.905221+05:30,t,dog.jpg,Some catchy bio.,John,Doe
9e44df35-5258-48e9-9e66-daa40d621e34,hmm@hotmail.com,asdf,employee,2022-11-22 12:16:44.477821+05:30,t,dog.jpg,Some catchy bio,Doshi, Meet
83cad31f-075a-4ec5-8066-e38102385eda,meet10@somaiya.edu,test1,SDE,2022-11-22 11:54:49.916626+05:30,t,dog.jpg,Some catchy bio.,John,Doe
<div [innerHTML]="file"></div> <div [innerHTML]="file" style="margin: 5%;"></div>
\ No newline at end of file \ No newline at end of file
import { Component, OnInit } from '@angular/core'; import { Component, OnInit } from '@angular/core';
import {Observable, Observer} from 'rxjs'; import {Observable, Observer} from 'rxjs';
import { FetcherService } from '../fetcher.service'; import { FetcherService } from '../fetcher.service';
import { GET_CONFLUENCE_PAGES_API } from '../urls';
import { getConfluencePagesResponse } from '../responses';
import { HttpClient } from '@angular/common/http';
import { Router } from '@angular/router';
import { CookieService } from 'ngx-cookie-service';
@Component({ @Component({
selector: 'app-confluence', selector: 'app-confluence',
...@@ -8,17 +13,26 @@ import { FetcherService } from '../fetcher.service'; ...@@ -8,17 +13,26 @@ import { FetcherService } from '../fetcher.service';
styleUrls: ['./confluence.component.css'] styleUrls: ['./confluence.component.css']
}) })
export class ConfluenceComponent implements OnInit { export class ConfluenceComponent implements OnInit {
projectId = NaN; projectId = "";
constructor(private fetcherService: FetcherService) { } file = "";
conf_stat$ = new Observable<getConfluencePagesResponse>();
constructor(private fetcherService: FetcherService, private router: Router, private cookieService: CookieService, private http:HttpClient) { }
ngOnInit(): void { ngOnInit(): void {
this.projectId = this.fetcherService.getCurrentProjectId(); this.projectId = this.cookieService.get('pid');
} this.conf_stat$ = this.http.get<getConfluencePagesResponse>(GET_CONFLUENCE_PAGES_API+'?pid='+this.projectId);
file = this.fetchData(this.projectId); this.conf_stat$.subscribe((data) => {
console.log(data);
fetchData(id: number) { if(data.status=true){
//return dummy data of type entry console.log(data);
const file = "<h1>Test file</h1>"; this.http.get('assets/'+data.pages,{responseType: 'text'}).subscribe((data_new) => {
return file; console.log(data_new);
this.file = data_new;
});
}
else{
console.log("error");
}
});
} }
} }
...@@ -83,5 +83,8 @@ export interface createJiraTicketResponse { ...@@ -83,5 +83,8 @@ export interface createJiraTicketResponse {
status: boolean; status: boolean;
} }
export interface getConfluencePagesResponse {
pages: string;
status: boolean;
}
...@@ -276,9 +276,9 @@ class getConfluencePagesViewSet(views.APIView): ...@@ -276,9 +276,9 @@ class getConfluencePagesViewSet(views.APIView):
pid = request.GET.get('pid') pid = request.GET.get('pid')
try: try:
project = Projects.objects.filter(pid=pid) project = Projects.objects.filter(pid=pid)
if project is None: if len(project)==0:
return Response({'status':False}) return Response({'status':False})
return Response({'pages':project[0].values('confluence_id'),'status':True}) return Response({'pages':project.values('confluence_id')[0]['confluence_id'],'status':True})
except Exception as e: except Exception as e:
print(e) print(e)
return Response({'status':False}) return Response({'status':False})
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment