Skip to content

Commit

Permalink
Feat/api changes (#17)
Browse files Browse the repository at this point in the history
* Feat(util): handler now contains singing out and refreshing mechanisms

* Feat(api): centralized all api calls to /api dir

* Feat(lib): added qs library for query string configuration

* Feat(types): added required types for new api calls

* Feat(App): replaced and refactored api calls to centralized functions

* Chore(Constants): cleaned up constants to use vite setup

* Refactor(MainBody): refactored api calls to centralized functions

* Refactor(HomePage): refactored api calls and choice type definition

* Refactor(AdminPanel): replaced api calls with centralized functions

* Refactor(MyDrafts): replaced api calls with centralized functions

* Fix(SignalCardPage): added error handling

* Refactor(TrendEntryFormEl): replaced api calls to centralized functions and updated choice types

* Refactor(SignalEntryFormEl): replaced api calls with centralized functions and updated choice types

* Refactor(components): updated choices objects according to new type definition

* Refactor(AddSingalsModal): replaced api calls with centralized calls and updated choice types

* Refactor(AddTrendsModal): replaced api calls to centralized function calls and updated choice types

* Refactor(SingOutButton): replaced api call to centralized function calls and updated choice types

* Refactor(SignUpButton): replaced api calls to centralized function calls

* Refactor(AllSignals): replaced api calls to centralized function calls

* Refactor(EditSignal): replaced api call to centralized function call

* Refactor(SignalDetail): replaced api calls to centralized function calls and updated choice types

* Refactor(AllTrends): replaced api calls to centralized function calls

* Refactor(EditTrend): replaced api call to centralized function call

* Refactor(TrendDetail): replaced api calls to centralized function calls and updated choice types

* Feat(asset): added hero image for easier relative import

* Refactor(auth): cleaned up authentication flow via use of interceptor

* Fix(Types): added missing attributes to types

* Fix(MainBody): added missing attributes to api function call

* Fix(PdfPageDesign): improved error handling for edge cases

* Fix(EntryForms): added required parameters to api function calls

* Fix(EditSignal/Trend): read using read endpoints instead of search endpoints

* Fix(AllSignals/Trends): added proper status to filter for search

* Refactor(minor): moved platform config to public folder

* Fix(constants): refactored constants for consistency

* Refactor(AuthConfig): renamed and refactored for consistency and readability

* Fix(types): added created by attribute to fix updating params

* Fix(api_config): increased timeout for image uploads and refactored auth process

* Feat(App): logs out automatically if token is expired

* Fix(main): minor import fix

* Fix(addModals): added essential params

* Fix(minor): import naming change

* Fix(entryFormEl): added proper params for update and image display

* Refactor(ci/cd): removed unused env variables and added new conditional variables for different branches

* Refactor(CI/CD): improved conditional env variables
  • Loading branch information
GedionT authored Nov 4, 2024
1 parent 5143d19 commit a42febd
Show file tree
Hide file tree
Showing 49 changed files with 2,080 additions and 1,252 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,15 @@ jobs:
build_and_deploy_job:
runs-on: ubuntu-latest
name: Build and Deploy Job
env:
VITE_API_BASEURL: ${{ github.ref == 'refs/heads/production' && secrets.VITE_API_BASEURL_PRODUCTION || secrets.VITE_API_BASEURL_STAGING }}
VITE_CLIENT_ID: ${{ secrets.VITE_CLIENT_ID }}
VITE_AUTHORITY: ${{ secrets.VITE_AUTHORITY }}
VITE_CLIENT_SECRET: ${{ secrets.CLIENT_SECRET_FOR_MSAL }}
steps:
- uses: actions/checkout@v3
with:
submodules: true
- name: Set redirect_uri_for_msal based on branch
run: |
if [ "${{ github.ref }}" == "refs/heads/production" ]; then
echo "REDIRECT_URI_FOR_MSAL=${{ secrets.REDIRECT_URI_FOR_MSAL }}" >> $GITHUB_ENV
elif [ "${{ github.ref }}" == "refs/heads/staging" ]; then
echo "REDIRECT_URI_FOR_MSAL=${{ secrets.REDIRECT_URI_FOR_MSAL_STAGING }}" >> $GITHUB_ENV
else
echo "REDIRECT_URI_FOR_MSAL=${{ secrets.REDIRECT_URI_FOR_MSAL }}" >> $GITHUB_ENV
fi
- name: Build And Deploy
id: builddeploy
uses: Azure/static-web-apps-deploy@v1
Expand All @@ -33,8 +29,4 @@ jobs:
app_location: "/" # App source code path
api_location: "" # Api source code path - optional
output_location: "build" # Built app content directory - optional
production_branch: "production"
access_token_for_api: ${{ secrets.ACCESS_CODE_FOR_API }}
redirect_uri_for_msal: ${{ env.REDIRECT_URI_FOR_MSAL }}
client_secret_for_msal: ${{ secrets.CLIENT_SECRET_FOR_MSAL }}
msal_client_id: ${{ secrets.MSAL_CLIENT_ID }}
production_branch: "production"
168 changes: 132 additions & 36 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
"d3-scale": "^4.0.2",
"lodash.remove": "^4.7.0",
"lodash.sortby": "^4.7.0",
"qs": "^6.13.0",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-router-dom": "^6.8.2",
Expand All @@ -35,6 +36,7 @@
"@types/d3-force": "^3.0.4",
"@types/d3-scale": "^4.0.3",
"@types/node": "^20.3.1",
"@types/qs": "^6.9.16",
"@types/react": "^18.0.27",
"@types/react-dom": "^18.0.10",
"@typescript-eslint/eslint-plugin": "^5.51.0",
Expand Down
File renamed without changes.
Binary file added public/assets/UNDP-hero-image.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions public/robots.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# https://www.robotstxt.org/robotstxt.html
User-agent: *
Disallow:
Loading

0 comments on commit a42febd

Please sign in to comment.