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

Upload the calculator logo #982

Open
wants to merge 17 commits into
base: calculators-constructor
Choose a base branch
from

Conversation

KseniaGovorun
Copy link

@KseniaGovorun KseniaGovorun commented Nov 26, 2024

dev

Code reviewers

Summary of issue

The user should be able to upload the calculator logo

Summary of change

CHECK LIST

  • СI passed
  • Сode coverage >=95%
  • PR is reviewed manually again (to make sure you have 100% ready code)
  • All reviewers agreed to merge the PR
  • PR meets all conventions
    image
    image
    image

Show page

Calculator_image.mp4

@KseniaGovorun KseniaGovorun self-assigned this Nov 26, 2024
Copy link

codecov bot commented Nov 26, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 89.71%. Comparing base (ab3e058) to head (61ef4ab).

Additional details and impacted files
@@                     Coverage Diff                     @@
##           calculators-constructor     #982      +/-   ##
===========================================================
+ Coverage                    89.64%   89.71%   +0.06%     
===========================================================
  Files                           69       69              
  Lines                         1111     1118       +7     
===========================================================
+ Hits                           996     1003       +7     
  Misses                         115      115              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@KseniaGovorun KseniaGovorun force-pushed the 970-ability-upload-logo branch from e4b6ed9 to 4f47f52 Compare December 2, 2024 08:23
@@ -0,0 +1,5 @@
<% if @calculator.logo_picture.attached? %>
<%= image_tag(@calculator.logo_picture.variant(resize_to_fill: [428, 307])) %>
Copy link
Collaborator

Choose a reason for hiding this comment

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

use constant for this dimension definition

Comment on lines 28 to 33
<% if @calculator.logo_picture.attached? %>
<%= image_tag @calculator.logo_picture, class: "constructor-calculator-scales", alt: t(".image_alt") %>
<% else %>
<%# Default image %>
<%= image_tag "scales.png", class: "constructor-calculator-scales", alt: t(".image_alt") %>
<% end %>
Copy link
Collaborator

Choose a reason for hiding this comment

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

move logic to get default, or attached image to model

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.

4 participants