-
Notifications
You must be signed in to change notification settings - Fork 2
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
Rest to Graphql for Analytical Framework #2966
Conversation
9708c37
to
22acfdd
Compare
22acfdd
to
e624d10
Compare
const roleKeySelector = (d: AnalysisFrameworkRolesType) => d.id; | ||
const roleLabelSelector = (d: AnalysisFrameworkRolesType) => d.title; |
There was a problem hiding this comment.
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)) { |
There was a problem hiding this comment.
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.
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' }, | ||
); | ||
} |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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
if (isNotDefined(val.member)) { | ||
addEditFrameworkMembership({ variables: undefined }); |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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, |
There was a problem hiding this comment.
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
cff7989
to
b7ebc19
Compare
b7ebc19
to
050fbcb
Compare
Changes
This PR doesn't introduce any:
console.log
meant for debuggingThis PR contains valid: