diff --git a/CHANGES.md b/CHANGES.md index c8a875b9ebe..b2887b6e9a8 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -52,6 +52,7 @@ Apollo 1.9.0 * [feat(open-api): get authorized apps](https://github.com/ctripcorp/apollo/pull/3647) * [feature: shared session for multi apollo portal](https://github.com/ctripcorp/apollo/pull/3786) * [feature: add email for select user on apollo portal](https://github.com/ctripcorp/apollo/pull/3797) +* [feature: modify item comment valid size](https://github.com/ctripcorp/apollo/pull/3803) ------------------ All issues and pull requests are [here](https://github.com/ctripcorp/apollo/milestone/6?closed=1) diff --git a/apollo-portal/src/main/java/com/ctrip/framework/apollo/openapi/v1/controller/ItemController.java b/apollo-portal/src/main/java/com/ctrip/framework/apollo/openapi/v1/controller/ItemController.java index 7962b297c5c..b2ead890db4 100644 --- a/apollo-portal/src/main/java/com/ctrip/framework/apollo/openapi/v1/controller/ItemController.java +++ b/apollo-portal/src/main/java/com/ctrip/framework/apollo/openapi/v1/controller/ItemController.java @@ -76,8 +76,8 @@ public OpenItemDTO createItem(@PathVariable String appId, @PathVariable String e throw new BadRequestException("User " + item.getDataChangeCreatedBy() + " doesn't exist!"); } - if(!StringUtils.isEmpty(item.getComment()) && item.getComment().length() > 64){ - throw new BadRequestException("Comment length should not exceed 64 characters"); + if(!StringUtils.isEmpty(item.getComment()) && item.getComment().length() > 256){ + throw new BadRequestException("Comment length should not exceed 256 characters"); } ItemDTO toCreate = OpenApiBeanUtils.transformToItemDTO(item); @@ -113,8 +113,8 @@ public void updateItem(@PathVariable String appId, @PathVariable String env, throw new BadRequestException("user(dataChangeLastModifiedBy) not exists"); } - if(!StringUtils.isEmpty(item.getComment()) && item.getComment().length() > 64){ - throw new BadRequestException("Comment length should not exceed 64 characters"); + if(!StringUtils.isEmpty(item.getComment()) && item.getComment().length() > 256){ + throw new BadRequestException("Comment length should not exceed 256 characters"); } try { diff --git a/apollo-portal/src/main/resources/static/i18n/en.json b/apollo-portal/src/main/resources/static/i18n/en.json index fa04ea39e45..ed77dd1b5a6 100644 --- a/apollo-portal/src/main/resources/static/i18n/en.json +++ b/apollo-portal/src/main/resources/static/i18n/en.json @@ -724,10 +724,10 @@ "Valdr.AppNamespace.Comment.Size": "Comment length should not exceed 64 characters", "Valdr.Item.Key.Size": "Key cannot be longer than 128 characters", "Valdr.Item.Key.Required": "Key can't be empty", - "Valdr.Item.Comment.Size": "Comment length should not exceed 64 characters", + "Valdr.Item.Comment.Size": "Comment length should not exceed 256 characters", "Valdr.Release.ReleaseName.Size": "Release Name cannot be longer than 64 characters", "Valdr.Release.ReleaseName.Required": "Release Name cannot be empty", - "Valdr.Release.Comment.Size": "Comment length should not exceed 64 characters", + "Valdr.Release.Comment.Size": "Comment length should not exceed 256 characters", "ApolloConfirmDialog.DefaultConfirmBtnName": "OK", "ApolloConfirmDialog.SearchPlaceHolder": "Search items (App Id, App Name)", "RulesModal.ChooseInstances": "Select from the list of instances", diff --git a/apollo-portal/src/main/resources/static/i18n/zh-CN.json b/apollo-portal/src/main/resources/static/i18n/zh-CN.json index f2f6036bf65..cde65526268 100644 --- a/apollo-portal/src/main/resources/static/i18n/zh-CN.json +++ b/apollo-portal/src/main/resources/static/i18n/zh-CN.json @@ -724,10 +724,10 @@ "Valdr.AppNamespace.Comment.Size": "备注长度不能多于64个字符", "Valdr.Item.Key.Size": "Key长度不能多于128个字符", "Valdr.Item.Key.Required": "Key不能为空", - "Valdr.Item.Comment.Size": "备注长度不能多于64个字符", + "Valdr.Item.Comment.Size": "备注长度不能多于256个字符", "Valdr.Release.ReleaseName.Size": "Release Name长度不能多于64个字符", "Valdr.Release.ReleaseName.Required": "Release Name不能为空", - "Valdr.Release.Comment.Size": "备注长度不能多于64个字符", + "Valdr.Release.Comment.Size": "备注长度不能多于256个字符", "ApolloConfirmDialog.DefaultConfirmBtnName": "确认", "ApolloConfirmDialog.SearchPlaceHolder": "搜索项目(AppId、项目名)", "RulesModal.ChooseInstances": "从实例列表中选择", diff --git a/apollo-portal/src/main/resources/static/scripts/valdr.js b/apollo-portal/src/main/resources/static/scripts/valdr.js index 1c9d3358e0b..0540ebbdf38 100644 --- a/apollo-portal/src/main/resources/static/scripts/valdr.js +++ b/apollo-portal/src/main/resources/static/scripts/valdr.js @@ -94,7 +94,7 @@ application_module.config(function (valdrProvider) { }, 'comment': { 'size': { - 'max': 64, + 'max': 256, 'message': 'Valdr.Item.Comment.Size' } } @@ -111,7 +111,7 @@ application_module.config(function (valdrProvider) { }, 'comment': { 'size': { - 'max': 64, + 'max': 256, 'message': 'Valdr.Release.Comment.Size' } } diff --git a/docs/zh/usage/apollo-open-api-platform.md b/docs/zh/usage/apollo-open-api-platform.md index 8e1165efe88..14733554c8f 100644 --- a/docs/zh/usage/apollo-open-api-platform.md +++ b/docs/zh/usage/apollo-open-api-platform.md @@ -379,7 +379,7 @@ Apollo在生产环境(PRO)有限制规则:每次发布只能有一个人 ---- | --- | --- | --- key | true | String | 配置的key,长度不能超过128个字符。非properties格式,key固定为`content` value | true | String | 配置的value,长度不能超过20000个字符,非properties格式,value为文件全部内容 -comment | false | String | 配置的备注,长度不能超过1024个字符 +comment | false | String | 配置的备注,长度不能超过256个字符 dataChangeCreatedBy | true | String | item的创建人,格式为域账号,也就是sso系统的User ID * **Request body sample** : @@ -424,7 +424,7 @@ createIfNotExists | false | Boolean | 当配置不存在时是否自动创建 ---- | --- | --- | --- key | true | String | 配置的key,需和url中的key值一致。非properties格式,key固定为`content` value | true | String | 配置的value,长度不能超过20000个字符,非properties格式,value为文件全部内容 -comment | false | String | 配置的备注,长度不能超过1024个字符 +comment | false | String | 配置的备注,长度不能超过256个字符 dataChangeLastModifiedBy | true | String | item的修改人,格式为域账号,也就是sso系统的User ID dataChangeCreatedBy | false | String | 当createIfNotExists为true时必选。item的创建人,格式为域账号,也就是sso系统的User ID