/** @jsx React.DOM */
/* global conjur, React, ReactBootstrap, _ */
(function(conjur, React, ReactBootstrap, _) {
'use strict';
var TabPane = ReactBootstrap.TabPane,
OwnedResources = conjur.views.OwnedResources,
RoleLink = conjur.views.RoleLink,
AnnotationsBox = conjur.views.AnnotationsBox,
Permissions = conjur.views.Permissions;
// we can't create custom TabPanes as components,
// because they won't be recognized by TabbedArea as tabs
// that's why we just generalize their constructors
this.Tab = {
containsOwnedItems: function() {
return (
this.props.data.owned &&
this.props.data.owned.length &&
this.props.data.owned.length > 0
);
},
ownedIds: function() {
if (this.containsOwnedItems()) {
return this.props.data.owned.map(function(ownedItem) {
return ownedItem.id;
});
}
return [];
},
ownedTab: function() {
if (this.containsOwnedItems()) {
var result = (