From f61ba74c2dd05b09ccaaef116fc27dc05abe444e Mon Sep 17 00:00:00 2001 From: sachin-panayil Date: Wed, 9 Oct 2024 12:03:07 -0500 Subject: [PATCH 1/6] added age of project to frontend Signed-off-by: sachin-panayil --- app/site/_layouts/repo-report.liquid | 28 ++++++++++++++++++++++++++++ app/src/js/graphs.js | 14 ++++++++++++++ 2 files changed, 42 insertions(+) diff --git a/app/site/_layouts/repo-report.liquid b/app/site/_layouts/repo-report.liquid index 3fd984cd24..83c058fe9c 100644 --- a/app/site/_layouts/repo-report.liquid +++ b/app/site/_layouts/repo-report.liquid @@ -155,6 +155,34 @@ layout: base

{{ project.pull_requests_count }}

+
+
+

+ + + {% lucide "calendar" %} + + + Age Of Project +

+
+

+ + {{ project.created_at | date: "%B %d, %Y" }} + + +

+
{% else %}

Error Occurred: Object Not Found

diff --git a/app/src/js/graphs.js b/app/src/js/graphs.js index 94a85282c5..5c2237eed7 100644 --- a/app/src/js/graphs.js +++ b/app/src/js/graphs.js @@ -17,3 +17,17 @@ window.showGraph = function (selectedGraphId, className, buttonName) { } }) } + +// goes inside includes/js for the time being +function toggleDateAge(element) { + const dateSpan = element.querySelector('.date'); + const ageSpan = element.querySelector('.age'); + + if (ageSpan.style.display === 'none') { + dateSpan.style.display = 'none'; + ageSpan.style.display = 'inline'; + } else { + dateSpan.style.display = 'inline'; + ageSpan.style.display = 'none'; + } +} \ No newline at end of file From aec595d14616f890f9dc2836f2b9cafa86b346bb Mon Sep 17 00:00:00 2001 From: sachin-panayil Date: Fri, 11 Oct 2024 10:40:03 -0400 Subject: [PATCH 2/6] fixed linting and moved JS Signed-off-by: sachin-panayil --- app/site/_layouts/repo-report.liquid | 26 +++++++++++++++++++++++--- app/src/js/graphs.js | 14 -------------- 2 files changed, 23 insertions(+), 17 deletions(-) diff --git a/app/site/_layouts/repo-report.liquid b/app/site/_layouts/repo-report.liquid index 83c058fe9c..7775cfcf23 100644 --- a/app/site/_layouts/repo-report.liquid +++ b/app/site/_layouts/repo-report.liquid @@ -1,7 +1,22 @@ --- layout: base --- + +
{% assign project = projects | findObject: repo %} @@ -172,13 +187,18 @@ layout: base

- {{ project.created_at | date: "%B %d, %Y" }} + {{ project.created_at | date: '%B %d, %Y' }}

diff --git a/app/src/js/graphs.js b/app/src/js/graphs.js index 5c2237eed7..94a85282c5 100644 --- a/app/src/js/graphs.js +++ b/app/src/js/graphs.js @@ -17,17 +17,3 @@ window.showGraph = function (selectedGraphId, className, buttonName) { } }) } - -// goes inside includes/js for the time being -function toggleDateAge(element) { - const dateSpan = element.querySelector('.date'); - const ageSpan = element.querySelector('.age'); - - if (ageSpan.style.display === 'none') { - dateSpan.style.display = 'none'; - ageSpan.style.display = 'inline'; - } else { - dateSpan.style.display = 'inline'; - ageSpan.style.display = 'none'; - } -} \ No newline at end of file From 338dc6640bb670fa9092efb732909d314f1cc377 Mon Sep 17 00:00:00 2001 From: sachin-panayil Date: Fri, 11 Oct 2024 14:15:52 -0400 Subject: [PATCH 3/6] added requested changes Signed-off-by: sachin-panayil --- app/site/_layouts/repo-report.liquid | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/app/site/_layouts/repo-report.liquid b/app/site/_layouts/repo-report.liquid index 7775cfcf23..5af2c66eea 100644 --- a/app/site/_layouts/repo-report.liquid +++ b/app/site/_layouts/repo-report.liquid @@ -3,16 +3,16 @@ layout: base --- @@ -170,7 +170,7 @@ layout: base

{{ project.pull_requests_count }}

-
+

@@ -182,10 +182,11 @@ layout: base {% lucide "calendar" %} - Age Of Project + Project Creation Date +

-

+

{{ project.created_at | date: '%B %d, %Y' }} From b3dce6d60956fa68d549e984baa7675391597ce7 Mon Sep 17 00:00:00 2001 From: sachin-panayil Date: Fri, 11 Oct 2024 14:55:56 -0400 Subject: [PATCH 4/6] linting Signed-off-by: sachin-panayil --- app/site/_layouts/repo-report.liquid | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/app/site/_layouts/repo-report.liquid b/app/site/_layouts/repo-report.liquid index 5af2c66eea..58d38c5acb 100644 --- a/app/site/_layouts/repo-report.liquid +++ b/app/site/_layouts/repo-report.liquid @@ -3,14 +3,14 @@ layout: base --- From 655c58585890450945e5bdc2c7653a03eacd004b Mon Sep 17 00:00:00 2001 From: sachin-panayil Date: Fri, 11 Oct 2024 15:05:19 -0400 Subject: [PATCH 6/6] even more linting Signed-off-by: sachin-panayil --- app/site/_layouts/repo-report.liquid | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/site/_layouts/repo-report.liquid b/app/site/_layouts/repo-report.liquid index a5ccbddc3e..8470dfbffb 100644 --- a/app/site/_layouts/repo-report.liquid +++ b/app/site/_layouts/repo-report.liquid @@ -5,11 +5,11 @@ layout: base function toggleDateAge(element) { const dateElements = element.querySelectorAll('.date') const ageElements = element.querySelectorAll('.age') - + dateElements.forEach((element) => { element.style.display = element.style.display === 'none' ? 'inline' : 'none' }) - + ageElements.forEach((element) => { element.style.display = element.style.display === 'none' ? 'inline' : 'none' })