Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
data-portal
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
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
ICAT
data-portal
Commits
a1fb0394
Commit
a1fb0394
authored
1 week ago
by
Marjolaine Bodin
Browse files
Options
Downloads
Patches
Plain Diff
#843
add multiple references
parent
0a0791d0
No related branches found
No related tags found
1 merge request
!742
Resolve "DOI add multiple reference URLs"
Pipeline
#231193
passed
1 week ago
Stage: validate
Stage: build
Stage: test
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
apps/portal/src/components/mint/MintDOIModal.tsx
+16
-12
16 additions, 12 deletions
apps/portal/src/components/mint/MintDOIModal.tsx
apps/portal/src/components/mint/MintDOIPanel.tsx
+27
-14
27 additions, 14 deletions
apps/portal/src/components/mint/MintDOIPanel.tsx
with
43 additions
and
26 deletions
apps/portal/src/components/mint/MintDOIModal.tsx
+
16
−
12
View file @
a1fb0394
...
@@ -117,19 +117,23 @@ export function MintDOIModal({
...
@@ -117,19 +117,23 @@ export function MintDOIModal({
</
div
>
</
div
>
</
li
>
</
li
>
)
}
)
}
{
data
.
referenceURL
&&
(
{
data
.
referenceURL
s
&&
(
<
li
className
=
"p-2"
>
<
li
className
=
"p-2"
>
<
strong
>
Reference URL
</
strong
>
: Check that the external
<
strong
>
Reference URLs
</
strong
>
: : Check that the external
reference URL is correct.
reference URLs are correct.
<
div
className
=
"fst-italic"
>
<
ul
className
=
"fst-italic"
>
<
a
{
data
.
referenceURLs
.
map
((
referenceURL
:
any
,
index
:
any
)
=>
(
href
=
{
data
.
referenceURL
}
<
li
key
=
{
`reference-
${
index
}
`
}
>
target
=
{
'
_blank
'
}
<
a
rel
=
"noreferrer"
href
=
{
referenceURL
}
>
target
=
{
'
_blank
'
}
{
data
.
referenceURL
}
rel
=
"noreferrer"
</
a
>
>
</
div
>
{
referenceURL
}
</
a
>
</
li
>
))
}
</
ul
>
</
li
>
</
li
>
)
}
)
}
</
ul
>
</
ul
>
...
...
This diff is collapsed.
Click to expand it.
apps/portal/src/components/mint/MintDOIPanel.tsx
+
27
−
14
View file @
a1fb0394
...
@@ -109,7 +109,7 @@ type FormType = {
...
@@ -109,7 +109,7 @@ type FormType = {
}[];
}[];
keywords
?:
{
keyword
:
string
}[];
keywords
?:
{
keyword
:
string
}[];
citationPublicationDOI
?:
string
;
citationPublicationDOI
?:
string
;
referenceURL
?:
string
;
referenceURL
s
?:
{
referenceURL
:
string
}[]
;
};
};
function
FormSection
({
function
FormSection
({
...
@@ -252,20 +252,30 @@ function FormSection({
...
@@ -252,20 +252,30 @@ function FormSection({
return
undefined
;
return
undefined
;
},
},
},
},
referenceURL
:
{
referenceURLs
:
{
type
:
'
url
'
,
type
:
'
array
'
,
label
:
'
External reference URL (PDB,...)
'
,
label
:
'
External reference URLs (PDB,...)
'
,
validate
:
(
value
?:
string
)
=>
{
item
:
{
if
(
value
===
undefined
||
!
value
?.
length
)
{
referenceURL
:
(
v
)
=>
({
return
undefined
;
type
:
'
url
'
,
}
label
:
'
Reference URL
'
,
try
{
required
:
true
,
new
URL
(
value
);
validate
:
(
value
?:
string
)
=>
{
return
undefined
;
if
(
value
===
undefined
||
!
value
?.
length
)
{
}
catch
{
return
undefined
;
return
'
Invalid URL
'
;
}
}
try
{
new
URL
(
value
);
return
undefined
;
}
catch
{
return
'
Invalid URL
'
;
}
},
}),
},
},
newItem
:
()
=>
({
referenceURL
:
''
,
}),
},
},
};
};
...
@@ -338,6 +348,9 @@ function FormSection({
...
@@ -338,6 +348,9 @@ function FormSection({
keywords
:
data
.
keywords
?.
map
((
k
)
=>
{
keywords
:
data
.
keywords
?.
map
((
k
)
=>
{
return
k
.
keyword
;
return
k
.
keyword
;
}),
}),
referenceURLs
:
data
.
referenceURLs
?.
map
((
url
)
=>
{
return
url
.
referenceURL
;
}),
};
};
handleClick
({
...
postData
},
clearForm
,
onErrorCallBack
);
handleClick
({
...
postData
},
clearForm
,
onErrorCallBack
);
}
}
}
}
...
...
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