From d1537f765f054466377b60b5b585d192cf8e3d5f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ernest=20Ortu=C3=B1o?= Date: Sat, 7 Jul 2018 12:49:01 +0200 Subject: [PATCH 1/3] front-end prototype --- .../resources/static/v2/js/app/settings.js | 24 ++++++++++++++++- .../main/resources/templates/settings.html | 26 ++++++++++++++++++- 2 files changed, 48 insertions(+), 2 deletions(-) diff --git a/trampoline/src/main/resources/static/v2/js/app/settings.js b/trampoline/src/main/resources/static/v2/js/app/settings.js index 6062381..131e054 100644 --- a/trampoline/src/main/resources/static/v2/js/app/settings.js +++ b/trampoline/src/main/resources/static/v2/js/app/settings.js @@ -10,7 +10,7 @@ function changeSelectedClass(element) { } } -function createGroup(){ +/*function createGroup(){ idsMicroservicesGroup = []; $( ".microservice-group-form.btn-success" ).each(function( index ) { idsMicroservicesGroup.push($( this ).data("id")); @@ -34,6 +34,28 @@ function createGroup(){ } }); } +}*/ + +function createGroup(){ + idsMicroservicesGroup = []; + $( ".microservice-group-form.btn-success" ).each(function( index ) { + idsMicroservicesGroup.push($( this ).data("id")); + }); + if($("#input-groupname").val() == ''){ + $("#form-groupname").addClass("has-error"); + }else if(idsMicroservicesGroup.length<2){ + $("#form-groupname").removeClass("has-error"); + showNotification('danger', "You must select at least two microservices to register a group. Remember to register microservices first."); + }else{ + $("#title-group-definition").html($("#input-groupname").val()); + $("#table-group-definition > tbody").html(""); + + $( ".microservice-group-form.btn-success" ).each(function( index ) { + $('#table-group-definition tr:last').after(''+$( this ).data("name")+''); + }); + + $("#modal-group-definition").modal("show"); + } } function setMavenInformation(){ diff --git a/trampoline/src/main/resources/templates/settings.html b/trampoline/src/main/resources/templates/settings.html index 12bb2c2..00efb7f 100644 --- a/trampoline/src/main/resources/templates/settings.html +++ b/trampoline/src/main/resources/templates/settings.html @@ -367,7 +367,7 @@

Register Microservices Group

- +
@@ -459,6 +459,30 @@
+ +