Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
X
xpub-epmc
Manage
Activity
Members
Labels
Plan
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Deploy
Releases
Package Registry
Container Registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Insights
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Literature-services
public-projects
xpub-epmc
Merge requests
!502
hotfix fo DEV_JAN_24 replease
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
hotfix fo DEV_JAN_24 replease
dev
into
master
Overview
0
Commits
1
Pipelines
0
Changes
1
Merged
Lijun Xing
requested to merge
dev
into
master
10 months ago
Overview
0
Commits
1
Pipelines
0
Changes
1
Expand
Fixed #1369
0
0
Merge request reports
Compare
master
master (base)
and
latest version
latest version
68b07a82
1 commit,
10 months ago
1 file
+
1
−
28
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
app/components/upload-files/UploadFileListItem.jsx
+
1
−
28
Options
@@ -193,45 +193,19 @@ class UploadFileListItem extends React.Component {
type
:
this
.
props
.
file
.
type
?
this
.
props
.
file
.
type
:
''
,
loading
:
false
,
tooLong
:
false
,
isCopy
:
false
,
}
componentDidMount
()
{
this
.
_mounted
=
true
this
.
setState
({
label
:
this
.
props
.
file
.
label
||
''
})
}
componentWillUnmount
()
{
this
.
_mounted
=
false
}
checkLabel
=
e
=>
{
if
(
this
.
_mounted
)
{
const
{
files
:
allFiles
,
file
:
{
id
,
type
},
}
=
this
.
props
const
{
files
}
=
allFiles
.
find
(
t
=>
t
.
value
===
type
)
const
{
value
}
=
e
.
target
const
{
length
}
=
value
e
.
target
.
setSelectionRange
(
length
,
length
)
if
(
length
>
100
)
{
this
.
setState
({
tooLong
:
true
})
}
else
if
(
files
.
some
(
f
=>
f
.
id
!==
id
&&
f
.
label
===
value
))
{
this
.
setState
({
isCopy
:
true
})
}
else
{
this
.
setState
({
tooLong
:
false
,
isCopy
:
false
})
this
.
props
.
setLabel
(
value
)
}
}
}
static
contextType
=
UserContext
render
()
{
const
currentUser
=
this
.
context
const
{
label
,
type
,
loading
,
tooLong
,
isCopy
}
=
this
.
state
const
{
label
,
type
,
loading
,
tooLong
}
=
this
.
state
const
{
types
,
file
,
manuscript
,
pdfSend
,
setNotification
}
=
this
.
props
const
invalid
=
!
file
.
label
||
tooLong
||
isCopy
const
invalidProps
=
{
invalidTest
:
invalid
}
if
(
invalid
)
invalidProps
[
'
data-error
'
]
=
true
return
(
<
Mutation
awaitRefetchQueries
@@ -365,7 +339,6 @@ class UploadFileListItem extends React.Component {
const
obj
=
{}
obj
[
key
]
=
val
if
(
this
.
_mounted
)
{
this
.
checkLabel
()
if
(
key
===
'
label
'
&&
val
.
length
>
100
)
{
this
.
setState
({
tooLong
:
true
})
}
else
{