Skip to content

Commit

Permalink
Merge branch 'develop' into fix/breadcrumbs
Browse files Browse the repository at this point in the history
  • Loading branch information
stephanoshadjipetrou committed Mar 8, 2023
2 parents 1be82e3 + 5636bb0 commit ca2f9ed
Show file tree
Hide file tree
Showing 28 changed files with 33,228 additions and 6,567 deletions.
39,043 changes: 32,720 additions & 6,323 deletions public/sitemap.xml

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions src/app/components/Mobile/ViewsControl/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ export function MobileViewControl(props: MobileViewControlProps) {
}>(
getControlItems(
params.vizType,
params.subType,
history.location.pathname,
params.code,
params.period
Expand Down Expand Up @@ -121,6 +122,7 @@ export function MobileViewControl(props: MobileViewControlProps) {
setControlItems(
getControlItems(
params.vizType,
params.subType,
history.location.pathname,
params.code,
params.period
Expand Down
44 changes: 17 additions & 27 deletions src/app/components/PageHeader/components/tabs/data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export const countryDetailTabs: TabProps[] = [
tabs: [
{
name: "Eligibility",
url: "/location/<code>/eligibility",
url: "/location/<code>/eligibility/table",
},
{
name: "Allocation",
Expand Down Expand Up @@ -58,17 +58,12 @@ export const countryDetailTabs: TabProps[] = [
],
},
{
name: "More",
tabs: [
{
name: "Results",
url: "/location/<code>/results",
},
{
name: "Documents",
url: "/location/<code>/documents",
},
],
name: "Results",
url: "/location/<code>/results",
},
{
name: "Documents",
url: "/location/<code>/documents",
},
];

Expand Down Expand Up @@ -99,21 +94,16 @@ export const grantDetailTabs: TabProps[] = [
],
},
{
name: "More",
tabs: [
{
name: "Performance Rating",
url: "/grant/<code>/<period>/performance-rating",
},
{
name: "Targets and Results",
url: "/grant/<code>/<period>/targets-results",
},
{
name: "Documents",
url: "/grant/<code>/<period>/documents",
},
],
name: "Performance Rating",
url: "/grant/<code>/<period>/performance-rating",
},
{
name: "Targets and Results",
url: "/grant/<code>/<period>/targets-results",
},
{
name: "Documents",
url: "/grant/<code>/<period>/documents",
},
];

Expand Down
2 changes: 2 additions & 0 deletions src/app/components/Table/Expandable/Toolbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -251,8 +251,10 @@ export function TableToolbar(props: TableToolbarProps) {
<FormGroup>
{props.columns.map((c, index) => (
<FormControlLabel
key={c.name}
control={
<Checkbox
key={c.name}
value={index}
color="primary"
checked={c.checked}
Expand Down
2 changes: 2 additions & 0 deletions src/app/components/Table/Simple/data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ export interface SimpleTableProps {
title: string;
search: string;
sortBy: string;
forceExpand?: boolean;
rows: SimpleTableRow[];
formatNumbers?: boolean;
columns: SimpleTableColumn[];
onSearchChange: (value: string) => void;
onSortByChange: (value: string) => void;
Expand Down
92 changes: 53 additions & 39 deletions src/app/components/Table/Simple/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import ArrowDownward from "@material-ui/icons/ArrowDownward";
import { TriangleXSIcon } from "app/assets/icons/TriangleXS";
import TableContainer from "@material-ui/core/TableContainer";
import { tablecell } from "app/components/Table/Simple/styles";
import { formatFinancialValue } from "app/utils/formatFinancialValue";
import { TableToolbar } from "app/components/Table/Expandable/Toolbar";
import { TableToolbarCols } from "app/components/Table/Expandable/data";
import {
Expand All @@ -36,9 +37,11 @@ function Row(props: {
columns: SimpleTableColumn[];
paddingLeft?: number;
visibleColumnsIndexes: number[];
formatNumbers?: boolean;
forceExpand?: boolean;
}) {
const classes = useRowStyles();
const [open, setOpen] = React.useState(false);
const [open, setOpen] = React.useState(Boolean(props.forceExpand));

const firstColumnWidth = props.columns.length > 3 ? "30%" : "";
const firstColumnPadding = props.paddingLeft ? props.paddingLeft : 40;
Expand Down Expand Up @@ -80,58 +83,65 @@ function Row(props: {
{filter(
props.columns,
(_c, index) => props.visibleColumnsIndexes.indexOf(index) > -1
).map((column: SimpleTableColumn, index: number) => (
<TableCell
key={column.key}
css={`
${tablecell}
width: calc(${columnWidthCalc});
${index === 0
? `padding-left: ${firstColumnPadding}px;width: ${firstColumnWidth}`
: ""}
`}
>
<div
).map((column: SimpleTableColumn, index: number) => {
const value = get(props.row, column.key, "");
let formattedValue =
props.formatNumbers && !Number.isNaN(value)
? formatFinancialValue(value, true)
: value;
return (
<TableCell
key={column.key}
css={`
width: 100%;
display: flex;
align-items: center;
flex-direction: row;
justify-content: space-between;
${tablecell}
width: calc(${columnWidthCalc});
${index === 0
? `padding-left: ${firstColumnPadding}px;width: ${firstColumnWidth}`
: ""}
`}
>
<div
css={`
gap: 12px;
width: 100%;
display: flex;
align-items: center;
flex-direction: row;
font-weight: ${index === 0 ? "bold" : "normal"};
font-family: "GothamNarrow-${index === 0 ? "Bold" : "Book"}",
"Helvetica Neue", sans-serif;
justify-content: space-between;
`}
>
<div
css={`
gap: 12px;
width: 100%;
display: flex;
align-items: center;
flex-direction: row;
font-weight: ${index === 0 ? "bold" : "normal"};
font-family: "GothamNarrow-${index === 0 ? "Bold" : "Book"}",
"Helvetica Neue", sans-serif;
> * {
@supports (-webkit-touch-callout: none) and
(not (translate: none)) {
&:not(:last-child) {
margin-right: 12px;
> * {
@supports (-webkit-touch-callout: none) and
(not (translate: none)) {
&:not(:last-child) {
margin-right: 12px;
}
}
}
}
> svg {
transition: transform 0.1s ease-in-out;
transform: rotate(${open ? "0deg" : "-180deg"});
}
`}
>
{index === 0 && props.row.children && <TriangleXSIcon />}
{get(props.row, column.key, "")}
> svg {
transition: transform 0.1s ease-in-out;
transform: rotate(${open ? "0deg" : "-180deg"});
}
`}
>
{index === 0 && props.row.children && <TriangleXSIcon />}
{formattedValue}
</div>
</div>
</div>
</TableCell>
))}
</TableCell>
);
})}
</TableRow>
<TableRow
css={`
Expand All @@ -155,6 +165,8 @@ function Row(props: {
key={child.name}
paddingLeft={40}
columns={props.columns}
forceExpand={props.forceExpand}
formatNumbers={props.formatNumbers}
visibleColumnsIndexes={props.visibleColumnsIndexes}
/>
))}
Expand Down Expand Up @@ -270,6 +282,8 @@ export function SimpleTable(props: SimpleTableProps) {
key={row.name}
row={row}
columns={props.columns}
forceExpand={props.forceExpand}
formatNumbers={props.formatNumbers}
visibleColumnsIndexes={visibleColumnsIndexes}
/>
))}
Expand Down
Loading

0 comments on commit ca2f9ed

Please sign in to comment.