Skip to content

Commit

Permalink
Merge branch 'main' into 2577-add-warning-color
Browse files Browse the repository at this point in the history
  • Loading branch information
simomps authored Nov 11, 2024
2 parents 18e1763 + fd18304 commit 50a9194
Show file tree
Hide file tree
Showing 115 changed files with 930 additions and 588 deletions.
12 changes: 11 additions & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -326,6 +326,16 @@ jobs:
paths:
- << parameters.build_config_name >>.apk
root: native/android
- run:
command: mv app/build/outputs/bundle/release/app-release.aab << parameters.build_config_name >>.aab
name: Rename aab
working_directory: native/android
- store_artifacts:
path: native/android/<< parameters.build_config_name >>.aab
- persist_to_workspace:
paths:
- << parameters.build_config_name >>.aab
root: native/android
- unless:
condition:
or:
Expand Down Expand Up @@ -569,7 +579,7 @@ jobs:
name: '[FL] Browserstack Upload Live'
working_directory: native
- run:
command: bundle exec fastlane android playstore_upload build_config_name:<< parameters.build_config_name >> apk_path:attached_workspace/<< parameters.build_config_name >>.apk production_delivery:"<< parameters.production_delivery >>" version_name:${NEW_VERSION_NAME} version_code:${NEW_VERSION_CODE}
command: bundle exec fastlane android playstore_upload build_config_name:<< parameters.build_config_name >> aab_path:attached_workspace/<< parameters.build_config_name >>.aab production_delivery:"<< parameters.production_delivery >>" version_name:${NEW_VERSION_NAME} version_code:${NEW_VERSION_CODE}
name: '[FL] Play Store Upload'
working_directory: native
- notify
Expand Down
10 changes: 10 additions & 0 deletions .circleci/src/jobs/build_android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,16 @@ steps:
root: native/android
paths:
- << parameters.build_config_name >>.apk
- run:
name: Rename aab
command: mv app/build/outputs/bundle/release/app-release.aab << parameters.build_config_name >>.aab
working_directory: native/android
- store_artifacts:
path: native/android/<< parameters.build_config_name >>.aab
- persist_to_workspace:
root: native/android
paths:
- << parameters.build_config_name >>.aab
- unless:
condition:
or:
Expand Down
2 changes: 1 addition & 1 deletion .circleci/src/jobs/deliver_android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,6 @@ steps:
working_directory: native
- run:
name: '[FL] Play Store Upload'
command: bundle exec fastlane android playstore_upload build_config_name:<< parameters.build_config_name >> apk_path:attached_workspace/<< parameters.build_config_name >>.apk production_delivery:"<< parameters.production_delivery >>" version_name:${NEW_VERSION_NAME} version_code:${NEW_VERSION_CODE}
command: bundle exec fastlane android playstore_upload build_config_name:<< parameters.build_config_name >> aab_path:attached_workspace/<< parameters.build_config_name >>.aab production_delivery:"<< parameters.production_delivery >>" version_name:${NEW_VERSION_NAME} version_code:${NEW_VERSION_CODE}
working_directory: native
- notify
6 changes: 6 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,12 @@ module.exports = {
allowNullableString: true,
},
],
'@typescript-eslint/array-type': [
'error',
{
default: 'array',
},
],
'@typescript-eslint/switch-exhaustiveness-check': 'error',
'@typescript-eslint/no-non-null-assertion': 'error',

Expand Down
4 changes: 4 additions & 0 deletions assets/icons/chat-bot.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions assets/icons/chat-person.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions build-configs/BuildConfigType.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,9 @@ export type CommonBuildConfigType = {
// Host name of the web app, used for sharing, deep linking and social media previews.
hostName: string
// Hostnames from which resources are automatically downloaded for offline usage.
allowedHostNames: Array<string>
allowedHostNames: string[]
// Linked hosts that can may look similar https://chromium.googlesource.com/chromium/src/+/master/docs/security/lookalikes/lookalike-domains.md#automated-warning-removal
allowedLookalikes: Array<string>
allowedLookalikes: string[]
// Regex defining which urls to intercept as they are internal ones.
supportedIframeSources: string[]
internalLinksHijackPattern: string
Expand Down
2 changes: 2 additions & 0 deletions build-configs/aschaffenburg/theme/colors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@ import { ColorsType, commonLightColors } from '../../common/theme/colors'

const themeColor = '#009684'
const themeColorLight = 'rgba(0, 150, 132, 0.5)'
const themeContrast = '#1A1A1A'

export const lightColors: ColorsType = {
themeColor,
themeColorLight,
themeContrast,
...commonLightColors,
}
1 change: 1 addition & 0 deletions build-configs/common/theme/colors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ export type ColorsType = {
invalidInput: string
warningColor: string
linkColor: string
themeContrast: string
}
export const commonLightColors = {
backgroundAccentColor: '#fafafa',
Expand Down
2 changes: 2 additions & 0 deletions build-configs/integreat/theme/colors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@ import { ColorsType, commonLightColors } from '../../common/theme/colors'

const themeColor = '#fbda16'
const themeColorLight = 'rgba(251, 218, 22, 0.5)'
const themeContrast = '#000000'

export const lightColors: ColorsType = {
themeColor,
themeColorLight,
themeContrast,
...commonLightColors,
}
2 changes: 2 additions & 0 deletions build-configs/malte/theme/colors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@ import { ColorsType, commonLightColors } from '../../common/theme/colors'

const themeColor = '#ff0000'
const themeColorLight = 'rgba(255, 0, 0, 0.5)'
const themeContrast = '#fff'

export const lightColors: ColorsType = {
themeColor,
themeColorLight,
themeContrast,
...commonLightColors,
}
2 changes: 2 additions & 0 deletions build-configs/obdach/theme/colors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@ import { ColorsType, commonLightColors } from '../../common/theme/colors'

const themeColor = '#E55129'
const themeColorLight = 'rgba(229, 81, 41, 0.5)'
const themeContrast = '#000000'

export const lightColors: ColorsType = {
themeColor,
themeColorLight,
themeContrast,
...commonLightColors,
}
2 changes: 1 addition & 1 deletion e2e-tests/native/test/helpers/Selector.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
export class Selector {
private queries: Array<string> = new Array<string>()
private queries: string[] = new Array<string>()

public ByText(text: string): Selector {
if (driver.isAndroid) {
Expand Down
2 changes: 1 addition & 1 deletion e2e-tests/shared/constants.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
export const filter = 'wirschaffendas'
export const contentSearch = 'language'
export const defaultCity = 'Testumgebung Ende-zu-Ende-Testing'
export const defaultCity = 'E2E-Testumgebung'
export const augsburgCity = 'Stadt Augsburg'
export const language = 'en'

Expand Down
2 changes: 1 addition & 1 deletion e2e-tests/web/wdio.conf.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { browsers, ciCapabilities } from './capabilities.js'
import waitForLocalhost from './waitForLocalhost.js'

const getCapabilities = (): Array<WebdriverIO.Capabilities> => {
const getCapabilities = (): WebdriverIO.Capabilities[] => {
if (process.env.CI) {
return [ciCapabilities]
}
Expand Down
2 changes: 1 addition & 1 deletion native/android/fastlane/Fastfile
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ lane :build do |options|
end

gradle(
task: "assembleRelease",
tasks: ["assembleRelease", "bundleRelease"],
properties: {
:BUILD_CONFIG_NAME => build_config_name,
:VERSION_CODE => version_code,
Expand Down
27 changes: 20 additions & 7 deletions native/docs/manual-builds.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,24 +29,37 @@ found [here](build-configs.md).**
- Install and setup XCode.
- [Install and setup Fastlane](../../docs/cicd.md#fastlane-setup).
- Read about [Apple Certificates](apple-certifcates.md).
- To set up the certificates:
- have access to the `app-credentials` repo
- have access to the Passbolt folder "Integreat App Publishing"
- your personal Apple account needs to be added to the Digitalfabrik's account either as an admin or with the right to
access "Certificates, Identifiers & Profiles".

#### Certificates Setup
If you need any of these permissions, ask for them in the ~team-app channel on Mattermost.

- Prepare the necessary environment variables as
specified [here](../../docs/cicd.md#environment-variables-and-dependencies).
#### Certificates Setup

- Install the certificates locally:

```bash
cd ios && bundle exec fastlane certificates
cd ios && fastlane match development
```

If you want to build for for a different environment than development (e.g. production), put that one in the command.

- If you get an error that you can't clone the repo `app-credentials`, request access.

- The password that you need to fill in twice is saved in Passbolt as Digitalfabrik Fastlane Match.

- The Apple account that you need to sign in to is your personal one.

- You will need to add all the `app_identifiers` you want to work with. You can find a list of them at
https://github.com/digitalfabrik/app-credentials/blob/main/apple%20app%20identifier%20list.txt

##### Trouble Shooting

- [Installing certificates hangs on `Cloning remote git repo...`](troubleshooting.md#bundle-exec-fastlane-certificates-hangs-on-cloning-remote-git-repo)
- Secrets containing `'`: Exporting as environment variable is possible as
follows: `export SECRET='<prefix>'"'"'<suffix>'`.
- 2FA prompt: Message @Max or @Steffen.
- Secrets containing `'`: Exporting as environment variable is possible as follows: `export SECRET='<prefix>'"'"'<suffix>'`.

#### Dependency Management

Expand Down
11 changes: 6 additions & 5 deletions native/fastlane/Fastfile
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,8 @@ platform :android do
# version_code: The version code of the app
# version_name: The version name of the app
# build_config_name: The name of the build config
# apk_path: The path of the apk to upload (relative to home dir)
# production_delivery: Whether the apk should be uploaded to the production track
# aab_path: The path of the aab to upload (relative to home dir)
# production_delivery: Whether the aab should be uploaded to the production track
desc "Deliver the app to Play Store. Depending on the option `production_delivery` the update is released to the general public."
lane :playstore_upload do |options|
ensure_env_vars(
Expand All @@ -77,10 +77,10 @@ platform :android do
version_code = options[:version_code]
version_name = options[:version_name]
build_config_name = options[:build_config_name]
apk_path = options[:apk_path]
aab_path = options[:aab_path]
production_delivery = options[:production_delivery]

if [version_name, version_code, build_config_name, apk_path, production_delivery].include?(nil)
if [version_name, version_code, build_config_name, aab_path, production_delivery].include?(nil)
raise "'nil' passed as parameter! Aborting..."
end

Expand All @@ -102,7 +102,7 @@ platform :android do
skip_upload_screenshots: skip_images,
skip_upload_metadata: false,
release_status: "completed",
apk: "#{ENV['HOME']}/#{apk_path}",
aab: "#{ENV['HOME']}/#{aab_path}",
json_key_data: ENV["GOOGLE_SERVICE_ACCOUNT_JSON"]
)
end
Expand Down Expand Up @@ -153,6 +153,7 @@ platform :android do
skip_upload_screenshots: true,
skip_upload_metadata: true,
skip_upload_apk: true,
skip_upload_aab: true,
release_status: "completed",
json_key_data: ENV["GOOGLE_SERVICE_ACCOUNT_JSON"]
)
Expand Down
31 changes: 14 additions & 17 deletions native/ios/fastlane/README.md
Original file line number Diff line number Diff line change
@@ -1,41 +1,38 @@
# fastlane documentation
fastlane documentation
----

# Installation

Make sure you have the latest version of the Xcode command line tools installed:

```
```sh
xcode-select --install
```

Install _fastlane_ using

```
[sudo] gem install fastlane -NV
```

or alternatively using `brew install fastlane`
For _fastlane_ installation instructions, see [Installing _fastlane_](https://docs.fastlane.tools/#installing-fastlane)

# Available Actions

### certificates

```
fastlane certificates
```sh
[bundle exec] fastlane certificates
```

Download and setup certificates

### build

```
fastlane build
```sh
[bundle exec] fastlane build
```

Create a release build

---
----

This README.md is auto-generated and will be re-generated every time [_fastlane_](https://fastlane.tools) is run.

More information about _fastlane_ can be found on [fastlane.tools](https://fastlane.tools).

This README.md is auto-generated and will be re-generated every time [fastlane](https://fastlane.tools) is run.
More information about fastlane can be found on [fastlane.tools](https://fastlane.tools).
The documentation of fastlane can be found on [docs.fastlane.tools](https://docs.fastlane.tools).
The documentation of _fastlane_ can be found on [docs.fastlane.tools](https://docs.fastlane.tools).
4 changes: 2 additions & 2 deletions native/run
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ program
.option('--production', 'whether a production (release) build should be made')
.action((buildConfigName, options) => {
const { production } = options
const productionFlag = production ? '--mode=release' : ''
const buildFlag = production ? '--mode=release' : '--active-arch-only'

const jsonBuildConfig = execSync(
`yarn workspace --silent build-configs --silent manage to-json ${buildConfigName} android`,
Expand All @@ -34,7 +34,7 @@ program
.toString()
.replaceAll('\n', ' ')
execSync(
`yarn cross-env ${buildConfig} yarn react-native run-android --no-packager --appId ${applicationId} ${productionFlag}`,
`yarn cross-env ${buildConfig} yarn react-native run-android --no-packager --appId ${applicationId} ${buildFlag}`,
{ stdio: 'inherit' },
)
})
Expand Down
7 changes: 4 additions & 3 deletions native/src/Navigator.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -88,16 +88,17 @@ const Stack = createStackNavigator<RoutesParamsType>()

const Navigator = (): ReactElement | null => {
const showSnackbar = useSnackbar()
const { settings, cityCode, changeCityCode, languageCode, updateSettings } = useAppContext()
const appContext = useAppContext()
const { settings, cityCode, changeCityCode, updateSettings } = appContext
const navigation = useNavigation<NavigationProps<RoutesType>>()
const [initialRoute, setInitialRoute] = useState<InitialRouteType>(null)

// Preload cities
const { data: cities, error: citiesError, refresh: refreshCities } = useLoadCities()

useEffect(() => {
initialPushNotificationRequest(cityCode, languageCode).catch(reportError)
}, [cityCode, languageCode])
initialPushNotificationRequest(appContext).catch(reportError)
}, [appContext])

useForegroundPushNotificationListener({ showSnackbar, navigate: navigation.navigate })

Expand Down
Loading

0 comments on commit 50a9194

Please sign in to comment.