Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Add mirageJS support to mock API #145

Merged
merged 6 commits into from
Apr 14, 2023
Merged

Conversation

sathyanarayanan-v
Copy link
Contributor

@sathyanarayanan-v sathyanarayanan-v commented Apr 13, 2023

I have covered most of the pages to use MirageJS to mock APIs'.

  • I have mocked API for the following pages
    • Sale
    • Feed
    • Login

Currently MirageJS is enabled on prod. Once we feel that APIs are solid, we can enable it only on dev environment.

Closes #146

Docs for MirageJS - Click here!

@sathyanarayanan-v sathyanarayanan-v changed the base branch from main to frontend April 13, 2023 18:23
@sathyanarayanan-v
Copy link
Contributor Author

@xl26, @hardikpatil, @prasannarajezzzy and @prestonmasseyblake I have worked on pages which you folks raised a PR for. Please review if this is working on your end.

This PR will NOT communicate to backend. Instead, MirageJS simulates the backend services.

Let's keep the discussion here moving forward for this PR to shed light to all of us who are involved.

@sathyanarayanan-v sathyanarayanan-v deleted the mirage-js-integration branch April 13, 2023 18:53
@sathyanarayanan-v sathyanarayanan-v restored the mirage-js-integration branch April 13, 2023 18:53
Copy link
Contributor

@hardikpatil hardikpatil left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues on docker or local, works great, however, sorting on the expiring list has changed, I looked at the script, logic is still the same, weird.

Screenshot 2023-04-13 at 12 35 23
Screenshot 2023-04-13 at 12 35 30

@hardikpatil
Copy link
Contributor

No issues on docker or local, works great, however, sorting on the expiring list has changed, I looked at the script, logic is still the same, weird.

Screenshot 2023-04-13 at 12 35 23 Screenshot 2023-04-13 at 12 35 30

on npm start

Screenshot 2023-04-13 at 12 52 24

@sathyanarayanan-v
Copy link
Contributor Author

@hardikpatil Right now, MirageJS is configured to work only on port 3000. From the screenshots attached, I can see that you are testing the app in port 3002. Can you please check if the app works fine on port 3000?

@hardikpatil
Copy link
Contributor

@hardikpatil Right now, MirageJS is configured to work only on port 3000. From the screenshots attached, I can see that you are testing the app in port 3002. Can you please check if the app works fine on port 3000?

worked on port 3000!

Screenshot 2023-04-13 at 14 14 14
Screenshot 2023-04-13 at 14 14 28

@AbhinavReddy-Dev
Copy link
Contributor

Works for me in local, but throws cors error in codespaces and there seems to be a docker issue when running it in a container. I think the docker issue is independent of this feature.

@sathyanarayanan-v sathyanarayanan-v merged commit af86a69 into frontend Apr 14, 2023
@sathyanarayanan-v sathyanarayanan-v deleted the mirage-js-integration branch April 14, 2023 00:04
@hardikpatil hardikpatil mentioned this pull request Apr 14, 2023
@hardikpatil hardikpatil added UI Concerns UI presentation backend concerns backend/API presentation labels Apr 14, 2023
briswells added a commit that referenced this pull request Apr 15, 2023
commit dc7032e
Merge: d45499b aab812b
Author: Hardik Patil <hardik.patil2494@gmail.com>
Date:   Fri Apr 14 10:55:20 2023 -0700

    Frontend updates (#140)

    This PR is to merge all the updates from `frontend` to `main` with the
    following features :
    - Donor page UI improvements - @prasannarajezzzy
    - Linter for frontend - @shmansa @AbhinavReddy-Dev
    - Moved .eslintrc.cjs from root to backend directory to resolve plugin
    issues. - @shmansa @AbhinavReddy-Dev
    - Summary page @decoles @abhilashSreenivasa
    - mirageJS support to mock API @sathyanarayanan-v
    - Linter error fix @hardikpatil @jayrevolinskyjr

commit aab812b
Author: hardikpatil <hardik.patil2494@gmail.com>
Date:   Fri Apr 14 01:22:48 2023 -0700

    resolved warnings on the container logs

commit 87909e6
Author: AbhinavReddy-Dev <abhinavreddy9681@gmail.com>
Date:   Fri Apr 14 00:45:09 2023 -0700

    remnamed PantryNodeReact to frontend, updated actions.yml, added .env.example file and updated readme for local eslint & .env file usage

commit 59ae5fc
Author: AbhinavReddy-Dev <abhinavreddy9681@gmail.com>
Date:   Fri Apr 14 00:45:09 2023 -0700

    remnamed PantryNodeReact to frontend, added .env.example file and updated readme for local eslint & .env file usage

commit 04751ca
Author: hardikpatil <hardik.patil2494@gmail.com>
Date:   Fri Apr 14 00:15:58 2023 -0700

    how to linter test update on readme

commit 1dcf5cb
Author: Hardik Patil <hardik.patil2494@gmail.com>
Date:   Thu Apr 13 22:32:11 2023 -0700

    Linter error on frontend (#150)

    * fix lint error on indent. resolved #147

    * resolved console error on donor page

    * Update actions.yml to handle PR to frontend

    * Update linter.yml to handle PR to frontend

    * changed off to warn: no-explicit-any and no-unused-vars

    * changed CI to false to not consider lint warns as errors

    * changed CI to false in package.json

    * added names to run commands in actions.yml

    * added names to run commands in actions.yml v2

    ---------

    Co-authored-by: Jay Revolinsky <98365370+jayrevolinskyjr@users.noreply.github.com>
    Co-authored-by: AbhinavReddy-Dev <abhinavreddy9681@gmail.com>

commit 817266c
Merge: af86a69 d45499b
Author: AbhinavReddy-Dev <abhinavreddy9681@gmail.com>
Date:   Thu Apr 13 22:04:56 2023 -0700

    conflict resolve: Merge branch 'main' into frontend

commit d45499b
Merge: eb11be4 6839a0b
Author: briswells <32494875+briswells@users.noreply.github.com>
Date:   Thu Apr 13 21:53:10 2023 -0700

    Docker module issue Closing #139 (#149)

commit 6839a0b
Author: Brian S Wells <briswells@gmail.com>
Date:   Thu Apr 13 17:33:22 2023 -0700

    Update path for start script

commit 1ea02cf
Author: Brian S Wells <briswells@gmail.com>
Date:   Thu Apr 13 17:30:20 2023 -0700

    Updated mounts to not include node modules

commit af86a69
Merge: 16d8afe 6d735ba
Author: Sathya <36219956+sathyanarayanan-v@users.noreply.github.com>
Date:   Thu Apr 13 17:04:23 2023 -0700

    Add mirageJS support to mock API (#145)

    I have covered most of the pages to use MirageJS to mock APIs'.

    - I have mocked API for the following pages
         - Sale
         - Feed
         - Login

    Currently MirageJS is enabled on prod. Once we feel that APIs are solid,
    we can enable it only on dev environment.

    Closes #146

    Docs for MirageJS - [Click here!](https://miragejs.com/)

commit 6d735ba
Merge: 1cc370b 16d8afe
Author: Sathya <svvsathyanarayanan@gmail.com>
Date:   Thu Apr 13 17:00:48 2023 -0700

    Merge branch 'frontend' into mirage-js-integration

commit 16d8afe
Author: David Coles <davidepcoles@gmail.com>
Date:   Thu Apr 13 16:51:45 2023 -0700

    Stock Summary Page  (#142)

    * Inital table configuration started #91

    * Tables configured for mobile, interfaces and temp data started #91

    * Test data setup in tables #91

    * Added count from array of data (hopefully can be used later) #91

    * Summary now has scrollable tables and scrolling whole page isnt needed for bigger displays, resizing works well #91

    * updated Summary page to include themed table headers & alternating colors on rows #91

    * BarChart file has been created #91

    * Bar chart fuctionality has been added #91

    * Added bar chart with some data to summary page #91

    * Toggle button has been added, Tables and Charts are separated #91

    * Toggle button has been added, Tables and Charts are separated #91

    * Added comments to toggle functions and states #91

    * tables are set to default active toggle and margin has been added #91

    * made changes to UI, Resolved issue #91

    ---------

    Co-authored-by: Abhilash Sreenivasa <abhilash.sreenivasa@gmail.com>

commit b2b9614
Author: AbhinavReddy-Dev <abhinavreddy9681@gmail.com>
Date:   Thu Apr 13 16:27:27 2023 -0700

    no-const-assign in backend lint error fix

commit 250c2b3
Merge: b6fd8e7 eb11be4
Author: AbhinavReddy-Dev <abhinavreddy9681@gmail.com>
Date:   Thu Apr 13 16:23:39 2023 -0700

    eslintrc.cjs and linter.yml conflicts resolved

commit 1cc370b
Merge: 41a2692 b6fd8e7
Author: Sathya <svvsathyanarayanan@gmail.com>
Date:   Thu Apr 13 11:40:19 2023 -0700

    Merge branch 'frontend' into mirage-js-integration

commit 41a2692
Author: Sathya <svvsathyanarayanan@gmail.com>
Date:   Thu Apr 13 11:37:54 2023 -0700

    resolve conflicts with frontend branch

commit 6d28b4d
Merge: 429cf62 8e6920c
Author: Sathya <svvsathyanarayanan@gmail.com>
Date:   Thu Apr 13 11:36:57 2023 -0700

    Merge branch 'frontend' into mirage-js-integration

commit 429cf62
Author: Sathya <svvsathyanarayanan@gmail.com>
Date:   Thu Apr 13 11:31:50 2023 -0700

    Merge branch 'frontend' into mirage-js-integration

commit 3061f1b
Author: Sathya <svvsathyanarayanan@gmail.com>
Date:   Thu Apr 13 10:32:48 2023 -0700

    add miragejs for all the API routes

commit eb11be4
Author: Anoushka Sharma <35841938+Anoushka444@users.noreply.github.com>
Date:   Thu Apr 13 09:52:11 2023 -0700

    Issue undef1 (#103)

    * .eslintrc.cjs

    * changed eslintrc.cjs

    * changed eslintrc.cjs

    * Changed eslintrc.cjs

    * Changed eslintrc.cjs

    * Unsure of changes to init-models.ts

    * Unsure of changes to init-models.ts

    * Changed eslintrc.cjs

    * Removed all errors and left some as warnings

    * Changed eslintrc.cjs file and ignored some errors

    * Fixed issueundef error

    * Clean Up

    ---------

    Co-authored-by: Anoushka Sharma <asharma7@csuchico.edu>
    Co-authored-by: James Krepelka <jameskrepelka@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend concerns backend/API presentation UI Concerns UI presentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants