You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@stratos.apache.org by la...@apache.org on 2014/11/20 12:33:37 UTC
[3/7] stratos git commit: add dependancy check for deployment policy
add dependancy check for deployment policy
Project: http://git-wip-us.apache.org/repos/asf/stratos/repo
Commit: http://git-wip-us.apache.org/repos/asf/stratos/commit/93003a25
Tree: http://git-wip-us.apache.org/repos/asf/stratos/tree/93003a25
Diff: http://git-wip-us.apache.org/repos/asf/stratos/diff/93003a25
Branch: refs/heads/master
Commit: 93003a25e6f39e4854d365bfde50626698951253
Parents: c9591f9
Author: Dakshika Jayathilaka <si...@gmail.com>
Authored: Wed Nov 19 23:56:36 2014 +0530
Committer: Dakshika Jayathilaka <si...@gmail.com>
Committed: Wed Nov 19 23:56:36 2014 +0530
----------------------------------------------------------------------
.../console/configure_form.jag | 10 ++++++++++
.../console/themes/theme0/css/custom.css | 2 +-
.../console/themes/theme0/partials/configure_form.hbs | 8 +++++++-
.../console/themes/theme0/renderers/configure_form.js | 1 +
4 files changed, 19 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/stratos/blob/93003a25/components/org.apache.stratos.manager.console/console/configure_form.jag
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.manager.console/console/configure_form.jag b/components/org.apache.stratos.manager.console/console/configure_form.jag
index 6106a36..920bf40 100644
--- a/components/org.apache.stratos.manager.console/console/configure_form.jag
+++ b/components/org.apache.stratos.manager.console/console/configure_form.jag
@@ -35,6 +35,7 @@ var log = new Log("apachestratos.configure_form"),
breadcrumbPathLevelOne = 'configure',
formDataEdit = '',
isEdit = false,
+ dependancy = '',
isForm = false;
//create left menu
@@ -93,6 +94,14 @@ switch (formtype) {
case "deployments":
list_data = util.RESTCalls.getPolicyDeployment();
+
+ if(list_data == null) {
+ list_data = util.RESTCalls.getPartitions()
+ if(list_data.partition && list_data.partition.length === 0){
+ list_data = null;
+ dependancy = 'partitions';
+ }
+ }
break;
case "loadbalancer":
@@ -145,6 +154,7 @@ var caramelData = {
left_menu: leftMenu,
isForm: isForm,
isEdit: isEdit,
+ dependancy:dependancy,
formDataEdit: JSON.stringify(formDataEdit),
formTitle: formTitle,
formDataRaw: JSON.stringify(formDataRaw),
http://git-wip-us.apache.org/repos/asf/stratos/blob/93003a25/components/org.apache.stratos.manager.console/console/themes/theme0/css/custom.css
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.manager.console/console/themes/theme0/css/custom.css b/components/org.apache.stratos.manager.console/console/themes/theme0/css/custom.css
index 349abe3..1fb731f 100644
--- a/components/org.apache.stratos.manager.console/console/themes/theme0/css/custom.css
+++ b/components/org.apache.stratos.manager.console/console/themes/theme0/css/custom.css
@@ -152,7 +152,7 @@ body{ background: url('../images/stratos_background.png') no-repeat; background
.form-error{color: red;margin-bottom: .5em;}
.no-item{margin-bottom: 5em;}
-.no-item h2{margin-bottom: 2em;}
+.no-item h2, .no-item h3{margin-bottom: 2em;}
h2.truncate {
width: 11em;
http://git-wip-us.apache.org/repos/asf/stratos/blob/93003a25/components/org.apache.stratos.manager.console/console/themes/theme0/partials/configure_form.hbs
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.manager.console/console/themes/theme0/partials/configure_form.hbs b/components/org.apache.stratos.manager.console/console/themes/theme0/partials/configure_form.hbs
index 701998b..0fb8ee5 100644
--- a/components/org.apache.stratos.manager.console/console/themes/theme0/partials/configure_form.hbs
+++ b/components/org.apache.stratos.manager.console/console/themes/theme0/partials/configure_form.hbs
@@ -79,7 +79,13 @@
<div class="row no-item row-overide">
<div class="row title">
<h2>No {{formTitle}} found..</h2>
- <a type="button" class="btn btn-primary btn-lg" href="new/">Add New {{formTitle}}</a>
+ {{#if dependancy}}
+ <h3>You need to add <i>{{dependancy}}</i> before {{formTitle}}</h3>
+ <a type="button" class="btn btn-primary btn-lg" href="../{{dependancy}}/new/">Add New {{dependancy}}</a>
+ {{else}}
+ <a type="button" class="btn btn-primary btn-lg" href="new/">Add New {{formTitle}}</a>
+ {{/if}}
+
</div>
</div>
{{/if}}
http://git-wip-us.apache.org/repos/asf/stratos/blob/93003a25/components/org.apache.stratos.manager.console/console/themes/theme0/renderers/configure_form.js
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.manager.console/console/themes/theme0/renderers/configure_form.js b/components/org.apache.stratos.manager.console/console/themes/theme0/renderers/configure_form.js
index 085af8f..550ef4b 100644
--- a/components/org.apache.stratos.manager.console/console/themes/theme0/renderers/configure_form.js
+++ b/components/org.apache.stratos.manager.console/console/themes/theme0/renderers/configure_form.js
@@ -73,6 +73,7 @@ var render = function (theme, data, meta, require) {
formDataRaw: data.formDataRaw,
formTitle: data.formTitle,
buttonText: data.buttonText,
+ dependancy:data.dependancy,
isForm: data.isForm,
isEdit:data.isEdit,
formDataEdit:data.formDataEdit,