Skip to content
This repository was archived by the owner on Sep 21, 2020. It is now read-only.

fix(messaging): only initialize messaging when logged in #64

Merged
merged 2 commits into from
Apr 16, 2020

Conversation

prescottprue
Copy link
Collaborator

As mentioned in #63, this switches messaging to only be initialized when logged in

@prescottprue prescottprue merged commit 110e4a8 into next Apr 16, 2020
@prescottprue prescottprue deleted the notifications-when-needed branch April 16, 2020 01:08
thebitguru added a commit that referenced this pull request Apr 29, 2020
* Generate project using generator-react-firebase

* Apply styling to navbar

* Add requests page and remove projects

* Add createdAt and lastUpdatedAt

* Add font. Remove RTDB rules. Fix requests form errors

* Add other pages

* Add tests for recently added pages

* Fix tests since auth isn't required

* Remove duplicated verify workflow

* Update lock file

* Started implementing the homepage maps component.

* Remove build config step

* add version change reloader - #52

* Adding the original schema file so we can see the proposed changes.

* Proposing schema changes.

* Couldn't sleep so I fixed the request form. Removed emotional support option

* Add Search page and remove SignupPage

* Implemented the ClickableMap component.
Merged request page changes, but still working on the request page.
Added a few more request page tests.
Hooked up the Notifications component in core layout.
WIP - NeedsMap component on the homepage.

* Revising the schema based on discusison.

* Minor change

* Removing aggregate and switching to .txt for now.

* Generate project using generator-react-firebase (#56)

* Generate project using generator-react-firebase

* Apply styling to navbar

* Add requests page and remove projects

* Add createdAt and lastUpdatedAt

* Add font. Remove RTDB rules. Fix requests form errors

* Add other pages

* Add tests for recently added pages

* Fix tests since auth isn't required

* Remove duplicated verify workflow

* Update lock file

* Started implementing the homepage maps component.

* Remove build config step

* add version change reloader - #52

* Adding the original schema file so we can see the proposed changes.

* Proposing schema changes.

* Couldn't sleep so I fixed the request form. Removed emotional support option

* Add Search page and remove SignupPage

* Implemented the ClickableMap component.
Merged request page changes, but still working on the request page.
Added a few more request page tests.
Hooked up the Notifications component in core layout.
WIP - NeedsMap component on the homepage.

* Remove functions tests from CI since they are currently acting up

* Remove geofirestore from cloud functions (since it will be used on client)

* Cleaned up some lint

* Add cv19assist-next project settings. Remove staging config from .env. .env.local is now used for config

* Add firestore security rules based on proposed data structure

* Remove .env.production to fix build commands. Wire up NewUser page

Co-authored-by: Farhan Ahmad <[email protected]>

* fix(ci): fix version update logic

* fix(tests): add Cypress projectId  for recording test results

* Update yarn.lock

* Implemented the request creation.
Removed references to old collections in rules.
Added privacy policy and terms of service.
Moved the ClickableMap to the proper location.
Renamed requests.phoneNumber to requests.phone to make it consistent with `users`.
Changed collection names to snake case.
Included geofirestore for geo queries.

* Adding the missed rules file.

* Fixing lint errors.

* fix(ci): use correct cache path for yarn settings

* Add back create rule since createdBy is now uid

* FIx syntax error in rules

* feat(core): simple notifications phase 1 (#59)

* WIP - Setting the default status on new requests.
Now populating the marker on the needs map (still need info windows).
Committing to request help with the search page.

* Add github templates. Add rules requiring status.

* Implement InfoWindow on the homepage markers.

* Contact Page Form (#62)

* fix(ci): add github branch env var so correct build script is used

* feat(app): add logo and update settings in firebase-messaging-sw.js

* Search page working with distance between

* Load location from user profile if it exists or fallback to default. Move constants and utils

* Only load lat/long from profile if logged in

* fix(messaging): only initialize messaging in FCM supported environments - #63

* Move scrambleLocation to utils/geo

* fix(messaging): only initialize messaging when logged in (#64)

* Adding general location name

* Morning Unfulfilled Requests Email (#65)

* Add `morningEmailCentral` cloud function for sending out 9AM email containing info on unfulfilled requests (to UIDs which are listed in `morningEmail` parameter of `system_settings/notifications`)
* Add unit test for `morningEmailCentral` cloud function
* Add email templates to repo
* Add updateEmailTemplates script to update email templates within Firestore
* Add logic to deploy CI workflow to update email templates after deploy
* Re-enable unit tests for other cloud functions by fixing firebase issue with global teardown

* Request Detail Page (#66)

* fix(app): use redirect for login on mobile

* fix(app): handle a case where messaging was getting run in unsupported brwosers

* fix(functions): pass data from d parameter to mail request template data

* feat(app): implement the search page. Still need to hook up the buttons and create tests.
fix(NewRequest): now properly defaulting status=1.
docs(CONTRIBUTING): add links to angular commit guidelines.
refactor(NeedsMap): rename to RequestsMap.
refactor(google-maps): remove the static google maps include in public.html and now using LoadScript for all cases.
fix(RequestMap): delete an erroneously left empty MapMarker.

* New Request Page Location Sets To Profile (#68)

* Add default location support to ClickableMap for use in NewRequestPage

* Use NEXT_SERVICE_ACCOUNT as default for tests

* Fix error on search page if geopoint does not exist

* Fix project flag in start command

* Fix UI tests. Fix request not found page

* fix(ci): parse SERVICE_ACCOUNT string from environment

* Search enhancements and fixes (#69)

* * feat(SearchPage): sort results by distance, and properly use useEffect for search param changes.
* feat(SearchPage): add simple indeterminate search progress indicator.
* fix(SearchPage): switch to useEffect approach to fix the first-search issue for logged in users.
* style(SearchPage): adjust the styling of the location entry.
* test(SearchPage): create simple search tests.
* fea(geo): Adding the default location name and switching to Madison, WI.
* refactor(google-maps): removing references to REACT_APP_GOOLGE_MAPS_API_KEY in favor of REACT_APP_FIREBASE_API_KEY.
* refactor(*): Removed the no longer needed API URL from env files.

* test(SearchPage): adjusting tests

* My Requests Page (#73)

* Start my requests page

* Add navbar link and remove distance

* Switch to sourcing .env file

* Add empty messages and headers

* Switch tests to chrome

* Switch to just an env file

* Skip failing UI test for MyRequests

* Firebase Analytics (#74)

* Start analytics work

* Add new analytics id

* Add other events. Add setting of user id.

* Add check for null in if

Co-authored-by: Farhan Ahmad <[email protected]>

* fix(app): prevent location of undefined issue by placing AnalyticsPageViewLogger within router

* Request details, acceptance/release/confirmation, search page and other fixes (#76)

* * feat(SearchPage): sort results by distance, and properly use useEffect for search param changes.
* feat(SearchPage): add simple indeterminate search progress indicator.
* fix(SearchPage): switch to useEffect approach to fix the first-search issue for logged in users.
* style(SearchPage): adjust the styling of the location entry.
* test(SearchPage): create simple search tests.
* fea(geo): Adding the default location name and switching to Madison, WI.
* refactor(google-maps): removing references to REACT_APP_GOOLGE_MAPS_API_KEY in favor of REACT_APP_FIREBASE_API_KEY.
* refactor(*): Removed the no longer needed API URL from env files.

* test(SearchPage): adjusting tests

* fix(RequestMap): now using the paths constant to generate the correct path.
fix(SearchPage): WIP, trying to fix the timing issues on search page. Not there yet.

* Only search after location is set

* feat(RequestPage): implement contact lookup, auditing, and accompaying rules.
fix(NewRequestPage): set usersWithContactInfoAccess in new requests.
fix(firestore.rules): fix the lookup in hasRequestContactAccess.

* feat(PublicComments): implement public comments on requests.
feat(Discussion): implement private comments on requests.
feat(RequestPage): implement completion workflow.
feat(RequestPage): implement release workflow.
style(dbschema): start migrating to db-json-schema.json in json-schema format.
refactor(dbschema): change action.action to action.kind.
refactor(dbschema): made the status/kind values consistent across all document types.
fix(indexes): remove unnecessary d.d.status index.

* I still need to add tests, and need help with the rules.

* feat(SearchPage): switch back to the useEffect implementation, but add debounce to address the remaining issues.
style(SearchPage): Fixed some of the odd stylign on the search page.

* fix(NewRequestPage): no longer change the user's location to the selected location.
fix(NewRequestPage): properly default immediacy value.
fix(NewRequestPage): fix the `needs` validation logic.
feat(NewRequestPage): allow anonymous users to create requests.
fix(ClickableMap): fix the jumping behavior and make the latitude/longitude property names consistent.

NOTE: This commit has insecure firestore rules that we will be fixing soon.

* fix(paths): fix linting issue.

* Committing a missed file.

Co-authored-by: Scott Prue <[email protected]>

* Data Migration For New Structure (#71)

* Start new version migration

* Add copying of needs history

* Add g/l

* Fixing some behavior based on the old data structure.

* Add generalLocationName through reverse geocoding

* Fix Geopoints. Handle formatted address not being in geocode result.

* fix(newVersionMigration): fix the request_actions doc creation.
fix(newVersionMigration): all userProfiles always have a location and numerous other adjustments to match the latest data model.
fix(newVersionMigration): add delay to conversion to address the Google Geocoding API rate limit.
feat(deleteNewCollections): add temporary script to delete collections taht the migration script creates.
feat(testQuery): add simple test query script.

Co-authored-by: Farhan Ahmad <[email protected]>

* fix(auth): fix multiple runs of user profile update (#78)

* Fix login to only call user update once

* Crate new user by email if they do not exist

* fix(docs): update README

* Blog and other fixes (#79)

* * feat(SearchPage): sort results by distance, and properly use useEffect for search param changes.
* feat(SearchPage): add simple indeterminate search progress indicator.
* fix(SearchPage): switch to useEffect approach to fix the first-search issue for logged in users.
* style(SearchPage): adjust the styling of the location entry.
* test(SearchPage): create simple search tests.
* fea(geo): Adding the default location name and switching to Madison, WI.
* refactor(google-maps): removing references to REACT_APP_GOOLGE_MAPS_API_KEY in favor of REACT_APP_FIREBASE_API_KEY.
* refactor(*): Removed the no longer needed API URL from env files.

* test(SearchPage): adjusting tests

* fix(RequestMap): now using the paths constant to generate the correct path.
fix(SearchPage): WIP, trying to fix the timing issues on search page. Not there yet.

* Only search after location is set

* feat(RequestPage): implement contact lookup, auditing, and accompaying rules.
fix(NewRequestPage): set usersWithContactInfoAccess in new requests.
fix(firestore.rules): fix the lookup in hasRequestContactAccess.

* feat(PublicComments): implement public comments on requests.
feat(Discussion): implement private comments on requests.
feat(RequestPage): implement completion workflow.
feat(RequestPage): implement release workflow.
style(dbschema): start migrating to db-json-schema.json in json-schema format.
refactor(dbschema): change action.action to action.kind.
refactor(dbschema): made the status/kind values consistent across all document types.
fix(indexes): remove unnecessary d.d.status index.

* I still need to add tests, and need help with the rules.

* feat(SearchPage): switch back to the useEffect implementation, but add debounce to address the remaining issues.
style(SearchPage): Fixed some of the odd stylign on the search page.

* blog migration to next branch

* fix(NewRequestPage): no longer change the user's location to the selected location.
fix(NewRequestPage): properly default immediacy value.
fix(NewRequestPage): fix the `needs` validation logic.
feat(NewRequestPage): allow anonymous users to create requests.
fix(ClickableMap): fix the jumping behavior and make the latitude/longitude property names consistent.

NOTE: This commit has insecure firestore rules that we will be fixing soon.

* fix(paths): fix linting issue.

* fixing blog

* Committing a missed file.

* fix(routes): rearrange the blog routes to the single page is shown.
style(blog): adjust styling on the blog listing and single entry pages.

* fix(db.json-schema): fix the requests_actions collection name.
fix(ClickableMap): now using administrative_area_level_3 to name location.

* fix(NewRequestPage): adjust the formatting of requests_actions creation.
refactor(db.json-schema): move all documents to the new json-schema format.
refactor(requests): change request.d.coordinates to request.d.generalLocation.
refactor(requests): change request.d.createdByInfo.userProfileId to uid.
fix(LoginPage): fix the redirection logic which was preventing the NEW_USER_PATH redirection.
feat(Logout): create a new logout page for simplifying some links.
fix(NewUser): require auth.
feat(ClickableMap): support passing in null location.
fix(NewUser): fix the ClickableMap compatiblity issue that I recently created.
style(Search): add Google info.

* fix(NewRequest): add preciseLocationName to private info

* refactor(LogoutPage): use useAuth instead useFirebaseApp.

* test(SearchPage): fix the search page test

Co-authored-by: Scott Prue <[email protected]>
Co-authored-by: Mauricio Soto <[email protected]>
Co-authored-by: Mauricio Soto <[email protected]>

* Include users_privileged parameters in indexUser function (#80)

* fix: pass request context to morning emials

* fix: use correct query for requests in morningEmailCentral cloud function

* Prerelease fixes (#81)

* fix(RequestPage): stop using the private `request` collection.
fix(NewUser): propagate the user properties to all collections.
refactor(*): removed the preciseLocationName concept.
fix(SearchPage): use generalLocationName instead of preciseLocationName for users.
feature(MyRequests): display first name and general location for easier identification.
fix(MyRequests): filter by 'owner' instead of 'createdBy'. We will add the requests that you created in the future.

* fix(firebase-rules): allow access to requests_discussions

* Fix My Requests

* Move useNewRequestPage hook to its own file
* Fix issue with missing first name in RequestActionDialog

* Start rules cleanup

* fix(newVersionMigration): set role='user' for migrated users.
fix(ContactInfo): stop retrying after failing too many times.
fix(firestore.rules): remove the unnecessary deny-all rule.
fix(firestore.rules): fix the requests_contacts and requests_discussions rules.

* refactor(.gitignore): add notes.txt :)

* fix(indexUser): fix incorrect assumption about the before/after changes.
test(indexUser): add additional test cases.

* fix(newVersionMigration): set {requests,request_public}.generalLocation and minor other adjustments.
feat(contactInfo): support displaying old/converted 'contactInfo' field.
fix(useNewRequestPage): do not assume the user is logged in.
fix(firestore.rules): fix the public discussion rule.

Co-authored-by: Scott Prue <[email protected]>

* New prerelease fixes (#82)

* fix(Discussion): add the permission-denied timing workaround.

* Update dev dependency versions including cypress

* Small fixes with new request and new user

* style(*): updating text on donate and homepage.

* Fix needFinancialAssistance writing

Co-authored-by: Farhan Ahmad <[email protected]>

Co-authored-by: Farhan Ahmad <[email protected]>
Co-authored-by: Mauricio Soto <[email protected]>
Co-authored-by: Mauricio Soto <[email protected]>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants