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

Don't rely on js for badge length setting #5045

Merged
merged 1 commit into from
Mar 20, 2023
Merged

Conversation

asdil12
Copy link
Member

@asdil12 asdil12 commented Mar 20, 2023

JS doesn't work when SVG is shown via tag.

Ticket: https://progress.opensuse.org/issues/124173

@asdil12
Copy link
Member Author

asdil12 commented Mar 20, 2023

image

@asdil12 asdil12 requested a review from Martchus March 20, 2023 13:55
Copy link
Contributor

@Martchus Martchus left a comment

Choose a reason for hiding this comment

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

I generally like the lookup-table approach. Seems much simpler/faster than your previous if-else-cascade attempt.

By the way, how did you come up with these scaling factors? Maybe it is worth adding a comment?

lib/OpenQA/WebAPI/Controller/Test.pm Outdated Show resolved Hide resolved
lib/OpenQA/WebAPI/Controller/Test.pm Outdated Show resolved Hide resolved
lib/OpenQA/WebAPI/Controller/Test.pm Outdated Show resolved Hide resolved
@asdil12
Copy link
Member Author

asdil12 commented Mar 20, 2023

The lookup table was created using the HTML testpage (see https://progress.opensuse.org/issues/124173#note-12) which looks like #5045 (comment).

# scaling factors for chars - determined by using a test page (see https://progress.opensuse.org/issues/124173#note-12)
# showing 20x the same char in a badge with one badge for each char or symbol
# and then adjusting the lookup table values until the size of each badge matched.

JS doesn't work when SVG is shown via <img> tag.

Ticket: https://progress.opensuse.org/issues/124173
@codecov
Copy link

codecov bot commented Mar 20, 2023

Codecov Report

Merging #5045 (d20e18a) into master (39af241) will increase coverage by 0.00%.
The diff coverage is 100.00%.

@@           Coverage Diff           @@
##           master    #5045   +/-   ##
=======================================
  Coverage   98.23%   98.23%           
=======================================
  Files         381      381           
  Lines       35870    35876    +6     
=======================================
+ Hits        35238    35244    +6     
  Misses        632      632           
Impacted Files Coverage Δ
lib/OpenQA/WebAPI/Controller/Test.pm 95.52% <100.00%> (+0.06%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@mergify mergify bot merged commit 84fc5a7 into os-autoinst:master Mar 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants