-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update header for pre-prod release steps (#715)
Show a small timeline, the workflow and a drawer for build insights
- Loading branch information
Showing
19 changed files
with
264 additions
and
294 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
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
44 changes: 44 additions & 0 deletions
44
app/components/v2/live_release/pre_prod_release/header_component.html.erb
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,44 @@ | ||
<div class="<%= grids %> item-gap-default"> | ||
<div> | ||
<% if events.present? %> | ||
<%= render TimelineComponent.new(events:, truncate: true, view_all_link: timeline_release_path(pre_prod_release.release)) %> | ||
<% end %> | ||
</div> | ||
|
||
<div class="flex flex-col justify-start gap-1"> | ||
<div class="flex flex-wrap flex-row justify-end gap-2"> | ||
<div class="flex gap-1 items-center text-secondary text-sm"> | ||
<% icon = V2::IconComponent.new("v2/info_full.svg", size: :base) %> | ||
<% icon.with_tooltip("", placement: "bottom", type: :detailed) do |tooltip| %> | ||
<% tooltip.with_detailed_text do %> | ||
The build will be created from this workflow. Once the workflow completes and Tramline is able to find | ||
the build, Tramline will send the build to the configured submission channels automatically or otherwise | ||
(based on your settings). | ||
<% end %> | ||
<% end %> | ||
|
||
<%= render icon %> | ||
|
||
Workflow | ||
</div> | ||
|
||
<div class="last:border-0 border-l border-solid border-main-300"></div> | ||
|
||
<div> | ||
<%= render V2::BadgeComponent.new(text: workflow_config.name, kind: :badge) do |badge| %> | ||
<% badge.with_icon(ci_cd_provider_logo) %> | ||
<% end %> | ||
</div> | ||
</div> | ||
|
||
<div class="flex justify-end"> | ||
<%= render V2::ModalComponent.new(title: "Build Insights", size: :lg, type: :drawer, authz: false) do |modal| %> | ||
<% button = modal.with_button(label: "Build Insights", scheme: :supporting, size: :xxs, type: :action) %> | ||
<% button.with_icon("lightbulb.svg", size: :md) %> | ||
<% modal.with_body do %> | ||
<%= render partial: "pre_prod_releases/build_insights", locals: { builds: } %> | ||
<% end %> | ||
<% end %> | ||
</div> | ||
</div> | ||
</div> |
29 changes: 29 additions & 0 deletions
29
app/components/v2/live_release/pre_prod_release/header_component.rb
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,29 @@ | ||
# frozen_string_literal: true | ||
|
||
class V2::LiveRelease::PreProdRelease::HeaderComponent < V2::BaseComponent | ||
include Memery | ||
|
||
def initialize(release_platform_run, pre_prod_release) | ||
@release_platform_run = release_platform_run | ||
@pre_prod_release = pre_prod_release | ||
end | ||
|
||
attr_reader :release_platform_run, :pre_prod_release | ||
delegate :latest_events, to: :pre_prod_release, allow_nil: true | ||
|
||
memoize def events | ||
return [] unless latest_events | ||
latest_events.flat_map do |event| | ||
{ | ||
type: event.kind.to_sym, | ||
description: event.message, | ||
timestamp: time_format(event.event_timestamp, with_year: false) | ||
} | ||
end | ||
end | ||
|
||
def grids | ||
return "grid grid-cols-2" if events.present? | ||
"grid grid-cols-1" | ||
end | ||
end |
11 changes: 11 additions & 0 deletions
11
app/components/v2/live_release/pre_prod_release/internal_header_component.rb
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,11 @@ | ||
# frozen_string_literal: true | ||
|
||
class V2::LiveRelease::PreProdRelease::InternalHeaderComponent < V2::LiveRelease::PreProdRelease::HeaderComponent | ||
def workflow_config | ||
release_platform_run.conf.pick_internal_workflow | ||
end | ||
|
||
def builds | ||
release_platform_run.internal_builds.includes(:external_build) | ||
end | ||
end |
11 changes: 11 additions & 0 deletions
11
app/components/v2/live_release/pre_prod_release/rc_header_component.rb
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,11 @@ | ||
# frozen_string_literal: true | ||
|
||
class V2::LiveRelease::PreProdRelease::RcHeaderComponent < V2::LiveRelease::PreProdRelease::HeaderComponent | ||
def workflow_config | ||
release_platform_run.conf.release_candidate_workflow | ||
end | ||
|
||
def builds | ||
release_platform_run.rc_builds.includes(:external_build) | ||
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
36 changes: 0 additions & 36 deletions
36
app/components/v2/live_release/submission_config_component.html.erb
This file was deleted.
Oops, something went wrong.
11 changes: 0 additions & 11 deletions
11
app/components/v2/live_release/submission_config_component.rb
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.