From e4e8b0c29ec199ed402c6baf02271310d28f08d2 Mon Sep 17 00:00:00 2001 From: chriswebb09 Date: Mon, 18 Dec 2023 17:06:39 -0500 Subject: [PATCH] update --- .../browserview/blueprints/auth/auth.py | 2 +- .../blueprints/reports/reportbp.py | 2 +- .../static/js/account/accountcomponents.js | 2 +- DirectReport/browserview/static/js/index.js | 4 +- .../browserview/static/js/{ => list}/list.js | 6 +-- .../browserview/static/js/listcomponents.js | 34 ++++++++------- DirectReport/browserview/static/js/note.js | 1 + .../static/js/teamreport/teamreport.js | 42 +++++++------------ .../js/teamreport/teamreportcomponents.js | 10 ++--- .../browserview/templates/_navigation.html | 22 ++-------- DirectReport/browserview/templates/list.html | 4 +- .../templates/team/teamreport.html | 2 +- DirectReport/models/Report/report.py | 5 ++- DirectReport/models/Report/report_builder.py | 4 +- DirectReport/models/Report/report_model.py | 13 +++--- DirectReport/models/user_model.py | 12 ------ 16 files changed, 67 insertions(+), 98 deletions(-) rename DirectReport/browserview/static/js/{ => list}/list.js (88%) diff --git a/DirectReport/browserview/blueprints/auth/auth.py b/DirectReport/browserview/blueprints/auth/auth.py index fbef0c9e..ace6100c 100644 --- a/DirectReport/browserview/blueprints/auth/auth.py +++ b/DirectReport/browserview/blueprints/auth/auth.py @@ -77,7 +77,7 @@ def account_data(): "lastname": current_user.lastname, "userid": current_user.id, "username": current_user.username, - "email": current_user.email, + "email": current_user.email } user_element = {"user": user_account, "reports": report_results, "shortlog": shortlog} return user_element, 201 diff --git a/DirectReport/browserview/blueprints/reports/reportbp.py b/DirectReport/browserview/blueprints/reports/reportbp.py index a4ef45cc..04ce1fe2 100644 --- a/DirectReport/browserview/blueprints/reports/reportbp.py +++ b/DirectReport/browserview/blueprints/reports/reportbp.py @@ -42,7 +42,7 @@ def report(): } data_json["shortlog"] = client.parse_git_shortlog(log_item) data_json["repos"] = repodata - ReportBuilder.new(data_json, prompt, current_user.id) + ReportBuilder.new(data_json, prompt, current_user.id, "DirectReport") return data_json, 201 diff --git a/DirectReport/browserview/static/js/account/accountcomponents.js b/DirectReport/browserview/static/js/account/accountcomponents.js index 3e508e4d..a6b5433c 100644 --- a/DirectReport/browserview/static/js/account/accountcomponents.js +++ b/DirectReport/browserview/static/js/account/accountcomponents.js @@ -3,7 +3,7 @@ const { useState, useEffect } = React; const AccountUserInfo = (userData, reportData) => { return ( -
+
diff --git a/DirectReport/browserview/static/js/index.js b/DirectReport/browserview/static/js/index.js index 160980f9..2b9fd073 100644 --- a/DirectReport/browserview/static/js/index.js +++ b/DirectReport/browserview/static/js/index.js @@ -9,7 +9,7 @@ class Home extends React.Component { React.createElement( 'div', { - className: "py-20 flex h-50", + className: "pt-20 pb-20 flex h-50", style: {background: "linear-gradient(90deg, #667eea 0%, #764ba2 100%)"} }, React.createElement( @@ -20,7 +20,7 @@ class Home extends React.Component { React.createElement( "h2", { - className: "mt-1 text-3xl font-bold mb-3 text-white" + className: "text-3xl font-bold mb-3 text-white" }, "DirectReport." ), diff --git a/DirectReport/browserview/static/js/list.js b/DirectReport/browserview/static/js/list/list.js similarity index 88% rename from DirectReport/browserview/static/js/list.js rename to DirectReport/browserview/static/js/list/list.js index 5ac2705c..ec5c4d50 100644 --- a/DirectReport/browserview/static/js/list.js +++ b/DirectReport/browserview/static/js/list/list.js @@ -1,6 +1,6 @@ const { useState, useEffect } = React; -const ListApp = () => { +const SavedReportListApp = () => { const [listData, setListData] = useState([]); const [loading, setLoading] = useState(true); @@ -37,7 +37,7 @@ const ListApp = () => { if (listData.length > 0) { return (
- +
) } else { @@ -51,4 +51,4 @@ const ListApp = () => { } const domContainer = document.querySelector("#root"); -ReactDOM.render(, domContainer); +ReactDOM.render(, domContainer); diff --git a/DirectReport/browserview/static/js/listcomponents.js b/DirectReport/browserview/static/js/listcomponents.js index cae0a1e3..60159903 100644 --- a/DirectReport/browserview/static/js/listcomponents.js +++ b/DirectReport/browserview/static/js/listcomponents.js @@ -1,24 +1,26 @@ const { useState, useEffect } = React; -class EntryList extends React.Component { +class SavedReportList extends React.Component { render() { return ( -
-

- Saved Reports +
+

+ Saved Reports

- {this.props.listdata.map(item => - - )} +
+ {this.props.listdata.map(item => + + )} +
); } diff --git a/DirectReport/browserview/static/js/note.js b/DirectReport/browserview/static/js/note.js index 7493d7c1..059201ff 100644 --- a/DirectReport/browserview/static/js/note.js +++ b/DirectReport/browserview/static/js/note.js @@ -6,6 +6,7 @@ function jsonEscape(str) { } class ReportItem extends React.Component { render() { + console.log(this.props.report["summary"]) console.log(this.props.report["areas_of_focus"]) console.log(this.props.report["total_commits"]) diff --git a/DirectReport/browserview/static/js/teamreport/teamreport.js b/DirectReport/browserview/static/js/teamreport/teamreport.js index 04ce78fb..e79d6738 100644 --- a/DirectReport/browserview/static/js/teamreport/teamreport.js +++ b/DirectReport/browserview/static/js/teamreport/teamreport.js @@ -77,28 +77,16 @@ const TeamReport = () => { document.getElementById('popoverCommits').innerHTML = "Commits: " + teammember.commits; } - const openRepoPopover = (e: ChangeEvent) => { - const element = document.getElementById('formUI'); + const openRepoPopover = (e: ChangeEvent) => { + const element = document.getElementById('h1content'); Popper.createPopper(element, document.getElementById('popover-repo-left-purple'), { - strategy: 'fixed', - modifiers: [{ - name: "offset", // offsets popper from the reference/button - options: { - offset: [0, 8] - } - }, { - name: "flip", // flips popper with allowed placements - options: { - allowedAutoPlacements: ["right", "left", "top", "bottom"], - rootBoundary: "viewport" - } - }] + strategy: 'fixed' }); document.getElementById('popover-repo-left-purple').classList.toggle("hidden"); document.getElementById('popover-repo-TitleContent').innerHTML = "Repos" + "(" + teamData["repos"].length + ")"; - var list = '