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
Boxiang Sun
gitlab-ce
Commits
feae8975
Commit
feae8975
authored
Sep 04, 2018
by
Phil Hughes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
karma fixes
parent
9badf9e7
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
8 deletions
+26
-8
app/assets/javascripts/ide/stores/actions.js
app/assets/javascripts/ide/stores/actions.js
+4
-4
spec/javascripts/ide/stores/actions_spec.js
spec/javascripts/ide/stores/actions_spec.js
+22
-4
No files found.
app/assets/javascripts/ide/stores/actions.js
View file @
feae8975
...
@@ -124,25 +124,25 @@ export const scrollToTab = () => {
...
@@ -124,25 +124,25 @@ export const scrollToTab = () => {
};
};
export
const
stageAllChanges
=
({
state
,
commit
,
dispatch
})
=>
{
export
const
stageAllChanges
=
({
state
,
commit
,
dispatch
})
=>
{
const
active
File
=
state
.
openFiles
[
0
];
const
open
File
=
state
.
openFiles
[
0
];
commit
(
types
.
SET_LAST_COMMIT_MSG
,
''
);
commit
(
types
.
SET_LAST_COMMIT_MSG
,
''
);
state
.
changedFiles
.
forEach
(
file
=>
commit
(
types
.
STAGE_CHANGE
,
file
.
path
));
state
.
changedFiles
.
forEach
(
file
=>
commit
(
types
.
STAGE_CHANGE
,
file
.
path
));
dispatch
(
'
openPendingTab
'
,
{
dispatch
(
'
openPendingTab
'
,
{
file
:
state
.
stagedFiles
.
find
(
f
=>
f
.
path
===
active
File
.
path
),
file
:
state
.
stagedFiles
.
find
(
f
=>
f
.
path
===
open
File
.
path
),
keyPrefix
:
stageKeys
.
staged
,
keyPrefix
:
stageKeys
.
staged
,
});
});
};
};
export
const
unstageAllChanges
=
({
state
,
commit
,
dispatch
})
=>
{
export
const
unstageAllChanges
=
({
state
,
commit
,
dispatch
})
=>
{
const
active
File
=
state
.
openFiles
[
0
];
const
open
File
=
state
.
openFiles
[
0
];
state
.
stagedFiles
.
forEach
(
file
=>
commit
(
types
.
UNSTAGE_CHANGE
,
file
.
path
));
state
.
stagedFiles
.
forEach
(
file
=>
commit
(
types
.
UNSTAGE_CHANGE
,
file
.
path
));
dispatch
(
'
openPendingTab
'
,
{
dispatch
(
'
openPendingTab
'
,
{
file
:
state
.
changedFiles
.
find
(
f
=>
f
.
path
===
active
File
.
path
),
file
:
state
.
changedFiles
.
find
(
f
=>
f
.
path
===
open
File
.
path
),
keyPrefix
:
stageKeys
.
unstaged
,
keyPrefix
:
stageKeys
.
unstaged
,
});
});
};
};
...
...
spec/javascripts/ide/stores/actions_spec.js
View file @
feae8975
...
@@ -305,7 +305,11 @@ describe('Multi-file store actions', () => {
...
@@ -305,7 +305,11 @@ describe('Multi-file store actions', () => {
describe
(
'
stageAllChanges
'
,
()
=>
{
describe
(
'
stageAllChanges
'
,
()
=>
{
it
(
'
adds all files from changedFiles to stagedFiles
'
,
done
=>
{
it
(
'
adds all files from changedFiles to stagedFiles
'
,
done
=>
{
store
.
state
.
changedFiles
.
push
(
file
(),
file
(
'
new
'
));
const
openFile
=
{
...
file
(),
path
:
'
test
'
};
store
.
state
.
openFiles
.
push
(
openFile
);
store
.
state
.
stagedFiles
.
push
(
openFile
);
store
.
state
.
changedFiles
.
push
(
openFile
,
file
(
'
new
'
));
testAction
(
testAction
(
stageAllChanges
,
stageAllChanges
,
...
@@ -316,7 +320,12 @@ describe('Multi-file store actions', () => {
...
@@ -316,7 +320,12 @@ describe('Multi-file store actions', () => {
{
type
:
types
.
STAGE_CHANGE
,
payload
:
store
.
state
.
changedFiles
[
0
].
path
},
{
type
:
types
.
STAGE_CHANGE
,
payload
:
store
.
state
.
changedFiles
[
0
].
path
},
{
type
:
types
.
STAGE_CHANGE
,
payload
:
store
.
state
.
changedFiles
[
1
].
path
},
{
type
:
types
.
STAGE_CHANGE
,
payload
:
store
.
state
.
changedFiles
[
1
].
path
},
],
],
[],
[
{
type
:
'
openPendingTab
'
,
payload
:
{
file
:
openFile
,
keyPrefix
:
'
staged
'
},
},
],
done
,
done
,
);
);
});
});
...
@@ -324,7 +333,11 @@ describe('Multi-file store actions', () => {
...
@@ -324,7 +333,11 @@ describe('Multi-file store actions', () => {
describe
(
'
unstageAllChanges
'
,
()
=>
{
describe
(
'
unstageAllChanges
'
,
()
=>
{
it
(
'
removes all files from stagedFiles after unstaging
'
,
done
=>
{
it
(
'
removes all files from stagedFiles after unstaging
'
,
done
=>
{
store
.
state
.
stagedFiles
.
push
(
file
(),
file
(
'
new
'
));
const
openFile
=
{
...
file
(),
path
:
'
test
'
};
store
.
state
.
openFiles
.
push
(
openFile
);
store
.
state
.
changedFiles
.
push
(
openFile
);
store
.
state
.
stagedFiles
.
push
(
openFile
,
file
(
'
new
'
));
testAction
(
testAction
(
unstageAllChanges
,
unstageAllChanges
,
...
@@ -334,7 +347,12 @@ describe('Multi-file store actions', () => {
...
@@ -334,7 +347,12 @@ describe('Multi-file store actions', () => {
{
type
:
types
.
UNSTAGE_CHANGE
,
payload
:
store
.
state
.
stagedFiles
[
0
].
path
},
{
type
:
types
.
UNSTAGE_CHANGE
,
payload
:
store
.
state
.
stagedFiles
[
0
].
path
},
{
type
:
types
.
UNSTAGE_CHANGE
,
payload
:
store
.
state
.
stagedFiles
[
1
].
path
},
{
type
:
types
.
UNSTAGE_CHANGE
,
payload
:
store
.
state
.
stagedFiles
[
1
].
path
},
],
],
[],
[
{
type
:
'
openPendingTab
'
,
payload
:
{
file
:
openFile
,
keyPrefix
:
'
unstaged
'
},
},
],
done
,
done
,
);
);
});
});
...
...
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