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

Don't allow entering edit mode if PrimaryKey is not set - 14.2 #12423

Merged
merged 6 commits into from
Dec 12, 2022

Conversation

georgianastasov
Copy link
Contributor

Closes #12393

Additional information (check all that apply):

  • Bug fix
  • New functionality
  • Documentation
  • Demos
  • CI/CD

Checklist:

  • All relevant tags have been applied to this PR
  • This PR includes unit tests covering all the new code (test guidelines)
  • This PR includes API docs for newly added methods/properties (api docs guidelines)
  • This PR includes feature/README.MD updates for the feature docs
  • This PR includes general feature table updates in the root README.MD
  • This PR includes CHANGELOG.MD updates for newly added functionality
  • This PR contains breaking changes
  • This PR includes ng update migrations for the breaking changes (migrations guidelines)
  • This PR includes behavioral changes and the feature specification has been updated with them

Sorry, something went wrong.

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
…on editable
@georgianastasov georgianastasov added the ❌ status: awaiting-test PRs awaiting manual verification label Dec 6, 2022

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
@IvanKitanov17 IvanKitanov17 added 💥 status: in-test PRs currently being tested ✅ status: verified Applies to PRs that have passed manual verification and removed ❌ status: awaiting-test PRs awaiting manual verification 💥 status: in-test PRs currently being tested labels Dec 7, 2022

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
@hanastasov hanastasov requested a review from MayaKirova December 9, 2022 12:00
@hanastasov
Copy link
Contributor

hanastasov commented Dec 9, 2022

This PR partially changes current grid behavior in the following way:

Current behavior for grid with enabled editing, no primaryKey set
If a cell or row is editable, user is able to enter edit mode. This edit mode is buggy (for example, for row edit UI will lack the Done, Cancel buttons due to bug), and in the end no succesful transaciton is done). In the console, a warning is displayed that primaryKey needs to be set to the grid.

New behavior
If primaryKey is not set, same warning is displayed in the console, but grid will not even try to display the editing UI.

@sdimchevski @dkamburov Are you OK with this change?

@dkamburov
Copy link
Contributor

@hanastasov @georgianastasov @sdimchevski
I'm not sure about it. Here my thoughts(please correct me if I'm wrong). We currently do throw such warning, but only when the row editing mode is enabled. Now this will apply to cell editing as well, right?

Also do we really need this for both editing modes? Isn't cell editing working without primary key?

And the bigger concern If we go with this fix. We previously didn't stop users from entering edit mode and now we do, sounds like a breaking change. Should be included in the changelog and drop fixes for 14.2. And maybe there were some scenarios were this isn't required, but now it will be.

@georgianastasov
Copy link
Contributor Author

@hanastasov @dkamburov @sdimchevski
The fix will only apply when rowEditing is set to true, but without primaryKey.

On the other hand, when the rowEditing property is not set, and editing is performed as cell editing again without primaryKey, then the fix is not applied and the given cell enters edit mode.

The given changes are related to this issue #12393 in order not to enter row edit mode without editing overlay and without displaying the following error Cannot read properties of undefined (reading 'getBoundingClientRect'), but only to display a warning.

This also relates perhaps to breaking change as @dkamburov mentioned.

@sdimchevski
Copy link

@hanastasov @georgianastasov @dkamburov I'm OK with a warning in the console. That's where all the devs are looking anyway so.

@hanastasov hanastasov merged commit 79345ee into 14.2.x Dec 12, 2022
@hanastasov hanastasov deleted the ganastasov/fix-12393-14.2 branch December 12, 2022 10:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
grid: row-editing grid version: 14.2.x ✅ status: verified Applies to PRs that have passed manual verification
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants