-
-
Notifications
You must be signed in to change notification settings - Fork 10.2k
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
add revoke item API. #2856 #2952
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a nice try, however I think we need to combine the ui part to see how we could make this function work.
apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/controller/ItemController.java
Show resolved
Hide resolved
apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/service/ItemService.java
Outdated
Show resolved
Hide resolved
感谢 @bigflybrother 提供Portal页面支持。 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Basically it works nicely. However, there are some suggestions as below, please take a look.
BTW, would you please squash the commits so that one commit from @bigflybrother and one commit from @Accelerater? Because for each pr we would only record one commit per author.
Env env = model.getEnv(); | ||
String clusterName = model.getClusterName(); | ||
String namespaceName = model.getNamespaceName(); | ||
long namespaceId = model.getNamespaceId(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please load the namespace and get the namespaceId instead of just using what's passed in since the namespaceId might not match the namespaceName
NamespaceDTO namespace = namespaceAPI.loadNamespace(appId, env, clusterName, namespaceName);
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
是的,modifyItemsByText这个也有潜在的安全风险
@@ -345,6 +347,8 @@ | |||
"Config.ClusterIsDefaultTipContent": "所有不属于 '{{name}}' 集群的实例会使用default集群(当前页面)的配置,属于 '{{name}}' 的实例会使用对应集群的配置!", | |||
"Config.ClusterIsCustomTipContent": "属于 '{{name}}' 集群的实例只会使用 '{{name}}' 集群(当前页面)的配置,只有当对应namespace在当前集群没有发布过配置时,才会使用default集群的配置。", | |||
"Config.HasNotPublishNamespace": "以下环境/集群有未发布的配置,客户端获取不到未发布的配置,请及时发布。", | |||
"Config.RevokeItem.DialogTitle": "撤销配置", | |||
"Config.RevokeItem.DialogContent": "当前命名空间下已修改但尚未未发布的配置将被撤销,确定要撤销么?", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
当前命名空间下已修改但尚未发布的配置将被撤销,确定要撤销么?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个中文提示有什么不对的地方么?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
尚未未发布
=> 尚未发布
,撤销,确定
=> 撤销,确定
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
我的 眼瞎了😖
@@ -178,6 +180,37 @@ function controller($rootScope, $scope, $translate, toastr, AppUtil, EventManage | |||
}); | |||
} | |||
|
|||
function preRevokeItem(namespace) { | |||
console.log("xxx") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please remove the debug message
ItemDTO oldItem = oldKeyMapItem.get(key); | ||
if (oldItem == null) { | ||
ItemDTO deletedItemDto = deletedItemDTOs.computeIfAbsent(key, k -> new ItemDTO()); | ||
changeSets.addCreateItem(buildNormalItem(0L,namespaceId,key,value,deletedItemDto.getComment(),lineNum.get())); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the format doesn't look right here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这里是为了获取到已删除配置的comment. 有哪里不对么..
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
code format is not right, e.g, 0L,namespaceId
=> 0L, namespaceId
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
😂okay
@@ -187,6 +187,8 @@ | |||
"Component.Namespace.Master.Items.FilterItem": "过滤配置", | |||
"Component.Namespace.Master.Items.SyncItemTips": "同步各环境间配置", | |||
"Component.Namespace.Master.Items.SyncItem": "同步配置", | |||
"Component.Namespace.Master.Items.RevokeItemTips": "撤销配置的修改", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please add the English translations to en.json
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
okay
@@ -345,6 +347,8 @@ | |||
"Config.ClusterIsDefaultTipContent": "All instances that do not belong to the '{{name}}' cluster will fetch the default cluster (current page) configuration, and those that belong to the '{{name}}' cluster will use the corresponding cluster configuration!", | |||
"Config.ClusterIsCustomTipContent": "Instances belonging to the '{{name}}' cluster will only fetch the configuration of the '{{name}}' cluster (the current page), and the default cluster configuration will only be fetched when the corresponding namespace has not been released in the current cluster.", | |||
"Config.HasNotPublishNamespace": "The following environment/cluster has unreleased configurations, the client will not fetch the unreleased configurations, please release them in time.", | |||
"Config.RevokeItem.DialogTitle": "Revoke configuration", | |||
"Config.RevokeItem.DialogContent": "Modified but unpublished configurations in the current namespace will be revoked. Are you sure to revoke the configuration?", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think Revoke.RevokeFailed
and Revoke.RevokeSuccessfully
are still missing?
@@ -185,6 +185,8 @@ | |||
"Component.Namespace.Master.Items.SummitChanged": "Submit", | |||
"Component.Namespace.Master.Items.SortByKey": "Filter the configurations by key", | |||
"Component.Namespace.Master.Items.FilterItem": "Filter", | |||
"Component.Namespace.Master.Items.RevokeItemTips": "Revoke configurations", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about Revoke configuration changes
?
@@ -345,6 +347,8 @@ | |||
"Config.ClusterIsDefaultTipContent": "All instances that do not belong to the '{{name}}' cluster will fetch the default cluster (current page) configuration, and those that belong to the '{{name}}' cluster will use the corresponding cluster configuration!", | |||
"Config.ClusterIsCustomTipContent": "Instances belonging to the '{{name}}' cluster will only fetch the configuration of the '{{name}}' cluster (the current page), and the default cluster configuration will only be fetched when the corresponding namespace has not been released in the current cluster.", | |||
"Config.HasNotPublishNamespace": "The following environment/cluster has unreleased configurations, the client will not fetch the unreleased configurations, please release them in time.", | |||
"Config.RevokeItem.DialogTitle": "Revoke configuration", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about Revoke configuration changes
?
@@ -345,6 +347,8 @@ | |||
"Config.ClusterIsDefaultTipContent": "All instances that do not belong to the '{{name}}' cluster will fetch the default cluster (current page) configuration, and those that belong to the '{{name}}' cluster will use the corresponding cluster configuration!", | |||
"Config.ClusterIsCustomTipContent": "Instances belonging to the '{{name}}' cluster will only fetch the configuration of the '{{name}}' cluster (the current page), and the default cluster configuration will only be fetched when the corresponding namespace has not been released in the current cluster.", | |||
"Config.HasNotPublishNamespace": "The following environment/cluster has unreleased configurations, the client will not fetch the unreleased configurations, please release them in time.", | |||
"Config.RevokeItem.DialogTitle": "Revoke configuration", | |||
"Config.RevokeItem.DialogContent": "Modified but unpublished configurations in the current namespace will be revoked. Are you sure to revoke the configuration?", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about Modified but unpublished configurations in the current namespace will be revoked. Are you sure to revoke the configuration changes?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
What's the purpose of this PR
add revoke item API.
Which issue(s) this PR fixes:
Fixes #2856 #2595