Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
core
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Requirements
External wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
minerva
core
Commits
e1700608
Commit
e1700608
authored
7 years ago
by
Piotr Gawron
Browse files
Options
Downloads
Patches
Plain Diff
link on element provides to search results on the map
parent
05a1b6c1
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!99
Resolve "Link from literature file to the related reaction in the map does not work"
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
frontend-js/src/main/js/gui/leftPanel/PublicationListDialog.js
+56
-45
56 additions, 45 deletions
...end-js/src/main/js/gui/leftPanel/PublicationListDialog.js
with
56 additions
and
45 deletions
frontend-js/src/main/js/gui/leftPanel/PublicationListDialog.js
+
56
−
45
View file @
e1700608
...
...
@@ -64,51 +64,62 @@ PublicationListDialog.prototype._dataTableAjaxCall = function(data, callback) {
sortColumn
:
self
.
getColumnsDefinition
()[
data
.
order
[
0
].
column
].
name
,
sortOrder
:
data
.
order
[
0
].
dir
,
search
:
data
.
search
.
value
,
})
.
then
(
function
(
publicationList
)
{
var
out
=
[];
var
allElements
=
[];
for
(
var
i
=
0
;
i
<
publicationList
.
data
.
length
;
i
++
)
{
var
publication
=
publicationList
.
data
[
i
].
publication
.
article
;
var
elements
=
publicationList
.
data
[
i
].
elements
;
var
row
=
[];
row
[
0
]
=
"
<a href='
"
+
publication
.
link
+
"
'>
"
+
publication
.
id
+
"
</a>
"
;
row
[
1
]
=
publication
.
title
;
row
[
2
]
=
publication
.
authors
.
join
();
row
[
3
]
=
publication
.
journal
;
row
[
4
]
=
publication
.
year
;
row
[
5
]
=
"
<div>
"
;
for
(
var
j
=
0
;
j
<
elements
.
length
;
j
++
)
{
row
[
5
]
+=
"
<a name='
"
+
elements
[
j
].
id
+
"
' href='#'>
"
+
elements
[
j
].
type
+
"
:
"
+
elements
[
j
].
id
+
"
</a>,
"
;
allElements
.
push
(
new
IdentifiedElement
(
elements
[
j
]));
}
row
[
5
]
+=
"
</div>
"
;
out
.
push
(
row
);
}
callback
({
draw
:
data
.
draw
,
recordsTotal
:
publicationList
.
totalSize
,
recordsFiltered
:
publicationList
.
filteredSize
,
data
:
out
,
});
var
promises
=
[];
allElements
.
forEach
(
function
(
element
)
{
promises
.
push
(
self
.
getMap
().
getSubmapById
(
element
.
getModelId
()).
getModel
().
getByIdentifiedElement
(
element
,
true
).
then
(
function
(
elementData
)
{
var
name
=
null
;
if
(
elementData
instanceof
Alias
)
{
name
=
elementData
.
getName
();
}
else
if
(
elementData
instanceof
Reaction
)
{
name
=
elementData
.
getReactionId
();
}
$
(
"
a[name=
"
+
elementData
.
getId
()
+
"
]
"
,
$
(
self
.
getElement
())).
html
(
name
);
}));
});
return
Promise
.
all
(
promises
);
});
}).
then
(
function
(
publicationList
)
{
var
out
=
[];
var
allElements
=
[];
for
(
var
i
=
0
;
i
<
publicationList
.
data
.
length
;
i
++
)
{
var
publication
=
publicationList
.
data
[
i
].
publication
.
article
;
var
elements
=
publicationList
.
data
[
i
].
elements
;
var
row
=
[];
row
[
0
]
=
"
<a href='
"
+
publication
.
link
+
"
'>
"
+
publication
.
id
+
"
</a>
"
;
row
[
1
]
=
publication
.
title
;
row
[
2
]
=
publication
.
authors
.
join
();
row
[
3
]
=
publication
.
journal
;
row
[
4
]
=
publication
.
year
;
row
[
5
]
=
"
<div>
"
;
for
(
var
j
=
0
;
j
<
elements
.
length
;
j
++
)
{
row
[
5
]
+=
"
<a name='
"
+
elements
[
j
].
id
+
"
' href='#'>
"
+
elements
[
j
].
type
+
"
:
"
+
elements
[
j
].
id
+
"
</a>,
"
;
allElements
.
push
(
new
IdentifiedElement
(
elements
[
j
]));
}
row
[
5
]
+=
"
</div>
"
;
out
.
push
(
row
);
}
callback
({
draw
:
data
.
draw
,
recordsTotal
:
publicationList
.
totalSize
,
recordsFiltered
:
publicationList
.
filteredSize
,
data
:
out
,
});
var
promises
=
[];
allElements
.
forEach
(
function
(
element
)
{
var
model
=
self
.
getMap
().
getSubmapById
(
element
.
getModelId
()).
getModel
();
promises
.
push
(
model
.
getByIdentifiedElement
(
element
,
true
).
then
(
function
(
elementData
)
{
var
name
=
null
;
if
(
elementData
instanceof
Alias
)
{
name
=
elementData
.
getName
();
}
else
if
(
elementData
instanceof
Reaction
)
{
name
=
elementData
.
getReactionId
();
}
$
(
"
a[name=
"
+
elementData
.
getId
()
+
"
]
"
,
$
(
self
.
getElement
())).
html
(
name
);
var
onclick
=
function
()
{
var
searchOverlay
=
self
.
getMap
().
getOverlayByName
(
"
search
"
);
var
query
;
if
(
element
.
getType
()
===
"
ALIAS
"
)
{
query
=
"
element:
"
+
element
.
getId
();
}
else
{
query
=
"
reaction:
"
+
element
.
getId
();
}
self
.
getMap
().
openSubmap
(
elementData
.
getModelId
());
return
searchOverlay
.
searchByQuery
(
query
,
true
,
true
).
then
(
function
()
{
$
(
self
.
getElement
()).
dialog
(
"
close
"
);
}).
then
(
null
,
GuiConnector
.
alert
);
}
$
(
"
a[name=
"
+
elementData
.
getId
()
+
"
]
"
,
$
(
self
.
getElement
())).
click
(
onclick
);
}));
});
return
Promise
.
all
(
promises
);
});
};
PublicationListDialog
.
prototype
.
show
=
function
()
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment