fix: List visualziation bundles only in order

This commit is contained in:
1ambda 2017-01-27 14:33:22 +09:00
parent 4029c029c6
commit 49e03fc4d5
4 changed files with 15 additions and 14 deletions

View file

@ -17,7 +17,6 @@
package org.apache.zeppelin.rest;
import com.github.eirslett.maven.plugins.frontend.lib.TaskRunnerException;
import com.google.gson.Gson;
import com.google.gson.reflect.TypeToken;
import org.apache.commons.io.FileUtils;
@ -160,15 +159,15 @@ public class HeliumRestApi {
}
@GET
@Path("bundleOrder")
public Response getBundlePackageOrder() {
List<String> order = helium.getBundlePackageOrder();
@Path("order/visualization")
public Response getVisualizationPackageOrder() {
List<String> order = helium.setVisualizationPackageOrder();
return new JsonResponse(Response.Status.OK, order).build();
}
@POST
@Path("bundleOrder")
public Response setBundlePackageOrder(String orderedPackageNameList) {
@Path("order/visualization")
public Response getVisualizationPackageOrder(String orderedPackageNameList) {
List<String> orderedList = gson.fromJson(
orderedPackageNameList, new TypeToken<List<String>>(){}.getType());

View file

@ -61,7 +61,7 @@
};
var getBundleOrder = function() {
heliumService.getBundleOrder().
heliumService.getVisualizationPackageOrder().
success(function(data, status) {
$scope.bundleOrder = data.body;
}).
@ -98,7 +98,7 @@
confirm.$modalFooter.find('button').addClass('disabled');
confirm.$modalFooter.find('button:contains("OK")')
.html('<i class="fa fa-circle-o-notch fa-spin"></i> Enabling');
heliumService.setBundleOrder($scope.bundleOrder).
heliumService.setVisualizationPackageOrder($scope.bundleOrder).
success(function(data, status) {
init();
confirm.close();

View file

@ -70,12 +70,12 @@ import { HeliumType, } from './helium-type';
return visualizationBundles;
};
this.getBundleOrder = function() {
return $http.get(baseUrlSrv.getRestApiBase() + '/helium/bundleOrder');
this.getVisualizationPackageOrder = function() {
return $http.get(baseUrlSrv.getRestApiBase() + '/helium/order/visualization');
};
this.setBundleOrder = function(list) {
return $http.post(baseUrlSrv.getRestApiBase() + '/helium/bundleOrder', list);
this.setVisualizationPackageOrder = function(list) {
return $http.post(baseUrlSrv.getRestApiBase() + '/helium/order/visualization', list);
};
this.getAllPackageInfo = function() {

View file

@ -346,12 +346,14 @@ public class Helium {
* Get enabled package list in order
* @return
*/
public List<String> getBundlePackageOrder() {
public List<String> setVisualizationPackageOrder() {
List orderedPackageList = new LinkedList<>();
List<HeliumPackage> packages = getBundlePackagesToBundle();
for (HeliumPackage pkg : packages) {
orderedPackageList.add(pkg.getName());
if (HeliumPackage.Type.VISUALIZATION == pkg.getType()) {
orderedPackageList.add(pkg.getName());
}
}
return orderedPackageList;