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
5d90c706
Commit
5d90c706
authored
May 01, 2018
by
Phil Hughes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed getters
parent
55b91d94
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
5 deletions
+5
-5
app/assets/javascripts/ide/stores/getters.js
app/assets/javascripts/ide/stores/getters.js
+3
-3
app/assets/javascripts/ide/stores/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
{
__
}
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
;
export
const
activeFile
=
state
=>
state
.
openFiles
.
find
(
file
=>
file
.
active
)
||
null
;
...
@@ -69,10 +69,10 @@ export const getChangesInFolder = state => path => {
...
@@ -69,10 +69,10 @@ export const getChangesInFolder = state => path => {
};
};
export
const
getUnstagedFilesCountForPath
=
state
=>
path
=>
export
const
getUnstagedFilesCountForPath
=
state
=>
path
=>
getChangesCountFor
State
(
state
.
changes
Files
,
path
);
getChangesCountFor
Files
(
state
.
changed
Files
,
path
);
export
const
getStagedFilesCountForPath
=
state
=>
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
// prevent babel-plugin-rewire from generating an invalid default during karma tests
export
default
()
=>
{};
export
default
()
=>
{};
app/assets/javascripts/ide/stores/utils.js
View file @
5d90c706
...
@@ -141,5 +141,5 @@ export const sortTree = sortedTree =>
...
@@ -141,5 +141,5 @@ export const sortTree = sortedTree =>
export
const
filePathMatches
=
(
f
,
path
)
=>
export
const
filePathMatches
=
(
f
,
path
)
=>
f
.
path
.
replace
(
new
RegExp
(
`
${
f
.
name
}
$`
),
''
).
indexOf
(
`
${
path
}
/`
)
===
0
;
f
.
path
.
replace
(
new
RegExp
(
`
${
f
.
name
}
$`
),
''
).
indexOf
(
`
${
path
}
/`
)
===
0
;
export
const
getChangesCountFor
State
=
(
state
,
path
)
=>
export
const
getChangesCountFor
Files
=
(
files
,
path
)
=>
state
.
stagedF
iles
.
filter
(
f
=>
filePathMatches
(
f
,
path
)).
length
;
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