Parcourir la source

1. remove useless code (#3871)

2. fix failed ut
3. add change log
张乐 il y a 3 ans
Parent
commit
278114744e

+ 1 - 0
CHANGES.md

@@ -68,6 +68,7 @@ Apollo 1.9.0
 * [fix show-text-modal number display](https://github.com/ctripcorp/apollo/pull/3851)
 * [Lazy load ConfigUtil](https://github.com/ctripcorp/apollo/pull/3864)
 * [make jdbc session enable default](https://github.com/ctripcorp/apollo/pull/3869)
+* [support json/yaml/xml format for public namespace](https://github.com/ctripcorp/apollo/pull/3836)
 
 ------------------
 All issues and pull requests are [here](https://github.com/ctripcorp/apollo/milestone/6?closed=1)

+ 0 - 5
apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/service/AppNamespaceService.java

@@ -127,11 +127,6 @@ public class AppNamespaceService {
       throw new BadRequestException("App not exist. AppId = " + appId);
     }
 
-    // public namespaces only allow properties format
-//    if (appNamespace.isPublic()) {
-//      appNamespace.setFormat(ConfigFileFormat.Properties.getValue());
-//    }
-
     StringBuilder appNamespaceName = new StringBuilder();
     //add prefix postfix
     appNamespaceName

+ 1 - 2
apollo-portal/src/main/resources/static/namespace.html

@@ -122,7 +122,6 @@
                                     </div>
                                 </div>
 
-                                <!--public namespace can only be properties -->
                                 <div class="col-sm-2">
                                     <select class="form-control" name="format" ng-model="appNamespace.format">
                                         <option value="properties">properties</option>
@@ -254,4 +253,4 @@
 
 </body>
 
-</html>
+</html>

+ 0 - 6
apollo-portal/src/main/resources/static/scripts/controller/NamespaceController.js

@@ -86,7 +86,6 @@ namespace_module.controller("LinkNamespaceController",
             };
 
             function shouldAppendNamespacePrefix() {
-                //return $scope.appNamespace.isPublic ? $scope.appendNamespacePrefix : false;
                 return  $scope.appendNamespacePrefix;
             }
 
@@ -150,11 +149,6 @@ namespace_module.controller("LinkNamespaceController",
                         return;
                     }
 
-                    // public namespaces only allow properties format
-                    // if ($scope.appNamespace.isPublic) {
-                    //     $scope.appNamespace.format = 'properties';
-                    // }
-
                     $scope.submitBtnDisabled = true;
                     //only append namespace prefix for public app namespace
                     var appendNamespacePrefix = shouldAppendNamespacePrefix();

+ 1 - 1
apollo-portal/src/test/java/com/ctrip/framework/apollo/portal/service/AppNamespaceServiceTest.java

@@ -161,7 +161,7 @@ public class AppNamespaceServiceTest extends AbstractIntegrationTest {
 
     Assert.assertNotNull(createdAppNamespace);
     Assert.assertEquals(appNamespace.getName(), createdAppNamespace.getName());
-    Assert.assertEquals(ConfigFileFormat.Properties.getValue(), createdAppNamespace.getFormat());
+    Assert.assertEquals(ConfigFileFormat.YAML.getValue(), createdAppNamespace.getFormat());
   }