forked from openSUSE/open-build-service
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Show the diff against the superseded request
- Loading branch information
Showing
8 changed files
with
130 additions
and
13 deletions.
There are no files selected for viewing
38 changes: 38 additions & 0 deletions
38
src/api/app/components/sourcediff_tab_beta_component.html.haml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
.row | ||
- if @action[:diff_not_cached] | ||
.col-lg-12 | ||
.clearfix.mb-2.text-center | ||
.btn.btn-outline-primary.cache-refresh{ title: 'Refresh results', onclick: "reloadRequestAction(#{@index})" } | ||
Crunching the latest data. Refresh again in a few seconds | ||
%i.fas.fa-sync-alt{ id: "cache#{@index}-reload" } | ||
- else | ||
- (@action[:sourcediff] || []).each do |sourcediff| | ||
.clearfix.mb-2 | ||
.btn-group.float-end | ||
%button.btn.btn-outline-secondary.expand-diffs{ data: { package: @action[:spkg] } } | ||
Expand all | ||
%button.btn.btn-outline-secondary.collapse-diffs{ data: { package: @action[:spkg] } } | ||
Collapse all | ||
- if sourcediff[:error] | ||
%p | ||
%i.error | ||
= sourcediff[:error] | ||
- else | ||
- if @action[:sourcediff].length > 1 | ||
%h4 | ||
#{diff_label(sourcediff['new'])} – #{diff_label(sourcediff['old'])} | ||
- if sourcediff['filenames'].present? | ||
- sourcediff['filenames'].each_with_index do |filename, file_index| | ||
.mb-2 | ||
= render partial: 'webui/package/revision_diff_detail', locals: { file_view_path: file_view_path(filename, sourcediff), | ||
filename: filename, | ||
file: sourcediff['files'][filename], | ||
index: file_index, | ||
last: sourcediff['filenames'].last == filename, | ||
package: @action[:spkg], | ||
linkinfo: nil } | ||
- else | ||
.mb-2 | ||
%p.lead | ||
No source changes. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
# frozen_string_literal: true | ||
|
||
class SourcediffTabBetaComponent < ApplicationComponent | ||
attr_accessor :bs_request, :action, :active, :index | ||
|
||
delegate :valid_xml_id, to: :helpers | ||
delegate :request_action_header, to: :helpers | ||
delegate :diff_label, to: :helpers | ||
delegate :diff_data, to: :helpers | ||
|
||
def initialize(bs_request:, action:, active:, index:) | ||
super | ||
|
||
@bs_request = bs_request | ||
@action = action | ||
@active = active | ||
@index = index | ||
end | ||
|
||
def file_view_path(filename, sourcediff) | ||
return if sourcediff['files'][filename]['state'] == 'deleted' | ||
|
||
diff_params = diff_data(@action[:type], sourcediff) | ||
package_view_file_path(diff_params.merge(filename: filename)) | ||
end | ||
|
||
def release_info | ||
@action[:type] == :maintenance_incident && @action[:releaseproject] | ||
end | ||
|
||
def active_class | ||
return if @active != @action[:name] | ||
|
||
'active' | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
:ruby | ||
@pagetitle = "Request #{@bs_request.number}: #{@action[:name]}" | ||
|
||
= render partial: 'beta_alert', locals: { bs_request: @bs_request, action: @action } | ||
|
||
.card | ||
.card-body.p-0 | ||
= render partial: 'request_header', | ||
locals: { bs_request: @bs_request, staging_status: @staging_status, action: @action, active_action: @active_action, | ||
prev_action: @prev_action, next_action: @next_action, supported_actions: @supported_actions, | ||
diff_to_superseded_id: @diff_to_superseded_id, diff_limit: @diff_limit, page_name: 'request_changes', | ||
bs_requests: @watched_requests, packages: @watched_packages, projects: @watched_projects } | ||
= render partial: 'request_tabs', | ||
locals: { bs_request: @bs_request, bs_request_action: @bs_request_action, issues: @issues, active_action: @active_action, | ||
actions_count: @supported_actions.count, active_tab: @active_tab } | ||
.container.p-4 | ||
.tab-content.supersedediff | ||
= render(SourcediffTabBetaComponent.new(bs_request: @bs_request, action: @action, active: @active_action, index: 0)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters