BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
5d90c706
Unverified
Commit
5d90c706
authored
May 01, 2018
by
Phil Hughes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed getters
parent
55b91d94
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
5 deletions
+5
-5
getters.js
app/assets/javascripts/ide/stores/getters.js
+3
-3
utils.js
app/assets/javascripts/ide/stores/utils.js
+2
-2
No files found.
app/assets/javascripts/ide/stores/getters.js
View file @
5d90c706
import
{
__
}
from
'~/locale'
;
import
{
getChangesCountFor
State
,
filePathMatches
}
from
'./utils'
;
import
{
getChangesCountFor
Files
,
filePathMatches
}
from
'./utils'
;
export
const
activeFile
=
state
=>
state
.
openFiles
.
find
(
file
=>
file
.
active
)
||
null
;
...
...
@@ -69,10 +69,10 @@ export const getChangesInFolder = state => path => {
};
export
const
getUnstagedFilesCountForPath
=
state
=>
path
=>
getChangesCountFor
State
(
state
.
changes
Files
,
path
);
getChangesCountFor
Files
(
state
.
changed
Files
,
path
);
export
const
getStagedFilesCountForPath
=
state
=>
path
=>
getChangesCountFor
State
(
state
.
stagedFiles
,
path
);
getChangesCountFor
Files
(
state
.
stagedFiles
,
path
);
// prevent babel-plugin-rewire from generating an invalid default during karma tests
export
default
()
=>
{};
app/assets/javascripts/ide/stores/utils.js
View file @
5d90c706
...
...
@@ -141,5 +141,5 @@ export const sortTree = sortedTree =>
export
const
filePathMatches
=
(
f
,
path
)
=>
f
.
path
.
replace
(
new
RegExp
(
`
${
f
.
name
}
$`
),
''
).
indexOf
(
`
${
path
}
/`
)
===
0
;
export
const
getChangesCountFor
State
=
(
state
,
path
)
=>
state
.
stagedF
iles
.
filter
(
f
=>
filePathMatches
(
f
,
path
)).
length
;
export
const
getChangesCountFor
Files
=
(
files
,
path
)
=>
f
iles
.
filter
(
f
=>
filePathMatches
(
f
,
path
)).
length
;
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