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

Table name textbox UI error fix #1412

Conversation

AnushDeokar
Copy link
Contributor

closes #1409
It was watching the wrong field i.e. collection due to which the watchvalue will always be equal to the collection name.
Also, I have added consistency in the startCase through which if you switch your input focus and comeback again on tablename field the startCase consistency would be maintained.

@vercel
Copy link

vercel bot commented Sep 13, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Ignored Deployment
Name Status Preview Updated (UTC)
rowy-typedoc ⬜️ Ignored (Inspect) Visit Preview Sep 13, 2023 8:11pm

@vercel
Copy link

vercel bot commented Sep 13, 2023

@AnushDeokar is attempting to deploy a commit to the Rowy Team on Vercel.

A member of the Team first needs to authorize it.

@harinij
Copy link
Member

harinij commented Sep 18, 2023

@AnushDeokar the watchvalue is collection as the table name defaults to the collection name with case corrected form if nothing else is mentioned. The bug here is that the Text box was not editable on first attempt however is editable after another field like description is edited.

@AnushDeokar
Copy link
Contributor Author

AnushDeokar commented Sep 18, 2023

Hey @harinij,
The reason why we are not able to change the table name in the first attempt is because in the first attempt onChange(startCase(watchedValue)); is triggered and since the watchValue is set to collection name doing changes in the field is causing it to reset it to collection name. Therefore the tablename field seems to be uneditable in the first attempt.

However, when we switch field to some other field and comback(let's name it as second attempt) to edit the tablename it works because this time onChange((value.trim()); is triggered which works as expected.

Another reason why keeping watchfield equal to collection does not seems to be logical because consider the following case:

  1. My table name is initially set to let's say Members which is equal to collection name.
  2. Now, I want to change my table name to students. I somehow manages to do by changing it the second attempt and I save it.
  3. However After saving I realise that I had made a typo mistake I forgot to put an 's' in the end and it's just student. Now I will again go back to table settings and as soon as I try to add an 's' at the end in the table name field(displayed as student) It will get refreshed to 'Members' which is equal to the collection name and again the table name will become uneditable since it's the first attempt. This does not makes sense since I want to start edit from student itself. This is another issue.

Changing the collection name to 'name' will fix this bug. Changes made in this PR works perfectly fine and as expected. Please let me know if I am wrong at any point or If you want to this bug to be fixed in any other way.

@AnushDeokar
Copy link
Contributor Author

Why did I add a startcase in value.trim()?

Now let's say I am also able to edit the table name in the first attempt. Another change I made is changing onChange(value.trim()) to onChange(startCase(value.trim())) because in the first attempt when I am trying to change the name the case correction is done but when you switch your focus to description and again comback to change tablename the case correction will not be performed.
You ofcourse cannot notice it right now in the deployment because it's not able to change the tablename in the first attempt.

@shamsmosowi shamsmosowi merged commit 093183e into rowyio:develop Oct 25, 2023
1 of 2 checks passed
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.

None yet

3 participants