-
Notifications
You must be signed in to change notification settings - Fork 0
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
x1032 Add user full name to Release Recipient #393
Conversation
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 have seen the following issues
- The layout of columns are not correct
- The recipient names are not saved or updated
Hi @seenanair, thank you for reviewing this
- I fixed the layout in the second commit, is it still not right at your end ?
- The user should only be able the edit the recipient user full name, unless you mean the user full name ? is there any errors ?
username, | ||
enabled | ||
})); | ||
}; |
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.
Why this conversion is required?
Also, It will be better to define this in a global file and not in EntityManager.
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.
As the userFullName field is optional, the conversion is only to set it to empty if 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.
Ok, is it for displaying purpose? If so, is it not possible to check it on the fly and display an empty string?
<TableCell colSpan={2}> | ||
<Input | ||
type="text" | ||
placeholder="Enter user full name" |
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 generic class, so I think you should avoid any specifics here. For e.g, if we need to add an extra column in another config tab, this won't make sense
<TableCell colSpan={2}>{entity[displayKeyColumnName]}</TableCell> | ||
{extraDisplayColumnName && ( | ||
<TableCell colSpan={2}> | ||
<Input |
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.
Would it be better to switch it back to a label or input style resembling a label ,once user finishes editing or on blur?
<TableCell colSpan={2}> | ||
<Input | ||
type="text" | ||
placeholder="Enter user ID" |
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.
We should avoid messages specific to a particular context as this is a generic class.
type BasicReleaseRecipient = { | ||
userFullName: string; | ||
username: string; | ||
enabled: boolean; |
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.
Why this need to be redefined as we have already a graphql fragment - ReleaseRecipientFieldsFragment available?
src/pages/Configuration.tsx
Outdated
@@ -347,7 +347,7 @@ export default function Configuration({ configuration }: ConfigurationParams) { | |||
also available on the <StyledLink to={'/sgp'}>SGP Management</StyledLink> page as "Work Requester" | |||
</p> | |||
<EntityManager | |||
initialEntities={configuration.releaseRecipients} | |||
initialEntities={convertToBasicReleaseRecipient(configuration.releaseRecipients)} |
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.
Why we need these conversions?
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.
Same as obove, as the userFullName is defined as optional
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.
Looking good 👍
src/pages/Configuration.tsx
Outdated
.then((res) => convertToBasicReleaseRecipient(res.updateReleaseRecipientFullName)[0]); | ||
label: 'Full Name', | ||
value: 'fullName', | ||
extraFieldPlaceholder: 'Enter User Full Name', |
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.
Probably you can change this as well to 'Enter full name' to match column header
@@ -290,7 +272,7 @@ export default function EntityManager<E extends Record<string, EntityValueType>> | |||
<TableCell colSpan={2}> | |||
<Input |
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 have the class style for the full name to be as no border (or a very subtle one) as in normal condition and when we start editing (that means when it gets focus), the border can appear? This way the field will look more similar to other, I think
No description provided.