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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix initiative print link, margin, and organization logo #9162

Merged
merged 7 commits into from May 3, 2022

Conversation

andreslucena
Copy link
Member

馃帺 What? Why?

This PR removes a legacy print page that we have in admin. This should have been removed when #5736 was implemented, but it was left. I've removed the action and linked to the frontend.

In the process of fixing it, I found a couple more bugs that this PR also solves:

  1. If the initiative has a logo uploaded then you'll have an exception here:

Failure/Error: <%= image_tag current_organization.logo.url, title: current_organization.name %>

ActionView::Template::Error:
bad URI(is not URI?): nil

I think it was because it wasn't migrated during the change to ActiveStorage on #7598. I've also added a regression test for this.

  1. There was a string left without i18n translation. I've added it.
  2. There was a missing margin in the page. I've added it. (see screenshots)

馃搶 Related Issues

Testing

  1. Upload the logo to the organization
  2. Go to an initiative in "Technical validation" state.
  3. Click in the Print link
  4. See that you have the organization logo
  5. See that you have a margin in this page
  6. (After the i18n gets filled in Crowdin, you can check that the "Members.." string is translated)

Regarding the print initiative in admin:

  1. Sign in as admin
  2. Go to the initiatives' page in the admin panel
  3. Click in the print button
  4. See that it isn't in Catalan and doesn't have the wording for the city of Barcelona

馃摲 Screenshots

Before

image

After

image

鈾ワ笍 Thank you!

@andreslucena andreslucena added module: initiatives type: fix PRs that implement a fix for a bug labels Apr 13, 2022
@andreslucena andreslucena changed the title Fix initiative print when there's an organization logo Fix initiative print link, margin, and organization logo Apr 13, 2022
@andreslucena
Copy link
Member Author

There's a failing spec, I'll need to check it. I'll let you know when this is ready to be re-reviewed.

@andreslucena andreslucena marked this pull request as draft May 2, 2022 08:13
@andreslucena andreslucena marked this pull request as ready for review May 3, 2022 09:04
@andreslucena
Copy link
Member Author

There's a failing spec, I'll need to check it. I'll let you know when this is ready to be re-reviewed.

I've fixed the spec. This is ready to be re-reviewed @ahukkanen

@ahukkanen ahukkanen merged commit 1f6b3ef into develop May 3, 2022
@ahukkanen ahukkanen deleted the fix/initiative-print branch May 3, 2022 10:47
andreslucena added a commit that referenced this pull request May 6, 2022
* Fix initiative print when there's an organization logo

* Add i18n string for members header

* Add missing margin in initiative print page

* Link to the public initiative print page from admin panel

* Remove show/print action from initiatives' admin

* Open initiative print page in new tab

* Fix spec
andreslucena added a commit that referenced this pull request May 6, 2022
* Fix initiative print when there's an organization logo

* Add i18n string for members header

* Add missing margin in initiative print page

* Link to the public initiative print page from admin panel

* Remove show/print action from initiatives' admin

* Open initiative print page in new tab

* Fix spec
ahukkanen pushed a commit that referenced this pull request May 10, 2022
* Fix initiative print when there's an organization logo

* Add i18n string for members header

* Add missing margin in initiative print page

* Link to the public initiative print page from admin panel

* Remove show/print action from initiatives' admin

* Open initiative print page in new tab

* Fix spec
@alecslupu alecslupu added this to the 0.27.0 milestone Jul 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
module: initiatives type: fix PRs that implement a fix for a bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

PDF creation within Initiative not translatable
3 participants