-
-
Notifications
You must be signed in to change notification settings - Fork 13
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
Protect words/senses imported with data The Combine doesn't handle #2019
Conversation
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## master #2019 +/- ##
==========================================
+ Coverage 49.65% 49.81% +0.15%
==========================================
Files 293 294 +1
Lines 9151 9184 +33
Branches 663 666 +3
==========================================
+ Hits 4544 4575 +31
+ Misses 4071 4069 -2
- Partials 536 540 +4
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 1 file with indirect coverage changes Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report in Codecov by Sentry. |
Still to-do:
|
…llow protected words/senses
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.
Reviewed 2 of 7 files at r1, 21 of 30 files at r2, 10 of 11 files at r3, all commit messages.
Reviewable status: 31 of 33 files reviewed, 1 unresolved discussion (waiting on @imnasnainaec)
src/components/DataEntry/DataEntryComponent.tsx
line 61 at r3 (raw file):
const senses = currentWord.senses.filter((s) => [Status.Active, Status.Protected, undefined].includes(s.accessibility) );
We should either retain the comment about why undefined is allowed, or remove it if we can prove it is now obsolete.
Code quote:
const senses = currentWord.senses.filter((s) =>
[Status.Active, Status.Protected, undefined].includes(s.accessibility)
);
src/components/DataEntry/tests/DataEntryComponent.test.tsx
line 39 at r3 (raw file):
{ ...mockWord, senses: [{ ...newSense(), accessibility: Status.Protected }],
I can't tell from just this code if the test is valid. Does newSense contain an Active sense, and does that impact this logic?
It is probably fine, just checking.
Code quote:
senses: [{ ...newSense(), accessibility: Status.Protected }],
src/goals/MergeDupGoal/MergeDupStep/SenseCardContent.tsx
line 134 at r3 (raw file):
), ]; // If props.languages is undefined, this is a sidebar sense and needs no warning.
I'm not sure if I like relying on this to determine if it is a sidebar sense. It seems fragile. Maybe we should have a property to specifically indicate the sidebar senses?
Code quote:
// If props.languages is undefined, this is a sidebar sense and needs no warning.
const protectedWarning =
props.languages !== undefined &&
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.
Reviewable status: 27 of 33 files reviewed, all discussions resolved (waiting on @imnasnainaec and @jasonleenaylor)
src/components/DataEntry/DataEntryComponent.tsx
line 61 at r3 (raw file):
Previously, jasonleenaylor (Jason Naylor) wrote…
We should either retain the comment about why undefined is allowed, or remove it if we can prove it is now obsolete.
Restored.
src/components/DataEntry/tests/DataEntryComponent.test.tsx
line 39 at r3 (raw file):
Previously, jasonleenaylor (Jason Naylor) wrote…
I can't tell from just this code if the test is valid. Does newSense contain an Active sense, and does that impact this logic?
It is probably fine, just checking.
newSense()
does have accessibility=Status.Active
, which is explicitly overridden here.
src/goals/MergeDupGoal/MergeDupStep/SenseCardContent.tsx
line 134 at r3 (raw file):
Previously, jasonleenaylor (Jason Naylor) wrote…
I'm not sure if I like relying on this to determine if it is a sidebar sense. It seems fragile. Maybe we should have a property to specifically indicate the sidebar senses?
Silly of me. Fixed.
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.
Reviewed 1 of 30 files at r2, 1 of 11 files at r3, 4 of 4 files at r4, all commit messages.
Reviewable status: complete! all files reviewed, all discussions resolved (waiting on @imnasnainaec)
Ok, this will need some work. I just used the Collect Words tool in FLEx to generate a couple of entries. Code quote: entry.Traits.Count > 0 || |
Could you use Code quote: (sense.Traits.Find(t => !t.Name.StartsWith("semantic-domain")) != null |
Ok, looking at some lift files I found and tags which we will also want to protect. |
Previously, jasonleenaylor (Jason Naylor) wrote…
Hmm, let's try that again. I found |
Previously, jasonleenaylor (Jason Naylor) wrote…
Note with a "type" other than empty probably should also cause protection. |
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.
Reviewable status: 32 of 33 files reviewed, 2 unresolved discussions (waiting on @jasonleenaylor)
Backend/Helper/LiftHelper.cs
line 13 at r4 (raw file):
Previously, jasonleenaylor (Jason Naylor) wrote…
Note with a "type" other than empty probably should also cause protection.
Note protections added.
Backend/Helper/LiftHelper.cs
line 14 at r4 (raw file):
Previously, jasonleenaylor (Jason Naylor) wrote…
Ok, this will need some work. I just used the Collect Words tool in FLEx to generate a couple of entries.
and<trait name="morph-type" value="stem" />
was present on the entries.
"stem" Trait protection removed.
Backend/Helper/LiftHelper.cs
line 25 at r4 (raw file):
Previously, jasonleenaylor (Jason Naylor) wrote…
Could you use
Sense.Traits.Any(t => !t.Name.StartsWith("semantic-domain")
?
done
I think you have the logic inverted on the nullorempty check here. |
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.
Reviewable status: 32 of 33 files reviewed, 2 unresolved discussions (waiting on @jasonleenaylor)
Backend/Helper/LiftHelper.cs
line 15 at r5 (raw file):
Previously, jasonleenaylor (Jason Naylor) wrote…
I think you have the logic inverted on the nullorempty check here.
flipped
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.
Reviewed 1 of 1 files at r5, 1 of 1 files at r6, all commit messages.
Reviewable status: complete! all files reviewed, all discussions resolved (waiting on @imnasnainaec)
Resolves #1761
This change is