Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release/v5.5.3 #996

Merged
merged 69 commits into from
Apr 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
69 commits
Select commit Hold shift + click to select a range
70602a0
Timetable: Add index for course name and code
JJamesWWang Mar 3, 2023
02319d5
Format script: Add status
JJamesWWang Mar 3, 2023
a3e05a6
Timetable: Add a migration to delete non-jhu courses
JJamesWWang Mar 3, 2023
8f8fb90
Merge pull request #966 from JJamesWWang/feature/optimize-course-fetch
JJamesWWang Mar 3, 2023
0b482cb
Related courses: Disable feature in serializer
JJamesWWang Mar 4, 2023
be2640e
Course: Do not use school as a db_index
JJamesWWang Mar 4, 2023
5c3b4c9
Reactions: Use a single query instead of 9 separate ones for reaction…
JJamesWWang Mar 4, 2023
d7862a8
Reactions: Remove un-needed .all()
JJamesWWang Mar 4, 2023
66a197a
Sections: Optimize loading of offerings by a little
JJamesWWang Mar 4, 2023
571ff43
Search: Set limit to 6 since that's how many can be displayed at one …
JJamesWWang Mar 4, 2023
4da0af6
Tests: Fix test cases and comment out related_courses test
JJamesWWang Mar 4, 2023
3069617
Tests: Un-skip e2e tests
JJamesWWang Mar 4, 2023
2ddfd58
Formatting
JJamesWWang Mar 4, 2023
6e22ca1
Student: Remove print statements
JJamesWWang Mar 4, 2023
d164b08
Advanced Search: change to 8 results again, and fix issue with pagina…
JJamesWWang Mar 4, 2023
43306a1
Merge pull request #967 from JJamesWWang/feature/optimize-course-fetch
JJamesWWang Mar 5, 2023
e5888fe
Sidebar: Hide when minimizing screen by default
JJamesWWang Mar 9, 2023
858035a
Topbar: Remove console logs
JJamesWWang Mar 11, 2023
ffa3a2c
Merge pull request #970 from JJamesWWang/feature/default-close-sidebar
JJamesWWang Mar 11, 2023
b4288a9
Timetable: Expand to 24 hours and make it auto-scroll to best view
JJamesWWang Mar 11, 2023
5467d8e
abbreviations
andyjaramillo Mar 12, 2023
4b53047
Search/Migration:removed 2017-2021 semesters to improve search speeds
jyang0403 Mar 18, 2023
eff24f2
Style:changing style to fit Black linter
jyang0403 Mar 18, 2023
5a1175f
Merge pull request #978 from jyang0403/feature/remove_old_semesters
jyang0403 Mar 21, 2023
6ef7b13
SEM-212 - Committing to dev dockerRegistryServiceConnection update
mike-sellers Mar 23, 2023
dbf8ef8
Tests: Unfinished attempt to fix
JJamesWWang Mar 23, 2023
0c117fd
Revert "Merge pull request #978 from jyang0403/feature/remove_old_sem…
JJamesWWang Mar 23, 2023
28af0f3
Merge pull request #981 from JJamesWWang/revert/delete-sem-migration
JJamesWWang Mar 23, 2023
ef2f6df
Analytics: Initial commit
jchen324 Mar 26, 2023
5d38c34
Analytics: Remove redundant statistics, reorder relevant data, and ad…
jchen324 Mar 26, 2023
86fb836
Analytics: Undo removing the student.user.is_staff check in views.py
jchen324 Mar 27, 2023
3d06333
Style: Pass linter check
jchen324 Mar 27, 2023
0678c30
Style: Format with black
jchen324 Mar 27, 2023
bd45acc
Style: Reduce chart size to make it look better
jchen324 Mar 28, 2023
ff9aec6
Analytics: Remove commented out statistics and related code
jchen324 Mar 28, 2023
f2d9878
Merge pull request #982 from jchen324/feature/analytics
JJamesWWang Mar 28, 2023
4b04ecf
E2E Testing: Add note that installation only works for WSL/Linux
JJamesWWang Mar 29, 2023
e9a7396
remove year: create command
JiaqiWang18 Mar 30, 2023
6245a6f
remove year: add documentation
JiaqiWang18 Mar 30, 2023
f08b8db
remove year: run lint
JiaqiWang18 Mar 30, 2023
5cc7808
added course abbreviations to map
andyjaramillo Mar 31, 2023
8388e70
merged
andyjaramillo Mar 31, 2023
3b275ba
added to map
andyjaramillo Mar 31, 2023
17d330a
Merge pull request #985 from jhuopensource/feature/remove-semester-co…
JiaqiWang18 Apr 1, 2023
45c96de
current abreviations working but not appending to normal list
andyjaramillo Apr 2, 2023
3126f12
Timetables: Fix dispatching of incomplete timetable when nullifying t…
JJamesWWang Apr 3, 2023
a6dcf90
Timeline: Show at all hours
JJamesWWang Apr 3, 2023
2c57878
Hours: Change max end hour to 24 so it doesn't show past midnight
JJamesWWang Apr 3, 2023
7a1c704
Remove console log
JJamesWWang Apr 3, 2023
31a1e8d
Test: Fix import and fixture
JJamesWWang Apr 3, 2023
3bc3e9e
Fix ESLint
JJamesWWang Apr 3, 2023
756c0a4
Utils: Remove outdated comments now that tt is 24 hours
JJamesWWang Apr 3, 2023
4b46cbe
Tests: Uncomment out e2e tests
JJamesWWang Apr 3, 2023
56c1a1f
Merge pull request #984 from JJamesWWang/docs/fix-e2e-docs-wrong
JessieLuo30 Apr 3, 2023
3a76a7c
Custom Events Test: Fix time params and update documentation to refle…
JJamesWWang Apr 3, 2023
b60d641
Search: Refactor and clean up commented out code, update docs
JJamesWWang Apr 6, 2023
edc1c0b
Abbreviations: Sort alphabetically
JJamesWWang Apr 6, 2023
912fce0
Abbreviations: add to list, remove micro/macro
JJamesWWang Apr 6, 2023
0f38e90
Abbreviations: Add some more CS abbreviations
JJamesWWang Apr 6, 2023
44f6997
added tests to abbreviations
andyjaramillo Apr 8, 2023
080a8f7
Merge pull request #971 from JJamesWWang/feature/expand-tt
JJamesWWang Apr 8, 2023
211ffb9
Merge pull request #973 from andyjaramillo/feature/search-abbreviations
JJamesWWang Apr 8, 2023
d10c7de
Revert: Removing non-jhu courses
JJamesWWang Apr 8, 2023
c5c5ff7
Merge pull request #993 from JJamesWWang/revert/delete-non-jhu-courses
JJamesWWang Apr 8, 2023
cdd3ad6
Migration: Add back alter course to not index school
JJamesWWang Apr 8, 2023
51c8f0d
Formatting
JJamesWWang Apr 8, 2023
2da8a8f
Config: Add fall 2023
JJamesWWang Apr 8, 2023
2a70ba0
Merge pull request #995 from JJamesWWang/feature/add-fall2023
JJamesWWang Apr 8, 2023
ff76b8e
Merge pull request #994 from JJamesWWang/fix/redo-alter-course-migration
JJamesWWang Apr 8, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
300 changes: 26 additions & 274 deletions analytics/templates/analytics_dashboard.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,7 @@
<meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
<link rel="stylesheet" href="https://code.ionicframework.com/ionicons/2.0.1/css/ionicons.min.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/flat-ui/2.2.2/css/flat-ui.css">

<link rel="stylesheet" href="{% static 'css/analytics/analytics.css' %}">


</head>

<body>
Expand All @@ -31,203 +28,58 @@ <h4>Total number of Shared timetables: {{total_shared_timetables}}</h4>
<li>
<h4>Total number of Personal timetables: {{total_personal_timetables}}</h4>
</li>

<li>
<h4>Total signups: {{total_signups}}</h4>
</li>
<li>
<h4>Sign ups by permission</h4>
</li>
<ul>
{% for permission, value in num_users_by_permission.items %}
<li>{{permission}}: {{value.0}} ({{value.1}}%) </li>
{% endfor %}
</ul>
<li>
<h4>Total number of calendar exports: {{total_calendar_exports}}</h4>
</li>
<li>
<h4>Number of Google calendar exports: {{google_calendar_exports}}</h4>
</li>
<li>
<h4>Number of ics calendar exports: {{ics_calendar_exports}}</h4>
</li>
<li>
<h4>Number of calendar exports by unique users: {{unique_users_calendar_exports}}</h4>
</li>
<li>
<h4>Number of shared timetable views: {{total_shared_timetable_views}}</h4>
</li>
<li>
<h4>Number of shared course views: {{total_shared_course_views}}</h4>
</li>
<li>
<h4>Number of Facebook alert views: {{fb_alert_views}}</h4>
</li>
<li>
<h4>Number of Facebook alert views by unique users: {{unique_users_fb_alert_views}}</h4>
</li>
<li>
<h4>Number of Facebook alert clicks: {{fb_alert_clicks}}</h4>
</li>
<li>
<h4>Number of Facebook alert clicks by unique users: {{unique_users_fb_alert_clicks}}</h4>
</li>
</ul>



<!-- <h4>Most popular courses in JHU:</h4>

{% for course in jhu_most_popular_courses %}
<div>
<p>{{ course.name }}</p>
</div>
{% endfor %}


<h4>Most searched courses in JHU:</h4>
{% for course in jhu_most_searched_courses %}
<div>
<p>{{ course.name }}</p>
</div>
{% endfor %} -->

<!-- <h4>Most popular courses in UOFT:</h4>
{% for course in uoft_most_popular_courses %}
<div>
<p>{{ course.name }}</p>
</div>
{% endfor %}

<h4>Most searched courses in UOFT:</h4>
{% for course in uoft_most_searched_courses %}
<div>
<p>{{ course.name }}</p>
</div>
{% endfor %}-->

<!-- <h4>Most popular courses in UMD:</h4>
{% for course in umd_most_popular_courses %}
<div>
<p>{{ course.name }}</p>
</div>
{% endfor %}

<h4>Most searched courses in UMD:</h4>
{% for course in umd_most_searched_courses %}
<div>
<p>{{ course.name }}</p>
</div>
{% endfor %} -->


<!-- Analytics displayed with graphs -->
<script type="text/javascript">
var num_users_by_class_year = JSON.parse("{{num_users_by_class_year|escapejs}}");
var num_users_by_school = JSON.parse("{{num_users_by_school|escapejs}}");
var total_timetables_by_school = JSON.parse("{{total_timetables_by_school|escapejs}}");
var total_timetables_by_semester = JSON.parse("{{total_timetables_by_semester|escapejs}}");
var number_of_reactions = JSON.parse("{{number_of_reactions|escapejs}}");
var calendar_exports_by_type = JSON.parse("{{calendar_exports_by_type|escapejs}}");
// var timetables_per_hour = JSON.parse("{{timetables_per_hour|escapejs}}");
// var shared_timetables_per_hour = JSON.parse("{{shared_timetables_per_hour|escapejs}}");
var signups_per_hour = JSON.parse("{{signups_per_hour|escapejs}}");
</script>

<h4>Number of users by school:</h4>
<canvas id="num_users_by_school"></canvas>

<h4>Number of users by class year:</h4>
<canvas id="num_users_by_class_year"></canvas>

<h4>Number of timetables by school:</h4>
<canvas id="timetables_by_schools"></canvas>

<h4>Number of timetables by semester:</h4>
<canvas id="timetables_by_semester"></canvas>

<h4>Number of calendar exports by type:</h4>
<canvas id="calendar_exports_by_type"></canvas>

<!-- <h4>Number of timetables created per hour per school for the past 24 hours:</h4>
<canvas id="timetables_per_hours_chart"></canvas>

<h4>Number of shared timetables per hour per school for the past 24 hours:</h4>
<canvas id="shared_timetables_per_hours_chart"></canvas> -->

<div id="chart-wrapper">
<canvas id="num_users_by_class_year"></canvas>
</div>

<h4>Number of signups per day for the past week:</h4>
<canvas id="signups_chart"></canvas>

<h4>Number of each reaction used:</h4>
<canvas id="reactions_chart"></canvas>
<div id="chart-wrapper">
<canvas id="signups_chart"></canvas>
</div>



<script>
// Process and get all the data for graphs

// Colors for each school.
// TODO: user COLOURS_DATA in constants.jsx.
var primary_colors = ["#FD7473", "#5CCCF2", "#36DEBB", "#FFD462", "#C585DE", "#53e997", "#D4DBC8", "#E7F76D", "#A3F5F2", "#7499A2",
"#C8F7C5", "#4c7fd8"];
var secondary_colors = ["#e36867", "#52b7d9", "#30c7a8", "#e5be58", "#b177c7", "#4ad187", "#B5BFA3", "#C9E20A", "#7CD2CF", "#668B94",
"#C4D44D", "#6598f1"];
Chart.defaults.global.responsive = true;
// var timetables_per_hour_datasets = new Array(Object.keys(timetables_per_hour).length);
// var shared_timetables_per_hour_datasets = new Array(Object.keys(shared_timetables_per_hour).length);
// var index = 0;
// for (key in timetables_per_hour) {
// timetables_per_hour_datasets[index] =
// {
// label: key,
// fill: false,
// lineTension: 0.1,
// backgroundColor: primary_colors[index],
// borderColor: secondary_colors[index],
// borderCapStyle: 'butt',
// borderDash: [],
// borderDashOffset: 0.0,
// borderJoinStyle: 'miter',
// pointBackgroundColor: "#fff",
// pointBorderWidth: 1,
// pointHoverRadius: 5,
// pointHoverBorderColor: "rgba(220,220,220,1)",
// pointHoverBorderWidth: 2,
// pointRadius: 1,
// pointHitRadius: 10,
// data: timetables_per_hour[key],
// };
// shared_timetables_per_hour_datasets[index] =
// {
// label: key,
// fill: false,
// lineTension: 0.1,
// backgroundColor: primary_colors[index],
// borderColor: secondary_colors[index],
// borderCapStyle: 'butt',
// borderDash: [],
// borderDashOffset: 0.0,
// borderJoinStyle: 'miter',
// pointBackgroundColor: "#fff",
// pointBorderWidth: 1,
// pointHoverRadius: 5,
// pointHoverBorderColor: "rgba(220,220,220,1)",
// pointHoverBorderWidth: 2,
// pointRadius: 1,
// pointHitRadius: 10,
// data: shared_timetables_per_hour[key],
// };
// index++;
// }

var past_24_labels = ["-23", "-22", "-21", "-20", "-19", "-18", "-17", "-16", "-15", "-14", "-13", "-12", "-11", "-10", "-9", "-8", "-7", "-6", "-5", "-4", "-3", "-2", "-1", "Now"];
var num_users_by_class_year_data = {
labels: Object.keys(num_users_by_class_year),
datasets: [
{
data: Object.keys(num_users_by_class_year).map(function (key) { return num_users_by_class_year[key] }),
backgroundColor: primary_colors,
hoverBackgroundColor: secondary_colors
}]
};

// var timetables_per_hour_data = {
// labels: past_24_labels,
// datasets: timetables_per_hour_datasets
// };
// var shared_timetables_per_hour_data = {
// labels: past_24_labels,
// datasets: shared_timetables_per_hour_datasets
// };
var signups_per_hour_data = {
labels: ["-6", "-5", "-4", "-3", "-2", "-1", "Now"],
datasets: [
Expand All @@ -252,126 +104,26 @@ <h4>Number of each reaction used:</h4>
}
]
}
var reactions_data = {
labels: Object.keys(number_of_reactions),
datasets: [
{
label: "# Uses",
backgroundColor: "rgba(255,23,68,0.2)",
borderColor: "rgba(255,23,68,1)",
borderWidth: 1,
hoverBackgroundColor: "rgba(255,23,68,0.4)",
hoverBorderColor: "rgba(255,23,68,1)",
data: Object.keys(number_of_reactions).map(function (key) { return number_of_reactions[key] }),
}
]
};
var num_users_by_school_data = {
labels: Object.keys(num_users_by_school),
datasets: [
{
data: Object.keys(num_users_by_school).map(function (key) { return num_users_by_school[key] }),
backgroundColor: primary_colors,
hoverBackgroundColor: secondary_colors
}]
};
var num_users_by_class_year_data = {
labels: Object.keys(num_users_by_class_year),
datasets: [
{
data: Object.keys(num_users_by_class_year).map(function (key) { return num_users_by_class_year[key] }),
backgroundColor: primary_colors,
hoverBackgroundColor: secondary_colors
}]
};
var timetables_by_schools_data = {
labels: Object.keys(total_timetables_by_school),
datasets: [
{
data: Object.keys(total_timetables_by_school).map(function (key) { return total_timetables_by_school[key] }),
backgroundColor: primary_colors,
hoverBackgroundColor: secondary_colors
}]
};
var timetables_by_semester_data = {
labels: Object.keys(total_timetables_by_semester),
datasets: [
{
data: Object.keys(total_timetables_by_semester).map(function (key) { return total_timetables_by_semester[key] }),
backgroundColor: primary_colors,
hoverBackgroundColor: secondary_colors
}]
};
var calendar_exports_by_type_data = {
labels: Object.keys(calendar_exports_by_type),
datasets: [
{
data: Object.keys(calendar_exports_by_type).map(function (key) { return calendar_exports_by_type[key] }),
backgroundColor: primary_colors,
hoverBackgroundColor: secondary_colors
}]
};

// var ctx = document.getElementById("timetables_per_hours_chart");
// var line_chart_24_hours = new Chart(ctx, {
// type: 'line',
// data: timetables_per_hour_data,
// });

// var stx = document.getElementById("shared_timetables_per_hours_chart");
// var line_chart_shared_24_hours = new Chart(stx, {
// type: 'line',
// data: shared_timetables_per_hour_data,
// });

var utx = document.getElementById("signups_chart");
var SignupsPieChart = new Chart(utx, {
type: 'line',
data: signups_per_hour_data,
});

var rtx = document.getElementById("reactions_chart");
var line_chart_reactions = new Chart(rtx, {
type: 'bar',
data: reactions_data,
});

var btx = document.getElementById("num_users_by_school");
var UsersBySchoolPieChart = new Chart(btx, {
type: 'pie',
data: num_users_by_school_data,
});

// Display the data in appropriate graphs
var ytx = document.getElementById("num_users_by_class_year");
var UsersByYearPieChart = new Chart(ytx, {
type: 'pie',
data: num_users_by_class_year_data,
});

var ptx = document.getElementById("timetables_by_schools");
var TimetablesBySchoolPieChart = new Chart(ptx, {
type: 'pie',
data: timetables_by_schools_data,
});

var stx = document.getElementById("timetables_by_semester");
var TimetablesBySemesterPieChart = new Chart(stx, {
type: 'pie',
data: timetables_by_semester_data,
});

var ctx = document.getElementById("calendar_exports_by_type");
var CalendarExportsPieChart = new Chart(ctx, {
type: 'pie',
data: calendar_exports_by_type_data,
var utx = document.getElementById("signups_chart");
var SignupsPieChart = new Chart(utx, {
type: 'line',
data: signups_per_hour_data,
});
</script>

<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.4/jquery.min.js"></script>
<script type="text/javascript" src="https://fb.me/react-0.14.3.js"></script>
<script type="text/javascript" src="https://fb.me/react-dom-0.14.3.js"></script>
<!--<script type="text/javascript" src="{% static 'js/gulp/analytics_application.js' %}"></script>-->

<!-- <script type="text/javascript" src="{% static 'js/gulp/analytics_application.js' %}"></script> -->
</body>

</html>
Loading