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

Rest to Graphql for Analytical Framework #2966

Merged
merged 4 commits into from
Aug 27, 2024

Conversation

shreeyash07
Copy link
Contributor

@shreeyash07 shreeyash07 commented Jul 11, 2024

Changes

  • Add graphql query for
    • fetch analytical framework memberships
  • Add graphql mutation for
    • Add and edit framework memberships
    • Add analytical framework to a project
    • Delete an analytical framework membership

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/analytical-framework-rest-graphql branch 2 times, most recently from 9708c37 to 22acfdd Compare July 19, 2024 10:53
@shreeyash07 shreeyash07 force-pushed the feature/analytical-framework-rest-graphql branch from 22acfdd to e624d10 Compare July 30, 2024 12:07
@shreeyash07 shreeyash07 marked this pull request as ready for review July 31, 2024 06:19
Comment on lines +36 to 37
const roleKeySelector = (d: AnalysisFrameworkRolesType) => d.id;
const roleLabelSelector = (d: AnalysisFrameworkRolesType) => d.title;
Copy link
Contributor

Choose a reason for hiding this comment

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

Give better naming convention then d.

type FormSchemaFields = ReturnType<FormSchema['fields']>

const schema: FormSchema = {
fields: (value): FormSchemaFields => {
if (isDefined(value?.id)) {
if (isDefined(value?.frameworkId)) {
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 not frameworkId, it is id because, we need to have value of membership if the membership is being updated which is signified by this check.

Comment on lines +157 to +169
const ok = isDefined(result) && result?.length > 0;

if (ok) {
if (userValue?.id) {
alert.show(
'Successfully updated user to the analytical framework.',
{ variant: 'success' },
);
} else {
alert.show(
'Successfully added user to the analytical framework.',
{ variant: 'success' },
);
}
Copy link
Member

Choose a reason for hiding this comment

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

Can we not fetch ok directly from the server?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

there is no ok response in bulk mutation

Comment on lines 211 to 212
if (isNotDefined(val.member)) {
addEditFrameworkMembership({ variables: undefined });
Copy link
Member

Choose a reason for hiding this comment

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

I don't understand why this case exists.
We either add a user or update it. It is defined by member part of the data.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

due to type issue we have to check it

onDeleteClick: triggerUserRemove,
disabled: data.member === activeUserId,
onDeleteClick: handleUserDeleteClick,
disabled: data.id === activeUserId,
Copy link
Member

Choose a reason for hiding this comment

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

The id will refer to member id, but we need the user Id here

@shreeyash07 shreeyash07 force-pushed the feature/analytical-framework-rest-graphql branch from cff7989 to b7ebc19 Compare August 22, 2024 05:18
@AdityaKhatri AdityaKhatri force-pushed the feature/analytical-framework-rest-graphql branch from b7ebc19 to 050fbcb Compare August 27, 2024 10:22
@AdityaKhatri AdityaKhatri merged commit 4b7f1af into develop Aug 27, 2024
4 of 5 checks passed
@AdityaKhatri AdityaKhatri deleted the feature/analytical-framework-rest-graphql branch August 27, 2024 10:31
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.

4 participants