From 2375b81bb6844e776eaf7db88c6ae1bad9e0b24d Mon Sep 17 00:00:00 2001 From: gsalunke Date: Wed, 20 Apr 2022 12:42:25 +0530 Subject: [PATCH 1/3] added few changes --- samples/all_pr_for_org.json | 17 +++++++++++++++++ samples/login.json | 3 +++ samples/pr_approval.json | 3 +++ samples/pr_approval_base.json | 3 +++ 4 files changed, 26 insertions(+) create mode 100644 samples/all_pr_for_org.json create mode 100644 samples/login.json create mode 100644 samples/pr_approval.json create mode 100644 samples/pr_approval_base.json diff --git a/samples/all_pr_for_org.json b/samples/all_pr_for_org.json new file mode 100644 index 0000000..7e7f558 --- /dev/null +++ b/samples/all_pr_for_org.json @@ -0,0 +1,17 @@ +{ + "template": "all_pr_for_org.html", + "repo_mapping": { + "code_repo": { + "owner": { + "account_name": "Acme, Inc" + }, + "repo_full_name": "acme/mono-repo" + }, + "documentation_repo": { + "repo_full_name": "acme/documentation" + } + }, + "monitored_pr": { + "pull_request_status": "NOT_CONNECTED" + } +} diff --git a/samples/login.json b/samples/login.json new file mode 100644 index 0000000..a2d3ddc --- /dev/null +++ b/samples/login.json @@ -0,0 +1,3 @@ +{ + "template": "login.html" +} diff --git a/samples/pr_approval.json b/samples/pr_approval.json new file mode 100644 index 0000000..5b98e76 --- /dev/null +++ b/samples/pr_approval.json @@ -0,0 +1,3 @@ +{ + "template": "pr_approval.html" +} diff --git a/samples/pr_approval_base.json b/samples/pr_approval_base.json new file mode 100644 index 0000000..1917035 --- /dev/null +++ b/samples/pr_approval_base.json @@ -0,0 +1,3 @@ +{ + "template": "pr_approval_base.html" +} From 353fbb2d3f3751f91d3f120b52b0f569e9623249 Mon Sep 17 00:00:00 2001 From: gsalunke Date: Wed, 20 Apr 2022 15:54:09 +0530 Subject: [PATCH 2/3] added new view data for homepage --- app/templates/all_pr_for_org.html | 4 +- samples/all_pr_for_org-empty.json | 16 ++++++ samples/all_pr_for_org.json | 89 +++++++++++++++++++++++++++++-- 3 files changed, 105 insertions(+), 4 deletions(-) create mode 100644 samples/all_pr_for_org-empty.json diff --git a/app/templates/all_pr_for_org.html b/app/templates/all_pr_for_org.html index db69454..e09d2dc 100644 --- a/app/templates/all_pr_for_org.html +++ b/app/templates/all_pr_for_org.html @@ -26,8 +26,10 @@
{% for monitored_pr in open_prs %} + {% with code_pr_number=monitored_pr.code_pull_request.pr_number|stringformat:"s" documentation_pr_number=monitored_pr.documentation_pull_request.pr_number|stringformat:"s" %} {% with code_pr_name="#"|add:code_pr_number|add:" "|add:monitored_pr.code_pull_request.pr_title %} + { % 'title':"{{'jjj'}} %s"}
{% if monitored_pr.pull_request_status == "NOT_CONNECTED" %}
@@ -35,7 +37,7 @@ {{ code_pr_name }} {{monitored_pr.pull_request_status}} + data-icon="octicon:note-16">{{monitored_pr.get_pull_request_status_display}}
diff --git a/samples/all_pr_for_org-empty.json b/samples/all_pr_for_org-empty.json new file mode 100644 index 0000000..a879322 --- /dev/null +++ b/samples/all_pr_for_org-empty.json @@ -0,0 +1,16 @@ +{ + "template": "all_pr_for_org.html", + "repo_mapping": { + "code_repo": { + "owner": { + "account_name": "Acme, Inc" + }, + "repo_full_name": "acme/mono-repo" + }, + "documentation_repo": { + "repo_full_name": "acme/documentation" + } + }, + "open_prs": [] +} +//http://localhost:8000/samples/all_pr_for_org-empty/ - design required \ No newline at end of file diff --git a/samples/all_pr_for_org.json b/samples/all_pr_for_org.json index 7e7f558..3b6fb87 100644 --- a/samples/all_pr_for_org.json +++ b/samples/all_pr_for_org.json @@ -11,7 +11,90 @@ "repo_full_name": "acme/documentation" } }, - "monitored_pr": { - "pull_request_status": "NOT_CONNECTED" - } + "open_prs": [ + { + "pull_request_status": "NOT_CONNECTED", + "get_pull_request_status_display": "Not Connected", + "get_latest_approval": { + "approver": { + "github_user":{ + "account_name": "Amit Upadhyay" + } + }, + "created_on": "2 minutes" + }, + "code_pull_request": { + "pr_number": 20, + "pr_title" : "Code PR title here", + "get_url" : "https://github.com/fifthtry" + }, + "documentation_pull_request":{ + "pr_number": 10, + "pr_title" : "Document PR title here" + } + }, + { + "pull_request_status": "APPROVED", + "get_pull_request_status_display": "Approved", + "get_latest_approval": { + "approver": { + "github_user":{ + "account_name": "Amit Upadhyay" + } + }, + "created_on": "2 minutes" + }, + "code_pull_request": { + "pr_number": 20, + "pr_title" : "Code PR title here", + "get_url" : "https://github.com/fifthtry" + }, + "documentation_pull_request":{ + "pr_number": 10, + "pr_title" : "Document PR title here" + } + }, + { + "pull_request_status": "APPROVAL_PENDING", + "get_pull_request_status_display": "Approval Pending", + "get_latest_approval": { + "approver": { + "github_user":{ + "account_name": "Amit Upadhyay" + } + }, + "created_on": "2 minutes" + }, + "code_pull_request": { + "pr_number": 20, + "pr_title" : "Code PR title here", + "get_url" : "https://github.com/fifthtry" + }, + "documentation_pull_request":{ + "pr_number": 10, + "pr_title" : "Document PR title here" + } + }, + { + "pull_request_status": "STALE_CODE", + "get_pull_request_status_display": "Stale Code", + "get_latest_approval": { + "approver": { + "github_user":{ + "account_name": "Amit Upadhyay" + } + }, + "created_on": "2 minutes" + }, + "code_pull_request": { + "pr_number": 20, + "pr_title" : "Code PR title here", + "get_url" : "https://github.com/fifthtry" + }, + "documentation_pull_request":{ + "pr_number": 10, + "pr_title" : "Document PR title here" + } + } + ] } From de3cd7967317cd265564d9d0e84357a1fc7bd615 Mon Sep 17 00:00:00 2001 From: gsalunke Date: Wed, 20 Apr 2022 15:55:32 +0530 Subject: [PATCH 3/3] removed garbage --- samples/all_pr_for_org-empty.json | 1 - 1 file changed, 1 deletion(-) diff --git a/samples/all_pr_for_org-empty.json b/samples/all_pr_for_org-empty.json index a879322..573cfdc 100644 --- a/samples/all_pr_for_org-empty.json +++ b/samples/all_pr_for_org-empty.json @@ -13,4 +13,3 @@ }, "open_prs": [] } -//http://localhost:8000/samples/all_pr_for_org-empty/ - design required \ No newline at end of file