Commit 6fe2e668 authored by svilayphiou's avatar svilayphiou
Browse files

tree does not list hidden files

parent 34e7d52c
......@@ -99,13 +99,16 @@
//})
// T R E E
const hiddenFile = /^\./;
var fileList = [];
var formerTree = [];
var treeURL = "https://gitlab.constantvzw.org/api/v4/projects/" + repoID + "/repository/tree?per_page=100";
fetch(treeURL).then(function(resp){ return resp.json(); })
.then(function(data){
return data.map(function(file) {
fileList.push(file);
if (! file["name"].match(hiddenFile)) {
fileList.push(file);
}
})
})
......@@ -120,6 +123,7 @@
methods: {
tree: function(type, path, blobID){
vm = this;
if (type == "tree") {
currentPath = path;
var treeURL = "https://gitlab.constantvzw.org/api/v4/projects/" + repoID + "/repository/tree?per_page=100&path="+ path;
......@@ -127,7 +131,9 @@
fetch(treeURL).then(function(resp){ return resp.json(); })
.then(function(data){
return data.map(function(file) {
vm.fileList.push(file);
if (! file["name"].match(hiddenFile)) {
vm.fileList.push(file);
}
})
})
} else if (type == "up") {
......@@ -139,7 +145,9 @@
fetch(treeURL).then(function(resp){ return resp.json(); })
.then(function(data){
return data.map(function(file) {
vm.fileList.push(file);
if (! file["name"].match(hiddenFile)) {
vm.fileList.push(file);
}
})
})
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment