Skip to content
This repository has been archived by the owner on Nov 4, 2024. It is now read-only.

Commit

Permalink
master (#4530)
Browse files Browse the repository at this point in the history
Syncing master back to develop to keep the two branches up-to-date.
  • Loading branch information
VWSCoronaDashboard26 authored Dec 19, 2022
1 parent 78d3b7f commit ee8ae1f
Show file tree
Hide file tree
Showing 8 changed files with 102 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/app/next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ const nextConfig = {
productionBrowserSourceMaps: true,

webpack(config) {
config.optimization.chunkIds = 'named';
config.optimization.chunkIds = 'size';
config.module.rules.push({
test: /\.svg$/,
type: 'asset',
Expand Down
45 changes: 45 additions & 0 deletions packages/app/schema/gm/hospital_nice_choropleth.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
{
"definitions": {
"value": {
"title": "gm_hospital_nice_choropleth_value",
"type": "object",
"additionalProperties": false,
"required": [
"admissions_on_date_of_admission",
"admissions_on_date_of_reporting",
"date_unix",
"date_of_insertion_unix"
],
"properties": {
"date_unix": {
"type": "integer"
},
"admissions_on_date_of_admission": {
"type": "integer"
},
"admissions_on_date_of_reporting": {
"type": "integer"
},
"date_of_insertion_unix": {
"type": "integer"
}
}
}
},
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "gm_hospital_nice_choropleth",
"type": "object",
"required": ["values", "last_value"],
"additionalProperties": false,
"properties": {
"values": {
"type": "array",
"items": {
"$ref": "#/definitions/value"
}
},
"last_value": {
"$ref": "#/definitions/value"
}
}
}
45 changes: 45 additions & 0 deletions packages/app/schema/vr/hospital_nice_choropleth.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "vr_hospital_nice_choropleth",
"type": "object",
"properties": {
"values": {
"type": "array",
"items": {
"$ref": "#/definitions/value"
}
},
"last_value": {
"$ref": "#/definitions/value"
}
},
"required": ["values", "last_value"],
"additionalProperties": false,
"definitions": {
"value": {
"title": "vr_hospital_nice_choropleth_value",
"type": "object",
"properties": {
"admissions_on_date_of_admission": {
"type": "integer"
},
"admissions_on_date_of_reporting": {
"type": "integer"
},
"date_unix": {
"type": "integer"
},
"date_of_insertion_unix": {
"type": "integer"
}
},
"required": [
"admissions_on_date_of_admission",
"admissions_on_date_of_reporting",
"date_unix",
"date_of_insertion_unix"
],
"additionalProperties": false
}
}
}
1 change: 1 addition & 0 deletions packages/app/src/components/combo-box/combo-box.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ type TProps<Option extends TOption> = {
options: Option[];
placeholder: string;
onSelect: (option: Option) => void;
sorter?: (a: Option, b: Option) => number;
selectedOption?: Option;
};

Expand Down
2 changes: 1 addition & 1 deletion packages/app/src/components/trend-icon.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export const TrendIcon = ({ trendDirection, ariaLabel, intensity = null, color =

// Icon with intensity is used only on the homepage at the moment, for all other trend icons the default (below) are used.
if (intensity && color && TrendDirection[trendDirection]) {
return <TrendIconWithIntensity color={color} direction={trendDirection} intensity={intensity} />;
return <TrendIconWithIntensity color={color} direction={trendDirection} intensity={intensity} aria-label={ariaLabelText} />;
}

switch (trendDirection) {
Expand Down
4 changes: 4 additions & 0 deletions packages/app/src/domain/layout/components/gm-combo-box.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ export function GmComboBox(props: GmComboBoxProps) {
const { commonTexts } = useIntl();
const reverseRouter = useReverseRouter();
const router = useRouter();
const expStr = new RegExp(["'s-"].join(' | '), 'g');

return (
<ComboBox
Expand All @@ -27,6 +28,9 @@ export function GmComboBox(props: GmComboBoxProps) {
: reverseRouter.gm.index(gemcode)
);
}}
sorter={(a, b) =>
a.name.replace(expStr, '').localeCompare(b.name.replace(expStr, ''))
}
selectedOption={gmData.find((gm) => gm.gemcode === selectedGmCode)}
/>
);
Expand Down
1 change: 1 addition & 0 deletions packages/app/src/domain/layout/components/vr-combo-box.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ export function VrComboBox(props: VrComboBoxProps) {
: reverseRouter.vr.index(region.code)
)
}
sorter={(a, b) => a.name.localeCompare(b.name)}
selectedOption={vrData.find((vr) => vr.code === selectedVrCode)}
/>
);
Expand Down
4 changes: 4 additions & 0 deletions packages/cms/src/data/data-structure.ts
Original file line number Diff line number Diff line change
Expand Up @@ -304,6 +304,10 @@ export const dataStructure = {
'admissions_on_date_of_admission_moving_average_rounded',
'admissions_on_date_of_reporting',
],
hospital_nice_choropleth: [
"admissions_on_date_of_admission",
"admissions_on_date_of_reporting",
],
tested_ggd: [
'infected',
'infected_moving_average',
Expand Down

0 comments on commit ee8ae1f

Please sign in to comment.