Skip to content

Commit

Permalink
update file structure
Browse files Browse the repository at this point in the history
  • Loading branch information
chriswebb09 committed Dec 18, 2023
1 parent c19c8f8 commit 7def27a
Show file tree
Hide file tree
Showing 27 changed files with 147 additions and 130 deletions.
9 changes: 4 additions & 5 deletions DirectReport/browserview/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@
from flask import Flask, render_template, request, redirect, json, url_for
from flask_login import LoginManager, login_required, current_user

from DirectReport.browserview.github import GithubClient
from DirectReport.browserview.prompt_logic import generate_email
from DirectReport.browserview.services.github import GithubClient
from DirectReport.browserview.services.prompt_logic import generate_email
from DirectReport.datadependencies import appsecrets
from DirectReport.models.user_model import UserModel
from .auth.auth import auth
from .reportbp import reportsbp
from DirectReport.browserview.blueprints.auth.auth import auth
from DirectReport.browserview.blueprints.reports.reportbp import reportsbp

file = Path(__file__).resolve()
package_root_directory = file.parents[1]
Expand Down Expand Up @@ -100,7 +100,6 @@ def generateemail():
def repo(reponame=None):
client = GithubClient()
repo = client.get_repo_issues("chriswebb09", reponame)
print(repo)
return render_template('team/team.html', title='Team', data=[])


Expand Down
File renamed without changes.
Empty file.
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
from DirectReport.models.user_model import UserModel
from flask_login import login_user, login_required, logout_user, current_user
from DirectReport.browserview import app
from DirectReport.models.report_builder import ReportBuilder
from DirectReport.browserview.github import GithubClient
from DirectReport.models.Report.report_builder import ReportBuilder
from DirectReport.browserview.services.github import GithubClient

auth = Blueprint('auth', __name__)

Expand Down
Empty file.
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@
from flask import render_template, request, json
from flask_login import login_required, current_user

from DirectReport.browserview.github import GithubClient
from DirectReport.browserview.github import GoogleAIClient
from DirectReport.browserview.services.github import GithubClient
from DirectReport.browserview.services.github import GoogleAIClient
from DirectReport.models.entry_storage import EntryStorage
from DirectReport.models.list_builder import ListBuilder
from DirectReport.models.report_builder import ReportBuilder
from DirectReport.models.report_model import ReportModel
from DirectReport.models.Report.report_builder import ReportBuilder
from DirectReport.models.Report.report_model import ReportModel

reportsbp = Blueprint('reportsbp', __name__)

Expand Down
Empty file.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,35 +1,6 @@

const { useState, useEffect } = React;

const AccountUserInfo = (userData, reportData) => {
return (
<div className="lg:col-span-3 md:col-span-1 sm:col-span-3 justify-center">
<div className="grid grid-flow-col gap-10 shadow-lg self-center bg-blue-200 py-6 px-5 my-2 shadow-lg rounded-3xl">
<div className="col-span-1 py-6 bg-blue-50 rounded-3xl">
<div className="bg-blue-50 rounded-2xl pl-20">
<h1 className="text-left pl-5">
<span className="pr-4 font-semibold">Account: </span>{userData.name}
</h1>
<h1 className="text-left pl-5 pt-1">
<span className="pr-10 font-semibold">Email: </span> {userData.userid}
</h1>
</div>
</div>
<div className="col-span-1 py-6 bg-blue-50 rounded-3xl">
<div className="bg-blue-50 rounded-2xl pl-20">
<p className="text-left pl-4 pt-1">
<span className="pr-11 font-semibold">Username: </span> {userData.username}
</p>
<p className="text-left pl-4 pt-1">
<span className="pr-4 font-semibold">Number of reports saved: </span> {reportData.length}
</p>
</div>
</div>
</div>
</div>
)
}

const Account = () => {
const [userData, setUserData] = useState({});
const [actualData, setActualData] = useState({});
Expand Down Expand Up @@ -83,5 +54,7 @@ const Account = () => {
}
};



const domContainer = document.querySelector('#root');
ReactDOM.render(<Account/>, domContainer);
33 changes: 33 additions & 0 deletions DirectReport/browserview/static/js/account/accountcomponents.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@

const { useState, useEffect } = React;

const AccountUserInfo = (userData, reportData) => {
return (
<div className="lg:col-span-3 md:col-span-1 sm:col-span-3 justify-center">
<div className="bg-blue-500 py-10 px-14 my-2 shadow-[1.0px_1.0px_5.0px_0.0px_rgba(0,0,0,0.58)] rounded-3xl">
<div className="grid grid-flow-col gap-10 self-center bg-blue-200 py-10 px-15 my-6 shadow-[1.0px_1.0px_5.0px_0.0px_rgba(0,0,0,0.58)] rounded-3xl">
<div className="col-span-1 ml-10 py-10 px-15 bg-blue-50 rounded-3xl shadow-[1.0px_1.0px_5.0px_0.0px_rgba(0,0,0,0.58)]">
<div className="bg-blue-50 rounded-2xl pl-10">
<h1 className="text-left pl-10">
<span className="pl-4 font-semibold">Account: </span> {userData.name}
</h1>
<h1 className="text-left pl-10 pt-1">
<span className="pl-4 font-semibold">Email: </span> {userData.userid}
</h1>
</div>
</div>
<div className="col-span-1 mr-10 py-8 bg-blue-50 rounded-3xl shadow-[1.0px_1.0px_5.0px_0.0px_rgba(0,0,0,0.58)]">
<div className="bg-blue-50 rounded-2xl pl-10">
<p className="text-left pl-4 ml-10 pt-1">
<span className="pr-11 font-semibold">Username: </span> {userData.username}
</p>
<p className="text-left pl-4 ml-10 pt-1">
<span className="pr-4 font-semibold">Number of reports saved: </span> {reportData.length}
</p>
</div>
</div>
</div>
</div>
</div>
)
}
2 changes: 1 addition & 1 deletion DirectReport/browserview/static/js/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class Home extends React.Component {
React.createElement(
"a",
{
className: "my-14 px-10 py-5 text-md font-bold tracking-wide text-center text-indigo-500 bg-white rounded-full hover:bg-blue-800 hover:text-white shadow-lg uppercase",
className: "my-14 px-10 py-5 text-md font-bold tracking-wide text-center text-indigo-500 bg-white rounded-full hover:bg-blue-800 hover:text-white shadow-[1.0px_1.0px_5.0px_0.0px_rgba(0,0,0,0.58)] uppercase",
href: "/account"
},
"Get Started"
Expand Down
42 changes: 2 additions & 40 deletions DirectReport/browserview/static/js/list.js
Original file line number Diff line number Diff line change
@@ -1,44 +1,6 @@
const { useState, useEffect } = React;

class EntryList extends React.Component {
render() {
return (
<div className="grid grid-cols-3 gap-1 mb-20 mx-20">
<h1 className="col-span-3 text-2xl text-blue-800 text-left font-bold font-mono mb-4 mx-10">
Saved Reports
</h1>
{this.props.listdata.map(item =>
<div className="col-span-1 justify-center mt-3 mb-3">
<article className="mx-4 mt-2 w-90 rounded-2xl border border-gray-200 p-1 shadow-lg transition hover:shadow-xl">
<a className="block rounded-xl bg-white p-1 sm:p-6 lg:p-8" href={'/entry/' + item.uuid}>
<div className="mt-1">
<h2 className="text-2xl font-bold text-gray-800 sm:text-xl">{'Topic: ' + item.user_id}</h2>
<p className="mt-3 text-sm text-justify line-clamp-5 text-gray-500">{'Entry: ' + item.raw_input}</p>
</div>
</a>
</article>
</div>
)}
</div>
);
}
}

class EmptyEntryList extends React.Component {
render() {
return (
<div className="mx-50 content-center mt-20 my-28 h-150">
<div className="flex flex-col justify-center my-6 mx-60">
<h1 className="self-center text-3xl text-gray-700 text-center font-bold">Add New Entry</h1>
<EntryForm/>
</div>
</div>
);
}
}


const App = () => {
const ListApp = () => {

const [listData, setListData] = useState([]);
const [loading, setLoading] = useState(true);
Expand Down Expand Up @@ -89,4 +51,4 @@ const App = () => {
}

const domContainer = document.querySelector("#root");
ReactDOM.render(<App/>, domContainer);
ReactDOM.render(<ListApp/>, domContainer);
38 changes: 38 additions & 0 deletions DirectReport/browserview/static/js/listcomponents.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
const { useState, useEffect } = React;

class EntryList extends React.Component {
render() {
return (
<div className="grid grid-cols-3 gap-1 mb-20 mx-20">
<h1 className="col-span-3 text-2xl text-blue-800 text-left font-bold font-mono mb-4 mx-10">
Saved Reports
</h1>
{this.props.listdata.map(item =>
<div className="col-span-1 justify-center mt-3 mb-3">
<article className="mx-4 mt-2 w-90 rounded-2xl border border-gray-200 p-1 shadow-lg transition hover:shadow-xl">
<a className="block rounded-xl bg-white p-1 sm:p-6 lg:p-8" href={'/getreport/' + item.uuid}>
<div className="mt-1">
<h2 className="text-2xl font-bold text-gray-800 sm:text-xl">{'Topic: ' + item.user_id}</h2>
<p className="mt-3 text-sm text-justify line-clamp-5 text-gray-500">{'Entry: ' + item.raw_input}</p>
</div>
</a>
</article>
</div>
)}
</div>
);
}
}

class EmptyEntryList extends React.Component {
render() {
return (
<div className="mx-50 content-center mt-20 my-28 h-150">
<div className="flex flex-col justify-center my-6 mx-60">
<h1 className="self-center text-3xl text-gray-700 text-center font-bold">Add New Entry</h1>
<EntryForm/>
</div>
</div>
);
}
}
38 changes: 32 additions & 6 deletions DirectReport/browserview/static/js/teamreport/teamreport.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const { useState, useEffect } = React;

const TeamData = () => {
const TeamReport = () => {

const [teamData, setTeamData] = useState({})
const [commentText, setCommentText] = useState("")
Expand Down Expand Up @@ -132,6 +132,31 @@ const TeamData = () => {
setIsOpened(isOpened => !isOpened);
}

const FormDiv = (handleSubmit, openRepoPopover, commentText) => {
return (
<div className="py-1 bg-blue-500 rounded-3xl px-30 shadow-[1.0px_1.0px_2.0px_1.0px_rgba(0,0,0,0.58)]">
<form onSubmit={handleSubmit} className="w-97 sm:w-97">
<h1 className="self-center text-center text-white text-xl text-center font-semibold font-mono mb-1 mt-3">Enter
Github Data
</h1>
<div className="self-center mb-4 mt-2">
<div className="py-2 px-10 mx-0 min-w-full flex flex-col items-center">
<textarea id="prompt_input" cols="38" rows="13" className="self-center py-2 border-2 bg-slate-100 shadow-[1.5px_2.0px_1.0px_0.5px_rgba(0,0,0,0.28)] border-gray-200 w-90 h-78 sm:w-90 text-xs font-sm break-words tracking-wide text-blue-600 placeholder-white border rounded-3xl focus:shadow-outline" value={commentText} onChange={e => setCommentText(e.target.value)}>
</textarea>
</div>
<div className="px-10 mx-0 min-w-full flex flex-col items-center">
<button id="submit_prompt_btn" className="w-80 sm:w-90 bg-slate-100 shadow-[1.5px_2px_1.0px_0.5px_rgba(0,0,0,0.48)] hover:bg-blue-400 text-blue-500 hover:text-white hover:border-gray-200 text-lg font-semibold py-2 px-5 rounded-2xl mt-2" type="submit">
Generate
</button>
<p></p>
<button className="w-80 sm:w-90 bg-slate-100 hover:bg-blue-400 text-blue-500 shadow-[1.5px_2px_1.0px_0.5px_rgba(0,0,0,0.48)] hover:text-white hover:border-gray-200 text-lg font-semibold py-2 px-5 rounded-2xl mt-2" onClick={(e) => openRepoPopover(e)} type="button">Repos</button>
</div>
</div>
</form>
</div>
)
}

return (
<div>
<h1 className="self-center text-center text-2xl text-blue-800 text-center font-bold font-mono pt-3 pb-2 mb-2 pt-4 mx-10 px-20">
Expand All @@ -140,14 +165,15 @@ const TeamData = () => {
{/*{repoPopoverUI()}*/}
<div id="topRow" className="grid grid-cols-3 gap-8 rounded-3xl mx-10 mt-6">
<div className="lg:col-span-1 sm:col-span-3 justify-center" id="edit_summary_div">
{/*<FormDiv handleSum/>*/}
{FormDiv(handleSubmit, openRepoPopover, commentText)}
</div>
<div id="show_summmary_div" className="lg:col-span-1 sm:col-span-3 justify-center">
<div className="pb-6 pt-2 bg-blue-500 rounded-3xl px-30 shadow-[1.0px_1.0px_5.0px_0.0px_rgba(0,0,0,0.48)]">
<div className="pb-6 pt-2 bg-blue-500 rounded-3xl px-30 shadow-[1.0px_1.0px_5.0px_0.0px_rgba(0,0,0,0.58)]">
<h1 className="self-center text-center text-xl text-white text-center font-semibold font-mono mb-1 mt-2 mx-20 px-20">Summary</h1>
<div id="summary" className="px-4 mx-0 mb-3 mt-2">
{isOpened && (
<div id="summary-container" className="ml-3 mr-3 bg-slate-100 shadow-[1.0px_1.0px_6.0px_0.0px_rgba(0,0,0,0.28)] overflow-y-scroll h-100 rounded-3xl tracking-wide text-gray-500 md:text-gl dark:text-gray-400 mt-3 px-3 pt-6 pb-20">
<div id="summary-container" className="ml-3 mr-3 bg-slate-100 shadow-[1.0px_1.0px_6.0px_0.0px_rgba(0,0,0,0.58)] overflow-y-scroll h-100 rounded-3xl tracking-wide text-gray-500 md:text-gl dark:text-gray-400 mt-3 px-3 pt-6 pb-20">
{ShowSummary(teamData["report"])}
{ShowHighlights(teamData["report"])}
</div>
Expand All @@ -156,12 +182,12 @@ const TeamData = () => {
</div>
</div>
<div id="team_member_to_select" className="lg:col-span-1 sm:col-span-3 justify-center">
<div className="pb-6 pt-2 bg-blue-500 rounded-3xl px-4 mb-2 shadow-[1.0px_1.0px_5.0px_0.0px_rgba(0,0,0,0.48)]">
<div className="pb-6 pt-2 bg-blue-500 rounded-3xl px-4 mb-2 shadow-[1.0px_1.0px_5.0px_0.0px_rgba(0,0,0,0.58)]">
<h1 className="self-center text-center text-xl text-white text-center font-semibold font-mono mb-1 mt-2 mx-20 px-20">Team</h1>
{PopoverUI(closePopover)}
<div id="display_team" className="my-3"></div>
{isOpened && (
<div className="content-center py-1 h-90 rounded-3xl mb-4 bg-slate-100 shadow-[1.0px_1.0px_6.0px_0.0px_rgba(0,0,0,0.28)] mx-1 px-3">
<div className="content-center py-1 h-90 rounded-3xl mb-4 bg-slate-100 shadow-[1.0px_1.0px_6.0px_0.0px_rgba(0,0,0,0.58)] mx-1 px-3">
{ShowTeamList(teamData["team"], openPopover)}
</div>
)}
Expand All @@ -176,4 +202,4 @@ const TeamData = () => {
};

const domContainer = document.querySelector('#root');
ReactDOM.render(<TeamData/>, domContainer);
ReactDOM.render(<TeamReport/>, domContainer);
Loading

0 comments on commit 7def27a

Please sign in to comment.