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

Include revision in the file url #15933

Merged
merged 2 commits into from Apr 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/api/app/controllers/webui/package_controller.rb
Expand Up @@ -466,7 +466,9 @@ def set_file_details
@revision = @current_rev if !@revision && !@srcmd5 # on very first page load only

files_xml = @package.source_file(nil, { rev: @srcmd5 || @revision, expand: @expand }.compact)
@files = Xmlhash.parse(files_xml).elements('entry')
files_hash = Xmlhash.parse(files_xml)
@files = files_hash.elements('entry')
@srcmd5 = files_hash['srcmd5'] unless @revision == @current_rev
rescue Backend::Error => e
# TODO: crudest hack ever!
if e.summary == 'service in progress' && @expand == 1
Expand Down
2 changes: 1 addition & 1 deletion src/api/app/views/webui/package/_file.html.haml
@@ -1,4 +1,4 @@
- can_be_removed = removable_file?(file_name: file['name'], package: package) && can_modify
- can_be_removed = removable_file?(file_name: file['name'], package: package) && can_modify && is_current_rev
%tr{ id: "file-#{valid_xml_id(file['name'])}" }
%td.text-word-break-all
- link_opts = { action: :show, controller: 'webui/packages/files', project_name: project,
Expand Down