Skip to content

Commit

Permalink
Merge pull request #1793 from digitalfabrik/1792-application-url-depe…
Browse files Browse the repository at this point in the history
…nds-environment

1792: Application url depends environment
  • Loading branch information
f1sh1918 authored Nov 20, 2024
2 parents 6f91edf + 538a7e9 commit 3bf6e79
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 7 deletions.
12 changes: 10 additions & 2 deletions frontend/build-configs/bayern/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
import { ACTIVATION_PATH, BAYERN_PRODUCTION_ID, BAYERN_STAGING_ID } from "../constants"
import {
ACTIVATION_PATH,
BAYERN_PRODUCTION_ID,
BAYERN_STAGING_ID,
} from '../constants'
import BuildConfigType, { CommonBuildConfigType } from "../types"
import disclaimerText from "./disclaimerText"
import publisherText from "./publisherText"
Expand Down Expand Up @@ -72,7 +76,11 @@ export const bayernCommon: CommonBuildConfigType = {
verification: true,
favorites: false,
},
applicationUrl: "https://bayern.ehrenamtskarte.app/beantragen",
applicationUrl: {
production: `https://${BAYERN_PRODUCTION_ID}/beantragen`,
staging: `https://${BAYERN_STAGING_ID}/beantragen`,
local : 'http://localhost:3000/beantragen'
},
dataPrivacyPolicyUrl: "https://bayern.ehrenamtskarte.app/data-privacy-policy",
publisherAddress:
"Bayerisches Staatsministerium\nfür Familie, Arbeit und Soziales\nWinzererstraße 9\n80797 München",
Expand Down
6 changes: 5 additions & 1 deletion frontend/build-configs/koblenz/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,11 @@ export const koblenzCommon: CommonBuildConfigType = {
verification: true,
favorites: false,
},
applicationUrl: "https://koblenz.sozialpass.app/erstellen",
applicationUrl: {
production: `https://${KOBLENZ_PRODUCTION_ID}/erstellen`,
staging: `https://${KOBLENZ_STAGING_ID}/erstellen`,
local : 'http://localhost:3000/erstellen'
},
dataPrivacyPolicyUrl: "https://koblenz.sozialpass.app/data-privacy-policy",
publisherAddress: "Stadt Koblenz\nWilli-Hörter-Platz 1\n56068 Koblenz",
publisherText,
Expand Down
12 changes: 10 additions & 2 deletions frontend/build-configs/nuernberg/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
import { ACTIVATION_PATH, NUERNBERG_PRODUCTION_ID, NUERNBERG_STAGING_ID } from "../constants"
import {
ACTIVATION_PATH,
NUERNBERG_PRODUCTION_ID,
NUERNBERG_STAGING_ID
} from '../constants'
import BuildConfigType, { CommonBuildConfigType } from "../types"
import disclaimerText from "./disclaimerText"
import publisherText from "./publisherText"
Expand Down Expand Up @@ -72,7 +76,11 @@ export const nuernbergCommon: CommonBuildConfigType = {
verification: true,
favorites: false,
},
applicationUrl: "https://beantragen.nuernberg.sozialpass.app",
applicationUrl: {
production: 'https://beantragen.nuernberg.sozialpass.app',
staging: 'https://beantragen.nuernberg.sozialpass.app',
local : 'https://beantragen.nuernberg.sozialpass.app'
},
publisherAddress:
"Stadt Nürnberg\nAmt für Existenzsicherung\nund soziale Integration - Sozialamt\nDietzstraße 4\n90443 Nürnberg",
dataPrivacyPolicyUrl: "https://nuernberg.sozialpass.app/data-privacy-policy",
Expand Down
6 changes: 5 additions & 1 deletion frontend/build-configs/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,11 @@ export type CommonBuildConfigType = {
theme: ThemeType
categories: number[]
featureFlags: FeatureFlagsType
applicationUrl: string
applicationUrl: {
staging: string
production: string
local: string
}
dataPrivacyPolicyUrl: string
publisherAddress: string
publisherText: string
Expand Down
9 changes: 8 additions & 1 deletion frontend/lib/identification/identification_page.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import 'package:carousel_slider/carousel_controller.dart';
import 'package:ehrenamtskarte/build_config/build_config.dart' show buildConfig;
import 'package:ehrenamtskarte/configuration/definitions.dart';
import 'package:ehrenamtskarte/configuration/settings_model.dart';
import 'package:ehrenamtskarte/identification/activation_workflow/activation_code_scanner_page.dart';
import 'package:ehrenamtskarte/identification/card_detail_view/card_carousel.dart';
Expand Down Expand Up @@ -103,8 +104,14 @@ class IdentificationPageState extends State<IdentificationPage> {
}

Future<bool> _startApplication() {
final isStagingEnabled = Provider.of<SettingsModel>(context, listen: false).enableStaging;
final applicationUrl = isStagingEnabled
? buildConfig.applicationUrl.staging
: isProduction()
? buildConfig.applicationUrl.production
: buildConfig.applicationUrl.local;
return launchUrlString(
buildConfig.applicationUrl,
applicationUrl,
mode: LaunchMode.externalApplication,
);
}
Expand Down

0 comments on commit 3bf6e79

Please sign in to comment.