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
dba40985
Commit
dba40985
authored
Apr 19, 2018
by
Phil Hughes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added support for staged files
parent
509c0cbf
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
47 additions
and
13 deletions
+47
-13
app/assets/javascripts/ide/components/changed_file_icon.vue
app/assets/javascripts/ide/components/changed_file_icon.vue
+2
-8
app/assets/javascripts/ide/components/commit_sidebar/list_item.vue
...s/javascripts/ide/components/commit_sidebar/list_item.vue
+1
-1
app/assets/javascripts/ide/stores/getters.js
app/assets/javascripts/ide/stores/getters.js
+12
-2
app/assets/stylesheets/pages/repo.scss
app/assets/stylesheets/pages/repo.scss
+2
-2
spec/javascripts/ide/stores/getters_spec.js
spec/javascripts/ide/stores/getters_spec.js
+30
-0
No files found.
app/assets/javascripts/ide/components/changed_file_icon.vue
View file @
dba40985
...
...
@@ -36,7 +36,7 @@ export default {
return
`
${
this
.
changedIcon
}
-solid`
;
},
changedIconClass
()
{
return
`multi-
${
this
.
changedIcon
}
p
repend-left-5 p
ull-left`
;
return
`multi-
${
this
.
changedIcon
}
pull-left`
;
},
tooltipTitle
()
{
if
(
!
this
.
showTooltip
)
return
undefined
;
...
...
@@ -72,13 +72,7 @@ export default {
class=
"ide-file-changed-icon"
>
<icon
v-if=
"file.staged && showStagedIcon"
:name=
"stagedIcon"
:size=
"12"
:css-classes=
"changedIconClass"
/>
<icon
v-if=
"file.changed || file.tempFile || (file.staged && !showStagedIcon)"
v-if=
"file.changed || file.tempFile || file.staged"
:name=
"changedIcon"
:size=
"12"
:css-classes=
"changedIconClass"
...
...
app/assets/javascripts/ide/components/commit_sidebar/list_item.vue
View file @
dba40985
...
...
@@ -36,7 +36,7 @@ export default {
return
this
.
file
.
tempFile
?
`file-addition
${
prefix
}
`
:
`file-modified
${
prefix
}
`
;
},
iconClass
()
{
return
`multi-file-
${
this
.
file
.
tempFile
?
'
addition
s
'
:
'
modified
'
}
append-right-8`
;
return
`multi-file-
${
this
.
file
.
tempFile
?
'
addition
'
:
'
modified
'
}
append-right-8`
;
},
},
methods
:
{
...
...
app/assets/javascripts/ide/stores/getters.js
View file @
dba40985
...
...
@@ -42,7 +42,17 @@ export const collapseButtonTooltip = state =>
export
const
hasMergeRequest
=
state
=>
!!
state
.
currentMergeRequestId
;
export
const
getChangesInFolder
=
state
=>
path
=>
state
.
changedFiles
.
filter
(
f
=>
f
.
path
.
replace
(
new
RegExp
(
`/
${
f
.
name
}
$`
),
''
)
===
path
).
length
;
export
const
getChangesInFolder
=
state
=>
path
=>
{
const
changedFilesCount
=
state
.
changedFiles
.
filter
(
f
=>
f
.
path
.
replace
(
new
RegExp
(
`/
${
f
.
name
}
$`
),
''
)
===
path
,
).
length
;
const
stagedFilesCount
=
state
.
stagedFiles
.
filter
(
f
=>
f
.
path
.
replace
(
new
RegExp
(
`/
${
f
.
name
}
$`
),
''
)
===
path
&&
!
state
.
changedFiles
.
find
(
changedF
=>
changedF
.
path
===
f
.
path
),
).
length
;
return
changedFilesCount
+
stagedFilesCount
;
};
export
const
getStagedFile
=
state
=>
path
=>
state
.
stagedFiles
.
find
(
f
=>
f
.
path
===
path
);
app/assets/stylesheets/pages/repo.scss
View file @
dba40985
...
...
@@ -589,8 +589,8 @@
}
}
.multi-file-addition
s
,
.multi-file-addition
s
-solid
{
.multi-file-addition
,
.multi-file-addition-solid
{
color
:
$green-500
;
}
...
...
spec/javascripts/ide/stores/getters_spec.js
View file @
dba40985
...
...
@@ -81,6 +81,36 @@ describe('IDE store getters', () => {
expect
(
getters
.
getChangesInFolder
(
localState
)(
'
test
'
)).
toBe
(
1
);
});
it
(
'
returns length of changed & staged files for a path
'
,
()
=>
{
localState
.
changedFiles
.
push
(
{
path
:
'
test/index
'
,
name
:
'
index
'
,
},
{
path
:
'
testing/123
'
,
name
:
'
123
'
,
},
);
localState
.
stagedFiles
.
push
(
{
path
:
'
test/123
'
,
name
:
'
123
'
,
},
{
path
:
'
test/index
'
,
name
:
'
index
'
,
},
{
path
:
'
testing/12345
'
,
name
:
'
12345
'
,
},
);
expect
(
getters
.
getChangesInFolder
(
localState
)(
'
test
'
)).
toBe
(
2
);
});
it
(
'
returns length of changed & tempFiles files for a path
'
,
()
=>
{
localState
.
changedFiles
.
push
(
{
...
...
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