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
eb6692ab
Commit
eb6692ab
authored
Mar 05, 2018
by
Phil Hughes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed content changing across different files
parent
1ff2ac38
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
26 additions
and
4 deletions
+26
-4
ee/app/assets/javascripts/ide/components/repo_editor.vue
ee/app/assets/javascripts/ide/components/repo_editor.vue
+2
-2
ee/app/assets/javascripts/ide/lib/common/model.js
ee/app/assets/javascripts/ide/lib/common/model.js
+1
-1
ee/app/assets/javascripts/ide/stores/modules/commit/actions.js
...p/assets/javascripts/ide/stores/modules/commit/actions.js
+4
-1
ee/app/assets/javascripts/ide/stores/mutation_types.js
ee/app/assets/javascripts/ide/stores/mutation_types.js
+1
-0
ee/app/assets/javascripts/ide/stores/mutations/file.js
ee/app/assets/javascripts/ide/stores/mutations/file.js
+5
-0
spec/javascripts/ide/stores/mutations/file_spec.js
spec/javascripts/ide/stores/mutations/file_spec.js
+13
-0
No files found.
ee/app/assets/javascripts/ide/components/repo_editor.vue
View file @
eb6692ab
...
...
@@ -83,12 +83,12 @@ export default {
this
.
editor
.
attachModel
(
this
.
model
);
this
.
model
.
onChange
((
model
)
=>
{
const
{
file
}
=
this
.
model
;
const
{
file
}
=
model
;
if
(
file
.
active
)
{
this
.
changeFileContent
({
file
,
content
:
model
.
getValue
(),
content
:
model
.
get
Model
().
get
Value
(),
});
}
});
...
...
ee/app/assets/javascripts/ide/lib/common/model.js
View file @
eb6692ab
...
...
@@ -61,7 +61,7 @@ export default class Model {
this
.
events
.
set
(
this
.
path
,
this
.
disposable
.
add
(
this
.
model
.
onDidChangeContent
(
e
=>
cb
(
this
.
model
,
e
)),
this
.
model
.
onDidChangeContent
(
e
=>
cb
(
this
,
e
)),
),
);
}
...
...
ee/app/assets/javascripts/ide/stores/modules/commit/actions.js
View file @
eb6692ab
...
...
@@ -94,7 +94,10 @@ export const updateFilesAfterCommit = (
raw
:
entry
.
content
,
},
{
root
:
true
});
commit
(
rootTypes
.
DISCARD_FILE_CHANGES
,
entry
,
{
root
:
true
});
commit
(
rootTypes
.
TOGGLE_FILE_CHANGED
,
{
file
:
entry
,
changed
:
false
,
},
{
root
:
true
});
eventHub
.
$emit
(
`editor.update.model.content.
${
entry
.
path
}
`
,
entry
.
raw
);
});
...
...
ee/app/assets/javascripts/ide/stores/mutation_types.js
View file @
eb6692ab
...
...
@@ -39,6 +39,7 @@ export const DISCARD_FILE_CHANGES = 'DISCARD_FILE_CHANGES';
export
const
CREATE_TMP_FILE
=
'
CREATE_TMP_FILE
'
;
export
const
ADD_FILE_TO_CHANGED
=
'
ADD_FILE_TO_CHANGED
'
;
export
const
REMOVE_FILE_FROM_CHANGED
=
'
REMOVE_FILE_FROM_CHANGED
'
;
export
const
TOGGLE_FILE_CHANGED
=
'
TOGGLE_FILE_CHANGED
'
;
// Viewer mutation types
export
const
SET_PREVIEW_MODE
=
'
SET_PREVIEW_MODE
'
;
...
...
ee/app/assets/javascripts/ide/stores/mutations/file.js
View file @
eb6692ab
...
...
@@ -79,4 +79,9 @@ export default {
state
.
changedFiles
.
splice
(
indexOfChangedFile
,
1
);
},
[
types
.
TOGGLE_FILE_CHANGED
](
state
,
{
file
,
changed
})
{
Object
.
assign
(
file
,
{
changed
,
});
},
};
spec/javascripts/ide/stores/mutations/file_spec.js
View file @
eb6692ab
...
...
@@ -161,4 +161,17 @@ describe('Multi-file store file mutations', () => {
expect
(
localState
.
changedFiles
.
length
).
toBe
(
0
);
});
});
describe
(
'
TOGGLE_FILE_CHANGED
'
,
()
=>
{
it
(
'
updates file changed status
'
,
()
=>
{
const
f
=
file
();
mutations
.
TOGGLE_FILE_CHANGED
(
localState
,
{
file
:
f
,
changed
:
true
,
});
expect
(
f
.
changed
).
toBeTruthy
();
});
});
});
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