-
Notifications
You must be signed in to change notification settings - Fork 0
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
Create editFlyer
mutation
#105
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good to go, just a few minor comments below. I like the detail you put into the PR description and how you explained your testing procedure in detail -- keep it up!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good to go
* 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 <4architmehta@gmail.com> * Update src/tests/data/ArticleFactory.ts Co-authored-by: Archit Mehta <4architmehta@gmail.com> * Refactor code * Refactor byDate Co-authored-by: Kidus Zegeye <kmz25@cornell.edu> Co-authored-by: Archit Mehta <4architmehta@gmail.com> * 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 <4architmehta@gmail.com> * Update src/tests/data/ArticleFactory.ts Co-authored-by: Archit Mehta <4architmehta@gmail.com> * Refactor code * Refactor byDate * Add docstrings Co-authored-by: Kidus Zegeye <kmz25@cornell.edu> Co-authored-by: Archit Mehta <4architmehta@gmail.com> * 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 <4architmehta@gmail.com> * Update src/tests/data/ArticleFactory.ts Co-authored-by: Archit Mehta <4architmehta@gmail.com> * Refactor code * Refactor byDate * Add docstrings Co-authored-by: Kidus Zegeye <kmz25@cornell.edu> Co-authored-by: Archit Mehta <4architmehta@gmail.com> 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 <51487468+kidzegeye@users.noreply.github.com> * 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 <kmz25@cornell.edu> * 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 <51487468+kidzegeye@users.noreply.github.com> Co-authored-by: Kidus Zegeye <kmz25@cornell.edu> Co-authored-by: Archit404Error <4architmehta@gmail.com> * 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 <kmz25@cornell.edu> * 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 <51487468+kidzegeye@users.noreply.github.com> Co-authored-by: Kidus Zegeye <kmz25@cornell.edu> Co-authored-by: Archit404Error <4architmehta@gmail.com> * 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 <kmz25@cornell.edu> * 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 <51487468+kidzegeye@users.noreply.github.com> Co-authored-by: Kidus Zegeye <kmz25@cornell.edu> Co-authored-by: Archit404Error <4architmehta@gmail.com> * 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) * Flyer Notifications + Org/Flyer Model Changes (#99) * Fixed notification issue * Added flyer notification * Added flyer notification * Updated Organization and Flyer models * Updated test cases * Inline notification calls * Improve Search Algorithm (#101) * Update README.md start instructions * Update search function for articles * Remove console log * Update articles search to use text search instead of regex * Update search for Flyers and Magazines * Update documentation, remove unused Fuse package * Fix README.md start docs * Filter out past flyers during flyers search * Fix formatting, improve concision * Remove start.md * Changed indexing method to being declared on the models * Update README.md Co-authored-by: Archit Mehta <4architmehta@gmail.com> --------- Co-authored-by: Archit Mehta <4architmehta@gmail.com> * getFlyersByCategorySlug Query (#100) * Fixed notification issue * Added flyer notification * Added flyer notification * Updated Organization and Flyer models * Updated test cases * Added getFlyersByCategorySlug query * Update query description * Inline notification calls * Update flyer.test.ts * Update flyer.test.ts * Merge `vin/create-flyer` to `main` (#104) * Fixed notification issue * Added flyer notification * Added flyer notification * Updated Organization and Flyer models * Updated test cases * Added getFlyersByCategorySlug query * Update query description * Inline notification calls * Add createFlyer mutation * `deleteFlyer` mutation (#103) * Add deleteFlyer mutation * Address PR comments * Update utils.ts * Update FlyerRepo.ts * Trendiness Update and Migration Script for New Flyers Model (#106) * Add migration script to update data based on new Flyers schema * Update Flyer trendiness * Fix comments * Clean up syntax for get trending flyers * Remove unnecessary createSpecificsByIndex function * Zach/trendiness and migration hot fix (#107) * Add migration script to update data based on new Flyers schema * Update Flyer trendiness * Fix comments * Clean up syntax for get trending flyers * Remove unnecessary createSpecificsByIndex function * Fix TypeScript compilation error * Micro PR for Flyers categorySlug migration (#108) * Add migration script to update data based on new Flyers schema * Update Flyer trendiness * Fix comments * Clean up syntax for get trending flyers * Remove unnecessary createSpecificsByIndex function * Fix TypeScript compilation error * Update migration script to account for category slug * Fix formatting for flyers test * Create `editFlyer` mutation (#105) * Add `editFlyer` * Address PR comments * `checkAccessCode` query for Organization authentication (#109) * Added Organization authentication * Updated Authorization --------- Co-authored-by: Kidus Zegeye <51487468+kidzegeye@users.noreply.github.com> Co-authored-by: Kidus Zegeye <kmz25@cornell.edu> Co-authored-by: Archit Mehta <4architmehta@gmail.com> Co-authored-by: Shungo Najima <sn685@cornell.edu> Co-authored-by: Isaac Han <isaac.han100@gmail.com> Co-authored-by: Sasha Loayza <104698418+SashaLoayza@users.noreply.github.com> Co-authored-by: Zachary Seidner <58796478+zachseidner1@users.noreply.github.com>
* 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 <4architmehta@gmail.com> * Update src/tests/data/ArticleFactory.ts Co-authored-by: Archit Mehta <4architmehta@gmail.com> * Refactor code * Refactor byDate Co-authored-by: Kidus Zegeye <kmz25@cornell.edu> Co-authored-by: Archit Mehta <4architmehta@gmail.com> * 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 <4architmehta@gmail.com> * Update src/tests/data/ArticleFactory.ts Co-authored-by: Archit Mehta <4architmehta@gmail.com> * Refactor code * Refactor byDate * Add docstrings Co-authored-by: Kidus Zegeye <kmz25@cornell.edu> Co-authored-by: Archit Mehta <4architmehta@gmail.com> * 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 <4architmehta@gmail.com> * Update src/tests/data/ArticleFactory.ts Co-authored-by: Archit Mehta <4architmehta@gmail.com> * Refactor code * Refactor byDate * Add docstrings Co-authored-by: Kidus Zegeye <kmz25@cornell.edu> Co-authored-by: Archit Mehta <4architmehta@gmail.com> 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 <51487468+kidzegeye@users.noreply.github.com> * 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 <kmz25@cornell.edu> * 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 <51487468+kidzegeye@users.noreply.github.com> Co-authored-by: Kidus Zegeye <kmz25@cornell.edu> Co-authored-by: Archit404Error <4architmehta@gmail.com> * 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 <kmz25@cornell.edu> * 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 <51487468+kidzegeye@users.noreply.github.com> Co-authored-by: Kidus Zegeye <kmz25@cornell.edu> Co-authored-by: Archit404Error <4architmehta@gmail.com> * 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 <kmz25@cornell.edu> * 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 <51487468+kidzegeye@users.noreply.github.com> Co-authored-by: Kidus Zegeye <kmz25@cornell.edu> Co-authored-by: Archit404Error <4architmehta@gmail.com> * 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) * Flyer Notifications + Org/Flyer Model Changes (#99) * Fixed notification issue * Added flyer notification * Added flyer notification * Updated Organization and Flyer models * Updated test cases * Inline notification calls * Improve Search Algorithm (#101) * Update README.md start instructions * Update search function for articles * Remove console log * Update articles search to use text search instead of regex * Update search for Flyers and Magazines * Update documentation, remove unused Fuse package * Fix README.md start docs * Filter out past flyers during flyers search * Fix formatting, improve concision * Remove start.md * Changed indexing method to being declared on the models * Update README.md Co-authored-by: Archit Mehta <4architmehta@gmail.com> --------- Co-authored-by: Archit Mehta <4architmehta@gmail.com> * getFlyersByCategorySlug Query (#100) * Fixed notification issue * Added flyer notification * Added flyer notification * Updated Organization and Flyer models * Updated test cases * Added getFlyersByCategorySlug query * Update query description * Inline notification calls * Update flyer.test.ts * Update flyer.test.ts * Merge `vin/create-flyer` to `main` (#104) * Fixed notification issue * Added flyer notification * Added flyer notification * Updated Organization and Flyer models * Updated test cases * Added getFlyersByCategorySlug query * Update query description * Inline notification calls * Add createFlyer mutation * `deleteFlyer` mutation (#103) * Add deleteFlyer mutation * Address PR comments * Update utils.ts * Update FlyerRepo.ts * Trendiness Update and Migration Script for New Flyers Model (#106) * Add migration script to update data based on new Flyers schema * Update Flyer trendiness * Fix comments * Clean up syntax for get trending flyers * Remove unnecessary createSpecificsByIndex function * Zach/trendiness and migration hot fix (#107) * Add migration script to update data based on new Flyers schema * Update Flyer trendiness * Fix comments * Clean up syntax for get trending flyers * Remove unnecessary createSpecificsByIndex function * Fix TypeScript compilation error * Micro PR for Flyers categorySlug migration (#108) * Add migration script to update data based on new Flyers schema * Update Flyer trendiness * Fix comments * Clean up syntax for get trending flyers * Remove unnecessary createSpecificsByIndex function * Fix TypeScript compilation error * Update migration script to account for category slug * Fix formatting for flyers test * Create `editFlyer` mutation (#105) * Add `editFlyer` * Address PR comments * `checkAccessCode` query for Organization authentication (#109) * Added Organization authentication * Updated Authorization * Implemented getAllFlyerCategories and tests (#110) * Implemented getAllFlyerCategories and tests * update jest * update jest * implemented suggestions from zach, vin, and archit * got rid of ESLint comment * fixed names for tests * Added loops to test cases * Fixed test case to create flyers with the same category * Changed 'push' to 'concat' --------- Co-authored-by: Cindy <cl2329@cornell.edu> * Changing specifications for getFlyersBeforeDate and getFlyersAfterDate (#112) * Cindy/flyer categories (#113) * Implemented getAllFlyerCategories and tests * update jest * update jest * implemented suggestions from zach, vin, and archit * got rid of ESLint comment * fixed names for tests * Added loops to test cases * Fixed test case to create flyers with the same category * Changed 'push' to 'concat' * Updated `getAllFlyerCategories` --------- Co-authored-by: Cindy <cl2329@cornell.edu> Co-authored-by: Vin Bui <vdb23@cornell.edu> * Increased HTTP request size (#114) * Added limit to JSON request body * Update package-lock.json * Add error message (#116) * Added limit to JSON request body * Update package-lock.json * Added error message --------- Co-authored-by: Kidus Zegeye <51487468+kidzegeye@users.noreply.github.com> Co-authored-by: Kidus Zegeye <kmz25@cornell.edu> Co-authored-by: Archit Mehta <4architmehta@gmail.com> Co-authored-by: Shungo Najima <sn685@cornell.edu> Co-authored-by: Isaac Han <isaac.han100@gmail.com> Co-authored-by: Sasha Loayza <104698418+SashaLoayza@users.noreply.github.com> Co-authored-by: Zachary Seidner <58796478+zachseidner1@users.noreply.github.com> Co-authored-by: cindy-x-liang <67083541+cindy-x-liang@users.noreply.github.com> Co-authored-by: Cindy <cl2329@cornell.edu> Co-authored-by: Aayush <68517064+Aayush-Agnihotri@users.noreply.github.com>
* 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 <4architmehta@gmail.com> * Update src/tests/data/ArticleFactory.ts Co-authored-by: Archit Mehta <4architmehta@gmail.com> * Refactor code * Refactor byDate Co-authored-by: Kidus Zegeye <kmz25@cornell.edu> Co-authored-by: Archit Mehta <4architmehta@gmail.com> * 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 <4architmehta@gmail.com> * Update src/tests/data/ArticleFactory.ts Co-authored-by: Archit Mehta <4architmehta@gmail.com> * Refactor code * Refactor byDate * Add docstrings Co-authored-by: Kidus Zegeye <kmz25@cornell.edu> Co-authored-by: Archit Mehta <4architmehta@gmail.com> * 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 <4architmehta@gmail.com> * Update src/tests/data/ArticleFactory.ts Co-authored-by: Archit Mehta <4architmehta@gmail.com> * Refactor code * Refactor byDate * Add docstrings Co-authored-by: Kidus Zegeye <kmz25@cornell.edu> Co-authored-by: Archit Mehta <4architmehta@gmail.com> 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 <51487468+kidzegeye@users.noreply.github.com> * 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 <kmz25@cornell.edu> * 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 <51487468+kidzegeye@users.noreply.github.com> Co-authored-by: Kidus Zegeye <kmz25@cornell.edu> Co-authored-by: Archit404Error <4architmehta@gmail.com> * 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 <kmz25@cornell.edu> * 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 <51487468+kidzegeye@users.noreply.github.com> Co-authored-by: Kidus Zegeye <kmz25@cornell.edu> Co-authored-by: Archit404Error <4architmehta@gmail.com> * 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 <kmz25@cornell.edu> * 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 <51487468+kidzegeye@users.noreply.github.com> Co-authored-by: Kidus Zegeye <kmz25@cornell.edu> Co-authored-by: Archit404Error <4architmehta@gmail.com> * 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) * Flyer Notifications + Org/Flyer Model Changes (#99) * Fixed notification issue * Added flyer notification * Added flyer notification * Updated Organization and Flyer models * Updated test cases * Inline notification calls * Improve Search Algorithm (#101) * Update README.md start instructions * Update search function for articles * Remove console log * Update articles search to use text search instead of regex * Update search for Flyers and Magazines * Update documentation, remove unused Fuse package * Fix README.md start docs * Filter out past flyers during flyers search * Fix formatting, improve concision * Remove start.md * Changed indexing method to being declared on the models * Update README.md Co-authored-by: Archit Mehta <4architmehta@gmail.com> --------- Co-authored-by: Archit Mehta <4architmehta@gmail.com> * getFlyersByCategorySlug Query (#100) * Fixed notification issue * Added flyer notification * Added flyer notification * Updated Organization and Flyer models * Updated test cases * Added getFlyersByCategorySlug query * Update query description * Inline notification calls * Update flyer.test.ts * Update flyer.test.ts * Merge `vin/create-flyer` to `main` (#104) * Fixed notification issue * Added flyer notification * Added flyer notification * Updated Organization and Flyer models * Updated test cases * Added getFlyersByCategorySlug query * Update query description * Inline notification calls * Add createFlyer mutation * `deleteFlyer` mutation (#103) * Add deleteFlyer mutation * Address PR comments * Update utils.ts * Update FlyerRepo.ts * Trendiness Update and Migration Script for New Flyers Model (#106) * Add migration script to update data based on new Flyers schema * Update Flyer trendiness * Fix comments * Clean up syntax for get trending flyers * Remove unnecessary createSpecificsByIndex function * Zach/trendiness and migration hot fix (#107) * Add migration script to update data based on new Flyers schema * Update Flyer trendiness * Fix comments * Clean up syntax for get trending flyers * Remove unnecessary createSpecificsByIndex function * Fix TypeScript compilation error * Micro PR for Flyers categorySlug migration (#108) * Add migration script to update data based on new Flyers schema * Update Flyer trendiness * Fix comments * Clean up syntax for get trending flyers * Remove unnecessary createSpecificsByIndex function * Fix TypeScript compilation error * Update migration script to account for category slug * Fix formatting for flyers test * Create `editFlyer` mutation (#105) * Add `editFlyer` * Address PR comments * `checkAccessCode` query for Organization authentication (#109) * Added Organization authentication * Updated Authorization * Implemented getAllFlyerCategories and tests (#110) * Implemented getAllFlyerCategories and tests * update jest * update jest * implemented suggestions from zach, vin, and archit * got rid of ESLint comment * fixed names for tests * Added loops to test cases * Fixed test case to create flyers with the same category * Changed 'push' to 'concat' --------- Co-authored-by: Cindy <cl2329@cornell.edu> * Changing specifications for getFlyersBeforeDate and getFlyersAfterDate (#112) * Cindy/flyer categories (#113) * Implemented getAllFlyerCategories and tests * update jest * update jest * implemented suggestions from zach, vin, and archit * got rid of ESLint comment * fixed names for tests * Added loops to test cases * Fixed test case to create flyers with the same category * Changed 'push' to 'concat' * Updated `getAllFlyerCategories` --------- Co-authored-by: Cindy <cl2329@cornell.edu> Co-authored-by: Vin Bui <vdb23@cornell.edu> * Increased HTTP request size (#114) * Added limit to JSON request body * Update package-lock.json * Add error message (#116) * Added limit to JSON request body * Update package-lock.json * Added error message * Update FlyerMiddleware.ts --------- Co-authored-by: Kidus Zegeye <51487468+kidzegeye@users.noreply.github.com> Co-authored-by: Kidus Zegeye <kmz25@cornell.edu> Co-authored-by: Archit Mehta <4architmehta@gmail.com> Co-authored-by: Shungo Najima <sn685@cornell.edu> Co-authored-by: Isaac Han <isaac.han100@gmail.com> Co-authored-by: Sasha Loayza <104698418+SashaLoayza@users.noreply.github.com> Co-authored-by: Zachary Seidner <58796478+zachseidner1@users.noreply.github.com> Co-authored-by: cindy-x-liang <67083541+cindy-x-liang@users.noreply.github.com> Co-authored-by: Cindy <cl2329@cornell.edu> Co-authored-by: Aayush <68517064+Aayush-Agnihotri@users.noreply.github.com>
* 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 <4architmehta@gmail.com> * Update src/tests/data/ArticleFactory.ts Co-authored-by: Archit Mehta <4architmehta@gmail.com> * Refactor code * Refactor byDate Co-authored-by: Kidus Zegeye <kmz25@cornell.edu> Co-authored-by: Archit Mehta <4architmehta@gmail.com> * 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 <4architmehta@gmail.com> * Update src/tests/data/ArticleFactory.ts Co-authored-by: Archit Mehta <4architmehta@gmail.com> * Refactor code * Refactor byDate * Add docstrings Co-authored-by: Kidus Zegeye <kmz25@cornell.edu> Co-authored-by: Archit Mehta <4architmehta@gmail.com> * 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 <4architmehta@gmail.com> * Update src/tests/data/ArticleFactory.ts Co-authored-by: Archit Mehta <4architmehta@gmail.com> * Refactor code * Refactor byDate * Add docstrings Co-authored-by: Kidus Zegeye <kmz25@cornell.edu> Co-authored-by: Archit Mehta <4architmehta@gmail.com> 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 <51487468+kidzegeye@users.noreply.github.com> * 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 <kmz25@cornell.edu> * 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 <51487468+kidzegeye@users.noreply.github.com> Co-authored-by: Kidus Zegeye <kmz25@cornell.edu> Co-authored-by: Archit404Error <4architmehta@gmail.com> * 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 <kmz25@cornell.edu> * 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 <51487468+kidzegeye@users.noreply.github.com> Co-authored-by: Kidus Zegeye <kmz25@cornell.edu> Co-authored-by: Archit404Error <4architmehta@gmail.com> * 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 <kmz25@cornell.edu> * 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 <51487468+kidzegeye@users.noreply.github.com> Co-authored-by: Kidus Zegeye <kmz25@cornell.edu> Co-authored-by: Archit404Error <4architmehta@gmail.com> * 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) * Flyer Notifications + Org/Flyer Model Changes (#99) * Fixed notification issue * Added flyer notification * Added flyer notification * Updated Organization and Flyer models * Updated test cases * Inline notification calls * Improve Search Algorithm (#101) * Update README.md start instructions * Update search function for articles * Remove console log * Update articles search to use text search instead of regex * Update search for Flyers and Magazines * Update documentation, remove unused Fuse package * Fix README.md start docs * Filter out past flyers during flyers search * Fix formatting, improve concision * Remove start.md * Changed indexing method to being declared on the models * Update README.md Co-authored-by: Archit Mehta <4architmehta@gmail.com> --------- Co-authored-by: Archit Mehta <4architmehta@gmail.com> * getFlyersByCategorySlug Query (#100) * Fixed notification issue * Added flyer notification * Added flyer notification * Updated Organization and Flyer models * Updated test cases * Added getFlyersByCategorySlug query * Update query description * Inline notification calls * Update flyer.test.ts * Update flyer.test.ts * Merge `vin/create-flyer` to `main` (#104) * Fixed notification issue * Added flyer notification * Added flyer notification * Updated Organization and Flyer models * Updated test cases * Added getFlyersByCategorySlug query * Update query description * Inline notification calls * Add createFlyer mutation * `deleteFlyer` mutation (#103) * Add deleteFlyer mutation * Address PR comments * Update utils.ts * Update FlyerRepo.ts * Trendiness Update and Migration Script for New Flyers Model (#106) * Add migration script to update data based on new Flyers schema * Update Flyer trendiness * Fix comments * Clean up syntax for get trending flyers * Remove unnecessary createSpecificsByIndex function * Zach/trendiness and migration hot fix (#107) * Add migration script to update data based on new Flyers schema * Update Flyer trendiness * Fix comments * Clean up syntax for get trending flyers * Remove unnecessary createSpecificsByIndex function * Fix TypeScript compilation error * Micro PR for Flyers categorySlug migration (#108) * Add migration script to update data based on new Flyers schema * Update Flyer trendiness * Fix comments * Clean up syntax for get trending flyers * Remove unnecessary createSpecificsByIndex function * Fix TypeScript compilation error * Update migration script to account for category slug * Fix formatting for flyers test * Create `editFlyer` mutation (#105) * Add `editFlyer` * Address PR comments * `checkAccessCode` query for Organization authentication (#109) * Added Organization authentication * Updated Authorization * Implemented getAllFlyerCategories and tests (#110) * Implemented getAllFlyerCategories and tests * update jest * update jest * implemented suggestions from zach, vin, and archit * got rid of ESLint comment * fixed names for tests * Added loops to test cases * Fixed test case to create flyers with the same category * Changed 'push' to 'concat' --------- Co-authored-by: Cindy <cl2329@cornell.edu> * Changing specifications for getFlyersBeforeDate and getFlyersAfterDate (#112) * Cindy/flyer categories (#113) * Implemented getAllFlyerCategories and tests * update jest * update jest * implemented suggestions from zach, vin, and archit * got rid of ESLint comment * fixed names for tests * Added loops to test cases * Fixed test case to create flyers with the same category * Changed 'push' to 'concat' * Updated `getAllFlyerCategories` --------- Co-authored-by: Cindy <cl2329@cornell.edu> Co-authored-by: Vin Bui <vdb23@cornell.edu> * Increased HTTP request size (#114) * Added limit to JSON request body * Update package-lock.json * Add error message (#116) * Added limit to JSON request body * Update package-lock.json * Added error message * Update FlyerMiddleware.ts (#119) * Update publications.json (#122) Add WoMENA as a publication * Change Create Flyer route to use form data for image upload (#121) * Add post express route using form data * Remove .idea * revert readme * try catch for large file uploads * Remove uncertain comments * Refactor upload image util to use form data * Cover the case where the Flyer ID that was sent is invalid * Update file key, add documentation --------- Co-authored-by: Kidus Zegeye <51487468+kidzegeye@users.noreply.github.com> Co-authored-by: Kidus Zegeye <kmz25@cornell.edu> Co-authored-by: Archit Mehta <4architmehta@gmail.com> Co-authored-by: Shungo Najima <sn685@cornell.edu> Co-authored-by: Isaac Han <isaac.han100@gmail.com> Co-authored-by: Sasha Loayza <104698418+SashaLoayza@users.noreply.github.com> Co-authored-by: Zachary Seidner <58796478+zachseidner1@users.noreply.github.com> Co-authored-by: cindy-x-liang <67083541+cindy-x-liang@users.noreply.github.com> Co-authored-by: Cindy <cl2329@cornell.edu> Co-authored-by: Aayush <68517064+Aayush-Agnihotri@users.noreply.github.com> Co-authored-by: Jennifer Gu <57200368+jjennifergu@users.noreply.github.com>
* 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 <4architmehta@gmail.com> * Update src/tests/data/ArticleFactory.ts Co-authored-by: Archit Mehta <4architmehta@gmail.com> * Refactor code * Refactor byDate Co-authored-by: Kidus Zegeye <kmz25@cornell.edu> Co-authored-by: Archit Mehta <4architmehta@gmail.com> * 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 <4architmehta@gmail.com> * Update src/tests/data/ArticleFactory.ts Co-authored-by: Archit Mehta <4architmehta@gmail.com> * Refactor code * Refactor byDate * Add docstrings Co-authored-by: Kidus Zegeye <kmz25@cornell.edu> Co-authored-by: Archit Mehta <4architmehta@gmail.com> * 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 <4architmehta@gmail.com> * Update src/tests/data/ArticleFactory.ts Co-authored-by: Archit Mehta <4architmehta@gmail.com> * Refactor code * Refactor byDate * Add docstrings Co-authored-by: Kidus Zegeye <kmz25@cornell.edu> Co-authored-by: Archit Mehta <4architmehta@gmail.com> 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 <51487468+kidzegeye@users.noreply.github.com> * 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 <kmz25@cornell.edu> * 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 <51487468+kidzegeye@users.noreply.github.com> Co-authored-by: Kidus Zegeye <kmz25@cornell.edu> Co-authored-by: Archit404Error <4architmehta@gmail.com> * 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 <kmz25@cornell.edu> * 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 <51487468+kidzegeye@users.noreply.github.com> Co-authored-by: Kidus Zegeye <kmz25@cornell.edu> Co-authored-by: Archit404Error <4architmehta@gmail.com> * 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 <kmz25@cornell.edu> * 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 <51487468+kidzegeye@users.noreply.github.com> Co-authored-by: Kidus Zegeye <kmz25@cornell.edu> Co-authored-by: Archit404Error <4architmehta@gmail.com> * 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) * Flyer Notifications + Org/Flyer Model Changes (#99) * Fixed notification issue * Added flyer notification * Added flyer notification * Updated Organization and Flyer models * Updated test cases * Inline notification calls * Improve Search Algorithm (#101) * Update README.md start instructions * Update search function for articles * Remove console log * Update articles search to use text search instead of regex * Update search for Flyers and Magazines * Update documentation, remove unused Fuse package * Fix README.md start docs * Filter out past flyers during flyers search * Fix formatting, improve concision * Remove start.md * Changed indexing method to being declared on the models * Update README.md Co-authored-by: Archit Mehta <4architmehta@gmail.com> --------- Co-authored-by: Archit Mehta <4architmehta@gmail.com> * getFlyersByCategorySlug Query (#100) * Fixed notification issue * Added flyer notification * Added flyer notification * Updated Organization and Flyer models * Updated test cases * Added getFlyersByCategorySlug query * Update query description * Inline notification calls * Update flyer.test.ts * Update flyer.test.ts * Merge `vin/create-flyer` to `main` (#104) * Fixed notification issue * Added flyer notification * Added flyer notification * Updated Organization and Flyer models * Updated test cases * Added getFlyersByCategorySlug query * Update query description * Inline notification calls * Add createFlyer mutation * `deleteFlyer` mutation (#103) * Add deleteFlyer mutation * Address PR comments * Update utils.ts * Update FlyerRepo.ts * Trendiness Update and Migration Script for New Flyers Model (#106) * Add migration script to update data based on new Flyers schema * Update Flyer trendiness * Fix comments * Clean up syntax for get trending flyers * Remove unnecessary createSpecificsByIndex function * Zach/trendiness and migration hot fix (#107) * Add migration script to update data based on new Flyers schema * Update Flyer trendiness * Fix comments * Clean up syntax for get trending flyers * Remove unnecessary createSpecificsByIndex function * Fix TypeScript compilation error * Micro PR for Flyers categorySlug migration (#108) * Add migration script to update data based on new Flyers schema * Update Flyer trendiness * Fix comments * Clean up syntax for get trending flyers * Remove unnecessary createSpecificsByIndex function * Fix TypeScript compilation error * Update migration script to account for category slug * Fix formatting for flyers test * Create `editFlyer` mutation (#105) * Add `editFlyer` * Address PR comments * `checkAccessCode` query for Organization authentication (#109) * Added Organization authentication * Updated Authorization * Implemented getAllFlyerCategories and tests (#110) * Implemented getAllFlyerCategories and tests * update jest * update jest * implemented suggestions from zach, vin, and archit * got rid of ESLint comment * fixed names for tests * Added loops to test cases * Fixed test case to create flyers with the same category * Changed 'push' to 'concat' --------- Co-authored-by: Cindy <cl2329@cornell.edu> * Changing specifications for getFlyersBeforeDate and getFlyersAfterDate (#112) * Cindy/flyer categories (#113) * Implemented getAllFlyerCategories and tests * update jest * update jest * implemented suggestions from zach, vin, and archit * got rid of ESLint comment * fixed names for tests * Added loops to test cases * Fixed test case to create flyers with the same category * Changed 'push' to 'concat' * Updated `getAllFlyerCategories` --------- Co-authored-by: Cindy <cl2329@cornell.edu> Co-authored-by: Vin Bui <vdb23@cornell.edu> * Increased HTTP request size (#114) * Added limit to JSON request body * Update package-lock.json * Add error message (#116) * Added limit to JSON request body * Update package-lock.json * Added error message * Update FlyerMiddleware.ts (#119) * Update publications.json (#122) Add WoMENA as a publication * Change Create Flyer route to use form data for image upload (#121) * Add post express route using form data * Remove .idea * revert readme * try catch for large file uploads * Remove uncertain comments * Refactor upload image util to use form data * Cover the case where the Flyer ID that was sent is invalid * Update file key, add documentation * Fixed issue with edit flyer (#124) * Fixed issue with edit flyer * Update app.ts --------- Co-authored-by: Kidus Zegeye <51487468+kidzegeye@users.noreply.github.com> Co-authored-by: Kidus Zegeye <kmz25@cornell.edu> Co-authored-by: Archit Mehta <4architmehta@gmail.com> Co-authored-by: Shungo Najima <sn685@cornell.edu> Co-authored-by: Isaac Han <isaac.han100@gmail.com> Co-authored-by: Sasha Loayza <104698418+SashaLoayza@users.noreply.github.com> Co-authored-by: Zachary Seidner <58796478+zachseidner1@users.noreply.github.com> Co-authored-by: cindy-x-liang <67083541+cindy-x-liang@users.noreply.github.com> Co-authored-by: Cindy <cl2329@cornell.edu> Co-authored-by: Aayush <68517064+Aayush-Agnihotri@users.noreply.github.com> Co-authored-by: Jennifer Gu <57200368+jjennifergu@users.noreply.github.com>
* 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 <4architmehta@gmail.com> * Update src/tests/data/ArticleFactory.ts Co-authored-by: Archit Mehta <4architmehta@gmail.com> * Refactor code * Refactor byDate Co-authored-by: Kidus Zegeye <kmz25@cornell.edu> Co-authored-by: Archit Mehta <4architmehta@gmail.com> * 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 <4architmehta@gmail.com> * Update src/tests/data/ArticleFactory.ts Co-authored-by: Archit Mehta <4architmehta@gmail.com> * Refactor code * Refactor byDate * Add docstrings Co-authored-by: Kidus Zegeye <kmz25@cornell.edu> Co-authored-by: Archit Mehta <4architmehta@gmail.com> * 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 <4architmehta@gmail.com> * Update src/tests/data/ArticleFactory.ts Co-authored-by: Archit Mehta <4architmehta@gmail.com> * Refactor code * Refactor byDate * Add docstrings Co-authored-by: Kidus Zegeye <kmz25@cornell.edu> Co-authored-by: Archit Mehta <4architmehta@gmail.com> 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 <51487468+kidzegeye@users.noreply.github.com> * 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 <kmz25@cornell.edu> * 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 <51487468+kidzegeye@users.noreply.github.com> Co-authored-by: Kidus Zegeye <kmz25@cornell.edu> Co-authored-by: Archit404Error <4architmehta@gmail.com> * 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 <kmz25@cornell.edu> * 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 <51487468+kidzegeye@users.noreply.github.com> Co-authored-by: Kidus Zegeye <kmz25@cornell.edu> Co-authored-by: Archit404Error <4architmehta@gmail.com> * 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 <kmz25@cornell.edu> * 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 <51487468+kidzegeye@users.noreply.github.com> Co-authored-by: Kidus Zegeye <kmz25@cornell.edu> Co-authored-by: Archit404Error <4architmehta@gmail.com> * 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) * Flyer Notifications + Org/Flyer Model Changes (#99) * Fixed notification issue * Added flyer notification * Added flyer notification * Updated Organization and Flyer models * Updated test cases * Inline notification calls * Improve Search Algorithm (#101) * Update README.md start instructions * Update search function for articles * Remove console log * Update articles search to use text search instead of regex * Update search for Flyers and Magazines * Update documentation, remove unused Fuse package * Fix README.md start docs * Filter out past flyers during flyers search * Fix formatting, improve concision * Remove start.md * Changed indexing method to being declared on the models * Update README.md Co-authored-by: Archit Mehta <4architmehta@gmail.com> --------- Co-authored-by: Archit Mehta <4architmehta@gmail.com> * getFlyersByCategorySlug Query (#100) * Fixed notification issue * Added flyer notification * Added flyer notification * Updated Organization and Flyer models * Updated test cases * Added getFlyersByCategorySlug query * Update query description * Inline notification calls * Update flyer.test.ts * Update flyer.test.ts * Merge `vin/create-flyer` to `main` (#104) * Fixed notification issue * Added flyer notification * Added flyer notification * Updated Organization and Flyer models * Updated test cases * Added getFlyersByCategorySlug query * Update query description * Inline notification calls * Add createFlyer mutation * `deleteFlyer` mutation (#103) * Add deleteFlyer mutation * Address PR comments * Update utils.ts * Update FlyerRepo.ts * Trendiness Update and Migration Script for New Flyers Model (#106) * Add migration script to update data based on new Flyers schema * Update Flyer trendiness * Fix comments * Clean up syntax for get trending flyers * Remove unnecessary createSpecificsByIndex function * Zach/trendiness and migration hot fix (#107) * Add migration script to update data based on new Flyers schema * Update Flyer trendiness * Fix comments * Clean up syntax for get trending flyers * Remove unnecessary createSpecificsByIndex function * Fix TypeScript compilation error * Micro PR for Flyers categorySlug migration (#108) * Add migration script to update data based on new Flyers schema * Update Flyer trendiness * Fix comments * Clean up syntax for get trending flyers * Remove unnecessary createSpecificsByIndex function * Fix TypeScript compilation error * Update migration script to account for category slug * Fix formatting for flyers test * Create `editFlyer` mutation (#105) * Add `editFlyer` * Address PR comments * `checkAccessCode` query for Organization authentication (#109) * Added Organization authentication * Updated Authorization * Implemented getAllFlyerCategories and tests (#110) * Implemented getAllFlyerCategories and tests * update jest * update jest * implemented suggestions from zach, vin, and archit * got rid of ESLint comment * fixed names for tests * Added loops to test cases * Fixed test case to create flyers with the same category * Changed 'push' to 'concat' --------- Co-authored-by: Cindy <cl2329@cornell.edu> * Changing specifications for getFlyersBeforeDate and getFlyersAfterDate (#112) * Cindy/flyer categories (#113) * Implemented getAllFlyerCategories and tests * update jest * update jest * implemented suggestions from zach, vin, and archit * got rid of ESLint comment * fixed names for tests * Added loops to test cases * Fixed test case to create flyers with the same category * Changed 'push' to 'concat' * Updated `getAllFlyerCategories` --------- Co-authored-by: Cindy <cl2329@cornell.edu> Co-authored-by: Vin Bui <vdb23@cornell.edu> * Increased HTTP request size (#114) * Added limit to JSON request body * Update package-lock.json * Add error message (#116) * Added limit to JSON request body * Update package-lock.json * Added error message * Update FlyerMiddleware.ts (#119) * Update publications.json (#122) Add WoMENA as a publication * Change Create Flyer route to use form data for image upload (#121) * Add post express route using form data * Remove .idea * revert readme * try catch for large file uploads * Remove uncertain comments * Refactor upload image util to use form data * Cover the case where the Flyer ID that was sent is invalid * Update file key, add documentation * Fixed issue with edit flyer (#124) * Fixed issue with edit flyer * Update app.ts * Adding routes and migration script for bookmarking (#126) * Adding routes and migration script for bookmarking * Refactoring WeeklyDebrief * Fixing unbookmarking functions * Adding (un)bookmark articles tests * More article bookmark tests * Adding more tests for flyers and magazines --------- Co-authored-by: Kidus Zegeye <51487468+kidzegeye@users.noreply.github.com> Co-authored-by: Kidus Zegeye <kmz25@cornell.edu> Co-authored-by: Archit Mehta <4architmehta@gmail.com> Co-authored-by: Shungo Najima <sn685@cornell.edu> Co-authored-by: Isaac Han <isaac.han100@gmail.com> Co-authored-by: Sasha Loayza <104698418+SashaLoayza@users.noreply.github.com> Co-authored-by: Zachary Seidner <58796478+zachseidner1@users.noreply.github.com> Co-authored-by: cindy-x-liang <67083541+cindy-x-liang@users.noreply.github.com> Co-authored-by: Cindy <cl2329@cornell.edu> Co-authored-by: Aayush <68517064+Aayush-Agnihotri@users.noreply.github.com> Co-authored-by: Jennifer Gu <57200368+jjennifergu@users.noreply.github.com>
* 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 <4architmehta@gmail.com> * Update src/tests/data/ArticleFactory.ts Co-authored-by: Archit Mehta <4architmehta@gmail.com> * Refactor code * Refactor byDate Co-authored-by: Kidus Zegeye <kmz25@cornell.edu> Co-authored-by: Archit Mehta <4architmehta@gmail.com> * 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 <4architmehta@gmail.com> * Update src/tests/data/ArticleFactory.ts Co-authored-by: Archit Mehta <4architmehta@gmail.com> * Refactor code * Refactor byDate * Add docstrings Co-authored-by: Kidus Zegeye <kmz25@cornell.edu> Co-authored-by: Archit Mehta <4architmehta@gmail.com> * 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 <4architmehta@gmail.com> * Update src/tests/data/ArticleFactory.ts Co-authored-by: Archit Mehta <4architmehta@gmail.com> * Refactor code * Refactor byDate * Add docstrings Co-authored-by: Kidus Zegeye <kmz25@cornell.edu> Co-authored-by: Archit Mehta <4architmehta@gmail.com> 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 <51487468+kidzegeye@users.noreply.github.com> * 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 <kmz25@cornell.edu> * 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 <51487468+kidzegeye@users.noreply.github.com> Co-authored-by: Kidus Zegeye <kmz25@cornell.edu> Co-authored-by: Archit404Error <4architmehta@gmail.com> * 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 <kmz25@cornell.edu> * 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 <51487468+kidzegeye@users.noreply.github.com> Co-authored-by: Kidus Zegeye <kmz25@cornell.edu> Co-authored-by: Archit404Error <4architmehta@gmail.com> * 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 <kmz25@cornell.edu> * 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 <51487468+kidzegeye@users.noreply.github.com> Co-authored-by: Kidus Zegeye <kmz25@cornell.edu> Co-authored-by: Archit404Error <4architmehta@gmail.com> * 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) * Flyer Notifications + Org/Flyer Model Changes (#99) * Fixed notification issue * Added flyer notification * Added flyer notification * Updated Organization and Flyer models * Updated test cases * Inline notification calls * Improve Search Algorithm (#101) * Update README.md start instructions * Update search function for articles * Remove console log * Update articles search to use text search instead of regex * Update search for Flyers and Magazines * Update documentation, remove unused Fuse package * Fix README.md start docs * Filter out past flyers during flyers search * Fix formatting, improve concision * Remove start.md * Changed indexing method to being declared on the models * Update README.md Co-authored-by: Archit Mehta <4architmehta@gmail.com> --------- Co-authored-by: Archit Mehta <4architmehta@gmail.com> * getFlyersByCategorySlug Query (#100) * Fixed notification issue * Added flyer notification * Added flyer notification * Updated Organization and Flyer models * Updated test cases * Added getFlyersByCategorySlug query * Update query description * Inline notification calls * Update flyer.test.ts * Update flyer.test.ts * Merge `vin/create-flyer` to `main` (#104) * Fixed notification issue * Added flyer notification * Added flyer notification * Updated Organization and Flyer models * Updated test cases * Added getFlyersByCategorySlug query * Update query description * Inline notification calls * Add createFlyer mutation * `deleteFlyer` mutation (#103) * Add deleteFlyer mutation * Address PR comments * Update utils.ts * Update FlyerRepo.ts * Trendiness Update and Migration Script for New Flyers Model (#106) * Add migration script to update data based on new Flyers schema * Update Flyer trendiness * Fix comments * Clean up syntax for get trending flyers * Remove unnecessary createSpecificsByIndex function * Zach/trendiness and migration hot fix (#107) * Add migration script to update data based on new Flyers schema * Update Flyer trendiness * Fix comments * Clean up syntax for get trending flyers * Remove unnecessary createSpecificsByIndex function * Fix TypeScript compilation error * Micro PR for Flyers categorySlug migration (#108) * Add migration script to update data based on new Flyers schema * Update Flyer trendiness * Fix comments * Clean up syntax for get trending flyers * Remove unnecessary createSpecificsByIndex function * Fix TypeScript compilation error * Update migration script to account for category slug * Fix formatting for flyers test * Create `editFlyer` mutation (#105) * Add `editFlyer` * Address PR comments * `checkAccessCode` query for Organization authentication (#109) * Added Organization authentication * Updated Authorization * Implemented getAllFlyerCategories and tests (#110) * Implemented getAllFlyerCategories and tests * update jest * update jest * implemented suggestions from zach, vin, and archit * got rid of ESLint comment * fixed names for tests * Added loops to test cases * Fixed test case to create flyers with the same category * Changed 'push' to 'concat' --------- Co-authored-by: Cindy <cl2329@cornell.edu> * Changing specifications for getFlyersBeforeDate and getFlyersAfterDate (#112) * Cindy/flyer categories (#113) * Implemented getAllFlyerCategories and tests * update jest * update jest * implemented suggestions from zach, vin, and archit * got rid of ESLint comment * fixed names for tests * Added loops to test cases * Fixed test case to create flyers with the same category * Changed 'push' to 'concat' * Updated `getAllFlyerCategories` --------- Co-authored-by: Cindy <cl2329@cornell.edu> Co-authored-by: Vin Bui <vdb23@cornell.edu> * Increased HTTP request size (#114) * Added limit to JSON request body * Update package-lock.json * Add error message (#116) * Added limit to JSON request body * Update package-lock.json * Added error message * Update FlyerMiddleware.ts (#119) * Update publications.json (#122) Add WoMENA as a publication * Change Create Flyer route to use form data for image upload (#121) * Add post express route using form data * Remove .idea * revert readme * try catch for large file uploads * Remove uncertain comments * Refactor upload image util to use form data * Cover the case where the Flyer ID that was sent is invalid * Update file key, add documentation * Fixed issue with edit flyer (#124) * Fixed issue with edit flyer * Update app.ts * Adding routes and migration script for bookmarking (#126) * Adding routes and migration script for bookmarking * Refactoring WeeklyDebrief * Fixing unbookmarking functions * Adding (un)bookmark articles tests * More article bookmark tests * Adding more tests for flyers and magazines * Enabling notifications for adding, editing, and deleting a flyer (#118) * Implemented getAllFlyerCategories and tests * update jest * update jest * implemented suggestions from zach, vin, and archit * got rid of ESLint comment * fixed names for tests * Added loops to test cases * Fixed test case to create flyers with the same category * Changed 'push' to 'concat' * Enabled notifications for adding, editing, and deleting a flyer - Created a function in NotificationRepo.ts called notifyFlyersForOrganization that takes in a flyerID and a title of the notification - the title of the notification should reflect the action performed (add, edit, delete) - This function is called in FlyerResolver.ts * Added more specific body text for updating flyers, removed notifyNewFlyers * Addressed Vin's Comments - used enums for action commparison instead of strings - used template strings instead of concat - added documentation for the various branches of the if statement in the notification for editing a flyer * Addressing Vin's Comments - changed nested if statements to a switch block - used proper capitlization for Enums * add num flyers for organizations * Changed edit and delete flyer notifications to only be sent to users who have flyers bookmarked - in UserRepo added getUsersBookmarkedFlyers to get a list of all the users that have the desired flyer bookmarked - in NotificationRepo, factored out a function titled notifyFlyersForBookmarks - in FlyerResolver, for edit/delete flyers notifyFlyersForBookmarks will be called instead of notifyFlyersForOrganizations * fixed specs for added functions * addressing vin's comments --------- Co-authored-by: Cindy <cl2329@cornell.edu> Co-authored-by: Vin Bui <vdb23@cornell.edu> * Update app.ts (#128) --------- Co-authored-by: Kidus Zegeye <51487468+kidzegeye@users.noreply.github.com> Co-authored-by: Kidus Zegeye <kmz25@cornell.edu> Co-authored-by: Archit Mehta <4architmehta@gmail.com> Co-authored-by: Shungo Najima <sn685@cornell.edu> Co-authored-by: Isaac Han <isaac.han100@gmail.com> Co-authored-by: Sasha Loayza <104698418+SashaLoayza@users.noreply.github.com> Co-authored-by: Zachary Seidner <58796478+zachseidner1@users.noreply.github.com> Co-authored-by: cindy-x-liang <67083541+cindy-x-liang@users.noreply.github.com> Co-authored-by: Cindy <cl2329@cornell.edu> Co-authored-by: Aayush <68517064+Aayush-Agnihotri@users.noreply.github.com> Co-authored-by: Jennifer Gu <57200368+jjennifergu@users.noreply.github.com>
Overview
This PR implements a mutation to edit a flyer.
Changes Made
editFlyer Mutation
id
the ID of the Flyer to editcategorySlug
the slug for this flyer's categoryendDate
the end date for this flyer's event in UTC ISO8601 formatflyerURL
the URL for this flyer when tappedimageB64
the base64 string representing the flyer's imagelocation
the location for this flyer's eventstartDate
the start date for this flyer's event in UTC ISO8601 formattitle
the title for this flyerimageB64
is uploaded to our Digital Ocean via a POST request.imageB64
is not null, then we know that the flyer image wants to be changed. In this case, the middleware for uploading Flyer images (FlyerUploadErrorInterceptor
) had to be changed to account for the fact that this could be null. This could cause thecreateFlyer
mutation to fail so I went back and tested it to see if it would still work.createFlyer
mutation is that most input are nullable, meaning that you can choose which fields to change. This required me to only make changes to the flyer fields if that field is not null to prevent it from being assigned a null value.Test Coverage
createFlyer
still works properly since I made changes to the middleware. It seems to work just fine so using this newly created Flyer. I also tested to see ifdeleteFlyer
works as well just for insurance, and it is also fine.I then tested the
editFlyer
mutation with this:id
does not represent any Flyer, an error is thrown with the message: “Cannot return null for non-nullable field Mutation.editFlyer.”id
but do not provide any other inputs, an error is NOT thrown and you get the same flyer back.endDate
andstartDate
must in the proper format and will throw an error as intended if not.Next Steps
getAllFlyerCateogries
.Screenshots