Commit b16ef121 by lepdou

Merge pull request #170 from lepdou/lepdou_master

bugfix release name
parents cfe37bed cb602922
......@@ -67,6 +67,7 @@ public class ReleaseService {
release.setReleaseKey(ReleaseKeyGenerator.generateReleaseKey(namespace));
release.setDataChangeCreatedTime(new Date());
release.setDataChangeCreatedBy(owner);
release.setDataChangeLastModifiedBy(owner);
release.setName(name);
release.setComment(comment);
release.setAppId(namespace.getAppId());
......
......@@ -12,12 +12,11 @@ public class NamespaceTextModel implements Verifiable {
private String namespaceName;
private int namespaceId;
private String configText;
private String modifyBy;
private String comment;
@Override
public boolean isInvalid(){
return StringUtils.isContainEmpty(appId, env, clusterName, namespaceName, configText, modifyBy) || namespaceId <= 0;
return StringUtils.isContainEmpty(appId, env, clusterName, namespaceName, configText) || namespaceId <= 0;
}
public String getAppId() {
return appId;
......@@ -67,14 +66,6 @@ public class NamespaceTextModel implements Verifiable {
this.configText = configText;
}
public String getModifyBy() {
return modifyBy;
}
public void setModifyBy(String modifyBy) {
this.modifyBy = modifyBy;
}
public String getComment() {
return comment;
}
......
......@@ -17,4 +17,4 @@ ctrip:
apollo:
portal:
env: dev
env: dev,fat
......@@ -159,7 +159,7 @@ application_module.controller("AppConfigController",
$scope.commitChange = function () {
ConfigService.modify_items($scope.pageContext.appId, $scope.pageContext.env, $scope.pageContext.clusterName,
$scope.draft.namespace.namespaceName, $scope.draft.text,
$scope.draft.namespace.id, $scope.commitComment, currentUser).then(
$scope.draft.namespace.id, $scope.commitComment).then(
function (result) {
toastr.success("更新成功");
//refresh all namespace items
......@@ -205,10 +205,11 @@ application_module.controller("AppConfigController",
releaseNamespace = namespace;
};
$scope.releaseComment = '';
$scope.releaseTitle = '';
$scope.release = function () {
ConfigService.release($scope.pageContext.appId, $scope.pageContext.env,
$scope.pageContext.clusterName,
releaseNamespace.namespace.namespaceName, currentUser,
releaseNamespace.namespace.namespaceName, $scope.releaseTitle,
$scope.releaseComment).then(
function (result) {
toastr.success("发布成功");
......
......@@ -72,7 +72,9 @@ sync_item_module.controller("SyncItemController",
$scope.syncItems = function () {
ConfigService.sync_items($scope.pageContext.namespaceName, parseSyncSourceData()).then(function (result) {
$scope.syncItemStep += 1;
$scope.syncSuccess = true;
}, function (result) {
$scope.syncSuccess = false;
toastr.error(AppUtil.errorMsg(result));
});
};
......
......@@ -59,7 +59,7 @@ appService.service("ConfigService", ['$resource', '$q', function ($resource, $q)
return d.promise;
},
modify_items: function (appId, env, clusterName, namespaceName, configText, namespaceId, comment, modifyBy) {
modify_items: function (appId, env, clusterName, namespaceName, configText, namespaceId, comment) {
var d = $q.defer();
config_source.modify_items({
appId: appId,
......@@ -70,8 +70,7 @@ appService.service("ConfigService", ['$resource', '$q', function ($resource, $q)
{
configText: configText,
namespaceId: namespaceId,
comment:comment,
modifyBy: modifyBy
comment:comment
}, function (result) {
d.resolve(result);
......
......@@ -334,12 +334,13 @@
<h4 class="modal-title">发布</h4>
</div>
<div class="modal-body">
<textarea rows="4" class="form-control" style="width:570px;" ng-model="releaseComment"
<input type="text" class="form-control" placeholder="input release title" ng-model="releaseTitle" required="required">
<textarea rows="4" class="form-control" style="margin-top: 15px;" ng-model="releaseComment"
placeholder="input release log...."></textarea>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
<button type="button" class="btn btn-primary" data-dismiss="modal" ng-click="release()">提交
<button type="submit" class="btn btn-primary" data-dismiss="modal" ng-click="release()">提交
</button>
</div>
</div>
......
......@@ -162,9 +162,13 @@
<!--step 3-->
<div class="row text-center" ng-show="syncItemStep == 3">
<div class="row text-center" ng-show="syncItemStep == 3 && syncSuccess">
<img src="../img/sync-succ.png" style="height: 100px; width: 100px">
<h3>同步成功!</h3>
<h3 >同步成功!</h3>
</div>
<div class="row text-center" ng-show="syncItemStep == 3 && !syncSuccess">
<img src="../img/sync-error.png" style="height: 100px; width: 100px">
<h3 >同步失败!</h3>
</div>
</div>
......
......@@ -100,7 +100,6 @@ public class ConfigServiceTest {
NamespaceTextModel model = new NamespaceTextModel();
model.setEnv("DEV");
model.setModifyBy("ll");
model.setNamespaceName(namespaceName);
model.setClusterName(clusterName);
model.setAppId(appId);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment