mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-02-11 09:26:37 +08:00
fixes new sample group/type link in sample row [fixes SCI-796]
This commit is contained in:
parent
c4ff12be51
commit
b07f9fae59
2 changed files with 14 additions and 2 deletions
|
@ -749,7 +749,9 @@ function createSampleTypeSelect(data, selected) {
|
|||
var $selectType = $('<select></select>')
|
||||
.attr('name', 'sample_type_id').addClass('show-tick');
|
||||
|
||||
var $option = $("<option href='/organizations/1/sample_types'></option>")
|
||||
var sampleTypesLink = $('#samples').attr('data-sample-types-link');
|
||||
|
||||
var $option = $("<option href='" + sampleTypesLink + "'></option>")
|
||||
.attr('value', -2)
|
||||
.text(I18n.t('samples.table.add_sample_type'));
|
||||
$selectType.append($option);
|
||||
|
@ -777,7 +779,9 @@ function createSampleGroupSelect(data, selected) {
|
|||
var $selectGroup = $('<select></select>')
|
||||
.attr('name', 'sample_group_id').addClass('show-tick');
|
||||
|
||||
var $option = $("<option href='/organizations/1/sample_groups'></option>")
|
||||
var sampleGroupsLink = $('#samples').attr('data-sample-groups-link');
|
||||
|
||||
var $option = $("<option href='" + sampleGroupsLink + "'></option>")
|
||||
.text(I18n.t('samples.table.add_sample_group'));
|
||||
$selectGroup.append($option);
|
||||
$option = $('<option></option>')
|
||||
|
|
|
@ -129,6 +129,14 @@
|
|||
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)) %>"
|
||||
>
|
||||
<thead>
|
||||
<tr>
|
||||
|
|
Loading…
Reference in a new issue