Skip to content

Commit

Permalink
Merge branch 'qa'
Browse files Browse the repository at this point in the history
  • Loading branch information
smeeks committed Nov 13, 2021
2 parents 2db35a6 + 5a2db29 commit 62163b6
Show file tree
Hide file tree
Showing 4 changed files with 86 additions and 41 deletions.
14 changes: 10 additions & 4 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,16 @@ source "https://rubygems.org"

gem 'active_record-acts_as', git: 'https://github.com/camsys/active_record-acts_as', branch: 'master' # use our fork

gem 'transam_core', git: 'https://github.com/camsys/transam_core', branch: :master
gem 'transam_reporting', git: 'https://github.com/camsys/transam_reporting', branch: :master
gem 'transam_transit', git: 'https://github.com/camsys/transam_transit', branch: :master
gem 'transam_accounting', git: 'https://github.com/camsys/transam_accounting', branch: :master
current_branch = `git rev-parse --abbrev-ref HEAD`.strip
current_branch = ENV['TRAVIS_BRANCH'] if current_branch == 'HEAD'
use_branch = ['master', 'qa', 'develop'].include?(current_branch) ? current_branch : 'develop'
puts "TransAM engines using branch: #{use_branch}"

gem 'transam_core', git: 'https://github.com/camsys/transam_core', branch: use_branch
gem 'transam_reporting', git: 'https://github.com/camsys/transam_reporting', branch: use_branch
gem 'transam_transit', git: 'https://github.com/camsys/transam_transit', branch: use_branch
gem 'transam_accounting', git: 'https://github.com/camsys/transam_accounting', branch: use_branch

gem "capybara", '2.6.2' # lock gem for old capybara behavior on hidden element xpath
gem 'rails-controller-testing'

Expand Down
87 changes: 59 additions & 28 deletions app/views/capital_plans/index.html.haml
Original file line number Diff line number Diff line change
@@ -1,35 +1,66 @@
%h2= "Assets Status"

.row
.col-md-1
.col-md-10
%table.table-striped.statusTable
%thead
%tr
%th
Org
%th
Assets Updated
%tbody.searchable
-current_user.viewable_organizations.each do |o|
- if Rails.application.config.try(:use_new_scenarios_tool)
%h2= "Assets Status"

.row
.col-md-1
.col-md-10
%table.table-striped.statusTable
%thead
%tr
%td
=o.short_name
%td
="#{OrgAuditAnalyzer.new(o).audit_complete_pcnt}%"
%th
Org
%th
Assets Updated
%tbody.searchable
-current_user.viewable_organizations.each do |o|
%tr
%td
=o.short_name
%td
="#{OrgAuditAnalyzer.new(o).audit_complete_pcnt}%"



:css
table.dataTable thead .sorting,
table.dataTable thead .sorting_asc,
table.dataTable thead .sorting_desc {
background : none;
}

:javascript
$(document).ready(function () {
$('.statusTable').DataTable();
});

- else
#spinner{style: 'display:none;'}= loader_panel_tag({:message => "Updating capital plan(s)...", :size => 3, :spinner => "cog"})

.row
.col-sm-12
.page-header
%h2= "#{format_as_fiscal_year(current_planning_year_year)} Capital Plan Status"

:css
table.dataTable thead .sorting,
table.dataTable thead .sorting_asc,
table.dataTable thead .sorting_desc {
background : none;
}
.row
.col-md-12
- CapitalPlanType.all.each do |plan_type|
- table_dom_id = SecureRandom.hex
= render partial: 'capital_plans_table', locals: {capital_plan_type: plan_type, table_dom_id: table_dom_id}

:javascript
$(document).ready(function () {
- if can? :update, CapitalPlan
= render partial: 'scripts', locals: {table_dom_id: table_dom_id}

$('.statusTable').DataTable();
:javascript
function get_checkbox_vals(action) {
checked_targets = [];
unchecked_targets = [];
$('input.capital-plan-action-checkbox[data-index="'+action.data('index')+'"]').each(function() {
if ($(this).is(':checked')) {
checked_targets.push($( this ).val());
} else{
unchecked_targets.push($( this ).val());
}
});

});
return [$('tr[data-index="'+action.data('index')+'"]').data('object-key'), checked_targets.join(',')];
}
24 changes: 16 additions & 8 deletions app/views/shared/_cpt_policy_sub_nav.html.haml
Original file line number Diff line number Diff line change
@@ -1,11 +1,19 @@
%li.text-left
= link_to scenarios_path do
%i.fa.fa-cubes.fa-fw
= "Scenarios"
//%li.text-left
// = link_to planning_index_path do
// %i.fa.fa-tasks.fa-fw
// = " Project Planner"
- if Rails.application.config.try(:use_new_scenarios_tool)
%li.text-left
= link_to scenarios_path do
%i.fa.fa-cubes.fa-fw
= "Scenarios"

- else
%li.text-left
= link_to capital_projects_path do
%i.fa.fa-cubes.fa-fw
= "Projects"

%li.text-left
= link_to planning_index_path do
%i.fa.fa-tasks.fa-fw
= " Project Planner"

- if can? :create, CapitalProject
%li.text-left
Expand Down
2 changes: 1 addition & 1 deletion lib/transam_cpt/version.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module TransamCpt
VERSION = "2.16.1"
VERSION = "2.17.0"
end

0 comments on commit 62163b6

Please sign in to comment.