Skip to content

Commit ae98e32

Browse files
committed
#2261 fix ui component by doi links
1 parent 4e56609 commit ae98e32

File tree

4 files changed

+22
-7
lines changed

4 files changed

+22
-7
lines changed

Console/BExIS.Web.Shell/Areas/DDM/BExIS.Modules.Ddm.UI/Views/Data/_labelsView.cshtml

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,22 @@
33
<div class="publication-container">
44
@foreach (var label in Model)
55
{
6-
if (@label.Value == "template")
6+
7+
if (label.Value == "template")
78
{
89
<a href="" class="label label-info">@label.Key</a>
910
}
10-
else
11+
else if(label.Value.ToLower() == "doi")
1112
{
12-
<a href="@label.Key" class="label label-success">@label.Value: @label.Key</a>
13-
}
14-
13+
string displayName = label.Key;
14+
if (label.Key.StartsWith("http"))
15+
{
16+
string[] parts = label.Key.Split('/');
17+
displayName = string.Join("/", parts.Skip(parts.Length - 2));
18+
}
1519

20+
<a href="@label.Key" class="label label-success">@label.Value: @displayName</a>
21+
}
1622
}
1723

1824
</div>

Console/BExIS.Web.Shell/Areas/DIM/BExIS.Modules.Dim.UI/Controllers/GbifController.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
using System.Web;
2222
using System.Web.Mvc;
2323
using Vaiona.Web.Mvc.Modularity;
24+
using static System.Net.WebRequestMethods;
2425

2526
namespace BExIS.Modules.Dim.UI.Controllers
2627
{
@@ -125,7 +126,7 @@ public async Task<JsonResult> RegisterDataset(long publicationId)
125126
publication.Status = PublicationStatus.Registered.ToString();
126127
publication.FilePath = downloadPath;
127128
publication.Response = result.Replace('\"', ' ').Trim();
128-
publication.ExternalLink = doi;
129+
publication.ExternalLink = "https://doi.org/"+doi;
129130
publication.ExternalLinkType = "DOI";
130131
publicationManager.UpdatePublication(publication);
131132

Console/Workspace

database update scripts/4.1.0-4.2.0.sql

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
BEGIN TRANSACTION;
22

3+
-- change all doi entries from 10.21373/vmy64f -> https://doi.org/10.21373/vmy64f
4+
UPDATE dim_publications
5+
SET externallink = 'https://doi.org/' || externallink
6+
WHERE
7+
externallinktype='DOI' and
8+
externallink NOT LIKE 'http%';
9+
10+
311
ALTER TABLE public.dim_linkelements
412
ALTER COLUMN xpath TYPE text COLLATE pg_catalog."default";
513

0 commit comments

Comments
 (0)