Skip to content

Commit

Permalink
Merge pull request #176 from openstreetmap-polska/dev
Browse files Browse the repository at this point in the history
Release dev
  • Loading branch information
starsep authored Nov 19, 2023
2 parents 1974227 + 3770389 commit 7944c9c
Show file tree
Hide file tree
Showing 14 changed files with 105 additions and 90 deletions.
Binary file added public/img/logo-cez.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/img/logo-pw.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified public/img/sprite.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified public/img/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified public/img/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions public/locales/en/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -97,11 +97,13 @@
"thanks_for_report": "Thank you for sending a report. It will be reviewed by the site administrators."
},
"partners": {
"e_health_centre": "e-Health Centre",
"honorary_patronage": "Honorary patronage",
"gugik": "Head Office of Geodesy and Cartography in Poland",
"acting": "acting",
"chief_geodesist": "Chief Geodesist of Poland",
"main_scientific_partner": "The Main Scientific Partner",
"warsaw_university_of_technology": "Warsaw University of Technology",
"wroclaw_medical_university": "Wroclaw Medical University"
},
"common": {
Expand Down
2 changes: 2 additions & 0 deletions public/locales/pl/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -97,11 +97,13 @@
"thanks_for_report": "Dziękujemy za wysłanie zgłoszenia. Zostanieono przeanalizowane przez administratorów strony."
},
"partners": {
"e_health_centre": "Centrum e-Zdrowia",
"honorary_patronage": "Patronat honorowy",
"gugik": "Główny Urząd Geodezji i Kartografii",
"acting": "p. o.",
"chief_geodesist": "Główny Geodeta Kraju",
"main_scientific_partner": "Główny Partner Naukowy",
"warsaw_university_of_technology": "Politechnika Warszawska",
"wroclaw_medical_university": "Uniwersytet Medyczny im. Piastów Śląskich we Wrocławiu"
},
"common": {
Expand Down
4 changes: 2 additions & 2 deletions src/backend.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ interface BackendCountry {
data_path: string;
}

export async function fetchCountriesData(): Promise<Array<Country> | null> {
const url = `${backendBaseUrl}/api/v1/countries/names`;
export async function fetchCountriesData(language: string): Promise<Array<Country> | null> {
const url = `${backendBaseUrl}/api/v1/countries/names?language=${language.toUpperCase()}`;
return fetch(url)
.then((response) => response.json())
.then((response: Array<BackendCountry>) => response.map((country: BackendCountry) => ({
Expand Down
4 changes: 2 additions & 2 deletions src/components/downloadCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,11 @@ export default function DownloadCard() {
const selectedCountry = countries.find((country) => country.code === selectedCountryCode);
useEffect(() => {
const fetchData = async () => {
const data = await fetchCountriesData();
const data = await fetchCountriesData(language);
if (data !== null) setCountries(data);
};
fetchData().catch(console.error);
}, []);
}, [language]);

function countryLabel(country: Country) {
return `${countryName(country)} (${country.featureCount})`;
Expand Down
13 changes: 7 additions & 6 deletions src/components/footer.tsx
Original file line number Diff line number Diff line change
@@ -1,22 +1,23 @@
import {
mdiArrowRightBold,
mdiCancel,
mdiMapMarkerPlus, /* mdiAccountGroup, */
mdiMapMarkerPlus,
mdiAccountGroup,
} from "@mdi/js";
import Icon from "@mdi/react";
import React, { FC } from "react";
import { Button, Footer } from "react-bulma-components";
import { useTranslation } from "react-i18next";
import ButtonsType from "../model/buttonsType";
import "./footer.css";
/* import { useAppContext } from "../appContext"; */
/* import { initialModalState, ModalType } from "../model/modal"; */
import { useAppContext } from "../appContext";
import { initialModalState, ModalType } from "../model/modal";

const FooterDiv: FC<FooterDivProps> = ({
startAEDAdding, mobileCancel, showFormMobile, buttonsConfiguration,
}) => {
const { t } = useTranslation();
/* const { setModalState } = useAppContext(); */
const { setModalState } = useAppContext();
const basicButtons = (
<div>
<span className="is-hidden-mobile">
Expand All @@ -43,7 +44,7 @@ const FooterDiv: FC<FooterDivProps> = ({
{t("footer.add")}
</Button>
</span>
{/* <Button
<Button
color="info"
mt={1}
ml={2}
Expand All @@ -52,7 +53,7 @@ const FooterDiv: FC<FooterDivProps> = ({
>
<Icon path={mdiAccountGroup} className="icon mr-2" />
{t("footer.partners")}
</Button> */}
</Button>
</div>
);
const mobileAddAedButtons = (
Expand Down
12 changes: 6 additions & 6 deletions src/components/legend.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,12 @@ export default function MapLegend() {
text: t("access.yes"),
tag: "access=yes",
},
{
key: "permissive",
icon: MarkerPermissive,
text: t("access.permissive"),
tag: "access=permissive",
},
{
key: "customers",
icon: MarkerCustomers,
Expand All @@ -30,12 +36,6 @@ export default function MapLegend() {
text: t("access.private"),
tag: "access=private",
},
{
key: "permissive",
icon: MarkerPermissive,
text: t("access.permissive"),
tag: "access=permissive",
},
{
key: "no",
icon: MarkerNo,
Expand Down
149 changes: 77 additions & 72 deletions src/components/partnersModal.tsx
Original file line number Diff line number Diff line change
@@ -1,91 +1,96 @@
import React, { FC } from "react";
import { useTranslation } from "react-i18next";

interface Partner {
name: string;
person: string | null;
role: string | null;
image: string;
imageHeight: number;
url: string;
}

const PartnersModal: FC<{}> = () => {
const { t } = useTranslation();
const cloudFerro = "CloudFerro";
const partners: Partner[] = [
{
name: "CloudFerro",
person: null,
role: null,
image: "cloudferro_logo-dark.png",
imageHeight: 55,
url: "https://cloudferro.com/",
},
{
name: t("partners.wroclaw_medical_university"),
person: null,
role: t("partners.main_scientific_partner"),
image: "logo-umw.jpg", // TODO: vector logo
imageHeight: 40,
url: "https://www.umw.edu.pl",
},
{
name: t("partners.e_health_centre"),
person: null,
role: null,
image: "logo-cez.png",
imageHeight: 67,
url: "https://cez.gov.pl",
},
{
name: t("partners.warsaw_university_of_technology"),
person: null,
role: null,
image: "logo-pw.png",
imageHeight: 80,
url: "https://pw.edu.pl/",
},
{
name: t("partners.gugik"),
person: "Alicja Kulka",
role: `${t("partners.acting")} ${t("partners.chief_geodesist")}`,
image: "logo-gugik-short.png",
imageHeight: 55,
url: "https://www.gov.pl/web/gugik",
},
];
return (
<>
<section className="modal-card-body has-text-weight-light" id="partners-modal">
<div className="pb-3 pt-5 pl-5 box">
<div className="media">
<div className="media-left">
<figure className="image">
<img
alt={t("partners.gugik")}
src="./img/logo-gugik-short.png"
/>
</figure>
</div>
<div className="media-content">
<a href="http://www.gugik.gov.pl/" rel="noopener noreferrer" target="_blank">
{t("partners.gugik")}
</a>
<p className="is-size-6">
{/* eslint-disable-next-line react/jsx-no-literals */}
<span className="has-text-weight-semibold">Alicja Kulka</span>
</p>
<span
className="has-text-weight-light has-text-grey is-size-6"
>
{t("partners.acting")}
&nbsp;
{t("partners.chief_geodesist")}
</span>
</div>
</div>

<div className="media">
<div className="media-left">
<figure className="image">
<img
// TODO: vector logo
src="./img/logo-umw.jpg"
alt={t("partners.wroclaw_medical_university")}
style={{ height: "40px" }}
/>
</figure>
</div>
<div className="media-content">
<a href="https://www.umw.edu.pl" rel="noopener noreferrer" target="_blank">
{t("partners.wroclaw_medical_university")}
</a>
<p className="is-size-6">
<span className="has-text-weight-light has-text-grey is-size-6">
{t("partners.main_scientific_partner")}
</span>
</p>
</div>
</div>

<div className="media">
<div className="media-left">
<figure className="image">
<img
alt={cloudFerro}
src="./img/cloudferro_logo-dark.png"
style={{ height: "55px" }}
/>
</figure>
</div>
<div className="media-content">
<a href="https://cloudferro.com/" rel="noopener noreferrer" target="_blank">
{cloudFerro}
</a>
{partners.map((partner) => (
<div className="media partner-row">
<div className="media-left">
<figure className="image">
<img
alt={partner.name}
src={`./img/${partner.image}`}
style={{ height: `${partner.imageHeight}px` }}
/>
</figure>
</div>
<div className="media-content">
<a href={partner.url} rel="noopener noreferrer" target="_blank">{partner.name}</a>
{partner.person !== null && (
<p className="is-size-6">
<span className="has-text-weight-semibold">{partner.person}</span>
</p>
)}
{partner.role !== null && (
<div className="has-text-weight-light has-text-grey is-size-6">
{partner.role}
</div>
)}
</div>
</div>
</div>
))}
</div>
</section>
<footer className="modal-card-foot p-2">
<div className="notification is-info is-light">
{t("modal.become_openaedmap_partner")}
&nbsp;
<a
className="has-text-weight-medium"
href="mailto:[email protected]"
>
{t("modal.contact_us")}
</a>
<a className="has-text-weight-medium" href="mailto:[email protected]">{t("modal.contact_us")}</a>
.
</div>
</footer>
Expand Down
5 changes: 5 additions & 0 deletions src/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -81,4 +81,9 @@ a.navbar-item:focus-within, a.navbar-item:hover {

.maplibregl-ctrl-geocoder {
min-width: 300px !important;
}

.partner-row {
flex-wrap: wrap;
align-items: center !important;
}
4 changes: 2 additions & 2 deletions src/marker_icons/marker_permissive.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 7944c9c

Please sign in to comment.