Skip to content

Commit

Permalink
registry updates
Browse files Browse the repository at this point in the history
* update step indicators
  • Loading branch information
ryanwoldatwork committed Apr 18, 2023
1 parent 1fb98c0 commit cf86cef
Show file tree
Hide file tree
Showing 23 changed files with 230 additions and 102 deletions.
16 changes: 8 additions & 8 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -91,12 +91,12 @@ GEM
acts-as-list (0.1.2)
acts-as-taggable-on (9.0.1)
activerecord (>= 6.0, < 7.1)
addressable (2.8.3)
addressable (2.8.4)
public_suffix (>= 2.0.2, < 6.0)
aes_key_wrap (1.1.0)
ast (2.4.2)
aws-eventstream (1.2.0)
aws-partitions (1.742.0)
aws-partitions (1.749.0)
aws-record (2.10.1)
aws-sdk-dynamodb (~> 1.18)
aws-sdk-core (3.171.0)
Expand Down Expand Up @@ -293,12 +293,12 @@ GEM
timeout
net-smtp (0.3.3)
net-protocol
newrelic_rpm (9.1.0)
newrelic_rpm (9.2.0)
nio4r (2.5.9)
nokogiri (1.14.2)
nokogiri (1.14.3)
mini_portile2 (~> 2.8.0)
racc (~> 1.4)
nokogiri (1.14.2-x86_64-darwin)
nokogiri (1.14.3-x86_64-darwin)
racc (~> 1.4)
oauth2 (2.0.9)
faraday (>= 0.17.3, < 3.0)
Expand All @@ -321,7 +321,7 @@ GEM
paper_trail (12.3.0)
activerecord (>= 5.2)
request_store (~> 1.1)
parallel (1.22.1)
parallel (1.23.0)
parser (3.2.2.0)
ast (~> 2.4.1)
pg (1.4.6)
Expand Down Expand Up @@ -382,7 +382,7 @@ GEM
redis (4.8.0)
redis-namespace (1.10.0)
redis (>= 4)
regexp_parser (2.7.0)
regexp_parser (2.8.0)
request_store (1.5.1)
rack (>= 1.4)
responders (3.1.0)
Expand All @@ -409,7 +409,7 @@ GEM
rspec-support (3.12.0)
rspec_junit_formatter (0.6.0)
rspec-core (>= 2, < 4, != 2.12.0)
rubocop (1.49.0)
rubocop (1.50.2)
json (~> 2.3)
parallel (~> 1.10)
parser (>= 3.2.0.0)
Expand Down
6 changes: 5 additions & 1 deletion app/controllers/admin/digital_products_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,11 @@ def review
.page(params[:page])
end

def show; end
def show
@events = Event.where(object_type: "Digital Product", object_id: @digital_product.id.to_s)
.includes(:user)
.order("created_at DESC")
end

def new
@digital_product = DigitalProduct.new
Expand Down
7 changes: 6 additions & 1 deletion app/controllers/admin/digital_service_accounts_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,12 @@ def review
.page(params[:page])
end

def show; end
def show
@events = Event
.where(object_type: "Digital Service Account", object_id: @digital_service_account.id.to_s)
.includes(:user)
.order("created_at DESC")
end

def new
@digital_service_account = DigitalServiceAccount.new
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,9 @@ def set_omb_cx_reporting_collection

def set_collections
if performance_manager_permissions?
@collections = Collection.all
@collections = Collection.all.order('organizations.name').includes(:organization)
else
@collections = current_user.collections
@collections = current_user.collections.order('organizations.name').includes(:organization)
end
end

Expand Down
2 changes: 1 addition & 1 deletion app/models/omb_cx_reporting_collection.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def omb_control_number
end

def federal_register_url
super || 'Federal Register URL'
super || 'https:///www.reginfo.gov/...'
end

def q1_point_scale
Expand Down
2 changes: 1 addition & 1 deletion app/views/admin/collections/_form.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@

<div class="field">
<%= f.label :service_provider_id, "HISP Service Provider", class: "usa-label" %>
<%= f.select :service_provider_id, ServiceProvider.all.map { |h| ["#{h.organization.name} - #{h.name}", h.id] }, { include_blank: true }, class: "usa-select" %>
<%= f.select :service_provider_id, ServiceProvider.all.map { |h| ["#{h.organization.abbreviation} - #{h.organization.name} - #{h.name}", h.id] }, { include_blank: true }, class: "usa-select" %>
</div>

<div class="field">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
</div>
<div class="field">
<%= form.label :federal_register_url, class: "usa-label" %>
<%= form.text_field :federal_register_url, class: "usa-input", placeholder: "https://federalregister.gov/..." %>
<%= form.url_field :federal_register_url, class: "usa-input", placeholder: "https://federalregister.gov/..." %>
</div>
</div>

Expand Down
4 changes: 2 additions & 2 deletions app/views/admin/digital_product_versions/_form.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

<div class="field">
<%= form.label :store_url, "Store URL", class: "usa-label" %>
<%= form.text_field :store_url, class: "usa-input" %>
<%= form.url_field :store_url, class: "usa-input" %>
</div>

<div class="field">
Expand Down Expand Up @@ -57,7 +57,7 @@

<div class="field">
<%= form.label :screenshot_url, class: "usa-label" %>
<%= form.text_field :screenshot_url, class: "usa-input" %>
<%= form.url_field :screenshot_url, class: "usa-input" %>
</div>

<div class="field" hidden>
Expand Down
4 changes: 2 additions & 2 deletions app/views/admin/digital_products/_form.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,12 @@
<div class="usa-hint font-sans-2xs">
Please provide the URL of the app or website’s icon
</div>
<%= form.text_field :screenshot_url, class: "usa-input" %>
<%= form.url_field :screenshot_url, class: "usa-input" %>
</div>

<div class="field" hidden>
<%= form.label :code_repository_url, class: "usa-label" %>
<%= form.text_field :code_repository_url, class: "usa-input" %>
<%= form.url_field :code_repository_url, class: "usa-input" %>
</div>

<div class="field">
Expand Down
91 changes: 71 additions & 20 deletions app/views/admin/digital_products/_step_indicator.html.erb
Original file line number Diff line number Diff line change
@@ -1,21 +1,72 @@
<div class="usa-step-indicator" aria-label="progress">
<ol class="usa-step-indicator__segments">
<li class="usa-step-indicator__segment usa-step-indicator__segment--complete <%= "usa-step-indicator__segment--current" if collection.draft? %>"">
<span class="usa-step-indicator__segment-label">
Drafted
<% if collection.draft? %>
<span class="usa-sr-only">completed</span>
<% end %>
</span>
</li>
<li class="usa-step-indicator__segment <%= "usa-step-indicator__segment--complete" if collection.published? %> <%= "usa-step-indicator__segment--current" if collection.submitted? %>">
<span class="usa-step-indicator__segment-label">
Submitted
<span class="usa-sr-only">completed</span>
</span>
</li>
<li class="usa-step-indicator__segment <%= "usa-step-indicator__segment--complete" if collection.published? %> <%= "usa-step-indicator__segment--current" if collection.published? %>" aria-current="true">
<span class="usa-step-indicator__segment-label">Published</span>
</li>
</ol>
<div class="border border-base-lighter padding-2 padding-bottom-0 margin-bottom-2">

<div class="font-sans-sm margin-bottom-1">
Publication status:
<%= product.aasm_state %>
<a
href="#website-status-modal"
aria-controls="website-status-modal"
data-open-modal><i class="fa fa-info-circle"></i></a>
</div>
<div
class="usa-modal usa-modal--lg"
id="website-status-modal"
aria-labelledby="modal-2-heading"
aria-describedby="modal-2-description">
<div class="usa-modal__content">
<div class="usa-modal__main">
<h2 class="usa-modal__heading" id="modal-2-heading">
The publishing status of a digital product
</h2>
<div class="usa-prose">
<p>
Each digital product is a digital asset and has a publishing flow.
The "aasm_state" states a digital product may have are below.
</p>
<br>
<ul class="usa-list usa-list--unstyled">
<% { "created" => "Created", "updated" => "Updated", "submitted" => "Submitted", "published" => "Published", "archived" => "Archived" }.each_pair do |key, value| %>
<li>
<span class="usa-tag bg-primary-light <%= "bg-primary" if product.aasm_state == key %>"><%= value %></span>
</li>
<% end %>
</ul>
</div>
</div>
<button
class="usa-button usa-modal__close"
aria-label="Close this window"
data-close-modal>
<svg class="usa-icon" aria-hidden="true" focusable="false" role="img">
<use xlink:href="<%= asset_path "sprite.svg#close" %>"></use>
</svg>
</button>
</div>
</div>

<div class="usa-step-indicator" aria-label="progress">
<ol class="usa-step-indicator__segments">
<li class="usa-step-indicator__segment
<%= "usa-step-indicator__segment--complete" if product.submitted? || product.published? || product.archived? || product.updated? %>
<%= "usa-step-indicator__segment--current" if product.created? %>"
aria-current="true">
<span class="usa-step-indicator__segment-label">Created</span>
</li>
<li class="usa-step-indicator__segment
<%= "usa-step-indicator__segment--complete" if product.published? || product.archived? %>
<%= "usa-step-indicator__segment--current" if product.submitted? %>" aria-current="true">
<span class="usa-step-indicator__segment-label">Submitted</span>
</li>
<li class="usa-step-indicator__segment
<%= "usa-step-indicator__segment--complete" if product.published? || product.archived? %>
<%= "usa-step-indicator__segment--current" if product.published? %>" aria-current="true">
<span class="usa-step-indicator__segment-label">Published</span>
</li>
<li class="usa-step-indicator__segment
<%= "usa-step-indicator__segment--complete" if product.archived? %>
<%= "usa-step-indicator__segment--current" if product.archived? %>" aria-current="true">
<span class="usa-step-indicator__segment-label">Archived</span>
</li>
</ol>
</div>
</div>
17 changes: 6 additions & 11 deletions app/views/admin/digital_products/show.html.erb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<div class="grid-row grid-gap-lg">
<div class="grid-col-12">
<% content_for :navigation_title do %>
Viewing Mobile App: <%= @digital_product.name %>
Mobile App: <%= @digital_product.name %>

<% if digital_product_permissions?(digital_product: @digital_product, user: current_user) %>
<%= link_to edit_admin_digital_product_path(@digital_product), class: "usa-button usa-button-inverted float-right" do %>
Expand Down Expand Up @@ -29,22 +29,18 @@
<br>
<% end %>
</div>
</div>

<%= render 'admin/digital_products/step_indicator', product: @digital_product %>

<div class="grid-row grid-gap-lg">
<div class="desktop:grid-col-8">
<p>
<%= label_tag "Name", nil, class: "usa-label" %>
<br>
<%= @digital_product.name %>
</p>

<p>
<%= label_tag "Status", nil, class: "usa-label" %>
<br>
<span class="usa-tag">
<%= @digital_product.aasm_state %>
</span>
</p>

<p>
<%= label_tag "Short description", nil, class: "usa-label" %>
<br>
Expand Down Expand Up @@ -238,8 +234,7 @@
</div>

<% if digital_product_permissions?(digital_product: @digital_product, user: current_user) %>
<%= render 'components/event_log', events: Event.where(object_type: "Digital Product", object_id: @digital_product.id.to_s ).order("created_at DESC") %>
<%= render 'components/event_log', events: @events %>
<% end %>

</div>
</div>
2 changes: 1 addition & 1 deletion app/views/admin/digital_service_accounts/_form.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

<div class="field">
<%= form.label :service_url, "Account URL", class: "usa-label" %>
<%= form.text_field :service_url, class: "usa-input", required: true %>
<%= form.url_field :service_url, class: "usa-input", required: true %>
</div>

<div class="field">
Expand Down
72 changes: 72 additions & 0 deletions app/views/admin/digital_service_accounts/_step_indicator.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
<div class="border border-base-lighter padding-2 padding-bottom-0 margin-bottom-2">

<div class="font-sans-sm margin-bottom-1">
Publication status:
<%= account.aasm_state %>
<a
href="#website-status-modal"
aria-controls="website-status-modal"
data-open-modal><i class="fa fa-info-circle"></i></a>
</div>
<div
class="usa-modal usa-modal--lg"
id="website-status-modal"
aria-labelledby="modal-2-heading"
aria-describedby="modal-2-description">
<div class="usa-modal__content">
<div class="usa-modal__main">
<h2 class="usa-modal__heading" id="modal-2-heading">
The publishing status of a digital service account
</h2>
<div class="usa-prose">
<p>
Each digital service account is a digital asset and has a publishing flow.
The "aasm_state" states a digital service account may have are below.
</p>
<br>
<ul class="usa-list usa-list--unstyled">
<% { "created" => "Created", "updated" => "Updated", "submitted" => "Submitted", "published" => "Published", "archived" => "Archived" }.each_pair do |key, value| %>
<li>
<span class="usa-tag bg-primary-light <%= "bg-primary" if account.aasm_state == key %>"><%= value %></span>
</li>
<% end %>
</ul>
</div>
</div>
<button
class="usa-button usa-modal__close"
aria-label="Close this window"
data-close-modal>
<svg class="usa-icon" aria-hidden="true" focusable="false" role="img">
<use xlink:href="<%= asset_path "sprite.svg#close" %>"></use>
</svg>
</button>
</div>
</div>

<div class="usa-step-indicator" aria-label="progress">
<ol class="usa-step-indicator__segments">
<li class="usa-step-indicator__segment
<%= "usa-step-indicator__segment--complete" if account.submitted? || account.published? || account.archived? || account.updated? %>
<%= "usa-step-indicator__segment--current" if account.created? %>"
aria-current="true">
<span class="usa-step-indicator__segment-label">Created</span>
</li>
<li class="usa-step-indicator__segment
<%= "usa-step-indicator__segment--complete" if account.published? || account.archived? %>
<%= "usa-step-indicator__segment--current" if account.submitted? %>" aria-current="true">
<span class="usa-step-indicator__segment-label">Submitted</span>
</li>
<li class="usa-step-indicator__segment
<%= "usa-step-indicator__segment--complete" if account.published? || account.archived? %>
<%= "usa-step-indicator__segment--current" if account.published? %>" aria-current="true">
<span class="usa-step-indicator__segment-label">Published</span>
</li>
<li class="usa-step-indicator__segment
<%= "usa-step-indicator__segment--complete" if account.archived? %>
<%= "usa-step-indicator__segment--current" if account.archived? %>" aria-current="true">
<span class="usa-step-indicator__segment-label">Archived</span>
</li>
</ol>
</div>
</div>
Loading

0 comments on commit cf86cef

Please sign in to comment.