Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🎀 Final change of the service rewrite #1126

Merged
merged 777 commits into from
Feb 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
777 commits
Select commit Hold shift + click to select a range
fd01034
fallback to fakeConfig
Nov 19, 2023
83a773e
prettier types
Nov 19, 2023
51f6ece
await instead of timeout
Nov 19, 2023
3dee26f
Use expect.any(Type) for stricter testing
Nov 19, 2023
becc4af
enketoHelper: expand typings for resolveTimestamps
JGreenlee Nov 20, 2023
9a5753b
code style cleanup
JGreenlee Nov 20, 2023
25a064d
Fixes missing timezone conversions
the-bay-kay Nov 20, 2023
7480b92
Removed unnecessary imports
niccolopaganini Nov 20, 2023
fd0c1ab
Added npm package, fixed HTML formatting
the-bay-kay Nov 20, 2023
6fc9894
Merge branch 'controlHelper-rewrite' of https://github.com/the-bay-ka…
JGreenlee Nov 21, 2023
6d64774
Merge branch 'expand-enketo-helper' of https://github.com/Abby-Wheeli…
JGreenlee Nov 21, 2023
2c92ff9
Merge branch 'diaryServices-rewrite' of https://github.com/the-bay-ka…
JGreenlee Nov 21, 2023
0092ace
Merge branch 'notifScheduler-rewrite' of https://github.com/sebastian…
JGreenlee Nov 21, 2023
dd39c92
fix missing import in timelineHelper
JGreenlee Nov 21, 2023
c0170de
fix bad merge conflict resolution in diaryTypes
JGreenlee Nov 21, 2023
30eccf3
Merge branch 'service_rewrite_2023_emailService' of https://github.co…
JGreenlee Nov 21, 2023
c03324f
Merge branch 'metrics-services-rewrite' of https://github.com/Abby-Wh…
JGreenlee Nov 21, 2023
3760d25
remove all remaining uses of getAngularService()
JGreenlee Nov 21, 2023
2a0daf9
remove unused files + services
JGreenlee Nov 21, 2023
87fdae5
Add reminder scheme missing test for updateScheduledNotifs
sebastianbarry Nov 21, 2023
2871402
remove angular from customMetricsHelper
JGreenlee Nov 21, 2023
4df43c2
don't use angular in ngApp.js
JGreenlee Nov 21, 2023
b81493c
Clean up this file
JGreenlee Nov 21, 2023
810c319
fix bad parentheses
JGreenlee Nov 21, 2023
3242697
remove angular and ionic packages
JGreenlee Nov 21, 2023
5b0cea0
Merge branch 'service_rewrite_2023_emailService' of https://github.co…
JGreenlee Nov 21, 2023
828ee12
enketoHelper: fix error if timestamps are null
JGreenlee Nov 21, 2023
e414c5c
Merge branch 'expand-enketo-helper' of https://github.com/Abby-Wheeli…
JGreenlee Nov 21, 2023
ea60154
remove unused styles; consolidate into style.css
JGreenlee Nov 21, 2023
2c4afca
Merge branch 'expand-enketo-helper' of https://github.com/Abby-Wheeli…
JGreenlee Nov 21, 2023
2d438f0
consolidate ngApp.js into index.js
JGreenlee Nov 21, 2023
5bb56fe
fix failing test in notifScheduler
JGreenlee Nov 21, 2023
80fa776
remove ng-i18next
JGreenlee Nov 21, 2023
ebe7fe5
remove unused /build folder
JGreenlee Nov 21, 2023
263c90a
remove outdated comments referencing angular
JGreenlee Nov 21, 2023
99e1090
fix missing newline at end of index.html
JGreenlee Nov 21, 2023
9a20378
Added localization for trip duration
the-bay-kay Nov 21, 2023
d27cefe
Fixed trip start/end formatting error
the-bay-kay Nov 21, 2023
26638a7
Merge pull request #1105 from niccolopaganini/fix_wide_buttons
shankari Nov 22, 2023
35468e5
Merge pull request #1097 from niccolopaganini/service_rewrite_2023_em…
shankari Nov 22, 2023
49a1a64
comply to Typescript "strictNullChecks": true
JGreenlee Nov 22, 2023
9f7bc4a
more type safety to comply with strictNullChecks
JGreenlee Nov 22, 2023
3d14e37
clean/reformat pushNotifySettings
JGreenlee Nov 22, 2023
6b70afd
use aria-hidden instead of accessibilityHidden
JGreenlee Nov 22, 2023
72b3f7a
i18next: typesafe translation keys
JGreenlee Nov 22, 2023
12133ba
remove french and italian
JGreenlee Nov 22, 2023
b60a05f
convert remaining jsx to tsx
JGreenlee Nov 22, 2023
214081e
Add already scheduled notifs test
sebastianbarry Nov 22, 2023
f5ebb1e
Fixing comments
sebastianbarry Nov 22, 2023
50fb40d
add js/types to typeRoots
JGreenlee Nov 22, 2023
df0f03f
cleanup and fix types in ProfileSettings
JGreenlee Nov 22, 2023
fe3d417
Filled out typing for timelineHelper functions
the-bay-kay Nov 22, 2023
9e58c7e
more cleanup related to typings
JGreenlee Nov 22, 2023
667fec8
Expanded diaryTypes
the-bay-kay Nov 22, 2023
07c5f80
Added test for readUnprocessedTrips
the-bay-kay Nov 23, 2023
aee8738
Merge branch 'service_rewrite_2023' into expand-enketo-helper
shankari Nov 23, 2023
6892580
Final overall test for updateScheduledNotifs
sebastianbarry Nov 24, 2023
659b53e
add codecov report workflow
jiji14 Nov 27, 2023
a232e3f
Revert "Switched to old fileIO, fixes issue with android"
the-bay-kay Nov 27, 2023
369b3ad
Changed fileIO directory to fix android issue
the-bay-kay Nov 27, 2023
49d90fe
Change token method
jiji14 Nov 28, 2023
1a6a721
add file path
jiji14 Nov 28, 2023
4e29f79
Collect jest coverage and add it in gitignore
jiji14 Nov 28, 2023
4f6ec43
Check if coverage file is in the target directory
jiji14 Nov 28, 2023
f497f4d
Execute codecov report after jest test
jiji14 Nov 28, 2023
84d4e38
Upload coverage reports to Codecov
jiji14 Nov 28, 2023
d2a335c
Add codecov config file
jiji14 Nov 28, 2023
7a94e22
Add token in workflow
jiji14 Nov 28, 2023
7121ec6
rollback to previous commit
jiji14 Nov 28, 2023
3bebd8c
fix DiaryCard showing current time if blank
JGreenlee Nov 29, 2023
9a2567c
add TimestampRange type
JGreenlee Nov 29, 2023
3e232ab
fix DiaryCard showing blank TimestampBadges
JGreenlee Nov 29, 2023
7a0ea59
new LabelTab functions for user inputs
JGreenlee Nov 29, 2023
cf7027e
handle enketo validation with try/catch
JGreenlee Nov 30, 2023
45799c6
fix UserInputButton not filling in after response
JGreenlee Nov 30, 2023
27549a3
add duration to ConfirmedPlace type def
JGreenlee Nov 30, 2023
2efb03d
refactor enketo user input types
JGreenlee Nov 30, 2023
fa1dfbf
ignore /dist directory
JGreenlee Nov 30, 2023
44ecc45
fix reload on every tab switch
JGreenlee Nov 30, 2023
31ce4d3
UI touchups
JGreenlee Nov 30, 2023
e8b449f
Merge branch 'service_rewrite_2023' of https://github.com/e-mission/e…
JGreenlee Nov 30, 2023
0d1717d
Added tests for updateUnprocessedInputs
the-bay-kay Nov 30, 2023
85f0519
Added user exists test for getReminderPrefs
sebastianbarry Nov 30, 2023
0528fb0
Remove unnecessary console.log
sebastianbarry Nov 30, 2023
2c0ec40
Fixing moved location of commHelper causing jest tests to fail
sebastianbarry Nov 30, 2023
d93da07
Bug fix for Enekto Survey
the-bay-kay Dec 1, 2023
54b73f6
Merge pull request #1108 from jiji14/setup-codecov
shankari Dec 2, 2023
76e579e
remove unused bits from index.html
JGreenlee Dec 2, 2023
f04079b
Merge branch 'notifScheduler-rewrite' of https://github.com/sebastian…
JGreenlee Dec 2, 2023
a0eb054
Merge branch 'diaryServices-rewrite' of https://github.com/the-bay-ka…
JGreenlee Dec 2, 2023
b900d1e
Merge branch 'service_rewrite_2023' into expand-enketo-helper
shankari Dec 3, 2023
bc2543b
Merge branch 'service_rewrite_2023' into metrics-services-rewrite
shankari Dec 3, 2023
9a321b7
Merge pull request #1063 from Abby-Wheelis/expand-enketo-helper
shankari Dec 4, 2023
1006165
Merge branch 'service_rewrite_2023' into metrics-services-rewrite
shankari Dec 4, 2023
4959198
add "/dist/" to jest ignore
JGreenlee Dec 4, 2023
c0e29ef
Merge branch 'service_rewrite_2023' of https://github.com/e-mission/e…
JGreenlee Dec 4, 2023
c1f6dc3
Merge pull request #1098 from Abby-Wheelis/metrics-services-rewrite
shankari Dec 4, 2023
b59c65f
Update www/js/diary/diaryHelper.ts
the-bay-kay Dec 4, 2023
92f4a64
Updated tests for luxon time conversion
the-bay-kay Dec 4, 2023
e3dc66f
Cleaned up code
the-bay-kay Dec 4, 2023
d844466
add TimestampRange type
JGreenlee Dec 4, 2023
c42665f
add getMessagesForInterval to BEMUserCache mock
JGreenlee Dec 4, 2023
650564a
add tests for updateLocalUnprocessedInputs
JGreenlee Dec 4, 2023
1cb28c6
Merge branch 'diaryServices-rewrite' of https://github.com/the-bay-ka…
JGreenlee Dec 4, 2023
b6b7c94
Merge branch 'service_rewrite_2023' of https://github.com/e-mission/e…
JGreenlee Dec 4, 2023
356336c
fix diaryTypes
JGreenlee Dec 4, 2023
f80deb9
fix timelineHelper test
JGreenlee Dec 4, 2023
f5dc166
Merge branch 'service_rewrite_2023' of https://github.com/e-mission/e…
JGreenlee Dec 4, 2023
76e6867
Merge branch 'diaryServices-rewrite' of https://github.com/the-bay-ka…
JGreenlee Dec 4, 2023
47acc03
fix getFormattedTimeRange
JGreenlee Dec 5, 2023
ee2fe2a
rework resolveTimestamps validation to fix test
JGreenlee Dec 5, 2023
abc88bd
run coverage workflow only when PR is ready
jiji14 Dec 5, 2023
b357744
include shell command
jiji14 Dec 5, 2023
a6d9932
setup the serve environment for test
jiji14 Dec 5, 2023
18539f5
check out the repository and activate the environment
jiji14 Dec 5, 2023
db19a5b
Merge pull request #1052 from the-bay-kay/controlHelper-rewrite
shankari Dec 6, 2023
4d664ad
fix up timelineHelper tests
JGreenlee Dec 6, 2023
aa8cbe4
fix broken start time on draft trips
JGreenlee Dec 6, 2023
35ffc41
Merge branch 'service_rewrite_2023' of https://github.com/e-mission/e…
JGreenlee Dec 6, 2023
4e44dba
fix error on configs without reminderSchemes
JGreenlee Dec 6, 2023
aa9ee64
Merge branch 'service_rewrite_2023' of https://github.com/e-mission/e…
JGreenlee Dec 6, 2023
4f173ba
update to Prettier 3.1
JGreenlee Dec 6, 2023
0f77f5c
Merge branch 'notifScheduler-rewrite' of https://github.com/sebastian…
JGreenlee Dec 7, 2023
b3dd4b1
Merge branch 'diaryServices-rewrite' of https://github.com/the-bay-ka…
JGreenlee Dec 7, 2023
60ef5ed
fix type warnings in timelineHelper
JGreenlee Dec 7, 2023
a9042d3
fix type warnings on timelineHelperMocks
JGreenlee Dec 7, 2023
8e78f79
fix Enketo type warnings
JGreenlee Dec 7, 2023
1a35e1f
fix type warnings in confirmHelper.test.ts
JGreenlee Dec 7, 2023
107eb84
fix type warnings in confirmHelper.test.ts
JGreenlee Dec 7, 2023
81f4558
Merge branch 'migration-wrapup' of https://github.com/JGreenlee/e-mis…
JGreenlee Dec 7, 2023
3367e60
make labelVars as optional in AppConfig type def
JGreenlee Dec 8, 2023
8c31b65
fix backwards compat on retrieved configs
JGreenlee Dec 8, 2023
0527569
dynamicConfig: use 'function' syntax for big fns
JGreenlee Dec 9, 2023
b011bca
add JSdoc and types to fns in dynamicConfigs.ts
JGreenlee Dec 9, 2023
5ee4d64
Add getReminderPrefs test for when user does not exist
sebastianbarry Dec 12, 2023
d3750c3
Add simple setReminderPrefs test
sebastianbarry Dec 12, 2023
1901f4c
remove Jest from the osx-serve-install workflow to avoid running the …
jiji14 Dec 12, 2023
26efc6d
Merge remote-tracking branch 'upstream/master' into service_rewrite_2023
jiji14 Dec 13, 2023
3ffa629
add specific prettier version
jiji14 Dec 13, 2023
0eab473
Merge branch 'notifScheduler-rewrite' of https://github.com/sebastian…
JGreenlee Dec 14, 2023
58fba92
add specific prettier version
jiji14 Dec 13, 2023
17deb22
use prettier 3.1.0 in workflow
JGreenlee Dec 14, 2023
113ed82
handle errors better while fetching/loading config
JGreenlee Dec 14, 2023
a99af4d
mockBEMUserCache: putRWDocument for storing config
JGreenlee Dec 14, 2023
b6a01f1
config backwards compats as one function
JGreenlee Dec 14, 2023
ec9729d
Add test for updateScheduledNotifs to test if notifs successfully get…
sebastianbarry Dec 15, 2023
6676dc5
only use fakeConfig if passed to mockBEMUserCache
JGreenlee Dec 15, 2023
870bee2
initial tests for dynamicConfig.test.ts
JGreenlee Dec 15, 2023
9bc5cd6
update dynamicConfig.test.ts
JGreenlee Dec 15, 2023
63732f0
fix handling of invalid opcode
JGreenlee Dec 15, 2023
b32c0d4
Merge pull request #1117 from jiji14/prettier-version-fix
shankari Dec 20, 2023
8070e76
Merge pull request #1114 from jiji14/change_codecov_setting
shankari Dec 20, 2023
ae0ae28
Merge branch 'service_rewrite_2023' into migration-wrapup
shankari Dec 21, 2023
80e3903
Fix merge conflict the right way
shankari Dec 21, 2023
5cb8187
Fixed WSOD on single-date pick
the-bay-kay Dec 26, 2023
588f685
Clean up a line of test code
the-bay-kay Dec 26, 2023
e7b44dd
fix privacy links
Dec 28, 2023
5bc023c
update weekly minutes to have translated axis labels
Jan 2, 2024
3b61247
Merge remote-tracking branch 'upstream/service_rewrite_2023' into tra…
Jan 2, 2024
f8911a8
internationalize dates on the trip cards
Jan 2, 2024
d86c91d
run prettier
Jan 2, 2024
6e3af4f
correct syntax
Jan 2, 2024
961ac78
update unprocessed inputs after recording user input
JGreenlee Jan 8, 2024
68ae2bb
allow labels to be stored as a batch
JGreenlee Jan 8, 2024
5166bef
Added to WSOD fix on metrics tab
the-bay-kay Jan 9, 2024
27e7a51
Merge pull request #1 from the-bay-kay/diary_wsod_fix
JGreenlee Jan 9, 2024
1474833
use memoization pattern for added notes' displayDt
JGreenlee Jan 9, 2024
01f33d3
display error properly if thrown in EnketoModal
JGreenlee Jan 9, 2024
f1bd447
revise type defs for additions / EnketoUserInputEntry
JGreenlee Jan 9, 2024
c91e8c0
Merge pull request #1121 from Abby-Wheelis/translation-cleanup-jan24
shankari Jan 14, 2024
14c748d
Merge pull request #1092 from sebastianbarry/notifScheduler-rewrite
shankari Jan 20, 2024
392c64f
Merge pull request #1119 from Abby-Wheelis/privacy_links
shankari Jan 20, 2024
8f85e05
Merge pull request #1115 from JGreenlee/fix-surveyconfig-backwardscompat
shankari Jan 20, 2024
dfbee1f
Merge branch 'service_rewrite_2023' into diaryServices-rewrite
shankari Jan 20, 2024
1fb7c95
Fix formatting error introduced by merge code
shankari Jan 20, 2024
3cbb5f0
❌🙁 Fix codecov-test failure - ‼️📅 Rewrite - notifScheduler.ts (#1123)
sebastianbarry Jan 23, 2024
e69138b
Merge branch 'service_rewrite_2023' into diaryServices-rewrite
the-bay-kay Jan 23, 2024
a89f356
Update func param types, fix func formatting
the-bay-kay Jan 24, 2024
d54ce29
Renamed `ServerData` to BEMData
the-bay-kay Jan 24, 2024
cdb7138
Imporved test in `timelineHelper.test.ts`
the-bay-kay Jan 25, 2024
95d6255
Ran prettier from `www/`
the-bay-kay Jan 25, 2024
9f73f74
Updated diaryTypes to use GeoJSON `Point`
the-bay-kay Jan 25, 2024
f54257b
Prettier after `Point` change
the-bay-kay Jan 25, 2024
ee32008
Merge pull request #1085 from the-bay-kay/diaryServices-rewrite
shankari Jan 25, 2024
cb7b191
Merge branch 'service_rewrite_2023' of https://github.com/e-mission/e…
JGreenlee Jan 25, 2024
d1927b3
fix missing import in timelineHelper
JGreenlee Nov 21, 2023
0d417f2
remove all remaining uses of getAngularService()
JGreenlee Nov 21, 2023
e558163
remove unused files + services
JGreenlee Nov 21, 2023
0153f0f
remove angular from customMetricsHelper
JGreenlee Nov 21, 2023
ce81699
don't use angular in ngApp.js
JGreenlee Nov 21, 2023
2c18cc1
remove angular and ionic packages
JGreenlee Nov 21, 2023
e920752
remove unused styles; consolidate into style.css
JGreenlee Nov 21, 2023
385a384
consolidate ngApp.js into index.js
JGreenlee Nov 21, 2023
6d5566e
fix failing test in notifScheduler
JGreenlee Nov 21, 2023
40f7aad
remove ng-i18next
JGreenlee Nov 21, 2023
4d9a8ef
remove unused /build folder
JGreenlee Nov 21, 2023
98b08bf
remove outdated comments referencing angular
JGreenlee Nov 21, 2023
78661da
fix missing newline at end of index.html
JGreenlee Nov 21, 2023
c901e91
comply to Typescript "strictNullChecks": true
JGreenlee Nov 22, 2023
8178c1f
more type safety to comply with strictNullChecks
JGreenlee Nov 22, 2023
dd00645
clean/reformat pushNotifySettings
JGreenlee Nov 22, 2023
a5edfb7
use aria-hidden instead of accessibilityHidden
JGreenlee Nov 22, 2023
5f9c665
i18next: typesafe translation keys
JGreenlee Nov 22, 2023
60f12b3
remove french and italian
JGreenlee Nov 22, 2023
7286a04
convert remaining jsx to tsx
JGreenlee Nov 22, 2023
aa74a4f
add js/types to typeRoots
JGreenlee Nov 22, 2023
e77b92a
cleanup and fix types in ProfileSettings
JGreenlee Nov 22, 2023
6a17228
more cleanup related to typings
JGreenlee Nov 22, 2023
9dc0d48
fix DiaryCard showing current time if blank
JGreenlee Nov 29, 2023
da0a311
add TimestampRange type
JGreenlee Nov 29, 2023
1e906c0
fix DiaryCard showing blank TimestampBadges
JGreenlee Nov 29, 2023
63c14d6
new LabelTab functions for user inputs
JGreenlee Nov 29, 2023
9ac6e00
handle enketo validation with try/catch
JGreenlee Nov 30, 2023
d339de7
fix UserInputButton not filling in after response
JGreenlee Nov 30, 2023
6deab9f
add duration to ConfirmedPlace type def
JGreenlee Nov 30, 2023
e37fa01
refactor enketo user input types
JGreenlee Nov 30, 2023
098ba21
ignore /dist directory
JGreenlee Nov 30, 2023
36bbf08
fix reload on every tab switch
JGreenlee Nov 30, 2023
412b3b8
UI touchups
JGreenlee Nov 30, 2023
c9b2683
remove unused bits from index.html
JGreenlee Dec 2, 2023
e1d03a6
add "/dist/" to jest ignore
JGreenlee Dec 4, 2023
07befbc
fix getFormattedTimeRange
JGreenlee Dec 5, 2023
fec6a4b
rework resolveTimestamps validation to fix test
JGreenlee Dec 5, 2023
3c65612
update to Prettier 3.1
JGreenlee Dec 6, 2023
59a080f
fix type warnings in timelineHelper
JGreenlee Dec 7, 2023
3563698
fix type warnings on timelineHelperMocks
JGreenlee Dec 7, 2023
699d90f
fix Enketo type warnings
JGreenlee Dec 7, 2023
ff840ff
fix type warnings in confirmHelper.test.ts
JGreenlee Dec 7, 2023
88c72f8
use prettier 3.1.0 in workflow
JGreenlee Dec 14, 2023
a6e7a79
update unprocessed inputs after recording user input
JGreenlee Jan 8, 2024
8161d58
allow labels to be stored as a batch
JGreenlee Jan 8, 2024
b6a9155
Fixed WSOD on single-date pick
the-bay-kay Dec 26, 2023
ce760b6
Clean up a line of test code
the-bay-kay Dec 26, 2023
7483fe5
Added to WSOD fix on metrics tab
the-bay-kay Jan 9, 2024
b3785fd
use memoization pattern for added notes' displayDt
JGreenlee Jan 9, 2024
3e44ebc
display error properly if thrown in EnketoModal
JGreenlee Jan 9, 2024
316d4e9
revise type defs for additions / EnketoUserInputEntry
JGreenlee Jan 9, 2024
d5fe4b4
Merge branch 'service_rewrite_2023' of https://github.com/e-mission/e…
JGreenlee Jan 25, 2024
b0d6e7b
Merge branch 'migration-wrapup' of https://github.com/JGreenlee/e-mis…
JGreenlee Jan 25, 2024
6631890
fix notifScheduler test
JGreenlee Jan 25, 2024
a086892
fix type defs for notifScheduler
JGreenlee Jan 25, 2024
0aec763
fix type defs for timelineHelper
JGreenlee Jan 25, 2024
79d18a1
fix type warnings
JGreenlee Jan 25, 2024
004b9ea
replace remaining uses of `moment` & remove it from dependencies
JGreenlee Jan 26, 2024
48633c3
remove jQuery from dependencies + webpack
JGreenlee Jan 26, 2024
d8379c2
Merge pull request #1106 from JGreenlee/migration-wrapup
shankari Feb 1, 2024
539924c
fix processed trip survey responses not matching
JGreenlee Feb 2, 2024
cf28dba
inputMatcher prettier
JGreenlee Feb 2, 2024
e5ef8da
add tests for mapInputsToTimelineEntries
JGreenlee Feb 2, 2024
9ddcf31
Merge pull request #1125 from JGreenlee/fix-processed-surveys-matching
shankari Feb 2, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 0 additions & 14 deletions .editorconfig

This file was deleted.

35 changes: 35 additions & 0 deletions .github/workflows/code-coverage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: code coverage
on:
pull_request:
types:
- opened
- reopened
- synchronize
- ready_for_review

jobs:
run-codecov:
if: github.event.pull_request.draft == false
runs-on: macos-latest
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2

- name: Setup the serve environment
shell: bash -l {0}
run: |
bash setup/setup_serve.sh

- name: Run Jest tests
shell: bash -l {0}
run: |
source setup/activate_serve.sh
npx jest

- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3
with:
files: ./coverage/coverage-final.json
flags: unit
fail_ci_if_error: ${{ github.repository == 'e-mission/e-mission-phone' }}

12 changes: 12 additions & 0 deletions .github/workflows/prettier.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: prettier
on:
pull_request:

jobs:
run-prettier:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: npx [email protected] --check www


5 changes: 0 additions & 5 deletions .github/workflows/serve-install.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,6 @@ jobs:
echo "ionic version"
npx ionic --version

- name: Run Jest tests
shell: bash -l {0}
run: |
npx jest

# TODO: figure out how to check that a server started correctly
# - name: Try starting it
# run: npx run serve
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
node_modules/
platforms/
plugins/
dist/
www/lib/
package-hooks/
.DS_Store
Expand All @@ -16,3 +17,4 @@ app-settings.json
www/dist/
config.xml
package.json
coverage/
12 changes: 12 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Ignore www/dist, json
www/dist
www/json

# Ignore all HTML files:
**/*.html

# This is the pattern to check only www directory
# Ignore all
/*
# but don't ignore all the files in www directory
!/www
10 changes: 10 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"printWidth": 100,
"tabWidth": 2,
"singleQuote": true,
"trailingComma": "all",
"bracketSpacing": true,
"bracketSameLine": true,
"endOfLine": "lf",
"semi": true
}
4 changes: 4 additions & 0 deletions babel.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
module.exports = {
presets: ['@babel/preset-env', '@babel/preset-typescript', '@babel/preset-react'],
plugins: ['@babel/plugin-transform-flow-strip-types'],
}
8 changes: 8 additions & 0 deletions codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
comment:
layout: " diff, flags, files"
behavior: default
require_changes: false
require_base: false
require_head: true
hide_project_coverage: false

21 changes: 21 additions & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
module.exports = {
testEnvironment: 'jsdom',
testPathIgnorePatterns: [
"/node_modules/",
"/dist/",
"/platforms/",
"/plugins/",
"/lib/",
],
preset: 'react-native',
transform: {
"^.+\\.(ts|tsx|js|jsx)$": "babel-jest"
},
transformIgnorePatterns: [
"node_modules/(?!((enketo-transformer/dist/enketo-transformer/web)|(jest-)?react-native(-.*)?|@react-native(-community)?)/)",
],
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx'],
moduleDirectories: ["node_modules", "src"],
globals: {"__DEV__": false},
collectCoverage: true,
};
15 changes: 0 additions & 15 deletions jest.config.json

This file was deleted.

24 changes: 6 additions & 18 deletions package.cordovabuild.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
"@types/luxon": "^3.3.0",
"@types/react": "^18.2.20",
"babel-loader": "^9.1.2",
"babel-plugin-angularjs-annotate": "^0.10.0",
"babel-plugin-optional-require": "^0.3.1",
"concurrently": "^8.0.1",
"cordova": "^11.1.0",
Expand Down Expand Up @@ -102,17 +101,11 @@
},
"dependencies": {
"@havesource/cordova-plugin-push": "git+https://github.com/havesource/cordova-plugin-push.git#4.0.0-dev.0",
"@messageformat/core": "^3.2.0",
"@react-navigation/native": "^6.1.7",
"@react-navigation/stack": "^6.3.17",
"@shopify/flash-list": "^1.3.1",
"angular": "1.6.7",
"angular-animate": "1.6.7",
"angular-local-storage": "^0.7.1",
"angular-sanitize": "1.6.7",
"angular-simple-logger": "^0.1.7",
"angular-translate": "^2.18.1",
"angular-translate-loader-static-files": "^2.18.1",
"angular-ui-router": "0.2.13",
"@types/leaflet": "^1.9.4",
"animate.css": "^3.5.2",
"bottleneck": "^2.19.5",
"chart.js": "^4.3.0",
Expand Down Expand Up @@ -141,27 +134,22 @@
"cordova-plugin-x-socialsharing": "6.0.4",
"core-js": "^2.5.7",
"enketo-core": "^6.1.7",
"enketo-transformer": "^4.0.0",
"fast-xml-parser": "^4.2.2",
"fs-extra": "^9.0.1",
"i18next": "^22.5.0",
"humanize-duration": "^3.31.0",
"i18next": "^23.7.6",
"install": "^0.13.0",
"ionic-datepicker": "1.2.1",
"ionic-toast": "^0.4.1",
"jquery": "^3.1.0",
"klaw-sync": "^6.0.0",
"leaflet": "^1.9.4",
"luxon": "^3.3.0",
"messageformat": "^2.3.0",
"moment": "^2.29.4",
"moment-timezone": "^0.5.43",
"ng-i18next": "^1.0.7",
"npm": "^9.6.3",
"phonegap-plugin-barcodescanner": "git+https://github.com/phonegap/phonegap-plugin-barcodescanner#v8.1.0",
"prop-types": "^15.8.1",
"react": "^18.2.*",
"react-chartjs-2": "^5.2.0",
"react-dom": "^18.2.*",
"react-i18next": "^12.3.1",
"react-i18next": "^13.5.0",
"react-native-paper": "^5.8.0",
"react-native-paper-dates": "^0.18.12",
"react-native-safe-area-context": "^4.6.3",
Expand Down
33 changes: 13 additions & 20 deletions package.serve.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,17 @@
"@babel/core": "^7.21.3",
"@babel/plugin-proposal-class-properties": "^7.18.6",
"@babel/plugin-proposal-object-rest-spread": "^7.20.7",
"@babel/plugin-transform-flow-strip-types": "^7.22.5",
"@babel/preset-env": "^7.21.4",
"@babel/preset-flow": "^7.21.4",
"@babel/preset-react": "^7.18.6",
"@babel/preset-typescript": "^7.21.4",
"@ionic/cli": "6.20.8",
"@testing-library/react-native": "^12.3.0",
"@types/luxon": "^3.3.0",
"@types/react": "^18.2.20",
"babel-jest": "^29.7.0",
"babel-loader": "^9.1.2",
"babel-plugin-angularjs-annotate": "^0.10.0",
"babel-plugin-optional-require": "^0.3.1",
"concurrently": "^8.0.1",
"cordova": "^11.1.0",
Expand All @@ -35,58 +37,49 @@
"expose-loader": "^4.1.0",
"file-loader": "^6.2.0",
"jest": "^29.7.0",
"jest-environment-jsdom": "^29.7.0",
"phonegap": "9.0.0+cordova.9.0.0",
"process": "^0.11.10",
"sass": "^1.62.1",
"sass-loader": "^13.3.1",
"style-loader": "^3.3.3",
"ts-jest": "^29.1.1",
"ts-loader": "^9.4.2",
"ts-node": "^10.9.1",
"typescript": "^5.0.3",
"url-loader": "^4.1.1",
"webpack": "^5.0.1",
"webpack-cli": "^5.0.1"
"webpack-cli": "^5.0.1",
"prettier": "3.1.0"
},
"dependencies": {
"@messageformat/core": "^3.2.0",
"@react-navigation/native": "^6.1.7",
"@react-navigation/stack": "^6.3.17",
"@shopify/flash-list": "^1.3.1",
"@types/jest": "^29.5.5",
"angular": "1.6.7",
"angular-animate": "1.6.7",
"angular-local-storage": "^0.7.1",
"angular-sanitize": "1.6.7",
"angular-simple-logger": "^0.1.7",
"angular-translate": "^2.18.1",
"angular-translate-loader-static-files": "^2.18.1",
"angular-ui-router": "0.2.13",
"@types/leaflet": "^1.9.4",
"animate.css": "^3.5.2",
"bottleneck": "^2.19.5",
"chart.js": "^4.3.0",
"chartjs-adapter-luxon": "^1.3.1",
"chartjs-plugin-annotation": "^3.0.1",
"core-js": "^2.5.7",
"enketo-core": "^6.1.7",
"enketo-transformer": "^4.0.0",
"fast-xml-parser": "^4.2.2",
"fs-extra": "^9.0.1",
"i18next": "^22.5.0",
"humanize-duration": "^3.31.0",
"i18next": "^23.7.6",
"install": "^0.13.0",
"ionic-datepicker": "1.2.1",
"ionic-toast": "^0.4.1",
"jquery": "^3.1.0",
"klaw-sync": "^6.0.0",
"leaflet": "^1.9.4",
"luxon": "^3.3.0",
"messageformat": "^2.3.0",
"moment": "^2.29.4",
"moment-timezone": "^0.5.43",
"ng-i18next": "^1.0.7",
"npm": "^9.6.3",
"prop-types": "^15.8.1",
"react": "^18.2.*",
"react-chartjs-2": "^5.2.0",
"react-dom": "^18.2.*",
"react-i18next": "^12.3.1",
"react-i18next": "^13.5.0",
"react-native-paper": "^5.8.0",
"react-native-paper-dates": "^0.18.12",
"react-native-safe-area-context": "^4.6.3",
Expand Down
6 changes: 4 additions & 2 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,15 @@
"sourceMap": true,
"module": "es6",
"target": "es5",
"strictNullChecks": true,
"downlevelIteration": true,
"esModuleInterop": true,
"resolveJsonModule": true,
"jsx": "react",
"allowJs": true,
"moduleResolution": "node"
"moduleResolution": "node",
"typeRoots": ["node_modules/@types", "www/js/types"],
},
"include": ["www/**/*"],
"exclude": ["**/www/manual_lib/*", "**/node_modules/*", "**/dist/*"],
"exclude": ["**/node_modules/*", "**/dist/*"],
}
13 changes: 7 additions & 6 deletions webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ module.exports = {
{
test: /\.(scss|css)$/,
include: [path.resolve(__dirname, 'www/css'),
path.resolve(__dirname, 'www/manual_lib'),
path.resolve(__dirname, 'node_modules/enketo-core'),
path.resolve(__dirname, 'node_modules/leaflet')],
use: ['style-loader', 'css-loader', 'sass-loader'],
Expand Down Expand Up @@ -57,11 +56,8 @@ module.exports = {
],
},
plugins: [
// to load jQuery and moment globally
// to load Leaflet globally
new webpack.ProvidePlugin({
$: 'jquery',
jQuery: 'jquery',
moment: 'moment',
L: 'leaflet',
}),
new webpack.DefinePlugin({
Expand All @@ -79,7 +75,12 @@ module.exports = {
/* Enketo expects its per-app configuration to be available as 'enketo-config',
so we have to alias it here.
https://github.com/enketo/enketo-core#global-configuration */
'enketo/config': path.resolve(__dirname, 'www/js/config/enketo-config')
'enketo/config': path.resolve(__dirname, 'www/js/config/enketo-config'),
/* enketo-transformer has 'libxslt' as an optional peer dependency.
We don't need it since we are only doing client-side transformations via
enketo-transformer/web (https://github.com/enketo/enketo-transformer#web).
So, we can tell webpack it's ok to ignore libxslt by aliasing it to false. */
'libxslt': false,
},
extensions: ['.web.js', '.jsx', '.tsx', '.ts', '.js'],
},
Expand Down
17 changes: 0 additions & 17 deletions webpack.prod.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,23 +7,6 @@ module.exports = merge(common, {
devtool: 'source-map',
module: {
rules: [
/* In production, Webpack minifies JS files and randomizes variable names.
This causes problems with AngularJS unless you use explicit annotations,
which we don't.
https://docs.angularjs.org/error/$injector/strictdi
(The syntax we use is like the 'bad' example: implicit annotations)
So rather than change every file in our codebase, I'm adding this
babel plugin which basically preprocesses our 'bad' code into 'good' code.
Only needed on production because minification doesn't happen on dev. */
{
test: /\.(js)$/,
include: path.resolve(__dirname, 'www'),
loader: 'babel-loader',
options: {
presets: ['@babel/preset-env'],
plugins: ["angularjs-annotate"],
},
},
{
test: /\.(js|jsx|ts|tsx)$/,
loader: 'babel-loader',
Expand Down
Loading
Loading