Skip to content

Commit 1fb702b

Browse files
author
OpenShift Bot
authored
Merge pull request #984 from jhadvig/overview_redirect
Merged by openshift-bot
2 parents d914386 + f4b83e2 commit 1fb702b

File tree

6 files changed

+18
-8
lines changed

6 files changed

+18
-8
lines changed

app/scripts/directives/fromFile.js

+6-1
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,12 @@ angular.module("openshiftConsole")
158158
openTemplateProcessModal();
159159
// Else if any resources already exist
160160
} else if (!_.isEmpty($scope.updateResources)) {
161-
confirmReplace();
161+
$scope.updateTemplate = $scope.updateResources.length === 1 && $scope.updateResources[0].kind === "Template";
162+
if ($scope.updateTemplate) {
163+
openTemplateProcessModal();
164+
} else {
165+
confirmReplace();
166+
}
162167
} else {
163168
QuotaService.getLatestQuotaAlerts($scope.createResources, $scope.context).then(showWarningsOrCreate);
164169
}

app/styles/_core.less

+4
Original file line numberDiff line numberDiff line change
@@ -900,6 +900,10 @@ a.disabled-link {
900900
p {
901901
font-size: @font-size-large + 1;
902902
}
903+
.help-block {
904+
margin-top: 0px;
905+
margin-bottom: 10px;
906+
}
903907
}
904908

905909
// Disable numeric highlighting in YAML and Dockerfile modes because of bugs

app/views/modals/process-template.html

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<div class="modal-resource-action">
22
<div class="modal-body">
3-
<h1>Add Template</h1>
3+
<h1>{{updateTemplate ? "Update" : "Add"}} Template</h1>
44
<p>What would you like to do?</p>
55

66
<div>
@@ -13,9 +13,9 @@ <h1>Add Template</h1>
1313
<div>
1414
<label>
1515
<input type="checkbox" ng-model="templateOptions.add"/>
16-
<strong>Save template</strong>
16+
<strong>{{updateTemplate ? "Update" : "Save"}} template</strong>
1717
</label>
18-
<span id="helpBlock" class="help-block">Save the template to the project. This will make the template available to anyone who can view the project.</span>
18+
<span id="helpBlock" class="help-block">{{updateTemplate ? "This will overwrite the current version of the template." : "Save the template to the project. This will make the template available to anyone who can view the project."}}</span>
1919
</div>
2020
</div>
2121
<div class="modal-footer">

dist/scripts/scripts.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -9426,7 +9426,7 @@ var c = [];
94269426
l.errorOccured = !1, _.forEach(l.resourceList, function(a) {
94279427
return m(a) ? void c.push(r(a)) :(l.errorOccured = !0, !1);
94289428
}), a.all(c).then(function() {
9429-
l.errorOccured || (1 === l.createResources.length && "Template" === l.resourceList[0].kind ? n() :_.isEmpty(l.updateResources) ? k.getLatestQuotaAlerts(l.createResources, l.context).then(B) :o());
9429+
l.errorOccured || (1 === l.createResources.length && "Template" === l.resourceList[0].kind ? n() :_.isEmpty(l.updateResources) ? k.getLatestQuotaAlerts(l.createResources, l.context).then(B) :(l.updateTemplate = 1 === l.updateResources.length && "Template" === l.updateResources[0].kind, l.updateTemplate ? n() :o()));
94309430
});
94319431
}
94329432
};

dist/scripts/templates.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -9790,7 +9790,7 @@ angular.module('openshiftConsoleTemplates', []).run(['$templateCache', function(
97909790
$templateCache.put('views/modals/process-template.html',
97919791
"<div class=\"modal-resource-action\">\n" +
97929792
"<div class=\"modal-body\">\n" +
9793-
"<h1>Add Template</h1>\n" +
9793+
"<h1>{{updateTemplate ? \"Update\" : \"Add\"}} Template</h1>\n" +
97949794
"<p>What would you like to do?</p>\n" +
97959795
"<div>\n" +
97969796
"<label>\n" +
@@ -9802,9 +9802,9 @@ angular.module('openshiftConsoleTemplates', []).run(['$templateCache', function(
98029802
"<div>\n" +
98039803
"<label>\n" +
98049804
"<input type=\"checkbox\" ng-model=\"templateOptions.add\"/>\n" +
9805-
"<strong>Save template</strong>\n" +
9805+
"<strong>{{updateTemplate ? \"Update\" : \"Save\"}} template</strong>\n" +
98069806
"</label>\n" +
9807-
"<span id=\"helpBlock\" class=\"help-block\">Save the template to the project. This will make the template available to anyone who can view the project.</span>\n" +
9807+
"<span id=\"helpBlock\" class=\"help-block\">{{updateTemplate ? \"This will overwrite the current version of the template.\" : \"Save the template to the project. This will make the template available to anyone who can view the project.\"}}</span>\n" +
98089808
"</div>\n" +
98099809
"</div>\n" +
98109810
"<div class=\"modal-footer\">\n" +

dist/styles/main.css

+1
Original file line numberDiff line numberDiff line change
@@ -3931,6 +3931,7 @@ a.disabled-link:active,a.disabled-link:focus,a.disabled-link:hover{color:#bbb;te
39313931
.modal-resource-action{background-color:#f1f1f1}
39323932
.modal-resource-action h1{font-size:21px;font-weight:500;margin-bottom:20px;word-wrap:break-word;word-break:break-word;overflow-wrap:break-word;min-width:0}
39333933
.modal-resource-action p{font-size:16px}
3934+
.modal-resource-action .help-block{margin-top:0px;margin-bottom:10px}
39343935
.ace_editor.dockerfile-mode .ace_constant.ace_numeric,.editor.yaml-mode .ace_constant.ace_numeric{color:inherit}
39353936
.edit-yaml h1{line-height:1.3}
39363937
.edit-yaml .editor{line-height:1.5;width:100%;min-height:140px;height:50vh}

0 commit comments

Comments
 (0)