Skip to content

Commit

Permalink
Fix Performance table formatting, change url from performances to s…
Browse files Browse the repository at this point in the history
…ingular `performance`
  • Loading branch information
bensheldon committed Jul 6, 2024
1 parent 493f790 commit ad05f85
Show file tree
Hide file tree
Showing 17 changed files with 24 additions and 24 deletions.
2 changes: 1 addition & 1 deletion app/controllers/good_job/performances_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

module GoodJob
class PerformancesController < ApplicationController
def index
def show
if GoodJob::DiscreteExecution.monotonic_duration_migrated?
@performances = GoodJob::DiscreteExecution
.where.not(job_class: nil)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,32 +13,32 @@
<header class="list-group-item bg-body-tertiary">
<div class="row small text-muted text-uppercase align-items-center">
<div class="col-12 col-lg-4"><%= t ".job_class" %></div>
<div class="col-lg-1 d-none d-lg-block"><%= t ".executions" %></div>
<div class="col-lg-2 d-none d-lg-block"><%= t ".executions" %></div>

<div class="col-lg-1 d-none d-lg-block"><%= t ".average_duration" %></div>
<div class="col-lg-1 d-none d-lg-block"><%= t ".minimum_duration" %></div>
<div class="col-lg-1 d-none d-lg-block"><%= t ".maximum_duration" %></div>
<div class="col-lg-2 d-none d-lg-block"><%= t ".average_duration" %></div>
<div class="col-lg-2 d-none d-lg-block"><%= t ".minimum_duration" %></div>
<div class="col-lg-2 d-none d-lg-block"><%= t ".maximum_duration" %></div>
</div>
</header>

<% @performances.each do |performance| %>
<div role="row" class="list-group-item py-3">
<div class="row align-items-center">
<div class="col-12 col-lg-4"><%= performance.job_class %></div>
<div class="col-6 col-lg-1 text-wrap">
<div class="col-6 col-lg-2 text-wrap">
<div class="d-lg-none small text-muted mt-1"><%= t ".executions" %></div>
<%= performance.executions_count %>
</div>

<div class="col-6 col-lg-1 text-wrap">
<div class="col-6 col-lg-2 text-wrap">
<div class="d-lg-none small text-muted mt-1"><%= t ".average_duration" %></div>
<%= format_duration performance.avg_duration %>
</div>
<div class="col-6 col-lg-1 text-wrap">
<div class="col-6 col-lg-2 text-wrap">
<div class="d-lg-none small text-muted mt-1"><%= t ".minimum_duration" %></div>
<%= format_duration performance.min_duration %>
</div>
<div class="col-6 col-lg-1 text-wrap">
<div class="col-6 col-lg-2 text-wrap">
<div class="d-lg-none small text-muted mt-1"><%= t ".maximum_duration" %></div>
<%= format_duration performance.max_duration %>
</div>
Expand Down
2 changes: 1 addition & 1 deletion app/views/good_job/shared/_navbar.erb
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
<% end %>
</li>
<li class="nav-item">
<%= link_to performances_path, class: ["nav-link", ("active" if controller_name == 'performances')] do %>
<%= link_to performance_path, class: ["nav-link", ("active" if controller_name == 'performances')] do %>
<%= t(".performances") %>
<% end %>
</li>
Expand Down
2 changes: 1 addition & 1 deletion config/locales/de.yml
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ de:
trillion: T
unit: ''
performances:
index:
show:
average_duration: Durchschnittliche Dauer
executions: Hinrichtungen
job_class: Berufsklasse
Expand Down
2 changes: 1 addition & 1 deletion config/locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ en:
trillion: T
unit: ''
performances:
index:
show:
average_duration: Average duration
executions: Executions
job_class: Job class
Expand Down
2 changes: 1 addition & 1 deletion config/locales/es.yml
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ es:
trillion: T
unit: ''
performances:
index:
show:
average_duration: Duración promedio
executions: Ejecuciones
job_class: clase de trabajo
Expand Down
2 changes: 1 addition & 1 deletion config/locales/fr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ fr:
trillion: J
unit: ''
performances:
index:
show:
average_duration: Durée moyenne
executions: Exécutions
job_class: Catégorie d'emplois
Expand Down
2 changes: 1 addition & 1 deletion config/locales/it.yml
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ it:
trillion: T
unit: ''
performances:
index:
show:
average_duration: Durata media
executions: Esecuzioni
job_class: Classe di lavoro
Expand Down
2 changes: 1 addition & 1 deletion config/locales/ja.yml
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ ja:
trillion: T
unit: ''
performances:
index:
show:
average_duration: 平均所要時間
executions: 処刑
job_class: 職種
Expand Down
2 changes: 1 addition & 1 deletion config/locales/ko.yml
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ ko:
trillion: T
unit: ''
performances:
index:
show:
average_duration: 평균 지속 시간
executions: 처형
job_class: 직업군
Expand Down
2 changes: 1 addition & 1 deletion config/locales/nl.yml
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ nl:
trillion: T
unit: ''
performances:
index:
show:
average_duration: Gemiddelde duur
executions: Executies
job_class: Functie klasse
Expand Down
2 changes: 1 addition & 1 deletion config/locales/pt-BR.yml
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ pt-BR:
trillion: T
unit: ''
performances:
index:
show:
average_duration: Duração média
executions: Execuções
job_class: Classe de trabalho
Expand Down
2 changes: 1 addition & 1 deletion config/locales/ru.yml
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ ru:
trillion: Т
unit: ''
performances:
index:
show:
average_duration: Средняя продолжительность
executions: Казни
job_class: Класс работы
Expand Down
2 changes: 1 addition & 1 deletion config/locales/tr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ tr:
trillion: Trilyon
unit: ''
performances:
index:
show:
average_duration: Ortalama süre
executions: İnfazlar
job_class: İş sınıfı
Expand Down
2 changes: 1 addition & 1 deletion config/locales/uk.yml
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ uk:
trillion: Трлн
unit: ''
performances:
index:
show:
average_duration: Середня тривалість
executions: Страти
job_class: Клас роботи
Expand Down
2 changes: 1 addition & 1 deletion config/routes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@

resources :processes, only: %i[index]

resources :performances, only: %i[index]
resource :performance, only: %i[show]

scope :frontend, controller: :frontends do
get "modules/:name", action: :module, as: :frontend_module, constraints: { format: 'js' }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

describe '#index' do
it 'renders the index page' do
get :index
get :show
expect(response).to have_http_status(:ok)
expect(response.body).to include('Performance')
end
Expand Down

0 comments on commit ad05f85

Please sign in to comment.