Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

KImg review follow-ups #615

Merged
merged 3 commits into from
Apr 15, 2024
Merged

Conversation

MisRob
Copy link
Member

@MisRob MisRob commented Apr 11, 2024

Description

(1) Removes props related to dimensions

These can be simply set by native CSS, with the benefits of

  • no need for validation
  • no need to be adding support for new units
  • no need to have the whole section in the docs to explain how to use something that is, in its native form, familiar to every developer

Even though this is a breaking change, I think it's better to do it sooner than later since at this point, KImg is not used in the products.

(2) Improves internal classes naming

The previous naming didn't make much sense. For example, scaleStyles.innerContainer communicates its purpose (styles related to scaling logic applied to the inner container) much clearly than previous scaleStyles.ratioContainer.

Issue addressed

This resolves some feedback on my KImg work from the walkthrough we did with @AllanOXDi.

Changelog

  • #615
    • Description: Removes KImg props related to dimensions: height, width, maxHeight, minHeight, maxWidth, minWidth
    • Products impact: updated API
    • Addresses: -
    • Components: KImg
    • Breaking: yes
    • Impacts a11y: no
    • Guidance: Use native style, for example replace <KImg width="100%" maxWidth="500px" /> by <KImg :style="{ width: '100%', maxWidth: '500px' }" />.
  • #615
    • Description: Renames KImg internal classes
    • Products impact: none
    • Addresses: -
    • Components: KImg
    • Breaking: -
    • Impacts a11y: -
    • Guidance: -

Steps to test

Testing checklist

  • Contributor has fully tested the PR manually
  • If there are any front-end changes, before/after screenshots are included
  • Critical and brittle code paths are covered by unit tests
  • The change is described in the changelog section above

Reviewer guidance

  • Is the code clean and well-commented?
  • Are there tests for this change?
  • Are all UI components LTR and RTL compliant (if applicable)?
  • Add other things to check for here

After review

  • The changelog item has been pasted to the CHANGELOG.md

Comments

These can be simply set by native CSS, with the benefits of
- no need for validation
- acceptance of any CSS unit rather than just a limited
  set we explicitly built support for
- no need to have the whole section in the docs to explain
  how to use something that is, in its native form,
  familiar to every developer

Relatedly relocates utils file to `KLogo` directory as
it is now the only consumer of it.
@MisRob MisRob requested review from akolson and AllanOXDi April 11, 2024 20:12
@MisRob MisRob added the TODO: needs review Waiting for review label Apr 11, 2024
MisRob added 2 commits April 11, 2024 22:16
The previous naming didn't make much sense.
For example, 'scaleStyles.innerContainer' communicates its purpose
(styles related to scaling logic applied to the inner container)
much clearly than 'scaleStyles.ratioContainer'.
Copy link
Member

@akolson akolson left a comment

Choose a reason for hiding this comment

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

These changes look correct and make sense to me. Thanks @MisRob @AllanOXDi for this. Also, the names for the scaleType internals also are now much more clearer. <3

@MisRob
Copy link
Member Author

MisRob commented Apr 15, 2024

Hi, thanks

@MisRob MisRob merged commit a9d7899 into learningequality:develop Apr 15, 2024
8 checks passed
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
TODO: needs review Waiting for review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants