-
-
Notifications
You must be signed in to change notification settings - Fork 29
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
feat(editors): add Clone functionality to Composite Editor #236
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- clone allows you to select a row and clone it, the benefit is that it opens the Composite Editor with the selected row data context and then it allows you to edit anything in the form before doing the actual clone
- in some cases we could fall into an infinite loop if a field changes another field which changes the first field and we fall into inifinite... to resolve this, we can provide an extra paramater "triggeredBy" ("user" or "system") and the developer can change his code to make sure a system change doesn't run more than once to avoid the infinite loop from happening
Codecov Report
@@ Coverage Diff @@
## master #236 +/- ##
==========================================
Coverage 100.00% 100.00%
==========================================
Files 207 207
Lines 11931 11974 +43
Branches 3945 4117 +172
==========================================
+ Hits 11931 11974 +43
Continue to review full report at Codecov.
|
- add new cloned item data context to the onSave - add applyChangesCallback to the onSave - add post callback code to the mdal type switch/case
- the experimental code got moved into the `@typescript-eslint/no-unused-vars`, so this is no longer necessary
ghiscoding
changed the title
feat(editors): add Clone functionality to Composite Editor
WIP - feat(editors): add Clone functionality to Composite Editor
Jan 18, 2021
- rename from `complexFieldLabel` to `complexField` but keep previous property as an alternative to avoid breaking anyone's code
- the applyChanges callback is kind of unnecessary, we could remove it. If developer wants to refresh the grid, it's his own decision and won't interfere with this applyChanges anyway. This way is better because we no longer require the user to call the applyChanges callback and we didn't want to rely on that for all the other create/clone/edit which can now also benefit from this
- when using ColumnPicker, GridMenu or hiding a column via HeaderMenu, it has to recalculate the frozenColumn index because SlickGrid doesn't take care of that and the previous fix that I implement sometimes become out of sync. This PR simplifies the frozenColumn index position, it will simply update it when the index is different, as simple as that.
- even if the property is not found in the item data context, we should still apply the value, SF often has undefined property and that is shown in the Example 12 on the first row on the "% complete" field
ghiscoding
changed the title
WIP - feat(editors): add Clone functionality to Composite Editor
feat(editors): add Clone functionality to Composite Editor
Jan 22, 2021
ghiscoding
commented
Jan 23, 2021
packages/vanilla-bundle/src/components/__tests__/slick-vanilla-grid.spec.ts
Outdated
Show resolved
Hide resolved
ghiscoding
commented
Jan 23, 2021
ghiscoding
commented
Jan 23, 2021
2 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
TODOs
onSave
callback to all modal type, not just mass updates & return data context when possible