diff --git a/compendium-frontend/src/components/ColorBadge.tsx b/compendium-frontend/src/components/ColorBadge.tsx index 83547d0a4702eddb1220fec910208a18975c0588..bc6b55da6e043cbc1e6a92c4fe3538f7428e2f2d 100644 --- a/compendium-frontend/src/components/ColorBadge.tsx +++ b/compendium-frontend/src/components/ColorBadge.tsx @@ -1,6 +1,6 @@ import React from "react"; -function ColorBadge({ index: index, active=true }) { +function ColorBadge({ index: index, active = true }) { return ( <div className="d-inline-block m-2" key={index}> {active ? ( diff --git a/compendium-frontend/src/components/ColorBadgeService.tsx b/compendium-frontend/src/components/ColorBadgeService.tsx index c978a92eeec639748262f84018a4a1b7f7c5afd2..8b33e05653cb7b8a32388a32cb0d794c01849ad6 100644 --- a/compendium-frontend/src/components/ColorBadgeService.tsx +++ b/compendium-frontend/src/components/ColorBadgeService.tsx @@ -16,7 +16,7 @@ function ColorBadgeService({ year, active, serviceInfo, tickServiceIndex, curren name = name || "N/A"; desc = desc || "N/A"; info = info || "N/A"; - tooltip_text = serviceName +" ("+year+")"+ "\n" + name + "\n\n" + "Description: " + desc + "\n" + "Information: " + info; + tooltip_text = serviceName + " (" + year + ")" + "\n" + name + "\n\n" + "Description: " + desc + "\n" + "Information: " + info; } } diff --git a/compendium-frontend/src/components/ScrollableMatrix.tsx b/compendium-frontend/src/components/ScrollableMatrix.tsx index 2a2926118fb42383daf980ea6d688a3d544bc94b..53498be40550873f86ca8428743ca6df63b9b925 100644 --- a/compendium-frontend/src/components/ScrollableMatrix.tsx +++ b/compendium-frontend/src/components/ScrollableMatrix.tsx @@ -10,7 +10,7 @@ const CELL_SIZE = 8 interface ScrollableMatrixProps { // dataLookup is a map of NRENs, years, and categories that maps to data for that category in that year for that NREN - dataLookup: Map<string, Map<number, Map<string, { [key: string]: { [key: string]: string|number } }>>>; + dataLookup: Map<string, Map<number, Map<string, { [key: string]: { [key: string]: string | number } }>>>; // rowInfo is a map of row titles and the lookup key that maps to data for that row rowInfo: { [key: string]: string }; diff --git a/compendium-frontend/src/components/ScrollableTable.tsx b/compendium-frontend/src/components/ScrollableTable.tsx index 3b31659a83d8e1ea126df12df8ce45474fcfe582..94888ad34eafecfe84daad04e477396b63dee5c7 100644 --- a/compendium-frontend/src/components/ScrollableTable.tsx +++ b/compendium-frontend/src/components/ScrollableTable.tsx @@ -25,7 +25,7 @@ export function ScrollableTable<T extends NrenAndYearDatapoint>({ dataLookup, co <div className="scrollable-horizontal"> {Array.from(nrenData.entries()).map(([year, yearData]) => { // workaround for setting the background color of the ::before element to the color of the year - const style = { + const style = { '--before-color': `var(--color-of-the-year-muted-${year % 9})`, } as React.CSSProperties @@ -37,7 +37,7 @@ export function ScrollableTable<T extends NrenAndYearDatapoint>({ dataLookup, co <thead> <tr> {Object.keys(columnInfo).map((title) => ( - <th key={title} style={{position: "relative"}}> + <th key={title} style={{ position: "relative" }}> <span style={style}>{title}</span></th> ))} </tr> diff --git a/compendium-frontend/src/components/global/GeantFooter.tsx b/compendium-frontend/src/components/global/GeantFooter.tsx index 5959b797baa3cd0b21f427d9f8f1a1a8a9e325d6..f7091ad45059997c27b1898bbda3ab1d9ebf0c0e 100644 --- a/compendium-frontend/src/components/global/GeantFooter.tsx +++ b/compendium-frontend/src/components/global/GeantFooter.tsx @@ -23,7 +23,7 @@ function GeantFooter(): ReactElement { <wbr />| <a className="mx-3 footer-link" href="https://geant.org/Privacy-Notice/">Privacy Policy</a> <wbr />| - <a className="mx-3 footer-link" style={{cursor: "pointer"}} onClick={() => { + <a className="mx-3 footer-link" style={{ cursor: "pointer" }} onClick={() => { localStorage.removeItem('matomo_consent'); window.location.reload(); }}>Analytics Consent</a> diff --git a/compendium-frontend/src/helpers/dataconversion.tsx b/compendium-frontend/src/helpers/dataconversion.tsx index df93348eab512e40c73bcce7c7fa2d163c5ef7ae..83ddd81f18f42f18bd5dd4f9b8fb3c38c4a8a91c 100644 --- a/compendium-frontend/src/helpers/dataconversion.tsx +++ b/compendium-frontend/src/helpers/dataconversion.tsx @@ -193,7 +193,7 @@ export function createCategoryMatrixLookup<T extends NrenAndYearDatapoint>( */ // Row identifier -> NREN -> Year -> Data for that year - const dataLookup = new Map<string, Map<number, Map<string, { [key: string]: { [key: string]: string|number } }>>>(); + const dataLookup = new Map<string, Map<number, Map<string, { [key: string]: { [key: string]: string | number } }>>>(); const processMatrixLookup = (data: T[], categoryField: keyof T | undefined, field: string) => { data.forEach(datapoint => { @@ -207,8 +207,8 @@ export function createCategoryMatrixLookup<T extends NrenAndYearDatapoint>( const nren = datapoint.nren; const year = datapoint.year; - const nrenData = dataLookup.get(nren) || new Map<number, Map<string, { [key: string]: string|number }>>(); // NREN -> Year -> Data for that year - const yearData = nrenData.get(year) || new Map<string, { [key: string]: { [key: string]: string|number } }>(); // Year -> Data for that year + const nrenData = dataLookup.get(nren) || new Map<number, Map<string, { [key: string]: string | number }>>(); // NREN -> Year -> Data for that year + const yearData = nrenData.get(year) || new Map<string, { [key: string]: { [key: string]: string | number } }>(); // Year -> Data for that year const values = yearData.get(rowIdentifier as string) || {}; // Data for that year const value = datapoint[field]; diff --git a/compendium-frontend/src/index.tsx b/compendium-frontend/src/index.tsx index 1be857a35126b31a590be82a50dde1c37e34609c..02df09a3eebf4b6fb1ab5f9a57712a952afe882f 100644 --- a/compendium-frontend/src/index.tsx +++ b/compendium-frontend/src/index.tsx @@ -6,9 +6,9 @@ import 'bootstrap/dist/css/bootstrap.min.css'; import './main.scss'; const container = document.getElementById('root') as HTMLElement; -const root = createRoot(container); +const root = createRoot(container); root.render( <React.StrictMode> - <App/> + <App /> </React.StrictMode> ) \ No newline at end of file diff --git a/compendium-frontend/src/matomo/UseMatomo.ts b/compendium-frontend/src/matomo/UseMatomo.ts index 13a7cd0bf006eb41d62f8a46ba7b27c2d6ea6220..c3624f016040f8bf370be73da9b02b6f756a2fc7 100644 --- a/compendium-frontend/src/matomo/UseMatomo.ts +++ b/compendium-frontend/src/matomo/UseMatomo.ts @@ -14,7 +14,7 @@ function useMatomo() { [instance], ) -const trackEvent = useCallback( + const trackEvent = useCallback( (params: TrackEventParams) => instance?.trackEvent(params), [instance], ) @@ -32,7 +32,7 @@ const trackEvent = useCallback( const pushInstruction = useCallback( (name: string, ...args: any[]) => { // eslint-disable-line @typescript-eslint/no-explicit-any - + instance?.pushInstruction(name, ...args) }, [instance], diff --git a/compendium-frontend/src/pages/ConnectedUsers/RemoteCampuses.tsx b/compendium-frontend/src/pages/ConnectedUsers/RemoteCampuses.tsx index b130c932edbf3bb96d9cb7addbc129e0aa3967b0..ff97780c88773d6796ce6597342c9c21642c55ca 100644 --- a/compendium-frontend/src/pages/ConnectedUsers/RemoteCampuses.tsx +++ b/compendium-frontend/src/pages/ConnectedUsers/RemoteCampuses.tsx @@ -31,7 +31,7 @@ function RemoteCampusesPage() { const countries = campus.connections.map(connection => connection.country).join(', '); obj['countries'] = countries; obj['local_r_and_e_connection'] = campus.connections.map(connection => connection.local_r_and_e_connection ? 'Yes' : 'No').join(', '); - + } }) diff --git a/compendium-frontend/src/pages/Network/CapacityLargestLink.tsx b/compendium-frontend/src/pages/Network/CapacityLargestLink.tsx index d3d7a50d41657007dbeca18e397dc3e07a9e53e4..81138ba276621db394dbe44b063096e1d2bc18d8 100644 --- a/compendium-frontend/src/pages/Network/CapacityLargestLink.tsx +++ b/compendium-frontend/src/pages/Network/CapacityLargestLink.tsx @@ -52,7 +52,7 @@ function CapacityLargestLinkPage() { provide the sum of aggregated links, backup capacity was not to be included.` const options = getBarChartOptions({ - + title: title, tooltipUnit: 'Gbit/s', unit: 'Gbit/s', diff --git a/compendium-frontend/src/pages/Network/ExternalConnections.tsx b/compendium-frontend/src/pages/Network/ExternalConnections.tsx index 8bfe733b3217c5d6f86d32ba5ddba55c33bfec55..8bed655e5dffaa4c778184d15e7df14753b01878 100644 --- a/compendium-frontend/src/pages/Network/ExternalConnections.tsx +++ b/compendium-frontend/src/pages/Network/ExternalConnections.tsx @@ -40,8 +40,8 @@ function ExternalConnectionsPage(): React.ReactElement { These include links to their regional backbone (ie. GÉANT), to other research locations, to the commercial internet, peerings to internet exchanges, cross-border dark fibre links, and any other links they may have.</p> <p>NRENs are asked to state the capacity for production purposes, not any additional link that may be there solely for the purpose of giving resilience. - Cross-border fibre links are meant as those links which have been commissioned or established by the NREN from a point on their network, - which is near the border to another point near the border on the network of a neighbouring NREN.</p></> + Cross-border fibre links are meant as those links which have been commissioned or established by the NREN from a point on their network, + which is near the border to another point near the border on the network of a neighbouring NREN.</p></> return ( <DataPage title="NREN External IP Connections" diff --git a/compendium-frontend/src/pages/Organization/FundingSource.tsx b/compendium-frontend/src/pages/Organization/FundingSource.tsx index 958971ac3e8f0d5e524dc3147ea2489b75a6036d..ae62e3b94714267225383a1ead251b58f18b47d8 100644 --- a/compendium-frontend/src/pages/Organization/FundingSource.tsx +++ b/compendium-frontend/src/pages/Organization/FundingSource.tsx @@ -1,7 +1,7 @@ import React, { useContext } from 'react'; import { Bar } from 'react-chartjs-2'; import { Col, Row } from "react-bootstrap"; -import { Chart as ChartJS, Tooltip} from 'chart.js'; +import { Chart as ChartJS, Tooltip } from 'chart.js'; import ChartDataLabels from 'chartjs-plugin-datalabels'; import { FundingSource } from "../../Schema"; @@ -30,16 +30,16 @@ const chartOptions = { }, tooltip: { callbacks: { - label: function (tooltipItem) { - let label = tooltipItem.dataset.label || ''; + label: function (tooltipItem) { + let label = tooltipItem.dataset.label || ''; - if (tooltipItem.parsed.y !== null) { - label += `: ${tooltipItem.parsed.x}%` - } - return label; + if (tooltipItem.parsed.y !== null) { + label += `: ${tooltipItem.parsed.x}%` } + return label; + } }, - }, + }, }, scales: { x: { @@ -119,7 +119,7 @@ function FundingSourceLegend() { } ChartJS.register( - Tooltip, + Tooltip, ); function FundingSourcePage() { diff --git a/compendium-frontend/src/providers/ConsentProvider.tsx b/compendium-frontend/src/providers/ConsentProvider.tsx index cba0ec0da4e1ced1f8225561fb4c407edc5d07a6..caf79512e9e1950ad8b3e836fc2f64f2ef33d479 100644 --- a/compendium-frontend/src/providers/ConsentProvider.tsx +++ b/compendium-frontend/src/providers/ConsentProvider.tsx @@ -9,7 +9,7 @@ const consentContext = createContext<{ setConsent: (consent: boolean) => void; }>({ consent: null, - setConsent: () => {} + setConsent: () => { } }); diff --git a/compendium-frontend/src/providers/PreviewProvider.tsx b/compendium-frontend/src/providers/PreviewProvider.tsx index 4630a5d9d9ef389a8c8ef4b2e16c2ef650182844..91e6ac59df6a77758311f1fc6ce3b9d1b7c57186 100644 --- a/compendium-frontend/src/providers/PreviewProvider.tsx +++ b/compendium-frontend/src/providers/PreviewProvider.tsx @@ -9,7 +9,7 @@ const PreviewContext = createContext<{ setPreview: Dispatch<SetStateAction<boolean>>; }>({ preview: false, - setPreview: () => {} + setPreview: () => { } }); diff --git a/compendium-frontend/src/survey/ProgressBar.tsx b/compendium-frontend/src/survey/ProgressBar.tsx index b88da9f5f526b79002b365d91ff7d70ec532a350..e1b44b3df98f919ed106347710832197435e479c 100644 --- a/compendium-frontend/src/survey/ProgressBar.tsx +++ b/compendium-frontend/src/survey/ProgressBar.tsx @@ -14,17 +14,17 @@ function ProgressBar({ surveyModel, pageNoSetter }) { const filterCallback = (question) => { - if(question.value === null || question.value === undefined || question.value===""){ + if (question.value === null || question.value === undefined || question.value === "") { return false; } // For text and comment and other types - if(question.getType()==="checkbox" && question.value.length == 0) { - return false ; + if (question.getType() === "checkbox" && question.value.length == 0) { + return false; }//For empty checkbox - if (question.getType()==="multipletext" && + if (question.getType() === "multipletext" && ((Object.keys(question.value).length === 1 - && Object.values(question.value)[0]=== undefined) - || Object.keys(question.value).length === 0 )){ - return false + && Object.values(question.value)[0] === undefined) + || Object.keys(question.value).length === 0)) { + return false }// For empty multipletext return true; }; diff --git a/compendium-frontend/src/survey/SurveyContainerComponent.tsx b/compendium-frontend/src/survey/SurveyContainerComponent.tsx index 3e724a58b423714608711b93e5b560dfc20908d8..8fbfd5953b786031949e91078dc5a6b29c4b9a04 100644 --- a/compendium-frontend/src/survey/SurveyContainerComponent.tsx +++ b/compendium-frontend/src/survey/SurveyContainerComponent.tsx @@ -48,7 +48,7 @@ function oldValidateWebsiteUrl(params) { } } -function validateQuestion(this: { question: ValidationQuestion, row? }, params) { +function validateQuestion(this: { question: ValidationQuestion, row?}, params) { try { const question = this.question; const validator = params[0] || undefined; diff --git a/compendium-frontend/src/survey/api/survey.ts b/compendium-frontend/src/survey/api/survey.ts index 44814d468d65bad9b8608f4c94421dc8600b2b8a..e61e6ceb5d75fab51fb161fd24c16214c6871e71 100644 --- a/compendium-frontend/src/survey/api/survey.ts +++ b/compendium-frontend/src/survey/api/survey.ts @@ -16,7 +16,7 @@ export async function fetchActiveSurveyYear(): Promise<string> { const data = await response.json(); if ('year' in data) { const year = data.year; - return year.toString(); + return year.toString(); } else { console.log('Invalid response format: Failed fetching active survey year.'); return "";