conjur-asset-ui 1.3.0 → 1.3.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (81) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +3 -1
  3. data/.jshintrc +41 -0
  4. data/Gemfile +3 -1
  5. data/README.md +34 -0
  6. data/Rakefile +69 -1
  7. data/bower.json +93 -0
  8. data/conjur-asset-ui.gemspec +1 -1
  9. data/features/navigation_bar.feature +31 -0
  10. data/features/step_definitions/custom_step.rb +32 -0
  11. data/features/support/env.rb +38 -0
  12. data/features/support/hooks.rb +30 -0
  13. data/features/support/world.rb +17 -0
  14. data/gulpfile.js +140 -0
  15. data/lib/conjur/command/ui.rb +1 -1
  16. data/lib/conjur/webserver/server.rb +14 -9
  17. data/lib/conjur-asset-ui-version.rb +1 -1
  18. data/package.json +47 -0
  19. data/preprocessor.js +7 -0
  20. data/public/_client_libs.html +2 -15
  21. data/public/css/styles.less +170 -4
  22. data/public/index.html.erb +5 -7
  23. data/public/js/init.js +183 -97
  24. data/public/js/lib/sorted-set.no-require.js +3 -28
  25. data/public/js/models/groupRecord.js +12 -11
  26. data/public/js/models/hostRecord.js +6 -7
  27. data/public/js/models/layerRecord.js +12 -11
  28. data/public/js/models/namespace.js +2 -0
  29. data/public/js/models/policyList.js +3 -1
  30. data/public/js/models/policyRecord.js +6 -7
  31. data/public/js/models/record.js +24 -23
  32. data/public/js/models/resourceList.js +28 -10
  33. data/public/js/models/userList.js +7 -2
  34. data/public/js/models/userRecord.js +7 -8
  35. data/public/js/models/variableList.js +18 -7
  36. data/public/js/models/variableRecord.js +13 -12
  37. data/public/js/routers.js +72 -26
  38. data/public/js/views/annotations.js +38 -27
  39. data/public/js/views/audit.js +23 -17
  40. data/public/js/views/chart.js +471 -0
  41. data/public/js/views/dashboard.js +94 -58
  42. data/public/js/views/generic.js +16 -9
  43. data/public/js/views/group.js +94 -55
  44. data/public/js/views/groups.js +3 -7
  45. data/public/js/views/host.js +75 -44
  46. data/public/js/views/hosts.js +2 -6
  47. data/public/js/views/layer.js +127 -82
  48. data/public/js/views/layers.js +2 -6
  49. data/public/js/views/mixins/search.js +12 -5
  50. data/public/js/views/mixins/tabs.js +95 -55
  51. data/public/js/views/navSearch.js +16 -5
  52. data/public/js/views/owned.js +14 -8
  53. data/public/js/views/permissions.js +244 -178
  54. data/public/js/views/policies.js +2 -4
  55. data/public/js/views/policy.js +65 -38
  56. data/public/js/views/resource.js +49 -34
  57. data/public/js/views/role.js +52 -37
  58. data/public/js/views/searchResults.js +205 -138
  59. data/public/js/views/time.js +26 -13
  60. data/public/js/views/user.js +178 -55
  61. data/public/js/views/users.js +2 -7
  62. data/public/js/views/variable.js +226 -45
  63. data/public/js/views/variables.js +4 -8
  64. metadata +20 -20
  65. data/public/_client_code.html +0 -42
  66. data/public/css/bootstrap.css +0 -7
  67. data/public/fonts/glyphicons-halflings-regular.eot +0 -0
  68. data/public/fonts/glyphicons-halflings-regular.svg +0 -229
  69. data/public/fonts/glyphicons-halflings-regular.ttf +0 -0
  70. data/public/fonts/glyphicons-halflings-regular.woff +0 -0
  71. data/public/js/lib/JSXTransformer.js +0 -10862
  72. data/public/js/lib/async.js +0 -958
  73. data/public/js/lib/backbone.js +0 -2
  74. data/public/js/lib/bootstrap.js +0 -6
  75. data/public/js/lib/less.js +0 -16
  76. data/public/js/lib/moment.js +0 -7768
  77. data/public/js/lib/react-bootstrap.js +0 -5346
  78. data/public/js/lib/react-bootstrap.min.js +0 -4
  79. data/public/js/lib/underscore-min.js +0 -6
  80. data/public/js/lib/underscore.string.min.js +0 -1
  81. data/public/js/main.js +0 -57
@@ -1,40 +1,45 @@
1
1
  /** @jsx React.DOM */
2
+ /* global conjur, React, ReactBootstrap, _ */
2
3
 
3
- (function(conjur, ReactBootstrap) {
4
+ (function(conjur, React, ReactBootstrap, _) {
4
5
  'use strict';
5
6
 
6
- var TabbedArea = ReactBootstrap.TabbedArea,
7
- TabPane = ReactBootstrap.TabPane,
8
- OwnedResources = conjur.views.OwnedResources;
7
+ var TabPane = ReactBootstrap.TabPane,
8
+ OwnedResources = conjur.views.OwnedResources,
9
+ RoleLink = conjur.views.RoleLink,
10
+ AnnotationsBox = conjur.views.AnnotationsBox,
11
+ Permissions = conjur.views.Permissions;
9
12
 
10
13
  // we can't create custom TabPanes as components,
11
14
  // because they won't be recognized by TabbedArea as tabs
12
15
  // that's why we just generalize their constructors
13
- conjur.views.mixins.Tab = {
14
- lexical_sorter: function(a,b) {
15
-
16
- },
17
-
18
- contains_owned_items: function() {
19
- return (this.props.data.owned && this.props.data.owned.length && this.props.data.owned.length > 0 );
16
+ this.Tab = {
17
+ containsOwnedItems: function() {
18
+ return (
19
+ this.props.data.owned &&
20
+ this.props.data.owned.length &&
21
+ this.props.data.owned.length > 0
22
+ );
20
23
  },
21
24
 
22
- owned_ids: function() {
23
- if (this.contains_owned_items()) {
24
- return this.props.data.owned.map(function(owned_item) {
25
- return owned_item.id;
25
+ ownedIds: function() {
26
+ if (this.containsOwnedItems()) {
27
+ return this.props.data.owned.map(function(ownedItem) {
28
+ return ownedItem.id;
26
29
  });
27
30
  }
28
31
 
29
32
  return [];
30
33
  },
31
34
 
32
- owned_tab: function() {
33
- if (this.contains_owned_items()) {
34
- var result =
35
- <TabPane key="owned" tab={get_tabname("Owned resources",this.props.data.owned)}>
36
- <OwnedResources owned={this.props.data.owned} tabview={true} />
37
- </TabPane>;
35
+ ownedTab: function() {
36
+ if (this.containsOwnedItems()) {
37
+ var result = (
38
+ <TabPane key="owned"
39
+ tab={conjur.utils.getTabname('Owned resources', this.props.data.owned)}>
40
+ <OwnedResources owned={this.props.data.owned} tabview={true} />
41
+ </TabPane>
42
+ );
38
43
 
39
44
  return result;
40
45
  }
@@ -42,73 +47,108 @@
42
47
  return null;
43
48
  },
44
49
 
45
- contains_nontrivial_roles: function() {
46
- return (this.props.data.roles && this.props.data.roles.length && this.props.data.roles.length>1);
50
+ containsNontrivialRoles: function() {
51
+ return (
52
+ this.props.data.roles &&
53
+ this.props.data.roles.length &&
54
+ this.props.data.roles.length > 1
55
+ );
47
56
  },
48
57
 
49
- external_roles: function( own_id ) {
50
- if (!this.contains_nontrivial_roles()) {
58
+ externalRoles: function(ownId) {
59
+ if (!this.containsNontrivialRoles()) {
51
60
  return [];
52
61
  }
53
62
 
54
- var owned_ids = this.owned_ids();
63
+ var ownedIds = this.ownedIds();
55
64
 
56
65
  return this.props.data.roles.filter(function(roleid) {
57
66
  // do not show themself
58
- return roleid!=own_id;
67
+ return roleid !== ownId;
59
68
  }).filter(function(roleid) {
60
69
  // do not show internal roles
61
- return ! (roleid.split(':')[1]=='@') ;
70
+ return roleid.split(':')[1] !== '@';
62
71
  }).filter(function(roleid) {
63
72
  // do not show owned groups
64
- return ! _.contains(owned_ids, roleid);
73
+ return ! _.contains(ownedIds, roleid);
65
74
  });
66
75
  },
67
76
 
68
- memberships_tab: function( own_id ) {
69
- if (!this.contains_nontrivial_roles()) {
77
+ membershipsTab: function(ownId) {
78
+ if (!this.containsNontrivialRoles()) {
70
79
  return null;
71
80
  }
72
81
 
73
- var membership_links = this.external_roles(own_id)
74
- .sort( function(a,b) { return a.toLowerCase().localeCompare(b.toLowerCase());} )
75
- .map ( function(roleid) { return <li className="list-group-item list-group-item-noborder"><RoleLink id={roleid}/></li> });
76
-
77
- if (membership_links.length==0) { return null; }
82
+ var membershipLinks = this.externalRoles(ownId)
83
+ .sort(function(a, b) {
84
+ return a.toLowerCase().localeCompare(b.toLowerCase());
85
+ })
86
+ .map(function(roleid) {
87
+ return (
88
+ <li className="list-group-item list-group-item-noborder">
89
+ <RoleLink id={roleid} />
90
+ </li>
91
+ );
92
+ });
93
+
94
+ if (membershipLinks.length === 0) {
95
+ return null;
96
+ }
78
97
 
79
- var result =
80
- <TabPane key="memberships" tab={get_tabname("Explicit memberships", membership_links)}>
81
- <ul className="list-group">{membership_links}</ul>
82
- </TabPane>;
98
+ var result = (
99
+ <TabPane key="memberships"
100
+ tab={conjur.utils.getTabname('Explicit memberships', membershipLinks)}>
101
+ <ul className="list-group">
102
+ {membershipLinks}
103
+ </ul>
104
+ </TabPane>
105
+ );
83
106
 
84
107
  return result;
85
- } ,
108
+ },
86
109
 
87
- contains_annotations: function() {
88
- return (this.props.data.annotations && this.props.data.annotations.length && this.props.data.annotations.length>0);
110
+ containsAnnotations: function() {
111
+ return (
112
+ this.props.data.annotations &&
113
+ this.props.data.annotations.length &&
114
+ this.props.data.annotations.length > 0
115
+ );
89
116
  },
90
117
 
91
- annotations_tab: function() {
92
- if (!this.contains_annotations()) {
118
+ annotationsTab: function() {
119
+ if (!this.containsAnnotations()) {
93
120
  return null;
94
121
  }
95
122
 
96
- var result =
97
- <TabPane key="annotations" tab={get_tabname("Annotations",this.props.data.annotations)}>
98
- <AnnotationsBox annotations={this.props.data.annotations}/>
99
- </TabPane>;
123
+ var result = (
124
+ <TabPane key="annotations"
125
+ tab={conjur.utils.getTabname('Annotations', this.props.data.annotations)}>
126
+ <AnnotationsBox annotations={this.props.data.annotations} />
127
+ </TabPane>
128
+ );
100
129
 
101
130
  return result;
102
131
  },
103
132
 
104
- permissions_tab: function(roleid) {
105
- var result =
106
- <TabPane key="permissions" tab="Permissions held">
107
- <Permissions owned={this.props.data.owned} roles={this.props.data.roles} role={roleid} tabview={true}/>
108
- </TabPane>;
133
+ permissionsTab: function(roleid) {
134
+ var result = (
135
+ <TabPane key="permissions" tab="Permissions held">
136
+ <Permissions owned={this.props.data.owned}
137
+ roles={this.props.data.roles}
138
+ role={roleid}
139
+ tabview={true} />
140
+ </TabPane>
141
+ );
109
142
 
110
143
  return result;
111
144
  }
112
145
 
113
146
  };
114
- })(conjur, ReactBootstrap);
147
+
148
+ }).bind(conjur.views.mixins)
149
+ (
150
+ conjur,
151
+ React,
152
+ ReactBootstrap,
153
+ _
154
+ );
@@ -1,18 +1,29 @@
1
1
  /** @jsx React.DOM */
2
+ /* global conjur, React */
2
3
 
3
4
  (function(conjur, React) {
4
5
  'use strict';
5
6
 
6
- var NavSearchForm = this.NavSearchForm = React.createClass({
7
- mixins: [conjur.views.mixins.Search],
7
+ var Search = conjur.views.mixins.Search;
8
+
9
+ this.NavSearchForm = React.createClass({
10
+ mixins: [Search],
8
11
 
9
12
  render: function() {
10
13
  return (
11
- <form className="form-inline navbar-form" role="search" onSubmit={this.handleSubmit}>
14
+ <form className="form-inline navbar-form"
15
+ role="search"
16
+ onSubmit={this.handleSubmit}>
12
17
  <div className="form-group">
13
- <input ref="input" type="text" className="form-control" placeholder="Search Conjur"></input>
18
+ <input ref="input"
19
+ type="text"
20
+ className="form-control"
21
+ placeholder="Search Conjur"></input>
14
22
  </div>
15
- <button type="submit" className="btn btn-default search-button">Search</button>
23
+ <button type="submit"
24
+ className="btn btn-default search-button">
25
+ Search
26
+ </button>
16
27
  </form>
17
28
  );
18
29
  }
@@ -1,6 +1,7 @@
1
1
  /** @jsx React.DOM */
2
+ /* global conjur, React, _ */
2
3
 
3
- (function(conjur, _, React) {
4
+ (function(conjur, React, _) {
4
5
  'use strict';
5
6
 
6
7
  var knownTypes = ['user', 'group', 'layer', 'host', 'variable', 'policy'];
@@ -34,11 +35,16 @@
34
35
  return a.id.toLowerCase().localeCompare(b.id.toLowerCase());
35
36
  }).map(function(resource) {
36
37
  var kind = resource.id.split(':')[1];
38
+
37
39
  filters.push(kind);
38
40
 
39
- if ((this.state.filter === '')
40
- || (this.state.filter != 'other' && this.state.filter === kind)
41
- || (this.state.filter === 'other' && _.intersection([kind], knownTypes).length === 0)) {
41
+ if ((this.state.filter === '') ||
42
+ (this.state.filter !== 'other' && this.state.filter === kind) ||
43
+ (this.state.filter === 'other' &&
44
+ _.intersection([kind], knownTypes).length === 0)) {
45
+
46
+ var ResourceLink = conjur.views.ResourceLink;
47
+
42
48
  return (
43
49
  <li className="list-group-item list-group-item-noborder">
44
50
  <ResourceLink data={resource} />
@@ -61,7 +67,7 @@
61
67
 
62
68
  var filterSelect = '';
63
69
 
64
- if (this.props.resources.length > 9 || this.state.filter != '') {
70
+ if (this.props.resources.length > 9 || this.state.filter !== '') {
65
71
  // TODO: sort, when done with previous TODO
66
72
  filterSelect = _.intersection(_.uniq(filters, true), knownTypes).map(function(f) {
67
73
  return (
@@ -127,7 +133,7 @@
127
133
  }
128
134
  });
129
135
 
130
- var OwnedResources = this.OwnedResources = React.createClass({
136
+ this.OwnedResources = React.createClass({
131
137
  getInitialState: function() {
132
138
  return {
133
139
  expanded: false
@@ -173,6 +179,6 @@
173
179
  }).bind(conjur.views)
174
180
  (
175
181
  conjur,
176
- _,
177
- React
182
+ React,
183
+ _
178
184
  );