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

When creating new People object, data from First/Last Name is lost after clicking on First/Last Name field #6740

Closed
BOHEUS opened this issue Aug 26, 2024 · 11 comments · Fixed by #6910
Assignees
Labels
scope: front Issues that are affecting the frontend side only

Comments

@BOHEUS
Copy link
Contributor

BOHEUS commented Aug 26, 2024

Scenario:

  1. Log in
  2. Go to People
  3. Click on '+' in right top corner
  4. Enter anything in First name and click on Last name field

Actual: Data inserted in First name field disappears after clicking on Last name field (on video it's clear that after inserting data in both name fields and clicking on any of them, it disappears)
Screencast from 2024-08-26 12-17-50.webm

Expected: Data must stay in First name field

Note: Problem doesn't appear when entering data in First name field and clicking Tab in order to move to Last name field

@harshit078
Copy link
Contributor

Seems like the current state is not getting saved as when you press Enter or Tab or click outside it saves the new cell when you switch from first name or last name. However when you attempt to rename the cell then it works normally.

@Nabhag8848
Copy link
Contributor

Nabhag8848 commented Aug 26, 2024

Related and has same issue as in #6633 draftValue is getting reset when we tap on it while having state in other field. I'm handling it in PR #6736 as this particular thing will need to fix first inorder to also handle that whitespace in both - fullName field shouldn't create record.

@Nabhag8848
Copy link
Contributor

Nabhag8848 commented Aug 26, 2024

Hey @harshit078 would you like to tackle this ? as I was able to test this without solving as you mentioned this isn't happening with tab or shift + tab, I haven't handle it yet.

I can help you to get your PR first contribution, right at this line just console.log(draftValue) this is getting undefined when we tap on it this can be starting point to find out whats the core issue and as always things can get complicated.

const { hotkeyScope, draftValue, setDraftValue } = useFullNameField();

also this commit in my pr #6736 are changes to this file 3ba10ae

@harshit078
Copy link
Contributor

Sure @Nabhag8848, Will take this up no issue.

@charlesBochet
Copy link
Member

Thank you guys!

@Bonapara Bonapara added good first issue Good for newcomers scope: front Issues that are affecting the frontend side only labels Aug 28, 2024
@Bonapara
Copy link
Member

@harshit078 are you still willing to take this up? If yes I will assign you. Thanks for contributing!

@harshit078
Copy link
Contributor

On debugging, It can be seen that const draftValue = useRecoilValue(getDraftValueSelector()); is the place where draftValue is being undefined. However recordId, fieldName and scopeId all are defined and are being not passed as NULL. Since draftValue is undefined then through nullish operator we should get the empty string operator but firstValue is still being passed the draftValue firstValue={draftValue?.firstName ?? ''} & secondValue={draftValue?.lastName ?? ''} . If we only pass '' in both first and second Value, this issue resolved itself as can be seen in the attached video. What are your opinions on this ?

Screen.Recording.2024-08-29.at.2.26.44.AM.mov

@Bonapara
Copy link
Member

@lucasbordeau will have a thought for your @harshit078. Thanks for tackling it!

@harshit078
Copy link
Contributor

Also this only happens when creating a new cell for the first time. When a cell already created and then if you edit the first name or last name, then it saves the current state.

Screen.Recording.2024-08-31.at.2.09.57.AM.mov

@charlesBochet
Copy link
Member

@lucasbordeau can you investigate this one?

draftValue should not be reset once we are still in the open cell

@lucasbordeau
Copy link
Contributor

@harshit078 I'll fix it rapidly.

@lucasbordeau lucasbordeau removed the good first issue Good for newcomers label Sep 5, 2024
@lucasbordeau lucasbordeau linked a pull request Sep 5, 2024 that will close this issue
@github-project-automation github-project-automation bot moved this from 🆕 New to ✅ Done in Product development ✅ Sep 6, 2024
lucasbordeau added a commit that referenced this issue Sep 20, 2024
…whitespaces string (#6736)

# ISSUE
- Closes #6734
- Closes #6633
- Closes #6733
- Closes #6816

# Description

- [x] Don't allow Empty (whitespaces) Objects to Create, all the
keyboard shortcuts are also handled for this.



https://github.com/user-attachments/assets/1c9add4e-f13f-458b-8f76-63bd868413a2



https://github.com/user-attachments/assets/e72b6ee3-74e4-4517-a230-3eb10db80dc7

Note: we do have one other issue with FullName field #6740 Inorder to
test use **shift**.




- [x] Api Keys Input Name Field -> New and Detail View Name field
shouldn't be empty or string with whitespaces, we won't able to have
whitespaces in both. **Try Entering just spaces**



https://github.com/user-attachments/assets/b521b49f-648c-4585-9d15-8ff4faed3c3a


- [x] Similar to above, Empty webhook endpoint url under
**/settings/developers/webhooks/new** won't be created. **Try Entering
just spaces**

- [x] New Functions or Updating Functions will not able to have
whitespaces, empty string as Name. **Try Entering just spaces**



https://github.com/user-attachments/assets/09fcf394-c6d9-4080-8efd-462b054a22d0



- [x] under **settings/workspace-members** changes will lead and solve
that user won't be able to enter Invite by email as just whitespaces +
button is now getting disabled when there is no correct email. **Try
Entering just spaces**



https://github.com/user-attachments/assets/b352edfa-113b-4645-80fd-db6f120ab5db



- [x] Text Input Field, will not allow to start entering with
whitespaces and won't take just whitespaces as value spaces between
words will work.


https://github.com/user-attachments/assets/8c1a0812-45be-4ed2-bd3d-bb4f92147976

- [x] Similarly Number works as per above including shortcuts. 


https://github.com/user-attachments/assets/9f69cc87-5c3c-43ee-93c4-fa887bc0d7ee


- [x] Similarly FullName field works as per above including shortcuts



https://github.com/user-attachments/assets/7bb006b2-abf7-44cd-a214-7a2fc68df169

- [x] Pasting fullName is been Improved. 

- Case 1 (Two Words): If there are exactly two words, return them as is.
- Case 2 (More than Two Words): If there are more than two words, return
the first two words only.
- Case 3 (One Word): If there is only one word, return it as the first
name, with an empty string as the last name.
- WhiteSpaces have been handled. 

```
console.log(splitFullName("John     Doe")); // ["John", "Doe"]
console.log(splitFullName("        ")); // ["", ""]
console.log(splitFullName("John")); // ["John", ""]
console.log(splitFullName("  John   Doe  ")); // ["John", "Doe"]
console.log(splitFullName("John Michael  Andrew Doe")); // ["John", "Michael"]
```

---------

Co-authored-by: Lucas Bordeau <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
scope: front Issues that are affecting the frontend side only
Projects
Status: ✅ Done
Development

Successfully merging a pull request may close this issue.

8 participants
@charlesBochet @Bonapara @lucasbordeau @BOHEUS @Nabhag8848 @harshit078 and others