Skip to content

Commit

Permalink
Release copy (#98)
Browse files Browse the repository at this point in the history
* Add Jest testing (#63)

* Initial boilerplate setup

* Add ArticleFactory, TestingDBConnection, FactoryUtils, placeholder article test file

* Add test cases on getAllArticles

* Create PublicationFactory, add tests for getAllArticles, getArticlesByPublicationID(s), getArticlesByPublicationSlug(s)

* Add hooks

* Update README

* Add pr changes

* Add pr changes

* Add tests for incrementShoutouts, searchArticle, getArticlesAfterDate

* Add publication tests and refactor factory files

* Remove test db open message

* Update src/tests/article.test.ts

Co-authored-by: Archit Mehta <[email protected]>

* Update src/tests/data/ArticleFactory.ts

Co-authored-by: Archit Mehta <[email protected]>

* Refactor code

* Refactor byDate

Co-authored-by: Kidus Zegeye <[email protected]>
Co-authored-by: Archit Mehta <[email protected]>

* Add Docstrings to Test Factory Functions (#64)

* Initial boilerplate setup

* Add ArticleFactory, TestingDBConnection, FactoryUtils, placeholder article test file

* Add test cases on getAllArticles

* Create PublicationFactory, add tests for getAllArticles, getArticlesByPublicationID(s), getArticlesByPublicationSlug(s)

* Add hooks

* Update README

* Add pr changes

* Add pr changes

* Add tests for incrementShoutouts, searchArticle, getArticlesAfterDate

* Add publication tests and refactor factory files

* Remove test db open message

* Update src/tests/article.test.ts

Co-authored-by: Archit Mehta <[email protected]>

* Update src/tests/data/ArticleFactory.ts

Co-authored-by: Archit Mehta <[email protected]>

* Refactor code

* Refactor byDate

* Add docstrings

Co-authored-by: Kidus Zegeye <[email protected]>
Co-authored-by: Archit Mehta <[email protected]>

* Update README.md

* Implement community board models (#65)

* Implemented community board models

- implemented Flyer and Organization models for community board feature
- modified User model
- updated typescript version to 4.0.5 to resolve es lint issue

* Revert package.json changes

- reverted package.json changes that are addressed in a different pr

* Add magazines to weekly debrief (#66)

* Implemented community board models

- implemented Flyer and Organization models for community board feature
- modified User model
- updated typescript version to 4.0.5 to resolve es lint issue

* Implemented weekly debrief magazines

- added magazines to weekly debrief feature
- updated user and weekly debrief models to allow tracking of read magazines
- updated logic in user and weekly debrief controllers to enable reading of magazines

* Revert package.json changes

- reverted package.json changes back to the original file
- added additional rules to eslintrc to suppress es lint warnings

* Create jest testing for magazines

- added jest test cases for magazines

* Implement jest testing for User

- implemented unit testing for UserRepo
- indirectly test Weekly Debrief with User unit tests

* Update gitignore

- updated gitignore file to include secrets folder

* Implement reshuffle articles (#68)

* Add Docstrings to Test Factory Functions (#64)

* Initial boilerplate setup

* Add ArticleFactory, TestingDBConnection, FactoryUtils, placeholder article test file

* Add test cases on getAllArticles

* Create PublicationFactory, add tests for getAllArticles, getArticlesByPublicationID(s), getArticlesByPublicationSlug(s)

* Add hooks

* Update README

* Add pr changes

* Add pr changes

* Add tests for incrementShoutouts, searchArticle, getArticlesAfterDate

* Add publication tests and refactor factory files

* Remove test db open message

* Update src/tests/article.test.ts

Co-authored-by: Archit Mehta <[email protected]>

* Update src/tests/data/ArticleFactory.ts

Co-authored-by: Archit Mehta <[email protected]>

* Refactor code

* Refactor byDate

* Add docstrings

Co-authored-by: Kidus Zegeye <[email protected]>
Co-authored-by: Archit Mehta <[email protected]>

Implement shuffle article function

try to implement reshuffling with aggregate

* Implement reshuffling of articles

* Revert package.json, update eslint and update .gitignore to match main branch

---------

Co-authored-by: Kidus Zegeye <[email protected]>

* Implement magazine search (#69)

* Implement magazine search

- implemented searching for magazines

* update magazinerepo

* Add unit test for magazine search

- created unit test for MagazineRepo.searchMagazine

* Convert result of shuffling resolver to ArticleModel (#71)

* Add 3 new publications (Cornell Daily Sun, Collective X, and Cornell Healthcare Review) to publications.js (#70)

* Resolve merge conflicts in publications.json (keep release version) (#76)

* Kidus/filter articles (#48)

* Add covid filter to all article query functions

* Add filtering capability

* Fix getArticleById filter

* Create filter migration script

* Finish migration script

* Add toggle for filtering enforcement

* Implement PR changes

Co-authored-by: Kidus Zegeye <[email protected]>

* Fix BRSN's url

* Migrate bookmark resolver and update User Repo & Entity

* Resolve remaining merge conflicts

* Implement chronological sorting

* Update prod deployment script

* Remove unused MagazineURL index from Magazine DB

* Add no rules to publications.json

* Remove trailing comma

---------

Co-authored-by: Kidus Zegeye <[email protected]>
Co-authored-by: Kidus Zegeye <[email protected]>
Co-authored-by: Archit404Error <[email protected]>

* Revert "Resolve merge conflicts in publications.json (keep release version) (#76)" (#77)

This reverts commit eccf00c.

* fix merge conflicts (#78)

* Kidus/filter articles (#48)

* Add covid filter to all article query functions

* Add filtering capability

* Fix getArticleById filter

* Create filter migration script

* Finish migration script

* Add toggle for filtering enforcement

* Implement PR changes

Co-authored-by: Kidus Zegeye <[email protected]>

* Fix BRSN's url

* Migrate bookmark resolver and update User Repo & Entity

* Resolve remaining merge conflicts

* Implement chronological sorting

* Update prod deployment script

* Remove unused MagazineURL index from Magazine DB

* Add no rules to publications.json

* Remove trailing comma

---------

Co-authored-by: Kidus Zegeye <[email protected]>
Co-authored-by: Kidus Zegeye <[email protected]>
Co-authored-by: Archit404Error <[email protected]>

* Implement community board [1/7] (#81)

* Begin implementing FlyerRepo

- implemented basic FlyerRepo functions
- updated Flyer model to support uploading in app instead of through a google form

* Implement flyers for community board

- alphabetized imports and fields
- finished implementing flyers for community board

* Address pr review comments

- addressed pr review comments
- removed redundant filtering in FlyerRepo
- added checks for null return values in FlyerRepo
- alphabetized imports and exports

* Add imageURL field to Magazine entity. (#73)

* Add no rules to volume-backend's publications.json (#82)

* Implement community board (flyer tests) [2/7] (#84)

* Begin implementing FlyerRepo

- implemented basic FlyerRepo functions
- updated Flyer model to support uploading in app instead of through a google form

* Implement flyers for community board

- alphabetized imports and fields
- finished implementing flyers for community board

* Implement jest testing for flyers

- created jest unit testing for FlyerRepo
- created FlyerFactory to help with jest testing

* Remove isFiltered field from Flyer entity

- removed redundant isFiltered field from Flyer entity (already checked in microservice)
- updated FlyerRepo and jest testing to reflect changes

* Alphabetize imports and exports

- alphabetized imports and exports in FlyerRepo, flyer.test, and FlyerFactory

* Revert merge conflict changes

- reverted merge conflict changes (accept incoming when actually wanted to keep current)

* Address review comments

- alphabetize imports
- add unit test cases for FlyerRepo including searching for 0 flyers and maximum limit in response
- added unit test case for FlyerRepo.getTrendingFlyers

* Address review comments (Shungo)

- added spaces between test cases

* Implement community board organizations (#85)

- resolve merge conflicts in Flyer.ts and FlyerFactory.ts
- update Organization model
- implement logic in OrganizationRepo
- implement queries and mutations in OrganizationResolver

* Implement community board (organization tests) [4/7] (#86)

* Implement community board organizations

- resolve merge conflicts in Flyer.ts and FlyerFactory.ts
- update Organization model
- implement logic in OrganizationRepo
- implement queries and mutations in OrganizationResolver

* Implement jest testing for organizations

- implemented jest testing for community board organizations
- created organizations.json with 3 onboarded organizations
- added FlyerResolver and OrganizationResolver to app.ts

* Implement community board (user queries/mutations) [5/7] (#87)

* Kidus/filter articles (#48)

* Add covid filter to all article query functions

* Add filtering capability

* Fix getArticleById filter

* Create filter migration script

* Finish migration script

* Add toggle for filtering enforcement

* Implement PR changes

Co-authored-by: Kidus Zegeye <[email protected]>

* Fix BRSN's url

* Migrate bookmark resolver and update User Repo & Entity

* Resolve remaining merge conflicts

* Implement chronological sorting

* Update prod deployment script

* Remove unused MagazineURL index from Magazine DB

* Add no rules to publications.json

* Remove trailing comma

* Begin implementing FlyerRepo

- implemented basic FlyerRepo functions
- updated Flyer model to support uploading in app instead of through a google form

* Implement basic community board features

- finished implementing basic organization and flyer repos/resolvers
- created jest testing for organization and flyer repos

* Remove unnecessary OrganizationRepo function

- removed content types route from organization repo and organization resolver

* Implement user routes for community board

- implemented user routes for community board to allow following orgs and reading flyers
- added jest unit test cases for new UserRepo functions

* Implement mutations for following and unfollowing organizations

- added resolvers to UserResolver for following and unfollowing organizations
- updated documentation in UserRepo
- added import of FlyerRepo in app.ts

* Address pr review comments

- fix spelling

* Address pr review comments

- made style consistent in UserRepo by checking for if(user) in appendReadFlyer, appendReadArticle, and appendReadMagazine

---------

Co-authored-by: Kidus Zegeye <[email protected]>
Co-authored-by: Kidus Zegeye <[email protected]>
Co-authored-by: Archit404Error <[email protected]>

* Onboard organizations (#90)

- add organizations from volume-microservice onto organizations.json

* Implement community board (categories and org lists) [6/7] (#89)

* Implement community board organizations

- resolve merge conflicts in Flyer.ts and FlyerFactory.ts
- update Organization model
- implement logic in OrganizationRepo
- implement queries and mutations in OrganizationResolver

* Implement jest testing for organizations

- implemented jest testing for community board organizations
- created organizations.json with 3 onboarded organizations
- added FlyerResolver and OrganizationResolver to app.ts

* initial commit

* Implement organizations as list for flyer model

- updated flyer model to allow a list of organizations and organizationSlugs to be associated with each flyer
- updated flyer and organization queries accordingly
- added unit jest test cases and update old ones accordingly

* Address pr review comments

- removed redundant resolvers
- updated getOrganizationByCategory test

* Address pr review comments (kate)

- updated docs in OrganizationResolver

* Implement cboard start and end dates (#93)

* Implement end dates

- implemented start and end dates
- changed shoutouts to times clicked
- updated testing and documentation to reflect changes

* Address pr review comments

- removed async from getFlyersBeforeDate and getFlyersAfterDate
- updated documentation in FactoryUtils

* add incrementTimesClicked to resolver

* update organization shoutouts query (#94)

* Implement end dates

- implemented start and end dates
- changed shoutouts to times clicked
- updated testing and documentation to reflect changes

* Address pr review comments

- removed async from getFlyersBeforeDate and getFlyersAfterDate
- updated documentation in FactoryUtils

* add incrementTimesClicked to resolver

* Update organization clicks

- changed shoutouts query to clicks in OrganizationResolver

* Implement trending flyers logic (#95)

- updated trending flyers logic
- updated FlyerRepo
- updated documentation in FlyerResolver

* Fixed notification issue (#97)

---------

Co-authored-by: Kidus Zegeye <[email protected]>
Co-authored-by: Kidus Zegeye <[email protected]>
Co-authored-by: Archit Mehta <[email protected]>
Co-authored-by: Shungo Najima <[email protected]>
Co-authored-by: Isaac Han <[email protected]>
Co-authored-by: Sasha Loayza <[email protected]>
  • Loading branch information
7 people authored Aug 26, 2023
1 parent 174c7e5 commit e48d0c9
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 13 deletions.
1 change: 0 additions & 1 deletion src/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import admin from 'firebase-admin';
import Express from 'express';
import { buildSchema } from 'type-graphql';


import { ApolloServer } from 'apollo-server-express';
import ArticleResolver from './resolvers/ArticleResolver';
import ArticleRepo from './repos/ArticleRepo';
Expand Down
20 changes: 11 additions & 9 deletions src/repos/NotificationRepo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,15 +59,17 @@ const sendNotif = async (
};

// Send notification to FCM servers
admin
.messaging()
.sendToDevice(deviceToken, message, options)
.then((response) => {
console.log(response);
})
.catch((error) => {
console.log(error);
});
if (deviceToken !== '') {
admin
.messaging()
.sendToDevice(deviceToken, message, options)
.then((response) => {
console.log(response);
})
.catch((error) => {
console.log(error);
});
}
};

const sendNewArticleNotification = async (
Expand Down
6 changes: 3 additions & 3 deletions src/repos/UserRepo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -131,9 +131,9 @@ const appendReadArticle = async (uuid: string, articleID: string): Promise<User>
const article = await ArticleRepo.getArticleByID(articleID);
const checkDuplicates = (prev: boolean, cur: Article) => prev || cur.id === articleID;

if (article && !user.readArticles.reduce(checkDuplicates, false)) {
user.readArticles.push(article);
}
if (article && !user.readArticles.reduce(checkDuplicates, false)) {
user.readArticles.push(article);
}

user.save();
}
Expand Down

0 comments on commit e48d0c9

Please sign in to comment.