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
Jérome Perrin
gitlab-ce
Commits
299aad3d
Commit
299aad3d
authored
Apr 05, 2018
by
Phil Hughes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed staged content not updating
parent
26901470
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
25 additions
and
8 deletions
+25
-8
app/assets/javascripts/ide/components/commit_sidebar/list_item.vue
...s/javascripts/ide/components/commit_sidebar/list_item.vue
+7
-1
app/assets/javascripts/ide/components/repo_editor.vue
app/assets/javascripts/ide/components/repo_editor.vue
+7
-1
app/assets/javascripts/ide/lib/common/model.js
app/assets/javascripts/ide/lib/common/model.js
+7
-0
app/assets/javascripts/ide/stores/actions/file.js
app/assets/javascripts/ide/stores/actions/file.js
+2
-5
app/assets/javascripts/ide/stores/mutations/file.js
app/assets/javascripts/ide/stores/mutations/file.js
+2
-1
No files found.
app/assets/javascripts/ide/components/commit_sidebar/list_item.vue
View file @
299aad3d
...
@@ -29,7 +29,13 @@ export default {
...
@@ -29,7 +29,13 @@ export default {
},
},
},
},
methods
:
{
methods
:
{
...
mapActions
([
'
discardFileChanges
'
,
'
updateViewer
'
,
'
openPendingTab
'
]),
...
mapActions
([
'
discardFileChanges
'
,
'
updateViewer
'
,
'
openPendingTab
'
,
'
unstageChange
'
,
'
stageChange
'
,
]),
openFileInEditor
()
{
openFileInEditor
()
{
return
this
.
openPendingTab
({
return
this
.
openPendingTab
({
file
:
this
.
file
,
file
:
this
.
file
,
...
...
app/assets/javascripts/ide/components/repo_editor.vue
View file @
299aad3d
...
@@ -69,7 +69,13 @@ export default {
...
@@ -69,7 +69,13 @@ export default {
path
:
this
.
file
.
path
,
path
:
this
.
file
.
path
,
baseSha
:
this
.
currentMergeRequest
?
this
.
currentMergeRequest
.
baseCommitSha
:
''
,
baseSha
:
this
.
currentMergeRequest
?
this
.
currentMergeRequest
.
baseCommitSha
:
''
,
})
})
.
then
(()
=>
this
.
updateViewer
(
this
.
file
.
pending
?
'
diff
'
:
this
.
viewer
))
.
then
(()
=>
{
const
viewerPromise
=
this
.
delayViewerUpdated
?
this
.
updateViewer
(
'
editor
'
)
:
Promise
.
resolve
();
return
viewerPromise
;
})
.
then
(()
=>
{
.
then
(()
=>
{
this
.
updateDelayViewerUpdated
(
false
);
this
.
updateDelayViewerUpdated
(
false
);
this
.
createEditorInstance
();
this
.
createEditorInstance
();
...
...
app/assets/javascripts/ide/lib/common/model.js
View file @
299aad3d
...
@@ -34,10 +34,12 @@ export default class Model {
...
@@ -34,10 +34,12 @@ export default class Model {
this
.
events
=
new
Map
();
this
.
events
=
new
Map
();
this
.
updateContent
=
this
.
updateContent
.
bind
(
this
);
this
.
updateContent
=
this
.
updateContent
.
bind
(
this
);
this
.
updateNewContent
=
this
.
updateNewContent
.
bind
(
this
);
this
.
dispose
=
this
.
dispose
.
bind
(
this
);
this
.
dispose
=
this
.
dispose
.
bind
(
this
);
eventHub
.
$on
(
`editor.update.model.dispose.
${
this
.
file
.
key
}
`
,
this
.
dispose
);
eventHub
.
$on
(
`editor.update.model.dispose.
${
this
.
file
.
key
}
`
,
this
.
dispose
);
eventHub
.
$on
(
`editor.update.model.content.
${
this
.
file
.
key
}
`
,
this
.
updateContent
);
eventHub
.
$on
(
`editor.update.model.content.
${
this
.
file
.
key
}
`
,
this
.
updateContent
);
eventHub
.
$on
(
`editor.update.model.new.content.
${
this
.
file
.
key
}
`
,
this
.
updateNewContent
);
}
}
get
url
()
{
get
url
()
{
...
@@ -87,11 +89,16 @@ export default class Model {
...
@@ -87,11 +89,16 @@ export default class Model {
}
}
}
}
updateNewContent
(
content
)
{
this
.
getModel
().
setValue
(
content
);
}
dispose
()
{
dispose
()
{
this
.
disposable
.
dispose
();
this
.
disposable
.
dispose
();
this
.
events
.
clear
();
this
.
events
.
clear
();
eventHub
.
$off
(
`editor.update.model.dispose.
${
this
.
file
.
key
}
`
,
this
.
dispose
);
eventHub
.
$off
(
`editor.update.model.dispose.
${
this
.
file
.
key
}
`
,
this
.
dispose
);
eventHub
.
$off
(
`editor.update.model.content.
${
this
.
file
.
key
}
`
,
this
.
updateContent
);
eventHub
.
$off
(
`editor.update.model.content.
${
this
.
file
.
key
}
`
,
this
.
updateContent
);
eventHub
.
$off
(
`editor.update.model.new.content.
${
this
.
file
.
key
}
`
,
this
.
updateNewContent
);
}
}
}
}
app/assets/javascripts/ide/stores/actions/file.js
View file @
299aad3d
...
@@ -174,10 +174,7 @@ export const stageChange = ({ commit, state }, path) => {
...
@@ -174,10 +174,7 @@ export const stageChange = ({ commit, state }, path) => {
commit
(
types
.
STAGE_CHANGE
,
path
);
commit
(
types
.
STAGE_CHANGE
,
path
);
if
(
stagedFile
)
{
if
(
stagedFile
)
{
eventHub
.
$emit
(
`editor.update.model.content.staged-
${
stagedFile
.
key
}
`
,
{
eventHub
.
$emit
(
`editor.update.model.new.content.staged-
${
stagedFile
.
key
}
`
,
stagedFile
.
content
);
content
:
stagedFile
.
content
,
changed
:
false
,
});
}
}
};
};
...
@@ -186,7 +183,7 @@ export const unstageChange = ({ commit }, path) => {
...
@@ -186,7 +183,7 @@ export const unstageChange = ({ commit }, path) => {
};
};
export
const
openPendingTab
=
({
commit
,
getters
,
dispatch
,
state
},
{
file
,
keyPrefix
})
=>
{
export
const
openPendingTab
=
({
commit
,
getters
,
dispatch
,
state
},
{
file
,
keyPrefix
})
=>
{
if
(
getters
.
activeFile
&&
getters
.
activeFile
.
path
===
file
.
path
&&
state
.
viewer
===
'
diff
'
)
{
if
(
getters
.
activeFile
&&
getters
.
activeFile
===
file
&&
state
.
viewer
===
'
diff
'
)
{
return
false
;
return
false
;
}
}
...
...
app/assets/javascripts/ide/stores/mutations/file.js
View file @
299aad3d
...
@@ -156,7 +156,7 @@ export default {
...
@@ -156,7 +156,7 @@ export default {
[
types
.
ADD_PENDING_TAB
](
state
,
{
file
,
keyPrefix
=
'
pending
'
})
{
[
types
.
ADD_PENDING_TAB
](
state
,
{
file
,
keyPrefix
=
'
pending
'
})
{
const
pendingTab
=
state
.
openFiles
.
find
(
f
=>
f
.
path
===
file
.
path
&&
f
.
pending
);
const
pendingTab
=
state
.
openFiles
.
find
(
f
=>
f
.
path
===
file
.
path
&&
f
.
pending
);
let
openFiles
=
state
.
openFiles
.
map
(
f
=>
let
openFiles
=
state
.
openFiles
.
map
(
f
=>
Object
.
assign
(
f
,
{
active
:
f
.
path
===
file
.
path
,
opened
:
false
}),
Object
.
assign
(
f
,
{
active
:
f
.
path
===
file
.
path
,
opened
:
false
,
active
:
false
}),
);
);
if
(
!
pendingTab
)
{
if
(
!
pendingTab
)
{
...
@@ -168,6 +168,7 @@ export default {
...
@@ -168,6 +168,7 @@ export default {
if
(
f
.
path
===
file
.
path
)
{
if
(
f
.
path
===
file
.
path
)
{
return
acc
.
concat
({
return
acc
.
concat
({
...
f
,
...
f
,
content
:
file
.
content
,
active
:
true
,
active
:
true
,
pending
:
true
,
pending
:
true
,
opened
:
true
,
opened
:
true
,
...
...
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