Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
G
Géocontrib Frontend
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Redmine
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Terraform modules
Analyze
Contributor 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
GéoContrib
Géocontrib Frontend
Commits
e2c02cf3
Commit
e2c02cf3
authored
3 years ago
by
Timothee P
Browse files
Options
Downloads
Patches
Plain Diff
Fix filename
parent
a63a2457
No related branches found
Branches containing commit
No related tags found
Tags containing commit
2 merge requests
!213
2.3.2-rc1
,
!203
REDMINE_ISSUE-12652
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/views/feature/Feature_detail.vue
+15
-15
15 additions, 15 deletions
src/views/feature/Feature_detail.vue
with
15 additions
and
15 deletions
src/views/feature/Feature_detail.vue
+
15
−
15
View file @
e2c02cf3
...
...
@@ -369,7 +369,6 @@ export default {
errors
:
null
,
title
:
""
,
file
:
null
,
type
:
""
,
},
comment
:
{
id_for_label
:
"
add-comment
"
,
...
...
@@ -478,9 +477,9 @@ export default {
.
postCommentAttachment
({
featureId
:
this
.
$route
.
params
.
slug_signal
,
file
:
this
.
comment_form
.
attachment_file
.
file
,
fileName
:
this
.
comment_form
.
attachment_file
.
title
,
commentId
:
response
.
data
.
id
,
fileName
:
this
.
comment_form
.
attachment_file
.
fileName
,
title
:
this
.
comment_form
.
attachment_file
.
title
,
commentId
:
response
.
data
.
id
,
})
.
then
(()
=>
{
this
.
confirmComment
();
...
...
@@ -496,7 +495,8 @@ export default {
this
.
$store
.
commit
(
"
DISPLAY_MESSAGE
"
,
"
Ajout du commentaire confirmé
"
);
this
.
getFeatureEvents
();
//* display new comment on the page
this
.
comment_form
.
attachment_file
.
file
=
null
;
this
.
comment_form
.
attachment_file
.
title
=
null
;
this
.
comment_form
.
attachment_file
.
fileName
=
""
;
this
.
comment_form
.
attachment_file
.
title
=
""
;
this
.
comment_form
.
comment
.
value
=
null
;
},
...
...
@@ -518,19 +518,19 @@ export default {
// * read image file
const
files
=
e
.
target
.
files
||
e
.
dataTransfer
.
files
;
const
_this
=
this
;
//* 'this' is different in onload function
function
handleFile
(
isValid
)
{
const
handleFile
=
(
isValid
)
=>
{
if
(
isValid
)
{
const
period
=
files
[
0
].
name
.
lastIndexOf
(
"
.
"
);
const
fileName
=
files
[
0
].
name
.
substring
(
0
,
period
);
const
fileExtension
=
files
[
0
].
name
.
substring
(
period
+
1
);
const
shortName
=
fileName
.
slice
(
0
,
10
)
+
"
[...].
"
+
fileExtension
;
_this
.
comment_form
.
attachment_file
.
file
=
files
[
0
];
//* store the file to post later
_this
.
comment_form
.
attachment_file
.
type
=
fileExtension
;
//* for adding to fileName
_this
.
comment_form
.
attachment_file
.
title
=
shortName
;
//* for display
_this
.
comment_form
.
attachment_file
.
errors
=
null
;
this
.
comment_form
.
attachment_file
.
file
=
files
[
0
];
//* store the file to post afterwards
let
title
=
files
[
0
].
name
this
.
comment_form
.
attachment_file
.
fileName
=
title
;
//* name of the file
const
fileExtension
=
title
.
substring
(
title
.
lastIndexOf
(
"
.
"
)
+
1
);
if
((
title
.
length
-
fileExtension
.
length
)
>
11
)
{
title
=
title
.
slice
(
0
,
10
)
+
"
[...].
"
+
fileExtension
;
}
this
.
comment_form
.
attachment_file
.
title
=
title
;
//* title for display
this
.
comment_form
.
attachment_file
.
errors
=
null
;
}
else
{
_
this
.
comment_form
.
attachment_file
.
errors
=
this
.
comment_form
.
attachment_file
.
errors
=
"
Transférez une image valide. Le fichier que vous avez transféré n'est pas une image, ou il est corrompu.
"
;
}
}
...
...
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