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

x1032 Add user full name to Release Recipient #393

Merged
merged 4 commits into from
Sep 7, 2023

Conversation

sabrine33
Copy link
Contributor

No description provided.

@sabrine33 sabrine33 requested a review from seenanair September 6, 2023 08:32
Copy link
Contributor

@seenanair seenanair left a 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
}));
};
Copy link
Contributor

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.

Copy link
Contributor Author

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

Copy link
Contributor

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"
Copy link
Contributor

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
Copy link
Contributor

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"
Copy link
Contributor

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;
Copy link
Contributor

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?

@@ -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)}
Copy link
Contributor

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?

Copy link
Contributor Author

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

@seenanair
Copy link
Contributor

Screenshot 2023-09-06 at 15 16 55
Screenshot 2023-09-06 at 15 16 34

Copy link
Contributor

@seenanair seenanair left a comment

Choose a reason for hiding this comment

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

Looking good 👍

.then((res) => convertToBasicReleaseRecipient(res.updateReleaseRecipientFullName)[0]);
label: 'Full Name',
value: 'fullName',
extraFieldPlaceholder: 'Enter User Full Name',
Copy link
Contributor

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
Copy link
Contributor

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

@sabrine33 sabrine33 merged commit b61fc93 into devel Sep 7, 2023
7 checks passed
@sabrine33 sabrine33 deleted the x1032_add_user_full_name_to_RR branch October 5, 2023 15:08
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.

2 participants