From 17ef618429ad1965e67f4dd8464ac5a69e06493f Mon Sep 17 00:00:00 2001 From: Kshaw362 Date: Wed, 5 Jun 2024 08:09:14 -0400 Subject: [PATCH 01/13] 119: wip --- sde_collections/urls.py | 1 + sde_collections/views.py | 8 +- .../templates/includes/navigation.html | 1 + .../sde_collections/sde_dashboard.html | 303 ++++++++++++++++++ 4 files changed, 312 insertions(+), 1 deletion(-) create mode 100644 sde_indexing_helper/templates/sde_collections/sde_dashboard.html diff --git a/sde_collections/urls.py b/sde_collections/urls.py index 98a1df06..baf12cbf 100644 --- a/sde_collections/urls.py +++ b/sde_collections/urls.py @@ -9,6 +9,7 @@ router.register(r"collections", views.CollectionViewSet) router.register(r"collections-read", views.CollectionReadViewSet) router.register(r"candidate-urls", views.CandidateURLViewSet) +router.register(r"sde_dashboard", views.SdeDashboardView) router.register(r"exclude-patterns", views.ExcludePatternViewSet) router.register(r"include-patterns", views.IncludePatternViewSet) router.register(r"title-patterns", views.TitlePatternViewSet) diff --git a/sde_collections/views.py b/sde_collections/views.py index 595bc2ef..ead437ac 100644 --- a/sde_collections/views.py +++ b/sde_collections/views.py @@ -196,6 +196,9 @@ def get_context_data(self, **kwargs): return context +class SdeDashboardView(LoginRequiredMixin,View ): + + template_name = "sde_collections/sde_dashboard.html" class CollectionFilterMixin: def get_queryset(self): @@ -347,6 +350,9 @@ def create(self, request, *args, **kwargs): class CollectionViewSet(viewsets.ModelViewSet): queryset = Collection.objects.all() + +class SdeDashboardViewSet(viewsets.ModelViewSet): + queryset = Collection.objects.all() serializer_class = CollectionSerializer class CollectionReadViewSet(viewsets.ReadOnlyModelViewSet): @@ -354,7 +360,7 @@ class CollectionReadViewSet(viewsets.ReadOnlyModelViewSet): serializer_class = CollectionReadSerializer -class PushToGithubView(APIView): +class PushToGithubView(APIView): def post(self, request): collection_ids = request.POST.getlist("collection_ids[]", []) if len(collection_ids) == 0: diff --git a/sde_indexing_helper/templates/includes/navigation.html b/sde_indexing_helper/templates/includes/navigation.html index 01183f6c..bf28d5a9 100644 --- a/sde_indexing_helper/templates/includes/navigation.html +++ b/sde_indexing_helper/templates/includes/navigation.html @@ -50,6 +50,7 @@ diff --git a/sde_indexing_helper/templates/sde_collections/sde_dashboard.html b/sde_indexing_helper/templates/sde_collections/sde_dashboard.html new file mode 100644 index 00000000..0f534b10 --- /dev/null +++ b/sde_indexing_helper/templates/sde_collections/sde_dashboard.html @@ -0,0 +1,303 @@ +{% extends "layouts/base.html" %} +{% load static %} +{% block title %} +{{ collection.name }} +{% endblock title %} +{% block stylesheets %} +{{ block.super }} + +{% endblock stylesheets %} + +{% block content %} +
+
+
+

{{ collection.name }}

+
+
+
+ + +
+
+ +
+
+
+ +
+ + + + + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
URL + {{collection.url }} +
Config Folder{{ collection.config_folder }}
Division + +
Document Type + + +
Update Frequency{{ collection.get_update_frequency_display }}
Tree Root +
Notes{{ collection.notes }}
Sinequa Configuration + {{collection.sinequa_configuration }} +
GitHub Issue Link + {% if github_form.errors %} + {{ github_form.errors.github_issue_link }} + {% endif %} + {{collection.github_issue_link }} + + + +
Candidate URLs + View +
Required URLs + {% for required_url in required_urls %} +
+
+ {% csrf_token %} + +
+  {{ required_url.url }} +
+ {% empty %} +

No required URLs yet

+ {% endfor %} +
+ {% csrf_token %} + {{ form.url }} + +
+
Comments +
+ {% for comment in comments %} +
+ {{ comment.user.username }} + {{ comment.created_at|date:"M. d, Y, P" }} +

{{ comment.text }}

+
+ {% empty %} +

No comments yet

+ {% endfor %} +
+
Post a Comment +
+ {% if user.is_authenticated %} +
+ {% csrf_token %} + + +
+ {% else %} +

Please log in to post comments.

+ {% endif %} +
+
+ +
+
+ + + + + + + + + + {% for entry in workflow_history %} + + + + + + {% endfor %} + + +
Workflow StatusCuratorTimeframe
+ + + {{ entry.curated_by }}{{entry.created_at|timesince}}
+
+
+
+ + + + + +{% endblock content %} +{% block javascripts %} + + +{% endblock javascripts %} \ No newline at end of file From 0c183da6cc11fe97b7a040e9aa34a76925f0641f Mon Sep 17 00:00:00 2001 From: Kshaw362 Date: Mon, 10 Jun 2024 11:56:30 -0400 Subject: [PATCH 02/13] 119: wip --- sde_collections/urls.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sde_collections/urls.py b/sde_collections/urls.py index baf12cbf..4078aa99 100644 --- a/sde_collections/urls.py +++ b/sde_collections/urls.py @@ -9,7 +9,7 @@ router.register(r"collections", views.CollectionViewSet) router.register(r"collections-read", views.CollectionReadViewSet) router.register(r"candidate-urls", views.CandidateURLViewSet) -router.register(r"sde_dashboard", views.SdeDashboardView) +router.register(r"sde_dashboard", views.SdeDashboardViewSet) router.register(r"exclude-patterns", views.ExcludePatternViewSet) router.register(r"include-patterns", views.IncludePatternViewSet) router.register(r"title-patterns", views.TitlePatternViewSet) From c6ca867f02c0e64a34234c344c556acf36bab6e8 Mon Sep 17 00:00:00 2001 From: Kshaw362 Date: Mon, 10 Jun 2024 12:35:23 -0400 Subject: [PATCH 03/13] 119: page is finally coming up --- sde_collections/urls.py | 2 +- sde_collections/views.py | 23 +- .../templates/includes/navigation.html | 2 +- .../sde_collections/sde_dashboard.html | 282 +----------------- 4 files changed, 20 insertions(+), 289 deletions(-) diff --git a/sde_collections/urls.py b/sde_collections/urls.py index 4078aa99..7c17feb1 100644 --- a/sde_collections/urls.py +++ b/sde_collections/urls.py @@ -9,7 +9,6 @@ router.register(r"collections", views.CollectionViewSet) router.register(r"collections-read", views.CollectionReadViewSet) router.register(r"candidate-urls", views.CandidateURLViewSet) -router.register(r"sde_dashboard", views.SdeDashboardViewSet) router.register(r"exclude-patterns", views.ExcludePatternViewSet) router.register(r"include-patterns", views.IncludePatternViewSet) router.register(r"title-patterns", views.TitlePatternViewSet) @@ -20,6 +19,7 @@ urlpatterns = [ path("", view=views.CollectionListView.as_view(), name="list"), + path("sde-dashboard/", view=views.SdeDashboardView.as_view(), name="dashboard"), path("/", view=views.CollectionDetailView.as_view(), name="detail"), path( "api/collections/push_to_github/", diff --git a/sde_collections/views.py b/sde_collections/views.py index ead437ac..038e7925 100644 --- a/sde_collections/views.py +++ b/sde_collections/views.py @@ -196,9 +196,24 @@ def get_context_data(self, **kwargs): return context -class SdeDashboardView(LoginRequiredMixin,View ): - +class SdeDashboardView(LoginRequiredMixin,ListView ): + + model = Collection template_name = "sde_collections/sde_dashboard.html" + context_object_name = "collections" + + def get_queryset(self): + return ( + super() + .get_queryset() + ) + + def get_context_data(self, **kwargs): + context = super().get_context_data(**kwargs) + context["segment"] = "collections" + return context + + class CollectionFilterMixin: def get_queryset(self): @@ -351,10 +366,6 @@ def create(self, request, *args, **kwargs): class CollectionViewSet(viewsets.ModelViewSet): queryset = Collection.objects.all() -class SdeDashboardViewSet(viewsets.ModelViewSet): - queryset = Collection.objects.all() - serializer_class = CollectionSerializer - class CollectionReadViewSet(viewsets.ReadOnlyModelViewSet): queryset = Collection.objects.all() serializer_class = CollectionReadSerializer diff --git a/sde_indexing_helper/templates/includes/navigation.html b/sde_indexing_helper/templates/includes/navigation.html index bf28d5a9..658b4275 100644 --- a/sde_indexing_helper/templates/includes/navigation.html +++ b/sde_indexing_helper/templates/includes/navigation.html @@ -50,7 +50,7 @@ diff --git a/sde_indexing_helper/templates/sde_collections/sde_dashboard.html b/sde_indexing_helper/templates/sde_collections/sde_dashboard.html index 0f534b10..bfd99e19 100644 --- a/sde_indexing_helper/templates/sde_collections/sde_dashboard.html +++ b/sde_indexing_helper/templates/sde_collections/sde_dashboard.html @@ -11,290 +11,10 @@ {% block content %}
-
-

{{ collection.name }}

-
-
- -
- -
-
+ oh yeaaa
-
- - - - -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
URL - {{collection.url }} -
Config Folder{{ collection.config_folder }}
Division - -
Document Type - - -
Update Frequency{{ collection.get_update_frequency_display }}
Tree Root -
Notes{{ collection.notes }}
Sinequa Configuration - {{collection.sinequa_configuration }} -
GitHub Issue Link - {% if github_form.errors %} - {{ github_form.errors.github_issue_link }} - {% endif %} - {{collection.github_issue_link }} - - - -
Candidate URLs - View -
Required URLs - {% for required_url in required_urls %} -
-
- {% csrf_token %} - -
-  {{ required_url.url }} -
- {% empty %} -

No required URLs yet

- {% endfor %} -
- {% csrf_token %} - {{ form.url }} - -
-
Comments -
- {% for comment in comments %} -
- {{ comment.user.username }} - {{ comment.created_at|date:"M. d, Y, P" }} -

{{ comment.text }}

-
- {% empty %} -

No comments yet

- {% endfor %} -
-
Post a Comment -
- {% if user.is_authenticated %} -
- {% csrf_token %} - - -
- {% else %} -

Please log in to post comments.

- {% endif %} -
-
- -
-
- - - - - - - - - - {% for entry in workflow_history %} - - - - - - {% endfor %} - - -
Workflow StatusCuratorTimeframe
- - - {{ entry.curated_by }}{{entry.created_at|timesince}}
-
-
-
- - - - {% endblock content %} {% block javascripts %} From aacded4df8ca35073e66a0a0d5d7b06252e01614 Mon Sep 17 00:00:00 2001 From: Kshaw362 Date: Mon, 10 Jun 2024 12:48:13 -0400 Subject: [PATCH 04/13] 119: adding header --- sde_indexing_helper/static/css/candidate_url_list.css | 6 +----- sde_indexing_helper/static/css/project.css | 6 ++++++ .../templates/sde_collections/sde_dashboard.html | 7 ++----- 3 files changed, 9 insertions(+), 10 deletions(-) diff --git a/sde_indexing_helper/static/css/candidate_url_list.css b/sde_indexing_helper/static/css/candidate_url_list.css index 9568b431..97eb97a8 100644 --- a/sde_indexing_helper/static/css/candidate_url_list.css +++ b/sde_indexing_helper/static/css/candidate_url_list.css @@ -279,11 +279,7 @@ letter-spacing: -0.02em; font-weight: 500; } - .pageTitle{ - font-size:56px; - color:white; - font-weight:500; - } + .custom-select, .buttons-csv, .customizeColumns, .addPattern{ border-style: solid !important; diff --git a/sde_indexing_helper/static/css/project.css b/sde_indexing_helper/static/css/project.css index 8150b59a..6ecefab4 100644 --- a/sde_indexing_helper/static/css/project.css +++ b/sde_indexing_helper/static/css/project.css @@ -357,3 +357,9 @@ body { box-shadow: 0px 8px 16px 0px #0037FA4D; } + +.pageTitle{ + font-size:56px; + color:white; + font-weight:500; + } diff --git a/sde_indexing_helper/templates/sde_collections/sde_dashboard.html b/sde_indexing_helper/templates/sde_collections/sde_dashboard.html index bfd99e19..6e06edfe 100644 --- a/sde_indexing_helper/templates/sde_collections/sde_dashboard.html +++ b/sde_indexing_helper/templates/sde_collections/sde_dashboard.html @@ -5,15 +5,12 @@ {% endblock title %} {% block stylesheets %} {{ block.super }} - + {% endblock stylesheets %} {% block content %}
-
- oh yeaaa -
- +

SDE Dashboard

{% endblock content %} From c3ec4a0cde90fedfb3497fee9d36fbf66ac3442c Mon Sep 17 00:00:00 2001 From: Kshaw362 Date: Mon, 10 Jun 2024 13:46:42 -0400 Subject: [PATCH 05/13] 119: taking out unused js file import --- sde_indexing_helper/templates/sde_collections/sde_dashboard.html | 1 - 1 file changed, 1 deletion(-) diff --git a/sde_indexing_helper/templates/sde_collections/sde_dashboard.html b/sde_indexing_helper/templates/sde_collections/sde_dashboard.html index 6e06edfe..d03c8c8d 100644 --- a/sde_indexing_helper/templates/sde_collections/sde_dashboard.html +++ b/sde_indexing_helper/templates/sde_collections/sde_dashboard.html @@ -15,6 +15,5 @@

SDE Dashboard

{% endblock content %} {% block javascripts %} - {% endblock javascripts %} \ No newline at end of file From bec7f36c04497d33860e7cd9912530aa683bf093 Mon Sep 17 00:00:00 2001 From: Kshaw362 Date: Mon, 10 Jun 2024 17:30:42 -0400 Subject: [PATCH 06/13] 119: first chart is in --- .../static/css/candidate_url_list.css | 30 ----------- sde_indexing_helper/static/css/project.css | 32 ++++++++++++ .../static/css/sde_dashboard.css | 5 ++ .../static/js/sde_dashboard.js | 51 +++++++++++++++++++ .../sde_collections/sde_dashboard.html | 45 ++++++++++++++++ 5 files changed, 133 insertions(+), 30 deletions(-) create mode 100644 sde_indexing_helper/static/css/sde_dashboard.css create mode 100644 sde_indexing_helper/static/js/sde_dashboard.js diff --git a/sde_indexing_helper/static/css/candidate_url_list.css b/sde_indexing_helper/static/css/candidate_url_list.css index a9e2865e..57f4acb8 100644 --- a/sde_indexing_helper/static/css/candidate_url_list.css +++ b/sde_indexing_helper/static/css/candidate_url_list.css @@ -101,37 +101,7 @@ } -.tab-nav { - color: black; - padding-right: 25px; - padding-left: 25px; - font-weight: 500; -} - -/* tab headers hover effect */ -.tab-nav:hover { - text-decoration: underline; - color: #0066CA; -} -/* alligning tab container with the table */ -.nav-tabs { - padding-left: 0px; -} - -/* active tab */ -.nav-item > .active { - color: #0066CA; - font-weight: 700; - border-bottom: 3px solid #FF3D57; - padding-bottom: 15px; -} - -/* line under the tab options */ -div > .nav { - padding-bottom: 15px; - border-bottom: 1px solid #F8FAFB; -} /* badge showing workflow status by header */ .badge { diff --git a/sde_indexing_helper/static/css/project.css b/sde_indexing_helper/static/css/project.css index 88e54801..b8799639 100644 --- a/sde_indexing_helper/static/css/project.css +++ b/sde_indexing_helper/static/css/project.css @@ -571,3 +571,35 @@ height: 38px; display: flex; justify-content: center; } + +.tab-nav { + color: black; + padding-right: 25px; + padding-left: 25px; + font-weight: 500; +} + +/* tab headers hover effect */ +.tab-nav:hover { + text-decoration: underline; + color: #0066CA; +} + +/* alligning tab container with the table */ +.nav-tabs { + padding-left: 0px; +} + +/* active tab */ +.nav-item > .active { + color: #0066CA; + font-weight: 700; + border-bottom: 3px solid #FF3D57; + padding-bottom: 15px; +} + +/* line under the tab options */ +div > .nav { + padding-bottom: 15px; + border-bottom: 1px solid #F8FAFB; +} \ No newline at end of file diff --git a/sde_indexing_helper/static/css/sde_dashboard.css b/sde_indexing_helper/static/css/sde_dashboard.css new file mode 100644 index 00000000..121235ca --- /dev/null +++ b/sde_indexing_helper/static/css/sde_dashboard.css @@ -0,0 +1,5 @@ +.dashboardContainer { + background: #15232E; + padding: 40px 30px; + border-radius: 15px; +} \ No newline at end of file diff --git a/sde_indexing_helper/static/js/sde_dashboard.js b/sde_indexing_helper/static/js/sde_dashboard.js new file mode 100644 index 00000000..0f30f72d --- /dev/null +++ b/sde_indexing_helper/static/js/sde_dashboard.js @@ -0,0 +1,51 @@ +let ctx = document.getElementById("chart").getContext("2d"); + +// let chart = new Chart(ctx, { +// type: "bar", +// data: { +// labels: ["2020/Q1", "2020/Q2", "2020/Q3", "2020/Q4"], +// datasets: [ +// { +// label: "Gross volume ($)", +// backgroundColor: "#79AEC8", +// borderColor: "#417690", +// data: [26900, 28700, 27300, 29200] +// } +// ] +// }, +// options: { +// title: { +// text: "Gross Volume in 2020", +// display: true +// } +// } +// }); + + +const labels = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", +"November", "December" +]; +const data = { + labels: labels, + datasets: [{ + label: 'Total SDE Entries', + data: [65, 59, 80, 81, 56, 55, 40, 43,7,50,12,52], + fill: false, + borderColor: 'rgb(75, 192, 192)', + tension: 0.1 + }] +}; + +const stackedLine = new Chart(ctx, { + type: 'line', + data: data, + options: { + scales: { + y: { + stacked: true + } + } + } +}); + + diff --git a/sde_indexing_helper/templates/sde_collections/sde_dashboard.html b/sde_indexing_helper/templates/sde_collections/sde_dashboard.html index d03c8c8d..b9b829de 100644 --- a/sde_indexing_helper/templates/sde_collections/sde_dashboard.html +++ b/sde_indexing_helper/templates/sde_collections/sde_dashboard.html @@ -6,14 +6,59 @@ {% block stylesheets %} {{ block.super }} + {% endblock stylesheets %} {% block content %}

SDE Dashboard

+
+
+ + +
+
+ + +
+ +
+ +
+ + +
+ +
+ +
+ +
+ +
+ + +
+
+ {% endblock content %} {% block javascripts %} + + {% endblock javascripts %} \ No newline at end of file From cd58f3ef4b05eb1f1a063b3581c8d87e8da2c55c Mon Sep 17 00:00:00 2001 From: Kshaw362 Date: Mon, 10 Jun 2024 17:53:10 -0400 Subject: [PATCH 07/13] 119: adding title --- sde_indexing_helper/static/js/sde_dashboard.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/sde_indexing_helper/static/js/sde_dashboard.js b/sde_indexing_helper/static/js/sde_dashboard.js index 0f30f72d..6a73045a 100644 --- a/sde_indexing_helper/static/js/sde_dashboard.js +++ b/sde_indexing_helper/static/js/sde_dashboard.js @@ -40,6 +40,14 @@ const stackedLine = new Chart(ctx, { type: 'line', data: data, options: { + plugins: { + title: { + display: true, + text: 'Total SDE Entries', + position: 'top', + align: 'start' + } + }, scales: { y: { stacked: true From 714bcf2e9327662629648c9e03771397973a36e4 Mon Sep 17 00:00:00 2001 From: Kshaw362 Date: Tue, 11 Jun 2024 13:52:56 -0400 Subject: [PATCH 08/13] 119: chart styling --- .../static/js/sde_dashboard.js | 56 ++++++++++--------- 1 file changed, 29 insertions(+), 27 deletions(-) diff --git a/sde_indexing_helper/static/js/sde_dashboard.js b/sde_indexing_helper/static/js/sde_dashboard.js index 6a73045a..8d0b034c 100644 --- a/sde_indexing_helper/static/js/sde_dashboard.js +++ b/sde_indexing_helper/static/js/sde_dashboard.js @@ -1,26 +1,5 @@ let ctx = document.getElementById("chart").getContext("2d"); -// let chart = new Chart(ctx, { -// type: "bar", -// data: { -// labels: ["2020/Q1", "2020/Q2", "2020/Q3", "2020/Q4"], -// datasets: [ -// { -// label: "Gross volume ($)", -// backgroundColor: "#79AEC8", -// borderColor: "#417690", -// data: [26900, 28700, 27300, 29200] -// } -// ] -// }, -// options: { -// title: { -// text: "Gross Volume in 2020", -// display: true -// } -// } -// }); - const labels = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December" @@ -30,8 +9,8 @@ const data = { datasets: [{ label: 'Total SDE Entries', data: [65, 59, 80, 81, 56, 55, 40, 43,7,50,12,52], - fill: false, - borderColor: 'rgb(75, 192, 192)', + fill: true, + borderColor: '#65B1EF', tension: 0.1 }] }; @@ -40,17 +19,40 @@ const stackedLine = new Chart(ctx, { type: 'line', data: data, options: { + plugins: { + title: { display: true, - text: 'Total SDE Entries', + text: 'Total SDE Entries 3000', position: 'top', - align: 'start' - } + align: 'start', + color: '#A7BACD', + font: { + family: 'sans-serif', + size: 14, + weight: '400', + }, + }, + subtitle: { + display: true, + position: 'top', + align: 'start', + text: '3000', + color: '#65B1EF', + font: { + size: 24, + family: 'sans-serif', + weight: '700', + }, }, + }, scales: { y: { - stacked: true + stacked: true, + grid: { + color:'#A7BACD' + } } } } From 871ab9726abf23fa2b78550537c5883a2c9a39f7 Mon Sep 17 00:00:00 2001 From: Kshaw362 Date: Tue, 11 Jun 2024 14:33:04 -0400 Subject: [PATCH 09/13] 119: second chart added --- .../static/css/candidate_url_list.css | 3 - sde_indexing_helper/static/css/project.css | 5 + .../static/css/sde_dashboard.css | 8 +- .../static/js/sde_dashboard.js | 109 ++++++++++++++---- .../sde_collections/sde_dashboard.html | 20 +++- 5 files changed, 117 insertions(+), 28 deletions(-) diff --git a/sde_indexing_helper/static/css/candidate_url_list.css b/sde_indexing_helper/static/css/candidate_url_list.css index 57f4acb8..615d4704 100644 --- a/sde_indexing_helper/static/css/candidate_url_list.css +++ b/sde_indexing_helper/static/css/candidate_url_list.css @@ -99,9 +99,6 @@ .select-dropdown.focus { box-shadow: none, 0 0 0 0.2rem rgba(76, 175, 80, 0.5); } - - - /* badge showing workflow status by header */ .badge { diff --git a/sde_indexing_helper/static/css/project.css b/sde_indexing_helper/static/css/project.css index b8799639..92b491e1 100644 --- a/sde_indexing_helper/static/css/project.css +++ b/sde_indexing_helper/static/css/project.css @@ -602,4 +602,9 @@ height: 38px; div > .nav { padding-bottom: 15px; border-bottom: 1px solid #F8FAFB; +} + +.divisionDropdown { + appearance: auto !important; + padding:10px; } \ No newline at end of file diff --git a/sde_indexing_helper/static/css/sde_dashboard.css b/sde_indexing_helper/static/css/sde_dashboard.css index 121235ca..76cba047 100644 --- a/sde_indexing_helper/static/css/sde_dashboard.css +++ b/sde_indexing_helper/static/css/sde_dashboard.css @@ -2,4 +2,10 @@ background: #15232E; padding: 40px 30px; border-radius: 15px; -} \ No newline at end of file +} + +.filterDiv { + float: right; + margin-top: 10px; +} + diff --git a/sde_indexing_helper/static/js/sde_dashboard.js b/sde_indexing_helper/static/js/sde_dashboard.js index 8d0b034c..c5b29637 100644 --- a/sde_indexing_helper/static/js/sde_dashboard.js +++ b/sde_indexing_helper/static/js/sde_dashboard.js @@ -1,30 +1,32 @@ -let ctx = document.getElementById("chart").getContext("2d"); - +////////////////// Division //////////////////////////// +let divisionChart = document.getElementById("divisionChart").getContext("2d"); const labels = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", -"November", "December" + "November", "December" ]; -const data = { - labels: labels, - datasets: [{ - label: 'Total SDE Entries', - data: [65, 59, 80, 81, 56, 55, 40, 43,7,50,12,52], - fill: true, - borderColor: '#65B1EF', - tension: 0.1 - }] +const divisionData = { + labels: labels, + datasets: [{ + label: 'Total SDE Entries', + data: [65, 59, 80, 81, 56, 55, 40, 43, 7, 50, 12, 52], + fill: true, + borderColor: '#65B1EF', + tension: 0.1 + }] }; -const stackedLine = new Chart(ctx, { +const stackedLine = new Chart(divisionChart, { type: 'line', - data: data, + data: divisionData, options: { - + plugins: { - + legend: { + display: false + }, title: { display: true, - text: 'Total SDE Entries 3000', + text: 'Total SDE Entries', position: 'top', align: 'start', color: '#A7BACD', @@ -32,30 +34,91 @@ const stackedLine = new Chart(ctx, { family: 'sans-serif', size: 14, weight: '400', - }, + }, }, subtitle: { display: true, position: 'top', align: 'start', + padding: 10, text: '3000', color: '#65B1EF', font: { - size: 24, - family: 'sans-serif', - weight: '700', + size: 24, + family: 'sans-serif', + weight: '700', }, + }, }, - }, scales: { y: { stacked: true, grid: { - color:'#A7BACD' + color: '#A7BACD' } } } } }); +///////////////////////////////////////////// +////// candidiate urls ///////////////////// +let urlChart = document.getElementById("urlChart").getContext("2d"); + +const urlData = { + labels: labels, + datasets: [{ + label: 'Total Scraped URLs', + data: [6512, 59, 800, 81, 56, 55, 40, 4300, 7, 50, 120, 520], + fill: true, + borderColor: '#65B1EF', + tension: 0.1 + }] +}; + +const stackedLine2 = new Chart(urlChart, { + type: 'line', + data: urlData, + options: { + + plugins: { + legend: { + display: false + }, + title: { + display: true, + text: 'Total Scraped URLs', + position: 'top', + align: 'start', + color: '#A7BACD', + font: { + family: 'sans-serif', + size: 14, + weight: '400', + }, + }, + subtitle: { + display: true, + position: 'top', + align: 'start', + padding: 10, + text: '5280', + color: '#65B1EF', + font: { + size: 24, + family: 'sans-serif', + weight: '700', + }, + }, + }, + scales: { + y: { + stacked: true, + grid: { + color: '#A7BACD' + } + } + } + } +}); \ No newline at end of file diff --git a/sde_indexing_helper/templates/sde_collections/sde_dashboard.html b/sde_indexing_helper/templates/sde_collections/sde_dashboard.html index b9b829de..0849f58b 100644 --- a/sde_indexing_helper/templates/sde_collections/sde_dashboard.html +++ b/sde_indexing_helper/templates/sde_collections/sde_dashboard.html @@ -33,11 +33,29 @@

SDE Dashboard

- +
+ +
+
+
From bc44a5b449e918ce4948a4fe3b67b696bd134d79 Mon Sep 17 00:00:00 2001 From: Kshaw362 Date: Tue, 11 Jun 2024 17:08:03 -0400 Subject: [PATCH 10/13] 119: 3rd chart made --- .../static/js/sde_dashboard.js | 112 +++++++++++++++++- .../sde_collections/sde_dashboard.html | 13 ++ 2 files changed, 122 insertions(+), 3 deletions(-) diff --git a/sde_indexing_helper/static/js/sde_dashboard.js b/sde_indexing_helper/static/js/sde_dashboard.js index c5b29637..fcb1833d 100644 --- a/sde_indexing_helper/static/js/sde_dashboard.js +++ b/sde_indexing_helper/static/js/sde_dashboard.js @@ -62,8 +62,6 @@ const stackedLine = new Chart(divisionChart, { }); ///////////////////////////////////////////// ////// candidiate urls ///////////////////// - - let urlChart = document.getElementById("urlChart").getContext("2d"); const urlData = { @@ -121,4 +119,112 @@ const stackedLine2 = new Chart(urlChart, { } } } -}); \ No newline at end of file +}); +////////////////////////////////////////////////////////////// +/////////////// Workflow status /////////////////////////////// +let workflowChart = document.getElementById("workflowChart").getContext("2d"); + +const workflowData = { + labels: ["Research in Progress", "Ready for Engineering", "Engineering in Progress", "Ready for Curation", + "Curation in Progress", + "Curated", + "Quality Fixed", + "Secret Deployment Started", + "Secret Deployment Failed", + "Ready for LRM Quality Check", + "Ready for Quality Check", + "Quality Check Failed", + "Ready for Public Production", + "Perfect and on Production", + "Low Priority Problems on Production", + "High Priority Problems on Production, only for old sources", + "Code Merge Pending" + ], + datasets: [{ + label: 'Workflow Status Counts', + data: [651, 59, 800, 81, 56, 550, 40, 430, 7, 50, 120, 520, 13, 14, 15, 16, 17], + backgroundColor: [ + '#65B1EF', + '#65B1EF', + '#65B1EF', + '#65B1EF', + '#65B1EF', + '#65B1EF', + '#65B1EF', + '#65B1EF', + '#65B1EF', + '#65B1EF', + '#65B1EF', + '#65B1EF', + '#65B1EF', + '#65B1EF', + '#65B1EF', + '#65B1EF', + '#65B1EF', + ], + borderColor: [ + '#65B1EF', + '#65B1EF', + '#65B1EF', + '#65B1EF', + '#65B1EF', + '#65B1EF', + '#65B1EF', + '#65B1EF', + '#65B1EF', + '#65B1EF', + '#65B1EF', + '#65B1EF', + '#65B1EF', + '#65B1EF', + '#65B1EF', + '#65B1EF', + '#65B1EF', + ], + borderWidth: 1 + + }] +}; + +const barChart = new Chart(workflowChart, { + type: 'bar', + data: workflowData, + options: { + + plugins: { + legend: { + display: false + }, + title: { + display: true, + text: 'Workflow Status Counts', + position: 'top', + padding: 20, + align: 'start', + color: '#A7BACD', + font: { + family: 'sans-serif', + size: 14, + weight: '400', + }, + }, + }, + scales: { + y: { + beginAtZero: true, + }, + x: { // not 'xAxes: [{' anymore (not an array anymore) + ticks: { + color: "white", // not 'fontColor:' anymore + //fontSize: 14, + + beginAtZero: true + } + } + + } + } +}); +/////////////////////////////////////////////////////////////// +///////////////// Curator ///////////////////////// + diff --git a/sde_indexing_helper/templates/sde_collections/sde_dashboard.html b/sde_indexing_helper/templates/sde_collections/sde_dashboard.html index 0849f58b..f71f052d 100644 --- a/sde_indexing_helper/templates/sde_collections/sde_dashboard.html +++ b/sde_indexing_helper/templates/sde_collections/sde_dashboard.html @@ -10,6 +10,7 @@ {% endblock stylesheets %} {% block content %} +

SDE Dashboard

@@ -61,11 +62,23 @@

SDE Dashboard

+
+
+ +
+ + +
+
+ +
+ +
From 0efed8dbb11d71f928639d3962b5eeeb6142c5bf Mon Sep 17 00:00:00 2001 From: Kshaw362 Date: Tue, 11 Jun 2024 17:59:29 -0400 Subject: [PATCH 11/13] 119: pie chart added --- .../static/js/sde_dashboard.js | 151 +++++++++++++++++- .../sde_collections/sde_dashboard.html | 44 +++-- 2 files changed, 179 insertions(+), 16 deletions(-) diff --git a/sde_indexing_helper/static/js/sde_dashboard.js b/sde_indexing_helper/static/js/sde_dashboard.js index fcb1833d..0d8b8add 100644 --- a/sde_indexing_helper/static/js/sde_dashboard.js +++ b/sde_indexing_helper/static/js/sde_dashboard.js @@ -213,11 +213,9 @@ const barChart = new Chart(workflowChart, { y: { beginAtZero: true, }, - x: { // not 'xAxes: [{' anymore (not an array anymore) + x: { ticks: { - color: "white", // not 'fontColor:' anymore - //fontSize: 14, - + color: "white", beginAtZero: true } } @@ -227,4 +225,149 @@ const barChart = new Chart(workflowChart, { }); /////////////////////////////////////////////////////////////// ///////////////// Curator ///////////////////////// +let sdeChart = document.getElementById("sdeChart").getContext("2d"); + +const stackedLine3 = new Chart(sdeChart, { + type: 'line', + data: divisionData, + options: { + + plugins: { + legend: { + display: false + }, + title: { + display: true, + text: 'Total SDE Entries', + position: 'top', + align: 'start', + color: '#A7BACD', + font: { + family: 'sans-serif', + size: 14, + weight: '400', + }, + }, + subtitle: { + display: true, + position: 'top', + align: 'start', + padding: 10, + text: '3000', + color: '#65B1EF', + font: { + size: 24, + family: 'sans-serif', + weight: '700', + }, + }, + }, + scales: { + y: { + stacked: true, + grid: { + color: '#A7BACD' + } + } + } + } +}); +ASTROPHYSICS = 1, "Astrophysics" +BIOLOGY = 2, "Biological and Physical Sciences" +EARTH_SCIENCE = 3, "Earth Science" +HELIOPHYSICS = 4, "Heliophysics" +PLANETARY = 5, "Planetary Science" +GENERAL = 6, "General" + +let divisionChart2 = document.getElementById("divisionChart2").getContext("2d"); + +const division2Data = { + labels: ["Astrophysics", "Biological and Physical Sciences", "Earth Science", + "Heliophysics", "Planetary Science", "General" + ], + datasets: [{ + label: 'Workflow Status Counts', + data: [25, 90, 120, 12, 56, 132], + backgroundColor: [ + '#65B1EF', + '#65B1EF', + '#65B1EF', + '#65B1EF', + '#65B1EF', + '#65B1EF', + ], + borderColor: [ + '#65B1EF', + '#65B1EF', + '#65B1EF', + '#65B1EF', + '#65B1EF', + '#65B1EF', + ], + borderWidth: 1 + + }] +}; + +const barChart2 = new Chart(divisionChart2, { + type: 'bar', + data: division2Data, + options: { + + plugins: { + legend: { + display: false + }, + title: { + display: true, + text: 'Division Counts', + position: 'top', + padding: 20, + align: 'start', + color: '#A7BACD', + font: { + family: 'sans-serif', + size: 14, + weight: '400', + }, + }, + }, + scales: { + y: { + beginAtZero: true, + }, + x: { + ticks: { + color: "white", + beginAtZero: true + } + } + + } + } +}); + +let pieChart = document.getElementById("pieChart").getContext("2d"); + +const pieChartData = { + labels: [ + 'Not Started', + 'Started', + 'Completed' + ], + datasets: [{ + label: 'Workflow Status Completion', + data: [300, 50, 100], + backgroundColor: [ + '#F4C534', + '#09B66D', + '#65B1EF' + ], + hoverOffset: 4 + }] + }; + const doughnutChart = new Chart(pieChart, { + type: 'doughnut', + data: pieChartData + }); \ No newline at end of file diff --git a/sde_indexing_helper/templates/sde_collections/sde_dashboard.html b/sde_indexing_helper/templates/sde_collections/sde_dashboard.html index f71f052d..2cfe2db8 100644 --- a/sde_indexing_helper/templates/sde_collections/sde_dashboard.html +++ b/sde_indexing_helper/templates/sde_collections/sde_dashboard.html @@ -67,18 +67,38 @@

SDE Dashboard

-
- -
- - -
-
- -
- - -
+
+
+ +
+
+ +
+ + +
+
+ +
+ + +
+
+
From a89f47e763be2b5656a761f55d1828979c27e00d Mon Sep 17 00:00:00 2001 From: Kshaw362 Date: Tue, 11 Jun 2024 18:15:51 -0400 Subject: [PATCH 12/13] 119: 4th chart page --- .../static/js/sde_dashboard.js | 76 ++++++++++++++++++- .../sde_collections/sde_dashboard.html | 6 +- 2 files changed, 77 insertions(+), 5 deletions(-) diff --git a/sde_indexing_helper/static/js/sde_dashboard.js b/sde_indexing_helper/static/js/sde_dashboard.js index 0d8b8add..44693546 100644 --- a/sde_indexing_helper/static/js/sde_dashboard.js +++ b/sde_indexing_helper/static/js/sde_dashboard.js @@ -369,5 +369,77 @@ const pieChartData = { const doughnutChart = new Chart(pieChart, { type: 'doughnut', - data: pieChartData - }); \ No newline at end of file + data: pieChartData, + options: { + + plugins: { + legend: { + display: true, + position:'bottom' + }, + title: { + display: true, + text: 'Workflow Status Completion', + position: 'top', + padding: 20, + align: 'start', + color: '#A7BACD', + font: { + family: 'sans-serif', + size: 14, + weight: '400', + }, + }, + }, + } + + }); + + let timeSpentChart = document.getElementById("timeSpentChart").getContext("2d"); + + +const timeLabels = ["12 AM", "8 AM", "4 PM", "11 PM"]; + +const timeSpentData = { + labels: timeLabels, + datasets: [{ + label: 'Total time spent', + data: [250, 390, 400, 81], + fill: true, + borderColor: '#65B1EF', + tension: 0.1 + }] +}; + +const stackedLine4 = new Chart(timeSpentChart, { + type: 'line', + data: timeSpentData, + options: { + + plugins: { + legend: { + display: false + }, + title: { + display: true, + text: 'Total time spent', + position: 'top', + align: 'start', + color: '#A7BACD', + font: { + family: 'sans-serif', + size: 14, + weight: '400', + }, + }, + }, + scales: { + y: { + stacked: true, + grid: { + color: '#A7BACD' + } + } + } + } +}); \ No newline at end of file diff --git a/sde_indexing_helper/templates/sde_collections/sde_dashboard.html b/sde_indexing_helper/templates/sde_collections/sde_dashboard.html index 2cfe2db8..da5a549b 100644 --- a/sde_indexing_helper/templates/sde_collections/sde_dashboard.html +++ b/sde_indexing_helper/templates/sde_collections/sde_dashboard.html @@ -88,13 +88,13 @@

SDE Dashboard

- +
- +
- +
From ef6109cc2dfbe86c58437462643778971ba75f13 Mon Sep 17 00:00:00 2001 From: Kshaw362 Date: Wed, 12 Jun 2024 12:47:44 -0400 Subject: [PATCH 13/13] 119: chart updates --- .../static/js/sde_dashboard.js | 179 +++++++++++++++--- .../sde_collections/sde_dashboard.html | 4 +- 2 files changed, 157 insertions(+), 26 deletions(-) diff --git a/sde_indexing_helper/static/js/sde_dashboard.js b/sde_indexing_helper/static/js/sde_dashboard.js index 44693546..a5da0139 100644 --- a/sde_indexing_helper/static/js/sde_dashboard.js +++ b/sde_indexing_helper/static/js/sde_dashboard.js @@ -55,7 +55,27 @@ const stackedLine = new Chart(divisionChart, { stacked: true, grid: { color: '#A7BACD' - } + }, + ticks: { + color: "white", + beginAtZero: true + }, + title:{ + display:true, + text: 'Number of Entries', + color:'white' + } + }, + x: { + ticks: { + color: "white", + beginAtZero: true + }, + title:{ + display:true, + text: 'Months', + color:'white' + } } } } @@ -115,7 +135,27 @@ const stackedLine2 = new Chart(urlChart, { stacked: true, grid: { color: '#A7BACD' - } + }, + ticks: { + color: "white", + beginAtZero: true + }, + title:{ + display:true, + text: 'Number of URLs', + color:'white' + } + }, + x: { + ticks: { + color: "white", + beginAtZero: true + }, + title:{ + display:true, + text: 'Months', + color:'white' + } } } } @@ -141,7 +181,7 @@ const workflowData = { "Code Merge Pending" ], datasets: [{ - label: 'Workflow Status Counts', + label: 'Total', data: [651, 59, 800, 81, 56, 550, 40, 430, 7, 50, 120, 520, 13, 14, 15, 16, 17], backgroundColor: [ '#65B1EF', @@ -197,7 +237,7 @@ const barChart = new Chart(workflowChart, { }, title: { display: true, - text: 'Workflow Status Counts', + text: 'Workflow Status Totals', position: 'top', padding: 20, align: 'start', @@ -212,12 +252,26 @@ const barChart = new Chart(workflowChart, { scales: { y: { beginAtZero: true, + ticks: { + color: "white", + beginAtZero: true + }, + title:{ + display:true, + text: 'Totals', + color:'white' + } }, x: { ticks: { color: "white", beginAtZero: true - } + }, + title:{ + display:true, + text: 'Statuses', + color:'white' + } } } @@ -267,17 +321,32 @@ const stackedLine3 = new Chart(sdeChart, { stacked: true, grid: { color: '#A7BACD' - } + }, + ticks: { + color: "white", + beginAtZero: true + }, + title:{ + display:true, + text: 'Number of Entries', + color:'white' + } + }, + x: { + ticks: { + color: "white", + beginAtZero: true + }, + title:{ + display:true, + text: 'Months', + color:'white' + } } } } }); -ASTROPHYSICS = 1, "Astrophysics" -BIOLOGY = 2, "Biological and Physical Sciences" -EARTH_SCIENCE = 3, "Earth Science" -HELIOPHYSICS = 4, "Heliophysics" -PLANETARY = 5, "Planetary Science" -GENERAL = 6, "General" + let divisionChart2 = document.getElementById("divisionChart2").getContext("2d"); @@ -286,7 +355,7 @@ const division2Data = { "Heliophysics", "Planetary Science", "General" ], datasets: [{ - label: 'Workflow Status Counts', + label: 'Total', data: [25, 90, 120, 12, 56, 132], backgroundColor: [ '#65B1EF', @@ -320,7 +389,7 @@ const barChart2 = new Chart(divisionChart2, { }, title: { display: true, - text: 'Division Counts', + text: 'Entries by Division', position: 'top', padding: 20, align: 'start', @@ -331,16 +400,43 @@ const barChart2 = new Chart(divisionChart2, { weight: '400', }, }, + subtitle: { + display: true, + position: 'top', + align: 'start', + padding: 10, + text: '4561', + color: '#65B1EF', + font: { + size: 24, + family: 'sans-serif', + weight: '700', + }, + }, }, scales: { y: { beginAtZero: true, + ticks: { + color: "white", + beginAtZero: true + }, + title:{ + display:true, + text: 'Totals', + color:'white' + } }, x: { ticks: { color: "white", beginAtZero: true - } + }, + title:{ + display:true, + text: 'Divisions', + color:'white' + } } } @@ -352,8 +448,8 @@ let pieChart = document.getElementById("pieChart").getContext("2d"); const pieChartData = { labels: [ 'Not Started', - 'Started', - 'Completed' + 'In Progress', + 'In Production' ], datasets: [{ label: 'Workflow Status Completion', @@ -375,7 +471,10 @@ const pieChartData = { plugins: { legend: { display: true, - position:'bottom' + position:'bottom', + labels: { + color:'white' + } }, title: { display: true, @@ -400,25 +499,44 @@ const pieChartData = { const timeLabels = ["12 AM", "8 AM", "4 PM", "11 PM"]; -const timeSpentData = { +const notStartedData = { labels: timeLabels, datasets: [{ - label: 'Total time spent', + label: 'Not Started', data: [250, 390, 400, 81], fill: true, borderColor: '#65B1EF', tension: 0.1 + }, + { + label: 'In Production', + data: [150, 590, 20, 810], + fill: true, + borderColor: 'red', + tension: 0.1 + }, + { + label: 'In Progress', + data: [20, 293, 630, 124], + fill: true, + borderColor: 'green', + tension: 0.1 }] }; + const stackedLine4 = new Chart(timeSpentChart, { type: 'line', - data: timeSpentData, + data: notStartedData, options: { plugins: { legend: { - display: false + display: true, + position:'bottom', + labels: { + color:'white' + } }, title: { display: true, @@ -438,8 +556,21 @@ const stackedLine4 = new Chart(timeSpentChart, { stacked: true, grid: { color: '#A7BACD' - } + }, + title:{ + display:true, + text: 'Number of Entries', + color:'white' + } + }, + x: { + title:{ + display:true, + text: 'Time', + color:'white' + } } } } -}); \ No newline at end of file +}); + diff --git a/sde_indexing_helper/templates/sde_collections/sde_dashboard.html b/sde_indexing_helper/templates/sde_collections/sde_dashboard.html index da5a549b..c4a7d90b 100644 --- a/sde_indexing_helper/templates/sde_collections/sde_dashboard.html +++ b/sde_indexing_helper/templates/sde_collections/sde_dashboard.html @@ -88,13 +88,13 @@

SDE Dashboard

- +

- +