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
04f4b868
Commit
04f4b868
authored
Sep 04, 2018
by
Phil Hughes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update state when staging/unstaging all
parent
cfb67193
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
21 additions
and
6 deletions
+21
-6
app/assets/javascripts/ide/components/commit_sidebar/list.vue
...assets/javascripts/ide/components/commit_sidebar/list.vue
+2
-2
app/assets/javascripts/ide/components/commit_sidebar/stage_button.vue
...avascripts/ide/components/commit_sidebar/stage_button.vue
+1
-1
app/assets/javascripts/ide/components/commit_sidebar/unstage_button.vue
...ascripts/ide/components/commit_sidebar/unstage_button.vue
+1
-1
app/assets/javascripts/ide/stores/actions.js
app/assets/javascripts/ide/stores/actions.js
+17
-2
No files found.
app/assets/javascripts/ide/components/commit_sidebar/list.vue
View file @
04f4b868
...
@@ -137,8 +137,8 @@ export default {
...
@@ -137,8 +137,8 @@ export default {
<button
<button
v-tooltip
v-tooltip
v-if=
"!stagedList"
v-if=
"!stagedList"
:title=
"__('
Unstage
all changes')"
:title=
"__('
Discard
all changes')"
:aria-label=
"__('
Unstage
all changes')"
:aria-label=
"__('
Discard
all changes')"
:disabled=
"!filesLength"
:disabled=
"!filesLength"
:class=
"
{
:class=
"
{
'disabled-content': !filesLength
'disabled-content': !filesLength
...
...
app/assets/javascripts/ide/components/commit_sidebar/stage_button.vue
View file @
04f4b868
...
@@ -39,7 +39,7 @@ export default {
...
@@ -39,7 +39,7 @@ export default {
<
template
>
<
template
>
<div
<div
v-once
v-once
class=
"multi-file-discard-btn"
class=
"multi-file-discard-btn
d-flex
"
>
>
<button
<button
v-tooltip
v-tooltip
...
...
app/assets/javascripts/ide/components/commit_sidebar/unstage_button.vue
View file @
04f4b868
...
@@ -25,7 +25,7 @@ export default {
...
@@ -25,7 +25,7 @@ export default {
<
template
>
<
template
>
<div
<div
v-once
v-once
class=
"multi-file-discard-btn"
class=
"multi-file-discard-btn
d-flex
"
>
>
<button
<button
v-tooltip
v-tooltip
...
...
app/assets/javascripts/ide/stores/actions.js
View file @
04f4b868
...
@@ -4,6 +4,7 @@ import { visitUrl } from '~/lib/utils/url_utility';
...
@@ -4,6 +4,7 @@ import { visitUrl } from '~/lib/utils/url_utility';
import
flash
from
'
~/flash
'
;
import
flash
from
'
~/flash
'
;
import
*
as
types
from
'
./mutation_types
'
;
import
*
as
types
from
'
./mutation_types
'
;
import
FilesDecoratorWorker
from
'
./workers/files_decorator_worker
'
;
import
FilesDecoratorWorker
from
'
./workers/files_decorator_worker
'
;
import
{
stageKeys
}
from
'
../constants
'
;
export
const
redirectToUrl
=
(
_
,
url
)
=>
visitUrl
(
url
);
export
const
redirectToUrl
=
(
_
,
url
)
=>
visitUrl
(
url
);
...
@@ -122,14 +123,28 @@ export const scrollToTab = () => {
...
@@ -122,14 +123,28 @@ export const scrollToTab = () => {
});
});
};
};
export
const
stageAllChanges
=
({
state
,
commit
})
=>
{
export
const
stageAllChanges
=
({
state
,
commit
,
dispatch
})
=>
{
const
activeFile
=
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
'
,
{
file
:
state
.
stagedFiles
.
find
(
f
=>
f
.
path
===
activeFile
.
path
),
keyPrefix
:
stageKeys
.
staged
,
});
};
};
export
const
unstageAllChanges
=
({
state
,
commit
})
=>
{
export
const
unstageAllChanges
=
({
state
,
commit
,
dispatch
})
=>
{
const
activeFile
=
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
'
,
{
file
:
state
.
changedFiles
.
find
(
f
=>
f
.
path
===
activeFile
.
path
),
keyPrefix
:
stageKeys
.
unstaged
,
});
};
};
export
const
updateViewer
=
({
commit
},
viewer
)
=>
{
export
const
updateViewer
=
({
commit
},
viewer
)
=>
{
...
...
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