Skip to content

Commit

Permalink
Merge pull request #151 from r00tat/enhancement/rename-app
Browse files Browse the repository at this point in the history
Prepare 2.0 release
  • Loading branch information
r00tat authored Sep 28, 2024
2 parents 0cdd06b + eb0f77a commit b0d93d4
Show file tree
Hide file tree
Showing 14 changed files with 78 additions and 43 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Hydrantenkarte der Freiwilligen Feuerwehr Neusiedl am See
# Einsatzkarte der Freiwilligen Feuerwehr Neusiedl am See

Dieses Repository ermöglicht es Hydranten auf einer Karte darzustellen. Ziel ist es möglichst leicht im Einsatzfall Hydranten lokalisieren zu können.

Expand Down
8 changes: 4 additions & 4 deletions firebase.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
"firestore": [
{
"database": "(default)",
"rules": "firestore.rules",
"indexes": "firestore.indexes.json"
"rules": "firebase/prod/firestore.rules",
"indexes": "firebase/prod/firestore.indexes.json"
},
{
"database": "ffndev",
"rules": "firestore.dev.rules",
"indexes": "firestore.indexes.dev.json"
"rules": "firebase/dev/firestore.rules",
"indexes": "firebase/dev/firestore.indexes.json"
}
]
}
File renamed without changes.
File renamed without changes.
51 changes: 51 additions & 0 deletions firebase/prod/firestore.indexes.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
{
"indexes": [
{
"collectionGroup": "call",
"queryScope": "COLLECTION",
"fields": [
{
"fieldPath": "deleted",
"order": "ASCENDING"
},
{
"fieldPath": "date",
"order": "DESCENDING"
}
]
},
{
"collectionGroup": "call",
"queryScope": "COLLECTION",
"fields": [
{
"fieldPath": "group",
"order": "ASCENDING"
},
{
"fieldPath": "date",
"order": "DESCENDING"
}
]
},
{
"collectionGroup": "call",
"queryScope": "COLLECTION",
"fields": [
{
"fieldPath": "deleted",
"order": "ASCENDING"
},
{
"fieldPath": "group",
"order": "ASCENDING"
},
{
"fieldPath": "date",
"order": "DESCENDING"
}
]
}
],
"fieldOverrides": []
}
11 changes: 4 additions & 7 deletions firestore.rules → firebase/prod/firestore.rules
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ service cloud.firestore {

function adminUser() {
return request.auth != null &&
get(/databases/$(database)/documents/user/$(request.auth.uid)).data.isAdmin == true;
get(/databases/$(database)/documents/user/$(request.auth.uid)).data.isAdmin == true;
}

match /hydrant/{doc=*} {
Expand All @@ -32,7 +32,8 @@ service cloud.firestore {
}

match /call/{doc=**} {
allow read, write: if authorizedUser()
allow read, write: if authorizedUser()
&& resource.data.group in get(/databases/$(database)/documents/user/$(request.auth.uid)).data.groups
}

match /clusters/{doc=**} {
Expand All @@ -41,6 +42,7 @@ service cloud.firestore {

match /clusters6/{doc=**} {
allow read: if authorizedUser();
allow write: if adminUser();
}

match /tokens/{doc=**} {
Expand All @@ -49,14 +51,9 @@ service cloud.firestore {
allow write: if authorizedUser() && request.auth.uid == request.resource.data.owner;
}


match /user/{doc=*} {
allow read: if request.auth != null && request.auth.uid == doc
}
match /clusters6/{doc=**} {
allow read: if authorizedUser();
allow write: if adminUser();
}

match /{document=**} {
allow read, write: if adminUser();
Expand Down
19 changes: 0 additions & 19 deletions firestore.indexes.json

This file was deleted.

8 changes: 4 additions & 4 deletions src/app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import AppProviders from '../components/providers/AppProviders';
import '../styles/globals.css';
import 'leaflet/dist/leaflet.css';

const APP_NAME = 'Hydrantenkarte FFN';
const APP_DEFAULT_TITLE = 'Hydrantenkarte FFN';
const APP_NAME = 'Einsatzkarte FFN';
const APP_DEFAULT_TITLE = 'Einsatzkarte FFN';
const APP_TITLE_TEMPLATE = '%s - PWA App';
const APP_DESCRIPTION = 'Hydraten und Einsatzkarte der FF Neusiedl am See';

Expand Down Expand Up @@ -60,10 +60,10 @@ export default function RootLayout({
return (
<html lang="de">
<head>
<title>Hydrantenkarte</title>
<title>Einsatzkarte</title>
<meta
name="description"
content="Hydrantenkarte der Freiwilligen Feuerwehr Neusiedl am See"
content="Einsatzkarte der Freiwilligen Feuerwehr Neusiedl am See"
/>
<link rel="icon" href="/favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
Expand Down
4 changes: 2 additions & 2 deletions src/app/manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"$schema": "https://json.schemastore.org/web-manifest-combined.json",
"name": "Hydrantenkarte FFN",
"short_name": "Hydrantenkarte",
"name": "Einsatzkarte FFN",
"short_name": "Einsatzkarte",
"theme_color": "#1976d2",
"background_color": "#ffffff",
"display": "standalone",
Expand Down
6 changes: 5 additions & 1 deletion src/components/Map/Map.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,11 @@ export default function Map() {
{Object.entries(overlayLayers)
.filter(([key, layer]) => (layer.type || 'WTMS') == 'WTMS')
.map(([key, layer]) => (
<LayersControl.Overlay name={layer.name} key={key}>
<LayersControl.Overlay
name={layer.name}
key={key}
checked={layer.enabled}
>
<TileLayer
attribution={layer.options.attribution}
url={layer.url}
Expand Down
2 changes: 2 additions & 0 deletions src/components/Map/tiles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ export interface TileConfig {
options: TileOptions;
description?: string;
type?: 'WMTS' | 'WMS';
enabled?: boolean;
}

export interface TileConfigs {
Expand Down Expand Up @@ -111,6 +112,7 @@ export const overlayLayers: TileConfigs = {
[49.037872, 17.189532],
],
},
enabled: true,
},

oberflaechenwasser: {
Expand Down
2 changes: 1 addition & 1 deletion src/components/actions/maps/places.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export async function searchPlace(
// console.info(`uri: ${uri}`);
const result = await fetch(uri, {
headers: {
'User-Agent': 'Hydrantenkarte https://hydrant.ffnd.at',
'User-Agent': 'Einsatzkarte https://hydrant.ffnd.at',
Accept: 'application/json',
},
});
Expand Down
6 changes: 3 additions & 3 deletions src/components/pages/LoginUi.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export default function LoginUi() {
<>
<Paper sx={{ p: 2, m: 2 }}>
<Typography>
Für die Nutzung der Hydrantenkarte ist eine Anmeldung und manuelle
Für die Nutzung der Einsatzkarte ist eine Anmeldung und manuelle
Freischaltung erforderlich. Bitte registriere dich hier.
</Typography>
<StyledLoginButton firebaseAuth={auth} />
Expand Down Expand Up @@ -61,7 +61,7 @@ export default function LoginUi() {
</Typography>
<Typography>
<Link href="/" passHref legacyBehavior>
<Button variant="outlined">Weiter zur Hydrantenkarte</Button>
<Button variant="outlined">Weiter zur Einsatzkarte</Button>
</Link>
</Typography>
</>
Expand All @@ -70,7 +70,7 @@ export default function LoginUi() {
<Typography>
Dein Benutzer wurde erfolgreich angemeldet, ist aber noch nicht
freigeschalten. Bitte wende dich an{' '}
<a href="mailto:hydrantenmap@ff-neusiedlamsee.at&amp;subject=Hydrantenkarte Freischaltung">
<a href="mailto:hydrantenmap@ff-neusiedlamsee.at&amp;subject=Einsatzkarte Freischaltung">
hydrantenmap@ff-neusiedlamsee.at
</a>{' '}
für die Freischaltung
Expand Down
2 changes: 1 addition & 1 deletion src/components/site/HeaderBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ function HeaderBar({
<MenuIcon />
</IconButton>
<Typography variant="h6" component="div" sx={{ flexGrow: 1 }}>
Hydrantenkarte {firecall?.name || ''}
Einsatzkarte {firecall?.name || ''}
{!isSignedIn && 'Anmeldung erforderlich'}
{isSignedIn && !isAuthorized && 'Freischaltung erforderlich'}
</Typography>
Expand Down

0 comments on commit b0d93d4

Please sign in to comment.