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

Implement graphql queries to fetch project roles #2885

Merged
merged 1 commit into from
Apr 25, 2024

Conversation

shreeyash07
Copy link
Contributor

@shreeyash07 shreeyash07 commented Apr 3, 2024

Changes

Replaced rest api with graphql in project roles options

This PR doesn't introduce any:

  • temporary files, auto-generated files or secret keys
  • build works
  • eslint issues
  • typescript issues
  • codegen errors
  • console.log meant for debugging
  • typos
  • unwanted comments
  • conflict markers

This PR contains valid:

  • permission checks
  • translations

@shreeyash07 shreeyash07 force-pushed the feature/project-roles-rest-graphql branch 4 times, most recently from eb06a37 to 82d0375 Compare April 5, 2024 05:59
Comment on lines 219 to 238
const roles = useMemo(() => {
if (isNotDefined(activeUserRole)) {
return undefined;
}
const currentUserRoleLevel = projectRolesResponse?.results?.find(
(role) => (
// FIXME: Update this after complete on server side
role.type.toUpperCase() === activeUserRole
),
)?.level;
if (!currentUserRoleLevel) {
return undefined;
}
return projectRolesResponse?.results.filter(
(role) => role.level >= currentUserRoleLevel,
);
}, [
activeUserRole,
projectRolesResponse,
]);
Copy link
Member

Choose a reason for hiding this comment

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

This is still required.

@shreeyash07 shreeyash07 force-pushed the feature/project-roles-rest-graphql branch 2 times, most recently from 75ccc21 to 396b36b Compare April 9, 2024 06:24
@shreeyash07 shreeyash07 requested a review from AdityaKhatri April 9, 2024 08:23
@subinasr
Copy link
Contributor

subinasr commented Apr 10, 2024

@shreeyash07 The query has been updated from server side. Can you reflect those changes and also rebase this branch with latest develop?

@shreeyash07 shreeyash07 force-pushed the feature/project-roles-rest-graphql branch from 396b36b to 1b68494 Compare April 17, 2024 09:55
@shreeyash07 shreeyash07 force-pushed the feature/project-roles-rest-graphql branch from 1b68494 to 3f3e661 Compare April 17, 2024 09:57
@AdityaKhatri AdityaKhatri merged commit 0f5ab32 into develop Apr 25, 2024
5 checks passed
@AdityaKhatri AdityaKhatri deleted the feature/project-roles-rest-graphql branch April 25, 2024 09:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants