Skip to content

Commit

Permalink
Added group labels in the account home page
Browse files Browse the repository at this point in the history
  • Loading branch information
rmiccoli committed Jul 16, 2021
1 parent 1bebbda commit 62fc2f5
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,16 @@ <h3 class="box-title"><strong>Groups</strong></h3>
<span ng-if="!$ctrl.isVoAdmin()">{{group.display}}</span>
</div>

<div class="iam-user-group-labels col-xs-2 col-sm-2">
<div ng-repeat="label in $ctrl.userGroupLabels[group.value]">
{{label.name}}
<style type="text/css">div.allinea { float:left; margin-left: .5em; margin-top: 10px }</style>
<div class="iam-user-group-labels col-xs-4 col-sm-4">
<div class="allinea" ng-repeat="label in $ctrl.userGroupLabels[group.value]">
<span style="background-color:#bee1f4; padding: 4px 7.2px 4px 7.2px; font-size: 12px">
<b><font color="#00659c">{{label.name}}</font></b>
</span>
</div>
</div>

<div class="iam-user-group-actions col-xs-4 col-sm-4 text-right">
<div class="iam-user-group-actions col-xs-2 col-sm-2 text-right">
<div class="btn-group">
<button class="btn btn-xs btn-danger" ng-click="$ctrl.openRemoveGroupDialog(group)" ng-if="$ctrl.isVoAdmin()">
<i class="fa fa-times"></i> Remove
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
self.$onInit = function() {
console.log('UserGroupsController onInit');
self.enabled = true;

self.userGroupLabels = {};

angular.forEach(self.user.groups, function(g){
Expand All @@ -46,11 +45,11 @@
});
};

// conoscendo l'id di un gruppo vado dal servizio e mi faccio dare le etichette
// Knowing the group id I recover its labels calling the appropriate service

self.groupLabels = function(groupId){

return scimFactory.getGroup(groupId).then(function(res){ //'then' chiamata asincrona --> non termina
return scimFactory.getGroup(groupId).then(function(res){
var r = res.data;
var labels = r['urn:indigo-dc:scim:schemas:IndigoGroup'].labels;
return labels;
Expand Down

1 comment on commit 62fc2f5

@rmiccoli
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the html file, the first row was added to horizontally align multiple div elements.
Basically an "allinea" class was created to then make the elements stand next to each other. The distance between them can be set through the value of the left and top margins.
A color to the label name and a boarder around it were added to copy the same style of the labels in the group list page.

Please sign in to comment.