Implemented trimming for item's name in Web IDE
Resolves https://gitlab.com/gitlab-org/gitlab-ce/issues/57540
This commit is contained in:
parent
bbbaa7078b
commit
1a2bdb4366
|
@ -29,7 +29,7 @@ export default {
|
||||||
return this.name || (entryPath ? `${entryPath}/` : '');
|
return this.name || (entryPath ? `${entryPath}/` : '');
|
||||||
},
|
},
|
||||||
set(val) {
|
set(val) {
|
||||||
this.name = val;
|
this.name = val.trim();
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
modalTitle() {
|
modalTitle() {
|
||||||
|
|
|
@ -0,0 +1,5 @@
|
||||||
|
---
|
||||||
|
title: Implemented whitespace-trimming for file names in Web IDE
|
||||||
|
merge_request: 26270
|
||||||
|
author:
|
||||||
|
type: fixed
|
|
@ -109,6 +109,18 @@ describe('new file modal component', () => {
|
||||||
|
|
||||||
expect(vm.entryName).toBe('index.js');
|
expect(vm.entryName).toBe('index.js');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it('removes leading/trailing spaces when found in the new name', () => {
|
||||||
|
vm.entryName = ' index.js ';
|
||||||
|
|
||||||
|
expect(vm.entryName).toBe('index.js');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('does not remove internal spaces in the file name', () => {
|
||||||
|
vm.entryName = ' In Praise of Idleness.txt ';
|
||||||
|
|
||||||
|
expect(vm.entryName).toBe('In Praise of Idleness.txt');
|
||||||
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue