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

Add navigation boxes for each section

parent 51e6b888
No related branches found
No related tags found
1 merge request!27Feature/comp 175 176 navigation and improvements
...@@ -3,20 +3,24 @@ import { Container, Row, Col } from "react-bootstrap"; ...@@ -3,20 +3,24 @@ import { Container, Row, Col } from "react-bootstrap";
import OrganizationSidebar from "./OrganizationSidebar"; import OrganizationSidebar from "./OrganizationSidebar";
import PageHeader from "../components/global/PageHeader" import PageHeader from "../components/global/PageHeader"
import SectionLink from "../components/global/SectionLink"; import SectionLink from "../components/global/SectionLink";
import SectionNavigation from "./SectionNavigation";
import { Sections } from "../helpers/constants";
interface inputProps { interface inputProps {
title: string, title: string,
filter: ReactElement, filter: ReactElement,
children: ReactElement children: ReactElement,
category: Sections
} }
function DataPage({ title, filter, children }: inputProps): ReactElement { function DataPage({ title, filter, children, category }: inputProps): ReactElement {
return ( return (
<> <>
<OrganizationSidebar /> <OrganizationSidebar />
<PageHeader type={'data'} header={'Compendium Data'}> <PageHeader type={'data'} header={'Compendium Data'}>
<SectionLink section={"Reports"} /> <SectionLink section={"Reports"} />
</PageHeader> </PageHeader>
<SectionNavigation activeCategory={category} />
<Container className="grow"> <Container className="grow">
<Col xs={9}> <Col xs={9}>
<Row> <Row>
......
import React from 'react';
import { Link } from 'react-router-dom';
import { Container, Row, ButtonToolbar, Button } from 'react-bootstrap';
import { Sections } from '../helpers/constants';
interface inputProps {
activeCategory: Sections
}
const SectionNavigation = ({ activeCategory }: inputProps) => {
return (
<Container>
<Row>
<ButtonToolbar className="navbox-bar gap-2 m-3">
<Link to={activeCategory === Sections.Organisation ? '.' : '/funding'}>
<Button
variant={'nav-box'}
active={activeCategory === Sections.Organisation}>
<span>{Sections.Organisation}</span>
</Button>
</Link>
<Link to={activeCategory === Sections.Policy ? '.' : '/policy'}>
<Button
variant={'nav-box'}
active={activeCategory === Sections.Policy}>
<span>{Sections.Policy}</span>
</Button>
</Link>
<Link to={activeCategory === Sections.ConnectedUsers ? '.' : '.'}>
<Button
variant={'nav-box'}
active={activeCategory === Sections.ConnectedUsers}
disabled={true}>
<span>{Sections.ConnectedUsers}</span>
</Button>
</Link>
<Link to={activeCategory === Sections.Network ? '.' : '.'}>
<Button
variant={'nav-box'}
active={activeCategory === Sections.Network}
disabled={true}>
<span>{Sections.Network}</span>
</Button>
</Link>
<Link to={activeCategory === Sections.Services ? '.' : '.'}>
<Button
variant={'nav-box'}
active={activeCategory === Sections.Services}
disabled={true}>
<span>{Sections.Services}</span>
</Button>
</Link>
</ButtonToolbar>
</Row>
</Container>
)
}
export default SectionNavigation
\ No newline at end of file
export enum Sections {
Organisation = 'ORGANISATION',
Policy = 'STANDARDS AND POLICIES',
ConnectedUsers = 'CONNECTED USERS',
Network = 'NETWORK',
Services = 'SERVICES',
};
...@@ -6,6 +6,7 @@ import { createBudgetDataset, getYearsAndNrens, loadDataWithFilterNrenSelectionF ...@@ -6,6 +6,7 @@ import { createBudgetDataset, getYearsAndNrens, loadDataWithFilterNrenSelectionF
import DataPage from '../components/DataPage'; import DataPage from '../components/DataPage';
import Filter from "../components/graphing/Filter"; import Filter from "../components/graphing/Filter";
import LineGraph from "../components/graphing/LineGraph"; import LineGraph from "../components/graphing/LineGraph";
import { Sections } from '../helpers/constants';
interface inputProps { interface inputProps {
...@@ -39,7 +40,7 @@ function BudgetPage({ filterSelection, setFilterSelection }: inputProps): ReactE ...@@ -39,7 +40,7 @@ function BudgetPage({ filterSelection, setFilterSelection }: inputProps): ReactE
/> />
return ( return (
<DataPage title="Budgets" filter={filterNode}> <DataPage title="Budgets" category={Sections.Organisation} filter={filterNode}>
<> <>
<Row> <Row>
<LineGraph data={budgetData} /> <LineGraph data={budgetData} />
......
...@@ -7,6 +7,7 @@ import { createChargingStructureDataLookup, getYearsAndNrens, loadDataWithFilter ...@@ -7,6 +7,7 @@ import { createChargingStructureDataLookup, getYearsAndNrens, loadDataWithFilter
import ColorPill from "../components/ColorPill"; import ColorPill from "../components/ColorPill";
import DataPage from "../components/DataPage"; import DataPage from "../components/DataPage";
import Filter from "../components/graphing/Filter"; import Filter from "../components/graphing/Filter";
import { Sections } from "../helpers/constants";
ChartJS.register( ChartJS.register(
...@@ -49,7 +50,7 @@ function ChargingStructurePage({ filterSelection, setFilterSelection }: inputPro ...@@ -49,7 +50,7 @@ function ChargingStructurePage({ filterSelection, setFilterSelection }: inputPro
/> />
return ( return (
<DataPage title="Charging Structure" filter={filterNode}> <DataPage title="Charging Structure" category={Sections.Organisation} filter={filterNode}>
<Table className="charging-struct-table" striped bordered responsive > <Table className="charging-struct-table" striped bordered responsive >
<colgroup> <colgroup>
<col span={1} style={{ width: "10%" }} /> <col span={1} style={{ width: "10%" }} />
......
...@@ -5,6 +5,7 @@ import { ECProject, FilterSelection } from "../Schema"; ...@@ -5,6 +5,7 @@ import { ECProject, FilterSelection } from "../Schema";
import { createECProjectsDataLookup, getYearsAndNrens, loadDataWithFilterSelectionFallback } from '../helpers/dataconversion'; import { createECProjectsDataLookup, getYearsAndNrens, loadDataWithFilterSelectionFallback } from '../helpers/dataconversion';
import DataPage from '../components/DataPage'; import DataPage from '../components/DataPage';
import Filter from "../components/graphing/Filter" import Filter from "../components/graphing/Filter"
import { Sections } from '../helpers/constants';
interface inputProps { interface inputProps {
...@@ -54,7 +55,7 @@ function ECProjects({ filterSelection, setFilterSelection }: inputProps) { ...@@ -54,7 +55,7 @@ function ECProjects({ filterSelection, setFilterSelection }: inputProps) {
/> />
return ( return (
<DataPage title="NREN Involvement in European Commission Projects" filter={filterNode}> <DataPage title="NREN Involvement in European Commission Projects" category={Sections.Organisation} filter={filterNode}>
<Table borderless className='compendium-table'> <Table borderless className='compendium-table'>
<thead> <thead>
<tr> <tr>
......
...@@ -6,6 +6,7 @@ import { FundingSource, FilterSelection } from "../Schema"; ...@@ -6,6 +6,7 @@ import { FundingSource, FilterSelection } from "../Schema";
import { createFundingSourceDataset, getYearsAndNrens, loadDataWithFilterSelectionFallback } from "../helpers/dataconversion"; import { createFundingSourceDataset, getYearsAndNrens, loadDataWithFilterSelectionFallback } from "../helpers/dataconversion";
import DataPage from '../components/DataPage'; import DataPage from '../components/DataPage';
import Filter from "../components/graphing/Filter" import Filter from "../components/graphing/Filter"
import { Sections } from '../helpers/constants';
ChartJS.register( ChartJS.register(
...@@ -97,7 +98,7 @@ function FundingSourcePage({ filterSelection, setFilterSelection }: inputProps) ...@@ -97,7 +98,7 @@ function FundingSourcePage({ filterSelection, setFilterSelection }: inputProps)
return ( return (
<DataPage title="Funding Source" filter={filterNode}> <DataPage title="Funding Source" category={Sections.Organisation} filter={filterNode}>
<div className="chart-container" style={{ 'minHeight': '100vh', 'width': '60vw', }}> <div className="chart-container" style={{ 'minHeight': '100vh', 'width': '60vw', }}>
<Bar <Bar
data={fundingSourceDataset} data={fundingSourceDataset}
......
...@@ -8,7 +8,7 @@ function Landing(): ReactElement { ...@@ -8,7 +8,7 @@ function Landing(): ReactElement {
return ( return (
<Container className="grey-container"> <Container className="grey-container">
<Row> <Row>
<div className="center-text max-width-100vw"> <div className="center-text">
<h1 className="geant-header">THE GÉANT COMPENDIUM OF NRENS</h1> <h1 className="geant-header">THE GÉANT COMPENDIUM OF NRENS</h1>
<br /> <br />
<div className="wordwrap"> <div className="wordwrap">
......
...@@ -5,6 +5,7 @@ import { Organisation, FilterSelection } from "../Schema"; ...@@ -5,6 +5,7 @@ import { Organisation, FilterSelection } from "../Schema";
import { createOrganisationDataLookup, getYearsAndNrens, loadDataWithFilterSelectionFallback } from "../helpers/dataconversion"; import { createOrganisationDataLookup, getYearsAndNrens, loadDataWithFilterSelectionFallback } from "../helpers/dataconversion";
import DataPage from '../components/DataPage'; import DataPage from '../components/DataPage';
import Filter from "../components/graphing/Filter" import Filter from "../components/graphing/Filter"
import { Sections } from '../helpers/constants';
function getJSXFromMap(data: Map<string, Map<number, Organisation[]>>) { function getJSXFromMap(data: Map<string, Map<number, Organisation[]>>) {
...@@ -49,7 +50,7 @@ function ParentOrganisation({ filterSelection, setFilterSelection }: inputProps) ...@@ -49,7 +50,7 @@ function ParentOrganisation({ filterSelection, setFilterSelection }: inputProps)
/> />
return ( return (
<DataPage title="NREN Parent Organisations" filter={filterNode}> <DataPage title="NREN Parent Organisations" category={Sections.Organisation} filter={filterNode}>
<Table borderless className='compendium-table'> <Table borderless className='compendium-table'>
<thead> <thead>
<tr> <tr>
......
...@@ -5,6 +5,7 @@ import { Policy, FilterSelection } from "../Schema"; ...@@ -5,6 +5,7 @@ import { Policy, FilterSelection } from "../Schema";
import { createPolicyDataLookup, getYearsAndNrens, loadDataWithFilterSelectionFallback } from '../helpers/dataconversion'; import { createPolicyDataLookup, getYearsAndNrens, loadDataWithFilterSelectionFallback } from '../helpers/dataconversion';
import DataPage from '../components/DataPage'; import DataPage from '../components/DataPage';
import Filter from "../components/graphing/Filter" import Filter from "../components/graphing/Filter"
import { Sections } from '../helpers/constants';
interface inputProps { interface inputProps {
filterSelection: FilterSelection filterSelection: FilterSelection
...@@ -69,7 +70,7 @@ function PolicyPage({ filterSelection, setFilterSelection }: inputProps) { ...@@ -69,7 +70,7 @@ function PolicyPage({ filterSelection, setFilterSelection }: inputProps) {
/> />
return ( return (
<DataPage title="NREN Policies" filter={filterNode}> <DataPage title="NREN Policies" category={Sections.Policy} filter={filterNode}>
<Table borderless className='compendium-table'> <Table borderless className='compendium-table'>
<thead> <thead>
<tr> <tr>
......
...@@ -6,6 +6,7 @@ import { NrenStaff, FilterSelection } from "../Schema"; ...@@ -6,6 +6,7 @@ import { NrenStaff, FilterSelection } from "../Schema";
import { createNRENStaffDataset, getYearsAndNrens, loadDataWithFilterSelectionFallback } from "../helpers/dataconversion"; import { createNRENStaffDataset, getYearsAndNrens, loadDataWithFilterSelectionFallback } from "../helpers/dataconversion";
import DataPage from '../components/DataPage'; import DataPage from '../components/DataPage';
import Filter from "../components/graphing/Filter" import Filter from "../components/graphing/Filter"
import { Sections } from '../helpers/constants';
ChartJS.register( ChartJS.register(
...@@ -103,7 +104,7 @@ function StaffGraph({ filterSelection, setFilterSelection, roles = false }: inpu ...@@ -103,7 +104,7 @@ function StaffGraph({ filterSelection, setFilterSelection, roles = false }: inpu
const text = roles ? "Roles" : "Employment"; const text = roles ? "Roles" : "Employment";
return ( return (
<DataPage title={"NREN Staff " + text} filter={filterNode}> <DataPage title={"NREN Staff " + text} category={Sections.Organisation} filter={filterNode}>
<div className="chart-container" style={{ 'minHeight': '60vh', 'width': '60vw', }}> <div className="chart-container" style={{ 'minHeight': '60vh', 'width': '60vw', }}>
<Bar <Bar
data={nrenStaffDataset} data={nrenStaffDataset}
......
...@@ -5,6 +5,7 @@ import { Organisation, FilterSelection } from "../Schema"; ...@@ -5,6 +5,7 @@ import { Organisation, FilterSelection } from "../Schema";
import { createOrganisationDataLookup, getYearsAndNrens, loadDataWithFilterSelectionFallback } from "../helpers/dataconversion"; import { createOrganisationDataLookup, getYearsAndNrens, loadDataWithFilterSelectionFallback } from "../helpers/dataconversion";
import DataPage from '../components/DataPage'; import DataPage from '../components/DataPage';
import Filter from "../components/graphing/Filter" import Filter from "../components/graphing/Filter"
import { Sections } from '../helpers/constants';
function getJSXFromMap(data: Map<string, Map<number, Organisation[]>>) { function getJSXFromMap(data: Map<string, Map<number, Organisation[]>>) {
...@@ -54,7 +55,7 @@ function SubOrganisation({ filterSelection, setFilterSelection }: inputProps) { ...@@ -54,7 +55,7 @@ function SubOrganisation({ filterSelection, setFilterSelection }: inputProps) {
/> />
return ( return (
<DataPage title="NREN Suborganisations" filter={filterNode}> <DataPage title="NREN Suborganisations" category={Sections.Organisation} filter={filterNode}>
<Table borderless className='compendium-table'> <Table borderless className='compendium-table'>
<thead> <thead>
<tr> <tr>
......
@import '../abstracts/variables';
.btn-nav-box {
--bs-btn-color: rgb(0, 63, 95);
--bs-btn-border-color: #6c757d;
--bs-btn-border-radius: none;
// active
--bs-btn-active-color: #fff;
// see https://stackoverflow.com/a/76213205 for why this syntax is necessary
--bs-btn-active-bg: #{$yellow-orange};
--bs-btn-active-border-color: #{$yellow-orange};
// hover
--bs-btn-hover-color: rgb(0, 63, 95);
--bs-btn-hover-bg: #{$yellow-orange};
--bs-btn-hover-border-color: #{$yellow-orange};
// disabled
--bs-btn-disabled-color: #6c757d;
--bs-btn-disabled-bg: transparent;
// --bs-btn-disabled-border-color: #6c757d;
border: 2px solid $yellow-orange;
}
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment