-
-
Notifications
You must be signed in to change notification settings - Fork 322
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
Update dropdown conditions on column rename #1038
Conversation
c564153
to
88a857b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add some tests for this functionality?
Refactored the entire logic. Now ACL formulas and dropdown condition formulas use the same logic to handle renames. Previously Comments and tests to come later. |
3e14132
to
101f4e9
Compare
2ead64c
to
4eeb928
Compare
e538e20
to
a1b537b
Compare
a1b537b
to
9847b84
Compare
Currently translated at 100.0% (1340 of 1340 strings) Translation: Grist/client Translate-URL: https://hosted.weblate.org/projects/grist/client/de/
We need this directory for building the image, but not for running the tests outside of it.
While the intent was to run tests with it, we don't need it. Instead, this caused problems because the stubs overrode the intended `ext` directory and therefore disabled the ext features.
Currently translated at 99.1% (1329 of 1340 strings) Translation: Grist/client Translate-URL: https://hosted.weblate.org/projects/grist/client/fr/
Currently translated at 100.0% (1340 of 1340 strings) Translation: Grist/client Translate-URL: https://hosted.weblate.org/projects/grist/client/sk/
Summary: - Adding confirmation dialog when user doesn't want to cancel site - Changing `Cancel subscription` to `Cancel plan` - Removing `Pro` from upgrade header on pricing modal - Better handling situation when there is no default price - Removing mentions about sprouts program - Removing cache for stripe plans Test Plan: Updated tests Reviewers: georgegevoian Reviewed By: georgegevoian Differential Revision: https://phab.getgrist.com/D4273
Summary: Some editors do some async work before saving the value (Ref column can add new records). Those actions were send without bundling, so it wasn't possible to undo those actions with togheter. Test Plan: Added new test Reviewers: georgegevoian Reviewed By: georgegevoian Differential Revision: https://phab.getgrist.com/D4285
This is to facilitate alerting to detect if snapshot generation were to stall for a document.
Reorganize preview workflows so that previews can be made for PRs from outside contributors.
Summary: Adding authorization header support for webhooks. Issue: #827 --------- Co-authored-by: Florent <florent.git@zeteo.me>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you! Looks good, just one lingering question about syntaxerrors.
sandbox/grist/dropdown_condition.py
Outdated
widget_options["dropdownCondition"] = {"text": new_dc_formula} | ||
try: | ||
# Parse the new dropdown condition formula if it is syntactically correct. | ||
# The data engine stops processing remaining formulas when it hits an exception. Parsing a |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This sentence sounds wrong. Generally Grist formulas can have exceptions and that doesn't normally interfere with other formulas. So probably you mean something more specific -- it would be good to clarify.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I rephrased it a bit. Hope it's clearer now.
I think one remaining comment is about making public a |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have two more comments but really minor now. Approving. Thank you very much! I appreciate in particular unifying quite a bit of the logic and fixing the renaming of acl formulas with "$" signs along the way!
# Build up a dictionary mapping col_ref of each affected formula to the new formula text. | ||
formula_updates = self._prepare_formula_renames(renames) | ||
|
||
# For any affected columns, include the formula into the update. | ||
for col_rec, new_formula in sorted(six.iteritems(formula_updates)): | ||
col_updates.setdefault(col_rec, {}).setdefault('formula', new_formula) | ||
|
||
acl.perform_acl_rule_renames(self, renames) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dsagal @SleepyLeslie Can I move those two method calls down below (where it were before)?
The new order of things generates acl rename actions before the column is actually renamed. Before the order was reversed, first RenameAction
then UpdateRecord
(for ACL)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After discussing it offline, I will update it in another PR.
This PR adds the ability to automatically update the dropdown condition formula on a reference column when a column it refers to has been renamed.