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
056933ed
Commit
056933ed
authored
Mar 22, 2018
by
Phil Hughes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added tooltips to various icons in the sidebars
fixed SVG colors
parent
4a4caa01
Changes
12
Show whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
246 additions
and
102 deletions
+246
-102
app/assets/javascripts/ide/components/changed_file_icon.vue
app/assets/javascripts/ide/components/changed_file_icon.vue
+53
-22
app/assets/javascripts/ide/components/commit_sidebar/empty_state.vue
...javascripts/ide/components/commit_sidebar/empty_state.vue
+9
-1
app/assets/javascripts/ide/components/commit_sidebar/list.vue
...assets/javascripts/ide/components/commit_sidebar/list.vue
+62
-57
app/assets/javascripts/ide/components/commit_sidebar/list_collapsed.vue
...ascripts/ide/components/commit_sidebar/list_collapsed.vue
+71
-16
app/assets/javascripts/ide/components/commit_sidebar/list_item.vue
...s/javascripts/ide/components/commit_sidebar/list_item.vue
+6
-1
app/assets/javascripts/ide/components/commit_sidebar/stage_button.vue
...avascripts/ide/components/commit_sidebar/stage_button.vue
+12
-2
app/assets/javascripts/ide/components/commit_sidebar/unstage_button.vue
...ascripts/ide/components/commit_sidebar/unstage_button.vue
+8
-1
app/assets/javascripts/ide/components/repo_file.vue
app/assets/javascripts/ide/components/repo_file.vue
+2
-1
app/assets/javascripts/ide/stores/getters.js
app/assets/javascripts/ide/stores/getters.js
+4
-0
app/assets/javascripts/ide/stores/mutations/file.js
app/assets/javascripts/ide/stores/mutations/file.js
+11
-0
app/assets/javascripts/ide/stores/utils.js
app/assets/javascripts/ide/stores/utils.js
+1
-0
app/assets/stylesheets/pages/repo.scss
app/assets/stylesheets/pages/repo.scss
+7
-1
No files found.
app/assets/javascripts/ide/components/changed_file_icon.vue
View file @
056933ed
<
script
>
<
script
>
import
icon
from
'
~/vue_shared/components/icon.vue
'
;
import
tooltip
from
'
~/vue_shared/directives/tooltip
'
;
import
icon
from
'
~/vue_shared/components/icon.vue
'
;
import
{
pluralize
}
from
'
~/lib/utils/text_utility
'
;
export
default
{
export
default
{
components
:
{
components
:
{
icon
,
icon
,
},
},
directives
:
{
tooltip
,
},
props
:
{
props
:
{
file
:
{
file
:
{
type
:
Object
,
type
:
Object
,
required
:
true
,
required
:
true
,
},
},
showTooltip
:
{
type
:
Boolean
,
required
:
false
,
default
:
false
,
},
},
},
computed
:
{
computed
:
{
changedIcon
()
{
changedIcon
()
{
...
@@ -18,14 +28,35 @@
...
@@ -18,14 +28,35 @@
changedIconClass
()
{
changedIconClass
()
{
return
`multi-
${
this
.
changedIcon
}
`
;
return
`multi-
${
this
.
changedIcon
}
`
;
},
},
tooltipTitle
()
{
if
(
!
this
.
showTooltip
)
return
undefined
;
const
type
=
this
.
file
.
tempFile
?
'
addition
'
:
'
modification
'
;
if
(
this
.
file
.
changed
&&
!
this
.
file
.
staged
)
{
return
`unstaged
${
type
}
`
;
}
else
if
(
!
this
.
file
.
changed
&&
this
.
file
.
staged
)
{
return
`staged
${
type
}
`
;
}
else
if
(
this
.
file
.
changed
&&
this
.
file
.
staged
)
{
return
`unstaged and staged
${
pluralize
(
type
)}
`
;
}
},
},
},
};
};
</
script
>
</
script
>
<
template
>
<
template
>
<span
v-tooltip
:title=
"tooltipTitle"
data-container=
"body"
data-placement=
"right"
class=
"ide-file-changed-icon"
>
<icon
<icon
:name=
"changedIcon"
:name=
"changedIcon"
:size=
"12"
:size=
"12"
:css-classes=
"`ide-file-changed-icon $
{changedIconClass}`
"
:css-classes=
"changedIconClass
"
/>
/>
</span>
</
template
>
</
template
>
app/assets/javascripts/ide/components/commit_sidebar/empty_state.vue
View file @
056933ed
<
script
>
<
script
>
import
{
mapActions
,
mapState
,
mapGetters
}
from
'
vuex
'
;
import
{
mapActions
,
mapState
,
mapGetters
}
from
'
vuex
'
;
import
Icon
from
'
~/vue_shared/components/icon.vue
'
;
import
Icon
from
'
~/vue_shared/components/icon.vue
'
;
import
tooltip
from
'
~/vue_shared/directives/tooltip
'
;
export
default
{
export
default
{
components
:
{
components
:
{
Icon
,
Icon
,
},
},
directives
:
{
tooltip
,
},
props
:
{
props
:
{
noChangesStateSvgPath
:
{
noChangesStateSvgPath
:
{
type
:
String
,
type
:
String
,
...
@@ -18,7 +22,7 @@ export default {
...
@@ -18,7 +22,7 @@ export default {
},
},
computed
:
{
computed
:
{
...
mapState
([
'
lastCommitMsg
'
,
'
rightPanelCollapsed
'
]),
...
mapState
([
'
lastCommitMsg
'
,
'
rightPanelCollapsed
'
]),
...
mapGetters
([
'
collapseButtonIcon
'
]),
...
mapGetters
([
'
collapseButtonIcon
'
,
'
collapseButtonTooltip
'
]),
statusSvg
()
{
statusSvg
()
{
return
this
.
lastCommitMsg
return
this
.
lastCommitMsg
?
this
.
committedStateSvgPath
?
this
.
committedStateSvgPath
...
@@ -42,6 +46,10 @@ export default {
...
@@ -42,6 +46,10 @@ export default {
}"
}"
>
>
<button
<button
v-tooltip
:title=
"collapseButtonTooltip"
data-container=
"body"
data-placement=
"left"
type=
"button"
type=
"button"
class=
"btn btn-transparent multi-file-commit-panel-collapse-btn"
class=
"btn btn-transparent multi-file-commit-panel-collapse-btn"
:aria-label=
"__('Toggle sidebar')"
:aria-label=
"__('Toggle sidebar')"
...
...
app/assets/javascripts/ide/components/commit_sidebar/list.vue
View file @
056933ed
<
script
>
<
script
>
import
{
mapActions
,
mapState
,
mapGetters
}
from
'
vuex
'
;
import
{
mapActions
,
mapState
,
mapGetters
}
from
'
vuex
'
;
import
icon
from
'
~/vue_shared/components/icon.vue
'
;
import
icon
from
'
~/vue_shared/components/icon.vue
'
;
import
listItem
from
'
./list_item.vue
'
;
import
tooltip
from
'
~/vue_shared/directives/tooltip
'
;
import
listCollapsed
from
'
./list_collapsed.vue
'
;
import
listItem
from
'
./list_item.vue
'
;
import
listCollapsed
from
'
./list_collapsed.vue
'
;
export
default
{
export
default
{
components
:
{
components
:
{
icon
,
icon
,
listItem
,
listItem
,
listCollapsed
,
listCollapsed
,
},
},
directives
:
{
tooltip
,
},
props
:
{
props
:
{
title
:
{
title
:
{
type
:
String
,
type
:
String
,
...
@@ -42,12 +46,8 @@
...
@@ -42,12 +46,8 @@
},
},
},
},
computed
:
{
computed
:
{
...
mapState
([
...
mapState
([
'
rightPanelCollapsed
'
]),
'
rightPanelCollapsed
'
,
...
mapGetters
([
'
collapseButtonIcon
'
,
'
collapseButtonTooltip
'
]),
]),
...
mapGetters
([
'
collapseButtonIcon
'
,
]),
},
},
methods
:
{
methods
:
{
...
mapActions
([
...
mapActions
([
...
@@ -59,7 +59,7 @@
...
@@ -59,7 +59,7 @@
this
[
this
.
action
]();
this
[
this
.
action
]();
},
},
},
},
};
};
</
script
>
</
script
>
<
template
>
<
template
>
...
@@ -87,7 +87,7 @@
...
@@ -87,7 +87,7 @@
:name=
"icon"
:name=
"icon"
:size=
"18"
:size=
"18"
/>
/>
{{
title
}}
{{
title
}}
changes
<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"
...
@@ -98,6 +98,10 @@
...
@@ -98,6 +98,10 @@
</div>
</div>
<button
<button
v-if=
"showToggle"
v-if=
"showToggle"
v-tooltip
:title=
"collapseButtonTooltip"
data-container=
"body"
data-placement=
"left"
type=
"button"
type=
"button"
class=
"btn btn-transparent multi-file-commit-panel-collapse-btn"
class=
"btn btn-transparent multi-file-commit-panel-collapse-btn"
:aria-label=
"__('Toggle sidebar')"
:aria-label=
"__('Toggle sidebar')"
...
@@ -113,6 +117,7 @@
...
@@ -113,6 +117,7 @@
v-if=
"rightPanelCollapsed"
v-if=
"rightPanelCollapsed"
:files=
"fileList"
:files=
"fileList"
:icon=
"icon"
:icon=
"icon"
:title=
"title"
/>
/>
<template
v-else
>
<template
v-else
>
<ul
<ul
...
...
app/assets/javascripts/ide/components/commit_sidebar/list_collapsed.vue
View file @
056933ed
<
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
{
sprintf
,
n__
}
from
'
~/locale
'
;
export
default
{
export
default
{
components
:
{
components
:
{
icon
,
icon
,
},
},
directives
:
{
tooltip
,
},
props
:
{
props
:
{
files
:
{
files
:
{
type
:
Array
,
type
:
Array
,
...
@@ -14,6 +19,10 @@ export default {
...
@@ -14,6 +19,10 @@ export default {
type
:
String
,
type
:
String
,
required
:
true
,
required
:
true
,
},
},
title
:
{
type
:
String
,
required
:
true
,
},
},
},
computed
:
{
computed
:
{
addedFilesLength
()
{
addedFilesLength
()
{
...
@@ -28,6 +37,29 @@ export default {
...
@@ -28,6 +37,29 @@ export default {
modifiedFilesClass
()
{
modifiedFilesClass
()
{
return
this
.
modifiedFilesLength
?
'
multi-file-modified
'
:
''
;
return
this
.
modifiedFilesLength
?
'
multi-file-modified
'
:
''
;
},
},
additionsTooltip
()
{
return
sprintf
(
n__
(
'
1 %{type} addition
'
,
'
%d %{type} additions
'
,
this
.
modifiedFilesLength
,
),
{
type
:
this
.
title
.
toLowerCase
()
},
);
},
modifiedTooltip
()
{
return
sprintf
(
n__
(
'
1 %{type} modification
'
,
'
%d %{type} modifications
'
,
this
.
modifiedFilesLength
,
),
{
type
:
this
.
title
.
toLowerCase
()
},
);
},
titleTooltip
()
{
return
`
${
this
.
title
}
changes`
;
},
},
},
};
};
</
script
>
</
script
>
...
@@ -35,24 +67,47 @@ export default {
...
@@ -35,24 +67,47 @@ export default {
<
template
>
<
template
>
<div
<div
class=
"multi-file-commit-list-collapsed text-center"
class=
"multi-file-commit-list-collapsed text-center"
>
<div
v-tooltip
:title=
"titleTooltip"
data-container=
"body"
data-placement=
"left"
class=
"append-bottom-15"
>
>
<icon
<icon
v-once
v-once
:name=
"icon"
:name=
"icon"
:size=
"18"
:size=
"18"
css-classes=
"append-bottom-15"
/>
/>
</div>
<div
v-tooltip
:title=
"additionsTooltip"
data-container=
"body"
data-placement=
"left"
class=
"append-bottom-10"
>
<icon
<icon
name=
"file-addition"
name=
"file-addition"
:size=
"18"
:size=
"18"
:css-classes=
"addedFilesIconClass + 'append-bottom-10'
"
:css-classes=
"addedFilesIconClass
"
/>
/>
</div>
{{
addedFilesLength
}}
{{
addedFilesLength
}}
<div
v-tooltip
:title=
"modifiedTooltip"
data-container=
"body"
data-placement=
"left"
class=
"prepend-top-10 append-bottom-10"
>
<icon
<icon
name=
"file-modified"
name=
"file-modified"
:size=
"18"
:size=
"18"
:css-classes=
"modifiedFilesClass + ' prepend-top-10 append-bottom-10'
"
:css-classes=
"modifiedFilesClass
"
/>
/>
</div>
{{
modifiedFilesLength
}}
{{
modifiedFilesLength
}}
</div>
</div>
</
template
>
</
template
>
app/assets/javascripts/ide/components/commit_sidebar/list_item.vue
View file @
056933ed
...
@@ -38,6 +38,9 @@ export default {
...
@@ -38,6 +38,9 @@ export default {
router
.
push
(
`/project
${
file
.
url
}
`
);
router
.
push
(
`/project
${
file
.
url
}
`
);
},
},
stageFile
()
{
alert
(
'
a
'
);
},
},
},
};
};
</
script
>
</
script
>
...
@@ -47,7 +50,9 @@ export default {
...
@@ -47,7 +50,9 @@ export default {
<button
<button
type=
"button"
type=
"button"
class=
"multi-file-commit-list-path"
class=
"multi-file-commit-list-path"
@
click=
"openFileInEditor(file)"
>
@
dblclick=
"stageFile"
@
click=
"openFileInEditor(file)"
>
<span
class=
"multi-file-commit-list-file-path"
>
<span
class=
"multi-file-commit-list-file-path"
>
<icon
<icon
:name=
"iconName"
:name=
"iconName"
...
...
app/assets/javascripts/ide/components/commit_sidebar/stage_button.vue
View file @
056933ed
<
script
>
<
script
>
import
{
mapActions
}
from
'
vuex
'
;
import
{
mapActions
}
from
'
vuex
'
;
import
Icon
from
'
~/vue_shared/components/icon.vue
'
;
import
Icon
from
'
~/vue_shared/components/icon.vue
'
;
import
tooltip
from
'
~/vue_shared/directives/tooltip
'
;
export
default
{
export
default
{
components
:
{
components
:
{
Icon
,
Icon
,
},
},
directives
:
{
tooltip
,
},
props
:
{
props
:
{
path
:
{
path
:
{
type
:
String
,
type
:
String
,
...
@@ -24,9 +28,12 @@ export default {
...
@@ -24,9 +28,12 @@ export default {
class=
"multi-file-discard-btn"
class=
"multi-file-discard-btn"
>
>
<button
<button
v-tooltip
type=
"button"
type=
"button"
class=
"btn btn-blank append-right-5"
class=
"btn btn-blank append-right-5"
:aria-label=
"__('Stage change')"
:aria-label=
"__('Stage changes')"
:title=
"__('Stage changes')"
data-container=
"body"
@
click.stop=
"stageChange(path)"
@
click.stop=
"stageChange(path)"
>
>
<icon
<icon
...
@@ -35,9 +42,12 @@ export default {
...
@@ -35,9 +42,12 @@ export default {
/>
/>
</button>
</button>
<button
<button
v-tooltip
type=
"button"
type=
"button"
class=
"btn btn-blank"
class=
"btn btn-blank"
:aria-label=
"__('Discard change')"
:aria-label=
"__('Discard changes')"
:title=
"__('Discard changes')"
data-container=
"body"
@
click.stop=
"discardFileChanges(path)"
@
click.stop=
"discardFileChanges(path)"
>
>
<icon
<icon
...
...
app/assets/javascripts/ide/components/commit_sidebar/unstage_button.vue
View file @
056933ed
<
script
>
<
script
>
import
{
mapActions
}
from
'
vuex
'
;
import
{
mapActions
}
from
'
vuex
'
;
import
Icon
from
'
~/vue_shared/components/icon.vue
'
;
import
Icon
from
'
~/vue_shared/components/icon.vue
'
;
import
tooltip
from
'
~/vue_shared/directives/tooltip
'
;
export
default
{
export
default
{
components
:
{
components
:
{
Icon
,
Icon
,
},
},
directives
:
{
tooltip
,
},
props
:
{
props
:
{
path
:
{
path
:
{
type
:
String
,
type
:
String
,
...
@@ -24,9 +28,12 @@ export default {
...
@@ -24,9 +28,12 @@ export default {
class=
"multi-file-discard-btn"
class=
"multi-file-discard-btn"
>
>
<button
<button
v-tooltip
type=
"button"
type=
"button"
class=
"btn btn-blank"
class=
"btn btn-blank"
:aria-label=
"__('Unstage change')"
:aria-label=
"__('Unstage changes')"
:title=
"__('Unstage changes')"
data-container=
"body"
@
click=
"unstageChange(path)"
@
click=
"unstageChange(path)"
>
>
<icon
<icon
...
...
app/assets/javascripts/ide/components/repo_file.vue
View file @
056933ed
...
@@ -103,8 +103,9 @@ export default {
...
@@ -103,8 +103,9 @@ export default {
/>
/>
</span>
</span>
<changed-file-icon
<changed-file-icon
v-if=
"file.changed || file.tempFile || file.staged"
:file=
"file"
:file=
"file"
v-if=
"file.changed || file.tempFil
e"
:show-tooltip=
"tru
e"
class=
"prepend-top-5 pull-right"
class=
"prepend-top-5 pull-right"
/>
/>
<new-dropdown
<new-dropdown
...
...
app/assets/javascripts/ide/stores/getters.js
View file @
056933ed
...
@@ -29,3 +29,7 @@ export const collapseButtonIcon = state =>
...
@@ -29,3 +29,7 @@ export const collapseButtonIcon = state =>
export
const
hasChanges
=
state
=>
export
const
hasChanges
=
state
=>
!!
state
.
changedFiles
.
length
||
!!
state
.
stagedFiles
.
length
;
!!
state
.
changedFiles
.
length
||
!!
state
.
stagedFiles
.
length
;
// eslint-disable-next-line no-confusing-arrow
export
const
collapseButtonTooltip
=
state
=>
state
.
rightPanelCollapsed
?
'
Expand sidebar
'
:
'
Collapse sidebar
'
;
app/assets/javascripts/ide/stores/mutations/file.js
View file @
056933ed
...
@@ -80,6 +80,12 @@ export default {
...
@@ -80,6 +80,12 @@ export default {
Object
.
assign
(
state
,
{
Object
.
assign
(
state
,
{
changedFiles
:
state
.
changedFiles
.
filter
(
f
=>
f
.
path
!==
path
),
changedFiles
:
state
.
changedFiles
.
filter
(
f
=>
f
.
path
!==
path
),
entries
:
Object
.
assign
(
state
.
entries
,
{
[
path
]:
Object
.
assign
(
state
.
entries
[
path
],
{
staged
:
true
,
changed
:
false
,
}),
}),
});
});
if
(
stagedFile
)
{
if
(
stagedFile
)
{
...
@@ -111,6 +117,11 @@ export default {
...
@@ -111,6 +117,11 @@ export default {
Object
.
assign
(
state
,
{
Object
.
assign
(
state
,
{
stagedFiles
:
state
.
stagedFiles
.
filter
(
f
=>
f
.
path
!==
path
),
stagedFiles
:
state
.
stagedFiles
.
filter
(
f
=>
f
.
path
!==
path
),
entries
:
Object
.
assign
(
state
.
entries
,
{
[
path
]:
Object
.
assign
(
state
.
entries
[
path
],
{
staged
:
false
,
}),
}),
});
});
},
},
[
types
.
TOGGLE_FILE_CHANGED
](
state
,
{
file
,
changed
})
{
[
types
.
TOGGLE_FILE_CHANGED
](
state
,
{
file
,
changed
})
{
...
...
app/assets/javascripts/ide/stores/utils.js
View file @
056933ed
...
@@ -13,6 +13,7 @@ export const dataStructure = () => ({
...
@@ -13,6 +13,7 @@ export const dataStructure = () => ({
opened
:
false
,
opened
:
false
,
active
:
false
,
active
:
false
,
changed
:
false
,
changed
:
false
,
staged
:
false
,
lastCommitPath
:
''
,
lastCommitPath
:
''
,
lastCommit
:
{
lastCommit
:
{
id
:
''
,
id
:
''
,
...
...
app/assets/stylesheets/pages/repo.scss
View file @
056933ed
...
@@ -64,6 +64,10 @@
...
@@ -64,6 +64,10 @@
.ide-file-changed-icon
{
.ide-file-changed-icon
{
margin-left
:
auto
;
margin-left
:
auto
;
>
svg
{
display
:
block
;
}
}
}
.ide-new-btn
{
.ide-new-btn
{
...
@@ -488,6 +492,7 @@
...
@@ -488,6 +492,7 @@
svg
{
svg
{
margin-right
:
$gl-btn-padding
;
margin-right
:
$gl-btn-padding
;
color
:
$theme-gray-700
;
}
}
}
}
...
@@ -544,7 +549,8 @@
...
@@ -544,7 +549,8 @@
flex-direction
:
column
;
flex-direction
:
column
;
padding
:
$gl-padding
0
;
padding
:
$gl-padding
0
;
>
svg
{
svg
{
display
:
block
;
margin-left
:
auto
;
margin-left
:
auto
;
margin-right
:
auto
;
margin-right
:
auto
;
color
:
$theme-gray-700
;
color
:
$theme-gray-700
;
...
...
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