Merge "Fix for swift ui displaying infinite folders"
This commit is contained in:
commit
4304bf3fce
@ -17,6 +17,7 @@ import os
|
|||||||
|
|
||||||
from django import forms
|
from django import forms
|
||||||
from django.http import StreamingHttpResponse
|
from django.http import StreamingHttpResponse
|
||||||
|
from django.utils.http import urlunquote
|
||||||
from django.views.decorators.csrf import csrf_exempt
|
from django.views.decorators.csrf import csrf_exempt
|
||||||
from django.views import generic
|
from django.views import generic
|
||||||
import six
|
import six
|
||||||
@ -120,6 +121,8 @@ class Objects(generic.View):
|
|||||||
:return:
|
:return:
|
||||||
"""
|
"""
|
||||||
path = request.GET.get('path')
|
path = request.GET.get('path')
|
||||||
|
if path is not None:
|
||||||
|
path = urlunquote(path)
|
||||||
|
|
||||||
objects = api.swift.swift_get_objects(
|
objects = api.swift.swift_get_objects(
|
||||||
request,
|
request,
|
||||||
|
@ -121,7 +121,7 @@
|
|||||||
delimiter: model.DELIMETER
|
delimiter: model.DELIMETER
|
||||||
};
|
};
|
||||||
if (folder) {
|
if (folder) {
|
||||||
spec.path = folder + model.DELIMETER;
|
spec.path = encodeURIComponent(folder) + model.DELIMETER;
|
||||||
}
|
}
|
||||||
|
|
||||||
return swiftAPI.getObjects(name, spec).then(function onObjects(response) {
|
return swiftAPI.getObjects(name, spec).then(function onObjects(response) {
|
||||||
@ -279,7 +279,7 @@
|
|||||||
state.counted.folders++;
|
state.counted.folders++;
|
||||||
var spec = {
|
var spec = {
|
||||||
delimiter: model.DELIMETER,
|
delimiter: model.DELIMETER,
|
||||||
path: item.path + model.DELIMETER
|
path: encodeURIComponent(item.path).replace(/%2F/g, '/')
|
||||||
};
|
};
|
||||||
return swiftAPI.getObjects(model.container.name, spec)
|
return swiftAPI.getObjects(model.container.name, spec)
|
||||||
.then(function objects(response) {
|
.then(function objects(response) {
|
||||||
|
@ -244,7 +244,7 @@
|
|||||||
beforeEach(function before() {
|
beforeEach(function before() {
|
||||||
spyOn(swiftAPI, 'getObjects').and.callFake(function fake(container, spec) {
|
spyOn(swiftAPI, 'getObjects').and.callFake(function fake(container, spec) {
|
||||||
var deferred = $q.defer();
|
var deferred = $q.defer();
|
||||||
var items = fakeSwift[spec.path];
|
var items = fakeSwift[spec.path + '/'];
|
||||||
expect(items).toBeDefined(); // sanity check
|
expect(items).toBeDefined(); // sanity check
|
||||||
deferred.resolve({data: {items: items}});
|
deferred.resolve({data: {items: items}});
|
||||||
return deferred.promise;
|
return deferred.promise;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user