Skip to content

Commit

Permalink
fix: resolve the link related errors in home page widget tech-by-desi…
Browse files Browse the repository at this point in the history
  • Loading branch information
megin1989 committed Jan 7, 2025
1 parent c847dc2 commit cd7dd06
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 8 deletions.
2 changes: 1 addition & 1 deletion hub-prime/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
</parent>
<groupId>org.techbd</groupId>
<artifactId>hub-prime</artifactId>
<version>0.422.0</version>
<version>0.423.0</version>
<packaging>war</packaging>
<name>Tech by Design Hub (Prime)</name>
<description>Tech by Design Hub (Primary)</description>
Expand Down
31 changes: 24 additions & 7 deletions hub-prime/src/main/resources/templates/page/home.html
Original file line number Diff line number Diff line change
Expand Up @@ -251,12 +251,13 @@ <h3 class="text-xl font-bold mb-4">Production (flat files)</h3>
mermaid.contentLoaded();

// Wait for Mermaid to render and then add click event listeners
setTimeout(function () {
addClickEvent('HEALTHeLINK Proxy Validated FHIR JSON', '/needs-attention/techbd-to-scoring-engine?qeName=healthelink');
addClickEvent('Healtheconnections Proxy Validated FHIR JSON', '/needs-attention/techbd-to-scoring-engine?qeName=healtheconn');
addClickEvent('Healthix Proxy Validated FHIR JSON', '/needs-attention/techbd-to-scoring-engine?qeName=healthix');
addClickEvent('Rochester Proxy Validated FHIR JSON', '/needs-attention/techbd-to-scoring-engine?qeName=grrhio');
addClickEvent('HixNY Proxy Validated FHIR JSON', '/needs-attention/techbd-to-scoring-engine?qeName=hixny');
setTimeout(function () {
const { todayFormatted, pastDateFormatted } = getDateRange(7);
addClickEvent('HEALTHeLINK Proxy Validated FHIR JSON', '/needs-attention/techbd-to-scoring-engine?qeName=healthelink&fromDate='+pastDateFormatted+'&toDate='+todayFormatted+'');
addClickEvent('Healtheconnections Proxy Validated FHIR JSON', '/needs-attention/techbd-to-scoring-engine?qeName=healtheconn&fromDate='+pastDateFormatted+'&toDate='+todayFormatted+'');
addClickEvent('Healthix Proxy Validated FHIR JSON', '/needs-attention/techbd-to-scoring-engine?qeName=healthix&fromDate='+pastDateFormatted+'&toDate='+todayFormatted+'');
addClickEvent('Rochester Proxy Validated FHIR JSON', '/needs-attention/techbd-to-scoring-engine?qeName=grrhio&fromDate='+pastDateFormatted+'&toDate='+todayFormatted+'');
addClickEvent('HixNY Proxy Validated FHIR JSON', '/needs-attention/techbd-to-scoring-engine?qeName=hixny&fromDate='+pastDateFormatted+'&toDate='+todayFormatted+'');
}, 500);

} catch (error) {
Expand Down Expand Up @@ -317,8 +318,24 @@ <h3 class="text-xl font-bold mb-4">Production (flat files)</h3>
}
});
}
function getDateRange(daysAgo = 7) {
let today = new Date();
let pastDate = new Date(today);
pastDate.setDate(today.getDate() - daysAgo);

return {
todayFormatted: formatDate(today),
pastDateFormatted: formatDate(pastDate),
};
}
function formatDate(date) {
let day = String(date.getDate()).padStart(2, '0');
let month = String(date.getMonth() + 1).padStart(2, '0'); // Months are zero-based
let year = date.getFullYear();

// Example usage on page load or user interaction
return `${month}-${day}-${year}`;
}
// Example usage on page load or user interaction
// window.onload = function () {
// fetchRecentData(); // Fetch data for the last 7 days
// }
Expand Down

0 comments on commit cd7dd06

Please sign in to comment.