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

1447 change attachment paths #1478

Merged
merged 12 commits into from
Mar 6, 2018
Merged

1447 change attachment paths #1478

merged 12 commits into from
Mar 6, 2018

Conversation

entantoencuanto
Copy link
Member

Closes #1447
This PR implements partially #932

✌️ What does this PR do?

  • Fixes wrong urls generated in admin creating or editing attachments not related with global GobiertoParticipation module or an specific GobiertoParticipation::Process.
  • Also implements the part described in URLs for sections / CMS pages #932 to unify paths to attachments. From now there will be only a path to any kind of attachment under 'documento/'
  • A decorator is used to calculate the context of the attachment (the template, the layout and the module related with the attachment) and the controller takes into account this context to display breadcrumbs or navigation menus.

🔍 How should this be manually tested?

(staging example) Visit file attachments management from admin: http:https://gobify.net/admin/attachments/file_attachments and go to a collection not related with Gobierto::Participation module, for example: http:https://gobify.net/admin/collections/22 and update an existing document or create a new one. Click on 'View the document' link on success message.

👀 Screenshots

The views remain unchanged, only the paths change.

:shipit: Does this PR changes any configuration file?

No

@ferblape
Copy link
Member

ferblape commented Mar 2, 2018

Maybe it's not related with this PR but during the acceptance in staging, when I update an attachment in staging I get this Rollbar:

https://rollbar.com/Populate/gobierto/items/851/?item_page=0&#traceback

Could you take a look and fix it, please?

I'm also getting a 500 error when visiting this URL: http:https://newalcobendas.gobify.net/documento/instrucciones-teclado

The URL belongs to a process attachment: http:https://newalcobendas.gobify.net/participacion/p/protocolo-sobre-medidas-a-adoptar-durante-episodios-de-alta-contaminacion-atmosferica/documentos

@codecov-io
Copy link

codecov-io commented Mar 2, 2018

Codecov Report

Merging #1478 into master will increase coverage by 0.05%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1478      +/-   ##
==========================================
+ Coverage   78.52%   78.57%   +0.05%     
==========================================
  Files         533      520      -13     
  Lines       13849    13492     -357     
==========================================
- Hits        10875    10602     -273     
+ Misses       2974     2890      -84
Impacted Files Coverage Δ
...obierto_attachments/file_attachments_controller.rb 92.3% <ø> (ø) ⬆️
...rto_participation/scopes/attachments_controller.rb 100% <ø> (+22.22%) ⬆️
...s/gobierto_participation/attachments_controller.rb 82.35% <ø> (-4.02%) ⬇️
..._participation/processes/attachments_controller.rb 87.5% <ø> (-3.41%) ⬇️
...rto_participation/issues/attachments_controller.rb 100% <ø> (+22.22%) ⬆️
...ators/gobierto_attachments/attachment_decorator.rb 100% <100%> (ø)
app/models/gobierto_attachments/attaching.rb 100% <100%> (ø) ⬆️
app/models/gobierto_attachments/attachment.rb 97.64% <100%> (+2.14%) ⬆️
...ribers/gobierto_attachments_attachment_activity.rb 93.33% <100%> (ø) ⬆️
...ers/gobierto_attachments/attachments_controller.rb 78.57% <100%> (ø) ⬆️
... and 30 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update bc09258...c58d00b. Read the comment docs.

@entantoencuanto
Copy link
Member Author

I think that it's fixed, when an attachment is not associated with a collection there aren't errors, but some GobiertoAttachments::Attachment instances remain with collection_id attribute blank.

@ferblape ferblape force-pushed the 1447-change_attachment_paths branch from be708ad to e3b8afd Compare March 6, 2018 08:25
@ferblape
Copy link
Member

ferblape commented Mar 6, 2018

Fixed an old issue in e3b8afd and c58d00b

@ferblape ferblape merged commit ea212ba into master Mar 6, 2018
@ferblape ferblape deleted the 1447-change_attachment_paths branch March 6, 2018 08:51
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

3 participants