-
Notifications
You must be signed in to change notification settings - Fork 733
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
Replace TextTruncatorCss
with KTextTruncator
#12215
Replace TextTruncatorCss
with KTextTruncator
#12215
Conversation
@@ -37,15 +37,15 @@ | |||
<script> | |||
|
|||
import { validateLinkObject } from 'kolibri.utils.validators'; | |||
import TextTruncatorCss from 'kolibri.coreVue.components.TextTruncatorCss'; | |||
import KTextTruncator from 'kolibri-design-system/lib/KTextTruncator'; |
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.
Same as my previous comment, I think all imports like this can be removed.
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.
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 see, hm I don't understand why it doesn't work, but looking at the Kolibri codebase, it's the case for more components. I will look at it later. So I think there's no need to be dealing with this in the scope of this pull request.
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.
@jasonmokk Actually one question - when you removed the import
statement, did you also remove KTextTruncator
from components
on line 48?
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.
No, I did not. I just double checked and still found tests are failing when I remove just the import
statement while keeping KTextTruncator
in components
.
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.
If you don't clean it from components
and remove import only then components
don't know where to reach for it and that's most likely the cause of the error. So both need to be cleaned up (and that should be fine because KTextTruncator
should be globally available for use in all Kolibri components immediately without any extra steps needed). Apologies for my first comment, I wasn't explicit about this and assumed you removed both places. Let me know if this helps.
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.
Ah I see. I tried removing KTextTruncator
from components
along with the import removal, but unfortunately I am still getting the same ReferenceError
when running yarn run test
. Perhaps this is a larger issue?
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.
Tests are passing on my localhost after this cleanup. Could you double-check if you removed all places before running tests?
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 noticed the most recent commit @jasonmokk and thanks for following-up. The tests are still failing, possibly because one last place in the BaseCard, line 77.
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.
Got it, I've updated it and I believe everything should be passing now.
Thanks @jasonmokk for your contribution. I left some first feedback. |
Build Artifacts
|
219135c
to
92cc3a8
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.
Hey I came on this issue to solve it, but seen it solved I decided to review the changes and In think everything look's great overall.
@@ -75,8 +74,7 @@ | |||
export default { | |||
name: 'BaseCard', | |||
components: { | |||
TextTruncatorCss, | |||
CardLink, | |||
KTextTruncator, |
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 will need to be removed as well
Also linting check is failing, you can follow this section of the developer documentation to resolve that. |
f994ce8
to
c125ddc
Compare
e3e9de7
to
8f2c3ff
Compare
Remove from apispecs only Remove KTextTruncator from components [pre-commit.ci lite] apply automatic fixes Linting fixup minor fixup
8f2c3ff
to
5c68c69
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.
All is looking good to me. Thank you and congrats to your first contribution @jasonmokk!
Summary
This PR removes all references to
TextTruncatorCss
from the codebase in favor ofKTextTruncator
.References
Closes #12211
Reviewer guidance
…
Testing checklist
PR process
Reviewer checklist
yarn
andpip
)