Skip to content
Snippets Groups Projects
Commit 620e67ae authored by moon's avatar moon
Browse files

Close #35: Gene name "null" issue

parent 38422d8c
No related branches found
No related tags found
No related merge requests found
......@@ -62,15 +62,33 @@
});
const proteinColumns = [
{
title: 'Uniprot',
data: 'uniprot_id',
// visible: false,
// fnCreatedCell: (nTd, sData, oData) => {
// $(nTd).html(`<a href="" class="detail-link gene"><i class="glyphicon glyphicon-list-alt"></i> </a>`);
// },
// render: function ( data, type, row, meta ) {
// return data + ' (' + row.uniprot_readable_id + ')';
// }
fnCreatedCell: (nTd, sData, oData) => {
let n = `${oData.uniprot_id} (${oData.uniprot_readable_id})`;
if(vm.keyword) {
n.replace(new RegExp(vm.keyword, 'gi'), `<mark>$&</mark>`);
}
$(nTd).html(`<a href="" class="detail-link"> ${n}</a>`);
},
},
{
title: 'Gene Name',
data: 'gene_name',
fnCreatedCell: (nTd, sData, oData) => {
let n = `${oData.gene_name}`;
let n = `${oData.gene_name ? oData.gene_name : 'N/A'}`;
if(vm.keyword) {
n = n.replace(new RegExp(vm.keyword, 'gi'), `<mark>$&</mark>`);
}
$(nTd).html(`<a href="" class="detail-link"> ${n}</a>`);
$(nTd).html(`${n}`);
},
},
{
......@@ -98,24 +116,6 @@
return data + ' (' + row.species_tax_id + ')';
}
},
{
title: 'Uniprot',
data: 'uniprot_id',
// visible: false,
// fnCreatedCell: (nTd, sData, oData) => {
// $(nTd).html(`<a href="" class="detail-link gene"><i class="glyphicon glyphicon-list-alt"></i> </a>`);
// },
// render: function ( data, type, row, meta ) {
// return data + ' (' + row.uniprot_readable_id + ')';
// }
fnCreatedCell: (nTd, sData, oData) => {
let n = `${oData.uniprot_id} (${oData.uniprot_readable_id})`;
if(vm.keyword) {
n.replace(new RegExp(vm.keyword, 'gi'), `<mark>$&</mark>`);
}
$(nTd).html(`${n}`);
},
},
// {
// title: 'Evidence Stars',
// className: "text-nowrap",
......
......@@ -67,6 +67,7 @@
const url = `/protein/${uniprot_id}`
// // eslint-disable-next-line
// console.log(url)
// this.$router.push(url)
window.open(url)
},
forwardUniprot(uniprot_id) {
......@@ -118,6 +119,14 @@
});
const columns = vm.isExperimental ? [
{
title: 'UniProt',
data: 'uniprot_id',
className: "text-nowrap",
fnCreatedCell: (nTd, sData, oData) => {
$(nTd).html(`<a href="" class="protein-link"> ${sData} </a>`);
},
},
{
title: 'Gene Name',
data: 'gene_name',
......@@ -125,7 +134,7 @@
if (sData) {
$(nTd).html(`<a href="" class="protein-link"> ${sData}</a>`);
} else {
$(nTd).html(`<a href="" class="protein-link"> ${oData.uniprot_id}</a>`);
$(nTd).html(`<a href="" class="protein-link"> N/A</a>`);
}
},
},
......@@ -205,15 +214,6 @@
return '';
}
},
{
title: 'UniProt',
data: 'uniprot_id',
className: "text-nowrap",
fnCreatedCell: (nTd, sData, oData) => {
$(nTd).html(`<a href="" class="uniprot-link tooltipped tooltipped-n tooltipped-multiline"
aria-label="Clicking this link opens UniProt page."> ${sData} <i class="glyphicon glyphicon-link"></i></a>`);
},
},
// {
// title: 'Evidence',
// data: 'uniprot_id',
......@@ -253,6 +253,14 @@
}
] :
[
{
title: 'UniProt',
data: 'uniprot_id',
className: "text-nowrap",
fnCreatedCell: (nTd, sData, oData) => {
$(nTd).html(`<a href="" class="protein-link"> ${sData} </a>`);
},
},
{
title: 'Gene Name',
data: 'gene_name',
......@@ -260,7 +268,7 @@
if (sData) {
$(nTd).html(`<a href="" class="protein-link"> ${sData}</a>`);
} else {
$(nTd).html(`<a href="" class="protein-link"> ${oData.uniprot_id}</a>`);
$(nTd).html(`<a href="" class="protein-link"> N/A</a>`);
}
},
},
......@@ -336,15 +344,6 @@
return '';
}
},
{
title: 'UniProt',
data: 'uniprot_id',
className: "text-nowrap",
fnCreatedCell: (nTd, sData, oData) => {
$(nTd).html(`<a href="" class="uniprot-link tooltipped tooltipped-n tooltipped-multiline"
aria-label="Clicking this link opens UniProt page."> ${sData} <i class="glyphicon glyphicon-link"></i></a>`);
},
},
// {
// title: 'Evidence',
// data: 'uniprot_id',
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment