Skip to content
Snippets Groups Projects
Commit 994c4734 authored by Bjarke Madsen's avatar Bjarke Madsen
Browse files

lint everything

parent 463e6da7
No related branches found
No related tags found
No related merge requests found
Showing
with 37 additions and 37 deletions
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 ? (
......
......@@ -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;
}
}
......
......@@ -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 };
......
......@@ -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>
......
......@@ -23,7 +23,7 @@ function GeantFooter(): ReactElement {
<wbr />|
<a className="mx-3 footer-link" href="https://geant.org/Privacy-Notice/">Privacy&nbsp;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&nbsp;Consent</a>
......
......@@ -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];
......
......@@ -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
......@@ -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],
......
......@@ -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(', ');
}
})
......
......@@ -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',
......
......@@ -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"
......
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() {
......
......@@ -9,7 +9,7 @@ const consentContext = createContext<{
setConsent: (consent: boolean) => void;
}>({
consent: null,
setConsent: () => {}
setConsent: () => { }
});
......
......@@ -9,7 +9,7 @@ const PreviewContext = createContext<{
setPreview: Dispatch<SetStateAction<boolean>>;
}>({
preview: false,
setPreview: () => {}
setPreview: () => { }
});
......
......@@ -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;
};
......
......@@ -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;
......
......@@ -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 "";
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment