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
e84e4fdd
Commit
e84e4fdd
authored
Feb 20, 2018
by
Phil Hughes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added i18n methods
parent
89f3be09
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
37 additions
and
11 deletions
+37
-11
app/assets/javascripts/ide/components/commit_sidebar/actions.vue
...ets/javascripts/ide/components/commit_sidebar/actions.vue
+20
-3
app/assets/javascripts/ide/components/repo_commit_section.vue
...assets/javascripts/ide/components/repo_commit_section.vue
+1
-1
app/assets/javascripts/ide/stores/modules/commit/actions.js
app/assets/javascripts/ide/stores/modules/commit/actions.js
+16
-7
No files found.
app/assets/javascripts/ide/components/commit_sidebar/actions.vue
View file @
e84e4fdd
<
script
>
import
{
mapState
}
from
'
vuex
'
;
import
{
sprintf
,
__
}
from
'
../../../locale
'
;
import
*
as
consts
from
'
../../stores/modules/commit/constants
'
;
import
RadioGroup
from
'
./radio_group.vue
'
;
...
...
@@ -19,7 +20,23 @@
'
currentBranchId
'
,
]),
newMergeRequestHelpText
()
{
return
`Creates a new branch from
${
this
.
currentBranchId
}
and re-directs to create a new merge request`
;
return
sprintf
(
__
(
`Creates a new branch from %{branchName} and re-directs to create a new merge request`
),
{
branchName
:
this
.
currentBranchId
},
);
},
commitToCurrentBranchText
()
{
return
sprintf
(
__
(
'
Commit to %{branchName} branch
'
),
{
branchName
:
`<strong>
${
this
.
currentBranchId
}
</strong>`
},
false
,
)
},
commitToNewBranchText
()
{
return
sprintf
(
__
(
'
Creates a new branch from %{branchName}
'
),
{
branchName
:
this
.
currentBranchId
},
);
},
},
};
...
...
@@ -32,7 +49,7 @@
:checked=
"true"
>
<span
v-html=
"
`Commit to
<strong>
${currentBranchId}
</strong>
branch`
"
v-html=
"
commitToCurrentBranchText
"
>
</span>
</radio-group>
...
...
@@ -40,7 +57,7 @@
:value=
"COMMIT_TO_NEW_BRANCH"
label=
"Create a new branch"
:show-input=
"true"
:help-text=
"
`Creates a new branch from $
{currentBranchId}`
"
:help-text=
"
commitToNewBranchText
"
/>
<radio-group
:value=
"COMMIT_TO_NEW_BRANCH_MR"
...
...
app/assets/javascripts/ide/components/repo_commit_section.vue
View file @
e84e4fdd
...
...
@@ -113,7 +113,7 @@ export default {
class=
"form-control input-sm multi-file-commit-message"
name=
"commit-message"
:value=
"commitMessage"
placeholder=
"Write a commit message...
"
:placeholder=
"__('Write a commit message...')
"
@
input=
"updateCommitMessage($event.target.value)"
>
</textarea>
...
...
app/assets/javascripts/ide/stores/modules/commit/actions.js
View file @
e84e4fdd
import
{
sprintf
,
__
}
from
'
../../../../locale
'
;
import
*
as
types
from
'
./mutation_types
'
;
import
*
as
consts
from
'
./constants
'
;
import
*
as
rootTypes
from
'
../../mutation_types
'
;
...
...
@@ -25,11 +26,19 @@ export const updateBranchName = ({ commit }, branchName) => {
};
export
const
setLastCommitMessage
=
({
commit
},
data
)
=>
{
let
commitMsg
=
`Your changes have been committed. Commit
${
data
.
short_id
}
`
;
if
(
data
.
stats
)
{
commitMsg
+=
` with
${
data
.
stats
.
additions
}
additions,
${
data
.
stats
.
deletions
}
deletions.`
;
}
const
commitStats
=
data
.
stats
?
sprintf
(
__
(
'
with %{additions} additions, %{deletions} deletions.
'
),
{
additions
:
data
.
stats
.
additions
,
deletions
:
data
.
stats
.
deletions
},
)
:
''
;
const
commitMsg
=
sprintf
(
__
(
'
Your changes have been committed. Commit %{commitId} %{commitStats}
'
),
{
commmitId
:
data
.
short_id
,
commitStats
,
},
);
commit
(
rootTypes
.
SET_LAST_COMMIT_MSG
,
commitMsg
,
{
root
:
true
});
};
...
...
@@ -48,7 +57,7 @@ export const checkCommitStatus = ({ rootState }) =>
return
false
;
})
.
catch
(()
=>
flash
(
'
Error checking branch data. Please try again.
'
,
'
alert
'
,
document
,
null
,
false
,
true
));
.
catch
(()
=>
flash
(
__
(
'
Error checking branch data. Please try again.
'
)
,
'
alert
'
,
document
,
null
,
false
,
true
));
export
const
updateFilesAfterCommit
=
(
{
commit
,
dispatch
,
state
,
rootState
,
rootGetters
},
...
...
@@ -135,7 +144,7 @@ export const commitChanges = ({ commit, state, getters, dispatch, rootState }) =
}
})
.
catch
((
err
)
=>
{
let
errMsg
=
'
Error committing changes. Please try again.
'
;
let
errMsg
=
__
(
'
Error committing changes. Please try again.
'
)
;
if
(
err
.
response
.
data
&&
err
.
response
.
data
.
message
)
{
errMsg
+=
` (
${
stripHtml
(
err
.
response
.
data
.
message
)}
)`
;
}
...
...
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