Skip to content

Commit

Permalink
Merge branch 'main' into 2520-show-number-search-results
Browse files Browse the repository at this point in the history
  • Loading branch information
steffenkleinle authored Nov 14, 2024
2 parents 2f8ab4a + c4538c1 commit 7bc4462
Show file tree
Hide file tree
Showing 107 changed files with 709 additions and 559 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/common/theme/colors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ export type ColorsType = {
positiveHighlight: string
negativeHighlight: string
invalidInput: string
warningColor: string
linkColor: string
themeContrast: string
}
Expand All @@ -31,5 +32,6 @@ export const commonLightColors = {
positiveHighlight: '#188038',
negativeHighlight: '#8b0000',
invalidInput: '#B3261E',
warningColor: '#FFA726',
linkColor: '#0b57d0',
}
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
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
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
4 changes: 2 additions & 2 deletions native/src/__mocks__/react-native-blob-util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ const existsMock = (file: string): Promise<boolean> => {
return Promise.resolve(exists || isParentOfExisting)
}

const lsMock = (path: string): Promise<Array<string>> => {
const lsMock = (path: string): Promise<string[]> => {
const filesInPath = Object.keys(mockFiles).filter(filePath => filePath.startsWith(path))
return Promise.resolve(filesInPath)
}
Expand Down Expand Up @@ -58,7 +58,7 @@ export default {
},
},
fs: {
ls: jest.fn<Promise<Array<string>>, [string]>(lsMock),
ls: jest.fn<Promise<string[]>, [string]>(lsMock),
exists: jest.fn<Promise<boolean>, [string]>(existsMock),
isDir: jest.fn<Promise<boolean>, [string]>(async () => true),
writeFile: jest.fn<Promise<void>, [string, string, string]>(writeMockFile),
Expand Down
2 changes: 1 addition & 1 deletion native/src/components/CitySelector.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ const SearchCounter = styled.Text`
`

type CitySelectorProps = {
cities: Array<CityModel>
cities: CityModel[]
navigateToDashboard: (city: CityModel) => void
}

Expand Down
4 changes: 2 additions & 2 deletions native/src/components/CustomHeaderButtons.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ const onOverflowMenuPress = (cancelButtonLabel: string) => (props: OnOverflowMen

const CustomHeaderButtons = (props: {
cancelLabel: string
items: Array<ReactNode>
overflowItems: Array<ReactNode>
items: ReactNode[]
overflowItems: ReactNode[]
}): ReactElement => {
const { cancelLabel, items, overflowItems } = props
const { t } = useTranslation('common')
Expand Down
8 changes: 4 additions & 4 deletions native/src/components/ExportEventButton.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { DateTime } from 'luxon'
import React, { ReactElement, useState } from 'react'
import { useTranslation } from 'react-i18next'
import { Linking, Platform } from 'react-native'
import { Platform } from 'react-native'
import RNCalendarEvents, { Calendar, CalendarEventWritable, RecurrenceFrequency } from 'react-native-calendar-events'
import { PERMISSIONS, requestMultiple } from 'react-native-permissions'
import { PERMISSIONS, openSettings, requestMultiple } from 'react-native-permissions'
import { Frequency } from 'rrule'
import styled from 'styled-components/native'

Expand Down Expand Up @@ -89,8 +89,8 @@ const ExportEventButton = ({ event }: ExportEventButtonType): ReactElement => {
showSnackbar({
text: 'noCalendarPermission',
positiveAction: {
label: t('settings'),
onPress: Linking.openSettings,
label: t('layout:settings'),
onPress: openSettings,
},
})
return
Expand Down
2 changes: 1 addition & 1 deletion native/src/components/List.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const NoItemsMessage = styled.Text`
`

type ListProps<T> = {
items: Array<T>
items: T[]
noItemsMessage?: ReactElement | string
renderItem: (props: { item: T; index: number }) => ReactElement
Header?: ReactElement
Expand Down
2 changes: 1 addition & 1 deletion native/src/components/NearbyCities.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ const StyledIcon = styled(Icon)`
`

type NearbyCitiesProps = {
cities: Array<CityModel>
cities: CityModel[]
navigateToDashboard: (city: CityModel) => void
filterText: string
}
Expand Down
2 changes: 1 addition & 1 deletion native/src/components/News.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ const getPageTitle = (
return t('localNews.pageTitle')
}

type NewsModelsType = Array<LocalNewsModel | TunewsModel>
type NewsModelsType = (LocalNewsModel | TunewsModel)[]

type NewsProps = {
news: NewsModelsType
Expand Down
2 changes: 1 addition & 1 deletion native/src/components/Note.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { NoteIcon } from '../assets'
import Icon from './base/Icon'

const NoteBox = styled.View`
background-color: ${props => props.theme.colors.themeColor};
background-color: ${props => props.theme.colors.warningColor};
margin-top: 12px;
padding: 12px;
flex-direction: row;
Expand Down
2 changes: 1 addition & 1 deletion native/src/components/Selector.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export const Wrapper = styled.View`
`

type SelectorProps = {
items: Array<SelectorItemModel>
items: SelectorItemModel[]
selectedItemCode: string | null
}

Expand Down
2 changes: 1 addition & 1 deletion native/src/components/SettingItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ const Badge = styled.View<{ enabled: boolean }>`
type SettingItemProps = {
title: string
description?: string
onPress: () => void
onPress: () => Promise<void>
bigTitle?: boolean
role?: Role
hasSwitch?: boolean
Expand Down
2 changes: 1 addition & 1 deletion native/src/components/__tests__/News.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ describe('News', () => {
localNewsEnabled = true,
}: {
newsId?: number | null
data?: Array<LocalNewsModel | TunewsModel>
data?: (LocalNewsModel | TunewsModel)[]
loadingMore?: boolean
selectedNewsType?: TuNewsType | LocalNewsType
tuNewsEnabled?: boolean
Expand Down
4 changes: 2 additions & 2 deletions native/src/constants/NavigationTypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,8 @@ export type RoutesParamsType = {
}
[LICENSES_ROUTE]: undefined
[CHANGE_LANGUAGE_MODAL_ROUTE]: {
languages: Array<LanguageModel>
availableLanguages: Array<string>
languages: LanguageModel[]
availableLanguages: string[]
}
[PDF_VIEW_MODAL_ROUTE]: {
url: string
Expand Down
Loading

0 comments on commit 7bc4462

Please sign in to comment.