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
de53d17a
Commit
de53d17a
authored
Feb 14, 2018
by
Phil Hughes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
reset changedFiles
parent
c8c1ed46
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
4 deletions
+15
-4
app/assets/javascripts/ide/stores/actions.js
app/assets/javascripts/ide/stores/actions.js
+0
-2
app/assets/javascripts/ide/stores/modules/commit/actions.js
app/assets/javascripts/ide/stores/modules/commit/actions.js
+15
-2
No files found.
app/assets/javascripts/ide/stores/actions.js
View file @
de53d17a
import
Vue
from
'
vue
'
;
import
Vue
from
'
vue
'
;
import
{
visitUrl
}
from
'
../../lib/utils/url_utility
'
;
import
{
visitUrl
}
from
'
../../lib/utils/url_utility
'
;
import
flash
from
'
../../flash
'
;
import
service
from
'
../services
'
;
import
*
as
types
from
'
./mutation_types
'
;
import
*
as
types
from
'
./mutation_types
'
;
export
const
redirectToUrl
=
(
_
,
url
)
=>
visitUrl
(
url
);
export
const
redirectToUrl
=
(
_
,
url
)
=>
visitUrl
(
url
);
...
...
app/assets/javascripts/ide/stores/modules/commit/actions.js
View file @
de53d17a
import
*
as
types
from
'
./mutation_types
'
;
import
*
as
types
from
'
./mutation_types
'
;
import
*
as
consts
from
'
./constants
'
;
import
*
as
consts
from
'
./constants
'
;
import
*
as
rootTypes
from
'
../../mutation_types
'
;
import
*
as
rootTypes
from
'
../../mutation_types
'
;
import
router
from
'
../../../ide_router
'
;
import
service
from
'
../../../services
'
;
import
service
from
'
../../../services
'
;
import
flash
from
'
../../../../flash
'
;
import
flash
from
'
../../../../flash
'
;
import
{
stripHtml
}
from
'
../../../../lib/utils/text_utility
'
;
import
{
stripHtml
}
from
'
../../../../lib/utils/text_utility
'
;
...
@@ -37,7 +38,9 @@ export const checkCommitStatus = ({ rootState }) =>
...
@@ -37,7 +38,9 @@ export const checkCommitStatus = ({ rootState }) =>
})
})
.
catch
(()
=>
flash
(
'
Error checking branch data. Please try again.
'
,
'
alert
'
,
document
,
null
,
false
,
true
));
.
catch
(()
=>
flash
(
'
Error checking branch data. Please try again.
'
,
'
alert
'
,
document
,
null
,
false
,
true
));
export
const
commitChanges
=
({
commit
,
state
,
getters
,
dispatch
,
rootState
})
=>
{
export
const
commitChanges
=
({
commit
,
state
,
getters
,
dispatch
,
rootState
,
rootGetters
,
})
=>
{
const
newBranch
=
state
.
commitAction
!==
consts
.
COMMIT_TO_CURRENT_BRANCH
;
const
newBranch
=
state
.
commitAction
!==
consts
.
COMMIT_TO_CURRENT_BRANCH
;
const
payload
=
{
const
payload
=
{
branch
:
getters
.
branchName
,
branch
:
getters
.
branchName
,
...
@@ -66,6 +69,8 @@ export const commitChanges = ({ commit, state, getters, dispatch, rootState }) =
...
@@ -66,6 +69,8 @@ export const commitChanges = ({ commit, state, getters, dispatch, rootState }) =
.
then
(({
data
})
=>
{
.
then
(({
data
})
=>
{
const
{
branch
}
=
payload
;
const
{
branch
}
=
payload
;
commit
(
types
.
UPDATE_LOADING
,
false
);
if
(
!
data
.
short_id
)
{
if
(
!
data
.
short_id
)
{
flash
(
data
.
message
,
'
alert
'
,
document
,
null
,
false
,
true
);
flash
(
data
.
message
,
'
alert
'
,
document
,
null
,
false
,
true
);
return
;
return
;
...
@@ -109,7 +114,15 @@ export const commitChanges = ({ commit, state, getters, dispatch, rootState }) =
...
@@ -109,7 +114,15 @@ export const commitChanges = ({ commit, state, getters, dispatch, rootState }) =
},
{
root
:
true
});
},
{
root
:
true
});
});
});
dispatch
(
'
discardAllChanges
'
,
null
,
{
root
:
true
});
commit
(
rootTypes
.
REMOVE_ALL_CHANGES_FILES
,
null
,
{
root
:
true
});
if
(
state
.
commitAction
===
consts
.
COMMIT_TO_NEW_BRANCH
)
{
const
fileUrl
=
rootGetters
.
activeFile
.
url
.
replace
(
rootState
.
currentBranchId
,
branch
);
router
.
push
(
`/project
${
fileUrl
}
`
);
}
dispatch
(
'
updateCommitAction
'
,
consts
.
COMMIT_TO_CURRENT_BRANCH
);
window
.
scrollTo
(
0
,
0
);
window
.
scrollTo
(
0
,
0
);
}
}
...
...
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