Skip to content
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

Merged

Conversation

jasonmokk
Copy link
Contributor

@jasonmokk jasonmokk commented May 27, 2024

Summary

This PR removes all references to TextTruncatorCss from the codebase in favor of KTextTruncator.

References

Closes #12211

Reviewer guidance


Testing checklist

  • Contributor has fully tested the PR manually
  • If there are any front-end changes, before/after screenshots are included
  • Critical user journeys are covered by Gherkin stories
  • Critical and brittle code paths are covered by unit tests

PR process

  • PR has the correct target branch and milestone
  • PR has 'needs review' or 'work-in-progress' label
  • If PR is ready for review, a reviewer has been added. (Don't use 'Assignees')
  • If this is an important user-facing change, PR or related issue has a 'changelog' label
  • If this includes an internal dependency change, a link to the diff is provided

Reviewer checklist

  • Automated test coverage is satisfactory
  • PR is fully functional
  • PR has been tested for accessibility regressions
  • External dependency files were updated if necessary (yarn and pip)
  • Documentation is updated
  • Contributor is in AUTHORS.md

@github-actions github-actions bot added APP: Device Re: Device App (content import/export, facility-syncing, user permissions, etc.) APP: Learn Re: Learn App (content, quizzes, lessons, etc.) APP: Coach Re: Coach App (lessons, quizzes, groups, reports, etc.) DEV: frontend SIZE: medium labels May 27, 2024
@jasonmokk jasonmokk marked this pull request as ready for review May 27, 2024 21:14
@@ -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';
Copy link
Member

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.

Copy link
Contributor Author

@jasonmokk jasonmokk May 31, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried removing all these imports, but it ends up causing a ReferenceError in the tests as seen below. I've updated the PR to only remove the import/definition from apiSpecs.js, is this okay?

Screenshot 2024-05-31 at 12 52 19 Screenshot 2024-05-31 at 12 48 16 1

Copy link
Member

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.

Copy link
Member

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?

Copy link
Contributor Author

@jasonmokk jasonmokk Jun 4, 2024

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.

Copy link
Member

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.

Copy link
Contributor Author

@jasonmokk jasonmokk Jun 6, 2024

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?

Copy link
Member

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?

Copy link
Member

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.

Copy link
Contributor Author

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.

@MisRob
Copy link
Member

MisRob commented May 30, 2024

Thanks @jasonmokk for your contribution. I left some first feedback.

@jasonmokk jasonmokk force-pushed the remove-text-truncator-css branch from 219135c to 92cc3a8 Compare May 31, 2024 17:31
Copy link

@ghagevaibhav ghagevaibhav left a 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.

@MisRob MisRob self-assigned this Jun 7, 2024
@@ -75,8 +74,7 @@
export default {
name: 'BaseCard',
components: {
TextTruncatorCss,
CardLink,
KTextTruncator,
Copy link
Member

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

@MisRob
Copy link
Member

MisRob commented Jun 13, 2024

Also linting check is failing, you can follow this section of the developer documentation to resolve that.

@jasonmokk jasonmokk force-pushed the remove-text-truncator-css branch from f994ce8 to c125ddc Compare June 17, 2024 18:17
@github-actions github-actions bot added DEV: dev-ops Continuous integration & deployment DEV: renderers HTML5 apps, videos, exercises, etc. DEV: backend Python, databases, networking, filesystem... APP: Facility Re: Facility App (user/class management, facility settings, csv import/export, etc.) APP: User Re: User app (sign-in, sign-up, user profile, etc.) DEV: tools Internal tooling for development SIZE: very large labels Jun 17, 2024
@jasonmokk jasonmokk force-pushed the remove-text-truncator-css branch 2 times, most recently from e3e9de7 to 8f2c3ff Compare June 17, 2024 18:27
Remove from apispecs only

Remove KTextTruncator from components

[pre-commit.ci lite] apply automatic fixes

Linting fixup

minor fixup
@jasonmokk jasonmokk force-pushed the remove-text-truncator-css branch from 8f2c3ff to 5c68c69 Compare June 17, 2024 18:30
Copy link
Member

@MisRob MisRob left a 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!

@MisRob MisRob merged commit d4993f5 into learningequality:develop Jun 18, 2024
31 checks passed
@jasonmokk jasonmokk deleted the remove-text-truncator-css branch November 12, 2024 03:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
APP: Coach Re: Coach App (lessons, quizzes, groups, reports, etc.) APP: Device Re: Device App (content import/export, facility-syncing, user permissions, etc.) APP: Facility Re: Facility App (user/class management, facility settings, csv import/export, etc.) APP: Learn Re: Learn App (content, quizzes, lessons, etc.) APP: User Re: User app (sign-in, sign-up, user profile, etc.) DEV: backend Python, databases, networking, filesystem... DEV: dev-ops Continuous integration & deployment DEV: frontend DEV: renderers HTML5 apps, videos, exercises, etc. DEV: tools Internal tooling for development SIZE: medium SIZE: very large
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Remove TextTruncatorCss Vue component in favor of KTextTruncator
3 participants