Skip to content

Commit

Permalink
fix ui issues
Browse files Browse the repository at this point in the history
  • Loading branch information
chriswebb09 committed Jan 2, 2024
1 parent 07559f1 commit dd4f260
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 15 deletions.
4 changes: 3 additions & 1 deletion DirectReport/browserview/dashboard/routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,9 @@ def dashboard_reports_update():
prompt = ""
prompt = request.get_json()["prompt"]
client = GithubClient()
user_repos = client.get_user_repos(current_user.github_username)
h_token = session['header_token']
print(current_user.github_username)
user_repos = client.get_user_repos(current_user.github_username, h_token)
repodata = []
for repo in user_repos:
repodata.append(repo["name"])
Expand Down
5 changes: 3 additions & 2 deletions DirectReport/browserview/services/github.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,9 @@ def get_pull_requests_count(self, repo_owner, repo_name):
response.raise_for_status()
return len(response.json())

def get_user_repos(self, repo_owner):
def get_user_repos(self, repo_owner, token):
url = f"https://api.github.com/users/{repo_owner}/repos?sort=updated&order=desc"
headers = {"Authorization": f"token {appsecrets.GITHUB_TOKEN}"}
headers = {"Authorization": f"token {token}"}
response = requests.get(url, headers=headers)
response.raise_for_status()
return response.json()
Expand Down Expand Up @@ -102,6 +102,7 @@ def query(self, prompt):

def get_data_from(self, prompt):
response = self.query(prompt)
print(response)
response_data = response["candidates"][0]["output"]
json_loaded = json.loads(response_data)
return json_loaded
17 changes: 9 additions & 8 deletions DirectReport/browserview/static/js/account/account_components.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,21 +24,22 @@ const AccountUserInfo = (userData, reportData) => {
</button>
</div>
</div>
<div
className="col-span-2 bg-gray-200 shadow-[1.0px_1.0px_7.0px_0.0px_rgba(0,0,0,0.58)] rounded-3xl py-8 px-5 border-solid border-2 border-gray-400">
<div className="col-span-2 bg-gray-200 shadow-[1.0px_1.0px_7.0px_0.0px_rgba(0,0,0,0.58)] rounded-3xl py-8 px-5 border-solid border-2 border-gray-400">
<p className="text-justify ml-20 pt-1 text-md font-mono tracking-wide text-sky-800">
<span
className="ml-10 font-black font-mono">NUMBER OF REPORTS SAVED: </span> {reportData.length}
<span className="ml-10 font-black font-mono">NUMBER OF REPORTS SAVED: </span>
{reportData.length}
</p>
<p className="text-justify ml-20 pt-1 text-md font-mono tracking-wide text-sky-800">
<span className="ml-10 font-black font-mono">LAST REPORT: </span> DEC
12, 2021
<span className="ml-10 font-black font-mono">LAST REPORT: </span>
DEC 12, 2021
</p>
<p className="text-justify ml-20 pt-1 text-md font-mono tracking-wide text-sky-800">
<span className="ml-10 font-black font-mono">GITHUB ACOUNT USERNAME: </span> {userData.github_username}
<span className="ml-10 font-black font-mono">GITHUB ACOUNT USERNAME: </span>
{userData.github_username}
</p>
<p className="text-justify ml-20 pt-1 text-md font-mono tracking-wide text-sky-800">
<span className="ml-10 font-black font-mono">SELECTED REPO: </span> DirectReport
<span className="ml-10 font-black font-mono">SELECTED REPO: </span>
DirectReport
</p>
<div className=" rounded-2xl flex items-center justify-center">
<button
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ class TeamReport extends React.Component {
</div>
</div>
{this.state.teamData.length <= 0 && (
<div className="pb-50 pt-40 mt-30 h-30">
<div className="pb-[200px] pt-40 mt-30 h-30">
</div>
)}
{this.state.teamData.length > 0 && (
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
const { useState, useEffect } = React;


const ShowSummary = ({ report }) => {
return (
<p id="show_summary" className="w-97 sm:w-97 overflow-y-auto break-words">
Expand Down
2 changes: 1 addition & 1 deletion DirectReport/browserview/templates/account.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

{% block content %}
<main>
<div id="root" class='md:max-lg:flex content-start bg-slate-200 pb-[56px]'></div>
<div id="root" class='md:max-lg:flex content-start bg-slate-200 pb-[100px]'></div>
<script type="text/babel" src="{{url_for('static', filename='js/account/account.js')}}"></script>
<script type="text/babel" src="{{url_for('static', filename='js/account/account_components.js')}}"></script>
<script type="text/babel" src="{{url_for('static', filename='js/chart_helper.js')}}"></script>
Expand Down
2 changes: 1 addition & 1 deletion DirectReport/browserview/templates/team/teamreport.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

{% block content %}
<main className="">
<div id="root" class='bg-slate-200 mx-50 pb-[200px]'></div>
<div id="root" class='bg-slate-200 mx-50 pb-[140px]'></div>
<script type="text/babel">
var data = {{data|tojson|safe}}
</script>
Expand Down

0 comments on commit dd4f260

Please sign in to comment.