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
0
Merge Requests
0
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
Léo-Paul Géneau
gitlab-ce
Commits
c51a9306
Commit
c51a9306
authored
Apr 06, 2018
by
Phil Hughes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
updates to template text to be i18n ready
parent
2aaa0222
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
35 additions
and
27 deletions
+35
-27
app/assets/javascripts/ide/components/changed_file_icon.vue
app/assets/javascripts/ide/components/changed_file_icon.vue
+10
-3
app/assets/javascripts/ide/components/commit_sidebar/list.vue
...assets/javascripts/ide/components/commit_sidebar/list.vue
+13
-7
app/assets/javascripts/ide/components/commit_sidebar/list_collapsed.vue
...ascripts/ide/components/commit_sidebar/list_collapsed.vue
+6
-15
app/assets/javascripts/ide/stores/getters.js
app/assets/javascripts/ide/stores/getters.js
+3
-1
app/assets/javascripts/ide/stores/modules/commit/getters.js
app/assets/javascripts/ide/stores/modules/commit/getters.js
+3
-1
No files found.
app/assets/javascripts/ide/components/changed_file_icon.vue
View file @
c51a9306
...
@@ -2,6 +2,7 @@
...
@@ -2,6 +2,7 @@
import
tooltip
from
'
~/vue_shared/directives/tooltip
'
;
import
tooltip
from
'
~/vue_shared/directives/tooltip
'
;
import
icon
from
'
~/vue_shared/components/icon.vue
'
;
import
icon
from
'
~/vue_shared/components/icon.vue
'
;
import
{
pluralize
}
from
'
~/lib/utils/text_utility
'
;
import
{
pluralize
}
from
'
~/lib/utils/text_utility
'
;
import
{
__
,
sprintf
}
from
'
~/locale
'
;
export
default
{
export
default
{
components
:
{
components
:
{
...
@@ -34,11 +35,17 @@ export default {
...
@@ -34,11 +35,17 @@ export default {
const
type
=
this
.
file
.
tempFile
?
'
addition
'
:
'
modification
'
;
const
type
=
this
.
file
.
tempFile
?
'
addition
'
:
'
modification
'
;
if
(
this
.
file
.
changed
&&
!
this
.
file
.
staged
)
{
if
(
this
.
file
.
changed
&&
!
this
.
file
.
staged
)
{
return
`Unstaged
${
type
}
`
;
return
sprintf
(
__
(
'
Unstaged %{type}
'
),
{
type
,
});
}
else
if
(
!
this
.
file
.
changed
&&
this
.
file
.
staged
)
{
}
else
if
(
!
this
.
file
.
changed
&&
this
.
file
.
staged
)
{
return
`Staged
${
type
}
`
;
return
sprintf
(
__
(
'
Staged %{type}
'
),
{
type
,
});
}
else
if
(
this
.
file
.
changed
&&
this
.
file
.
staged
)
{
}
else
if
(
this
.
file
.
changed
&&
this
.
file
.
staged
)
{
return
`Unstaged and staged
${
pluralize
(
type
)}
`
;
return
sprintf
(
__
(
'
Unstaged and staged %{type}
'
),
{
type
:
pluralize
(
type
),
});
}
}
return
undefined
;
return
undefined
;
...
...
app/assets/javascripts/ide/components/commit_sidebar/list.vue
View file @
c51a9306
<
script
>
<
script
>
import
{
mapActions
,
mapState
,
mapGetters
}
from
'
vuex
'
;
import
{
mapActions
,
mapState
,
mapGetters
}
from
'
vuex
'
;
import
i
con
from
'
~/vue_shared/components/icon.vue
'
;
import
I
con
from
'
~/vue_shared/components/icon.vue
'
;
import
tooltip
from
'
~/vue_shared/directives/tooltip
'
;
import
tooltip
from
'
~/vue_shared/directives/tooltip
'
;
import
listItem
from
'
./list_item.vue
'
;
import
ListItem
from
'
./list_item.vue
'
;
import
listCollapsed
from
'
./list_collapsed.vue
'
;
import
ListCollapsed
from
'
./list_collapsed.vue
'
;
import
{
__
,
sprintf
}
from
'
~/locale
'
;
export
default
{
export
default
{
components
:
{
components
:
{
i
con
,
I
con
,
l
istItem
,
L
istItem
,
l
istCollapsed
,
L
istCollapsed
,
},
},
directives
:
{
directives
:
{
tooltip
,
tooltip
,
...
@@ -48,6 +49,11 @@ export default {
...
@@ -48,6 +49,11 @@ export default {
computed
:
{
computed
:
{
...
mapState
([
'
rightPanelCollapsed
'
]),
...
mapState
([
'
rightPanelCollapsed
'
]),
...
mapGetters
([
'
collapseButtonIcon
'
,
'
collapseButtonTooltip
'
]),
...
mapGetters
([
'
collapseButtonIcon
'
,
'
collapseButtonTooltip
'
]),
titleText
()
{
return
sprintf
(
__
(
'
%{title} changes
'
),
{
title
:
this
.
title
,
});
},
},
},
methods
:
{
methods
:
{
...
mapActions
([
'
toggleRightPanelCollapsed
'
,
'
stageAllChanges
'
,
'
unstageAllChanges
'
]),
...
mapActions
([
'
toggleRightPanelCollapsed
'
,
'
stageAllChanges
'
,
'
unstageAllChanges
'
]),
...
@@ -83,7 +89,7 @@ export default {
...
@@ -83,7 +89,7 @@ export default {
:name=
"icon"
:name=
"icon"
:size=
"18"
:size=
"18"
/>
/>
{{
title
}}
changes
{{
title
Text
}}
<button
<button
type=
"button"
type=
"button"
class=
"btn btn-blank btn-link ide-staged-action-btn"
class=
"btn btn-blank btn-link ide-staged-action-btn"
...
...
app/assets/javascripts/ide/components/commit_sidebar/list_collapsed.vue
View file @
c51a9306
<
script
>
<
script
>
import
icon
from
'
~/vue_shared/components/icon.vue
'
;
import
icon
from
'
~/vue_shared/components/icon.vue
'
;
import
tooltip
from
'
~/vue_shared/directives/tooltip
'
;
import
tooltip
from
'
~/vue_shared/directives/tooltip
'
;
import
{
sprintf
,
n__
}
from
'
~/locale
'
;
import
{
sprintf
,
n__
,
__
}
from
'
~/locale
'
;
export
default
{
export
default
{
components
:
{
components
:
{
...
@@ -38,27 +38,18 @@ export default {
...
@@ -38,27 +38,18 @@ export default {
return
this
.
modifiedFilesLength
?
'
multi-file-modified
'
:
''
;
return
this
.
modifiedFilesLength
?
'
multi-file-modified
'
:
''
;
},
},
additionsTooltip
()
{
additionsTooltip
()
{
return
sprintf
(
return
sprintf
(
n__
(
'
1 %{type} addition
'
,
'
%d %{type} additions
'
,
this
.
addedFilesLength
),
{
n__
(
type
:
this
.
title
.
toLowerCase
(),
'
1 %{type} addition
'
,
});
'
%d %{type} additions
'
,
this
.
addedFilesLength
,
),
{
type
:
this
.
title
.
toLowerCase
()
},
);
},
},
modifiedTooltip
()
{
modifiedTooltip
()
{
return
sprintf
(
return
sprintf
(
n__
(
n__
(
'
1 %{type} modification
'
,
'
%d %{type} modifications
'
,
this
.
modifiedFilesLength
),
'
1 %{type} modification
'
,
'
%d %{type} modifications
'
,
this
.
modifiedFilesLength
,
),
{
type
:
this
.
title
.
toLowerCase
()
},
{
type
:
this
.
title
.
toLowerCase
()
},
);
);
},
},
titleTooltip
()
{
titleTooltip
()
{
return
`
${
this
.
title
}
changes`
;
return
sprintf
(
__
(
'
%{title} changes
'
),
{
title
:
this
.
title
})
;
},
},
},
},
};
};
...
...
app/assets/javascripts/ide/stores/getters.js
View file @
c51a9306
import
{
__
}
from
'
~/locale
'
;
export
const
activeFile
=
state
=>
state
.
openFiles
.
find
(
file
=>
file
.
active
)
||
null
;
export
const
activeFile
=
state
=>
state
.
openFiles
.
find
(
file
=>
file
.
active
)
||
null
;
export
const
addedFiles
=
state
=>
state
.
changedFiles
.
filter
(
f
=>
f
.
tempFile
);
export
const
addedFiles
=
state
=>
state
.
changedFiles
.
filter
(
f
=>
f
.
tempFile
);
...
@@ -36,6 +38,6 @@ export const hasChanges = state => !!state.changedFiles.length || !!state.staged
...
@@ -36,6 +38,6 @@ export const hasChanges = state => !!state.changedFiles.length || !!state.staged
// eslint-disable-next-line no-confusing-arrow
// eslint-disable-next-line no-confusing-arrow
export
const
collapseButtonTooltip
=
state
=>
export
const
collapseButtonTooltip
=
state
=>
state
.
rightPanelCollapsed
?
'
Expand sidebar
'
:
'
Collapse sidebar
'
;
state
.
rightPanelCollapsed
?
__
(
'
Expand sidebar
'
)
:
__
(
'
Collapse sidebar
'
)
;
export
const
hasMergeRequest
=
state
=>
!!
state
.
currentMergeRequestId
;
export
const
hasMergeRequest
=
state
=>
!!
state
.
currentMergeRequestId
;
app/assets/javascripts/ide/stores/modules/commit/getters.js
View file @
c51a9306
import
*
as
consts
from
'
./constants
'
;
import
*
as
consts
from
'
./constants
'
;
const
BRANCH_SUFFIX_COUNT
=
5
;
export
const
discardDraftButtonDisabled
=
state
=>
export
const
discardDraftButtonDisabled
=
state
=>
state
.
commitMessage
===
''
||
state
.
submitCommitLoading
;
state
.
commitMessage
===
''
||
state
.
submitCommitLoading
;
...
@@ -8,7 +10,7 @@ export const commitButtonDisabled = (state, getters, rootState) =>
...
@@ -8,7 +10,7 @@ export const commitButtonDisabled = (state, getters, rootState) =>
export
const
newBranchName
=
(
state
,
_
,
rootState
)
=>
export
const
newBranchName
=
(
state
,
_
,
rootState
)
=>
`
${
gon
.
current_username
}
-
${
rootState
.
currentBranchId
}
-patch-
${
`
${
new
Date
().
getTime
()}
`
.
substr
(
`
${
gon
.
current_username
}
-
${
rootState
.
currentBranchId
}
-patch-
${
`
${
new
Date
().
getTime
()}
`
.
substr
(
-
5
,
-
BRANCH_SUFFIX_COUNT
,
)}
`
;
)}
`
;
export
const
branchName
=
(
state
,
getters
,
rootState
)
=>
{
export
const
branchName
=
(
state
,
getters
,
rootState
)
=>
{
...
...
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