Skip to content

Commit

Permalink
Merge pull request #214 from kartevonmorgen/develop
Browse files Browse the repository at this point in the history
handle broken configs
  • Loading branch information
navid-kalaei authored Jul 9, 2024
2 parents 910d736 + 9cc30c4 commit 6cb0316
Show file tree
Hide file tree
Showing 18 changed files with 174 additions and 104 deletions.
33 changes: 28 additions & 5 deletions components/EntryDetail.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { useRouter } from 'next/router'
import { useDispatch } from 'react-redux'
import isString from 'lodash/isString'
import isArray from 'lodash/isArray'
import { Divider, Spin, Typography } from 'antd'
import { Divider, Spin, Typography, Button } from 'antd'
import { useUnmount, useMount } from 'ahooks'
import useRequest from '../api/useRequest'
import { EntryRequest } from '../dtos/EntryRequest'
Expand All @@ -28,9 +28,10 @@ import { PartialLatLng } from '../utils/geolocation'
import useFly from '../hooks/useFly'
import EntityRouteLink from './EntityRouteLink'
import { entityDetailActions, viewActions } from '../slices'
import useTranslation from 'next-translate/useTranslation'


const { Title } = Typography
const { Title, Paragraph, Text } = Typography


interface EntryDetailProps {
Expand All @@ -50,6 +51,8 @@ const EntryDetail: FC<EntryDetailProps> = (props) => {
const router = useRouter()
const { query } = router

const { t } = useTranslation('map')

const currentUrl = window.location.href

const { orgTag: optionalOrgTag } = query
Expand Down Expand Up @@ -100,7 +103,29 @@ const EntryDetail: FC<EntryDetailProps> = (props) => {

if (!foundEntry) {
// todo: show not found notification, redirect to the search view
return null
return (
<div
style={{
display: 'flex',
justifyContent: 'center',
alignItems: 'center',
height: '100vh',
flexDirection: 'column',
textAlign: 'center',

}}
>
<Paragraph>{t('entryDetails.notFound')}</Paragraph>

<Paragraph>
<Text>{t('entryDetails.approvalRequired')}</Text>
<br />
<Text>{t('entryDetails.entryIsInvisibleBeforeApprovement')}</Text>
</Paragraph>

<Button type="primary">{t('backToSearch')}</Button>
</div>
)
}

if (!entry) {
Expand All @@ -111,8 +136,6 @@ const EntryDetail: FC<EntryDetailProps> = (props) => {
const type: Category = entry.categories[0]
const typeName: string = CategoryToNameMapper[type]

console.log(entry.image_url)

return (
<div id='entity-detail'>
<EntityDetailHeader hasImage={entry.image_url !== undefined && entry.image_url !== null}/>
Expand Down
7 changes: 1 addition & 6 deletions components/EventDetail.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -76,12 +76,7 @@ const EventDetail: FC<EventDetailProps> = (props) => {


return (
<div
id="entity-detail"
style={{
position: 'relative',
}}
>
<div id="entity-detail">

<EntityDetailHeader hasImage={event.image_url !== undefined && event.image_url !== null}/>

Expand Down
6 changes: 4 additions & 2 deletions components/Sidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,16 @@ import SidebarCollapseButton from './SidebarCollapseButton'
import {convertQueryParamToString} from '../utils/utils'
import {isSidebarStatusShown} from '../dtos/SidebarStatus'
import {useSidebar} from '../hooks/useResponsive'
import { closeSidebar } from './SidebarCollapseButton'


interface SidebarProps {
title: String
title: string
}


const Sidebar: FC<SidebarProps> = (props) => {
const { title } = props

const ClientDrawer = useMemo(() => dynamic(
() => Promise.resolve(Drawer),
{
Expand Down Expand Up @@ -65,6 +66,7 @@ const Sidebar: FC<SidebarProps> = (props) => {
display: 'block'
}
}}
title={title.length !== 0 ? title : undefined}
>
<SidebarCollapseButton />
{isSidebarOpen && (
Expand Down
2 changes: 1 addition & 1 deletion consts/version.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const version = 'v1.2.6'
const version = 'v1.2.7'


export default version
8 changes: 6 additions & 2 deletions locales/be/map.json
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,10 @@
"telephone": "Зарэгістравацца па тэл.",
"homepage": "Зарэгістравацца онлайн"
},
"route": "Маршрут"
"route": "Маршрут",
"notFound": "Entry not found or needs approval",
"approvalRequired": "The approval is required for the organizational tags",
"entryIsInvisibleBeforeApprovement": "The entry remains invisible before approvement"
},
"login": {
"requiredField": "абавязковае поле",
Expand Down Expand Up @@ -357,5 +360,6 @@
"mapColorMode": {
"colorful": "Colorful",
"grey": "Grey"
}
},
"backToSearch": "Back to the search results"
}
22 changes: 19 additions & 3 deletions locales/de/map.json
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,10 @@
"telephone": "Anmeldung telefonisch",
"homepage": "Anmeldung online"
},
"route": "Route"
"route": "Route",
"notFound": "Entry not found or needs approval",
"approvalRequired": "The approval is required for the organizational tags",
"entryIsInvisibleBeforeApprovement": "The entry remains invisible before approvement"
},
"login": {
"requiredField": "Pflichtangabe",
Expand Down Expand Up @@ -208,7 +211,19 @@
"edit": "ändern",
"unsubscribe": "Abonnement abbestellen",
"back": "abbrechen",
"subscribe": "abonnieren"
"subscribe": "abonnieren",
"frequencies": {
"frequency": "Frequency",
"hour": "Hour",
"day": "Day",
"week": "Week"
},
"changeType": {
"type": "Type",
"new": "New",
"all": "All"
},
"subscriptionName": "Subscription Name"
},
"search-results": {
"cities": "Städte",
Expand Down Expand Up @@ -357,5 +372,6 @@
"mapColorMode": {
"colorful": "Farbig",
"grey": "Grau"
}
},
"backToSearch": "Back to the search results"
}
24 changes: 20 additions & 4 deletions locales/en/map.json
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,10 @@
"telephone": "Register by phone",
"homepage": "Register online"
},
"route": "Route"
"route": "Route",
"notFound": "Entry not found or needs approval",
"approvalRequired": "The approval is required for the organizational tags",
"entryIsInvisibleBeforeApprovement": "The entry remains invisible before approvement"
},
"login": {
"requiredField": "required field",
Expand Down Expand Up @@ -207,8 +210,20 @@
"cancel": "cancel",
"edit": "edit",
"unsubscribe": "unsubscribe",
"back": "cancel",
"subscribe": "subscribe"
"back": "Cancel",
"subscribe": "Subscribe",
"frequencies": {
"frequency": "Frequency",
"hour": "Hour",
"day": "Day",
"week": "Week"
},
"changeType": {
"type": "Type",
"new": "New",
"all": "All"
},
"subscriptionName": "Subscription Name"
},
"search-results": {
"cities": "cities",
Expand Down Expand Up @@ -358,5 +373,6 @@
"mapColorMode": {
"colorful": "Colorful",
"grey": "Grey"
}
},
"backToSearch": "Back to the search results"
}
8 changes: 6 additions & 2 deletions locales/es/map.json
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,10 @@
"telephone": "Registro por teléfono",
"homepage": "Registro en línea"
},
"route": "Ruta"
"route": "Ruta",
"notFound": "Entry not found or needs approval",
"approvalRequired": "The approval is required for the organizational tags",
"entryIsInvisibleBeforeApprovement": "The entry remains invisible before approvement"
},
"login": {
"requiredField": "información requerida",
Expand Down Expand Up @@ -357,5 +360,6 @@
"mapColorMode": {
"colorful": "Colorido",
"grey": "Gris"
}
},
"backToSearch": "Back to the search results"
}
8 changes: 6 additions & 2 deletions locales/fr/map.json
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,10 @@
"telephone": "Register by phone",
"homepage": "Register online"
},
"route": "Route"
"route": "Route",
"notFound": "Entry not found or needs approval",
"approvalRequired": "The approval is required for the organizational tags",
"entryIsInvisibleBeforeApprovement": "The entry remains invisible before approvement"
},
"login": {
"requiredField": "required field",
Expand Down Expand Up @@ -358,5 +361,6 @@
"mapColorMode": {
"colorful": "Colorée",
"grey": "Gris"
}
},
"backToSearch": "Back to the search results"
}
8 changes: 6 additions & 2 deletions locales/it/map.json
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,10 @@
"telephone": "Register by phone",
"homepage": "Register online"
},
"route": "Route"
"route": "Route",
"notFound": "Entry not found or needs approval",
"approvalRequired": "The approval is required for the organizational tags",
"entryIsInvisibleBeforeApprovement": "The entry remains invisible before approvement"
},
"login": {
"requiredField": "required field",
Expand Down Expand Up @@ -358,5 +361,6 @@
"mapColorMode": {
"colorful": "Colorful",
"grey": "Grey"
}
},
"backToSearch": "Back to the search results"
}
8 changes: 6 additions & 2 deletions locales/nl/map.json
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,10 @@
"telephone": "Register by phone",
"homepage": "Register online"
},
"route": "Route"
"route": "Route",
"notFound": "Entry not found or needs approval",
"approvalRequired": "The approval is required for the organizational tags",
"entryIsInvisibleBeforeApprovement": "The entry remains invisible before approvement"
},
"login": {
"requiredField": "required field",
Expand Down Expand Up @@ -358,5 +361,6 @@
"mapColorMode": {
"colorful": "Colorful",
"grey": "Grey"
}
},
"backToSearch": "Back to the search results"
}
8 changes: 6 additions & 2 deletions locales/pt/map.json
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,10 @@
"telephone": "Registrar por telefone",
"homepage": "Registo online"
},
"route": "Rota"
"route": "Rota",
"notFound": "Entry not found or needs approval",
"approvalRequired": "The approval is required for the organizational tags",
"entryIsInvisibleBeforeApprovement": "The entry remains invisible before approvement"
},
"login": {
"requiredField": "Campo obrigatório",
Expand Down Expand Up @@ -357,5 +360,6 @@
"mapColorMode": {
"colorful": "Colorido",
"grey": "Cinza"
}
},
"backToSearch": "Back to the search results"
}
8 changes: 6 additions & 2 deletions locales/ru/map.json
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,10 @@
"telephone": "Зарегистрируйтесь по телефону",
"homepage": "Зарегистрируйтесь онлайн"
},
"route": "Маршрут"
"route": "Маршрут",
"notFound": "Entry not found or needs approval",
"approvalRequired": "The approval is required for the organizational tags",
"entryIsInvisibleBeforeApprovement": "The entry remains invisible before approvement"
},
"login": {
"requiredField": "Обязательное поле",
Expand Down Expand Up @@ -357,5 +360,6 @@
"mapColorMode": {
"colorful": "Colorful",
"grey": "Grey"
}
},
"backToSearch": "Back to the search results"
}
8 changes: 6 additions & 2 deletions locales/uk/map.json
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,10 @@
"telephone": "Register by phone",
"homepage": "Register online"
},
"route": "Route"
"route": "Route",
"notFound": "Entry not found or needs approval",
"approvalRequired": "The approval is required for the organizational tags",
"entryIsInvisibleBeforeApprovement": "The entry remains invisible before approvement"
},
"login": {
"requiredField": "required field",
Expand Down Expand Up @@ -357,5 +360,6 @@
"mapColorMode": {
"colorful": "Барвистість",
"grey": "Сірий"
}
},
"backToSearch": "Back to the search results"
}
Loading

0 comments on commit 6cb0316

Please sign in to comment.