diff --git a/app/assets/javascripts/performance-charts.js b/app/assets/javascripts/performance-charts.js deleted file mode 100644 index d38b3ce4f..000000000 --- a/app/assets/javascripts/performance-charts.js +++ /dev/null @@ -1,142 +0,0 @@ -'use strict'; - -var chartConfigs = {}; -var cxCharts = {}; - -window.chartjsColors = { - blue: '#73b3e7', - vividRed: '#e41d3d', - darkBlue: '#1a4480', - orange: '#ffbc78', - blue2: '#73b3e7', - vividRed2: '#e41d3d', - darkBlue2: '#1a4480', - orange2: '#ffbc78', - blue3: '#73b3e7', - vividRed3: '#e41d3d', - darkBlue3: '#1a4480', - orange3: '#ffbc78' -}; - -(function(global) { - var MONTHS = [ - 'January', - 'February', - 'March', - 'April', - 'May', - 'June', - 'July', - 'August', - 'September', - 'October', - 'November', - 'December' - ]; - - var COLORS = [ - '#4dc9f6', - '#f67019', - '#f53794', - '#537bc4', - '#acc236', - '#166a8f', - '#00a950', - '#58595b', - '#8549ba' - ]; - - var Samples = global.Samples || (global.Samples = {}); - var Color = global.Color; - - Samples.utils = { - // Adapted from http://indiegamr.com/generate-repeatable-random-numbers-in-js/ - srand: function(seed) { - this._seed = seed; - }, - - rand: function(min, max) { - var seed = this._seed; - min = min === undefined ? 0 : min; - max = max === undefined ? 1 : max; - this._seed = (seed * 9301 + 49297) % 233280; - return min + (this._seed / 233280) * (max - min); - }, - - numbers: function(config) { - var cfg = config || {}; - var min = cfg.min || 0; - var max = cfg.max || 1; - var from = cfg.from || []; - var count = cfg.count || 8; - var decimals = cfg.decimals || 8; - var continuity = cfg.continuity || 1; - var dfactor = Math.pow(10, decimals) || 0; - var data = []; - var i, value; - - for (i = 0; i < count; ++i) { - value = (from[i] || 0) + this.rand(min, max); - if (this.rand() <= continuity) { - data.push(Math.round(dfactor * value) / dfactor); - } else { - data.push(null); - } - } - - return data; - }, - - labels: function(config) { - var cfg = config || {}; - var min = cfg.min || 0; - var max = cfg.max || 100; - var count = cfg.count || 8; - var step = (max - min) / count; - var decimals = cfg.decimals || 8; - var dfactor = Math.pow(10, decimals) || 0; - var prefix = cfg.prefix || ''; - var values = []; - var i; - - for (i = min; i < max; i += step) { - values.push(prefix + Math.round(dfactor * i) / dfactor); - } - - return values; - }, - - months: function(config) { - var cfg = config || {}; - var count = cfg.count || 12; - var section = cfg.section; - var values = []; - var i, value; - - for (i = 0; i < count; ++i) { - value = MONTHS[Math.ceil(i) % 12]; - values.push(value.substring(0, section)); - } - - return values; - }, - - color: function(index) { - return COLORS[index % COLORS.length]; - }, - - transparentize: function(color, opacity) { - var alpha = opacity === undefined ? 0.5 : 1 - opacity; - return Color(color).alpha(alpha).rgbString(); - } - }; - - // DEPRECATED - window.randomScalingFactor = function() { - return Math.round(Samples.utils.rand(1, 5)); - }; - - // INITIALIZATION - - Samples.utils.srand(Date.now()); -}(this)); diff --git a/app/controllers/admin/collections_controller.rb b/app/controllers/admin/collections_controller.rb deleted file mode 100644 index 579370c60..000000000 --- a/app/controllers/admin/collections_controller.rb +++ /dev/null @@ -1,168 +0,0 @@ -# frozen_string_literal: true - -module Admin - class CollectionsController < AdminController - before_action :set_collection, only: %i[show edit copy - submit publish - update destroy - events] - - def index - @quarter = params[:quarter].present? ? params[:quarter].to_i : nil - @year = params[:year].present? ? params[:year].to_i : nil - - if performance_manager_permissions? - if @quarter && @year - @collections = Collection.where(quarter: @quarter, year: @year) - .order('organizations.name', :year, :quarter, 'service_providers.name') - .includes(:organization, :service_provider) - elsif @quarter - @collections = Collection.where(quarter: @quarter) - .order('organizations.name', :year, :quarter, 'service_providers.name') - .includes(:organization, :service_provider) - else - @collections = Collection - .order('organizations.name', :year, :quarter, 'service_providers.name') - .includes(:organization, :service_provider) - end - elsif @quarter && @year - @collections = current_user.collections.where(quarter: @quarter, year: @year) - .order('organizations.name', :year, :quarter, 'service_providers.name') - .includes(:organization, :service_provider) - elsif @quarter - @collections = current_user.collections.where(quarter: @quarter) - .order('organizations.name', :year, :quarter, 'service_providers.name') - .includes(:organization, :service_provider) - else - @collections = current_user.collections - .order('organizations.name', :year, :quarter, 'service_providers.name') - .includes(:organization, :service_provider) - end - end - - def show - ensure_collection_owner(collection: @collection) - end - - def new - @collection = Collection.new - @collection.user = current_user - @collection.organization_id = params[:organization_id] - @collection.service_provider_id = params[:service_provider_id] - @collection.year = fiscal_year(Date.today) - @collection.quarter = fiscal_quarter(Date.today) - end - - def edit - ensure_collection_owner(collection: @collection) - end - - def submit - @collection.submit! - Event.log_event(Event.names[:collection_submitted], 'Collection', @collection.id, "Collection #{@collection.name} submitted at #{DateTime.now}", current_user.id) - UserMailer.collection_notification(collection_id: @collection.id).deliver_later - redirect_to admin_collection_path(@collection), notice: 'Collection has been submitted successfully.' - end - - def publish - @collection.publish! - Event.log_event(Event.names[:collection_published], 'Collection', @collection.id, "Collection #{@collection.name} published at #{DateTime.now}", current_user.id) - redirect_to admin_collection_path(@collection), notice: 'Collection has been published successfully.' - end - - def copy - ensure_collection_owner(collection: @collection) - - respond_to do |format| - new_collection = @collection.duplicate!(new_user: current_user) - - if new_collection.valid? - Event.log_event(Event.names[:collection_copied], 'Collection', @collection.id, "Collection #{@collection.name} copied at #{DateTime.now}", current_user.id) - - format.html { redirect_to admin_collection_path(new_collection), notice: 'Collection was successfully copied.' } - format.json { render :show, status: :created, location: new_collection } - else - format.html { render :new } - format.json { render json: new_collection.errors, status: :unprocessable_entity } - end - end - end - - def create - @collection = Collection.new(collection_params) - - @collection.user = current_user - if @collection.save - Event.log_event(Event.names[:collection_created], 'Collection', @collection.id, "Collection #{@collection.name} created at #{DateTime.now}", current_user.id) - redirect_to admin_collection_path(@collection), notice: 'Collection was successfully created.' - else - render :new - end - end - - def update - ensure_collection_owner(collection: @collection) - - if @collection.update(collection_params) - Event.log_event(Event.names[:collection_updated], 'Collection', @collection.id, "Collection #{@collection.name} updated at #{DateTime.now}", current_user.id) - redirect_to admin_collection_path(@collection), notice: 'Collection was successfully updated.' - else - render :edit - end - end - - def destroy - ensure_collection_owner(collection: @collection) - @collection.destroy - Event.log_event(Event.names[:collection_deleted], 'Collection', @collection.id, "Collection #{@collection.name} deleted at #{DateTime.now}", current_user.id) - redirect_to admin_collections_url, notice: 'Collection was successfully destroyed.' - end - - def events - @events = Event.where(object_type: 'Collection', object_uuid: @collection.id).order(:created_at) - end - - def export_csv - if performance_manager_permissions? - @collections = Collection.all - else - @collections = current_user.collections - end - send_data @collections.to_csv, filename: "touchpoints-data-collections-#{Date.today}.csv" - end - - def export_omb_cx_reporting_collections_csv - ensure_performance_manager_permissions - - @omb_cx_reporting_collections = OmbCxReportingCollection.to_csv - send_data @omb_cx_reporting_collections, filename: "touchpoints-omb-cx-reporting-data-collections-#{Date.today}.csv" - end - - private - - def set_collection - if performance_manager_permissions? - @collection = Collection.find(params[:id]) - else - @collection = current_user.collections.find(params[:id]) - end - end - - def collection_params - params.require(:collection).permit( - :name, - :start_date, - :end_date, - :organization_id, - :service_provider_id, - :year, - :quarter, - :user_id, - :reflection, - :integrity_hash, - :aasm_state, - :rating, - ) - end - end -end diff --git a/app/controllers/admin/cx_collection_details_controller.rb b/app/controllers/admin/cx_collection_details_controller.rb index 482636c17..4a907e2bc 100644 --- a/app/controllers/admin/cx_collection_details_controller.rb +++ b/app/controllers/admin/cx_collection_details_controller.rb @@ -101,6 +101,9 @@ def upload_csv "negative_other", "question_4" ].sort + rescue CSV::MalformedCSVError => e + flash[:alert] = "There was an error processing the CSV file: #{e.message}" + @valid_file_headers = false rescue @valid_file_headers = false end diff --git a/app/controllers/admin/cx_collections_controller.rb b/app/controllers/admin/cx_collections_controller.rb index 65dd8d73c..15d175ad9 100644 --- a/app/controllers/admin/cx_collections_controller.rb +++ b/app/controllers/admin/cx_collections_controller.rb @@ -17,6 +17,8 @@ def index end def show + ensure_cx_collection_owner(cx_collection: @cx_collection) + @events = Event .where(object_type: "CxCollection", object_uuid: @cx_collection.id) .order("created_at DESC") @@ -27,6 +29,7 @@ def new end def edit + ensure_cx_collection_owner(cx_collection: @cx_collection) end def export_cx_responses_csv @@ -67,6 +70,8 @@ def create end def submit + ensure_cx_collection_owner(cx_collection: @cx_collection) + @cx_collection.submit! Event.log_event(Event.names[:cx_collection_submitted], @cx_collection.class.to_s, @cx_collection.id, "Collection #{@cx_collection.name} submitted at #{DateTime.now}", current_user.id) UserMailer.cx_collection_notification(cx_collection_id: @cx_collection.id).deliver_later @@ -74,12 +79,16 @@ def submit end def publish + ensure_performance_manager_permissions + @cx_collection.publish! Event.log_event(Event.names[:cx_collection_published], @cx_collection.class.to_s, @cx_collection.id, "Collection #{@cx_collection.name} published at #{DateTime.now}", current_user.id) redirect_to admin_cx_collection_path(@cx_collection), notice: 'CX Data Collection has been published successfully.' end def no_report + ensure_performance_manager_permissions + @cx_collection.submitted_at = nil @cx_collection.no_report! Event.log_event(Event.names[:cx_collection_not_reported], @cx_collection.class.to_s, @cx_collection.id, "Collection #{@cx_collection.name} reset at #{DateTime.now}", current_user.id) @@ -87,18 +96,22 @@ def no_report end def reset + ensure_performance_manager_permissions + @cx_collection.reset! Event.log_event(Event.names[:cx_collection_reset], @cx_collection.class.to_s, @cx_collection.id, "Collection #{@cx_collection.name} reset at #{DateTime.now}", current_user.id) redirect_to admin_cx_collection_path(@cx_collection), notice: 'CX Data Collection has been reset successfully.' end def export_csv + ensure_cx_collection_owner(cx_collection: @cx_collection) + if performance_manager_permissions? - @collections = CxCollection.all + @cx_collections = CxCollection.all else - @collections = current_user.cx_collections + @cx_collections = current_user.cx_collections end - send_data @collections.to_csv, filename: "touchpoints-data-cx-collections-#{Date.today}.csv" + send_data @cx_collections.to_csv, filename: "touchpoints-data-cx-collections-#{Date.today}.csv" end def copy @@ -120,6 +133,8 @@ def copy end def update + ensure_cx_collection_owner(cx_collection: @cx_collection) + respond_to do |format| if @cx_collection.update(cx_collection_params) Event.log_event(Event.names[:collection_cx_updated], @cx_collection.class.to_s, @cx_collection.id, "Collection #{@cx_collection.name} updated at #{DateTime.now}", current_user.id) @@ -133,6 +148,8 @@ def update end def destroy + ensure_cx_collection_owner(cx_collection: @cx_collection) + @cx_collection.destroy respond_to do |format| @@ -144,7 +161,11 @@ def destroy private def set_cx_collection - @cx_collection = CxCollection.find(params[:id]) + if performance_manager_permissions? + @cx_collection = CxCollection.find(params[:id]) + else + @cx_collection = current_user.cx_collections.find(params[:id]) + end end def cx_collection_params diff --git a/app/controllers/admin/omb_cx_reporting_collections_controller.rb b/app/controllers/admin/omb_cx_reporting_collections_controller.rb deleted file mode 100644 index bdb5685ea..000000000 --- a/app/controllers/admin/omb_cx_reporting_collections_controller.rb +++ /dev/null @@ -1,142 +0,0 @@ -# frozen_string_literal: true - -module Admin - class OmbCxReportingCollectionsController < AdminController - before_action :set_omb_cx_reporting_collection, only: %i[show edit update destroy] - before_action :set_collections, only: %i[new create edit update] - - def index - ensure_admin - @omb_cx_reporting_collections = OmbCxReportingCollection.all - end - - def show; end - - def new - @omb_cx_reporting_collection = OmbCxReportingCollection.new - - @omb_cx_reporting_collection.collection_id = params[:collection_id] if params[:collection_id] && @collection = Collection.find(params[:collection_id]) - end - - def edit; end - - def create - @omb_cx_reporting_collection = OmbCxReportingCollection.new(omb_cx_reporting_collection_params) - - if @omb_cx_reporting_collection.save - redirect_to admin_omb_cx_reporting_collection_path(@omb_cx_reporting_collection), notice: 'Omb cx reporting collection was successfully created.' - else - render :new - end - end - - def update - if @omb_cx_reporting_collection.update(omb_cx_reporting_collection_params) - redirect_to admin_omb_cx_reporting_collection_path(@omb_cx_reporting_collection), notice: 'Omb cx reporting collection was successfully updated.' - else - render :edit - end - end - - def destroy - @omb_cx_reporting_collection.destroy - redirect_to admin_collection_url(@omb_cx_reporting_collection.collection), notice: 'Omb cx reporting collection was successfully destroyed.' - end - - private - - def set_omb_cx_reporting_collection - @omb_cx_reporting_collection = OmbCxReportingCollection.find(params[:id]) - end - - def set_collections - if performance_manager_permissions? - @collections = Collection.order('organizations.name').includes(:organization) - else - @collections = current_user.collections.order('organizations.name').includes(:organization) - end - end - - def omb_cx_reporting_collection_params - params.require(:omb_cx_reporting_collection).permit( - :collection_id, - :service_id, - :service_provided, - :transaction_point, - :channel, - :volume_of_customers, - :volume_of_customers_provided_survey_opportunity, - :volume_of_respondents, - :omb_control_number, - :federal_register_url, - :operational_metrics, - :q1_text, - :q1_1, - :q1_2, - :q1_3, - :q1_4, - :q1_5, - :q2_text, - :q2_1, - :q2_2, - :q2_3, - :q2_4, - :q2_5, - :q3_text, - :q3_1, - :q3_2, - :q3_3, - :q3_4, - :q3_5, - :q4_text, - :q4_1, - :q4_2, - :q4_3, - :q4_4, - :q4_5, - :q5_text, - :q5_1, - :q5_2, - :q5_3, - :q5_4, - :q5_5, - :q6_text, - :q6_1, - :q6_2, - :q6_3, - :q6_4, - :q6_5, - :q7_text, - :q7_1, - :q7_2, - :q7_3, - :q7_4, - :q7_5, - :q8_text, - :q8_1, - :q8_2, - :q8_3, - :q8_4, - :q8_5, - :q9_text, - :q9_1, - :q9_2, - :q9_3, - :q9_4, - :q9_5, - :q10_text, - :q10_1, - :q10_2, - :q10_3, - :q10_4, - :q10_5, - :q11_text, - :q11_1, - :q11_2, - :q11_3, - :q11_4, - :q11_5, - ) - end - end -end diff --git a/app/controllers/admin/organizations_controller.rb b/app/controllers/admin/organizations_controller.rb index 2d68fbc87..0e36a141b 100644 --- a/app/controllers/admin/organizations_controller.rb +++ b/app/controllers/admin/organizations_controller.rb @@ -26,7 +26,8 @@ def index def show @forms = @organization.forms - @collections = @organization.collections + @cx_collections = @organization.cx_collections + .order(:fiscal_year, :quarter) @users = @organization.users.active.order(:email) end diff --git a/app/controllers/admin/performance_controller.rb b/app/controllers/admin/performance_controller.rb index 98713c112..18c4a27c7 100644 --- a/app/controllers/admin/performance_controller.rb +++ b/app/controllers/admin/performance_controller.rb @@ -20,12 +20,12 @@ def quarterly_performance_notification year = params[:year] quarter = params[:quarter] - Collection.where(aasm_state: 'draft', year:, quarter:).find_each do |collection| - UserMailer.quarterly_performance_notification(collection_id: collection.id).deliver_later + CxCollection.where(aasm_state: 'draft', year:, quarter:).find_each do |cx_collection| + UserMailer.quarterly_performance_notification(cx_collection_id: cx_collection.id).deliver_later end redirect_to admin_performance_path, - notice: 'Quarterly performance email notication sent successfully.' + notice: 'Quarterly performance email notication sent successfully.' end private diff --git a/app/controllers/admin/reporting_controller.rb b/app/controllers/admin/reporting_controller.rb index bf5ee4c60..245040166 100644 --- a/app/controllers/admin/reporting_controller.rb +++ b/app/controllers/admin/reporting_controller.rb @@ -8,312 +8,6 @@ def hisps send_data ServiceProvider.to_csv, filename: "touchpoints-service-providers-#{Date.today}.csv" end - def hisp_services - row = [] - header_fields = %i[ - organization_name - organization_abbreviation - organization_id - service_provider_name - service_provider_slug - year - quarter - service_provided - transaction_point - channel - total_volume - surveys_offered_count - response_count - satisfied - trust - effective - easy - efficient - transparent - employee - ] - - row << header_fields.join(',') - - ServiceProvider.includes(:organization).order('organizations.name', :name).each do |service_provider| - service_provider.services.order(:name).each do |service| - service.omb_cx_reporting_collections.includes(:service, :collection).order('collections.year', 'collections.quarter', 'services.name').each do |omb_cx_reporting_collection| - row_fields = [ - omb_cx_reporting_collection.organization_abbreviation, - "\"#{omb_cx_reporting_collection.organization_name}\"", - omb_cx_reporting_collection.organization_id, - "\"#{omb_cx_reporting_collection.collection.service_provider.name}\"", - omb_cx_reporting_collection.collection.service_provider.slug, - omb_cx_reporting_collection.collection.year, - omb_cx_reporting_collection.collection.quarter, - "\"#{omb_cx_reporting_collection.service_provided}\"", - "\"#{omb_cx_reporting_collection.transaction_point}\"", - "\"#{omb_cx_reporting_collection.channel}\"", - omb_cx_reporting_collection.volume_of_customers, - omb_cx_reporting_collection.volume_of_customers_provided_survey_opportunity, - omb_cx_reporting_collection.volume_of_respondents, - omb_cx_reporting_collection.q1_point_scale, - omb_cx_reporting_collection.q2_point_scale, - omb_cx_reporting_collection.q3_point_scale, - omb_cx_reporting_collection.q4_point_scale, - omb_cx_reporting_collection.q5_point_scale, - omb_cx_reporting_collection.q6_point_scale, - omb_cx_reporting_collection.q7_point_scale, - ] - row << row_fields.join(',') - end - end - end - - render plain: row.join("\n") - end - - def hisp_service_cx_data_collections - rows = [] - header_fields = %i[ - organization_abbreviation - organization_name - organization_id - collection_name - collection_id - year - quarter - service_provider_name - service_provider_slug - service_provider_id - service_name - service_slug - service_id - service_provided - transaction_point - channel - volume_of_customers - volume_of_customers_provided_survey_opportunity - volume_of_customers - volume_of_respondents - omb_control_number - federal_register_url - operational_metrics - start_date - end_date - ] - - rows << header_fields.join(',') - - ServiceProvider.active.includes(:organization).order('organizations.name', :name).each do |service_provider| - service_provider.services.includes(:organization).order('organizations.name', :name).each do |service| - if params[:quarter] - @collections = service.collections.where(quarter: params[:quarter]) - else - @collections = service.collections - end - - @collections.each do |collection| - collection.omb_cx_reporting_collections.includes(:collection).order('collections.year', 'collections.quarter', 'omb_cx_reporting_collections.service_provided', 'omb_cx_reporting_collections.channel').each do |omb_cx_reporting_collection| - row_fields = [ - omb_cx_reporting_collection.organization_abbreviation, - "\"#{omb_cx_reporting_collection.organization_name}\"", - omb_cx_reporting_collection.organization_id, - "\"#{omb_cx_reporting_collection.collection.name}\"", - omb_cx_reporting_collection.collection.id, - omb_cx_reporting_collection.collection.year, - omb_cx_reporting_collection.collection.quarter, - "\"#{omb_cx_reporting_collection.collection.service_provider.name}\"", - omb_cx_reporting_collection.collection.service_provider.slug, - omb_cx_reporting_collection.collection.service_provider.id, - omb_cx_reporting_collection.service.name, - omb_cx_reporting_collection.service.service_slug, - omb_cx_reporting_collection.service.id, - "\"#{omb_cx_reporting_collection.service_provided}\"", - "\"#{omb_cx_reporting_collection.transaction_point}\"", - "\"#{omb_cx_reporting_collection.channel}\"", - omb_cx_reporting_collection.volume_of_customers, - omb_cx_reporting_collection.volume_of_customers_provided_survey_opportunity, - omb_cx_reporting_collection.volume_of_customers, - omb_cx_reporting_collection.volume_of_respondents, - omb_cx_reporting_collection.omb_control_number, - omb_cx_reporting_collection.federal_register_url, - omb_cx_reporting_collection.operational_metrics, - omb_cx_reporting_collection.collection.start_date, - omb_cx_reporting_collection.collection.end_date, - ] - rows << row_fields.join(',') - end - end - end - end - - render plain: rows.join("\n") - end - - def hisp_service_cx_data_collections_summary - rows = [] - header_fields = %i[ - organization_abbreviation - organization_name - organization_id - service_provider_name - service_provider_id - service_id - year - quarter - service_provided - transaction_point - channel - standardized_question_number - standardized_question_identifier - customized_question_text - likert_scale_1 - likert_scale_2 - likert_scale_3 - likert_scale_4 - likert_scale_5 - point_scale - response_volume - notes - question_total - start_date - end_date - ] - - rows << header_fields.join(',') - - ServiceProvider.active.includes(:organization).order('organizations.name', :name).each do |service_provider| - service_provider.services.includes(:organization).order('organizations.name', :name).each do |service| - if params[:quarter] - @collections = service.collections.where(quarter: params[:quarter]) - else - @collections = service.collections - end - - @collections.each do |collection| - collection.omb_cx_reporting_collections.includes(:collection).order('collections.year', 'collections.quarter', 'omb_cx_reporting_collections.service_provided', 'omb_cx_reporting_collections.channel').each do |omb_cx_reporting_collection| - # WRITE A CSV LINE FOR EACH OF THE 7 STANDARD QUESTIONS - (1..7).each do |question_number| - next if params[:question] && (question_number.to_s != params[:question]) - - row_fields = [ - omb_cx_reporting_collection.organization_abbreviation, - "\"#{omb_cx_reporting_collection.organization_name}\"", - omb_cx_reporting_collection.organization_id, - "\"#{omb_cx_reporting_collection.collection.service_provider.name}\"", - omb_cx_reporting_collection.collection.service_provider.slug, - omb_cx_reporting_collection.service.service_slug, - omb_cx_reporting_collection.collection.year, - omb_cx_reporting_collection.collection.quarter, - "\"#{omb_cx_reporting_collection.service_provided}\"", - "\"#{omb_cx_reporting_collection.transaction_point}\"", - "\"#{omb_cx_reporting_collection.channel}\"", - question_number, - hisp_questions_key[question_number.to_s], - "\"#{omb_cx_reporting_collection.send("q#{question_number}_text")}\"", - omb_cx_reporting_collection.send("q#{question_number}_1"), - omb_cx_reporting_collection.send("q#{question_number}_2"), - omb_cx_reporting_collection.send("q#{question_number}_3"), - omb_cx_reporting_collection.send("q#{question_number}_4"), - omb_cx_reporting_collection.send("q#{question_number}_5"), - omb_cx_reporting_collection.send("q#{question_number}_point_scale"), - omb_cx_reporting_collection.question_total(question: "q#{question_number}"), - '', - omb_cx_reporting_collection.collection.start_date, - omb_cx_reporting_collection.collection.end_date, - ] - rows << row_fields.join(',') - end - end - end - end - end - - render plain: rows.join("\n") - end - - def hisp_service_questions - rows = [] - header_fields = %i[ - organization_abbreviation - organization_name - organization_id - service_provider_name - service_provider_id - service_name - service_id - year - quarter - service_provided - transaction_point - channel - standardized_question_number - standardized_question_identifier - customized_question_text - likert_scale_1 - likert_scale_2 - likert_scale_3 - likert_scale_4 - likert_scale_5 - point_scale - response_volume - notes - question_total - start_date - end_date - ] - - header_fields.join(',') - - rows << header_fields.join(',') - - ServiceProvider.active.includes(:organization).order('organizations.name', :name).each do |service_provider| - service_provider.services.includes(:organization).order('organizations.name', :name).each do |service| - if params[:quarter] - @collections = service.collections.where(quarter: params[:quarter]) - else - @collections = service.collections - end - - @collections.each do |collection| - collection.omb_cx_reporting_collections.includes(:collection).order('collections.year', 'collections.quarter', 'omb_cx_reporting_collections.service_provided', 'omb_cx_reporting_collections.channel').each do |omb_cx_reporting_collection| - # WRITE A CSV LINE FOR EACH OF THE 7 STANDARD QUESTIONS - (1..7).each do |question_number| - next if params[:question] && (question_number.to_s != params[:question]) - - row_fields = [ - omb_cx_reporting_collection.organization_abbreviation, - "\"#{omb_cx_reporting_collection.organization_name}\"", - omb_cx_reporting_collection.organization_id, - "\"#{omb_cx_reporting_collection.collection.service_provider.name}\"", - omb_cx_reporting_collection.collection.service_provider.slug, - omb_cx_reporting_collection.service.name, - omb_cx_reporting_collection.service.service_slug, - omb_cx_reporting_collection.collection.year, - omb_cx_reporting_collection.collection.quarter, - "\"#{omb_cx_reporting_collection.service_provided}\"", - omb_cx_reporting_collection.transaction_point, - omb_cx_reporting_collection.channel, - question_number, - hisp_questions_key[question_number.to_s], - "\"#{omb_cx_reporting_collection.send("q#{question_number}_text")}\"", - omb_cx_reporting_collection.send("q#{question_number}_1"), - omb_cx_reporting_collection.send("q#{question_number}_2"), - omb_cx_reporting_collection.send("q#{question_number}_3"), - omb_cx_reporting_collection.send("q#{question_number}_4"), - omb_cx_reporting_collection.send("q#{question_number}_5"), - omb_cx_reporting_collection.send("q#{question_number}_point_scale"), - omb_cx_reporting_collection.question_total(question: "q#{question_number}"), - omb_cx_reporting_collection.collection.start_date, - omb_cx_reporting_collection.collection.end_date, - ] - - rows << row_fields.join(',') - end - end - end - end - end - - render plain: rows.join("\n") - end - def lifespan @form_lifespans = Submission.select('form_id, count(*) as num_submissions, (max(submissions.created_at) - min(submissions.created_at)) as lifespan').group(:form_id) @forms = Form.select(:id, :name, :organization_id, :uuid).where('exists (select id, uuid from submissions where submissions.form_id = forms.id)') diff --git a/app/controllers/admin/services_controller.rb b/app/controllers/admin/services_controller.rb index 7b85fc0f2..4b568acfe 100644 --- a/app/controllers/admin/services_controller.rb +++ b/app/controllers/admin/services_controller.rb @@ -8,7 +8,6 @@ class ServicesController < AdminController submit approve verify archive reset destroy equity_assessment - omb_cx_reporting add_tag remove_tag add_service_manager @@ -85,7 +84,6 @@ def export_csv end def show - @omb_cx_reporting_collections = @service.omb_cx_reporting_collections.includes(:collection).order('collections.year', 'collections.quarter') @cx_collections = @service.cx_collections end @@ -217,8 +215,6 @@ def remove_service_manager def equity_assessment; end - def omb_cx_reporting; end - private def set_service diff --git a/app/controllers/admin/site_controller.rb b/app/controllers/admin/site_controller.rb index d5f2598dd..6334cc44b 100644 --- a/app/controllers/admin/site_controller.rb +++ b/app/controllers/admin/site_controller.rb @@ -28,8 +28,6 @@ def index @recent_forms = Form.includes(:organization).find(form_ids) end - def a11; end - def a11_v2_collections; end def heartbeat diff --git a/app/controllers/admin/users_controller.rb b/app/controllers/admin/users_controller.rb index f01e34612..85e526891 100644 --- a/app/controllers/admin/users_controller.rb +++ b/app/controllers/admin/users_controller.rb @@ -50,7 +50,7 @@ def reactivate def show @forms = @user.forms.order(:status, :name) @websites = Website.where(site_owner_email: @user.email) - @collections = @user.collections.order(:year, :quarter) + @cx_collections = @user.cx_collections.order(:fiscal_year, :quarter) @user_events = Event.limit(100).where(object_type: 'User', object_uuid: @user.id).order('created_at DESC') @service_providers = ServiceProvider.with_role(:service_provider_manager, @user) @services = Service.with_role(:service_manager, @user) diff --git a/app/controllers/api/v1/collections_controller.rb b/app/controllers/api/v1/collections_controller.rb deleted file mode 100644 index 14a26ae55..000000000 --- a/app/controllers/api/v1/collections_controller.rb +++ /dev/null @@ -1,19 +0,0 @@ -# frozen_string_literal: true - -module Api - module V1 - class CollectionsController < ::ApiController - def index - respond_to do |format| - format.json do - if params[:all].present? && params[:all].to_s == '1' - render json: Collection.order(:id), each_serializer: CollectionSerializer - else - render json: Collection.published.order(:id), each_serializer: CollectionSerializer - end - end - end - end - end - end -end diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index ea1238c87..1437263ef 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -68,14 +68,6 @@ def ensure_performance_manager_permissions redirect_to(index_path, notice: 'Authorization is Required') end - def ensure_collection_owner(collection:) - return false if collection.blank? - return true if admin_permissions? - return true if collection_permissions?(collection:) - - redirect_to(index_path, notice: 'Authorization is Required') - end - def ensure_cx_collection_owner(cx_collection:) return false if cx_collection.blank? return true if admin_permissions? @@ -176,14 +168,6 @@ def cscrm_manager_permissions? current_user.cscrm_data_collection_manager? end - helper_method :collection_permissions? - def collection_permissions?(collection:) - return false if collection.blank? - return true if performance_manager_permissions? - - collection.organization == current_user.organization - end - helper_method :cx_collection_permissions? def cx_collection_permissions?(cx_collection:) return false if cx_collection.blank? diff --git a/app/mailers/user_mailer.rb b/app/mailers/user_mailer.rb index c286fd71e..0c1ad890c 100644 --- a/app/mailers/user_mailer.rb +++ b/app/mailers/user_mailer.rb @@ -72,13 +72,6 @@ def service_event_notification(subject:, service:, event:, link: '') to: (UserMailer.touchpoints_admin_emails + User.service_managers.collect(&:email)).uniq end - def collection_notification(collection_id:) - set_logo - @collection = Collection.find(collection_id) - mail subject: "Data Collection notification to #{@collection.name}", - to: (UserMailer.touchpoints_admin_emails + User.performance_managers.collect(&:email)).uniq - end - def cx_collection_notification(cx_collection_id:) set_logo @cx_collection = CxCollection.find(cx_collection_id) @@ -88,23 +81,23 @@ def cx_collection_notification(cx_collection_id:) def cscrm_data_collection_notification(collection_id:) set_logo - @collection = CscrmDataCollection.find(collection_id) - mail subject: "CSCRM Data Collection notification to #{@collection.id}", + @cscrm_data_collection = CscrmDataCollection.find(collection_id) + mail subject: "CSCRM Data Collection notification to #{@cscrm_data_collection.id}", to: (UserMailer.touchpoints_admin_emails + User.where(cscrm_data_collection_manager: true).collect(&:email)).uniq end def cscrm_data_collection2_notification(collection_id:) set_logo - @collection = CscrmDataCollection2.find(collection_id) - mail subject: "CSCRM Data Collection 2 notification to #{@collection.id}", + @cscrm_data_collection = CscrmDataCollection2.find(collection_id) + mail subject: "CSCRM Data Collection 2 notification to #{@cscrm_data_collection.id}", to: (UserMailer.touchpoints_admin_emails + User.where(cscrm_data_collection_manager: true).collect(&:email)).uniq end - def quarterly_performance_notification(collection_id:) + def quarterly_performance_notification(cx_collection_id:) set_logo - @collection = Collection.find(collection_id) - mail subject: "Quarterly Performance Data Collection Ready: #{@collection.name}", - to: @collection.user.email, + @cx_collection = CxCollection.find(cx_collection_id) + mail subject: "Quarterly Performance Data Collection Ready: #{@cx_collection.name}", + to: @cx_collection.user.email, cc: User.performance_managers.collect(&:email).uniq end diff --git a/app/models/collection.rb b/app/models/collection.rb deleted file mode 100644 index d7a887cf0..000000000 --- a/app/models/collection.rb +++ /dev/null @@ -1,213 +0,0 @@ -# frozen_string_literal: true - -class Collection < ApplicationRecord - include AASM - - belongs_to :organization - belongs_to :service_provider - belongs_to :user - has_many :omb_cx_reporting_collections, dependent: :delete_all - - validates :year, presence: true - validates :quarter, presence: true - - validates :name, presence: true - validates :reflection, length: { maximum: 5000 } - - scope :published, -> { where(aasm_state: 'published') } - - def omb_control_number - 'omb_control_number' - end - - aasm do - state :draft, initial: true - state :submitted - state :published - state :change_requested - state :archived - - event :submit do - transitions from: %i[draft change_requested], to: :submitted - end - - event :publish do - transitions from: :submitted, to: :published - end - - event :request_change do - transitions from: [:submitted], to: :change_requested - end - - event :archive do - transitions from: [:published], to: :archived - end - - event :reset do - transitions to: :draft - end - end - - def duplicate!(new_user:) - new_collection = dup - new_collection.user = new_user - new_collection.name = "Copy of #{name}" - new_collection.start_date = nil - new_collection.end_date = nil - new_collection.reflection = nil - new_collection.rating = nil - new_collection.aasm_state = :draft - new_collection.save - - # Loop OMB CX Reporting Collections to create them for new_collection - omb_cx_reporting_collections.each do |omb_cx_reporting_collection| - new_omb_cx_reporting_collection = omb_cx_reporting_collection.dup - new_omb_cx_reporting_collection.collection = new_collection - new_omb_cx_reporting_collection.volume_of_customers = 0 - new_omb_cx_reporting_collection.volume_of_customers_provided_survey_opportunity = 0 - new_omb_cx_reporting_collection.volume_of_respondents = 0 - new_omb_cx_reporting_collection.q1_1 = 0 - new_omb_cx_reporting_collection.q1_2 = 0 - new_omb_cx_reporting_collection.q1_3 = 0 - new_omb_cx_reporting_collection.q1_4 = 0 - new_omb_cx_reporting_collection.q1_5 = 0 - new_omb_cx_reporting_collection.q2_1 = 0 - new_omb_cx_reporting_collection.q2_2 = 0 - new_omb_cx_reporting_collection.q2_3 = 0 - new_omb_cx_reporting_collection.q2_4 = 0 - new_omb_cx_reporting_collection.q2_5 = 0 - new_omb_cx_reporting_collection.q3_1 = 0 - new_omb_cx_reporting_collection.q3_2 = 0 - new_omb_cx_reporting_collection.q3_3 = 0 - new_omb_cx_reporting_collection.q3_4 = 0 - new_omb_cx_reporting_collection.q3_5 = 0 - new_omb_cx_reporting_collection.q4_1 = 0 - new_omb_cx_reporting_collection.q4_2 = 0 - new_omb_cx_reporting_collection.q4_3 = 0 - new_omb_cx_reporting_collection.q4_4 = 0 - new_omb_cx_reporting_collection.q4_5 = 0 - new_omb_cx_reporting_collection.q5_1 = 0 - new_omb_cx_reporting_collection.q5_2 = 0 - new_omb_cx_reporting_collection.q5_3 = 0 - new_omb_cx_reporting_collection.q5_4 = 0 - new_omb_cx_reporting_collection.q5_5 = 0 - new_omb_cx_reporting_collection.q6_1 = 0 - new_omb_cx_reporting_collection.q6_2 = 0 - new_omb_cx_reporting_collection.q6_3 = 0 - new_omb_cx_reporting_collection.q6_4 = 0 - new_omb_cx_reporting_collection.q6_5 = 0 - new_omb_cx_reporting_collection.q7_1 = 0 - new_omb_cx_reporting_collection.q7_2 = 0 - new_omb_cx_reporting_collection.q7_3 = 0 - new_omb_cx_reporting_collection.q7_4 = 0 - new_omb_cx_reporting_collection.q7_5 = 0 - new_omb_cx_reporting_collection.q8_1 = 0 - new_omb_cx_reporting_collection.q8_2 = 0 - new_omb_cx_reporting_collection.q8_3 = 0 - new_omb_cx_reporting_collection.q8_4 = 0 - new_omb_cx_reporting_collection.q8_5 = 0 - new_omb_cx_reporting_collection.q9_1 = 0 - new_omb_cx_reporting_collection.q9_2 = 0 - new_omb_cx_reporting_collection.q9_3 = 0 - new_omb_cx_reporting_collection.q9_4 = 0 - new_omb_cx_reporting_collection.q9_5 = 0 - new_omb_cx_reporting_collection.q10_1 = 0 - new_omb_cx_reporting_collection.q10_2 = 0 - new_omb_cx_reporting_collection.q10_3 = 0 - new_omb_cx_reporting_collection.q10_4 = 0 - new_omb_cx_reporting_collection.q10_5 = 0 - new_omb_cx_reporting_collection.q11_1 = 0 - new_omb_cx_reporting_collection.q11_2 = 0 - new_omb_cx_reporting_collection.q11_3 = 0 - new_omb_cx_reporting_collection.q11_4 = 0 - new_omb_cx_reporting_collection.q11_5 = 0 - new_omb_cx_reporting_collection.save! - end - - new_collection - end - - def totals - @volume_of_customers = 0 - @volume_of_customers_provided_survey_opportunity = 0 - @volume_of_respondents = 0 - - omb_cx_reporting_collections.each do |omb_cx_reporting_collection| - @volume_of_customers += omb_cx_reporting_collection.volume_of_customers.to_i - @volume_of_customers_provided_survey_opportunity += omb_cx_reporting_collection.volume_of_customers_provided_survey_opportunity.to_i - @volume_of_respondents += omb_cx_reporting_collection.volume_of_respondents.to_i - end - - { - volume_of_customers: @volume_of_customers, - volume_of_customers_provided_survey_opportunity: @volume_of_customers_provided_survey_opportunity, - volume_of_respondents: @volume_of_respondents, - } - end - - def self.to_csv - collections = Collection.order(:year, :quarter, 'organizations.name').includes(:organization) - - attributes = %i[ - id - name - start_date - end_date - service_provider_id - service_provider_name - service_provider_organization_id - service_provider_organization_name - service_provider_organization_abbreviation - organization_id - organization_name - organization_abbreviation - user_email - year - quarter - reflection - created_at - updated_at - rating - aasm_state - integrity_hash - omb_cx_reporting_collections_count - ] - - CSV.generate(headers: true) do |csv| - csv << attributes - - collections.each do |collection| - csv << attributes = [ - collection.id, - collection.name, - collection.start_date, - collection.end_date, - collection.service_provider_id, - collection.service_provider.name, - collection.service_provider.organization_id, - collection.service_provider.organization_name, - collection.service_provider.organization_abbreviation, - collection.organization_id, - collection.organization.name, - collection.organization.abbreviation, - collection.user.email, - collection.year, - collection.quarter, - collection.reflection, - collection.created_at, - collection.updated_at, - collection.rating, - collection.aasm_state, - collection.integrity_hash, - collection.omb_cx_reporting_collections.size, - ] - end - end - end - - delegate :name, to: :organization, prefix: true - - delegate :abbreviation, to: :organization, prefix: true - - delegate :name, to: :service_provider, prefix: true -end diff --git a/app/models/cx_collection.rb b/app/models/cx_collection.rb index 5429b9f49..face78d7c 100644 --- a/app/models/cx_collection.rb +++ b/app/models/cx_collection.rb @@ -110,7 +110,7 @@ def self.to_csv rating aasm_state integrity_hash - omb_cx_reporting_collections_count + cx_collection_details_count ] CSV.generate(headers: true) do |csv| diff --git a/app/models/omb_cx_reporting_collection.rb b/app/models/omb_cx_reporting_collection.rb deleted file mode 100644 index ebeef41e5..000000000 --- a/app/models/omb_cx_reporting_collection.rb +++ /dev/null @@ -1,385 +0,0 @@ -# frozen_string_literal: true - -class OmbCxReportingCollection < ApplicationRecord - belongs_to :collection - belongs_to :service - - validates :service_provided, presence: true - - scope :published, lambda { - joins(:collection).where("collections.aasm_state = 'published'") - } - - (1..11).each do |q| - (1..5).each do |a| - validates :"q#{q}_#{a}", numericality: true - end - end - - def answer_points(question:) - (send("#{question}_1") * 1.0) + - (send("#{question}_2") * 2.0) + - (send("#{question}_3") * 3.0) + - (send("#{question}_4") * 4.0) + - (send("#{question}_5") * 5.0) - end - - def omb_control_number - super || 'OMB Control Number' - end - - def federal_register_url - super || 'https:///www.reginfo.gov/...' - end - - def q1_point_scale - ( - answer_points(question: :q1) / - q1_total - ).round(2) - end - - def q2_point_scale - ( - answer_points(question: :q2) / - q2_total - ).round(2) - end - - def q3_point_scale - ( - answer_points(question: :q3) / - q3_total - ).round(2) - end - - def q4_point_scale - ( - answer_points(question: :q4) / - q4_total - ).round(2) - end - - def q5_point_scale - ( - answer_points(question: :q5) / - q5_total - ).round(2) - end - - def q6_point_scale - ( - answer_points(question: :q6) / - q6_total - ).round(2) - end - - def q7_point_scale - ( - answer_points(question: :q7) / - q7_total - ).round(2) - end - - def q8_point_scale - ( - answer_points(question: :q8) / - q8_total - ).round(2) - end - - def q9_point_scale - ( - answer_points(question: :q9) / - q9_total - ).round(2) - end - - def q10_point_scale - ( - answer_points(question: :q10) / - q10_total - ).round(2) - end - - def q11_point_scale - ( - answer_points(question: :q11) / - q11_total - ).round(2) - end - - def question_total(question: nil) - send("#{question}_1") + - send("#{question}_2") + - send("#{question}_3") + - send("#{question}_4") + - send("#{question}_5") - end - - def q1_total - question_total(question: :q1) - end - - def q2_total - question_total(question: :q2) - end - - def q3_total - question_total(question: :q3) - end - - def q4_total - question_total(question: :q4) - end - - def q5_total - question_total(question: :q5) - end - - def q6_total - question_total(question: :q6) - end - - def q7_total - question_total(question: :q7) - end - - def q8_total - question_total(question: :q8) - end - - def q9_total - question_total(question: :q9) - end - - def q10_total - question_total(question: :q10) - end - - def q11_total - question_total(question: :q11) - end - - def volume_total - q1_total + q2_total + q3_total + q4_total + q5_total + q6_total + q7_total + q8_total + q9_total + q10_total + q11_total - end - - def self.to_csv - omb_cx_reporting_collections = OmbCxReportingCollection.all - - attributes = %i[ - id - collection_id - collection_year - collection_quarter - collection_name - collection_organization_id - collection_organization_name - collection_organization_abbreviation - service_provider_id - service_provider_name - service_provider_organization_id - service_provider_organization_name - service_provider_organization_abbreviation - service_provided - service_id - service_name - transaction_point - channel - volume_of_customers - volume_of_customers_provided_survey_opportunity - volume_of_respondents - omb_control_number - federal_register_url - q1_text - q1_1 - q1_2 - q1_3 - q1_4 - q1_5 - q2_text - q2_1 - q2_2 - q2_3 - q2_4 - q2_5 - q3_text - q3_1 - q3_2 - q3_3 - q3_4 - q3_5 - q4_text - q4_1 - q4_2 - q4_3 - q4_4 - q4_5 - q5_text - q5_1 - q5_2 - q5_3 - q5_4 - q5_5 - q6_text - q6_1 - q6_2 - q6_3 - q6_4 - q6_5 - q7_text - q7_1 - q7_2 - q7_3 - q7_4 - q7_5 - q8_text - q8_1 - q8_2 - q8_3 - q8_4 - q8_5 - q9_text - q9_1 - q9_2 - q9_3 - q9_4 - q9_5 - q10_text - q10_1 - q10_2 - q10_3 - q10_4 - q10_5 - q11_text - q11_1 - q11_2 - q11_3 - q11_4 - q11_5 - created_at - updated_at - operational_metrics - ] - - CSV.generate(headers: true) do |csv| - csv << attributes - - omb_cx_reporting_collections.each do |omb_cx_reporting_collection| - csv << attributes = [ - omb_cx_reporting_collection.id, - omb_cx_reporting_collection.collection_id, - omb_cx_reporting_collection.collection.year, - omb_cx_reporting_collection.collection.quarter, - omb_cx_reporting_collection.collection.name, - omb_cx_reporting_collection.collection.organization_id, - omb_cx_reporting_collection.collection.organization.abbreviation, - omb_cx_reporting_collection.collection.organization.name, - omb_cx_reporting_collection.collection.service_provider_id, - omb_cx_reporting_collection.collection.service_provider.name, - omb_cx_reporting_collection.collection.service_provider.organization_id, - omb_cx_reporting_collection.collection.service_provider.organization_name, - omb_cx_reporting_collection.collection.service_provider.organization_abbreviation, - omb_cx_reporting_collection.service_provided, - omb_cx_reporting_collection.service_id, - omb_cx_reporting_collection.service.name, - omb_cx_reporting_collection.transaction_point, - omb_cx_reporting_collection.channel, - omb_cx_reporting_collection.volume_of_customers, - omb_cx_reporting_collection.volume_of_customers_provided_survey_opportunity, - omb_cx_reporting_collection.volume_of_respondents, - omb_cx_reporting_collection.omb_control_number, - omb_cx_reporting_collection.federal_register_url, - omb_cx_reporting_collection.q1_text, - omb_cx_reporting_collection.q1_1, - omb_cx_reporting_collection.q1_2, - omb_cx_reporting_collection.q1_3, - omb_cx_reporting_collection.q1_4, - omb_cx_reporting_collection.q1_5, - omb_cx_reporting_collection.q2_text, - omb_cx_reporting_collection.q2_1, - omb_cx_reporting_collection.q2_2, - omb_cx_reporting_collection.q2_3, - omb_cx_reporting_collection.q2_4, - omb_cx_reporting_collection.q2_5, - omb_cx_reporting_collection.q3_text, - omb_cx_reporting_collection.q3_1, - omb_cx_reporting_collection.q3_2, - omb_cx_reporting_collection.q3_3, - omb_cx_reporting_collection.q3_4, - omb_cx_reporting_collection.q3_5, - omb_cx_reporting_collection.q4_text, - omb_cx_reporting_collection.q4_1, - omb_cx_reporting_collection.q4_2, - omb_cx_reporting_collection.q4_3, - omb_cx_reporting_collection.q4_4, - omb_cx_reporting_collection.q4_5, - omb_cx_reporting_collection.q5_text, - omb_cx_reporting_collection.q5_1, - omb_cx_reporting_collection.q5_2, - omb_cx_reporting_collection.q5_3, - omb_cx_reporting_collection.q5_4, - omb_cx_reporting_collection.q5_5, - omb_cx_reporting_collection.q6_text, - omb_cx_reporting_collection.q6_1, - omb_cx_reporting_collection.q6_2, - omb_cx_reporting_collection.q6_3, - omb_cx_reporting_collection.q6_4, - omb_cx_reporting_collection.q6_5, - omb_cx_reporting_collection.q7_text, - omb_cx_reporting_collection.q7_1, - omb_cx_reporting_collection.q7_2, - omb_cx_reporting_collection.q7_3, - omb_cx_reporting_collection.q7_4, - omb_cx_reporting_collection.q7_5, - omb_cx_reporting_collection.q8_text, - omb_cx_reporting_collection.q8_1, - omb_cx_reporting_collection.q8_2, - omb_cx_reporting_collection.q8_3, - omb_cx_reporting_collection.q8_4, - omb_cx_reporting_collection.q8_5, - omb_cx_reporting_collection.q9_text, - omb_cx_reporting_collection.q9_1, - omb_cx_reporting_collection.q9_2, - omb_cx_reporting_collection.q9_3, - omb_cx_reporting_collection.q9_4, - omb_cx_reporting_collection.q9_5, - omb_cx_reporting_collection.q10_text, - omb_cx_reporting_collection.q10_1, - omb_cx_reporting_collection.q10_2, - omb_cx_reporting_collection.q10_3, - omb_cx_reporting_collection.q10_4, - omb_cx_reporting_collection.q10_5, - omb_cx_reporting_collection.q11_text, - omb_cx_reporting_collection.q11_1, - omb_cx_reporting_collection.q11_2, - omb_cx_reporting_collection.q11_3, - omb_cx_reporting_collection.q11_4, - omb_cx_reporting_collection.q11_5, - omb_cx_reporting_collection.created_at, - omb_cx_reporting_collection.updated_at, - omb_cx_reporting_collection.operational_metrics, - ] - end - end - end - - delegate :organization, to: :collection - - delegate :id, to: :organization, prefix: true - - delegate :name, to: :organization, prefix: true - - delegate :abbreviation, to: :organization, prefix: true - - delegate :name, to: :collection, prefix: true - - delegate :year, to: :collection, prefix: true - - delegate :quarter, to: :collection, prefix: true - - delegate :name, to: :service, prefix: true - - delegate :service_slug, to: :service -end diff --git a/app/models/organization.rb b/app/models/organization.rb index 274bba434..d8f384ca9 100644 --- a/app/models/organization.rb +++ b/app/models/organization.rb @@ -7,7 +7,6 @@ class Organization < ApplicationRecord has_many :service_providers has_many :services has_many :websites - has_many :collections has_many :cx_collections has_many :cscrm_data_collections has_many :cscrm_data_collections2, class_name: "CscrmDataCollection2" diff --git a/app/models/service.rb b/app/models/service.rb index f8c6f25f6..8bbbedf51 100644 --- a/app/models/service.rb +++ b/app/models/service.rb @@ -11,9 +11,6 @@ class Service < ApplicationRecord belongs_to :service_provider, optional: true, counter_cache: true has_many :service_stages, dependent: :delete_all - has_many :omb_cx_reporting_collections - has_many :collections, through: :omb_cx_reporting_collections - has_many :cx_collections has_many :cx_collection_details, through: :cx_collections diff --git a/app/models/service_provider.rb b/app/models/service_provider.rb index 47e8c0542..4c35b2f1b 100644 --- a/app/models/service_provider.rb +++ b/app/models/service_provider.rb @@ -4,8 +4,8 @@ class ServiceProvider < ApplicationRecord resourcify belongs_to :organization has_many :services - has_many :collections, through: :services - has_many :omb_cx_reporting_collections, through: :collections + has_many :cx_collections, through: :services + has_many :cx_collection_details, through: :cx_collections acts_as_taggable_on :tags validates :name, presence: true diff --git a/app/models/user.rb b/app/models/user.rb index 3d46d1591..ed142280c 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -16,7 +16,6 @@ class User < ApplicationRecord belongs_to :organization, optional: true has_many :user_roles, dependent: :destroy has_many :forms, through: :user_roles, primary_key: 'form_id' - has_many :collections, through: :organization def cx_collections user_org = organization diff --git a/app/serializers/collection_serializer.rb b/app/serializers/collection_serializer.rb deleted file mode 100644 index 7a59ebafa..000000000 --- a/app/serializers/collection_serializer.rb +++ /dev/null @@ -1,23 +0,0 @@ -# frozen_string_literal: true - -class CollectionSerializer < ActiveModel::Serializer - attributes :id, - :name, - :start_date, - :end_date, - :organization_id, - :organization_name, - :organization_abbreviation, - :year, - :quarter, - :service_provider_id, - :service_provider_name, - :integrity_hash, - :aasm_state, - :reflection, - :rating, - :user_id, - :updated_at - - has_many :omb_cx_reporting_collections -end diff --git a/app/views/admin/collections/_csv_detail_row.html.erb b/app/views/admin/collections/_csv_detail_row.html.erb deleted file mode 100644 index eb1bca21e..000000000 --- a/app/views/admin/collections/_csv_detail_row.html.erb +++ /dev/null @@ -1 +0,0 @@ -<%= omb_cx_reporting_collection.collection.service_provider.slug %>,<%= omb_cx_reporting_collection.service.service_slug %>,<%= omb_cx_reporting_collection.collection.year %>,<%= omb_cx_reporting_collection.collection.quarter %>,"<%= omb_cx_reporting_collection.service_provided %>","<%= omb_cx_reporting_collection.transaction_point %>",<%= omb_cx_reporting_collection.channel %>,<%= question_number %>,<%= hisp_questions_key[question_number.to_s] %>,"<%= omb_cx_reporting_collection.send("q#{question_number}_text") %>",<%= omb_cx_reporting_collection.send("q#{question_number}_1") %>,<%= omb_cx_reporting_collection.send("q#{question_number}_2") %>,<%= omb_cx_reporting_collection.send("q#{question_number}_3") %>,<%= omb_cx_reporting_collection.send("q#{question_number}_4") %>,<%= omb_cx_reporting_collection.send("q#{question_number}_5") %>,<%= omb_cx_reporting_collection.send("q#{question_number}_point_scale") %>,<%= omb_cx_reporting_collection.question_total(question: "q#{question_number}") %>,"",<%= omb_cx_reporting_collection.collection.start_date %>,<%= omb_cx_reporting_collection.collection.end_date %> diff --git a/app/views/admin/collections/_form.html.erb b/app/views/admin/collections/_form.html.erb deleted file mode 100644 index 9a8c65803..000000000 --- a/app/views/admin/collections/_form.html.erb +++ /dev/null @@ -1,114 +0,0 @@ -<%= form_with(model: collection, url: collection.persisted? ? admin_collection_path(collection) : admin_collections_path, local: true, data: { turbo: false }) do |f| %> - <%- if collection.errors.any? %> -
- <%= f.submit class: "usa-button" %> -
-<% end %> - diff --git a/app/views/admin/collections/_hisps_csv_details.html.erb b/app/views/admin/collections/_hisps_csv_details.html.erb deleted file mode 100644 index 02638c409..000000000 --- a/app/views/admin/collections/_hisps_csv_details.html.erb +++ /dev/null @@ -1,72 +0,0 @@ -- This .csv data is used to populate the individual Services of each HISP on performance.gov. -
-- Filter by Question: - <%= link_to "Question 1", admin_collections_path(question: 1) %> - <%= link_to "Question 2", admin_collections_path(question: 2) %> - <%= link_to "Question 3", admin_collections_path(question: 3) %> - <%= link_to "Question 4", admin_collections_path(question: 4) %> - <%= link_to "Question 5", admin_collections_path(question: 5) %> - <%= link_to "Question 6", admin_collections_path(question: 6) %> - <%= link_to "Question 7", admin_collections_path(question: 7) %> -
-- | -- Question text - | -- 1 - | -- 2 - | -- 3 - | -- 4 - | -- 5 - | -
---|---|---|---|---|---|---|
- Satisfaction - | -- <%= form.text_field :q1_text, class: "usa-input" %> - | -- <%= form.text_field :q1_1, class: "usa-input" %> - | -- <%= form.text_field :q1_2, class: "usa-input" %> - | -- <%= form.text_field :q1_3, class: "usa-input" %> - | -- <%= form.text_field :q1_4, class: "usa-input" %> - | -- <%= form.text_field :q1_5, class: "usa-input" %> - | -
- Trust or Confidence - | -- <%= form.text_field :q2_text, class: "usa-input" %> - | -- <%= form.text_field :q2_1, class: "usa-input" %> - | -- <%= form.text_field :q2_2, class: "usa-input" %> - | -- <%= form.text_field :q2_3, class: "usa-input" %> - | -- <%= form.text_field :q2_4, class: "usa-input" %> - | -- <%= form.text_field :q2_5, class: "usa-input" %> - | -
- Effectiveness (Service) - | -- <%= form.text_field :q3_text, class: "usa-input" %> - | -- <%= form.text_field :q3_1, class: "usa-input" %> - | -- <%= form.text_field :q3_2, class: "usa-input" %> - | -- <%= form.text_field :q3_3, class: "usa-input" %> - | -- <%= form.text_field :q3_4, class: "usa-input" %> - | -- <%= form.text_field :q3_5, class: "usa-input" %> - | -
- Ease (Process) - | -- <%= form.text_field :q4_text, class: "usa-input" %> - | -- <%= form.text_field :q4_1, class: "usa-input" %> - | -- <%= form.text_field :q4_2, class: "usa-input" %> - | -- <%= form.text_field :q4_3, class: "usa-input" %> - | -- <%= form.text_field :q4_4, class: "usa-input" %> - | -- <%= form.text_field :q4_5, class: "usa-input" %> - | -
- Efficiency (Process) - | -- <%= form.text_field :q5_text, class: "usa-input" %> - | -- <%= form.text_field :q5_1, class: "usa-input" %> - | -- <%= form.text_field :q5_2, class: "usa-input" %> - | -- <%= form.text_field :q5_3, class: "usa-input" %> - | -- <%= form.text_field :q5_4, class: "usa-input" %> - | -- <%= form.text_field :q5_5, class: "usa-input" %> - | -
- Transparency (Process) - | -- <%= form.text_field :q6_text, class: "usa-input" %> - | -- <%= form.text_field :q6_1, class: "usa-input" %> - | -- <%= form.text_field :q6_2, class: "usa-input" %> - | -- <%= form.text_field :q6_3, class: "usa-input" %> - | -- <%= form.text_field :q6_4, class: "usa-input" %> - | -- <%= form.text_field :q6_5, class: "usa-input" %> - | -
- Employee (People) - | -- <%= form.text_field :q7_text, class: "usa-input" %> - | -- <%= form.text_field :q7_1, class: "usa-input" %> - | -- <%= form.text_field :q7_2, class: "usa-input" %> - | -- <%= form.text_field :q7_3, class: "usa-input" %> - | -- <%= form.text_field :q7_4, class: "usa-input" %> - | -- <%= form.text_field :q7_5, class: "usa-input" %> - | -
- Question 8 - | -- <%= form.text_field :q8_text, class: "usa-input" %> - | -- <%= form.text_field :q8_1, class: "usa-input" %> - | -- <%= form.text_field :q8_2, class: "usa-input" %> - | -- <%= form.text_field :q8_3, class: "usa-input" %> - | -- <%= form.text_field :q8_4, class: "usa-input" %> - | -- <%= form.text_field :q8_5, class: "usa-input" %> - | -
- Question 9 - | -- <%= form.text_field :q9_text, class: "usa-input" %> - | -- <%= form.text_field :q9_1, class: "usa-input" %> - | -- <%= form.text_field :q9_2, class: "usa-input" %> - | -- <%= form.text_field :q9_3, class: "usa-input" %> - | -- <%= form.text_field :q9_4, class: "usa-input" %> - | -- <%= form.text_field :q9_5, class: "usa-input" %> - | -
- Question 10 - | -- <%= form.text_field :q10_text, class: "usa-input" %> - | -- <%= form.text_field :q10_1, class: "usa-input" %> - | -- <%= form.text_field :q10_2, class: "usa-input" %> - | -- <%= form.text_field :q10_3, class: "usa-input" %> - | -- <%= form.text_field :q10_4, class: "usa-input" %> - | -- <%= form.text_field :q10_5, class: "usa-input" %> - | -
- Question 11 - | -- <%= form.text_field :q11_text, class: "usa-input" %> - | -- <%= form.text_field :q11_1, class: "usa-input" %> - | -- <%= form.text_field :q11_2, class: "usa-input" %> - | -- <%= form.text_field :q11_3, class: "usa-input" %> - | -- <%= form.text_field :q11_4, class: "usa-input" %> - | -- <%= form.text_field :q11_5, class: "usa-input" %> - | -
- <%= form.submit class: "usa-button width-full" %> -
-<% end %> - diff --git a/app/views/admin/collections/edit.html.erb b/app/views/admin/collections/edit.html.erb deleted file mode 100644 index 331b4a27d..000000000 --- a/app/views/admin/collections/edit.html.erb +++ /dev/null @@ -1,26 +0,0 @@ -<% content_for :navigation_title do %> - Editing Data Collection -<% end %> - -- <%= link_to admin_collection_path(@collection) do %> - - Back to Data Collection - <% end %> -
- -<%= render 'form', collection: @collection %> - -- <%= link_to admin_collection_path(@collection), method: :delete, data: { confirm: 'Are you sure?' }, class: "usa-button usa-button--secondary" do %> - - Delete - <% end %> - - <%= link_to copy_admin_collection_path(@collection), method: :post, class: "usa-button usa-button--outline float-right", data: { confirm: 'Are you sure?' } do %> - - Copy this collection - <% end %> -
diff --git a/app/views/admin/collections/events.html.erb b/app/views/admin/collections/events.html.erb deleted file mode 100644 index c1eeeb9bd..000000000 --- a/app/views/admin/collections/events.html.erb +++ /dev/null @@ -1,46 +0,0 @@ -<% content_for :navigation_title do %> - Event Log for <%= @collection.name %> -<% end %> -- <%= link_to admin_collection_path(@collection) do %> - - Back to Data Collection - <% end %> -
- -- Data Collections are a common user experience in federal government. - These Data Collections feature were created for - 1. staff who create Data Collections and - 2. staff who respond to Data Collections. - Requesting updates for specific data, by creating a Data Collection, should be easy. - Responding to Data Collections should also be easy. - The lifecycle of the data should be transparent and valuable as well. -
-- Touchpoints currently facilitates 2 - Data Collections: -
-Organization | -Service Provider (HISP) | -Collection name | -Detail report count | -Year | -Quarter | -Status | -Rating | -
---|---|---|---|---|---|---|---|
<%= render "admin/organizations/badge", organization: collection.organization %> | -<%= collection.service_provider ? collection.service_provider.name : "SPECIFY THIS COLLECTION'S SERVICE PROVIDER" %> | -<%= link_to collection.name, admin_collection_path(collection) %> | -<%= collection.omb_cx_reporting_collections.size %> | -<%= collection.year %> | -<%= collection.quarter %> | -- <%= render 'components/collection_status_tag', collection: collection %> - | -- <%= collection_rating_label(rating: collection.rating) %> - | -
- <%= link_to "Download Collections as .csv", export_csv_admin_collections_path, class: "usa-button" %> -
-- <%= link_to "Download OMB CX Data Reporting Collections as .csv", export_omb_cx_reporting_collections_csv_admin_collections_path, class: "usa-button" %> -
-<% end %> - -<%- if admin_permissions? %> - <%= render 'admin/collections/hisps_csv_details' %> - <%= render 'admin/components/performancegov/cx_summary_chart' %> -<% end %> diff --git a/app/views/admin/collections/new.html.erb b/app/views/admin/collections/new.html.erb deleted file mode 100644 index d26a8eadd..000000000 --- a/app/views/admin/collections/new.html.erb +++ /dev/null @@ -1,12 +0,0 @@ -<% content_for :navigation_title do %> - New Data Collection -<% end %> - -- <%= link_to admin_collections_path do %> - - Back to Data Collections - <% end %> -
- -<%= render 'form', collection: @collection %> diff --git a/app/views/admin/collections/show.html.erb b/app/views/admin/collections/show.html.erb deleted file mode 100644 index 3ce7cdda0..000000000 --- a/app/views/admin/collections/show.html.erb +++ /dev/null @@ -1,203 +0,0 @@ -<%= javascript_include_tag "chartjs-2.9.3.bundle.js" %> -<%= javascript_include_tag "performance-charts.js" %> - -<% content_for :navigation_title do %> - Data Collection - <%- if @collection.draft? || performance_manager_permissions? %> - <%= link_to edit_admin_collection_path(@collection), class: "usa-button usa-button-inverted float-right" do %> - - Edit - <% end %> - <% end %> -<% end %> - -- <%= link_to admin_collections_path do %> - - Back to Data Collections - <% end %> -
- -- This data collection has been published. -
-- About this data collection -
-- CX Customer Experience reporting is described in - OMB Circular A-11, Section 280. -
-- Each quarter, OMB coordinates this data collection from all HISPs. - This data will be summarized and reported on - performance.gov/cx. -
-- <%= label_tag :organization, nil, class: "usa-label" %> - <%= link_to_if admin_permissions?, @collection.organization.name, admin_organization_path(@collection.organization) %> -
-- <%= label_tag :service_provider, "Service Provider", class: "usa-label" %> - <%= link_to @collection.service_provider.name, admin_service_provider_path( @collection.service_provider) %> -
-- <%= label_tag :user, nil, class: "usa-label" %> - <%= link_to_if performance_manager_permissions?, @collection.user.email, admin_user_path(@collection.user) %> -
-- <%= label_tag :quarter_year, "Quarter and Fiscal year", class: "usa-label" %> - Q<%= @collection.quarter %> - FY<%= @collection.year %> -
- -
- <%= label_tag :date_range, "Date range", class: "usa-label" %>
- <%= @collection.start_date %>
- to
-
- <%= @collection.end_date %>
-
- Add a Service detail reporting page for each touchpoint available within a HISP service. -
-- <%= link_to new_admin_omb_cx_reporting_collection_path(collection_id: @collection.id), class: "usa-button usa-button--outline" do %> - - Add a Service to report on - <% end %> -
- <% end %> - <%= render 'components/performance_charts', collection: @collection if @collection.omb_cx_reporting_collections.present? %> -- <%- if @collection.reflection? %> - <%= to_markdown(@collection.reflection) %> - <% else %> -
- <%= link_to 'Edit this Collection', edit_admin_collection_path(@collection) %> - to add Reflection Text prior to submitting. -
-
- Integrity hash
-
- <%= @collection.integrity_hash || "not yet published" %>
-
- <%= label_tag :collection_status, nil, class: "usa-label" %>
-
- <%= render 'components/collection_status_tag', collection: @collection %>
-
- <%= label_tag :rating, nil, class: "usa-label" %>
-
- <%- if @collection.rating.present? %>
- <%= collection_rating_label(rating: @collection.rating) %>
- <% else %>
-
- This Collection will receive a - rating - after - Submission. -
-- <%- if !@collection.submitted? && !@collection.published? %> -
- Submitting this Data Collection will send an email - to <%= ENV.fetch("TOUCHPOINTS_ADMIN_EMAILS").split(',').to_sentence %> - who will - 1. review the data, then - 2. contact you via email - prior to publishing data on performance.gov. -
-
- Q<%= @quarter %> FY<%= @year %> :
- Jan 1 –
- Mar 31, 2021
-
-
- <%= render "components/reporting/cx_summary_data_detail_row", omb_cx_reporting_collection: @omb_cx_reporting_collection %> -
- -- Services are available - <%= link_to "here", admin_services_path, target: "_blank", rel: "noopener" %>. -
- <%- if @collection %> - <%= form.select :service_id, @collection.organization.services.includes(:organization).order("organizations.name", :name).map { |h| ["#{h.organization.abbreviation} - #{h.organization.name} - #{h.name}", h.id] }, { prompt: "For which Service?" }, class: "usa-select" %> - <% else %> - <%= form.select :service_id, Service.all.includes(:organization).order("organizations.name", :name).map { |h| ["#{h.organization.abbreviation} - #{h.organization.name} - #{h.name}", h.id] }, { prompt: "For which Service?" }, class: "usa-select" %> - <% end %> -- Describe the service that is being measured. -
- <%= form.text_field :service_provided, class: "usa-input", placeholder: "Description of the service provided", required: true %> -- Describe at what point in the user journey is the user prompted to complete the survey. -
- <%= form.text_field :transaction_point, class: "usa-input" %> -- Enter the reginfo.gov URL for the survey form. -
- <%= form.url_field :federal_register_url, class: "usa-input", placeholder: "https://www.reginfo.gov/..." %> -- Copy and paste the question text for at least questions 1-7. - And, enter the number of respondents for each of the likert scale options; 1-5. -
- -- | -- Question text - | -- 1 - | -- 2 - | -- 3 - | -- 4 - | -- 5 - | -
---|---|---|---|---|---|---|
- Satisfaction - | -- <%= form.text_field :q1_text, class: "usa-input" %> - | -- <%= form.number_field :q1_1, class: "usa-input" %> - | -- <%= form.number_field :q1_2, class: "usa-input" %> - | -- <%= form.number_field :q1_3, class: "usa-input" %> - | -- <%= form.number_field :q1_4, class: "usa-input" %> - | -- <%= form.number_field :q1_5, class: "usa-input" %> - | -
- Trust or Confidence - | -- <%= form.text_field :q2_text, class: "usa-input" %> - | -- <%= form.number_field :q2_1, class: "usa-input" %> - | -- <%= form.number_field :q2_2, class: "usa-input" %> - | -- <%= form.number_field :q2_3, class: "usa-input" %> - | -- <%= form.number_field :q2_4, class: "usa-input" %> - | -- <%= form.number_field :q2_5, class: "usa-input" %> - | -
- Effectiveness (Service) - | -- <%= form.text_field :q3_text, class: "usa-input" %> - | -- <%= form.number_field :q3_1, class: "usa-input" %> - | -- <%= form.number_field :q3_2, class: "usa-input" %> - | -- <%= form.number_field :q3_3, class: "usa-input" %> - | -- <%= form.number_field :q3_4, class: "usa-input" %> - | -- <%= form.number_field :q3_5, class: "usa-input" %> - | -
- Ease (Process) - | -- <%= form.text_field :q4_text, class: "usa-input" %> - | -- <%= form.number_field :q4_1, class: "usa-input" %> - | -- <%= form.number_field :q4_2, class: "usa-input" %> - | -- <%= form.number_field :q4_3, class: "usa-input" %> - | -- <%= form.number_field :q4_4, class: "usa-input" %> - | -- <%= form.number_field :q4_5, class: "usa-input" %> - | -
- Efficiency (Process) - | -- <%= form.text_field :q5_text, class: "usa-input" %> - | -- <%= form.number_field :q5_1, class: "usa-input" %> - | -- <%= form.number_field :q5_2, class: "usa-input" %> - | -- <%= form.number_field :q5_3, class: "usa-input" %> - | -- <%= form.number_field :q5_4, class: "usa-input" %> - | -- <%= form.number_field :q5_5, class: "usa-input" %> - | -
- Transparency (Process) - | -- <%= form.text_field :q6_text, class: "usa-input" %> - | -- <%= form.number_field :q6_1, class: "usa-input" %> - | -- <%= form.number_field :q6_2, class: "usa-input" %> - | -- <%= form.number_field :q6_3, class: "usa-input" %> - | -- <%= form.number_field :q6_4, class: "usa-input" %> - | -- <%= form.number_field :q6_5, class: "usa-input" %> - | -
- Employee (People) - | -- <%= form.text_field :q7_text, class: "usa-input" %> - | -- <%= form.number_field :q7_1, class: "usa-input" %> - | -- <%= form.number_field :q7_2, class: "usa-input" %> - | -- <%= form.number_field :q7_3, class: "usa-input" %> - | -- <%= form.number_field :q7_4, class: "usa-input" %> - | -- <%= form.number_field :q7_5, class: "usa-input" %> - | -
- Question 8 - | -- <%= form.text_field :q8_text, class: "usa-input" %> - | -- <%= form.number_field :q8_1, class: "usa-input" %> - | -- <%= form.number_field :q8_2, class: "usa-input" %> - | -- <%= form.number_field :q8_3, class: "usa-input" %> - | -- <%= form.number_field :q8_4, class: "usa-input" %> - | -- <%= form.number_field :q8_5, class: "usa-input" %> - | -
- Question 9 - | -- <%= form.text_field :q9_text, class: "usa-input" %> - | -- <%= form.number_field :q9_1, class: "usa-input" %> - | -- <%= form.number_field :q9_2, class: "usa-input" %> - | -- <%= form.number_field :q9_3, class: "usa-input" %> - | -- <%= form.number_field :q9_4, class: "usa-input" %> - | -- <%= form.number_field :q9_5, class: "usa-input" %> - | -
- Question 10 - | -- <%= form.text_field :q10_text, class: "usa-input" %> - | -- <%= form.number_field :q10_1, class: "usa-input" %> - | -- <%= form.number_field :q10_2, class: "usa-input" %> - | -- <%= form.number_field :q10_3, class: "usa-input" %> - | -- <%= form.number_field :q10_4, class: "usa-input" %> - | -- <%= form.number_field :q10_5, class: "usa-input" %> - | -
- Question 11 - | -- <%= form.text_field :q11_text, class: "usa-input" %> - | -- <%= form.number_field :q11_1, class: "usa-input" %> - | -- <%= form.number_field :q11_2, class: "usa-input" %> - | -- <%= form.number_field :q11_3, class: "usa-input" %> - | -- <%= form.number_field :q11_4, class: "usa-input" %> - | -- <%= form.number_field :q11_5, class: "usa-input" %> - | -
- <%= form.submit "Update CX Service Detail Report", class: "usa-button width-full" %> -
-<% end %> - diff --git a/app/views/admin/omb_cx_reporting_collections/edit.html.erb b/app/views/admin/omb_cx_reporting_collections/edit.html.erb deleted file mode 100644 index a21f17459..000000000 --- a/app/views/admin/omb_cx_reporting_collections/edit.html.erb +++ /dev/null @@ -1,22 +0,0 @@ -<% content_for :navigation_title do %> - Editing CX service reporting worksheet -<% end %> - -- <%= link_to admin_omb_cx_reporting_collection_path(@omb_cx_reporting_collection) do %> - - Back to CX service reporting worksheet - <% end %> -
- -<%= render 'form', omb_cx_reporting_collection: @omb_cx_reporting_collection %> - -- <%= link_to admin_omb_cx_reporting_collection_path(@omb_cx_reporting_collection), method: :delete, data: { confirm: 'Are you sure?' }, - class: "usa-button usa-button--secondary" do %> - - - Delete - - <% end %> -
diff --git a/app/views/admin/omb_cx_reporting_collections/index.html.erb b/app/views/admin/omb_cx_reporting_collections/index.html.erb deleted file mode 100644 index 3e053ea3a..000000000 --- a/app/views/admin/omb_cx_reporting_collections/index.html.erb +++ /dev/null @@ -1,42 +0,0 @@ -<% content_for :navigation_title do %> - Omb Cx Reporting Collections - - <%= link_to new_admin_omb_cx_reporting_collection_path, class: "usa-button usa-button-inverted float-right" do %> - - New Collection - <% end %> -<% end %> -- <%= link_to admin_collections_path do %> - - Back to Data Collections - <% end %> -
- -Collection | -Service | -CX Reporting Collection name | -
---|---|---|
- <%= omb_cx_reporting_collection.service.service_provider.name %> - | -- <%= omb_cx_reporting_collection.service.name %> - | -- <%= link_to omb_cx_reporting_collection.collection.name, admin_omb_cx_reporting_collection_path(omb_cx_reporting_collection) %> - | -
- <%= link_to admin_collections_path do %> - - Back to Data Collections - <% end %> -
- -<%= render 'form', omb_cx_reporting_collection: @omb_cx_reporting_collection %> diff --git a/app/views/admin/omb_cx_reporting_collections/show.html.erb b/app/views/admin/omb_cx_reporting_collections/show.html.erb deleted file mode 100644 index 22967c5ae..000000000 --- a/app/views/admin/omb_cx_reporting_collections/show.html.erb +++ /dev/null @@ -1,526 +0,0 @@ -<% content_for :navigation_title do %> - CX service reporting worksheet - - <%= link_to edit_admin_omb_cx_reporting_collection_path(@omb_cx_reporting_collection), class: "usa-button usa-button-inverted float-right" do %> - - Edit - <% end %> -<% end %> - -- <%= link_to admin_collection_path(@omb_cx_reporting_collection.collection) do %> - - Back to - <%= @omb_cx_reporting_collection.collection.name %> - <% end %> -
- --
-
-
-
-
-
-
-
-
-
-
-
- | -- Question text - | -- 1 - | -- 2 - | -- 3 - | -- 4 - | -- 5 - | -- Total - | -- 5-point scale - | -
---|---|---|---|---|---|---|---|---|
- Satisfaction - | -- <%= @omb_cx_reporting_collection.q1_text %> - | -- <%= @omb_cx_reporting_collection.q1_1 %> - | -- <%= @omb_cx_reporting_collection.q1_2 %> - | -- <%= @omb_cx_reporting_collection.q1_3 %> - | -- <%= @omb_cx_reporting_collection.q1_4 %> - | -- <%= @omb_cx_reporting_collection.q1_5 %> - | -- <%= @omb_cx_reporting_collection.q1_total %> - | -- <%= @omb_cx_reporting_collection.q1_point_scale %> - | -
- Trust or Confidence - | -- <%= @omb_cx_reporting_collection.q2_text %> - | -- <%= @omb_cx_reporting_collection.q2_1 %> - | -- <%= @omb_cx_reporting_collection.q2_2 %> - | -- <%= @omb_cx_reporting_collection.q2_3 %> - | -- <%= @omb_cx_reporting_collection.q2_4 %> - | -- <%= @omb_cx_reporting_collection.q2_5 %> - | -- <%= @omb_cx_reporting_collection.q2_total %> - | -- <%= @omb_cx_reporting_collection.q2_point_scale %> - | -
- Effectiveness (Service) - | -- <%= @omb_cx_reporting_collection.q3_text %> - | -- <%= @omb_cx_reporting_collection.q3_1 %> - | -- <%= @omb_cx_reporting_collection.q3_2 %> - | -- <%= @omb_cx_reporting_collection.q3_3 %> - | -- <%= @omb_cx_reporting_collection.q3_4 %> - | -- <%= @omb_cx_reporting_collection.q3_5 %> - | -- <%= @omb_cx_reporting_collection.q3_total %> - | -- <%= @omb_cx_reporting_collection.q3_point_scale %> - | -
- Ease (Process) - | -- <%= @omb_cx_reporting_collection.q4_text %> - | -- <%= @omb_cx_reporting_collection.q4_1 %> - | -- <%= @omb_cx_reporting_collection.q4_2 %> - | -- <%= @omb_cx_reporting_collection.q4_3 %> - | -- <%= @omb_cx_reporting_collection.q4_4 %> - | -- <%= @omb_cx_reporting_collection.q4_5 %> - | -- <%= @omb_cx_reporting_collection.q4_total %> - | -- <%= @omb_cx_reporting_collection.q4_point_scale %> - | -
- Efficiency (Process) - | -- <%= @omb_cx_reporting_collection.q5_text %> - | -- <%= @omb_cx_reporting_collection.q5_1 %> - | -- <%= @omb_cx_reporting_collection.q5_2 %> - | -- <%= @omb_cx_reporting_collection.q5_3 %> - | -- <%= @omb_cx_reporting_collection.q5_4 %> - | -- <%= @omb_cx_reporting_collection.q5_5 %> - | -- <%= @omb_cx_reporting_collection.q5_total %> - | -- <%= @omb_cx_reporting_collection.q5_point_scale %> - | -
- Transparency (Process) - | -- <%= @omb_cx_reporting_collection.q6_text %> - | -- <%= @omb_cx_reporting_collection.q6_1 %> - | -- <%= @omb_cx_reporting_collection.q6_2 %> - | -- <%= @omb_cx_reporting_collection.q6_3 %> - | -- <%= @omb_cx_reporting_collection.q6_4 %> - | -- <%= @omb_cx_reporting_collection.q6_5 %> - | -- <%= @omb_cx_reporting_collection.q6_total %> - | -- <%= @omb_cx_reporting_collection.q6_point_scale %> - | -
- Employee (People) - | -- <%= @omb_cx_reporting_collection.q7_text %> - | -- <%= @omb_cx_reporting_collection.q7_1 %> - | -- <%= @omb_cx_reporting_collection.q7_2 %> - | -- <%= @omb_cx_reporting_collection.q7_3 %> - | -- <%= @omb_cx_reporting_collection.q7_4 %> - | -- <%= @omb_cx_reporting_collection.q7_5 %> - | -- <%= @omb_cx_reporting_collection.q7_total %> - | -- <%= @omb_cx_reporting_collection.q7_point_scale %> - | -
- Question 8 - | -- <%= @omb_cx_reporting_collection.q8_text %> - | -- <%= @omb_cx_reporting_collection.q8_1 %> - | -- <%= @omb_cx_reporting_collection.q8_2 %> - | -- <%= @omb_cx_reporting_collection.q8_3 %> - | -- <%= @omb_cx_reporting_collection.q8_4 %> - | -- <%= @omb_cx_reporting_collection.q8_5 %> - | -- <%= @omb_cx_reporting_collection.q8_total %> - | -- <%= @omb_cx_reporting_collection.q8_point_scale %> - | -
- Question 9 - | -- <%= @omb_cx_reporting_collection.q9_text %> - | -- <%= @omb_cx_reporting_collection.q9_1 %> - | -- <%= @omb_cx_reporting_collection.q9_2 %> - | -- <%= @omb_cx_reporting_collection.q9_3 %> - | -- <%= @omb_cx_reporting_collection.q9_4 %> - | -- <%= @omb_cx_reporting_collection.q9_5 %> - | -- <%= @omb_cx_reporting_collection.q9_total %> - | -- <%= @omb_cx_reporting_collection.q9_point_scale %> - | -
- Question 10 - | -- <%= @omb_cx_reporting_collection.q10_text %> - | -- <%= @omb_cx_reporting_collection.q10_1 %> - | -- <%= @omb_cx_reporting_collection.q10_2 %> - | -- <%= @omb_cx_reporting_collection.q10_3 %> - | -- <%= @omb_cx_reporting_collection.q10_4 %> - | -- <%= @omb_cx_reporting_collection.q10_5 %> - | -- <%= @omb_cx_reporting_collection.q10_total %> - | -- <%= @omb_cx_reporting_collection.q10_point_scale %> - | -
- Question 11 - | -- <%= @omb_cx_reporting_collection.q11_text %> - | -- <%= @omb_cx_reporting_collection.q11_1 %> - | -- <%= @omb_cx_reporting_collection.q11_2 %> - | -- <%= @omb_cx_reporting_collection.q11_3 %> - | -- <%= @omb_cx_reporting_collection.q11_4 %> - | -- <%= @omb_cx_reporting_collection.q11_5 %> - | -- <%= @omb_cx_reporting_collection.q11_total %> - | -- <%= @omb_cx_reporting_collection.q11_point_scale %> - | -
- Totals - | -- | -- | -- | -- | -- | -- | -- <%= @omb_cx_reporting_collection.volume_total %> - | -- | -
-
- Operational metrics
-
-
- <%= @omb_cx_reporting_collection.operational_metrics %>
-
- <%= link_to admin_collections_path(fiscal_year_and_quarter(Time.now)), class: "usa-button usa-button--outline width-full" do - %> - CX Data Collection - <% end %> -
- <% end %><%= link_to admin_cx_collections_path(fiscal_year_and_quarter(Time.now)), class: "usa-button usa-button--outline width-full" do %> A-11 v2 CX Data Collection diff --git a/app/views/admin/reporting/index.html.erb b/app/views/admin/reporting/index.html.erb index 686b6b788..2f75a7fba 100644 --- a/app/views/admin/reporting/index.html.erb +++ b/app/views/admin/reporting/index.html.erb @@ -10,54 +10,9 @@
Fiscal year | @@ -122,21 +122,21 @@|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
- <%= omb_cx_reporting_collection.collection.year %> + <%= cx_collection_detail.cx_collection.fiscal_year %> | - <%= omb_cx_reporting_collection.collection.quarter %> + <%= cx_collection_detail.cx_collection.quarter %> | - <%= link_to omb_cx_reporting_collection.collection.name, - admin_collection_path(omb_cx_reporting_collection.collection) %> + <%= link_to cx_collection_detail.cx_collection.name, + admin_cx_collection_path(cx_collection_detail.cx_collection) %> | - <%= link_to omb_cx_reporting_collection.service.name, - admin_omb_cx_reporting_collection_path(omb_cx_reporting_collection) %> + <%= link_to cx_collection_detail.service.name, + admin_cx_collection_detail_path(cx_collection_detail) %> |
Organization | Service Provider | @@ -19,7 +19,7 @@<%= link_to(service.service_provider.name, admin_service_provider_path(service.service_provider)) if service.service_provider %> | <%= link_to service.name, admin_service_path(service) %> | <%= link_to_if service.service_stages.size > 0, service.service_stages.size, admin_service_service_stages_path(service) %> | -<%= link_to_if service.collections.size > 0, service.collections.size, admin_collections_path %> | +<%= link_to_if service.cx_collections.size > 0, service.cx_collections.size, admin_cx_collections_path %> |
<%- if service.hisp? %>
HISP
diff --git a/app/views/admin/services/omb_cx_reporting.html.erb b/app/views/admin/services/omb_cx_reporting.html.erb
deleted file mode 100644
index 7904e1a94..000000000
--- a/app/views/admin/services/omb_cx_reporting.html.erb
+++ /dev/null
@@ -1,56 +0,0 @@
-
-
- - <%= link_to admin_service_path(@service) do %> - - Back to Service - <% end %> - - -
-
-
-
- CX quarterly reporting
-
- |
---|
- Fiscal year - | -- Quarter - | -- Collection name - | -- Service name - | -
---|---|---|---|
- <%= omb_cx_reporting_collection.collection.year %> - | -- <%= omb_cx_reporting_collection.collection.quarter %> - | -- <%= link_to omb_cx_reporting_collection.collection.name, admin_collection_path(omb_cx_reporting_collection.collection) %> - | -- <%= link_to omb_cx_reporting_collection.service.name, admin_omb_cx_reporting_collection_path(omb_cx_reporting_collection) %> - | -
- <%= link_to admin_root_path do %> + <%= link_to admin_dashboard_path do %> - Back to Admin + Back to Admin Dashboard <% end %>
- Data in Touchpoints is consumed upstream by: + Data from the Touchpoints API is consumed upstream by:
- Organization - | -- Service Provided - | -- Channel - | -- OMB Control Number - | -- Respondents - | -- Total Customers - | -- Satisfaction - | -- Trust or Confidence - | -- Effectiveness (Service) - | -- Ease (Process) - | -- Efficiency (Process) - | -- Transparency (Process) - | -- Employee (People) - | -
---|---|---|---|---|---|---|---|---|---|---|---|---|
- <%= c.organization.name %> - | -- <%= s.service_provided %> - | -- <%= s.channel %> - | -- <%= s.omb_control_number %> - | -- <%= s.volume_of_respondents %> - | -- <%= s.volume_of_customers %> - | -- <%= s.q1_point_scale %> - | -- <%= s.q2_point_scale %> - | -- <%= s.q3_point_scale %> - | -- <%= s.q4_point_scale %> - | -- <%= s.q5_point_scale %> - | -- <%= s.q6_point_scale %> - | -- <%= s.q7_point_scale %> - | -
- | -- | -- | -- | -- | -- | -- <% @q1_runningtotal += s.q1_total %> - <%= s.q1_total %> - | -- <% @q2_runningtotal += s.q2_total %> - <%= s.q2_total %> - | -- <% @q3_runningtotal += s.q3_total %> - <%= s.q3_total %> - | -- <% @q4_runningtotal += s.q4_total %> - <%= s.q4_total %> - | -- <% @q5_runningtotal += s.q5_total %> - <%= s.q5_total %> - | -- <% @q6_runningtotal += s.q6_total %> - <%= s.q6_total %> - | -- <% @q7_runningtotal += s.q7_total %> - <%= s.q7_total %> - | -
- TOTALS - | -- | -- | -- | -- <%= @total_volume_of_respondents %> - | -- <%= @total_volume_of_customers %> - | -- <%= @q1_runningtotal %> - | -- <%= @q2_runningtotal %> - | -- <%= @q3_runningtotal %> - | -- <%= @q4_runningtotal %> - | -- <%= @q5_runningtotal %> - | -- <%= @q6_runningtotal %> - | -- <%= @q7_runningtotal %> - | -
- <%= collection.year %> + <%= cx_collection.fiscal_year %> | - <%= collection.quarter %> + <%= cx_collection.quarter %> | - <%= link_to collection.name, admin_collection_path(collection) %> + <%= link_to cx_collection.name, admin_cx_collection_path(cx_collection) %> | - <%= link_to collection.service_provider.name, admin_service_provider_path(collection.service_provider) %> + <%= link_to cx_collection.service_provider.name, admin_service_provider_path(cx_collection.service_provider) %> |
- Data Collections + CX Data Collections | Service details @@ -104,10 +104,10 @@ | ||
---|---|---|---|
- <%= number_with_delimiter(Collection.count) %> + <%= number_with_delimiter(CxCollection.count) %> | - <%= number_with_delimiter(OmbCxReportingCollection.count) %> + <%= number_with_delimiter(CxCollectionDetail.count) %> |