@@ -9656,7 +9656,9 @@ d.clear(), p.$on("no-projects-cannot-create", function() {
9656
9656
p.noProjectsCantCreate = !0;
9657
9657
}), p.input = {
9658
9658
selectedProject: p.project
9659
- }, p.aceLoaded = function(e) {
9659
+ }, p.$watch("input.selectedProject.metadata.name", function() {
9660
+ p.projectNameTaken = !1;
9661
+ }), p.aceLoaded = function(e) {
9660
9662
(P = e.getSession()).setOption("tabSize", 2), P.setOption("useSoftTabs", !0), e.setDragDelay = 0, e.$blockScrolling = 1 / 0;
9661
9663
};
9662
9664
var I = function(e) {
@@ -9710,10 +9712,10 @@ namespace: p.input.selectedProject.metadata.name
9710
9712
}).then(N) : (p.updateTemplate = 1 === p.updateResources.length && "Template" === p.updateResources[0].kind, p.updateTemplate ? v() : h()));
9711
9713
});
9712
9714
}, function(e) {
9713
- c.addNotification({
9715
+ "AlreadyExists" === e.data.reason ? p.projectNameTaken = !0 : c.addNotification({
9714
9716
id: "import-create-project-error",
9715
9717
type: "error",
9716
- message: "An error occurred creating project",
9718
+ message: "An error occurred creating project. ",
9717
9719
details: R(e)
9718
9720
});
9719
9721
});
@@ -13039,7 +13041,9 @@ value: v.template.metadata.name
13039
13041
}
13040
13042
var g, v = this, h = e("displayName"), y = e("humanize");
13041
13043
v.noProjectsCantCreate = !1, v.$onInit = function() {
13042
- v.labels = [], v.template = angular.copy(v.template), v.templateDisplayName = h(v.template), v.selectedProject = v.project, n.$on("no-projects-cannot-create", function() {
13044
+ v.labels = [], v.template = angular.copy(v.template), v.templateDisplayName = h(v.template), v.selectedProject = v.project, n.$watch("$ctrl.selectedProject.metadata.name", function() {
13045
+ v.projectNameTaken = !1;
13046
+ }), n.$on("no-projects-cannot-create", function() {
13043
13047
v.noProjectsCantCreate = !0;
13044
13048
}), f();
13045
13049
};
@@ -13127,14 +13131,15 @@ details: t
13127
13131
});
13128
13132
});
13129
13133
}, function(e) {
13130
- v.disableInputs = !1;
13134
+ if ( v.disableInputs = !1, "AlreadyExists" === e.data.reason) v.projectNameTaken = !0; else {
13131
13135
var t;
13132
13136
e.data && e.data.message && (t = e.data.message), i.addNotification({
13133
13137
id: "process-template-error",
13134
13138
type: "error",
13135
13139
message: "An error occurred creating the project.",
13136
13140
details: t
13137
13141
});
13142
+ }
13138
13143
});
13139
13144
}, v.cancel = function() {
13140
13145
k(), o.toProjectOverview(v.project.metadata.name);
@@ -13978,7 +13983,11 @@ isDialog: "="
13978
13983
},
13979
13984
templateUrl: "views/directives/deploy-image.html",
13980
13985
controller: [ "$scope", function(e) {
13981
- e.forms = {}, e.noProjectsCantCreate = !1;
13986
+ e.forms = {}, e.noProjectsCantCreate = !1, e.input = {
13987
+ selectedProject: e.project
13988
+ }, e.$watch("input.selectedProject.metadata.name", function() {
13989
+ e.projectNameTaken = !1;
13990
+ });
13982
13991
} ],
13983
13992
link: function(n) {
13984
13993
function m() {
@@ -13994,9 +14003,7 @@ env: p.compactEntries(n.env),
13994
14003
labels: e
13995
14004
});
13996
14005
}
13997
- n.input = {
13998
- selectedProject: n.project
13999
- }, n.mode = "istag", n.istag = {}, n.app = {}, n.env = [], n.labels = [ {
14006
+ n.mode = "istag", n.istag = {}, n.app = {}, n.env = [], n.labels = [ {
14000
14007
name: "app",
14001
14008
value: ""
14002
14009
} ], n.$on("no-projects-cannot-create", function() {
@@ -14160,12 +14167,12 @@ return n.nameTaken = e.nameTaken, a;
14160
14167
};
14161
14168
t.then(o, o).then(E, E);
14162
14169
}, function(e) {
14163
- c.addNotification({
14170
+ n.disableInputs = !1, "AlreadyExists" === e.data.reason ? n.projectNameTaken = !0 : c.addNotification({
14164
14171
id: "deploy-image-create-project-error",
14165
14172
type: "error",
14166
- message: "An error occurred creating project",
14173
+ message: "An error occurred creating project. ",
14167
14174
details: g(e)
14168
- }), n.disableInputs = !1 ;
14175
+ });
14169
14176
});
14170
14177
}, n.$on("newAppFromDeployImage", n.create), n.$on("$destroy", h);
14171
14178
}
0 commit comments