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

Add keyboard shortcuts for setting a cell to NULL #936

Open
seancolsen opened this issue Jan 3, 2022 · 19 comments
Open

Add keyboard shortcuts for setting a cell to NULL #936

seancolsen opened this issue Jan 3, 2022 · 19 comments
Assignees
Labels
affects: ux Related to user experience help wanted Community contributors can implement this ready Ready for implementation type: enhancement New feature or request work: frontend Related to frontend code in the mathesar_ui directory
Milestone

Comments

@seancolsen
Copy link
Contributor

seancolsen commented Jan 3, 2022

Desired behavior

  1. Select a cell.
  2. Press Shift+Delete or Shift+Backspace.
  3. The cell value will be set to NULL, with Mathesar exhibiting the same loading, success, and error behavior as it currently does when the user updates a value within a cell.

Notes

  • The keyboard shortcuts should only be active when in select mode -- in edit mode there should not be any keyboard shortcuts for the user to set the cell value to NULL.

  • If the column has a NOT NULL constraint, then an error toast message should show before a request is sent to the server, and no changes should be made.

    The toast message should read:

    <column_name> does not allow NULL.

    Within the toast message, the The column name should be stylized with the Identifier component and NULL should be stylized with the Null component.

  • If the cell is already NULL, then no request should be sent to the server and no toast message should display.

Additional context

See also

@seancolsen seancolsen added type: enhancement New feature or request work: frontend Related to frontend code in the mathesar_ui directory affects: ux Related to user experience ready Ready for implementation labels Jan 3, 2022
@seancolsen seancolsen added this to the [07] Initial Data Types milestone Jan 3, 2022
@seancolsen seancolsen added good first issue Everything in "Help wanted", PLUS being relatively easy and straightforward to implement. help wanted Community contributors can implement this labels Jan 3, 2022
@nk183
Copy link
Contributor

nk183 commented Apr 2, 2022

hi @seancolsen can I work on this

@kgodey kgodey added status: started and removed ready Ready for implementation labels Apr 2, 2022
@kgodey
Copy link
Contributor

kgodey commented Apr 2, 2022

Go ahead @nk183, thanks!

@seancolsen
Copy link
Contributor Author

@nk183 Are you still working on this? We'll be working to close out this milestone soon, so we'll need to re-assign it to a core team member if we don't get a PR by 2022-04-19. Thanks.

@seancolsen seancolsen assigned seancolsen and unassigned nk183 Apr 20, 2022
@seancolsen seancolsen modified the milestones: [07] Initial Data Types, [Beta] Better Editing Experience May 2, 2022
@kgodey kgodey modified the milestones: [Beta] Better Editing Experience, Unprioritized Jun 2, 2022
@seancolsen seancolsen removed their assignment Aug 31, 2022
@KasukabeDefenceForce
Copy link

hi @seancolsen can I work on this?

@Anish9901
Copy link
Member

Assigned to you @AbhinavOhri. Thanks!

@KasukabeDefenceForce
Copy link

hi @Anish9901, I need some help on this. I have figured out the part of how to run the keyboard shortcut but I am unable to figure the file where I should make the desired changes and how to check whether the edit mode is enabled or not.

@KasukabeDefenceForce
Copy link

I have completed setting up the keyboard shortcut. But I could not figure it out the "NOT NULL constraint" segment , can you please guide me on that?

@pavish
Copy link
Member

pavish commented Feb 28, 2023

@AbhinavOhri Each Column instance has a nullable: boolean; property. If this is true, it means that the column accepts null as a valid value in the database. If it's false, it means that the column does not allow null.

Refer BaseColumn interface within mathesar_ui/src/api/types/tables/columns.ts/ for the type definitions. You can see that there's a method setNullabilityOfColumn in mathesar_ui/src/stores/table-data/columns.ts which sends requests to update this column property.

As part of this issue, if the column does not allow null, you should be showing a toast message and not send any requests. If it allows null, you can set the value in the cell to null and the requests should be handled by code that's already in place.

@ParthShirole
Copy link

Hey @Anish9901 Because it has been 2 weeks since an update, can I work on this?

@Anish9901
Copy link
Member

Go ahead @ParthShirole

@KasukabeDefenceForce
Copy link

@Anish9901 I am still working on this. I am done setting up the keybind. I had some doubts about the not null constraint due to which I did not open a draft PR.

@Anish9901
Copy link
Member

Anish9901 commented Mar 6, 2023

I had some doubts about the not null constraint due to which I did not open a draft PR.

I understand that @AbhinavOhri but opening a draft PR helps us to keep track of the progress and since there wasn't one I assumed that no progress was made. Anyway, feel free to open a PR.

@kgodey
Copy link
Contributor

kgodey commented Mar 6, 2023

Assigned this back to @AbhinavOhri since there's a PR open.

@Fares-Basousy
Copy link

can i work on this

@rajatvijay
Copy link
Contributor

@Fares-Basousy there's already a PR under review for this. Please choose another issue.

@Pulkit0729
Copy link

Hi, @Anish9901 can I work on this. as the last PR is in waiting for one month?

@Anish9901
Copy link
Member

@Pulkit0729 I think @rajatvijay is taking care of this issue. You can look through other issues to fix.

@siddhiagarkar
Copy link

Hello @Anish9901
May I take up the task and work on this issue since it is pending yet?

@Anish9901
Copy link
Member

Hey @siddhiagarkar, this issue is being worked on by one of our core team member and is therefore not up for grabs, please find other issues that might interest you.

@Anish9901 Anish9901 removed the good first issue Everything in "Help wanted", PLUS being relatively easy and straightforward to implement. label Oct 6, 2023
@seancolsen seancolsen assigned seancolsen and unassigned rajatvijay Nov 1, 2023
@seancolsen seancolsen added the ready Ready for implementation label Dec 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
affects: ux Related to user experience help wanted Community contributors can implement this ready Ready for implementation type: enhancement New feature or request work: frontend Related to frontend code in the mathesar_ui directory
Projects
No open projects
Development

Successfully merging a pull request may close this issue.