-
Notifications
You must be signed in to change notification settings - Fork 102
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
Editing a variable sometimes updates other variables with the same name #197
Comments
Interesting. What does the CiceroMark look like? I think the editor just uses the variable name from the CiceroMark node. |
Model
CiceroMark
... So yes something is going very wrong in the CiceroMark there, there is no This issue should probably be pushed down to the markdown-transform. This is quite likely a common idiom. |
We may need to revisit the question of fully qualified names... Template mark holds on to the templateMark
|
I see - so we need to distinguish between the name of the field to be updated when editing, and the name of the variable in the model (field name in the owning type). For complex types, those are two different things. Perhaps we should set We will need to distinguish between |
I'm confused why they're both |
But the variable I think the bottom line is that you need more context (how did you get to that one variable). |
Because this is the name of the variable for both the licensor and the licensee (both contain an AccordParty, and each AccordParty has a partyId). |
Here is the same issue with the rental agreement with a Corresponding model
|
Also see: #175 |
@dselman @irmerk @jeromesimeon
One drawback in 2nd is that I don't know whether more than different variables can have the same field. |
@jeromesimeon @dselman @irmerk |
Sorry for the delay @K-Kumar-01! From my limited perspective on this, I think option 1 sounds like a decent approach and we should try it. As mentioned earlier I think this should probably be pushed down into |
hi @K-Kumar-01 I think we can distinguish between those variables using the context: In the example above: Is the I believe the Slate Document Object Model will contain that context (to be confirmed). |
I'm making an Issue in |
I think it could be entirely done in the web components. What's the reason this is better to do in the markdown transform? |
Alright, I was just going off of your #197 (comment) here :
|
I realise I've am splendidly inconsistent here. But I think the crux of this is how do you know the scope of a variable and we could attempt to fix it either upstream (in the markdown transform) by having "names" be really keeping track of the context where they are used, or by making the logic which links variables together in the editor smarter. The former approach is much more costly, so I'm wondering if someone would be interested in attempting the latter. I think mostly it would be to update the following logic in the editor itself: web-components/packages/ui-contract-editor/src/ContractEditor/plugins/withClauses.js Line 98 in 0667d02
|
The approach where we see the logic solely depends on the field i.e. I think for a temporary solution we can comment out the logic to avoid any confusion and look for a more suitable approach by having a thorough discussion on this. |
I'm suggesting we could change that logic to not be based only on the variable name, but also on the context for it within the Slate DOM. Not sure why you believe it would be ineffective.
Removing the feature as "not working" isn't the worst idea. I would wait for feedback from @dselman on that, though, since he implemented that feature in the first place. |
I apologize. I misunderstood the initial explanation, that's why I commented the above. I now understand the logic you are trying to say. I will see if I am able to find any suitable. |
Bug Report 🐛
In some cases, editing one variable would edit another variable making it impossible to distinguish them.
Expected Behavior
Update to a variable should be propagated to the same variable in other places in the document, but not to different variables.
Steps to Reproduce
Example with the copyright license template:
Both
licensor
andlicensee
variables have typeAccordParty
which seems to confuse the algorithm responsible for propagating variable changes.The text was updated successfully, but these errors were encountered: