Skip to content

Commit

Permalink
Merge pull request #191 from OpenBracketsCH/development
Browse files Browse the repository at this point in the history
Do not allow setting access=no anymore
  • Loading branch information
elektrolytmangel authored Sep 17, 2024
2 parents 730b024 + 30fa049 commit 6be055f
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 33 deletions.
6 changes: 3 additions & 3 deletions app/app.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"name": "Defikarte.ch",
"slug": "Defikarte-ch",
"owner": "defikarte",
"version": "1.0.39",
"version": "1.0.40",
"orientation": "portrait",
"icon": "./assets/icon.png",
"userInterfaceStyle": "light",
Expand All @@ -16,14 +16,14 @@
"ios": {
"supportsTablet": true,
"bundleIdentifier": "ch.defikarte.app",
"buildNumber": "1.0.39",
"buildNumber": "1.0.40",
"infoPlist": {
"NSLocationWhenInUseUsageDescription": true
}
},
"android": {
"package": "ch.defikarte.app",
"versionCode": 39,
"versionCode": 40,
"permissions": ["ACCESS_COARSE_LOCATION", "ACCESS_FINE_LOCATION"],
"config": {
"googleMaps": {
Expand Down
2 changes: 1 addition & 1 deletion app/src/components/SelectForm.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ const styles = StyleSheet.create({
dropdownMenuStyle: {
backgroundColor: '#E9ECEF',
borderRadius: 5,
height: 235,
maxHeight: 350,
},
dropdownItemStyle: {
width: '100%',
Expand Down
3 changes: 1 addition & 2 deletions app/src/config/createForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,11 +96,10 @@ export default [
type: 'Select',
label: 'access',
placeholder: 'access_placeholder',
options: ['yes', 'no', 'permissive', 'private'],
options: ['yes', 'permissive', 'private'],
infoTitel: 'access_info_titel',
infoText: [
{ titel: 'access_yes_titel', text: 'access_yes_text' },
{ titel: 'access_no_titel', text: 'access_no_text' },
{
titel: 'access_permissive_titel',
text: 'access_permissive_text',
Expand Down
8 changes: 0 additions & 8 deletions app/src/i18n/i18n.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@ const resources = {
not_specified: 'not specified',
access_yes_titel: 'Yes',
access_yes_text: 'The use is generally allowed',
access_no_titel: 'No',
access_no_text: 'No access for the general public. Stronger ban than private.',
access_permissive_titel: 'Permissive',
access_permissive_text: 'The owner tolerates public use. However, the owner can revoke permission at any time.',
access_private_titel: 'Private',
Expand Down Expand Up @@ -103,8 +101,6 @@ const resources = {
not_specified: 'keine Angabe',
access_yes_titel: 'Ja',
access_yes_text: 'Die Benutzung ist allgemein erlaubt',
access_no_titel: 'Nein',
access_no_text: 'Kein Zugang für die breite Öffentlichkeit. Stärkeres Verbot als private.',
access_permissive_titel: 'Eingeschränkt zugänglich',
access_permissive_text:
'Der Eigentümer duldet die öffentliche Benutzung. Die Erlaubnis oder Duldung kann der Eigentümer jedoch jederzeit widerrufen.',
Expand Down Expand Up @@ -183,8 +179,6 @@ const resources = {
not_specified: 'non spécifié',
access_yes_titel: 'Oui',
access_yes_text: "L'utilisation est généralement autorisée",
access_no_titel: 'Non',
access_no_text: "Pas d'accès pour le grand public. Interdiction plus forte que privée.",
access_permissive_titel: 'Accès restreint',
access_permissive_text:
"Le propriétaire tolère l'utilisation publique. Cependant, le propriétaire peut révoquer l'autorisation à tout moment.",
Expand Down Expand Up @@ -263,8 +257,6 @@ const resources = {
not_specified: 'non specificato',
access_yes_titel: 'Sì',
access_yes_text: "L'uso è generalmente consentito",
access_no_titel: 'No',
access_no_text: 'Nessun accesso per il pubblico. Divieto più forte rispetto a privato.',
access_permissive_titel: 'Accesso limitato',
access_permissive_text:
"Il proprietario tollera l'uso pubblico. Tuttavia, il proprietario può revocare l'autorizzazione o la tolleranza in qualsiasi momento.",
Expand Down
18 changes: 9 additions & 9 deletions backend/DefibrillatorFunction.cs
Original file line number Diff line number Diff line change
@@ -1,11 +1,4 @@
using System;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.Net;
using System.Net.Http;
using System.Threading.Tasks;
using System.Web.Http;
using DefikarteBackend.Cache;
using DefikarteBackend.Cache;
using DefikarteBackend.Configuration;
using DefikarteBackend.Model;
using DefikarteBackend.OsmOverpassApi;
Expand All @@ -22,6 +15,13 @@
using OsmSharp;
using OsmSharp.IO.API;
using OsmSharp.Tags;
using System;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.Net;
using System.Net.Http;
using System.Threading.Tasks;
using System.Web.Http;

namespace DefikarteBackend
{
Expand Down Expand Up @@ -169,7 +169,7 @@ private static Node CreateNode(DefibrillatorRequest request)
"operator", request.Operator
},
{
"access", request.Access ? "yes" : "no"
"access", request.Access ? "yes" : null
},
{
"indoor", request.Indoor ? "yes" : "no"
Expand Down
21 changes: 11 additions & 10 deletions backend/DefibrillatorFunctionV2.cs
Original file line number Diff line number Diff line change
@@ -1,11 +1,4 @@
using System;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.Net;
using System.Net.Http;
using System.Threading.Tasks;
using System.Web.Http;
using DefikarteBackend.Cache;
using DefikarteBackend.Cache;
using DefikarteBackend.Configuration;
using DefikarteBackend.Model;
using DefikarteBackend.OsmOverpassApi;
Expand All @@ -22,6 +15,13 @@
using OsmSharp;
using OsmSharp.IO.API;
using OsmSharp.Tags;
using System;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.Net;
using System.Net.Http;
using System.Threading.Tasks;
using System.Web.Http;

namespace DefikarteBackend
{
Expand Down Expand Up @@ -73,7 +73,7 @@ public async Task<IActionResult> GetAll(


[FunctionName("Defibrillators_POST_V2")]
[OpenApiOperation(operationId: "CreateDefibrillator_V2", tags: new[] {"Defibrillator-V2"}, Summary = "Create a new defibrillator.")]
[OpenApiOperation(operationId: "CreateDefibrillator_V2", tags: new[] { "Defibrillator-V2" }, Summary = "Create a new defibrillator.")]
[OpenApiRequestBody("application/json", typeof(DefibrillatorRequestV2))]
[OpenApiResponseWithBody(statusCode: HttpStatusCode.Created, contentType: "application/json", bodyType: typeof(DefibrillatorResponse), Description = "The OK response")]
[OpenApiSecurity("Defikarte.ch API-Key", SecuritySchemeType.ApiKey, In = OpenApiSecurityLocationType.Header, Name = "x-functions-key")]
Expand Down Expand Up @@ -169,7 +169,8 @@ private static Node CreateNode(DefibrillatorRequestV2 request)
"operator", request.Operator
},
{
"access", request.Access
// Ensure no values are not set anymore, i.e. by older versions of the app
"access", request.Access == "no" ? null : request.Access
},
{
"indoor", request.Indoor
Expand Down

0 comments on commit 6be055f

Please sign in to comment.