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 e4e8b0c commit d9b5a5d
Show file tree
Hide file tree
Showing 15 changed files with 14 additions and 48 deletions.
30 changes: 3 additions & 27 deletions DirectReport/browserview/blueprints/reports/reportbp.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@

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.report_builder import ReportBuilder
from DirectReport.models.Report.report_model import ReportModel

Expand Down Expand Up @@ -42,7 +40,7 @@ def report():
}
data_json["shortlog"] = client.parse_git_shortlog(log_item)
data_json["repos"] = repodata
ReportBuilder.new(data_json, prompt, current_user.id, "DirectReport")
ReportBuilder.new(data_json, prompt, current_user.id)
return data_json, 201


Expand All @@ -56,35 +54,13 @@ def team_report():
return render_template('team/teamreport.html', title='Team Report', data=[])


@reportsbp.route('/entry/<uid>', methods=['GET', 'POST'])
@login_required
def detail(uid=None):
"""
Retrieves and renders the details of a specific entry.
:param uid: The ID of the entry to display.
:return: Rendered HTML template for the entry details page.
"""
reports = ReportBuilder.get_reports_for_user_id(current_user.id)
report = list(filter(lambda report: report["uuid"] == uid, reports))[0]
json.loads(json.dumps(report))
item = EntryStorage('SQLite_Python.db')
if request.method == "POST":
json_data = request.get_json()
ListBuilder.update(
json_data["id"], json_data['entry'], json_data['topic'], json_data['created_at'], json_data['week_id']
)
entry = item.get_entry(uid).to_dict()
print(entry)
return render_template('detail.html', title='Detail', data=entry)


@reportsbp.route("/getreport/<uid>", methods=['GET'])
@login_required
def get_report(uid=None):
reports = ReportBuilder.get_reports_for_user_id(current_user.id)
report = list(filter(lambda report: report["uuid"] == uid, reports))[0]
return report, 201
print(report["report"])
return render_template('team/teamreport.html', title='Team Report', teamData=report["report"])


@reportsbp.route("/getlist", methods=['GET'])
Expand Down
4 changes: 4 additions & 0 deletions DirectReport/browserview/templates/team/teamreport.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@
{% block content %}
<main className="">
<div id="root" class='bg-slate-200 mx-50 pb-[120px]'></div>
<script>
const chart_data = {{ teamData|tojson }}
console.log(chart_data);
</script>
<script type="text/babel" src="{{url_for('static', filename='js/teamreport/teamreportcomponents.js')}}"></script>
<script type="text/babel" src="{{url_for('static', filename='js/chart_helper.js')}}"></script>
<script type="text/babel" src="{{url_for('static', filename='js/teamreport/teamreport.js')}}"></script>
Expand Down
Empty file.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import sqlite3
import uuid
from .team_member import TeamMember
from DirectReport.models.Report.team_member import TeamMember


class TeamMemberModel:
Expand Down
Empty file.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env python3

import sqlite3
from DirectReport.models.entry import Entry
from DirectReport.models.entry.entry import Entry


class EntryStorage:
Expand Down
4 changes: 2 additions & 2 deletions DirectReport/models/list_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

import datetime
import uuid
from DirectReport.models.entry import Entry
from DirectReport.models.entry_storage import EntryStorage
from DirectReport.models.entry.entry import Entry
from DirectReport.models.entry.entry_storage import EntryStorage


class ListBuilder:
Expand Down
Empty file.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import sqlite3
import uuid
from .team import Team
from DirectReport.models.team.team import Team


class TeamModel:
Expand Down
11 changes: 0 additions & 11 deletions DirectReport/models/team_member.py

This file was deleted.

4 changes: 2 additions & 2 deletions DirectReport/tests/test_db.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env python3

from DirectReport.models.entry import Entry
from DirectReport.models.entry_storage import EntryStorage
from DirectReport.models.entry.entry import Entry
from DirectReport.models.entry.entry_storage import EntryStorage
from datetime import datetime
from pathlib import Path
import tempfile
Expand Down
3 changes: 0 additions & 3 deletions DirectReport/tests/test_model.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,2 @@
#!/usr/bin/env python3

from DirectReport.models.entry import Entry
import datetime
import uuid

0 comments on commit d9b5a5d

Please sign in to comment.