From efe41817f20c689536ef68a5de4523063293cb1d Mon Sep 17 00:00:00 2001 From: zmagod Date: Mon, 19 Dec 2016 10:49:21 +0100 Subject: [PATCH 1/2] removes sample group/type link in new sample form [fixes SCI-809] --- .../javascripts/samples/sample_datatable.js.erb | 11 ----------- app/views/shared/_samples.html.erb | 11 +---------- 2 files changed, 1 insertion(+), 21 deletions(-) diff --git a/app/assets/javascripts/samples/sample_datatable.js.erb b/app/assets/javascripts/samples/sample_datatable.js.erb index ba911e63e..4b7b284b6 100644 --- a/app/assets/javascripts/samples/sample_datatable.js.erb +++ b/app/assets/javascripts/samples/sample_datatable.js.erb @@ -756,12 +756,6 @@ function createSampleTypeSelect(data, selected) { var $selectType = $('') .attr('name', 'sample_type_id').addClass('show-tick'); - var sampleTypesLink = $('#samples').attr('data-sample-types-link'); - - var $option = $("") - .attr('value', -2) - .text(I18n.t('samples.table.add_sample_type')); - $selectType.append($option); $option = $('') .attr('value', -1).text(I18n.t('samples.table.no_type')) $selectType.append($option); @@ -786,11 +780,6 @@ function createSampleGroupSelect(data, selected) { var $selectGroup = $('') .attr('name', 'sample_group_id').addClass('show-tick'); - var sampleGroupsLink = $('#samples').attr('data-sample-groups-link'); - - var $option = $("") - .text(I18n.t('samples.table.add_sample_group')); - $selectGroup.append($option); $option = $('') .attr('value', -1).text(I18n.t('samples.table.no_group')) .attr('data-icon', 'glyphicon glyphicon-asterisk'); diff --git a/app/views/shared/_samples.html.erb b/app/views/shared/_samples.html.erb index 9ebb0b329..095a34ed0 100644 --- a/app/views/shared/_samples.html.erb +++ b/app/views/shared/_samples.html.erb @@ -128,16 +128,7 @@ data-source="<%= @samples_index_link %>" data-num-columns="<%= num_of_columns %>" data-new-sample="<%= new_organization_sample_path(organization_id: @organization) %>" - data-create-sample="<%= organization_samples_path(organization_id: @organization) %>" - data-sample-types-link="<%= organization_sample_types_path(@organization, - project_id: (@project.id if @project), - my_module_id: (@my_module.id if @my_module), - experiment_id: (@experiment.id if @experiment)) %>" - data-sample-groups-link="<%= organization_sample_groups_path(current_organization, - project_id: (@project.id if @project), - my_module_id: (@my_module.id if @my_module), - experiment_id: (@experiment.id if @experiment)) %>" - > + data-create-sample="<%= organization_samples_path(organization_id: @organization) %>"> From 6f7f6a8b7f9d658bce1c62ad966ebcecea56737f Mon Sep 17 00:00:00 2001 From: zmagod Date: Mon, 19 Dec 2016 16:41:14 +0100 Subject: [PATCH 2/2] removes dropdown sorting [fixes SCI-811] --- app/assets/javascripts/samples/sample_datatable.js.erb | 2 -- 1 file changed, 2 deletions(-) diff --git a/app/assets/javascripts/samples/sample_datatable.js.erb b/app/assets/javascripts/samples/sample_datatable.js.erb index 4b7b284b6..857ef7367 100644 --- a/app/assets/javascripts/samples/sample_datatable.js.erb +++ b/app/assets/javascripts/samples/sample_datatable.js.erb @@ -751,7 +751,6 @@ function createTdElement(content) { * @return {Object} select dropdown */ function createSampleTypeSelect(data, selected) { - selected = _.isUndefined(selected) ? 1 : selected + 1; var $selectType = $('') .attr('name', 'sample_type_id').addClass('show-tick'); @@ -775,7 +774,6 @@ function createSampleTypeSelect(data, selected) { * @param selected Selected sample group id */ function createSampleGroupSelect(data, selected) { - selected = _.isUndefined(selected) ? 1 : selected + 1; var $selectGroup = $('') .attr('name', 'sample_group_id').addClass('show-tick');