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

(User roles) Create useNavigation hook and extract scopes to constants #7741

Merged
merged 19 commits into from
Oct 18, 2024

Conversation

tumbledwyer
Copy link
Collaborator

@tumbledwyer tumbledwyer commented Oct 8, 2024

Create useNavigation hook to extract scope logic away from the Navigation component.
Changed scope list to constants in the commons package so they can be referenced anywhere in the app by name rather than a magic string.

fixed issue: #7433

Copy link

github-actions bot commented Oct 8, 2024

Oops! Looks like you forgot to update the changelog. When updating CHANGELOG.md, please consider the following:

  • Changelog is read by country implementors who might not always be familiar with all technical details of OpenCRVS. Keep language high-level, user friendly and avoid technical references to internals.
  • Answer "What's new?", "Why was the change made?" and "Why should I care?" for each change.
  • If it's a breaking change, include a migration guide answering "What do I need to do to upgrade?".

packages/commons/src/scopes.ts Outdated Show resolved Hide resolved
packages/commons/src/scopes.ts Show resolved Hide resolved
packages/client/src/components/ScopedComponent.tsx Outdated Show resolved Hide resolved
packages/client/src/utils/gateway.ts Show resolved Hide resolved
packages/client/src/hooks/useNavigation.ts Outdated Show resolved Hide resolved
@@ -672,7 +600,7 @@ const NavigationView = (props: IFullProps) => {
}
/>
)}
{hasPerformance && userDetails && (
{userDetails && hasAccess(WORKQUEUE_TABS.report) && (
Copy link
Collaborator

Choose a reason for hiding this comment

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

Performance tab is shown twice in the navigation
image

Copy link
Collaborator

Choose a reason for hiding this comment

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

This is in the original PR too, i think.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yeah, even on develop there are 2 navigation items that point to performance. The 2nd one just has an id of report and a different icon but both call the props.goToPerformanceViewAction

@@ -89,6 +89,87 @@ export const scopes = [
] as const
Copy link
Collaborator

Choose a reason for hiding this comment

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

@Zangetsu101 Shouldn't we remove constants from /client/src/utils/gateway.ts since this is a file that is auto generated? Otherwise, the auto generation would be hampered more.

Copy link
Collaborator

Choose a reason for hiding this comment

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

This is still being auto generated no? 😅

@tumbledwyer tumbledwyer changed the title (User roles)Scoped components (User roles) Creating useNavigation hook and extract scopes to constants Oct 18, 2024
@tumbledwyer tumbledwyer changed the title (User roles) Creating useNavigation hook and extract scopes to constants (User roles) Create useNavigation hook and extract scopes to constants Oct 18, 2024
@tumbledwyer tumbledwyer merged commit 1633658 into configurable-roles Oct 18, 2024
36 of 40 checks passed
@tumbledwyer tumbledwyer deleted the scoped-components branch October 18, 2024 06:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants