Skip to content

Commit cb874ef

Browse files
committed
UI fixes for release.
1 parent 2624cb8 commit cb874ef

File tree

6 files changed

+375
-216
lines changed

6 files changed

+375
-216
lines changed

DataOperator-UI/css/main.css

Lines changed: 82 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -238,13 +238,13 @@
238238
}
239239

240240
.serviceRoleLogo {
241-
width: 5em;
242-
float: right;
241+
/*width: 40%;*/
242+
width: 4em;
243243
vertical-align: middle;
244244
}
245245

246246
.dataFlowLogo {
247-
width: 5em;
247+
width: 4em;
248248
float: right;
249249
vertical-align: middle;
250250
}
@@ -255,6 +255,15 @@
255255
color: #17B190;
256256
}
257257

258+
.headerColor {
259+
color: #17b190;
260+
}
261+
262+
.serviCeonnectionHeaderName {
263+
vertical-align: middle;
264+
color: #17B190;
265+
}
266+
258267
.noCompatibleServicesInfoText {
259268
color: #17B190;
260269
text-align: center;
@@ -471,6 +480,7 @@
471480

472481
.serviceNameOnConsentTitleArea {
473482
font-size: 2em;
483+
color: #676a6c;
474484
}
475485

476486
.consentDetailsArea {
@@ -585,6 +595,26 @@ p{
585595
padding-right: 3em;
586596
}
587597

598+
.marginFromBottom-1 {
599+
margin-bottom:1em;
600+
}
601+
602+
.marginFromBottom-2 {
603+
margin-bottom:2em;
604+
}
605+
606+
.marginFromBottom-3 {
607+
margin-bottom:3em;
608+
}
609+
610+
.marginFromBottom-4 {
611+
margin-bottom:4em;
612+
}
613+
614+
.marginFromBottom-5 {
615+
margin-bottom:5em;
616+
}
617+
588618
.marginFromTop-1 {
589619
margin-top:1em;
590620
}
@@ -593,6 +623,14 @@ p{
593623
margin-top:2em;
594624
}
595625

626+
.marginFromTop-3 {
627+
margin-top:3em;
628+
}
629+
630+
.marginFromTop-4 {
631+
margin-top:4em;
632+
}
633+
596634
.marginFromTop-5 {
597635
margin-top:5em;
598636
}
@@ -618,3 +656,44 @@ p{
618656
vertical-align: middle;
619657
float: none;
620658
}
659+
660+
661+
.opacity-01 {
662+
opacity: 0.1;
663+
}
664+
665+
.opacity-02 {
666+
opacity: 0.3;
667+
}
668+
669+
.opacity-03 {
670+
opacity: 0.3;
671+
}
672+
673+
.opacity-04 {
674+
opacity: 0.4;
675+
}
676+
677+
.opacity-05 {
678+
opacity: 0.5;
679+
}
680+
681+
.opacity-06 {
682+
opacity: 0.6;
683+
}
684+
685+
.opacity-07 {
686+
opacity: 0.7;
687+
}
688+
689+
.opacity-08 {
690+
opacity: 0.8;
691+
}
692+
693+
.opacity-09 {
694+
opacity: 0.9;
695+
}
696+
697+
.opacity-10 {
698+
opacity: 1.0;
699+
}

DataOperator-UI/js/controllers.js

Lines changed: 61 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,7 @@ function fakeAPI_MyServices () {
125125

126126
function MyServiceCtrl ($scope, $http) {
127127
this.title = 'My Service';
128+
$scope.noServices = true;
128129

129130
$scope.returnObjLength = function (obj) {
130131
var t = Object.keys(obj)
@@ -146,11 +147,18 @@ function MyServiceCtrl ($scope, $http) {
146147
}
147148
$http.defaults.headers.common.Authorization = "Basic " +_base64.encode('testuser' + ":" + 'Hello');
148149
$http.get("http://127.0.0.1:8080/ui/myServices?categories=&current=0&count=15").success(function(data) {
149-
console.log(data)
150-
$scope.data = data
150+
console.log("Count of Services: " + $scope.returnObjLength(data));
151+
console.log(data);
152+
$scope.data = data;
153+
154+
if($scope.returnObjLength(data) != 0) {
155+
// There is services to show --> Hide notification
156+
$scope.noServices = false;
157+
}
158+
151159
})
152160
.error(function(data) {
153-
console.log(data)
161+
console.log(data);
154162
//$scope.data = fakeAPI_MyServices()
155163
});
156164
}
@@ -711,8 +719,11 @@ function MyServiceDetailCtrl ($scope, $http, $stateParams, $state, $modal) {
711719

712720
function getServicesWithConsentDetails (data) {
713721

714-
$scope.potentialDataSinkWithoutContract = []
715-
$scope.potentialDataSourceWithoutContract = []
722+
$scope.potentialDataSinkWithoutContract = [];
723+
$scope.potentialDataSourceWithoutContract = [];
724+
725+
$scope.noSinkServicesWithoutContract = true;
726+
$scope.noSourceServicesWithoutContract = true;
716727

717728
Object.keys(data.potentialServicesWithoutContract).forEach(function(id) {
718729
var obj = data.potentialServicesWithoutContract[id]
@@ -721,10 +732,12 @@ function MyServiceDetailCtrl ($scope, $http, $stateParams, $state, $modal) {
721732
success(function(data, status, headers, config) {
722733
data['serviceID'] = id
723734
if (obj.role === 'Sink' || obj.role === 'Both') {
724-
$scope.potentialDataSinkWithoutContract.push(data[id])
735+
$scope.potentialDataSinkWithoutContract.push(data[id]);
736+
$scope.noSinkServicesWithoutContract = false;
725737
}
726738
if (obj.role === 'Source' || obj.role === 'Both') {
727-
$scope.potentialDataSourceWithoutContract.push(data[id])
739+
$scope.potentialDataSourceWithoutContract.push(data[id]);
740+
$scope.noSourceServicesWithoutContract = false;
728741
}
729742

730743
}).
@@ -742,8 +755,11 @@ function MyServiceDetailCtrl ($scope, $http, $stateParams, $state, $modal) {
742755

743756
});
744757

745-
$scope.potentialDataSinkWithContract = []
746-
$scope.potentialDataSourceWithContract = []
758+
$scope.potentialDataSinkWithContract = [];
759+
$scope.potentialDataSourceWithContract = [];
760+
761+
$scope.noSinkServicesWithContract = true;
762+
$scope.noSourceServicesWithContract = true;
747763

748764
Object.keys(data.potentialServicesWithContract).forEach(function(id) {
749765
var obj = data.potentialServicesWithContract[id]
@@ -756,12 +772,14 @@ function MyServiceDetailCtrl ($scope, $http, $stateParams, $state, $modal) {
756772
d['role'] = obj.role
757773
console.log()
758774
if (obj.role === 'Sink' || obj.role === 'Both') {
759-
$scope.potentialDataSinkWithContract.push(d)
775+
$scope.potentialDataSinkWithContract.push(d);
776+
$scope.noSinkServicesWithContract = false;
760777
}
761778
if (obj.role === 'Source' || obj.role === 'Both') {
762779
//FIX_FOR_DEMO: FIX THE DOT-NOTATION. CHANGE TO THE SAME STYLE SHOWING IN CONSENT DETAIL MODAL
763-
d['categories'] = reorganize(d['categories'])
764-
$scope.potentialDataSourceWithContract.push(d)
780+
d['categories'] = reorganize(d['categories']);
781+
$scope.potentialDataSourceWithContract.push(d);
782+
$scope.noSourceServicesWithContract = false;
765783
}
766784

767785
console.log("potentialDataSinkWithContract")
@@ -786,6 +804,9 @@ function MyServiceDetailCtrl ($scope, $http, $stateParams, $state, $modal) {
786804
$scope.datasinkWithConsent = []
787805
$scope.datasourceWithConsent = []
788806

807+
$scope.noSinkServicesWithoutConsent = true;
808+
$scope.noSourceServicesWithoutConsent = true;
809+
789810
Object.keys(data.servicesWithConsent).forEach(function(id) {
790811
var obj = data.servicesWithConsent[id]
791812
$http.defaults.headers.common.Authorization = "Basic " +_base64.encode('testuser' + ":" + 'Hello');
@@ -801,12 +822,14 @@ function MyServiceDetailCtrl ($scope, $http, $stateParams, $state, $modal) {
801822
d['duration'] = obj.duration
802823
d['role'] = obj.role
803824
if (obj.role === 'Sink' || obj.role === 'Both') {
804-
$scope.datasinkWithConsent.push(d)
825+
$scope.datasinkWithConsent.push(d);
826+
$scope.noSinkServicesWithoutConsent = false;
805827
}
806828
if (obj.role === 'Source' || obj.role === 'Both') {
807829
//FIX_FOR_DEMO: FIX THE DOT-NOTATION. CHANGE TO THE SAME STYLE SHOWING IN CONSENT DETAIL MODAL
808-
d['categories'] = reorganize(d['categories'])
809-
$scope.datasourceWithConsent.push(d)
830+
d['categories'] = reorganize(d['categories']);
831+
$scope.datasourceWithConsent.push(d);
832+
$scope.noSourceServicesWithoutConsent = false;
810833
}
811834
}).
812835
error(function(data, status, headers, config) {
@@ -1145,22 +1168,41 @@ function ServiceDetailCtrl ($scope, $http, $stateParams, $modal, $state) {
11451168
});
11461169
}
11471170

1148-
$scope.servicesCanAccess = []
1171+
$scope.sinkServicesCanAccess = []
1172+
$scope.sourceServicesCanAccess = []
1173+
1174+
$scope.noSinkServices = true;
1175+
$scope.noSourceServices = true;
11491176

11501177
function makeListOfserviceCanAccess(serviceDetails) {
11511178
Object.keys(serviceDetails.potentialServicesWithContract).forEach(function(id) {
1179+
var obj = serviceDetails.potentialServicesWithContract[id]
11521180
$http.defaults.headers.common.Authorization = "Basic " +_base64.encode('testuser' + ":" + 'Hello');
11531181
$http.get('http://127.0.0.1:8080/ui/services/' + id).
11541182
success(function(data, status, headers, config) {
11551183
console.log(data)
1156-
$scope.servicesCanAccess.push(data[id])
1184+
var d = data[id]
1185+
d['serviceID'] = id
1186+
1187+
//$scope.servicesCanAccess.push(d)
1188+
//$scope.servicesCanAccess.push(data[id])
1189+
1190+
if (obj.role === 'Sink' || obj.role === 'Both') {
1191+
$scope.sinkServicesCanAccess.push(data[id]);
1192+
//console.log("Length of sinkServicesCanAccess: " + $scope.sinkServicesCanAccess.length);
1193+
$scope.noSinkServices = false;
1194+
}
1195+
if (obj.role === 'Source' || obj.role === 'Both') {
1196+
$scope.sourceServicesCanAccess.push(data[id]);
1197+
//console.log("Length of sourceServicesCanAccess: " + $scope.sourceServicesCanAccess.length);
1198+
$scope.noSourceServices = false;
1199+
}
11571200
}).
11581201
error(function(data, status, headers, config) {
11591202
//$scope.servicesCanAccess.push(fakeAPI_Service(id)[id])
11601203
});
1161-
})
1204+
});
11621205
}
1163-
11641206
}
11651207

11661208
function HomeCtrl ($scope, $http) {

DataOperator-UI/views/myservices.html

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,18 @@ <h2 class="pull-left">Data Shared</h2>
4141
</div><!-- /row -->
4242
</div><!-- /ibox-content myServicesHeader -->
4343

44+
<!-- If there in no services to show -->
45+
<div class="ibox-content no-borders" ng-if="noServices">
46+
<div class="row">
47+
<div class="col-xs-12 col-sm-12 col-md-12 col-lg-12 text-center">
48+
<h1 class="headerColor">You don't have any compatible services yet.</h1><br>
49+
<a ui-sref="index.discover">
50+
<button class="btn btn-primary btn-lg">Discover</button>
51+
</a>
52+
</div>
53+
</div>
54+
</div>
55+
<!-- End of If there in no services to show -->
4456
<!-- If there is services to show -->
4557
<div class="ibox-content no-borders"
4658
ng-repeat="(serviceID, serviceDetails) in data"
@@ -139,6 +151,7 @@ <h2 class="pull-left">Data Shared</h2>
139151
</div><!-- col-xs-2 col-sm-2 -->
140152
</div><!-- /row -->
141153
</div><!-- /ibox-content no-borders -->
154+
<!-- End of If there is services to show -->
142155
</div><!-- /ibox -->
143156
</div><!-- /col-xs-12 col-sm-12 col-md-12 col-lg-12 -->
144157
</div><!-- /row -->

0 commit comments

Comments
 (0)