-
Notifications
You must be signed in to change notification settings - Fork 2
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
Fix multiple days in debates #33
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
primer exemple de review (les reals son en anglès):
- Falta millorar la descripció del que has fet, no cal posar "I fix", es millor posar de manera mes neutre que fa el pr que ho pugui entendre una persona que no sap de que va.
- Si el canvi es visual, cal incloure un screenshot del abans i després (podeu enganxar una imatge a la descripció del github, es puja automticament)
- Quan feu commits, es important que la descripció sigui una mica mes entenedora (no posar "a" com a descripció). Sempre de la forma imperativa, com contestant a la pregunta: "If i apply this change it will ...", els 3 punts seria el que hauries d'escriure.
- Un cop posat el PR cal mirar si passa els testos, el primer de tots es el d'estil "Lint", si hi ha errors cal arreglar-ho. Hi ha eines automatiques per fer-ho depenent del tipus d'error:
bundle exec rubocop -a
bundle exec erblint decidim-*/app/**/*.erb --autocorrect
Perfecte, ara faig els canvis,
Gràcies.
El jue, 26 de nov. de 2020 a la(s) 11:38, Ivan Vergés (
[email protected]) escribió:
… ***@***.**** requested changes on this pull request.
primer exemple de review (les reals son en anglès):
- Falta millorar la descripció del que has fet, no cal posar "I fix",
es millor posar de manera mes neutre que fa el pr que ho pugui entendre una
persona que no sap de que va.
- Si el canvi es visual, cal incloure un screenshot del abans i
després (podeu enganxar una imatge a la descripció del github, es puja
automticament)
- Quan feu commits, es important que la descripció sigui una mica mes
entenedora (no posar "a" com a descripció). Sempre de la forma imperativa,
com contestant a la pregunta: "If i apply this change it will ...", els 3
punts seria el que hauries d'escriure.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#33 (review)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ARJEF4YGJB2QONC6FQI35Y3SRYVZHANCNFSM4TULVB2A>
.
|
3a7b83e
to
43bc3f9
Compare
@@ -139,7 +139,6 @@ | |||
context "when the has address checkbox is checked" do | |||
let(:has_address) { true } | |||
|
|||
# rubocop:disable RSpec/EmptyExampleGroup |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This comments should not be deleted. Since this PR will be about decidim-debates, we should not change things in other components.
@@ -152,7 +151,6 @@ | |||
it { is_expected.to be_invalid } | |||
end | |||
end | |||
# rubocop:enable RSpec/EmptyExampleGroup |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The same for this one
@@ -12,6 +12,11 @@ | |||
} | |||
} | |||
|
|||
.icon-arrow-thin-right { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we want this class to be used in the whole of decidim or will it only be used in the cards used by debates? If so maybe it should go in another scss file related to cards or to debates.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good work! I left some suggestions to improve the code and ensure it follows some standards that help us developers better understand each other 🤖 🌱
Another thing that helps is to make sure your commit messages are descriptive (there are loooooots of guides of how to do it, I picked one randomly for you: https://chris.beams.io/posts/git-commit/#seven-rules)
Quick tip: If you haven't pushed changes yet, you can amend commits
And, one question: Why did you make so many commits? :D
@@ -76,14 +90,12 @@ edit_link( | |||
<% end %> | |||
</span> | |||
</div> | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is unnecessary to remove these blank lines, and it makes it more difficult to focus on the real changes this PR is making ;) The automatic erb
linter should take care that .erb files have a concise style, you don't need to worry about it!
|
||
<% if endorsements_enabled? && allowed_to?(:endorse, :debate, debate: debate) %> | ||
<% if endorsements_enabled? && allowed_to?(:endorse, :debate, debate: debate) %> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Woops! Wrong indentation 🙆🏽♀️
<div> | ||
<%= l debate.start_time, format: "%d" %> <span class="extra__month"> <%= l debate.start_time, format: "%B" %></span> | ||
<div class="extra__time text-small"> <%= l debate.start_time, format: "%H:%M" %> - <%= l debate.end_time, format: "%H:%M" %></span></div> | ||
</div> | ||
<% else %> | ||
<div> | ||
<%= l debate.start_time, format: "%d" %> <span class="extra__month"> <%= l debate.start_time, format: "%B" %></span> | ||
<div class="extra__time text-small"> <%= l debate.start_time, format: "%H:%M" %></span></div> | ||
</div> | ||
<%= icon "arrow-thin-right", class: "icon-arrow-thin-right" %> | ||
<div> | ||
<%= l debate.end_time, format: "%d" %> <span class="extra__month"> <%= l debate.end_time, format: "%B" %></span> | ||
<div class="extra__time text-small"> <%= l debate.end_time, format: "%H:%M" %></span></div> | ||
</div> | ||
<% end %> | ||
</div> | ||
<% end %> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice! It's working as it should :) To improve it, I would:
- Run
erblint
to correct the indentation (check the decidim docs if you're not sure how to do it) - Extracting the logic into a Rails helper would be super super nice 👌🏽 That way this file would be more readable and therefore easy to understand.
it "shows the start date" do | ||
within "extra__date" do | ||
expect(page).to have_content(debate.start_time.strftime("%d")) | ||
expect(page).to have_content(debate.start_time.strftime("%H:%M")) | ||
end | ||
end | ||
|
||
it "shows the end date" do | ||
within "extra__date" do | ||
expect(page).to have_content(debate.end_time.strftime("%d")) | ||
expect(page).to have_content(debate.end_time.strftime("%H:%M")) | ||
end | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good! You should add the other cases too (when only one day is displayed, when there is no end date...)
Thanks for the review |
🎩 What? Why?
It is used to add the end date of a debate, and appear on the view in addition to the start date with the day and month.
📌 Related Issues
Link your PR to an issue
Testing
Testing to verify that the dates appear correctly
📋 Checklist
🚨 Please review the guidelines for contributing to this repository.
docs/
.📷 Screenshots