From 53ea09c3de3b6be9813ce2a1eee1fd7465f6c8bf Mon Sep 17 00:00:00 2001 From: Oleksii Kriuchykhin Date: Wed, 21 Dec 2016 14:34:53 +0100 Subject: [PATCH] Fix issue with long samples column names in import modal [SCI-817] --- app/controllers/organizations_controller.rb | 4 ++++ app/views/samples/_parse_samples_modal.html.erb | 14 ++++++++++---- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/app/controllers/organizations_controller.rb b/app/controllers/organizations_controller.rb index 38f5bc86d..9f09a70dd 100644 --- a/app/controllers/organizations_controller.rb +++ b/app/controllers/organizations_controller.rb @@ -41,6 +41,10 @@ class OrganizationsController < ApplicationController # Fill in fields for dropdown @available_fields = @organization.get_available_sample_fields + # Truncate long fields + @available_fields.update(@available_fields) do |_k, v| + v.truncate(Constants::NAME_TRUNCATION_LENGTH_DROPDOWN) + end # Save file for next step (importing) @temp_file = TempFile.new( diff --git a/app/views/samples/_parse_samples_modal.html.erb b/app/views/samples/_parse_samples_modal.html.erb index 11b61a548..41101abf4 100644 --- a/app/views/samples/_parse_samples_modal.html.erb +++ b/app/views/samples/_parse_samples_modal.html.erb @@ -1,4 +1,4 @@ -