Skip to content

Commit 5810e80

Browse files
author
Jessica Wang
committed
Template page - make Delete Template available as long as the template is not in downloaded status.
1 parent 08abc59 commit 5810e80

1 file changed

Lines changed: 13 additions & 3 deletions

File tree

‎ui/scripts/cloud.core.template.js‎

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -345,16 +345,26 @@ function templateJsonToDetailsTab() {
345345
noAvailableActions = false;
346346
}
347347

348-
// "Download Template", "Delete Template"
348+
// "Download Template"
349349
if (((isUser() && jsonObj.ispublic == true && !(jsonObj.domainid == g_domainid && jsonObj.account == g_account)))
350350
|| (jsonObj.isready == false) || jsonObj.templatetype == "SYSTEM") {
351351
//do nothing
352352
}
353353
else {
354-
buildActionLinkForTab("Download Template", templateActionMap, $actionMenu, $midmenuItem1, $thisTab);
355-
buildActionLinkForTab("Delete Template", templateActionMap, $actionMenu, $midmenuItem1, $thisTab);
354+
buildActionLinkForTab("Download Template", templateActionMap, $actionMenu, $midmenuItem1, $thisTab);
356355
noAvailableActions = false;
357356
}
357+
358+
// "Delete Template"
359+
if (((isUser() && jsonObj.ispublic == true && !(jsonObj.domainid == g_domainid && jsonObj.account == g_account)))
360+
|| (jsonObj.isready == false && jsonObj.status != null && jsonObj.status.indexOf("Downloaded") != -1)
361+
|| jsonObj.templatetype == "SYSTEM") {
362+
//do nothing
363+
}
364+
else {
365+
buildActionLinkForTab("Delete Template", templateActionMap, $actionMenu, $midmenuItem1, $thisTab);
366+
noAvailableActions = false;
367+
}
358368

359369
// no available actions
360370
if(noAvailableActions == true) {

0 commit comments

Comments
 (0)