Merge branch '64677-delete-directory-webide' into 'master'
Fixed deletion of directories in Web IDE Closes #64677 See merge request gitlab-org/gitlab-ce!31727
This commit is contained in:
commit
0d79fe7ed9
3 changed files with 41 additions and 1 deletions
|
@ -129,7 +129,7 @@ export const commitActionForFile = file => {
|
||||||
|
|
||||||
export const getCommitFiles = stagedFiles =>
|
export const getCommitFiles = stagedFiles =>
|
||||||
stagedFiles.reduce((acc, file) => {
|
stagedFiles.reduce((acc, file) => {
|
||||||
if (file.moved) return acc;
|
if (file.moved || file.type === 'tree') return acc;
|
||||||
|
|
||||||
return acc.concat({
|
return acc.concat({
|
||||||
...file,
|
...file,
|
||||||
|
|
5
changelogs/unreleased/64677-delete-directory-webide.yml
Normal file
5
changelogs/unreleased/64677-delete-directory-webide.yml
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
---
|
||||||
|
title: Fixed removing directories in Web IDE
|
||||||
|
merge_request: 31727
|
||||||
|
author:
|
||||||
|
type: fixed
|
|
@ -261,6 +261,41 @@ describe('Multi-file store utils', () => {
|
||||||
},
|
},
|
||||||
]);
|
]);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it('filters out folders from the list', () => {
|
||||||
|
const files = [
|
||||||
|
{
|
||||||
|
path: 'a',
|
||||||
|
type: 'blob',
|
||||||
|
deleted: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: 'c',
|
||||||
|
type: 'tree',
|
||||||
|
deleted: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: 'c/d',
|
||||||
|
type: 'blob',
|
||||||
|
deleted: true,
|
||||||
|
},
|
||||||
|
];
|
||||||
|
|
||||||
|
const flattendFiles = utils.getCommitFiles(files);
|
||||||
|
|
||||||
|
expect(flattendFiles).toEqual([
|
||||||
|
{
|
||||||
|
path: 'a',
|
||||||
|
type: 'blob',
|
||||||
|
deleted: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: 'c/d',
|
||||||
|
type: 'blob',
|
||||||
|
deleted: true,
|
||||||
|
},
|
||||||
|
]);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('mergeTrees', () => {
|
describe('mergeTrees', () => {
|
||||||
|
|
Loading…
Reference in a new issue