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

Adds config.json, useConfig hook and move dashboard_url from env to config #4223

Merged
merged 6 commits into from
Dec 27, 2022

Conversation

rithviknishad
Copy link
Member

@rithviknishad rithviknishad commented Dec 5, 2022

Proposed Changes

⚠️ Breaking Changes

  • dashboard_url is now set from config.json instead of env. This change will work in staging, however for production, REACT_APP_CONFIG env needs to be configured.

Notes

Set the URL to the config.json file in environment (defaults to: "/config.json")

REACT_APP_CONFIG="/config.json"

An example config.json is specified in /public/config.json:

{
    "dashboard_url": "https://dashboard.coronasafe.network/"
}

Whenever adding/removing configs, do update the IConfig interface in /src/Common/hooks/useConfig.ts.

Use the configurations inside the app as shown:

const foo = () => {
  const { dashboard_url } = useConfig();
}

The config.json is cached in local storage (key: "config").

@coronasafe/care-fe-code-reviewers @coronasafe/code-reviewers

Merge Checklist

  • Add specs that demonstrate bug / test a new feature.
  • Update product documentation.
  • Ensure that UI text is kept in I18n files.
  • Prep screenshot or demo video for changelog entry, and attach it to issue.
  • Request for Peer Reviews
  • Completion of QA

@rithviknishad rithviknishad requested a review from a team December 5, 2022 13:49
@rithviknishad rithviknishad requested a review from a team as a code owner December 5, 2022 13:49
@netlify
Copy link

netlify bot commented Dec 5, 2022

Deploy Preview for care-egov-staging ready!

Name Link
🔨 Latest commit 05e459c
🔍 Latest deploy log https://app.netlify.com/sites/care-egov-staging/deploys/63aaa356e6fcdf0008ef9a40
😎 Deploy Preview https://deploy-preview-4223--care-egov-staging.netlify.app/
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@vercel
Copy link

vercel bot commented Dec 5, 2022

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
care-storybook ✅ Ready (Inspect) Visit Preview Dec 27, 2022 at 7:51AM (UTC)

@khavinshankar
Copy link
Member

@mathew-alex @rithviknishad LGTM

@github-actions github-actions bot added the merge conflict pull requests with merge conflict label Dec 8, 2022
@github-actions
Copy link

github-actions bot commented Dec 8, 2022

👋 Hi, @rithviknishad,
Conflicts have been detected against the base branch. Please rebase your branch against the base branch.


This message is automatically generated by prince-chrismc/label-merge-conflicts-action so don't hesitate to report issues/improvements there.

1 similar comment
@github-actions
Copy link

github-actions bot commented Dec 8, 2022

👋 Hi, @rithviknishad,
Conflicts have been detected against the base branch. Please rebase your branch against the base branch.


This message is automatically generated by prince-chrismc/label-merge-conflicts-action so don't hesitate to report issues/improvements there.

@github-actions
Copy link

👋 Hi, @rithviknishad,
Conflicts have been detected against the base branch. Please rebase your branch against the base branch.


This message is automatically generated by prince-chrismc/label-merge-conflicts-action so don't hesitate to report issues/improvements there.

@sonarcloud
Copy link

sonarcloud bot commented Dec 27, 2022

SonarCloud Quality Gate failed.    Quality Gate failed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 1 Code Smell

No Coverage information No Coverage information
4.0% 4.0% Duplication

@mathew-alex mathew-alex merged commit 079d977 into coronasafe:develop Dec 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants