-
Notifications
You must be signed in to change notification settings - Fork 438
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #12092 from danidoni/implement-a-workflow-run-show…
…-view Implement a workflow run show view
- Loading branch information
Showing
13 changed files
with
371 additions
and
28 deletions.
There are no files selected for viewing
14 changes: 14 additions & 0 deletions
14
src/api/app/components/workflow_run_header_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,14 @@ | ||
%h3 | ||
#{hook_event.humanize} event | ||
%p | ||
- if hook_action | ||
%span.badge.badge-primary= hook_action.humanize | ||
%span.badge{ class: status_class }= status.humanize | ||
%p Repository: #{link_to(repository_name, repository_url)} | ||
- case hook_event | ||
- when 'pull_request' | ||
%p PR: #{link_to("##{event_source_name}", event_source_url)} | ||
- when 'Merge Request Hook' | ||
%p MR: #{link_to("##{event_source_name}", event_source_url)} | ||
- when 'push', 'Push Hook' | ||
%p Commit: #{link_to(event_source_name, event_source_url)} |
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 @@ | ||
class WorkflowRunHeaderComponent < WorkflowRunRowComponent | ||
def initialize(workflow_run:) | ||
super | ||
|
||
@workflow_run = workflow_run | ||
end | ||
|
||
def status_class | ||
case status | ||
when 'fail' | ||
'badge-danger' | ||
when 'success' | ||
'badge-primary' | ||
else | ||
'badge-warning' | ||
end | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,13 @@ | ||
class Webui::WorkflowRunsController < Webui::WebuiController | ||
def index | ||
@workflow_runs = WorkflowRunPolicy::Scope.new(User.session, WorkflowRun, { token_id: params[:token_id] }).resolve.page(params[:page]) | ||
@token = Token::Workflow.find(params[:token_id]) | ||
end | ||
|
||
def show | ||
@workflow_run = WorkflowRun.find(params[:id]) | ||
authorize @workflow_run, policy_class: WorkflowRunPolicy | ||
|
||
@token = @workflow_run.token | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,4 +18,8 @@ def resolve | |
|
||
attr_reader :user, :scope, :opts | ||
end | ||
|
||
def show? | ||
record.token.user == user | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
- @pagetitle = "Workflow Run #{@workflow_run.id}" | ||
.card | ||
.card-body | ||
= render(WorkflowRunHeaderComponent.new(workflow_run: @workflow_run)) | ||
= render(WorkflowRunDetailComponent.new(workflow_run: @workflow_run)) |
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
Oops, something went wrong.