Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[#4807] Help partner to remember to submit profile for approval: #4808

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions app/views/partners/profiles/_actions.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<%# locals: (partner:) %>

<section class="content">
<div class="container-fluid">
<div class="row">
<div class="col-md-12">
<div class="card card-primary">
<div class="card-footer">
<% if partner.approved? %>
<%= link_to '', class: 'btn btn-info disabled' do %>
<i class="fa fa-check"></i> Approved
<% end %>
<% elsif partner.awaiting_review? %>
<%= link_to '', class: "btn btn-warning disabled" do %>
<i class="fa fa-clock"></i> Pending Approval
<% end %>
<% else %>
<%= link_to partners_approval_request_path, method: :post, class: "btn btn-success" do %>
<i class="fa fa-paper-plane"></i> Submit for Approval
<% end %>
<% end %>

<%= link_to edit_partners_profile_path, class: 'btn btn-primary' do %>
<i class="fa fa-pencil"></i> Update Information
<% end %>
</div>
</div>
</div>
</div>
</div>
</section>
37 changes: 3 additions & 34 deletions app/views/partners/profiles/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
</div><!-- /.container-fluid -->
</section>

<%= render 'actions', partner: current_partner %>

<div class="row">
<div class="col-md-12">
<div class="container-fluid">
Expand All @@ -42,37 +44,4 @@
</div>
</div>

<section class="content">
<div class="container-fluid">
<div class="row">
<!-- left column -->
<div class="col-md-12">
<!-- jquery validation -->
<div class="card card-primary">
<div class="card-footer">
<% if current_partner.approved? %>
<%= link_to '', class: 'btn btn-info disabled' do %>
<i class="fa fa-check"></i> Approved
<% end %>
<% elsif current_partner.awaiting_review? %>
<%= link_to '', class: "btn btn-warning disabled" do %>
<i class="fa fa-clock"></i> Pending Approval
<% end %>
<% else %>
<%= link_to partners_approval_request_path, method: :post, class: "btn btn-success" do %>
<i class="fa fa-paper-plane"></i> Submit for Approval
<% end %>
<% end %>

<%= link_to edit_partners_profile_path, class: 'btn btn-primary' do %>
<i class="fa fa-pencil"></i> Update Information
<% end %>
</div>
</div>
<!-- /.card -->
</div>
<!--/.col (left) -->
</div>
<!-- /.row -->
</div><!-- /.container-fluid -->
</section>
<%= render 'actions', partner: current_partner %>
6 changes: 3 additions & 3 deletions spec/system/partners/approval_process_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
before do
click_on 'My Profile'
assert page.has_content? 'Uninvited'
click_on 'Update Information'
all('a', text: 'Update Information').last.click

fill_in 'Other Agency Type', with: 'Lorem'

Expand All @@ -41,7 +41,7 @@
click_on 'Update Information'
assert page.has_content? 'Details were successfully updated.'

find_link(text: 'Submit for Approval').click
all('a', text: 'Submit for Approval').last.click
assert page.has_content? 'You have submitted your details for approval.'
assert page.has_content? 'Awaiting Review'
end
Expand Down Expand Up @@ -77,7 +77,7 @@
login_as(partner_user)
visit partner_user_root_path
click_on 'My Profile'
click_on 'Submit for Approval'
all('a', text: 'Submit for Approval').last.click
end

it "should render an error message", :aggregate_failures do
Expand Down