Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature: modify item comment valid size(#3799) #3803

Merged
merged 4 commits into from
Jul 3, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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 {
Expand Down
4 changes: 2 additions & 2 deletions apollo-portal/src/main/resources/static/i18n/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
4 changes: 2 additions & 2 deletions apollo-portal/src/main/resources/static/i18n/zh-CN.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": "从实例列表中选择",
Expand Down
4 changes: 2 additions & 2 deletions apollo-portal/src/main/resources/static/scripts/valdr.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ application_module.config(function (valdrProvider) {
},
'comment': {
'size': {
'max': 64,
'max': 256,
'message': 'Valdr.Item.Comment.Size'
}
}
Expand All @@ -111,7 +111,7 @@ application_module.config(function (valdrProvider) {
},
'comment': {
'size': {
'max': 64,
'max': 256,
'message': 'Valdr.Release.Comment.Size'
}
}
Expand Down
4 changes: 2 additions & 2 deletions docs/zh/usage/apollo-open-api-platform.md
Original file line number Diff line number Diff line change
Expand Up @@ -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** :
Expand Down Expand Up @@ -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

Expand Down