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

#988 Add color to Calculator #997

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

Conversation

DanielVajnagi
Copy link
Contributor

@DanielVajnagi DanielVajnagi commented Dec 1, 2024

Code reviewers

Second Level Review

Summary of issue

Add color picker to calculator

Summary of change

Added color field in model, created partial for picking color

image

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
  • I've checked new feature as logged in and logged out user if needed
  • PR meets all conventions

@DanielVajnagi DanielVajnagi self-assigned this Dec 1, 2024
@DanielVajnagi DanielVajnagi linked an issue Dec 1, 2024 that may be closed by this pull request
@DanielVajnagi DanielVajnagi changed the title Closes #988 Add color to Calculator #988 Add color to Calculator Dec 1, 2024
Copy link

codecov bot commented Dec 1, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 86.75%. Comparing base (f934abb) to head (bdb84cb).

Additional details and impacted files
@@                     Coverage Diff                     @@
##           calculators-constructor     #997      +/-   ##
===========================================================
+ Coverage                    86.74%   86.75%   +0.01%     
===========================================================
  Files                           68       68              
  Lines                         1056     1057       +1     
===========================================================
+ Hits                           916      917       +1     
  Misses                         140      140              

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

<%= f.input :color, as: :color, label: 'Choose a Color for Calculator Page:',
input_html: {
class: 'form-control form-control-color p-2',
style: 'width: 7rem; height: 3.5rem;'
Copy link
Collaborator

Choose a reason for hiding this comment

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

інлайн стилі не гуд

@@ -35,6 +36,7 @@ class Calculator < ApplicationRecord
validates :en_name, :uk_name, presence: true
validates :en_name, :uk_name, length: { minimum: 3, maximum: 50 }
validates :slug, presence: true, uniqueness: true
validates :color, format: { with: /\A#[0-9a-fA-F]{6}\z/ }
Copy link
Collaborator

Choose a reason for hiding this comment

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

а де тести?))

Comment on lines +43 to +44
width: 7rem;
height: 3.5rem;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
width: 7rem;
height: 3.5rem;
@apply w-28 h-14;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Rejected
Development

Successfully merging this pull request may close these issues.

Add a calculator's color
3 participants