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

feat: Add app switcher button #545

Merged
merged 1 commit into from
Apr 15, 2024
Merged

Conversation

bruce-glazier
Copy link
Contributor

Changes

  • Your changes...

Screenshots

sternetj
sternetj previously approved these changes Apr 9, 2024
src/screens/HomeScreen.tsx Outdated Show resolved Hide resolved
const { activeProject } = useActiveProject();

const query = useRestQuery(
'GET /v1/life-research/projects/:projectId/app-config',
'GET /v1/life-research/projects/:projectId/app-configs/list',
Copy link
Contributor

Choose a reason for hiding this comment

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

Somewhere we will need to make this smarter, probably at the API level. Currently this list will contain all configs that exist for the project but an App user should likely only be able to change between configs that they belong to (cohort or user list). This is probably okay until we identify how to manage that logic. I imagine it could end up being different per client.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Total oversight on my part, I'll work on updating API side

sternetj
sternetj previously approved these changes Apr 15, 2024
@coveralls
Copy link

Pull Request Test Coverage Report for Build 8693577141

Details

  • 18 of 62 (29.03%) changed or added relevant lines in 3 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-0.6%) to 84.344%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/components/AppConfigSwitcherButton.tsx 0 12 0.0%
src/components/AppConfigSwitcher.tsx 0 32 0.0%
Totals Coverage Status
Change from base Build 8691330942: -0.6%
Covered Lines: 3720
Relevant Lines: 4294

💛 - Coveralls

appTiles: mockAppTiles,
},

// Bug in mocker seems to not be able to tell /:id and /list apart
Copy link
Contributor

Choose a reason for hiding this comment

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

I think it is thinking that list is the :id. Did you try swapping the definition order of the route mocks? It seems like msw/node prepends the routes so I would think/hope that mocking /:id then mocking /list would produce the desired result. Regardless though this seems fine.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'd expect that if /list matches multiple routes that the mocking library would prefer the exact match over the wildcard which is sort of why I described this as a bug but perhaps you are right about that.

@bruce-glazier bruce-glazier merged commit f8b81a3 into master Apr 15, 2024
3 checks passed
@bruce-glazier bruce-glazier deleted the add-user-app-config-switching branch April 15, 2024 19:43
Copy link

🎉 This PR is included in version 12.1.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@github-actions github-actions bot added the released Has been released to the package repository (NPM, etc) label Apr 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
released Has been released to the package repository (NPM, etc)
Projects
None yet
3 participants