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
Léo-Paul Géneau
gitlab-ce
Commits
89c56c1f
Commit
89c56c1f
authored
Jul 30, 2018
by
Phil Hughes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed folders not being renamed
parent
e7fe50bf
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
32 additions
and
17 deletions
+32
-17
app/assets/javascripts/ide/components/repo_file.vue
app/assets/javascripts/ide/components/repo_file.vue
+1
-1
app/assets/javascripts/ide/stores/actions.js
app/assets/javascripts/ide/stores/actions.js
+10
-3
app/assets/javascripts/ide/stores/mutations.js
app/assets/javascripts/ide/stores/mutations.js
+20
-12
app/assets/javascripts/ide/stores/utils.js
app/assets/javascripts/ide/stores/utils.js
+1
-1
No files found.
app/assets/javascripts/ide/components/repo_file.vue
View file @
89c56c1f
...
...
@@ -193,7 +193,7 @@ export default {
data-container=
"body"
data-placement=
"right"
name=
"file-modified"
css-classes=
"prepend-left-5
multi
-file-modified"
css-classes=
"prepend-left-5
ide
-file-modified"
/>
</span>
<changed-file-icon
...
...
app/assets/javascripts/ide/stores/actions.js
View file @
89c56c1f
...
...
@@ -193,9 +193,16 @@ export const deleteEntry = ({ commit, dispatch, state }, path) => {
export
const
resetOpenFiles
=
({
commit
})
=>
commit
(
types
.
RESET_OPEN_FILES
);
export
const
renameEntry
=
({
dispatch
,
commit
},
{
path
,
name
})
=>
{
commit
(
types
.
RENAME_ENTRY
,
{
path
,
name
});
dispatch
(
'
deleteEntry
'
,
path
);
export
const
renameEntry
=
({
dispatch
,
commit
,
state
},
{
path
,
name
,
entryPath
=
null
})
=>
{
commit
(
types
.
RENAME_ENTRY
,
{
path
,
name
,
entryPath
});
state
.
entries
[
entryPath
||
path
].
tree
.
forEach
(
f
=>
dispatch
(
'
renameEntry
'
,
{
path
,
name
,
entryPath
:
f
.
path
}),
);
if
(
!
entryPath
)
{
dispatch
(
'
deleteEntry
'
,
path
);
}
};
export
*
from
'
./actions/tree
'
;
...
...
app/assets/javascripts/ide/stores/mutations.js
View file @
89c56c1f
...
...
@@ -201,27 +201,35 @@ export default {
state
.
changedFiles
=
state
.
changedFiles
.
concat
(
entry
);
parent
.
tree
=
parent
.
tree
.
filter
(
f
=>
f
.
path
!==
entry
.
path
);
},
[
types
.
RENAME_ENTRY
](
state
,
{
path
,
name
})
{
const
oldEntry
=
state
.
entries
[
path
];
const
parent
=
oldEntry
.
parentPath
?
state
.
entries
[
oldEntry
.
parentPath
]
:
state
.
trees
[
`
${
state
.
currentProjectId
}
/
${
state
.
currentBranchId
}
`
];
const
nameRegex
=
new
RegExp
(
`
${
oldEntry
.
name
}
$`
);
const
newPath
=
path
.
replace
(
nameRegex
,
name
);
[
types
.
RENAME_ENTRY
](
state
,
{
path
,
name
,
entryPath
=
null
})
{
const
oldEntry
=
state
.
entries
[
entryPath
||
path
];
const
nameRegex
=
new
RegExp
(
`^
${
path
}
`
);
const
newPath
=
oldEntry
.
path
.
replace
(
nameRegex
,
name
);
const
parentPath
=
oldEntry
.
parentPath
?
oldEntry
.
parentPath
.
replace
(
nameRegex
,
name
)
:
''
;
state
.
entries
[
newPath
]
=
{
...
oldEntry
,
id
:
newPath
,
key
:
`
${
name
}
-
${
oldEntry
.
type
}
-
${
oldEntry
.
id
}
`
,
path
:
newPath
,
name
,
name
:
entryPath
?
oldEntry
.
name
:
name
,
tempFile
:
true
,
prevPath
:
path
,
url
:
oldEntry
.
url
.
replace
(
nameRegex
,
name
),
prevPath
:
oldEntry
.
path
,
url
:
oldEntry
.
url
.
replace
(
new
RegExp
(
`
${
oldEntry
.
path
}
/?$`
),
newPath
),
tree
:
[],
parentPath
,
};
oldEntry
.
moved
=
true
;
parent
.
tree
=
parent
.
tree
.
concat
(
state
.
entries
[
newPath
]);
state
.
changedFiles
=
state
.
changedFiles
.
concat
(
state
.
entries
[
newPath
]);
const
parent
=
parentPath
?
state
.
entries
[
parentPath
]
:
state
.
trees
[
`
${
state
.
currentProjectId
}
/
${
state
.
currentBranchId
}
`
];
parent
.
tree
=
sortTree
(
parent
.
tree
.
concat
(
state
.
entries
[
newPath
]));
if
(
!
entryPath
)
{
state
.
changedFiles
=
state
.
changedFiles
.
concat
(
state
.
entries
[
newPath
]);
}
},
...
projectMutations
,
...
mergeRequestMutation
,
...
...
app/assets/javascripts/ide/stores/utils.js
View file @
89c56c1f
...
...
@@ -124,7 +124,7 @@ export const getCommitFiles = (stagedFiles, deleteTree = false) =>
stagedFiles
.
reduce
((
acc
,
file
)
=>
{
if
(
file
.
moved
)
return
acc
;
if
((
file
.
deleted
||
deleteTree
)
&&
file
.
type
===
'
tree
'
)
{
if
((
file
.
deleted
||
deleteTree
||
file
.
prevPath
)
&&
file
.
type
===
'
tree
'
)
{
return
acc
.
concat
(
getCommitFiles
(
file
.
tree
,
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