Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
c164a615
Commit
c164a615
authored
Aug 11, 2021
by
Samantha Ming
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move value to constants
parent
523cb9df
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
5 deletions
+7
-5
app/assets/javascripts/repository/components/delete_blob_modal.vue
...s/javascripts/repository/components/delete_blob_modal.vue
+4
-5
app/assets/javascripts/repository/constants.js
app/assets/javascripts/repository/constants.js
+3
-0
No files found.
app/assets/javascripts/repository/components/delete_blob_modal.vue
View file @
c164a615
...
...
@@ -8,6 +8,8 @@ import {
COMMIT_LABEL
,
TARGET_BRANCH_LABEL
,
TOGGLE_CREATE_MR_LABEL
,
COMMIT_MESSAGE_SUBJECT_MAX_LENGTH
,
COMMIT_MESSAGE_BODY_MAX_LENGTH
,
}
from
'
../constants
'
;
const
initFormField
=
({
value
,
required
=
true
,
skipValidation
=
false
})
=>
({
...
...
@@ -122,19 +124,16 @@ export default {
return
this
.
form
.
fields
[
'
commit_message
'
].
value
&&
this
.
form
.
fields
[
'
branch_name
'
].
value
;
},
showHint
()
{
const
commitMessageSubjectMaxLength
=
52
;
const
commitMessageBodyMaxLength
=
72
;
const
splitCommitMessageByLineBreak
=
this
.
form
.
fields
[
'
commit_message
'
].
value
.
trim
()
.
split
(
'
\n
'
);
const
[
firstLine
,
...
otherLines
]
=
splitCommitMessageByLineBreak
;
const
hasFirstLineExceedMaxLength
=
firstLine
.
length
>
commitMessageSubjectMaxLength
;
const
hasFirstLineExceedMaxLength
=
firstLine
.
length
>
COMMIT_MESSAGE_SUBJECT_MAX_LENGTH
;
const
hasOtherLineExceedMaxLength
=
Boolean
(
otherLines
.
length
)
&&
otherLines
.
some
((
text
)
=>
text
.
length
>
commitMessageBodyMaxLength
);
otherLines
.
some
((
text
)
=>
text
.
length
>
COMMIT_MESSAGE_BODY_MAX_LENGTH
);
return
(
!
this
.
form
.
fields
[
'
commit_message
'
].
feedback
&&
...
...
app/assets/javascripts/repository/constants.js
View file @
c164a615
...
...
@@ -8,3 +8,6 @@ export const SECONDARY_OPTIONS_TEXT = __('Cancel');
export
const
COMMIT_LABEL
=
__
(
'
Commit message
'
);
export
const
TARGET_BRANCH_LABEL
=
__
(
'
Target branch
'
);
export
const
TOGGLE_CREATE_MR_LABEL
=
__
(
'
Start a new merge request with these changes
'
);
export
const
COMMIT_MESSAGE_SUBJECT_MAX_LENGTH
=
52
;
export
const
COMMIT_MESSAGE_BODY_MAX_LENGTH
=
72
;
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment