Skip to content

Commit ce3aa0d

Browse files
Merge branch 'master' into refactor/answer-list-parser
2 parents fed27f5 + 7bbf8d1 commit ce3aa0d

File tree

68 files changed

+1341
-679
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

68 files changed

+1341
-679
lines changed

.firebaserc

-45
This file was deleted.

.github/workflows/reusable-android-build.yml

+2-20
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@
1010
# Configuration
1111
##################################################################################
1212
env:
13-
APP_ID: ${{vars.APP_ID}}
14-
APP_NAME: ${{vars.APP_NAME}}
1513
DEPLOYMENT_NAME: ${{vars.DEPLOYMENT_NAME}}
1614
APP_CODE_BRANCH: ${{vars.APP_CODE_BRANCH}}
1715
PARENT_DEPLOYMENT_REPO: ${{vars.PARENT_DEPLOYMENT_REPO}}
@@ -102,24 +100,8 @@ jobs:
102100
- name: Set deployment
103101
run: yarn workflow deployment set $DEPLOYMENT_NAME --skip-refresh
104102

105-
- name: Populate android assets
106-
run: yarn workflow populate_android_assets
107-
108-
- name: Update config names in android files
109-
run: |
110-
sed -i -e "s/international.idems.plh_teens/$APP_ID/g" -e "s/PLH Teens/$APP_NAME/g" ./capacitor.config.ts ./android/app/src/main/assets/capacitor.config.json ./android/app/src/main/res/values/strings.xml ./android/app/src/main/AndroidManifest.xml ./android/app/src/main/java/international/idems/plh_teens/MainActivity.java ./android/app/build.gradle
111-
112-
- name: Add version number to build.gradle
113-
run: |
114-
# Define the path to the file
115-
FILE_PATH="./.idems_app/deployments/${{env.DEPLOYMENT_NAME}}/config.ts"
116-
117-
# Extract the version number
118-
VERSION=$(grep 'content_tag_latest:' $FILE_PATH | sed 's/content_tag_latest: *"\(.*\)",/\1/')
119-
echo "Extracted Version: $VERSION"
120-
121-
# Run versioning script
122-
yarn run version $VERSION --android
103+
- name: Prepare android configuration
104+
run: yarn workflow android
123105

124106
- name: Download Build Artifact
125107
uses: actions/download-artifact@v3

.github/workflows/reusable-app-build.yml

-13
Original file line numberDiff line numberDiff line change
@@ -75,24 +75,11 @@ jobs:
7575
ref: ${{inputs.branch}}
7676
path: ".idems_app/deployments/${{env.DEPLOYMENT_NAME}}"
7777
fetch-depth: 0
78-
79-
- name: Update version number
80-
run: |
81-
# Define the path to the file
82-
FILE_PATH="./.idems_app/deployments/${{env.DEPLOYMENT_NAME}}/config.ts"
83-
84-
# Extract the version number
85-
VERSION=$(grep 'content_tag_latest:' $FILE_PATH | sed 's/content_tag_latest: *"\(.*\)",/\1/')
86-
echo "Extracted Version: $VERSION"
8778

8879
- name: Populate Encryption key
8980
if: env.DEPLOYMENT_PRIVATE_KEY != ''
9081
run: echo "${{env.DEPLOYMENT_PRIVATE_KEY}}" > ./.idems_app/deployments/${{env.DEPLOYMENT_NAME}}/encrypted/private.key
9182

92-
- name: Populate Firebase Config
93-
if: env.FIREBASE_CONFIG != ''
94-
run: echo 'export const firebaseConfig = ${{env.FIREBASE_CONFIG}}' > src/environments/firebaseConfig.ts
95-
9683
- name: Setup Node
9784
uses: actions/setup-node@v3
9885
with:

.github/workflows/reusable-content-sync.yml

+2-33
Original file line numberDiff line numberDiff line change
@@ -72,10 +72,6 @@ jobs:
7272
if: env.DEPLOYMENT_PRIVATE_KEY != ''
7373
run: echo "${{env.DEPLOYMENT_PRIVATE_KEY}}" > ./.idems_app/deployments/${{env.DEPLOYMENT_NAME}}/encrypted/private.key
7474

75-
# TODO - populate firebase as part of deployment set
76-
- name: Populate Firebase Config
77-
if: env.FIREBASE_CONFIG != ''
78-
run: echo 'export const firebaseConfig = ${{env.FIREBASE_CONFIG}}' > src/environments/firebaseConfig.ts
7975
- name: Setup Node
8076
uses: actions/setup-node@v3
8177
with:
@@ -109,35 +105,8 @@ jobs:
109105
run: yarn workflow sync
110106

111107
- name: Increment version number
112-
run: |
113-
# Define the path to the file
114-
FILE_PATH="./.idems_app/deployments/${{env.DEPLOYMENT_NAME}}/config.ts"
115-
116-
# Extract the version number
117-
VERSION=$(grep 'content_tag_latest:' $FILE_PATH | sed 's/content_tag_latest: *"\(.*\)",/\1/')
118-
echo "Extracted Version: $VERSION"
119-
120-
# Split the version into major, minor, and patch components
121-
IFS='.' read -ra VERSION_PARTS <<< "$VERSION"
122-
123-
if [[ ${#VERSION_PARTS[@]} -ne 3 ]]; then
124-
echo "Error: Version format is not as expected."
125-
exit 1
126-
fi
127-
128-
PATCH_VERSION="${VERSION_PARTS[2]}"
129-
130-
# Increment the patch version
131-
NEW_PATCH_VERSION=$((PATCH_VERSION + 1))
132-
133-
# Construct the new version
134-
NEW_VERSION="${VERSION_PARTS[0]}.${VERSION_PARTS[1]}.$NEW_PATCH_VERSION"
135-
136-
echo "New Version: $NEW_VERSION"
137-
echo "Command: s/$VERSION/$NEW_VERSION/ $FILE_PATH"
138-
139-
sed -i 's/\(content_tag_latest: "\)\([0-9]\+\.[0-9]\+\.\)\([0-9]\+\)"/\1\2'$((NEW_PATCH_VERSION))'"/' $FILE_PATH
140-
108+
run: yarn scripts version --content --auto-patch
109+
141110
- name: Commit changes
142111
working-directory: .idems_app/deployments/${{env.DEPLOYMENT_NAME}}
143112
run: |

.github/workflows/test-app-build.yml

-4
Original file line numberDiff line numberDiff line change
@@ -81,10 +81,6 @@ jobs:
8181
if: env.DEPLOYMENT_PRIVATE_KEY != ''
8282
run: echo "${{env.DEPLOYMENT_PRIVATE_KEY}}" > ./.idems_app/deployments/${{env.DEPLOYMENT_NAME}}/encrypted/private.key
8383

84-
- name: Populate Firebase Config
85-
if: env.FIREBASE_CONFIG != ''
86-
run: echo 'export const firebaseConfig = ${{env.FIREBASE_CONFIG}}' > src/environments/firebaseConfig.ts
87-
8884
- name: Setup Node
8985
uses: actions/setup-node@v3
9086
with:

.github/workflows/web-build.yml

-5
Original file line numberDiff line numberDiff line change
@@ -156,11 +156,6 @@ jobs:
156156
# Exact population varies depending on whether is PR, release, dispatch etc.
157157
#############################################################################
158158

159-
# TODO - populate firebase as part of deployment set
160-
- name: Populate firebaseConfig.ts
161-
if: ${{env.FIREBASE_CONFIG_TS}}
162-
run: echo $FIREBASE_CONFIG_TS > src/environments/firebaseConfig.ts
163-
164159
- name: Populate git sha
165160
if: ${{env.GIT_SHA}}
166161
run: echo "export const GIT_SHA = \"$GIT_SHA\";" > src/environments/sha.ts

.gitignore

+18-3
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,15 @@ node_modules
3131
/www
3232
yarn.lock.json
3333
google-services.json
34+
GoogleService-Info.plist
3435

3536
resources/android
3637
resources/ios
3738
package-lock.json
38-
src/environments/firebaseConfig.ts
3939
src/assets/app_data
4040
**/*.jks
41-
.firebase
41+
42+
4243

4344
/scripts/input
4445
/scripts/output
@@ -73,7 +74,21 @@ yarn.auto-install
7374
# Generated by https://supabase.com/docs/reference/cli/supabase-init
7475
supabase
7576

77+
# Firebase
78+
firebase.json
79+
.firebase
80+
.firebaserc
81+
7682
# Avoid comitting private keys
7783
private.key
7884

79-
.nx
85+
.nx
86+
87+
# Native config files populated by scripts
88+
capacitor.config.ts
89+
capacitor.config.json
90+
android/app/build.gradle
91+
android/app/src/main/AndroidManifest.xml
92+
android/app/src/main/java/international/idems/debug_app/MainActivity.java
93+
android/app/src/main/res/values/strings.xml
94+
ios/App/App.xcodeproj/project.pbxproj

.template.firebaserc

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"projects": {
3+
"default": "${FIREBASE_PROJECT_ID}"
4+
},
5+
"targets": {
6+
"${FIREBASE_PROJECT_ID}": {
7+
"hosting": {
8+
"${FIREBASE_HOSTING_TARGET}": [
9+
"${FIREBASE_PROJECT_ID}"
10+
]
11+
}
12+
}
13+
},
14+
"etags": {}
15+
}

README.md

-10
Original file line numberDiff line numberDiff line change
@@ -47,16 +47,6 @@ This will present an interactive list of deployments to select from.
4747

4848
See [Deployment Documentation](https://idemsinternational.github.io/parenting-app-ui/developers/deployments/) for information about creating and configuring deployments.
4949

50-
### Firebase
51-
To be able to run the full project a specific configuration file needs to be included to access
52-
the online database and authentication methods.
53-
```
54-
$ cp src/environments/firebaseConfig.sample.ts src/environments/firebaseConfig.ts
55-
```
56-
The default file is blank. It should be replaced with a version requested from the dev team.
57-
58-
(Note - this process will likely be simplified in the future)
59-
6050
## Running locally
6151

6252
### Start the local server

android/app/build.gradle android/app/build.template.gradle

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
apply plugin: 'com.android.application'
22

33
android {
4-
namespace "international.idems.plh_teens"
4+
namespace "${APP_ID}"
55
compileSdkVersion rootProject.ext.compileSdkVersion
66
defaultConfig {
7-
applicationId "international.idems.plh_teens"
7+
applicationId "${APP_ID}"
88
minSdkVersion rootProject.ext.minSdkVersion
99
targetSdkVersion rootProject.ext.targetSdkVersion
10-
versionCode *version_code*
11-
versionName "*version_name*"
10+
versionCode ${VERSION_CODE}
11+
versionName "${VERSION_NAME}"
1212
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
1313
}
1414
buildTypes {
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
3+
4+
<application android:allowBackup="true" android:icon="@mipmap/ic_launcher" android:label="@string/app_name" android:roundIcon="@mipmap/ic_launcher_round" android:supportsRtl="true" android:theme="@style/AppTheme" android:usesCleartextTraffic="true" android:requestLegacyExternalStorage="true">
5+
<!-- usesCleartextTraffic is required by capacitor-blob-writer -->
6+
<!-- requestLegacyExternalStorage is required to save files to "Documents" folder on Android 10 -->
7+
8+
<activity android:exported="true" android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale|smallestScreenSize|screenLayout|uiMode" android:name="${APP_ID}.MainActivity" android:label="@string/title_activity_main" android:theme="@style/AppTheme.NoActionBarLaunch" android:launchMode="singleTask">
9+
10+
<intent-filter>
11+
<action android:name="android.intent.action.MAIN" />
12+
<category android:name="android.intent.category.LAUNCHER" />
13+
</intent-filter>
14+
15+
<intent-filter>
16+
<action android:name="android.intent.action.VIEW" />
17+
<category android:name="android.intent.category.DEFAULT" />
18+
<category android:name="android.intent.category.BROWSABLE" />
19+
<data android:scheme="@string/custom_url_scheme" />
20+
</intent-filter>
21+
22+
</activity>
23+
24+
<provider android:name="androidx.core.content.FileProvider" android:authorities="${applicationId}.fileprovider" android:exported="false" android:grantUriPermissions="true">
25+
<meta-data android:name="android.support.FILE_PROVIDER_PATHS" android:resource="@xml/file_paths"></meta-data>
26+
</provider>
27+
</application>
28+
29+
<!-- Permissions -->
30+
31+
<!-- CC NOTE - 2021-06-02
32+
As we don't currrently need GeoLocation have removed permission
33+
(some installs on unsupported tester devices, e.g. Tecno-wx3p
34+
35+
If we want to put back we should make non-required and add runtime check
36+
in the app before using feature (might require both uses-feature and uses-permission
37+
https://stackoverflow.com/questions/30391355/can-i-get-access-to-nfc-without-manifest-permission-in-android
38+
https://stackoverflow.com/questions/28079449/uses-permission-vs-uses-feature
39+
https://developer.android.com/guide/topics/manifest/uses-feature-element
40+
https://developer.android.com/guide/topics/manifest/uses-permission-element
41+
42+
E.g. To enable camera include uses-permission for camera but manually add all features as optional
43+
https://developer.android.com/reference/android/Manifest.permission#CAMERA
44+
https://developer.android.com/guide/topics/manifest/uses-feature-element#camera-hw-features
45+
-->
46+
47+
48+
49+
<!-- Normal permissions, granted at install, don't require prompt -->
50+
<!-- https://developer.android.com/training/basics/network-ops/connecting -->
51+
<!-- <uses-permission android:name="android.permission.INTERNET" /> -->
52+
<!-- <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> -->
53+
54+
55+
<!-- Requested permissions, required in the app -->
56+
<!-- Camera, Photos, input file -->
57+
<!-- <uses-permission android:required="false" android:name="android.permission.READ_EXTERNAL_STORAGE"/> -->
58+
<!-- <uses-permission android:required="false" android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> -->
59+
60+
<!-- Navigator.getUserMedia -->
61+
<!-- Video -->
62+
<!-- <uses-permission android:required="false" android:name="android.permission.CAMERA" /> -->
63+
<!-- Audio -->
64+
<!-- <uses-permission android:required="false" android:name="android.permission.RECORD_AUDIO" /> -->
65+
<!-- <uses-permission android:required="false" android:name="android.permission.MODIFY_AUDIO_SETTINGS"/> -->
66+
67+
68+
<!-- Optional permissions, features we might make optional -->
69+
70+
<!-- <uses-feature android:name="android.hardware.location.gps" /> -->
71+
72+
73+
<!-- Not required permissions, features we have decided we don't want -->
74+
<!-- Geolocation API -->
75+
<!-- <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" /> -->
76+
<!-- <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" /> -->
77+
</manifest>

0 commit comments

Comments
 (0)