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

Fixed Update #8532 Replace TextTruncator with TextTruncatorCss #10518

Merged
merged 2 commits into from
Apr 28, 2023

Conversation

Pursottam6003
Copy link
Contributor

Summary

From the Issue #8532 I have changed the TextTruncator with TextTruncatorCss in two files only ie index.vue and AlsoInThis.vue

References

From the Issue discussion, i got the little clue to do this #8532

Reviewer guidance

I have been asked to do changes in step by step so that it would be easy to be evaluated and make corrections


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: Coach Re: Coach App (lessons, quizzes, groups, reports, etc.) APP: Learn Re: Learn App (content, quizzes, lessons, etc.) SIZE: small labels Apr 19, 2023
@Pursottam6003
Copy link
Contributor Author

Hii @MisRob Could you please review this PR does it meet the requirements if not kindly let me know where should i need modifications

@MisRob MisRob self-requested a review April 21, 2023 06:57
@MisRob
Copy link
Member

MisRob commented Apr 21, 2023

Thank you, @Pursottam6003, I will review it. Thank you for proceeding in smaller chunks, this will also help me to follow up with you sooner.

@MisRob
Copy link
Member

MisRob commented Apr 21, 2023

@Pursottam6003 In your upcoming pull requests, could you please add the reviewer guidance in a way that communicates how to preview places that were updated from a user point of view (whenever it's relevant)?

This would help a reviewer and especially our QA team as they will know where to navigate as a user and what places to check to confirm fixes, test for regressions, etc. (QA team can't determine where to go in the app according to file names). It doesn't need to be extremely detailed, just a couple of bullet points to give direction will do. Often it's similar to the way you previewed updates on your dev server so as you're working next time, you could just note it down and then paste it to your PR)

@Pursottam6003
Copy link
Contributor Author

Hii @MisRob Could you please review this PR does it meet the requirements if not kindly let me know where should i need modifications

Sure mam I will definitely add Reviewer Guidelines in upcomming PRs

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.

Thank you, @Pursottam6003. Some changes will be needed, please see the comment marked as blocking. Also, if you could reference places where you tested this as you're working on the update, that'd be helpful.

@@ -60,7 +60,7 @@
import CoachContentLabel from 'kolibri.coreVue.components.CoachContentLabel';
import ContentIcon from 'kolibri.coreVue.components.ContentIcon';
import { validateLinkObject, validateContentNodeKind } from 'kolibri.utils.validators';
import TextTruncator from 'kolibri.coreVue.components.TextTruncator';
import TextTruncatorCss from 'kolibri.coreVue.components.TextTruncatorCss'; //update
Copy link
Member

Choose a reason for hiding this comment

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

[minor] //update comment can be cleaned up. Same applies to the other updated component.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ok mam

@@ -35,7 +35,7 @@
<div v-if="message" class="message" :style="{ color: $themeTokens.text }">
{{ message }}
</div>
<TextTruncator
<TextTruncatorCss
v-if="!windowIsSmall"
:text="description"
:maxHeight="80"
Copy link
Member

Choose a reason for hiding this comment

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

[blocking] TextTruncatorCss doesn't have maxHeight property. Instead, it has maxLines which expects a number of lines instead of height information. As we're moving to TextTruncatorCss, these places in the code will need to be updated to its interface too. I'd recommend briefly skimming through TextTruncatorCss file to understand it. The same applies to the other updated component.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure mam, got it thanks for the review

@Pursottam6003
Copy link
Contributor Author

Thank you, @Pursottam6003. Some changes will be needed, please see the comment marked as blocking. Also, if you could reference places where you tested this as you're working on the update, that'd be helpful.

Hii @MisRob now I have resolved the invalid props reference error and tested the code both manually and by using the yarn run test and pre-commit run --all-files

Screenshot from 2023-04-27 15-45-43

Now the TextTruncatorCss is successfully working inside the kolibri/plugins/coach/assets/src/views/plan/LessonResourceSelectionPage/LessonContentCard/index.vue

<TextTruncatorCss
        v-if="!windowIsSmall"
        :text="description"
        :maxLines="3"
        class="description"
      />
    

Screenshot from 2023-04-27 15-09-13

We can clearly see since the maxLines is set to 3 and if it exceeds the 3 lines it will be truncated with ....

@MisRob MisRob self-requested a review April 28, 2023 04:41
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.

Thank you for your contribution and continuous cooperation, @Pursottam6003. It's looking good and I can confirm it works as expected in the other component as well.

Screenshot from 2023-04-28 06-40-20

If you'd like to continue working on #8532, feel free to proceed. It should be more or less the same process - replacing the component, props, and then checking if it works as expected in places where updated components are used. As mentioned before if you could briefly note how to navigate to places you tested in your next PR description, it'd be welcome, so that we know what to test (no need to update screenshots for all of them unless there are some user-facing changes)

@MisRob MisRob merged commit c477af0 into learningequality:develop Apr 28, 2023
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: Learn Re: Learn App (content, quizzes, lessons, etc.) SIZE: small
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants