public/js/views/owned.js in conjur-asset-ui-1.3.1 vs public/js/views/owned.js in conjur-asset-ui-1.3.2
- old
+ new
@@ -1,9 +1,8 @@
/** @jsx React.DOM */
-/* global conjur, React, _ */
-(function(conjur, React, _) {
+(function(conjur, _, React) {
'use strict';
var knownTypes = ['user', 'group', 'layer', 'host', 'variable', 'policy'];
var OwnedResourcesBox = this.OwnedResourcesBox = React.createClass({
@@ -33,20 +32,15 @@
// TODO: sort by kind with custom weights, by id, by creation date
// automatically gives sort by kind, id
return a.id.toLowerCase().localeCompare(b.id.toLowerCase());
}).map(function(resource) {
var kind = resource.id.split(':')[1];
-
filters.push(kind);
- if ((this.state.filter === '') ||
- (this.state.filter !== 'other' && this.state.filter === kind) ||
- (this.state.filter === 'other' &&
- _.intersection([kind], knownTypes).length === 0)) {
-
- var ResourceLink = conjur.views.ResourceLink;
-
+ if ((this.state.filter === '')
+ || (this.state.filter != 'other' && this.state.filter === kind)
+ || (this.state.filter === 'other' && _.intersection([kind], knownTypes).length === 0)) {
return (
<li className="list-group-item list-group-item-noborder">
<ResourceLink data={resource} />
</li>
);
@@ -65,11 +59,11 @@
);
}
var filterSelect = '';
- if (this.props.resources.length > 9 || this.state.filter !== '') {
+ if (this.props.resources.length > 9 || this.state.filter != '') {
// TODO: sort, when done with previous TODO
filterSelect = _.intersection(_.uniq(filters, true), knownTypes).map(function(f) {
return (
<option value={f}>{_.str.capitalize(conjur.utils.pluralize(f))}</option>
);
@@ -131,11 +125,11 @@
</div>
);
}
});
- this.OwnedResources = React.createClass({
+ var OwnedResources = this.OwnedResources = React.createClass({
getInitialState: function() {
return {
expanded: false
};
},
@@ -177,8 +171,8 @@
});
}).bind(conjur.views)
(
conjur,
- React,
- _
+ _,
+ React
);