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
cd638abb
Commit
cd638abb
authored
Jul 19, 2019
by
Denys Mishunov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed regression for re-naming files in WebIDE
parent
9f70a03b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
45 additions
and
4 deletions
+45
-4
app/assets/javascripts/ide/stores/mutations/file.js
app/assets/javascripts/ide/stores/mutations/file.js
+8
-4
spec/javascripts/ide/stores/mutations/file_spec.js
spec/javascripts/ide/stores/mutations/file_spec.js
+37
-0
No files found.
app/assets/javascripts/ide/stores/mutations/file.js
View file @
cd638abb
...
...
@@ -43,10 +43,14 @@ export default {
[
stateEntry
,
stagedFile
,
openFile
,
changedFile
].
forEach
(
f
=>
{
if
(
f
)
{
Object
.
assign
(
f
,
convertObjectPropsToCamelCase
(
data
,
{
dropKeys
:
[
'
raw
'
,
'
baseRaw
'
]
}),
{
raw
:
(
stateEntry
&&
stateEntry
.
raw
)
||
null
,
baseRaw
:
null
,
});
Object
.
assign
(
f
,
convertObjectPropsToCamelCase
(
data
,
{
dropKeys
:
[
'
path
'
,
'
name
'
,
'
raw
'
,
'
baseRaw
'
]
}),
{
raw
:
(
stateEntry
&&
stateEntry
.
raw
)
||
null
,
baseRaw
:
null
,
},
);
}
});
},
...
...
spec/javascripts/ide/stores/mutations/file_spec.js
View file @
cd638abb
...
...
@@ -103,6 +103,43 @@ describe('IDE store file mutations', () => {
expect
(
localState
.
openFiles
[
0
].
rawPath
).
toEqual
(
rawPath
);
expect
(
localFile
.
rawPath
).
toEqual
(
rawPath
);
});
it
(
'
does not mutate certain props on the file
'
,
()
=>
{
const
path
=
'
New Path
'
;
const
name
=
'
New Name
'
;
localFile
.
path
=
path
;
localFile
.
name
=
name
;
localState
.
stagedFiles
=
[
localFile
];
localState
.
changedFiles
=
[
localFile
];
localState
.
openFiles
=
[
localFile
];
mutations
.
SET_FILE_DATA
(
localState
,
{
data
:
{
path
:
'
Old Path
'
,
name
:
'
Old Name
'
,
raw
:
'
Old Raw
'
,
base_raw
:
'
Old Base Raw
'
,
},
file
:
localFile
,
});
[
localState
.
stagedFiles
[
0
],
localState
.
changedFiles
[
0
],
localState
.
openFiles
[
0
],
localFile
,
].
forEach
(
f
=>
{
expect
(
f
).
toEqual
(
jasmine
.
objectContaining
({
path
,
name
,
raw
:
null
,
baseRaw
:
null
,
}),
);
});
});
});
describe
(
'
SET_FILE_RAW_DATA
'
,
()
=>
{
...
...
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